chunk-5190983c.1668695772318.js 19 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5190983c"],{"02b6":function(t,e,a){"use strict";a("36ce")},"0b42":function(t,e,a){},"36ce":function(t,e,a){},"3dce":function(t,e,a){},ab17:function(t,e,a){"use strict";a("3dce")},ac76:function(t,e,a){"use strict";a("0b42")},bc5c:function(t,e,a){"use strict";var s=function(){var t=this,e=t._self._c;return e("div",{staticClass:"header"},[e("div",{staticClass:"left"},[e("div",{staticClass:"avator"},[e("img",{attrs:{src:t.avator,width:"40px",height:"40px",alt:""}})]),t._v(" "+t._s(t.userName)+" ")]),e("div",{staticClass:"center"},[t._v(" "+t._s(t.time)+" ")]),e("div",{staticClass:"right",on:{click:t.logOut}},[t._v(" 退出 ")]),e("div",{staticClass:"sub-header"},[t._v(t._s(t.title))])])},i=[],o=a("c837"),r=a.n(o),n=a("c276"),c=a("e999"),l=a("8376"),d=a("57bc"),h={name:"my-nav",data(){return{getStoreTitle:n["a"],avator:r.a,logOut:n["c"],timer:null,time:"",connection:null}},computed:{title(){return Object(n["a"])(sessionStorage.getItem("plcCode"),sessionStorage.getItem("door"))},userName(){return this.$store.state.name}},methods:{SRConnection(){let t=this;async function e(){try{await t.connection.start()}catch(a){setTimeout(()=>e(),5e3)}}this.connection=(new c["a"]).withUrl(`${l["a"]}/plcHub?groupName=storage${sessionStorage.getItem("plcCode")}&door=${sessionStorage.getItem("door")}`).withAutomaticReconnect().withHubProtocol(new d["a"]).build(),this.connection.on("outStorageDataCheck",t=>{this.connection.invoke("ReturnSureMes",t.MesId),this.$emit("listener-out")}),this.connection.on("inStorageDataCheck",t=>{this.connection.invoke("ReturnSureMes",t.MesId),this.$emit("listener-in")}),this.connection.on("helperScanf",t=>{this.connection.invoke("ReturnSureMes",t.MesId),this.$emit("listener-helper",t.Data)}),this.connection.start().then(()=>{}).catch(t=>{e()}),this.connection.onclose(()=>{this.connection=null})},back(){this.$router.back()},toHome(){this.$router.push({name:"Home",query:{plcCode:sessionStorage.getItem("plcCode"),door:sessionStorage.getItem("door")}})}},mounted(){this.time=this.$dayjs().format("YYYY年MM月DD日 HH:mm:ss"),this.timer=setInterval(()=>{this.time=this.$dayjs().format("YYYY年MM月DD日 HH:mm:ss")},1e3)},destroyed(){clearInterval(this.timer)}},m=h,u=(a("02b6"),a("0b56")),p=Object(u["a"])(m,s,i,!1,null,"380441e2",null);e["a"]=p.exports},c259:function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t._self._c;return e("div",{staticClass:"container"},[e("my-nav",{on:{"listener-out":t.outHandle,"listener-helper":t.helperHandle}}),e("div",{staticClass:"content"},[t.reading?e("div",{staticClass:"reading"},[t._v(" 出库扫描中"),e("br"),t._v(" 请下架所需要的物料"),e("br"),t._v(" 并将物料推出感应门 ")]):e("div",{staticStyle:{height:"100%"}},[e("div",{staticStyle:{display:"flex","justify-content":"space-between","align-items":"center"}},[e("div",{staticStyle:{width:"108px"}}),e("div",{staticClass:"title"},[t._v("出库扫描")]),e("div",{staticStyle:{padding:"0 10px"}},[e("Button",{attrs:{type:"primary"},on:{click:function(e){t.scanShow=!0}}},[t._v("辅助扫描")])],1)]),e("div",{staticClass:"main"},[e("div",{staticClass:"list-wrap"},[e("div",{staticClass:"list",staticStyle:{"margin-right":"20px"}},[e("div",{staticClass:"sub-title"},[t._v("领料信息")]),e("div",{staticStyle:{height:"calc(100% - 46px)",overflow:"auto"}},t._l(t.data,(function(a,s){return e("div",{key:s,staticClass:"row"},[e("div",{staticClass:"col",staticStyle:{width:"50px","align-items":"center"}},[a.checked?e("Icon",{attrs:{type:"ios-checkmark-circle",color:"red",size:"18"}}):t._e()],1),e("div",{staticClass:"col",staticStyle:{flex:"1"}},[e("div",[t._v(t._s(a.materialName))]),e("div",[t._v(" 物料长度:"+t._s(a.quantity)+"米 ")])])])})),0)]),e("div",{staticClass:"list"},[e("div",{staticClass:"sub-title"},[t._v("本次出库")]),e("div",{staticStyle:{height:"calc(100% - 46px)",overflow:"auto"}},t._l(t.scanData.rfidTagItems,(function(a,s){return e("div",{key:s,staticClass:"row"},[e("div",{staticClass:"col",staticStyle:{width:"50px","align-items":"center"}}),e("div",{staticClass:"col",staticStyle:{flex:"1",overflow:"hidden"}},[t._v(" 标签值:"+t._s("**************"+a.rfid.substr(-6,6))+" ")]),e("div",{staticClass:"col",staticStyle:{flex:"1",overflow:"hidden"},style:{color:1===a.scanRfidStatus?"orange":2===a.scanRfidStatus?"red":"#fff"}},[e("div",[t._v(t._s(a.materialName))]),e("div",[t._v(" 物料长度:"+t._s(a.quantity||0)+"米 ")])]),e("div",{staticClass:"col",staticStyle:{width:"50px"}},[e("Icon",{staticStyle:{cursor:"pointer"},attrs:{type:"ios-trash",size:"20",color:"red"},on:{click:function(e){return t.del(a,s)}}})],1)])})),0)])]),e("div",{staticClass:"list-wrap bottom"},[e("div",{staticClass:"list"},[e("div",{staticClass:"sub-title"},[t._v(" 本次统计 "),e("a",{staticClass:"remark",attrs:{href:"#"},on:{click:function(e){t.remarkShow=!0}}},[t._v("填写备注")])]),e("div",{staticStyle:{height:"calc(100% - 46px)",overflow:"auto"}},t._l(t.materialItemsCopy,(function(a,s){return e("div",{key:s,staticClass:"row"},[e("div",{staticClass:"col",staticStyle:{flex:"3"},style:{color:1===a.scanRfidStatus?"orange":2===a.scanRfidStatus?"red":"#fff"}},[e("div",[t._v(t._s(a.materialName))])]),e("div",{staticClass:"col",staticStyle:{flex:"2"},style:{color:1===a.scanRfidStatus?"orange":2===a.scanRfidStatus?"red":"#fff"}},[e("div",[t._v(" 出库件数:"+t._s(a.tagCount||1)+" ")])]),e("div",{staticClass:"col",staticStyle:{flex:"2"},style:{color:1===a.scanRfidStatus?"orange":2===a.scanRfidStatus?"red":"#fff"}},[e("div",[t._v(" 出库数量:"+t._s(a.quantity)+"米 ")])])])})),0)])])]),e("div",{staticClass:"footer"},[e("Button",{staticStyle:{"margin-right":"20px"},attrs:{type:"error",size:"large"},on:{click:function(e){return t.pass(0)}}},[t._v("重新扫描")]),e("Button",{attrs:{type:"success",size:"large"},nativeOn:{click:function(e){return t.copyData()}}},[t._v("仓管校验")])],1)])]),e("Modal",{attrs:{"mask-closable":!1,closable:!1,fullscreen:!0,"footer-hide":!0},model:{value:t.modal,callback:function(e){t.modal=e},expression:"modal"}},[e("Progress",{staticStyle:{width:"400px"},attrs:{percent:t.percent,"stroke-color":["#108ee9","#87d068"],"hide-info":!0}})],1),e("Modal",{attrs:{closable:!1,"footer-hide":!0,"class-name":"vertical-center-modal"},on:{"on-cancel":t.cancel},model:{value:t.remarkShow,callback:function(e){t.remarkShow=e},expression:"remarkShow"}},[e("div",{staticClass:"remark-content"},[e("div",{staticClass:"title"},[t._v("填写备注")]),e("Input",{attrs:{type:"textarea",rows:10},model:{value:t.remark,callback:function(e){t.remark=e},expression:"remark"}}),e("div",{staticClass:"btn"},[e("Button",{staticStyle:{width:"120px"},attrs:{type:"success"},on:{click:t.cfm}},[t._v("确定")])],1)],1)]),e("Modal",{attrs:{"class-name":"vertical-center-modal"},on:{"on-cancel":t.cancel},model:{value:t.scanShow,callback:function(e){t.scanShow=e},expression:"scanShow"}},[e("div",{staticClass:"scan-title",attrs:{slot:"header"},slot:"header"},[t._v("辅助扫描")]),e("div",{staticClass:"scan-btn",attrs:{slot:"footer"},slot:"footer"},[e("Button",{staticStyle:{width:"80px"},attrs:{type:"primary"},on:{click:function(e){t.scanShow=!1}}},[t._v("关闭")])],1),t.otherData.length>0?e("div",{staticClass:"scan-content"},t._l(t.otherData,(function(a,s){return e("div",{key:s,staticClass:"item"},[e("div",{staticClass:"left"},[e("div",{staticClass:"row"},[t._v("RFID标签:"+t._s(a.rfidCode))]),e("div",{staticClass:"row"},[t._v("物料编码:"+t._s(a.materialCode))]),e("div",{staticClass:"row"},[t._v("物料名称:"+t._s(a.materialName))]),e("div",{staticClass:"row"},[t._v("最近操作:"+t._s(a.lastOpera))])]),e("div",{staticClass:"right"},[-1!==a.lastOpera.indexOf("入库")?e("Button",{attrs:{type:"primary",ghost:""},on:{click:function(e){return t.add(a)}}},[t._v(t._s(a.check?"已添加":"添加"))]):t._e()],1)])})),0):e("div",{staticStyle:{padding:"10px 0",color:"#ffffff"}},[t._v("暂无数据")])]),e("Modal",{attrs:{width:"80%","class-name":"vertical-center-modal","footer-hide":!0},model:{value:t.show,callback:function(e){t.show=e},expression:"show"}},[e("check-modal",{on:{"face-check":t.faceCheck}})],1)],1)},i=[],o=(a("a567"),a("bc5c")),r=(a("e999"),a("8376"),a("57bc"),a("4ff3")),n=a.n(r),c=a("4fcb"),l=a("c276"),d=function(){var t=this,e=t._self._c;return e("div",{staticClass:"container2",style:{backgroundImage:`url(${t.bg})`}},[e("div",{staticClass:"tracking-wrap"},[e("img",{staticClass:"border",attrs:{src:t.border,alt:""}}),e("div",{staticClass:"tracking",style:{opacity:0===t.tabIndex?"1":"0"}},[e("video",{attrs:{id:"video",width:"620",height:"460",preload:"",autoplay:"",loop:"",muted:""},domProps:{muted:!0}}),e("canvas",{attrs:{id:"canvas",width:"620",height:"460"}})])]),e("div",{staticClass:"form",style:{opacity:1===t.tabIndex?"1":"0"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.enterHandle.apply(null,arguments)}}},[e("div",{staticClass:"title"},[t._v("登录")]),e("div",{staticClass:"content"},[e("Form",{ref:"form",attrs:{model:t.form,rules:t.rules}},[e("FormItem",{attrs:{prop:"user"}},[e("Input",{attrs:{type:"text",placeholder:"请输入用户"},model:{value:t.form.account,callback:function(e){t.$set(t.form,"account",e)},expression:"form.account"}},[e("Icon",{attrs:{slot:"prepend",type:"ios-person-outline"},slot:"prepend"})],1)],1),e("FormItem",{attrs:{prop:"pwd"}},[e("Input",{attrs:{type:"password",placeholder:"请输入密码"},model:{value:t.form.password,callback:function(e){t.$set(t.form,"password",e)},expression:"form.password"}},[e("Icon",{attrs:{slot:"prepend",type:"ios-lock-outline"},slot:"prepend"})],1)],1)],1)],1),e("div",{staticClass:"btn"},[e("Button",{attrs:{type:"primary"},on:{click:t.login}},[t._v("密码登录")])],1)])])},h=[],m=(a("3b08"),a("8d4f"),a("9dae"),a("5723")),u=a("a396"),p=a.n(u),f=a("3625"),g=a.n(f),v={name:"Home",data(){return{modal:!1,loginTimer:null,saveFaceTimer:null,tabIndex:1,tabs:[{icon:"md-qr-scanner",text:"扫码登录"},{icon:"ios-contact-outline",text:"账户登录"}],type:"",form:{account:"",password:""},rules:{account:[{required:!0,message:"请输入用户",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}]},border:p.a,bg:g.a,trackerTask:null,tracking:!0,isUpdateFace:!1,video:null,tokenCopy:Object(l["b"])()}},props:{value:{type:Boolean,default:!1,require:!0}},watch:{value:{handler(t){this.$emit("input",this.value)},immediate:!0}},methods:{enterHandle(){this.login()},login(){this.$refs.form.validate(t=>{t&&Object(m["b"])(this.form).then(t=>{0===t.code&&(this.$store.commit("setToken",t.result.token),Object(m["f"])().then(t=>{0===t.code&&(t.result.isBindFace?this.toNext():(this.$Message.error("当前用户未绑定人脸,请绑定人脸后登入"),this.tabIndex=0,this.tracking=!0,this.trackerTask.run(),this.isUpdateFace=!0))}))})})},tabHandle(t){this.tabIndex=t,0===t?(this.tracking=!0,this.trackerTask.run()):(this.trackerTask.stop(),this.tracking=!1,this.isUpdateFace=!1,clearTimeout(this.loginTimer),clearTimeout(this.saveFaceTimer))},toNext(){const t=this;this.$store.dispatch("getUserInfo").then(e=>{if(["storekeeper","supervisor","ckjy"].includes(e.result.roleKey))return this.$Message.success("登录成功!"),this.$store.commit("setToken",t.tokenCopy),this.$store.dispatch("getUserInfo"),void t.$emit("face-check",!0);this.$Message.error("请联系仓库员或总监处理!")})},stopMediaStreamTrack(){"object"===typeof window.stream&&(this.video.srcObject=null,window.stream.stop())},openCamera(){let t=this,e=this.video=document.getElementById("video"),a=document.getElementById("canvas"),s=a.getContext("2d");s.lineWidth=2,s.strokeStyle="blue";let i=new tracking.ObjectTracker("face");i.setInitialScale(4),i.setStepSize(1),i.setEdgesDensity(.1),this.trackerTask=tracking.track("#video",i,{camera:!0}),i.on("track",(function(i){if(s.clearRect(0,0,a.width,a.height),t.tracking&&1===i.data.length){let a=i.data[0];s.strokeRect(a.x,a.y,a.width,a.height),t.tracking=!1;let o=document.createElement("canvas");o.width=e.width,o.height=e.height,t.isUpdateFace?o.getContext("2d").drawImage(e,a.x-100,a.y-100,a.width+500,a.height+500,0,0,800,800):o.getContext("2d").drawImage(e,a.x-100,a.y-100,a.width+500,a.height+500,0,0,400,400);let r=o.toDataURL("image/png");Object(m["a"])({data:{base64:r},sign:"_sign",source:"_source"}).then(e=>{0===e.code&&["storekeeper","supervisor","ckjy"].includes(e.result.roleKey)?(t.modal=!1,t.$emit("face-check",!0)):(t.$Message.info("请联系仓库员扫脸登录!"),t.loginTimer=setTimeout(()=>{t.tracking=!0},2e3))})}}))}},mounted(){},beforeDestroy(){this.trackerTask&&(this.trackerTask.stop(),this.stopMediaStreamTrack())}},y=v,C=(a("ab17"),a("0b56")),k=Object(C["a"])(y,d,h,!1,null,"599a9ee0",null),w=k.exports,I={name:"store-in",data(){return{scanShow:!1,show:!1,modal:!1,percent:0,addTimer:null,overTimer:null,data:[],scanData:{rfidTagItems:[],materialItems:[]},otherData:[],tempDelData:[],connection:null,reading:!1,remarkShow:!1,remark:"",rfidTagItemsCopy:[],newData:[],materialItemsCopy:[]}},components:{MyNav:o["a"],CheckModal:w},methods:{copyData(){this.show=!0,this.rfidTagItemsCopy=JSON.parse(JSON.stringify(this.scanData.rfidTagItems))},add(t){if(t.totalQuantity=t.qty,t.quantity=t.qty,t.check=!0,this.scanData.rfidTagItems.find(e=>e.rfidCode===t.rfidCode))this.$Message.error("物料已添加");else{this.scanData.rfidTagItems.push({...t,isTemp:!0}),this.scanData.materialItems.push({...t,isTemp:!0}),this.materialItemsCopy=[];for(let t=0;t<this.scanData.rfidTagItems.length;t++){const a=this.scanData.rfidTagItems[t];if(0==this.materialItemsCopy.length)this.materialItemsCopy.push({...a,tagCount:1});else{var e=!1;for(let t=0;t<this.materialItemsCopy.length;t++){const s=this.materialItemsCopy[t];a.materialCode===s.materialCode&&(e=!0,s.tagCount++,s.quantity+=a.quantity)}e||this.materialItemsCopy.push({...a,tagCount:1})}}this.$Message.info("添加成功")}},cancel(){this.remark=""},cfm(){this.remarkShow=!1},faceCheck(t){const e=this;Object(c["n"])({inOutStorageNo:"",storageDoor:sessionStorage.getItem("door"),plcStationCode:sessionStorage.getItem("plcCode"),rfidList:this.rfidTagItemsCopy.map(t=>t.rfid),remark:this.remark}).then(t=>{if(0===t.code){this.$Message.info("出库成功!");const t=[];for(let a=0;a<e.scanData.rfidTagItems.length;a++){const s=e.scanData.rfidTagItems[a];t.push({materialCode:s.materialCode,materialRfid:s.rfidCode,quantity:s.quantity})}n.a.post("/cloudApi/stockDetail/submitRestrictedPicking",{appointInfo:e.newData,actual:t,jobNo:window.localStorage.getItem("jobNo")}).then(t=>{}),Object(l["c"])()}else this.saveErr()},t=>{this.saveErr()})},saveErr(){const t=this,e=window.localStorage.getItem("errList");if(e)var a=JSON.parse(e);else a=[];var s=[];for(let i=0;i<t.scanData.rfidTagItems.length;i++){const e=t.scanData.rfidTagItems[i];s.push(e.rfidCode)}s.push(window.localStorage.getItem("jobNo")),a.push(s),window.localStorage.setItem("errList",JSON.stringify(a))},del(t,e){this.scanData.rfidTagItems.splice(e,1),this.scanData.materialItems.splice(e,1),this.tempDelData.push(t),this.materialItemsCopy=[];for(let s=0;s<this.scanData.rfidTagItems.length;s++){const t=this.scanData.rfidTagItems[s];if(0==this.materialItemsCopy.length)this.materialItemsCopy.push({...t,tagCount:1});else{var a=!1;for(let e=0;e<this.materialItemsCopy.length;e++){const s=this.materialItemsCopy[e];t.materialCode===s.materialCode&&(a=!0,s.tagCount++,s.quantity+=t.quantity)}a||this.materialItemsCopy.push({...t,tagCount:1})}}},helperHandle(t){t.map(t=>{t.check=!1}),this.otherData=[...this.otherData,...t],this.otherData=this.unique(this.otherData,"rfidCode")},outHandle(){this.getList(),clearTimeout(this.overTimer),this.overTimer=setTimeout(()=>{clearInterval(this.addTimer),this.percent=100,setTimeout(()=>{this.modal=!1},500)},3e3)},pass(t){0===t?(this.$Message.info("请重新扫描出库!"),this.scanData.rfidTagItems=[],this.scanData.materialItems=[],this.materialItemsCopy=[],this.tempDelData=[],window.ws&&window.ws.close(),setTimeout(()=>{this.socketInit()},500)):1===t&&Object(c["n"])({inOutStorageNo:"",storageDoor:sessionStorage.getItem("door"),plcStationCode:sessionStorage.getItem("plcCode"),rfidList:this.scanData.rfidTagItems.map(t=>t.rfidCode),remark:this.remark}).then(t=>{0===t.code&&(this.$Message.info("出库成功!"),Object(l["c"])())})},unique(t,e){const a=new Map;return t.filter(t=>!a.has(t[e])&&a.set(t[e],1))},getList(t){if(t){this.reading=!1,this.scanData.rfidTagItems=[...this.scanData.rfidTagItems,...t],this.scanData.materialItems=[...this.scanData.materialItems],this.scanData.rfidTagItems=this.unique(this.scanData.rfidTagItems,"rfid"),this.tempDelData.forEach(t=>{for(const e in this.scanData.rfidTagItems)t.rfid===this.scanData.rfidTagItems[e].rfid&&this.scanData.rfidTagItems.splice(e,1);for(const e in this.scanData.materialItems)t.materialCode===this.scanData.materialItems[e].materialCode&&this.scanData.materialItems.splice(e,1)}),this.materialItemsCopy=[];for(let t=0;t<this.scanData.rfidTagItems.length;t++){const a=this.scanData.rfidTagItems[t];if(0==this.materialItemsCopy.length)this.materialItemsCopy.push({...a,tagCount:1});else{var e=!1;for(let t=0;t<this.materialItemsCopy.length;t++){const s=this.materialItemsCopy[t];a.materialCode===s.materialCode&&(e=!0,s.tagCount++,s.quantity+=a.quantity)}e||this.materialItemsCopy.push({...a,tagCount:1})}}this.data.map(t=>{this.materialItemsCopy.map(t=>{})}),this.materialItemsCopy.forEach(t=>{this.data.forEach(e=>{if(t.materialCode===e.materialCode)throw t.quantity>=e.quantity?t.scanRfidStatus=1:t.scanRfidStatus=3,new Error("End Loop");t.scanRfidStatus=2})}),this.scanData.rfidTagItems.forEach(t=>{this.materialItemsCopy.forEach(e=>{t.scanRfidStatus=3,e.materialCode===t.materialCode&&(t.scanRfidStatus=e.scanRfidStatus)})}),this.data.forEach(t=>{this.scanData.rfidTagItems.forEach(e=>{t.materialCode===e.materialCode&&(t.checked=!0)})})}},getApplyTakeStockOut(){Object(c["c"])().then(t=>{0===t.code&&(this.data=t.result)})},socketInit(){const t=this;window.ws=new WebSocket("ws://192.168.1.97:8300/webStock/"+window.localStorage.getItem("token")),window.ws.onopen=function(){},window.ws.onmessage=function(e){var a=JSON.parse(e.data);1==a.type&&(a.data.instructions=2,a.data.businessType=2,a.data.stockHouseId="c185883dba22478cb593d33f6b66cc53",a.data.type=2,a.type=2,window.ws.send(JSON.stringify(a))),3==a.type&&t.getList(a.data.rfidData)},window.ws.onclose=function(t){},window.ws.onerror=function(t){}}},mounted(){this.otherData=JSON.parse(this.$route.query.otherData),this.newData=JSON.parse(this.$route.query.newData),this.socketInit(),this.tempDelData=[],this.getApplyTakeStockOut(),this.time=this.$dayjs().format("YYYY年MM月DD日 HH:mm"),this.timer=setInterval(()=>{this.time=this.$dayjs().format("YYYY年MM月DD日 HH:mm")},1e3),this.addTimer=setInterval(()=>{this.percent+=1,100===this.percent&&(clearInterval(this.addTimer),clearTimeout(this.overTimer),this.modal=!1)},100),this.overTimer=setTimeout(()=>{clearInterval(this.addTimer),this.percent=100,setTimeout(()=>{this.modal=!1},500)},3e3),this.scanData.rfidTagItems=[],this.scanData.materialItems=[],this.materialItemsCopy=[]},destroyed(){clearInterval(this.timer)}},S=I,b=(a("ac76"),Object(C["a"])(S,s,i,!1,null,"99d31c32",null));e["default"]=b.exports},c837:function(t,e,a){t.exports=a.p+"img/avator.cecc4b55.png"}}]);