|
|
|
@ -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)
|
|
|
|
|