From b6e337c1b8c77fedde35bd985ba74455ec21bddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=93=B2=E5=A5=87?= <13840175730@139.com> Date: Mon, 16 Dec 2024 21:14:39 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8Dbug=202.=E4=B8=8A=E6=96=99?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AF=AD=E9=9F=B3=E6=8A=A5=E5=B7=A5=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/zyjhzx/sliao/index.vue | 71 ++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 3 deletions(-) diff --git a/src/views/zyjhzx/sliao/index.vue b/src/views/zyjhzx/sliao/index.vue index 4f07662..0535a39 100644 --- a/src/views/zyjhzx/sliao/index.vue +++ b/src/views/zyjhzx/sliao/index.vue @@ -47,6 +47,7 @@ export default { zt:'11', msg:null, tipsId:null, + llist:[], } }, mounted() { @@ -62,7 +63,65 @@ export default { created(){ // window.addEventListener('resize', this.initKonvaStage) }, - sockets:{}, + sockets:{ + zyjhzx(data){ + console.log(data) + if (this.deviceId!==data.msg.deviceId&&data.msg.actionType!=='开始报工'){ + return + } + //工单号尾号长度 + const djhWhLengh=3 + const tmpList=this.list.filter(item=>item.djh===data.msg.orderNumber||item.djh?.slice(-djhWhLengh)===data.msg.orderNumber) + if (tmpList.length>1){ + this.list=tmpList + this.drawSljhItem(tmpList) + this.$message.warning('短号有重复,请使用全工单号重新派工!!!') + return + } + console.log(this.currentDw,this.currentDwIndex) + if(!this.currentDw||this.currentDwIndex===-1){ + this.$message.warning('请选择上料垛位') + return; + } + + const currentWorker=this.getCurrentWorker() + if (!currentWorker){ + this.$message.warning('请选择报工人') + } + let index=-1 + for (const item of this.list) { + index+=1 + if (item.djh===data.msg.orderNumber||item.djh?.slice(-djhWhLengh)===data.msg.orderNumber){ + const data={ + ydjh:item, + ydid:item.id, + dwId:this.currentDw.id, + ceng:this.dw[this.currentDwIndex].list.length+1, + czbh:item.dcCh, + pl:item.dcPl, + fd:item.dcFd, + kw:item.kw, + zl:item.zl, + tlth:item.tzbh, + wph:item.wpxh, + wpgg:item.wpgg, + sljhrq:item.sljhrq, + qgjhrq:item.qgjhrq, + wlh:item.slwlh, + lph:item.sllph, + nbsbm:item.nbsbm, + bfr:currentWorker.userCode, + type:'YCL' + } + shangLiao(data).then(res=>{ + this.list.splice(index,1) + this.drawSljhItem(this.list) + }) + break + } + } + } + }, methods:{ initTlt(){ dict({bmlb:'QGKW'}).then(res=>{ @@ -71,6 +130,7 @@ export default { }, wsSubscribe(){ this.sockets.subscribe('slComplete', data => { + console.log(data) if (this.currentDw&&this.currentDw.id===data.dwId) { if (this.slGroup){ this.slGroup.destroyChildren() @@ -81,6 +141,10 @@ export default { this.dw[data.dwId].list.push(data) } this.initYcldw(); + for (const item of this.list) { + + } + }) this.sockets.subscribe('pwComplete', data => { this.initYcldw() @@ -112,6 +176,7 @@ export default { this.drawBaiFang=handler }, drawSljhItem(list){ + this.list=list if (this.sljhGroup){ this.sljhGroup.destroyChildren() } @@ -155,7 +220,7 @@ export default { fill:'#fff', align:'center', verticalAlign:'middle', - text:item.tzbh + text:item.djh }) qyGroup.add(tlth) @@ -402,7 +467,7 @@ export default { that.sljhItemList.splice(this.getAttr('index'),1) that.sljhGroup.destroyChildren() - that.drawSljhItem(that.sljhItemList.r('0:20')) + that.drawSljhItem(that.sljhItemList.r('0:200')) }else{ this.remove() _that.visible(true)