yxk_pc_mdh/gyhl/static/js/243.1b95b8fc8d3e0e069826.js

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 t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"sys-box plan-box"},[a("div",{staticClass:"sys-tabs"},[a("div",{staticClass:"sys-operate"},[a("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.back()}}},[t._v(t._s(t.config.cancelText))]),t._v(" "),a("el-button",{directives:[{name:"has",rawName:"v-has",value:"warehouse:consumingStock:toQrCode",expression:"'warehouse:consumingStock:toQrCode'"}],attrs:{type:"primary"},on:{click:function(e){return t.toQrCode()}}},[t._v("生成二维码")]),t._v(" "),a("el-button",{directives:[{name:"has",rawName:"v-has",value:"warehouse:consumingStock:printQrCode",expression:"'warehouse:consumingStock:printQrCode'"}],attrs:{type:"primary"},on:{click:function(e){return t.printQrCode()}}},[t._v("打印二维码")])],1),t._v(" "),a("div",{staticClass:"sys-form"},[a("el-form",{ref:"form",attrs:{"label-width":"110px",model:t.formData,rules:t.rulesForm}},[a("div",{staticClass:"flex"},[a("el-form-item",{staticClass:"form-inline",attrs:{label:"物料代码",prop:"materielNo"}},[a("el-input",{attrs:{readonly:""},model:{value:t.formData.materielNo,callback:function(e){t.$set(t.formData,"materielNo",e)},expression:"formData.materielNo"}})],1),t._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"批号",prop:"batch"}},[a("el-input",{attrs:{readonly:""},model:{value:t.formData.batch,callback:function(e){t.$set(t.formData,"batch",e)},expression:"formData.batch"}})],1),t._v(" "),a("el-form-item",{staticClass:"form-inline",attrs:{label:"数量",prop:"count"}},[a("el-input",{attrs:{readonly:""},model:{value:t.formData.count,callback:function(e){t.$set(t.formData,"count",e)},expression:"formData.count"}})],1)],1)]),t._v(" "),a("el-divider",{attrs:{"content-position":"left"}},[t._v("二维码")]),t._v(" "),t._m(0)],1)])])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{attrs:{id:"qrcode"}},[e("div",{staticClass:"prove_box qr_out"})])}]};var v=a("VU/8")(f,p,!1,function(t){a("motJ"),a("E5CM")},"data-v-2346c07e",null);e.default=v.exports},motJ:function(t,e){}});