chunk-63a29b4e.0031a330.js 14 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-63a29b4e"],{"5d86":function(e,t,r){"use strict";r.r(t);var o=function(){var e=this,t=e._self._c;return t("div",{staticStyle:{height:"100vh"}},[t("div",{staticClass:"header"},[t("div",{staticStyle:{"font-size":"20px",margin:"15px","font-weight":"bold","text-shadow":"1px 1px 1px #4FC9F2","letter-spacing":"2px"}},[e._v("芯片打印")]),t("div",{staticStyle:{width:"30%",display:"flex","align-items":"center","justify-content":"space-between"}},[t("label",{staticStyle:{width:"100px",color:"#FFFFFF"}},[e._v("选择时间:")]),t("Input",{attrs:{size:"large",clearable:"",placeholder:"请选择时间"},on:{"on-focus":function(t){e.is_time=!0}},model:{value:e.time,callback:function(t){e.time=t},expression:"time"}})],1),t("div",[t("Button",{staticStyle:{margin:"15px",width:"6rem"},attrs:{ghost:e.is_all,size:"large"},on:{click:e.handleChooseAll}},[e._v(e._s(e.is_all?"取消全选":"全选"))]),t("Button",{staticStyle:{margin:"15px"},attrs:{size:"large"},on:{click:e.handleReturn}},[e._v("返回")]),t("Button",{staticStyle:{margin:"15px"},attrs:{ghost:"",size:"large"},on:{click:e.handlePrint1}},[e._v("打印(203)")]),t("Button",{staticStyle:{margin:"15px"},attrs:{ghost:"",size:"large"},on:{click:e.handlePrint1}},[e._v("打印(300)")])],1)]),t("div",{staticClass:"bdy"},e._l(e.list,(function(r,o){return t("div",{key:o,class:r.is_choose?"choose_item":"item",on:{click:function(t){return e.handleClick(o)}}},[t("div",{staticStyle:{"margin-bottom":"10px"}},[t("span",[e._v("包装单号:")]),t("span",[e._v(e._s(r.box_no))])]),t("div",{staticStyle:{"margin-bottom":"10px"}},[t("span",[e._v("产品名称:")]),t("span",[e._v(e._s(r.product_title))])]),t("div",{staticStyle:{"margin-bottom":"10px"}},[t("span",[e._v("规格型号:")]),t("span",[e._v(e._s(r.product_size))])]),t("div",{staticStyle:{"margin-bottom":"10px"}},[t("span",[e._v("包装数量:")]),t("span",[e._v(e._s(r.num))])]),t("div",{staticStyle:{"margin-bottom":"10px"}},[t("span",[e._v("包装日期:")]),t("span",[e._v(e._s(r.box_date))])])])})),0),t("van-calendar",{attrs:{type:"range",title:"选择日期",color:"#0765f7","min-date":new Date(2020,0,1),"default-date":[new Date,new Date],"allow-same-day":!0},on:{confirm:e.onConfirm},model:{value:e.is_time,callback:function(t){e.is_time=t},expression:"is_time"}})],1)},s=[],_=r("1157"),T=r.n(_);document.title="芯片打印";var i={data(){return{list:[],selectData:[],is_time:!1,time:"",minDate:new Date(1990,1,1),is_all:!1}},created(){localStorage.getItem("dwy_url")||this.$router.push("/cms/chipScreen")},mounted(){let e=this.$route.query.order_no;const t={url:localStorage.getItem("dwy_url")+"jbl/api/module-data/box_orders_list/page",post:{debugFlag:!1,developmentSystemId:null,direction:"DESC",dynamicFormCode:"box_orders",fromClientType:"pc",number:0,property:"id",rules:[{field:"box_orders_product.order_no",option:"LIKE_ANYWHERE",values:[e]}],size:999,sorts:[],specialConditions:[]}};this.axios.post("/api/testdwy",{...t}).then(e=>{this.list=[],e.data.content=e.data.content.filter(e=>"PACKAGED"==e.status),e.data.content.forEach(e=>{let t={};t.order_number=e.box_orders_product.order_no,t.customer=e.box_orders_product.customer_name,t.product_title=e.box_orders_product.product_title,t.process=e.box_orders_product.process_title,t.color=e.box_orders_product.color,t.num=e.box_orders_product.box_num,t.box_no=e.defective_order_no,t.product_size=e.box_orders_product.product_size?e.box_orders_product.product_size:"",t.box_date=e.box_time.split("T")[0],this.list.push(t)})})},methods:{handleChooseAll(){let e;this.is_all=!this.is_all,this.is_all?(e=JSON.parse(JSON.stringify(this.list)),e.forEach(e=>{e.is_choose=!0})):(e=JSON.parse(JSON.stringify(this.list)),e.forEach(e=>{e.is_choose=!1})),this.$set(this,"list",e)},formatDate(e){return`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`},onConfirm(e){const[t,r]=e;this.is_time=!1,this.time=`${this.formatDate(t)} - ${this.formatDate(r)}`;let o=this.$route.query.order_no;const s={url:localStorage.getItem("dwy_url")+"jbl/api/module-data/box_orders_list/page",post:{debugFlag:!1,developmentSystemId:null,direction:"DESC",dynamicFormCode:"box_orders",fromClientType:"pc",number:0,property:"id",rules:[{field:"box_orders_product.order_no",option:"LIKE_ANYWHERE",values:[o]},{field:"box_time",option:"BTS",values:[new Date(this.formatDate(t)).toISOString(),new Date(Date.parse(this.formatDate(r))+864e5-1).toISOString()]}],size:999,sorts:[],specialConditions:[]}};this.axios.post("/api/testdwy",{...s}).then(e=>{this.list=[],e.data.content=e.data.content.filter(e=>"PACKAGED"==e.status),e.data.content.forEach(e=>{let t={};t.order_number=e.box_orders_product.order_no,t.customer=e.box_orders_product.customer_name,t.product_title=e.box_orders_product.product_title,t.process=e.box_orders_product.process_title,t.color=e.box_orders_product.color,t.num=e.box_orders_product.box_num,t.box_no=e.defective_order_no,t.product_size=e.box_orders_product.product_size?e.box_orders_product.product_size:"",t.box_date=e.box_time.split("T")[0],this.list.push(t)})})},handleReturn(){this.$router.go(-1)},handleClick(e){this.list[e].is_choose=!this.list[e].is_choose,this.selectData=this.list.filter(e=>e.is_choose),this.selectData.length==this.list.length?this.is_all=!0:this.is_all=!1,this.$forceUpdate()},close(){window.location.replace("about:blank"),window.close()},handlePrint1(){if(0===this.selectData.length)return this.$Message.warning("请选择需要打印的标签");this.$Message.success("操作成功!")},handlePrint(e){if(0===this.selectData.length)return this.$Message.warning("请选择需要打印的标签");let t=[{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(r=>{r.customer=r.customer?r.customer:" ",r.product_title=r.product_title?r.product_title:" ",r.order_number=r.order_number?r.order_number:" ",r.color=r.color?r.color:" ",r.box_date=r.box_date?r.box_date:"",r.process=r.process?r.process:" ",r.num=r.num?r.num:" ",r.customer1=r.customer&&r.customer.length>11?r.customer.slice(0,11):r.customer.slice(0),r.customer2=r.customer&&r.customer.length>11?r.customer.slice(11):"",r.product_title1=r.product_title&&r.product_title.length>12?r.product_title.slice(0,12):r.product_title.slice(0),r.product_title2=r.product_title&&r.product_title.length>12?r.product_title.slice(12):"",r.process1=r.process&&r.process.length>11?r.process.slice(0,11):r.process.slice(0),r.process2=r.process&&r.process.length>11?r.process.slice(11):"",r.color1=r.color&&r.color.length>12?r.color.slice(0,12):r.color.slice(0),r.color2=r.color&&r.color.length>12?r.color.slice(12):"",r.order_no=r.dispatch_no?r.dispatch_no:r.box_no,r.is_s=!!r.dispatch_no;let o,s=this.func.stringToHex(r.order_no).length%4;r.chip=this.func.stringToHex(r.order_no);for(let e=0;e<s;e++)r.chip="0"+r.chip;o=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,"+r.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,"+r.customer1},r.customer2?{PTK_DrawText_TrueType:"820,120,50,0,微软雅黑,1,700,0,0,0,"+r.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,"+r.product_title1},r.product_title2?{PTK_DrawText_TrueType:"300,220,50,0,微软雅黑,1,700,0,0,0,"+r.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,"+r.process1},r.process2?{PTK_DrawText_TrueType:"820,220,50,0,微软雅黑,1,700,0,0,0,"+r.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,"+r.color1},r.color2?{PTK_DrawText_TrueType:"300,320,50,0,微软雅黑,1,700,0,0,0,"+r.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,"+r.num},{PTK_DrawText_TrueType:"130,370,60,0,微软雅黑,1,700,0,0,0,"+(r.is_s?"派工单号:":"包装单号:")},{PTK_DrawText_TrueType:"330,370,60,0,微软雅黑,1,700,0,0,0,"+(r.dispatch_no?r.dispatch_no:r.box_no)},r.is_s?{}:{PTK_DrawText_TrueType:"700,370,60,0,微软雅黑,1,700,0,0,0,包装日期:"},r.is_s?{}:{PTK_DrawText_TrueType:"900,370,60,0,微软雅黑,1,700,0,0,0,"+r.box_date},{PTK_DrawText_TrueType:"130,525,60,0,微软雅黑,1,700,0,0,0,订单号:"},{PTK_DrawText_TrueType:"300,525,60,0,微软雅黑,1,700,0,0,0,"+r.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,"+r.customer1},r.customer2?{PTK_DrawText_TrueType:"820,575,50,0,微软雅黑,1,700,0,0,0,"+r.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,"+r.product_title1},r.product_title2?{PTK_DrawText_TrueType:"300,675,50,0,微软雅黑,1,700,0,0,0,"+r.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,"+r.process1},r.process2?{PTK_DrawText_TrueType:"820,675,50,0,微软雅黑,1,700,0,0,0,"+r.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,"+r.color1},r.color2?{PTK_DrawText_TrueType:"300,775,50,0,微软雅黑,1,700,0,0,0,"+r.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,"+r.num},{PTK_DrawText_TrueType:"130,825,60,0,微软雅黑,1,700,0,0,0,"+(r.is_s?"派工单号:":"包装单号:")},{PTK_DrawText_TrueType:"330,825,60,0,微软雅黑,1,700,0,0,0,"+(r.dispatch_no?r.dispatch_no:r.box_no)},r.is_s?{}:{PTK_DrawText_TrueType:"700,825,60,0,微软雅黑,1,700,0,0,0,包装日期:"},r.is_s?{}:{PTK_DrawText_TrueType:"900,825,60,0,微软雅黑,1,700,0,0,0,"+r.box_date},{PTK_RWRFIDLabel:`1,0,0,${r.chip.length/2},1,${r.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,"+r.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,"+r.customer1},r.customer2?{PTK_DrawText_TrueType:"720,120,50,0,微软雅黑,1,700,0,0,0,"+r.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,"+r.product_title1},r.product_title2?{PTK_DrawText_TrueType:"200,220,50,0,微软雅黑,1,700,0,0,0,"+r.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,"+r.process1},r.process2?{PTK_DrawText_TrueType:"720,220,50,0,微软雅黑,1,700,0,0,0,"+r.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,"+r.color1},r.color2?{PTK_DrawText_TrueType:"200,320,50,0,微软雅黑,1,700,0,0,0,"+r.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,"+r.num},{PTK_DrawText_TrueType:"30,370,60,0,微软雅黑,1,700,0,0,0,"+(r.is_s?"派工单号:":"包装单号:")},{PTK_DrawText_TrueType:"230,370,60,0,微软雅黑,1,700,0,0,0,"+(r.dispatch_no?r.dispatch_no:r.box_no)},r.is_s?{}:{PTK_DrawText_TrueType:"600,370,60,0,微软雅黑,1,700,0,0,0,包装日期:"},r.is_s?{}:{PTK_DrawText_TrueType:"800,370,60,0,微软雅黑,1,700,0,0,0,"+r.box_date},{PTK_DrawText_TrueType:"30,525,60,0,微软雅黑,1,700,0,0,0,订单号:"},{PTK_DrawText_TrueType:"200,525,60,0,微软雅黑,1,700,0,0,0,"+r.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,"+r.customer1},r.customer2?{PTK_DrawText_TrueType:"720,575,50,0,微软雅黑,1,700,0,0,0,"+r.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,"+r.product_title1},r.product_title2?{PTK_DrawText_TrueType:"200,675,50,0,微软雅黑,1,700,0,0,0,"+r.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,"+r.process1},r.process2?{PTK_DrawText_TrueType:"720,675,50,0,微软雅黑,1,700,0,0,0,"+r.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,"+r.color1},r.color2?{PTK_DrawText_TrueType:"200,775,50,0,微软雅黑,1,700,0,0,0,"+r.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,"+r.num},{PTK_DrawText_TrueType:"30,825,60,0,微软雅黑,1,700,0,0,0,"+(r.is_s?"派工单号:":"包装单号:")},{PTK_DrawText_TrueType:"230,825,60,0,微软雅黑,1,700,0,0,0,"+(r.dispatch_no?r.dispatch_no:r.box_no)},r.is_s?{}:{PTK_DrawText_TrueType:"600,825,60,0,微软雅黑,1,700,0,0,0,包装日期:"},r.is_s?{}:{PTK_DrawText_TrueType:"800,825,60,0,微软雅黑,1,700,0,0,0,"+r.box_date},{PTK_RWRFIDLabel:`1,0,0,${r.chip.length/2},1,${r.chip}`},{PTK_PrintLabel:"1,1"}],t.push(...o)}),t.push({PTK_CloseUSBPort:""});let r=this,o=JSON.stringify(t);console.log(t),T.a.ajax({type:"post",url:"http://127.0.0.1:888/postek/print",data:{reqParam:1,printparams:o},dataType:"json",timeout:5e3,success:function(e){"0"==e.retval?(r.$Message.success("发送成功"),setTimeout(()=>{},200)):r.$Message.error("发送失败,返回结果:"+e.msg)},error:function(){}})}}},a=i,c=(r("97ee"),r("2877")),l=Object(c["a"])(a,o,s,!1,null,"7490e467",null);t["default"]=l.exports},"97ee":function(e,t,r){"use strict";r("c1d1")},c1d1:function(e,t,r){}}]);