1 line
6.0 KiB
JavaScript
1 line
6.0 KiB
JavaScript
|
webpackJsonp([243],{E5CM:function(t,e){},TuSQ:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("mvHQ"),r=a.n(i),o=a("Dd8w"),n=a.n(o),s=a("bOdI"),c=a.n(s),m=a("NYxO"),d=a("bzuE"),l=(a("lbHh"),a("S8x/"),a("TExn"),a("MJLE")),u=a.n(l),h=a("uNt2"),f={name:"incoming_qrcode",components:{},data:function(){var t;return t={checkList:[],config:d.a,formData:{},dataList:[],printDirection:!0,pageHeight:"",pageWidth:""},c()(t,"config",d.a),c()(t,"num",""),c()(t,"rulesForm",{unitCount:[{required:!0,message:"请输入最少包装个数",trigger:"blur"}]}),t},mounted:function(){this.$route.params&&(this.formData=this.$route.params),console.log(this.$route.params),this.printDirection?(this.pageHeight=this.config.printHeightDirection0,this.pageWidth=this.config.printWidthDirection0):(this.pageHeight=this.config.printHeightDirection1,this.pageWidth=this.config.printWidthDirection1)},watch:{},methods:n()({},Object(m.d)({removeTagNav:"tagNav/removeTagNav"}),{back:function(){this.removeTagNav({path:this.$route.path,title:this.$route.meta.name}),this.$router.push({path:"/warehouse/consumingStock",query:{t:Date.now()}})},save:function(){var t=this;if(!this.formData.id||!this.formData.materielNo)return this.$message({message:"请重新选择生产领用",type:"error"}),this.removeTagNav({path:this.$route.path,title:this.$route.meta.name}),void this.$router.push({path:"/warehouse/consumingStock"});this.$refs.form.validate(function(e){if(e){var a={materielNo:t.formData.materielNo};t.$api.qrcodeAPI.qrcodeSave(a).then(function(e){console.log(e),0===e.code?(t.$message({message:e.msg,type:"success"}),t.dataList=e.qrCodeList,t.toQrCode()):t.$message({message:e.msg?e.msg:"操作失败,请重试",type:"error"})}).catch(function(e){t.$message({message:"操作失败,请重试",type:"error"})})}})},toQrCode:function(){var t=this,e=document.querySelector(".qr_out");e.style.opacity=0,e.innerHTML="",t.formData.batch=t.formData.batch?t.formData.batch:"";var a=document.createElement("div");a.classList.add("qrcode_container");var i=document.createElement("div");i.classList.add("qrcode_name"),i.innerHTML="物料名称:"+t.formData.materielName,a.appendChild(i);var o=document.createElement("div");o.classList.add("qrcode"),o.setAttribute("id","qrcode_"+this.formData.id),a.appendChild(o),e.appendChild(a);var n=document.createElement("div");n.classList.add("qrcode_info_container"),n.innerHTML="<div>代码:"+t.formData.materielNo+"</div><div>规格:"+t.formData.specification+"</div><div>批次:"+t.formData.batch+"</div><div>数量:"+t.formData.count+"</div>",a.appendChild(n);var s=document.createElement("label");s.classList.add("qrcode_label"),a.appendChild(s);var c=document.createElement("input");c.classList.add("qrcode_check"),c.setAttribute("type","checkbox"),c.value=this.formData.id,c.name="qrcode",c.onclick=function(){if(c.checked&&-1==t.checkList.indexOf(c.value))t.checkList.push(c.value);else if(!c.checked&&-1!=t.checkList.indexOf(c.value)){var e=t.checkList.indexOf(c.value);t.checkList.splice(e,1)}},a.appendChild(c);var m=new u.a(o,{colorDark:"#000000",colorLight:"#ffffff",typeNumber:4,width:80,height:80}),d={id:t.formData.id};m.clear(),m.makeCode(r()(d)),t.$nextTick(function(){e.style.opacity=1})},addPrintContent:function(t,e,a,i){LODOP.PRINT_INIT(""),LODOP.ADD_PRINT_RECT(20,15,193,121,0,1),LODOP.ADD_PRINT_TEXT(47,115,185,20,"代码:"+t);var r=document.getElementById("qrcode_"+i);LODOP.ADD_PRINT_IMAGE(48,15,100,80,r.innerHTML),LODOP.ADD_PRINT_TEXT(95,115,185,20,"批次:"+e),LODOP.ADD_PRINT_TEXT(115,115,185,20,"数量:"+a),LODOP.SET_SHOW_MODE("BKIMG_IN_PREVIEW",1),LODOP.SET_SHOW_MODE("BKIMG_PRINT",1),LODOP.SET_SHOW_MODE("BKIMG_LEFT",10),LODOP.SET_SHOW_MODE("BKIMG_TOP",10)},printQrCode:function(){LODOP=Object(h.a)(),LODOP.SET_LICENSES("","431AF27B46B4FFF6BBB88F67F0BB2974","","");for(var t=0;t<this.checkList.length;t++)this.addPrintContent(this.formData.materielNo,this.formData.materielName,this.formData.specification,this.formData.batch,this.formData.count,this.formData.id),LODOP.PRINT()}})},p={render:function(){var
|