(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{},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){}}]);