1.优化作业计划执行,调整理料间垛位及显示内容

2.修改pc端作业计划执行各工序数据查看逻辑,以上道序完工为依据下道序才能看到可操作数据
3.修正上料理料完成后垛位未更新的bug
master
董哲奇 8 months ago
parent 092b6828d9
commit a62d88a55a

@ -94,7 +94,7 @@ import {endLoading, startLoading} from "@/utils";
import {Message} from "element-ui";
import ProjectSelect from "@/components/ProjectSelect/index.vue";
export default {
name: "dhqdWH",
name: "DhqdWH",
components: {ProjectSelect},
data() {
return {

@ -200,7 +200,7 @@ export default {
field:'',
user:'',
jhrqField:'',
zt:'11',
zt:'42',
qgkw:''
},
statusOptions: [
@ -209,7 +209,7 @@ export default {
label: "已打印",
},
{
value: "32",
value: "42",
label: "未派工",
},
{

@ -202,7 +202,7 @@ export default {
field:'',
user:'',
jhrqField:'',
zt:'11',
zt:'21',
qgkw:''
},
zyqs:[],

@ -192,7 +192,7 @@ export default {
field:'',
user:'',
jhrqField:'',
zt:'11',
zt:'42',
ztHx:'52'
},
zyqs:[],

@ -205,18 +205,18 @@ export default {
pl:'',
fd:'',
fkyy:'',
zt:'01',
zt:'62',
tlth:'',
'lx':'q',
qgkw:''
},
statusOptions: [
{
value: "01",
label: "编制",
value: "62",
label: "未派工",
},
{
value: "02",
value: "82",
label: "派工",
},
{

@ -130,7 +130,7 @@ export default function (width,height,callback){
width: width,
height: height,
fill:'white',
text:`${formatName()}\n${item.list.length}`,
text:`${item.name}\n${item.list.length}`,
align:'center',
verticalAlign:'middle',
fontSize:14

@ -89,7 +89,7 @@ export default function (width,height){
width: width,
height: height,
fill:'white',
text:`${formatName()}\n${item.list.length}`,
text:`${item.name}\n${item.list.length}`,
align:'center',
verticalAlign:'middle',
fontSize:14

@ -123,7 +123,7 @@ export default function (width,height,callback){
width: width,
height: height,
fill:'white',
text:`${formatName()}\n${item.list.length}`,
text:`${item.name}\n${item.list.length}`,
align:'center',
verticalAlign:'middle',
fontSize:14

@ -15,7 +15,7 @@ import drawDw from './comps/dw'
import drawPgd from './comps/pgd'
import baifang from "./comps/baifang";
import {sljh} from "@/views/zyjhzx/lliaofkui/comps/sljh";
import {getPgd,getPgd2, getYcldw, shangLiao} from "@/api/zyjh";
import {bgControl, getPgd, getPgd2, getYcldw, shangLiao} from "@/api/zyjh";
import {getBzryList} from "@/api/sjzx/bzzGL";
import ZyjhSelectComp from "@/views/zyjhzx/components/SelectComp.vue";
import TipsComp from "@/views/zyjhzx/components/TipsComp.vue";
@ -65,6 +65,10 @@ export default {
}
},
mounted() {
Array.prototype.r = function(str){
const [start,end]=str.split(':').map(Number);
return this.slice(start, end);
}
this.$socket.open()
this.wsSubscribe()
this.initKonvaStage();
@ -88,40 +92,41 @@ export default {
let index=0
for (const item of this.sljhItemList) {
if (item.djh===data.djh||item.djh.slice(-djhWhLengh)===data.msg.orderNumber){
if (!!this.currentDw.tzbh&&item.kw===this.currentDw.tzbh){
const tmpZxData={
id:item.id,
lldw:this.currentDw.id,
llcs:this.dw[this.currentDwIndex].list.length+1,
llfkry:this.getCurrentWorker()?.userCode
}
const data={
ydjh:tmpZxData,
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,
bfr:this.currentWorker?.userCode,
type:'LLJ'
}
// if (!!this.currentDw.tzbh&&item.kw===this.currentDw.tzbh){
//
// }else{
// this.$message.warning(`,${this.kwNameFormat(item.kw)}`)
// }
const tmpZxData={
id:item.id,
lldw:this.currentDw.id,
llcs:this.dw[this.currentDwIndex].list.length+1,
llfkry:this.getCurrentWorker()?.userCode
}
const data={
ydjh:tmpZxData,
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,
bfr:this.currentWorker?.userCode,
type:'LLJ'
}
shangLiao(data).then(res=>{})
shangLiao(data).then(res=>{})
this.sljhItemList.splice(index,1)
this.sljhGroup.destroyChildren()
this.drawSljhItem(this.sljhItemList)
}else{
this.$message.warning(`理料垛位错误,请放入${this.kwNameFormat(item.kw)}所在垛位`)
}
this.sljhItemList.splice(index,1)
this.sljhGroup.destroyChildren()
this.drawSljhItem(this.sljhItemList.r('0:20'))
break
}
index++
@ -140,43 +145,9 @@ export default {
} else {
this.dw[data.dwId].list.push(data)
}
this.initSljhItem()
this.initDw()
})
// this.sockets.subscribe('zyjhzx', data => {
// if (this.zt===data.zt){
// const item=data.zyjh
// let dwId=0
// let dwCeng=0
// for (const dw of this.dw) {
// if(dw.tzbh===data.zyjh.kw){
// dwId=dw.dwId
// dwCeng=dw.list.length
// }
// }
// const tmp={
// ydjh:item,
// dwId:dwId,
// ceng:dwCeng+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,
// bfr:data.zyjh.llry,
// type:'LLJ'
// }
//
// shangLiao(tmp).then(res=>{})
//
// }else{
// this.$message.error(`:${data.gdh}`)
// }
// })
},
initPgd(pgd={}){
const group=this.drawGd(pgd)
@ -247,47 +218,48 @@ export default {
const maxY=y+that.height*0.8-20
if(thisX>=x&&thisY>=y&&thisX<=maxX&&thisY<=maxY){
const item=this.getAttr('item')
if (!!that.currentDw.tzbh&&item.kw===that.currentDw.tzbh){
item.lldw=that.currentDw.id
item.llcs=that.dw[that.currentDwIndex].list.length+1
item.llfkry=that.getCurrentWorker()?.userCode
const tmpZxData={
id:item.id,
lldw:that.currentDw.id,
llcs:that.dw[that.currentDwIndex].list.length+1,
llfkry:that.getCurrentWorker()?.userCode
}
const data={
ydjh:tmpZxData,
ydid:item.id,
dwId:that.currentDw.id,
ceng:that.dw[that.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,
bfr:that.currentWorker?.userCode,
type:'LLJ'
}
// if (!!that.currentDw.tzbh&&item.kw===that.currentDw.tzbh){
//
// }else{
// that.$message.warning(`,${that.kwNameFormat(item.kw)}`)
// this.remove()
// _that.visible(true)
// }
item.lldw=that.currentDw.id
item.llcs=that.dw[that.currentDwIndex].list.length+1
item.llfkry=that.getCurrentWorker()?.userCode
const tmpZxData={
id:item.id,
lldw:that.currentDw.id,
llcs:that.dw[that.currentDwIndex].list.length+1,
llfkry:that.getCurrentWorker()?.userCode
}
const data={
ydjh:tmpZxData,
ydid:item.id,
dwId:that.currentDw.id,
ceng:that.dw[that.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,
bfr:that.currentWorker?.userCode,
type:'LLJ'
}
shangLiao(data).then(res=>{})
shangLiao(data).then(res=>{})
this.remove()
this.remove()
that.sljhItemList.splice(this.getAttr('index'),1)
that.sljhGroup.destroyChildren()
that.drawSljhItem(that.sljhItemList)
}else{
that.$message.warning(`理料跨位错误,请放入${that.kwNameFormat(item.kw)}所在垛位`)
this.remove()
_that.visible(true)
}
that.sljhItemList.splice(this.getAttr('index'),1)
that.sljhGroup.destroyChildren()
that.drawSljhItem(this.sljhItemList.r('0:20'))
}else{
this.remove()
_that.visible(true)
@ -359,10 +331,25 @@ export default {
})
},
initSljhItem(){
getPgd2({field:'llfkry'}).then(res=>{
this.sljhItemList=res.data
this.drawSljhItem(res.data)
bgControl({}).then(res=>{
const gx=res.data||'1'
if (gx==='1'){
const data={
zt:'32',
}
getPgd(data).then(res => {
this.sljhItemList=res.data
this.drawSljhItem(this.sljhItemList.r('0:20'))
})
}
if (gx==='0'){
getPgd2({field:'llfkry'}).then(res=>{
this.sljhItemList=res.data
this.drawSljhItem(this.sljhItemList.r('0:20'))
})
}
})
},
initKonvaStage(){
this.width=this.$refs.pwpg.clientWidth

@ -89,7 +89,7 @@ export default function (width,height){
width: width,
height: height,
fill:'white',
text:`${formatName()}\n${item.list.length}`,
text:`${item.name}\n${item.list.length}`,
align:'center',
verticalAlign:'middle',
fontSize:14

@ -1,5 +1,5 @@
<template>
<VxeGrid v-bind="gridOptions" @cell-click="cellClick" />
<VxeGrid v-bind="gridOptions" @cell-click="cellClick" @checkbox-change="checkboxChange" @checkbox-all="checkboxAll" />
</template>
<script>
@ -58,10 +58,18 @@ export default {
}
},
methods:{
checkboxAll({checked}) {
this.$message.warning('不允许一次报工多条')
},
checkboxChange({checked, row}) {
const tmpArr=[{
id:row.id,
pwfkry: row.pwry
}]
this.baogong(tmpArr,row)
},
baogong(tmpArr,data){
let ycldwInfo=null
console.log(data)
console.log(this.dw)
for (const dw of this.dw) {
for (const info of dw.list) {
if (data.dcCh===info.czbh&&data.dcPl===info.pl&&data.dcFd===info.fd&&data.tzbh===info.tlth){

@ -96,11 +96,8 @@ export default function (width,height,callback){
setSelectShape(shape)
}
group.selected=selected
console.log(group)
const text=new Konva.Text({
x:0,
y:0,

@ -59,21 +59,13 @@ export default {
sockets:{},
methods:{
wsSubscribe(){
this.sockets.subscribe('slComplete', data => {
this.initDw()
})
this.sockets.subscribe('pwComplete', data => {
if (this.currentDw&&this.currentDw.id===data.dwId) {
if (this.slGroup){
this.slGroup.destroyChildren()
}
for (let i = 0; i < this.dw[this.currentDwIndex].list.length; i++) {
const item=this.dw[this.currentDwIndex].list[i]
if (item.czbh===data.czbh&&item.pl===data.pl&&item.tlth===data.tlth){
this.dw[this.currentDwIndex].list.splice(i,1)
break
}
}
this.drawBaiFang(this.dw[this.currentDwIndex].list)
this.$refs.pwpgd.initData(this.currentWorker.userCode,'31')
this.initDw()
this.initDw()
if (this.slGroup){
this.slGroup.destroyChildren()
}
})
},
@ -82,16 +74,18 @@ export default {
this.pgdGroup.add(group)
},
pgdClick(option){
const children=this.dwGroup.find('Group')
let index=-1
let dw=null
for (const item of this.dw) {
index+=1
if (item.id===option.slycldw){
dw=item
break
}
}
this.dwGroup.children[index].selected()
children[index].selected()
this.initDwInfo(index,dw)
const that=this

@ -41,6 +41,7 @@ export default {
workerGroup:null,
person:null,
deviceId:null,
dwGroup:null,
}
},
mounted() {
@ -51,16 +52,25 @@ export default {
this.deviceId=this.$route.query.deviceId||''
window.addEventListener('resize', this.initKonvaStage)
},
sockets:{},
sockets:{
slComplete(){
this.initDw()
this.$refs.pwpgd.initData()
}
},
methods:{
initPgd(pgd={}){
const group=this.drawGd(pgd)
this.pgdGroup.add(group)
},
initDw(){
if (this.dwGroup){
this.dwGroup.destroyChildren()
}
getYcldw({type:'ycl'}).then(res=>{
const {container,dw}=drawDw(this.width,this.height)
const {bgGroup,group}=container()
this.dwGroup=group;
this.layer.add(bgGroup)
for (let i=0;i<res.data.length;i++){

@ -131,7 +131,7 @@ export default function (width,height,callback){
width: width,
height: height,
fill:'white',
text:`${formatName()}\n${item.list.length}`,
text:`${item.name}\n${item.list.length}`,
align:'center',
verticalAlign:'middle',
fontSize:14

@ -89,7 +89,7 @@ export default function (width,height){
width: width,
height: height,
fill:'white',
text:`${formatName()}\n${item.list.length}`,
text:`${item.name}\n${item.list.length}`,
align:'center',
verticalAlign:'middle',
fontSize:14

@ -82,6 +82,9 @@ export default {
}
this.initYcldw();
})
this.sockets.subscribe('pwComplete', data => {
this.initYcldw()
})
this.sockets.subscribe('tips', data => {
})

Loading…
Cancel
Save