webpackJsonp([19],{"/6Wv":function(e,n,t){var i=t("KvT9");"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);t("rjj0")("f0b1ab38",i,!0)},"74QC":function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,a,r=t("fZjL"),o=t.n(r),s=t("Xxa5"),l=t.n(s),c=t("exGp"),d=t.n(c),m=t("//Fk"),p=t.n(m),h=t("Dd8w"),u=t.n(h),b=t("bOdI"),g=t.n(b),f=t("Zrlr"),v=t.n(f),x=t("wxAW"),w=t.n(x),y=(t("hky6"),t("UVPs")),k=t("TwlK"),_=t.n(k),S=t("Lokx"),C=t.n(S),z=t("MJLE"),L=t.n(z),q=function(){function e(){v()(this,e),this.printWindow=null}return w()(e,[{key:"print",value:function(e){var n=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 "+e+"\n \n "),this.printWindow.document.close(),setTimeout(function(){n.printWindow.focus(),n.printWindow.print(),setTimeout(function(){n.printWindow.close()},500)},500)}}]),e}(),T={name:"systemLogs",data:function(){var e;return e={printer:null,loading:!1,params:{page_no:1,page_size:20},tableData:"",searchTime:"",showLogDetail:!1,currDetailLog:{},advancedForm:{},codeList:[],barcodeValue:"",multipleSelection:[],scale:100},g()(e,"codeList",[]),g()(e,"PrintVisible",!1),g()(e,"printOrientation","portrait"),g()(e,"selectedSize","large"),g()(e,"sizeOptions",[{label:"45×10mm",value:"medium",width:45,height:12,marginTop:0,marginLeft:2,fontSize:7},{label:"50×20mm",value:"large",width:50,height:20,marginTop:0,marginLeft:2.5,fontSize:12},{label:"25×10mm",value:"small",width:25,height:10,marginTop:0,marginLeft:0,fontSize:6}]),g()(e,"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()(e,"searchForm",{goods_name:"",sku:""}),g()(e,"qrCodeVisible",!1),g()(e,"qrCodeList",[]),g()(e,"qrCodeScale",100),g()(e,"qrCodeSelectedSize","large"),g()(e,"qrCodeSizeOptions",[{label:"45×45mm",value:"medium",width:45,height:45,marginTop:0,marginLeft:0,qrSize:80},{label:"50×50mm",value:"large",width:50,height:50,marginTop:0,marginLeft:0,qrSize:100},{label:"25×25mm",value:"small",width:20,height:20,marginTop:0,marginLeft:0,qrSize:30}]),e},mounted:function(){this.GET_SystemLogs(),this.rowDrop()},created:function(){this.printer=new q},watch:(i={PrintVisible:function(e){var n=this;e&&this.$nextTick(function(){n.generateBarcodes()})},selectedSize:{handler:function(e){var n=this;this.$nextTick(function(){n.generateBarcodes()})}}},g()(i,"selectedSize",{handler:function(e){var n={large:{width:"50mm",height:"20mm"},medium:{width:"45mm",height:"10mm"},small:{width:"25mm",height:"10mm"}}[e];this.printOptions.extraCss="\n @page {\n size: "+n.width+" "+n.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: "+n.width+";\n height: "+n.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}),g()(i,"qrCodeSelectedSize",{handler:function(e){var n=this;this.$nextTick(function(){n.generateQRCodes()})}}),i),methods:(a={qRcode:function(){var e=this;0!==this.multipleSelection.length?(this.qrCodeList=this.multipleSelection.map(function(e){return e.sku}),this.qrCodeVisible=!0,this.$nextTick(function(){e.generateQRCodes()})):this.$message.warning("请先选择要打印的商品")},generateQRCodes:function(){var e=this;this.qrCodeList.forEach(function(n,t){var i=document.getElementById("qrcode-"+t);if(i){i.innerHTML="";var a=e.qrCodeSizeOptions.find(function(n){return n.value===e.qrCodeSelectedSize});new L.a(i,{text:n,width:a.qrSize,height:a.qrSize,colorDark:"#000000",colorLight:"#ffffff",correctLevel:L.a.CorrectLevel.H})}})},handleQRCodePrint:function(){var e=this;try{var n=this.qrCodeSizeOptions.find(function(n){return n.value===e.qrCodeSelectedSize}),t=this.qrCodeList.map(function(e,n){var t=document.getElementById("qrcode-"+n);return'\n \n "}).join("");this.printer.print(t,{width:n.width,height:n.height,marginTop:n.marginTop,marginLeft:n.marginLeft,fontSize:12}),this.$message.success("打印成功"),this.qrCodeVisible=!1}catch(e){this.$message.error("打印失败:"+e.message)}},handleQRCodeCancel:function(){this.qrCodeVisible=!1,this.qrCodeList=[]},handleSearch:function(){this.params=u()({},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 e=this;return new p.a(function(n,t){try{e.$nextTick(function(){e.codeList.forEach(function(n,t){var i=e.getBarcodeOptions(),a=document.getElementById("barcode-"+t);if(a){for(;a.firstChild;)a.removeChild(a.firstChild);_()("#barcode-"+t,n,i)}}),n()})}catch(e){t(e)}})},getBarcodeOptions:function(){var e={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:e.width,height:e.height,displayValue:!1,margin:5,fontSize:"small"===this.selectedSize?8:12,textMargin:2}},handleCancle:function(){this.PrintVisible=!1},handleSelectionChange:function(e){this.multipleSelection=e},batchPrint:function(){var e=this;return d()(l.a.mark(function n(){var t;return l.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:try{t=e.multipleSelection.map(function(e){return e.sku}),e.codeList=t,e.PrintVisible=!0}catch(n){e.$message.error("批量打印失败:"+n.message)}case 1:case"end":return n.stop()}},n,e)}))()},handlePrintGoodsLend:function(){var e=this;return d()(l.a.mark(function n(){var t,i;return l.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,e.selectedSize){n.next=4;break}return e.$message.warning("请先选择打印尺寸"),n.abrupt("return");case 4:if(t=e.sizeOptions.find(function(n){return n.value===e.selectedSize})){n.next=7;break}throw new Error("无效的打印尺寸");case 7:return n.next=9,e.generateBarcodes();case 9:i=e.codeList.map(function(e,n){var t=document.getElementById("barcode-"+n);if(!t)throw new Error("条形码生成失败");return'\n \n "}).join(""),e.printer.print(i,{width:t.width,height:t.height,marginTop:t.marginTop,marginLeft:t.marginLeft,fontSize:t.fontSize}),e.$message.success("打印成功"),e.PrintVisible=!1,n.next=18;break;case 15:n.prev=15,n.t0=n.catch(0),e.$message.error("打印失败:"+n.t0.message);case 18:case"end":return n.stop()}},n,e,[[0,15]])}))()}},g()(a,"handleCancle",function(){this.PrintVisible=!1,this.codeList=[]}),g()(a,"PrintIng",function(e){var n=this;return d()(l.a.mark(function t(){return l.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:try{n.barcodeValue=e.sku,n.codeList=[e.sku],n.PrintVisible=!0}catch(e){n.$message.error("打印失败:"+e.message)}case 1:case"end":return t.stop()}},t,n)}))()}),g()(a,"rowDrop",function(){var e=document.querySelector(".draggable-table .el-table__body-wrapper tbody"),n=this;C.a.create(e,{animation:300,handle:".drag-handle",onEnd:function(e){var t=e.newIndex,i=(e.oldIndex,n.tableData.data.splice(t,1)[0]);n.tableData.data.splice(t,0,i),n.updateList(i.id,t)}})}),g()(a,"updateList",function(e,n){var t=this,i=[{position:"own",product_id:this.tableData.data[n].id,sort:this.tableData.data[n].sort}];n>0&&i.push({position:"before",product_id:this.tableData.data[n-1].id,sort:this.tableData.data[n-1].sort}),n