1 |
- webpackJsonp([19],{"+F6w":function(n,t,e){var i=e("Km1E");"string"==typeof i&&(i=[[n.i,i,""]]),i.locals&&(n.exports=i.locals);e("rjj0")("22d2651d",i,!0)},"74QC":function(n,t,e){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,a=e("fZjL"),r=e.n(a),o=e("Dd8w"),s=e.n(o),l=e("Xxa5"),c=e.n(l),d=e("exGp"),m=e.n(d),p=e("//Fk"),h=e.n(p),f=e("bOdI"),u=e.n(f),g=e("Zrlr"),b=e.n(g),x=e("wxAW"),v=e.n(x),w=(e("hky6"),e("UVPs")),y=e("TwlK"),k=e.n(y),_=e("Lokx"),z=e.n(_),S=function(){function n(){b()(this,n),this.printWindow=null}return v()(n,[{key:"print",value:function(n){var t=this,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.width,a=e.height,r=e.marginTop,o=e.marginLeft,s=e.fontSize;this.printWindow=window.open("","_blank"),this.printWindow.document.write("\n <html>\n <head>\n <title>打印标签</title>\n <style>\n @page {\n size: "+i+"mm "+a+"mm;\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 .print-content {\n width: "+i+"mm;\n height: "+a+"mm;\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 margin-top: "+r+"mm;\n margin-left: "+o+"mm;\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 .text {\n font-size: "+s+"px;\n margin-top: 0mm;\n }\n @media print {\n * {\n border: none !important;\n outline: none !important;\n -webkit-print-color-adjust: exact;\n }\n }\n </style>\n </head>\n <body>"+n+"</body>\n </html>\n "),this.printWindow.document.close(),setTimeout(function(){t.printWindow.focus(),t.printWindow.print(),setTimeout(function(){t.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},u()(n,"codeList",[]),u()(n,"PrintVisible",!1),u()(n,"printOrientation","portrait"),u()(n,"selectedSize","large"),u()(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}]),u()(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 "}),n},mounted:function(){this.GET_SystemLogs(),this.rowDrop()},created:function(){this.printer=new S},watch:u()({PrintVisible:function(n){var t=this;n&&this.$nextTick(function(){t.generateBarcodes()})},selectedSize:{handler:function(n){var t=this;this.$nextTick(function(){t.generateBarcodes()})}}},"selectedSize",{handler:function(n){var t={large:{width:"50mm",height:"20mm"},medium:{width:"45mm",height:"10mm"},small:{width:"25mm",height:"10mm"}}[n];this.printOptions.extraCss="\n @page {\n size: "+t.width+" "+t.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: "+t.width+";\n height: "+t.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={generateBarcodes:function(){var n=this;return new h.a(function(t,e){try{n.$nextTick(function(){n.codeList.forEach(function(t,e){var i=n.getBarcodeOptions(),a=document.getElementById("barcode-"+e);if(a){for(;a.firstChild;)a.removeChild(a.firstChild);k()("#barcode-"+e,String(t).toUpperCase(),i)}}),t()})}catch(n){e(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 m()(c.a.mark(function t(){var e;return c.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:try{e=n.multipleSelection.map(function(n){return n.sku}),n.codeList=e,n.PrintVisible=!0}catch(t){n.$message.error("批量打印失败:"+t.message)}case 1:case"end":return t.stop()}},t,n)}))()},handlePrintGoodsLend:function(){var n=this;return m()(c.a.mark(function t(){var e,i;return c.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,n.selectedSize){t.next=4;break}return n.$message.warning("请先选择打印尺寸"),t.abrupt("return");case 4:if(e=n.sizeOptions.find(function(t){return t.value===n.selectedSize})){t.next=7;break}throw new Error("无效的打印尺寸");case 7:return t.next=9,n.generateBarcodes();case 9:i=n.codeList.map(function(n,t){var e=document.getElementById("barcode-"+t);if(!e)throw new Error("条形码生成失败");return'\n <div class="print-content">\n <div class="barcode-container">\n '+e.outerHTML+'\n </div>\n <div class="text">'+String(n).toUpperCase()+"</div>\n </div>\n "}).join(""),n.printer.print(i,{width:e.width,height:e.height,marginTop:e.marginTop,marginLeft:e.marginLeft,fontSize:e.fontSize}),n.$message.success("打印成功"),n.PrintVisible=!1,t.next=18;break;case 15:t.prev=15,t.t0=t.catch(0),n.$message.error("打印失败:"+t.t0.message);case 18:case"end":return t.stop()}},t,n,[[0,15]])}))()}},u()(i,"handleCancle",function(){this.PrintVisible=!1,this.codeList=[]}),u()(i,"PrintIng",function(n){var t=this;return m()(c.a.mark(function e(){return c.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:try{t.barcodeValue=n.sku,t.codeList=[n.sku],t.PrintVisible=!0}catch(n){t.$message.error("打印失败:"+n.message)}case 1:case"end":return e.stop()}},e,t)}))()}),u()(i,"rowDrop",function(){var n=document.querySelector(".draggable-table .el-table__body-wrapper tbody"),t=this;z.a.create(n,{animation:300,handle:".drag-handle",onEnd:function(n){var e=n.newIndex,i=(n.oldIndex,t.tableData.data.splice(e,1)[0]);t.tableData.data.splice(e,0,i),t.updateList(i.id,e)}})}),u()(i,"updateList",function(n,t){var e=this,i=[{position:"own",product_id:this.tableData.data[t].id,sort:this.tableData.data[t].sort}];t>0&&i.push({position:"before",product_id:this.tableData.data[t-1].id,sort:this.tableData.data[t-1].sort}),t<this.tableData.data.length-1&&i.push({position:"after",product_id:this.tableData.data[t+1].id,sort:this.tableData.data[t+1].sort}),w.h({data:i}).then(function(n){e.$message.success("更新成功!"),e.GET_SystemLogs()}).catch(function(){e.$message.error("更新失败!")})}),u()(i,"handlePageSizeChange",function(n){this.params.page_size=n,this.GET_SystemLogs()}),u()(i,"handlePageCurrentChange",function(n){this.params.page_no=n,this.GET_SystemLogs()}),u()(i,"searchEvent",function(n){var t=this;this.params=s()({},this.params,{keyword:n}),r()(this.advancedForm).forEach(function(n){return delete t.params[n]}),this.params.page_no=1,this.GET_SystemLogs()}),u()(i,"advancedSearchEvent",function(){this.params=s()({},this.params,this.advancedForm),delete this.params.start_time,delete this.params.end_time,this.advancedForm.order_time_range&&(this.params.start_time=this.advancedForm.order_time_range[0]/1e3,this.params.end_time=this.advancedForm.order_time_range[1]/1e3),delete this.params.keyword,delete this.params.order_time_range,this.params.page_no=1,this.GET_SystemLogs()}),u()(i,"GET_SystemLogs",function(){var n=this;this.loading=!0;var t=this.MixinClone(this.params);r()(t).forEach(function(n){t[n]||0===t[n]||delete t[n]}),w.c(t).then(function(t){n.loading=!1,n.tableData=t,n.params.page_no=t.page_no,n.params.page_size=t.page_size}).catch(function(){n.loading=!1})}),u()(i,"handleShowDetail",function(n){this.showLogDetail=!0,this.currDetailLog=n}),i)},L=e("XyMi");var j=function(n){e("lzRm"),e("+F6w")},D=Object(L.a)(C,function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("div",[e("en-table-layout",{staticClass:"draggable-table",attrs:{tableData:n.tableData.data,loading:n.loading},on:{"selection-change":n.handleSelectionChange}},[e("div",{staticClass:"inner-toolbar inner-toolbar2",attrs:{slot:"toolbar"},slot:"toolbar"},[e("div",{staticClass:"toolbar-btns"},[e("el-button",{attrs:{size:"mini",type:"primary",disabled:0===n.multipleSelection.length},on:{click:n.batchPrint}},[n._v("批量打印")])],1)]),n._v(" "),e("template",{slot:"table-columns"},[e("el-table-column",{attrs:{label:"",width:"100"}},[[e("span",{staticClass:"drag-handle"},[n._v("☰")])]],2),n._v(" "),e("el-table-column",{attrs:{type:"selection",width:"55"}}),n._v(" "),e("el-table-column",{attrs:{label:"图标"},scopedSlots:n._u([{key:"default",fn:function(n){return[e("img",{attrs:{src:n.row.goods_vo.image_small_list,alt:"",width:"50px"}})]}}])}),n._v(" "),e("el-table-column",{attrs:{prop:"goods_vo.name",label:"商品名称"},scopedSlots:n._u([{key:"default",fn:function(t){return[e("span",{staticClass:"selectable"},[n._v(n._s(t.row.goods_vo.name))])]}}])}),n._v(" "),e("el-table-column",{attrs:{prop:"goods_vo.sn",label:"商品编号"},scopedSlots:n._u([{key:"default",fn:function(t){return[e("span",{staticClass:"selectable"},[n._v(n._s(t.row.goods_vo.sn))])]}}])}),n._v(" "),e("el-table-column",{attrs:{label:"SKU",align:"center"},scopedSlots:n._u([{key:"default",fn:function(t){return[e("span",{staticClass:"selectable"},[n._v(n._s(t.row.sku))])]}}])}),n._v(" "),e("el-table-column",{attrs:{prop:"spec_name",label:"规格型号"}}),n._v(" "),e("el-table-column",{attrs:{label:"操作",width:"310"},scopedSlots:n._u([{key:"default",fn:function(t){return[e("el-button",{attrs:{size:"mini"},on:{click:function(e){return n.PrintIng(t.row)}}},[n._v("打印SKU")])]}}])})],1),n._v(" "),n.tableData?e("el-pagination",{attrs:{slot:"pagination","current-page":n.tableData.page_no,"page-sizes":[20,50,70,100],"page-size":n.tableData.page_size,layout:"total, sizes, prev, pager, next, jumper",total:n.tableData.data_total},on:{"size-change":n.handlePageSizeChange,"current-change":n.handlePageCurrentChange},slot:"pagination"}):n._e()],2),n._v(" "),e("el-dialog",{attrs:{title:"打印设置",visible:n.PrintVisible,width:"940px",center:""},on:{"update:visible":function(t){n.PrintVisible=t},close:n.handleCancle}},[e("el-form",{staticClass:"print-options",attrs:{inline:!0}},[e("el-form-item",{attrs:{label:"打印规格"}},[e("el-select",{attrs:{placeholder:"请选择打印规格"},model:{value:n.selectedSize,callback:function(t){n.selectedSize=t},expression:"selectedSize"}},n._l(n.sizeOptions,function(n){return e("el-option",{key:n.value,attrs:{label:n.label,value:n.value}})}),1)],1),n._v(" "),e("el-form-item",{attrs:{label:"缩放"}},[e("el-input-number",{attrs:{min:50,max:150,step:10},model:{value:n.scale,callback:function(t){n.scale=t},expression:"scale"}})],1)],1),n._v(" "),e("div",{staticClass:"print-preview-container"},[e("div",{style:{transform:"scale("+n.scale/100+")"},attrs:{id:"deliverySheet"}},n._l(n.codeList,function(t,i){return e("div",{key:i,staticClass:"tips-t"},[e("div",{staticClass:"content-wrapper"},[e("div",{staticClass:"barcode-container"},[e("svg",{attrs:{id:"barcode-"+i}})]),n._v(" "),e("div",{staticClass:"numOrder"},[n._v(n._s(String(t).toUpperCase()))])])])}),0)]),n._v(" "),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:n.handleCancle}},[n._v("取消")]),n._v(" "),e("el-button",{attrs:{type:"primary"},on:{click:n.handlePrintGoodsLend}},[n._v("打印")])],1)],1)],1)},[],!1,j,"data-v-299248cf",null);t.default=D.exports},Km1E:function(n,t,e){(n.exports=e("FZ+f")(!1)).push([n.i,'\n@charset "UTF-8";\n.nc-container[data-v-299248cf] {\n height: 32px !important;\n overflow: hidden;\n}\n.drag-handle[data-v-299248cf] {\n cursor: move;\n /* 设置鼠标为拖拽样式 */\n}\n.face-image[data-v-299248cf] {\n display: block;\n width: 50px;\n height: 50px;\n margin: 0 auto;\n}\n[data-v-299248cf] .el-dialog__body {\n padding: 10px 20px;\n}\n[data-v-299248cf] .img-code {\n width: 80%;\n}\n[data-v-299248cf] .img-code .el-input-group__append {\n padding: 0;\n margin: 0;\n}\n[data-v-299248cf] .img-code .el-input-group__append img {\n display: block;\n height: 30px;\n cursor: pointer;\n}\n.logInfo[data-v-299248cf] {\n margin-bottom: 20px;\n}\n.print-preview-container[data-v-299248cf] {\n overflow: auto;\n width: 100%;\n height: 400px;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n#deliverySheet[data-v-299248cf] {\n -webkit-transform-origin: top left;\n transform-origin: top left;\n padding: 10mm;\n}\n.tips-t[data-v-299248cf] {\n margin-bottom: 2mm;\n padding: 2mm;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.tips-t .content-wrapper[data-v-299248cf] {\n width: 100%;\n height: 100%;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.tips-t .barcode-container[data-v-299248cf] {\n width: 100%;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.tips-t .barcode-container svg[data-v-299248cf] {\n max-width: 100%;\n max-height: 100%;\n}\n.tips-t .numOrder[data-v-299248cf] {\n margin-top: 1mm;\n font-size: v-bind(\'selectedSize === "small" ? "8px" : "12px"\');\n}\n.tips-t[data-size="large"][data-v-299248cf] {\n width: 50mm;\n height: 20mm;\n}\n.tips-t[data-size="medium"][data-v-299248cf] {\n width: 45mm;\n height: 10mm;\n}\n.tips-t[data-size="small"][data-v-299248cf] {\n width: 25mm;\n height: 10mm;\n}\n#deliverySheet[data-v-299248cf] {\n -webkit-transform-origin: top left;\n transform-origin: top left;\n}\n.tips-t[data-v-299248cf] {\n border: 1px solid #ccc;\n margin-bottom: 2mm;\n padding: 2mm;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.tips-t .content-wrapper[data-v-299248cf] {\n width: 100%;\n height: 100%;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.tips-t .numOrder[data-v-299248cf] {\n font-size: 14px;\n margin-top: 1mm;\n}\n.tips-t .barcode-container[data-v-299248cf] {\n width: 100%;\n height: v-bind(\'selectedSize === "small" ? "60%" : "70%"\');\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.tips-t .barcode-container svg[data-v-299248cf] {\n max-width: 100%;\n max-height: 100%;\n}\n.tips-t .numOrder[data-v-299248cf] {\n font-size: v-bind(\'selectedSize === "small" ? "8px" : "14px"\');\n margin-top: 1mm;\n}\n#deliverySheet[data-v-299248cf] {\n -webkit-transform-origin: top left;\n transform-origin: top left;\n padding: 10mm;\n}\n#deliverySheet.portrait .tips-t[data-v-299248cf] {\n width: 95mm;\n height: 35mm;\n}\n#deliverySheet.landscape .tips-t[data-v-299248cf] {\n width: 35mm;\n height: 95mm;\n}\n.dialog-footer[data-v-299248cf] {\n text-align: right;\n margin-top: 20px;\n}\n@media print {\n@page {\n size: auto;\n margin: 0;\n}\nbody[data-v-299248cf] {\n margin: 0;\n}\n.print-options[data-v-299248cf],\n .dialog-footer[data-v-299248cf] {\n display: none;\n}\n#deliverySheet[data-v-299248cf] {\n -webkit-transform: none !important;\n transform: none !important;\n}\n.tips-t[data-v-299248cf] {\n page-break-inside: avoid;\n margin-bottom: 0;\n}\n}\n',""])},Zrlr:function(n,t,e){"use strict";t.__esModule=!0,t.default=function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}},ixWt:function(n,t,e){(n.exports=e("FZ+f")(!1)).push([n.i,"\n.print {\r\n margin-left: 790px;\n}\n.inner-toolbar2 {\r\n -webkit-box-pack: start !important;\r\n -ms-flex-pack: start !important;\r\n justify-content: flex-start !important;\n}\n.inner-toolbar2 .dateSearch {\r\n margin-right: 20px;\n}\n.toolbar-search {\r\n display: -webkit-box;\r\n display: -ms-flexbox;\r\n display: flex;\r\n width: 400px;\n}\n.toolbar-search .el-button {\r\n margin-left: 18px;\n}\r\n",""])},lzRm:function(n,t,e){var i=e("ixWt");"string"==typeof i&&(i=[[n.i,i,""]]),i.locals&&(n.exports=i.locals);e("rjj0")("55ed735c",i,!0)},wxAW:function(n,t,e){"use strict";t.__esModule=!0;var i,a=e("C4MV"),r=(i=a)&&i.__esModule?i:{default:i};t.default=function(){function n(n,t){for(var e=0;e<t.length;e++){var i=t[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),(0,r.default)(n,i.key,i)}}return function(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}}()}});
|