chunk-84f0305a.ff8f5d43.js 14 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-84f0305a"],{7362:function(e,t,o){"use strict";o.r(t);var i=function(){var e=this,t=e._self._c;return t("div",{staticStyle:{width:"100vw",height:"100vh"}},[t("div",{staticStyle:{display:"flex","justify-content":"center","align-items":"center","padding-top":"1rem",position:"relative"}},[t("div",{staticStyle:{position:"absolute",top:".2rem",left:"1rem",color:"#FFFFFF","font-weight":"bold","font-size":"3rem","letter-spacing":"1rem"}},[e._v("包装屏")]),t("Form",{staticStyle:{display:"flex"},attrs:{"label-width":150},nativeOn:{submit:function(e){e.preventDefault()},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(()=>!1).apply(null,arguments)}}},[t("FormItem",{attrs:{label:"销售订单号:"}},[t("Input",{staticStyle:{width:"25rem"},attrs:{clearable:"",placeholder:"请输入",size:"large"},on:{"on-focus":function(t){return e.handlefocus(null,null,2)}},model:{value:e.order_no,callback:function(t){e.order_no=t},expression:"order_no"}})],1),t("FormItem",{attrs:{"label-width":10}},[t("Button",{attrs:{type:"primary",ghost:"",size:"large"},on:{click:e.handleBlur}},[e._v("查询")])],1)],1),t("div",{staticStyle:{position:"absolute",top:"1.1rem",right:"0"}},[t("Button",{staticStyle:{"margin-right":"1rem"},attrs:{size:"large",id:"full_screen_btn",type:"primary"},on:{click:e.handleFullScreenClick}},[e._v(" "+e._s(e.isFullScreen?"收 缩":"全 屏")+" ")]),t("Button",{staticStyle:{"margin-right":"1rem"},attrs:{type:"primary",size:"large"},on:{click:e.handleSure}},[e._v("确认")]),t("Button",{staticStyle:{"margin-right":"1rem"},attrs:{size:"large"},on:{click:e.handleReturn}},[e._v("返回")])],1)],1),t("div",{staticClass:"bdy",style:e.state?{position:"relative",top:"-200px"}:{}},e._l(e.list,(function(o,i){return t("div",{key:i,staticClass:"item"},[t("div",{staticStyle:{position:"absolute",width:"2.4rem",height:"2.4rem",top:"0px",right:"0px","border-radius":"50%","background-color":"red",color:"#FFFFFF","text-align":"center","line-height":"1.6","font-size":"1.6rem"},on:{click:function(t){return e.handleDel(i)}}},[e._v("X")]),t("div",{staticClass:"it_ti"},[t("label",[e._v("包装时间:")]),t("DatePicker",{staticStyle:{width:"200px"},attrs:{type:"date",placeholder:"请选择"},model:{value:o.box_time,callback:function(t){e.$set(o,"box_time",t)},expression:"item.box_time"}})],1),t("div",{staticClass:"it_ti"},[t("label",[e._v("包装班组:")]),t("Select",{staticStyle:{width:"200px"},attrs:{clearable:"",filterable:"",transfer:""},on:{"on-change":e.handleChangeTeam},model:{value:o.team_id,callback:function(t){e.$set(o,"team_id",t)},expression:"item.team_id"}},e._l(e.teamList,(function(e){return t("Option",{key:e.id,attrs:{value:e.value,label:e.text}})})),1)],1),t("div",{staticClass:"it_ti"},[t("label",[e._v("包装人员:")]),t("Select",{staticStyle:{width:"200px"},attrs:{clearable:"",multiple:"",filterable:"",transfer:""},on:{"on-change":e.handleChangeEmp},model:{value:o.employee_id,callback:function(t){e.$set(o,"employee_id",t)},expression:"item.employee_id"}},e._l(e.employeeList,(function(e){return t("Option",{key:e.id,attrs:{value:e.value,label:e.text}})})),1)],1),t("Divider",[e._v("包装明细")]),e._l(o.children,(function(s,l){return t("div",{key:l,staticClass:"itemmingxi"},[t("div",{staticStyle:{position:"absolute",width:"2rem",height:"2rem",top:"-.4rem",right:"-.4rem","border-radius":"50%","background-color":"#c91d31",color:"#FFFFFF","text-align":"center","line-height":".6","font-size":"2.5rem"},on:{click:function(t){return e.handleDelItem(l)}}},[e._v("-")]),t("div",[t("label",[e._v("销售订单号:")]),t("span",[e._v(e._s(o.no))])]),t("div",[t("label",[e._v("经销商名称:")]),t("span",[e._v(e._s(s.exe_sale_order_b.jingxiaoshang_show))])]),t("div",[t("label",[e._v("产品编码:")]),t("span",[e._v(e._s(s.material_code))])]),t("div",{staticStyle:{display:"flex"}},[t("span",[e._v("产品名称:")]),t("span",{staticStyle:{width:"200px"}},[e._v(e._s(s.material_code_show))])]),t("div",{staticStyle:{display:"flex"}},[t("label",[e._v("规格型号:")]),t("span",{staticStyle:{width:"200px"}},[e._v(e._s(s.specs))])]),t("div",[t("label",[e._v("计量单位:")]),t("span",[e._v(e._s(s.unit_code_show))])]),t("div",[t("label",[e._v("工艺名称1:")]),t("span",[e._v(e._s(s.craft_type_code_show))])]),t("div",[t("label",[e._v("花色名称1:")]),t("span",[e._v(e._s(s.decor_code_show))])]),t("div",[t("label",[e._v("工艺名称2:")]),t("span",[e._v(e._s(s.craft_type_two_code_show))])]),t("div",[t("label",[e._v("花色名称2:")]),t("span",[e._v(e._s(s.decor_two_code_show))])]),t("div",[t("label",[e._v("包装数量:")]),t("Input",{staticStyle:{width:"150px"},attrs:{clearable:"",placeholder:"请输入"},on:{"on-focus":function(t){return e.handlefocus(i,l,1)}},model:{value:s.box_num,callback:function(t){e.$set(s,"box_num",t)},expression:"_item.box_num"}})],1),t("div",{staticStyle:{width:"100%",border:"1px solid #989595","border-radius":"10px"}},e._l(s.new_box_orders_label_producter,(function(o,s){return t("div",{key:s,staticStyle:{width:"100%",display:"flex","align-items":"center"}},[t("div",[t("label",[e._v("商标:")]),t("span",[e._v(e._s(o.product_title))])]),t("div",[t("label",[e._v("损耗数量:")]),t("Input",{staticStyle:{width:"150px"},attrs:{clearable:"",placeholder:"请输入"},on:{"on-focus":function(t){return e.handlefocus(i,l,3,s)}},model:{value:o.loss_num,callback:function(t){e.$set(o,"loss_num",t)},expression:"__item.loss_num"}})],1)])})),0)])}))],2)})),0),t("van-number-keyboard",{attrs:{show:e.show,theme:"custom","extra-key":".","close-button-text":"完成"},on:{blur:e.handleonBlur,input:e.onInput,delete:e.onDelete}})],1)},s=[],l={data(){return{itemIndexs:0,itemIndex:0,chooseIndex:0,state:!1,show:!1,isFullScreen:!1,list:[],order_no:"",teamList:[],equipmentList:[],employeeList:[],employee:{employee_id:null,employee_id_show:null},team:{team_id:null,team_id_show:null}}},created(){localStorage.getItem("dwy_url")||this.$router.push("/cms/chipScreen");const e={url:localStorage.getItem("dwy_url")+"jbl/api/module-data/team_list/page",post:{direction:"DESC",property:"id",fromClientType:"pc",number:0,sorts:[],rules:[],size:999,specialConditions:[],dynamicFormCode:"team",developmentSystemId:null,debugFlag:!0}};this.axios.post("/api/testdwy",{...e}).then(e=>{this.teamList=e.data.content.filter(e=>e.status),this.teamList.forEach(e=>{e.value=e.team_code,e.text=e.title})});const t={url:localStorage.getItem("dwy_url")+"jbl/api/module-data/team_code_btn/page",post:{direction:"DESC",property:"id",fromClientType:"pc",number:0,sorts:[],rules:[],size:999,specialConditions:[],workflowSearchBean:{},dynamicFormCode:"person",dynamicFormTable:null,ignoreField:!0,developmentSystemId:null,debugFlag:!0}};this.axios.post("/api/testdwy",{...t}).then(e=>{this.employeeList=e.data.content,this.employeeList.forEach(e=>{e.value=e.no,e.text=e.name})})},methods:{handleChangeTeam(e){if(e){let t,o=e,i=this.teamList.find(t=>t.value==e).text,s=this.teamList.find(t=>t.value==e);s.checkDisabled=!1,s.checked=!0,t=s,this.team={team_id:o,team_id_show:i,team_id_biz_data:t}}else this.team={team_id:null,team_id_show:null};console.log(this.team)},handleChangeEmp(e){if(0!=e.length){let t=e.toString(),o="",i=[];e.forEach((e,t)=>{let s=this.employeeList.find(t=>t.value==e).text,l=this.employeeList.find(t=>t.value==e);l.checkDisabled=!1,l.checked=!0,i.push(l),0==t?o=s:o+="$$$"+s}),this.employee={employee_id:t,employee_id_show:o,employee_id_biz_data:i}}else this.employee={employee_id_show:null,employee_id:null}},handlefocus(e,t,o,i){1==o&&(this.chooseIndex=e,this.itemIndex=t,this.state=!0),3==o&&(this.chooseIndex=e,this.itemIndex=t,this.itemIndexs=i,this.state=!0),this.sort=o,this.show=!0},onInput(e){1==this.sort?this.list[this.chooseIndex].children[this.itemIndex].box_num=this.list[this.chooseIndex].children[this.itemIndex].box_num+""+e:3==this.sort?this.list[this.chooseIndex].children[this.itemIndex].new_box_orders_label_producter[this.itemIndexs].loss_num=this.list[this.chooseIndex].children[this.itemIndex].new_box_orders_label_producter[this.itemIndexs].loss_num+""+e:this.order_no=this.order_no+""+e},onDelete(){1==this.sort?(this.list[this.chooseIndex].children[this.itemIndex].box_num+="",this.list[this.chooseIndex].children[this.itemIndex].box_num=this.list[this.chooseIndex].children[this.itemIndex].box_num.substring(0,this.list[this.chooseIndex].children[this.itemIndex].box_num.length-1)):3==this.sort?(this.list[this.chooseIndex].children[this.itemIndex].new_box_orders_label_producter[this.itemIndexs].loss_num+="",this.list[this.chooseIndex].children[this.itemIndex].new_box_orders_label_producter[this.itemIndexs].loss_num=this.list[this.chooseIndex].children[this.itemIndex].new_box_orders_label_producter[this.itemIndexs].loss_num.substring(0,this.list[this.chooseIndex].children[this.itemIndex].new_box_orders_label_producter[this.itemIndexs].loss_num.length-1)):this.order_no=this.order_no.substring(0,this.order_no.length-1)},handleonBlur(){this.show=!1,this.state=!1,2==this.sort&&this.handleBlur()},handleDelItem(e,t){this.list[e].children.splice(t,1)},handleDel(e){this.list.splice(e,1)},handleReturn(){this.isFullScreen&&this.handleFullScreenClick(),this.$router.go(-1)},handleFullScreenClick(){this.isFullScreen=!this.isFullScreen,this.isFullScreen?this.enterFullScreen():this.exitFullScreen()},enterFullScreen(){let e=document.documentElement,t=e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullscreen;if(t)t.call(e);else if("undefined"!==typeof window.ActiveXObject){let e=new ActiveXObject("WScript.Shell");null!=e&&e.SendKeys("{F11}")}},handleSure(){return this.team.team_id?this.employee.employee_id?this.list.some(e=>0==e.children.length)?this.$Message.warning("请确认包装数据!"):this.list.some(e=>e.children.some(e=>e.box_num<=0))?this.$Message.warning("请确认包装数量!"):void this.list.forEach((e,t)=>{let o={box_time:new Date(Date.parse(e.box_time)).toISOString(),created_by:null,created_date:null,defective_order_no:null,...this.employee,last_modified_by:null,last_modified_date:null,query_order_on:e.no,remark:null,site:null,status:"PACKAGED",...this.team},i=[],s=[],l=[];e.children.forEach(e=>{let t={box_num:e.box_num,brand_code:e.brand_code,brand_code_show:e.brand_code_show,color:e.color,color_code:e.color_code,color_code_two:e.color_code_two,color_two:e.color_two,craft_type_dk:e.carft_type_dk,craft_type_dk_show:e.carft_type_dk_show,customer_name:e.customer_name,customer_no:e.customer_no,dealer_name:e.dealer_name,dealer_no:e.dealer_no,item_num:e.item_num,not_box_num_total:e.not_box_num_total,order_item_id:e.order_item_id,order_item_no:e.order_item_no,order_no:e.order_no,process_code_two:e.process_code_two,process_title:e.process_title,process_title_two:e.process_title_two,product_no:e.product_no,product_size:e.product_size,product_title:e.product_title,product_unit:e.product_unit,product_unit_title:e.product_unit_title,site:null};s.push(t),l.push(t),e.new_box_orders_label_producter.forEach(e=>{e.loss_num>0&&i.push(e)})});const n={url:localStorage.getItem("dwy_url")+"jbl/api/module-data/box_orders/box_orders",post:{bizId:-1,bizTypeEk:"LOWCODE",data:{box_orders:o,box_orders_label_product:i,box_orders_product:s,production_orders_dtl:l},dynamicFormId:"474107044420857856",showModelId:"474108545251880960"}};this.$Message.loading({content:"正在上传数据...",duration:0}),this.axios.post("/api/testdwy",{...n}).then(e=>{this.$Message.destroy(),200==e.code&&(this.$Message.success(e.msg),t==this.list.length-1&&(this.list=[]))})}):this.$Message.warning("请选择包装人员!"):this.$Message.warning("请选择包装班组!")},exitFullScreen(){let e=document,t=e.cancelFullScreen||e.mozCancelFullScreen||e.msExitFullscreen||e.webkitExitFullscreen||e.exitFullscreen;if(t)t.call(e);else if("undefined"!==typeof window.ActiveXObject){let e=new ActiveXObject("WScript.Shell");null!=e&&e.SendKeys("{F11}")}},handleBlur(){if(this.order_no){let e=this.list.map(e=>e.no);const t={url:localStorage.getItem("dwy_url")+"jbl/api/module-data/sale_order/page",post:{debugFlag:!1,developmentSystemId:null,direction:"DESC",dynamicFormCode:"sale_order",dynamicFormTable:null,fromClientType:"pc",ignoreField:!0,number:0,property:"id",rules:[{field:"exe_sale_order_b.no",option:"LIKE_ANYWHERE",values:[this.order_no]}],size:999,sorts:[],specialConditions:[],workflowSearchBean:{}}};this.axios.post("/api/testdwy",{...t}).then(t=>{if(0!=t.data.content.length&&-1==e.indexOf(t.data.content[0].exe_sale_order_b.no)){t.data.content.forEach((e,t)=>{e.item_num=t+1,e.product_no=e.material_code,e.product_title=e.material_code_show,e.process_code=e.craft_type_code,e.color_code=e.decor_model,e.process_code_two=e.craft_type_two_code,e.color_code_two=e.decor_two_model,e.process_title=e.craft_type_code_show,e.color=e.decor_code_show,e.process_title_two=e.craft_type_two_code_show,e.color_two=e.decor_two_code_show,e.product_size=e.specs,e.product_unit=e.unit_code,e.product_unit_title=e.unit_code_show,e.order_no=e.exe_sale_order_b.no,e.order_item_id=e.id,e.order_item_no=e.item_no,e.customer_no=e.exe_sale_order_b.customer_code,e.customer_name=e.exe_sale_order_b.customer_code_show,e.dealer_no=e.exe_sale_order_b.jingxiaoshang,e.dealer_name=e.exe_sale_order_b.jingxiaoshang_show,e.brand_code=e.prod_trademark_compare_c.brand_code,e.brand_code_show=e.prod_trademark_compare_c.brand_code_show,e.site=null,e.box_num=e.not_box_num_total,e.not_box_num_total=e.box_num,e.new_box_orders_label_producter=[];let o=e.prod_trademark_compare_c.brand_code.split(","),i=e.prod_trademark_compare_c.brand_code_show.split("$$$");o.forEach((t,o)=>{let s={item_num:e.item_num,product_no:t,product_title:i[o],product_size:e.specs,product_unit:e.unit_code,product_unit_title:e.unit_code_show,order_no:e.exe_sale_order_b.no,order_item_id:e.id,order_item_no:e.item_no,site:null,not_box_num_total:e.not_box_num_total,loss_num:""};e.new_box_orders_label_producter.push(s)})});let e={...t.data.content[0].exe_sale_order_b,box_time:new Date,children:t.data.content};e.no=t.data.content[0].exe_sale_order_b.no,this.list.push(e),console.log(this.list),this.order_no=""}else this.order_no=""})}}}},n=l,r=(o("e48b"),o("2877")),d=Object(r["a"])(n,i,s,!1,null,"2fd2a050",null);t["default"]=d.exports},d17e:function(e,t,o){},e48b:function(e,t,o){"use strict";o("d17e")}}]);