webpackJsonp([19],{"/T7c":function(n,e,t){var i=t("ZAYv");"string"==typeof i&&(i=[[n.i,i,""]]),i.locals&&(n.exports=i.locals);t("rjj0")("f810380e",i,!0)},"74QC":function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,a=t("fZjL"),r=t.n(a),o=t("Xxa5"),s=t.n(o),l=t("exGp"),d=t.n(l),c=t("//Fk"),m=t.n(c),p=t("Dd8w"),h=t.n(p),u=t("bOdI"),g=t.n(u),b=t("Zrlr"),f=t.n(b),x=t("wxAW"),v=t.n(x),w=(t("hky6"),t("UVPs")),y=t("TwlK"),k=t.n(y),_=t("Lokx"),S=t.n(_),z=function(){function n(){f()(this,n),this.printWindow=null}return v()(n,[{key:"print",value:function(n){var e=this,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.width,a=t.height,r=t.marginTop,o=t.marginLeft,s=t.fontSize;this.printWindow=window.open("","_blank"),this.printWindow.document.write("\n \n \n 打印标签\n \n \n "+n+"\n \n "),this.printWindow.document.close(),setTimeout(function(){e.printWindow.focus(),e.printWindow.print(),setTimeout(function(){e.printWindow.close()},500)},500)}}]),n}(),C={name:"systemLogs",data:function(){var n;return n={printer:null,loading:!1,params:{page_no:1,page_size:20},tableData:"",searchTime:"",showLogDetail:!1,currDetailLog:{},advancedForm:{},PrintVisible:!1,codeList:[],barcodeValue:"",multipleSelection:[],scale:100},g()(n,"codeList",[]),g()(n,"PrintVisible",!1),g()(n,"printOrientation","portrait"),g()(n,"selectedSize","large"),g()(n,"sizeOptions",[{label:"45×10mm",value:"medium",width:45,height:10,marginTop:.55,marginLeft:2,fontSize:8},{label:"50×20mm",value:"large",width:50,height:20,marginTop:-5,marginLeft:2.5,fontSize:12},{label:"25×10mm",value:"small",width:25,height:10,marginTop:0,marginLeft:-1,fontSize:6}]),g()(n,"printOptions",{id:"deliverySheet",popTitle:"条码打印",preview:!1,extraCss:"\n @page {\n size: auto;\n margin: 0;\n }\n body {\n margin: 0;\n -webkit-print-color-adjust: exact;\n }\n .tips-t {\n page-break-after: always;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n box-sizing: border-box;\n padding: 1mm;\n /* 移除边框 */\n border: none !important;\n outline: none !important;\n }\n /* 移除所有可能的边框和轮廓 */\n * {\n border: none !important;\n outline: none !important;\n }\n .content-wrapper {\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n }\n .barcode-container {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 70%;\n }\n .numOrder {\n font-size: 10px;\n margin-top: 0.5mm;\n }\n /* 打印时隐藏所有边框 */\n @media print {\n * {\n border: none !important;\n outline: none !important;\n -webkit-print-color-adjust: exact;\n }\n .tips-t {\n border: none !important;\n outline: none !important;\n }\n }\n "}),g()(n,"searchForm",{goods_name:"",sku:""}),n},mounted:function(){this.GET_SystemLogs(),this.rowDrop()},created:function(){this.printer=new z},watch:g()({PrintVisible:function(n){var e=this;n&&this.$nextTick(function(){e.generateBarcodes()})},selectedSize:{handler:function(n){var e=this;this.$nextTick(function(){e.generateBarcodes()})}}},"selectedSize",{handler:function(n){var e={large:{width:"50mm",height:"20mm"},medium:{width:"45mm",height:"10mm"},small:{width:"25mm",height:"10mm"}}[n];this.printOptions.extraCss="\n @page {\n size: "+e.width+" "+e.height+";\n margin: 0;\n }\n body {\n margin: 0;\n -webkit-print-color-adjust: exact;\n }\n * {\n border: none !important;\n outline: none !important;\n }\n .tips-t {\n width: "+e.width+";\n height: "+e.height+";\n page-break-after: always;\n margin-top:-15px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n box-sizing: border-box;\n padding: 1mm;\n border: none !important;\n outline: none !important;\n }\n .content-wrapper {\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n }\n .barcode-container {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 70%;\n }\n .barcode-container svg {\n max-width: 100%;\n max-height: 100%;\n }\n .numOrder {\n font-size: 10px;\n margin-top: 0.5mm;\n }\n @media print {\n * {\n border: none !important;\n outline: none !important;\n -webkit-print-color-adjust: exact;\n }\n .tips-t {\n border: none !important;\n outline: none !important;\n }\n }\n "},immediate:!0}),methods:(i={handleSearch:function(){this.params=h()({},this.params,{name:this.searchForm.goods_name,sku:this.searchForm.sku,page_no:1}),this.GET_SystemLogs()},handleReset:function(){this.searchForm.goods_name="",this.searchForm.sku="",this.params={page_no:1,page_size:20},this.GET_SystemLogs()},generateBarcodes:function(){var n=this;return new m.a(function(e,t){try{n.$nextTick(function(){n.codeList.forEach(function(e,t){var i=n.getBarcodeOptions(),a=document.getElementById("barcode-"+t);if(a){for(;a.firstChild;)a.removeChild(a.firstChild);k()("#barcode-"+t,String(e).toUpperCase(),i)}}),e()})}catch(n){t(n)}})},getBarcodeOptions:function(){var n={large:{width:1.5,height:40},medium:{width:1.2,height:20},small:{width:1,height:15}}[this.selectedSize]||{width:1.5,height:40};return{format:"CODE128",width:n.width,height:n.height,displayValue:!1,margin:5,fontSize:"small"===this.selectedSize?8:12,textMargin:2}},handleCancle:function(){this.PrintVisible=!1},handleSelectionChange:function(n){this.multipleSelection=n},batchPrint:function(){var n=this;return d()(s.a.mark(function e(){var t;return s.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:try{t=n.multipleSelection.map(function(n){return n.sku}),n.codeList=t,n.PrintVisible=!0}catch(e){n.$message.error("批量打印失败:"+e.message)}case 1:case"end":return e.stop()}},e,n)}))()},handlePrintGoodsLend:function(){var n=this;return d()(s.a.mark(function e(){var t,i;return s.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n.selectedSize){e.next=4;break}return n.$message.warning("请先选择打印尺寸"),e.abrupt("return");case 4:if(t=n.sizeOptions.find(function(e){return e.value===n.selectedSize})){e.next=7;break}throw new Error("无效的打印尺寸");case 7:return e.next=9,n.generateBarcodes();case 9:i=n.codeList.map(function(n,e){var t=document.getElementById("barcode-"+e);if(!t)throw new Error("条形码生成失败");return'\n \n "}).join(""),n.printer.print(i,{width:t.width,height:t.height,marginTop:t.marginTop,marginLeft:t.marginLeft,fontSize:t.fontSize}),n.$message.success("打印成功"),n.PrintVisible=!1,e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),n.$message.error("打印失败:"+e.t0.message);case 18:case"end":return e.stop()}},e,n,[[0,15]])}))()}},g()(i,"handleCancle",function(){this.PrintVisible=!1,this.codeList=[]}),g()(i,"PrintIng",function(n){var e=this;return d()(s.a.mark(function t(){return s.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:try{e.barcodeValue=n.sku,e.codeList=[n.sku],e.PrintVisible=!0}catch(n){e.$message.error("打印失败:"+n.message)}case 1:case"end":return t.stop()}},t,e)}))()}),g()(i,"rowDrop",function(){var n=document.querySelector(".draggable-table .el-table__body-wrapper tbody"),e=this;S.a.create(n,{animation:300,handle:".drag-handle",onEnd:function(n){var t=n.newIndex,i=(n.oldIndex,e.tableData.data.splice(t,1)[0]);e.tableData.data.splice(t,0,i),e.updateList(i.id,t)}})}),g()(i,"updateList",function(n,e){var t=this,i=[{position:"own",product_id:this.tableData.data[e].id,sort:this.tableData.data[e].sort}];e>0&&i.push({position:"before",product_id:this.tableData.data[e-1].id,sort:this.tableData.data[e-1].sort}),e