chunk-07510353.51275077.js 11 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-07510353"],{"340c":function(e,r,t){},"8b3b":function(e,r,t){"use strict";t("340c")},d027:function(e,r,t){"use strict";t.r(r);var T=function(){var e=this,r=e._self._c;return r("div",{staticStyle:{height:"100vh"}},[r("div",{staticClass:"header"},[r("div",{staticStyle:{"font-size":"20px",margin:"15px","font-weight":"bold","text-shadow":"1px 1px 1px #4FC9F2","letter-spacing":"2px"}},[e._v("芯片打印")]),r("div",[r("Button",{staticStyle:{margin:"15px"},attrs:{ghost:""},on:{click:function(r){return e.handlePrint(1)}}},[e._v("打印(203)")]),r("Button",{staticStyle:{margin:"15px"},attrs:{ghost:""},on:{click:function(r){return e.handlePrint(2)}}},[e._v("打印(300)")])],1)]),r("div",{staticClass:"bdy"},e._l(e.list,(function(t,T){return r("div",{key:T,class:t.is_choose?"choose_item":"item",on:{click:function(r){return e.handleClick(T)}}},[r("div",{staticStyle:{"margin-bottom":"10px"}},[r("span",[e._v(e._s(t.dispatch_no?"派工单号:":"包装单号:"))]),r("span",[e._v(e._s(t.dispatch_no?t.dispatch_no:t.box_no))])])])})),0)])},_=[],s=t("1157"),o=t.n(s);document.title="芯片打印";var a={data(){return{list:[],selectData:[],state:!0}},mounted(){if(this.$route.query.print_list){let e=decodeURIComponent(this.$route.query.print_list);this.list=JSON.parse(e),this.list.forEach(e=>e.is_choose=!0),this.selectData=JSON.parse(JSON.stringify(this.list))}},methods:{handleClick(e){this.list[e].is_choose=!this.list[e].is_choose,this.selectData=this.list.filter(e=>e.is_choose),this.$forceUpdate()},close(){window.location.replace("about:blank"),window.close()},handlePrint(e){if(0===this.selectData.length)return this.$Message.warning("请选择需要打印的标签");if(this.state){this.state=!1;let r=[{PTK_OpenUSBPort:255},{PTK_ClearBuffer:""},{PTK_SetDarkness:10},{PTK_SetPrintSpeed:4},{PTK_SetDirection:"B"},{PTK_SetLabelHeight:1==e?"640,32,0,false":"960,48,0,false"},{PTK_SetLabelWidth:1==e?784:1176}];this.selectData.forEach(t=>{t.customer=t.customer?t.customer:" ",t.product_title=t.product_title?t.product_title:" ",t.order_number=t.order_number?t.order_number:" ",t.color=t.color?t.color:" ",t.box_date=t.box_date?t.box_date:"",t.dealer=t.dealer?t.dealer:"",t.process=t.process?t.process:" ",t.num=t.num?t.num:" ",t.dealer1=t.dealer&&t.dealer.length>8?t.dealer.slice(0,8):t.dealer.slice(0),t.dealer2=t.dealer&&t.dealer.length>8?t.dealer.slice(8):"",t.customer1=t.customer&&t.customer.length>11?t.customer.slice(0,11):t.customer.slice(0),t.customer2=t.customer&&t.customer.length>11?t.customer.slice(11):"",t.product_title1=t.product_title&&t.product_title.length>12?t.product_title.slice(0,12):t.product_title.slice(0),t.product_title2=t.product_title&&t.product_title.length>12?t.product_title.slice(12):"",t.process1=t.process&&t.process.length>11?t.process.slice(0,11):t.process.slice(0),t.process2=t.process&&t.process.length>11?t.process.slice(11):"",t.color1=t.color&&t.color.length>12?t.color.slice(0,12):t.color.slice(0),t.color2=t.color&&t.color.length>12?t.color.slice(12):"",t.order_no=t.dispatch_no?t.dispatch_no:t.box_no,t.is_s=!!t.dispatch_no;let T,_=this.func.stringToHex(t.order_no).length%4;t.chip=this.func.stringToHex(t.order_no);for(let e=0;e<_;e++)t.chip="0"+t.chip;T=1===e?[{PTK_DrawText_TrueType:"130,70,60,0,微软雅黑,1,700,0,0,0,订单号:"},{PTK_DrawText_TrueType:"300,70,60,0,微软雅黑,1,700,0,0,0,"+t.order_number},{PTK_DrawText_TrueType:"700,70,60,0,微软雅黑,1,700,0,0,0,客户:"},{PTK_DrawText_TrueType:"820,70,50,0,微软雅黑,1,700,0,0,0,"+t.customer1},t.customer2?{PTK_DrawText_TrueType:"820,120,50,0,微软雅黑,1,700,0,0,0,"+t.customer2}:{},{PTK_DrawText_TrueType:"150,170,60,0,微软雅黑,1,700,0,0,0,产品:"},{PTK_DrawText_TrueType:"300,170,50,0,微软雅黑,1,700,0,0,0,"+t.product_title1},t.product_title2?{PTK_DrawText_TrueType:"300,220,50,0,微软雅黑,1,700,0,0,0,"+t.product_title2}:{},{PTK_DrawText_TrueType:"700,170,60,0,微软雅黑,1,700,0,0,0,工艺:"},{PTK_DrawText_TrueType:"820,170,50,0,微软雅黑,1,700,0,0,0,"+t.process1},t.process2?{PTK_DrawText_TrueType:"820,220,50,0,微软雅黑,1,700,0,0,0,"+t.process2}:{},{PTK_DrawText_TrueType:"150,270,60,0,微软雅黑,1,700,0,0,0,花色:"},{PTK_DrawText_TrueType:"300,270,50,0,微软雅黑,1,700,0,0,0,"+t.color1},t.color2?{PTK_DrawText_TrueType:"300,320,50,0,微软雅黑,1,700,0,0,0,"+t.color2}:{},{PTK_DrawText_TrueType:"700,270,60,0,微软雅黑,1,700,0,0,0,数量:"},{PTK_DrawText_TrueType:"820,270,60,0,微软雅黑,1,700,0,0,0,"+t.num},{PTK_DrawText_TrueType:"130,370,60,0,微软雅黑,1,700,0,0,0,"+(t.is_s?"派工单号:":"包装单号:")},{PTK_DrawText_TrueType:"330,370,60,0,微软雅黑,1,700,0,0,0,"+(t.dispatch_no?t.dispatch_no:t.box_no)},t.is_s?{}:{PTK_DrawText_TrueType:"700,370,60,0,微软雅黑,1,700,0,0,0,包装日期:"},t.is_s?{}:{PTK_DrawText_TrueType:"900,370,60,0,微软雅黑,1,700,0,0,0,"+t.box_date},t.is_s?{PTK_DrawText_TrueType:"760,370,60,0,微软雅黑,1,700,0,0,0,经销商:"}:{},t.is_s?{PTK_DrawText_TrueType:"920,370,50,0,微软雅黑,1,700,0,0,0,"+t.dealer1}:{},t.is_s&&t.dealer2?{PTK_DrawText_TrueType:"920,420,50,0,微软雅黑,1,700,0,0,0,"+t.dealer2}:{},{PTK_DrawText_TrueType:"130,525,60,0,微软雅黑,1,700,0,0,0,订单号:"},{PTK_DrawText_TrueType:"300,525,60,0,微软雅黑,1,700,0,0,0,"+t.order_number},{PTK_DrawText_TrueType:"700,525,60,0,微软雅黑,1,700,0,0,0,客户:"},{PTK_DrawText_TrueType:"820,525,50,0,微软雅黑,1,700,0,0,0,"+t.customer1},t.customer2?{PTK_DrawText_TrueType:"820,575,50,0,微软雅黑,1,700,0,0,0,"+t.customer2}:{},{PTK_DrawText_TrueType:"150,625,60,0,微软雅黑,1,700,0,0,0,产品:"},{PTK_DrawText_TrueType:"300,625,50,0,微软雅黑,1,700,0,0,0,"+t.product_title1},t.product_title2?{PTK_DrawText_TrueType:"300,675,50,0,微软雅黑,1,700,0,0,0,"+t.product_title2}:{},{PTK_DrawText_TrueType:"700,625,60,0,微软雅黑,1,700,0,0,0,工艺:"},{PTK_DrawText_TrueType:"820,625,50,0,微软雅黑,1,700,0,0,0,"+t.process1},t.process2?{PTK_DrawText_TrueType:"820,675,50,0,微软雅黑,1,700,0,0,0,"+t.process2}:{},{PTK_DrawText_TrueType:"150,725,60,0,微软雅黑,1,700,0,0,0,花色:"},{PTK_DrawText_TrueType:"300,725,50,0,微软雅黑,1,700,0,0,0,"+t.color1},t.color2?{PTK_DrawText_TrueType:"300,775,50,0,微软雅黑,1,700,0,0,0,"+t.color2}:{},{PTK_DrawText_TrueType:"700,725,60,0,微软雅黑,1,700,0,0,0,数量:"},{PTK_DrawText_TrueType:"820,725,60,0,微软雅黑,1,700,0,0,0,"+t.num},{PTK_DrawText_TrueType:"130,825,60,0,微软雅黑,1,700,0,0,0,"+(t.is_s?"派工单号:":"包装单号:")},{PTK_DrawText_TrueType:"330,825,60,0,微软雅黑,1,700,0,0,0,"+(t.dispatch_no?t.dispatch_no:t.box_no)},t.is_s?{}:{PTK_DrawText_TrueType:"700,825,60,0,微软雅黑,1,700,0,0,0,包装日期:"},t.is_s?{}:{PTK_DrawText_TrueType:"900,825,60,0,微软雅黑,1,700,0,0,0,"+t.box_date},t.is_s?{PTK_DrawText_TrueType:"760,825,60,0,微软雅黑,1,700,0,0,0,经销商:"}:{},t.is_s?{PTK_DrawText_TrueType:"920,825,50,0,微软雅黑,1,700,0,0,0,"+t.dealer1}:{},t.is_s&&t.dealer2?{PTK_DrawText_TrueType:"920,875,50,0,微软雅黑,1,700,0,0,0,"+t.dealer2}:{},{PTK_RWRFIDLabel:`1,0,0,${t.chip.length/2},1,${t.chip}`},{PTK_PrintLabel:"1,1"}]:[{PTK_DrawText_TrueType:"30,70,60,0,微软雅黑,1,700,0,0,0,订单号:"},{PTK_DrawText_TrueType:"200,70,60,0,微软雅黑,1,700,0,0,0,"+t.order_number},{PTK_DrawText_TrueType:"600,70,60,0,微软雅黑,1,700,0,0,0,客户:"},{PTK_DrawText_TrueType:"720,70,50,0,微软雅黑,1,700,0,0,0,"+t.customer1},t.customer2?{PTK_DrawText_TrueType:"720,120,50,0,微软雅黑,1,700,0,0,0,"+t.customer2}:{},{PTK_DrawText_TrueType:"50,170,60,0,微软雅黑,1,700,0,0,0,产品:"},{PTK_DrawText_TrueType:"200,170,50,0,微软雅黑,1,700,0,0,0,"+t.product_title1},t.product_title2?{PTK_DrawText_TrueType:"200,220,50,0,微软雅黑,1,700,0,0,0,"+t.product_title2}:{},{PTK_DrawText_TrueType:"600,170,60,0,微软雅黑,1,700,0,0,0,工艺:"},{PTK_DrawText_TrueType:"720,170,50,0,微软雅黑,1,700,0,0,0,"+t.process1},t.process2?{PTK_DrawText_TrueType:"720,220,50,0,微软雅黑,1,700,0,0,0,"+t.process2}:{},{PTK_DrawText_TrueType:"50,270,60,0,微软雅黑,1,700,0,0,0,花色:"},{PTK_DrawText_TrueType:"200,270,50,0,微软雅黑,1,700,0,0,0,"+t.color1},t.color2?{PTK_DrawText_TrueType:"200,320,50,0,微软雅黑,1,700,0,0,0,"+t.color2}:{},{PTK_DrawText_TrueType:"600,270,60,0,微软雅黑,1,700,0,0,0,数量:"},{PTK_DrawText_TrueType:"720,270,60,0,微软雅黑,1,700,0,0,0,"+t.num},{PTK_DrawText_TrueType:"30,370,60,0,微软雅黑,1,700,0,0,0,"+(t.is_s?"派工单号:":"包装单号:")},{PTK_DrawText_TrueType:"230,370,60,0,微软雅黑,1,700,0,0,0,"+(t.dispatch_no?t.dispatch_no:t.box_no)},t.is_s?{}:{PTK_DrawText_TrueType:"600,370,60,0,微软雅黑,1,700,0,0,0,包装日期:"},t.is_s?{}:{PTK_DrawText_TrueType:"800,370,60,0,微软雅黑,1,700,0,0,0,"+t.box_date},t.is_s?{PTK_DrawText_TrueType:"660,370,60,0,微软雅黑,1,700,0,0,0,经销商:"}:{},t.is_s?{PTK_DrawText_TrueType:"820,370,50,0,微软雅黑,1,700,0,0,0,"+t.dealer1}:{},t.is_s&&t.dealer2?{PTK_DrawText_TrueType:"820,420,50,0,微软雅黑,1,700,0,0,0,"+t.dealer2}:{},{PTK_DrawText_TrueType:"30,525,60,0,微软雅黑,1,700,0,0,0,订单号:"},{PTK_DrawText_TrueType:"200,525,60,0,微软雅黑,1,700,0,0,0,"+t.order_number},{PTK_DrawText_TrueType:"600,525,60,0,微软雅黑,1,700,0,0,0,客户:"},{PTK_DrawText_TrueType:"720,525,50,0,微软雅黑,1,700,0,0,0,"+t.customer1},t.customer2?{PTK_DrawText_TrueType:"720,575,50,0,微软雅黑,1,700,0,0,0,"+t.customer2}:{},{PTK_DrawText_TrueType:"50,625,60,0,微软雅黑,1,700,0,0,0,产品:"},{PTK_DrawText_TrueType:"200,625,50,0,微软雅黑,1,700,0,0,0,"+t.product_title1},t.product_title2?{PTK_DrawText_TrueType:"200,675,50,0,微软雅黑,1,700,0,0,0,"+t.product_title2}:{},{PTK_DrawText_TrueType:"600,625,60,0,微软雅黑,1,700,0,0,0,工艺:"},{PTK_DrawText_TrueType:"720,625,50,0,微软雅黑,1,700,0,0,0,"+t.process1},t.process2?{PTK_DrawText_TrueType:"720,675,50,0,微软雅黑,1,700,0,0,0,"+t.process2}:{},{PTK_DrawText_TrueType:"50,725,60,0,微软雅黑,1,700,0,0,0,花色:"},{PTK_DrawText_TrueType:"200,725,50,0,微软雅黑,1,700,0,0,0,"+t.color1},t.color2?{PTK_DrawText_TrueType:"200,775,50,0,微软雅黑,1,700,0,0,0,"+t.color2}:{},{PTK_DrawText_TrueType:"600,725,60,0,微软雅黑,1,700,0,0,0,数量:"},{PTK_DrawText_TrueType:"720,725,60,0,微软雅黑,1,700,0,0,0,"+t.num},{PTK_DrawText_TrueType:"30,825,60,0,微软雅黑,1,700,0,0,0,"+(t.is_s?"派工单号:":"包装单号:")},{PTK_DrawText_TrueType:"230,825,60,0,微软雅黑,1,700,0,0,0,"+(t.dispatch_no?t.dispatch_no:t.box_no)},t.is_s?{}:{PTK_DrawText_TrueType:"600,825,60,0,微软雅黑,1,700,0,0,0,包装日期:"},t.is_s?{}:{PTK_DrawText_TrueType:"800,825,60,0,微软雅黑,1,700,0,0,0,"+t.box_date},t.is_s?{PTK_DrawText_TrueType:"660,825,60,0,微软雅黑,1,700,0,0,0,经销商:"}:{},t.is_s?{PTK_DrawText_TrueType:"820,825,50,0,微软雅黑,1,700,0,0,0,"+t.dealer1}:{},t.is_s&&t.dealer2?{PTK_DrawText_TrueType:"820,875,50,0,微软雅黑,1,700,0,0,0,"+t.dealer2}:{},{PTK_RWRFIDLabel:`1,0,0,${t.chip.length/2},1,${t.chip}`},{PTK_PrintLabel:"1,1"}],r.push(...T)}),r.push({PTK_CloseUSBPort:""});let t=this,T=JSON.stringify(r);o.a.ajax({type:"post",url:"http://127.0.0.1:888/postek/print",data:{reqParam:1,printparams:T},dataType:"json",timeout:5e3,success:function(e){"0"==e.retval?(t.$Message.success("发送成功"),setTimeout(()=>{this.close()},200)):t.$Message.error("发送失败,返回结果:"+e.msg),setTimeout(()=>{t.state=!0},2e3)},error:function(){}})}}}},p=a,u=(t("8b3b"),t("2877")),c=Object(u["a"])(p,T,_,!1,null,"1afade6d",null);r["default"]=c.exports}}]);