1.优化调整,修复bug

master
董哲奇 7 months ago
parent 2a27232719
commit 243f4a77ba

@ -1,13 +1,19 @@
<template> <template>
<VxeGrid ref="hxPgd" v-bind="gridOptions" @cell-click="cellClick" @current-change="getCurrentData" /> <VxeGrid ref="hxPgd" v-bind="gridOptions" @cell-click="cellClick" @current-change="getCurrentData" @checkbox-change="checkboxChange" @checkbox-all="checkboxAll" />
</template> </template>
<script> <script>
import { VXETable } from 'vxe-table'
import paoWanPgdConfig from './pgdTable' import paoWanPgdConfig from './pgdTable'
import {getDw, getForemanByWorker, getPgd, getPgd2, getYdjhByZtOrForeman, zx} from "@/api/zyjh"; import {getDw, getForemanByWorker, getPgd, getPgd2, getYdjhByZtOrForeman, zx} from "@/api/zyjh";
export default { export default {
name:'HxianPgd', name:'HxianPgd',
props:{ props:{
worker:{
type:Function,
default:function (){}
},
workers:{ workers:{
type:Array, type:Array,
default:[] default:[]
@ -41,7 +47,8 @@ export default {
if (item.djh===data.msg.orderNumber||item.djh.slice(-djhWhLengh)===data.msg.orderNumber){ if (item.djh===data.msg.orderNumber||item.djh.slice(-djhWhLengh)===data.msg.orderNumber){
const tmpArr=[{ const tmpArr=[{
id:item.id, id:item.id,
hxfkry:item.hxry hxfkry:this.$props.worker().userCode,
zt:item.zt
}] }]
this.baogong(tmpArr,item) this.baogong(tmpArr,item)
break break
@ -56,6 +63,26 @@ export default {
this.gridOptions.columns=columns this.gridOptions.columns=columns
}, },
methods:{ methods:{
checkboxAll({checked}) {
const worker = this.$props.worker
if (!worker) {
this.$message.warning('请选择操作人')
return;
}
if (checked) {
this.fankgui(worker)
}
},
checkboxChange({checked, row}) {
const worker = this.$props.worker()
if (!worker) {
this.$message.warning('请选择操作人')
return;
}
if (checked) {
this.fankgui(worker)
}
},
baogong(tmpArr,data){ baogong(tmpArr,data){
let ycldwInfo=null let ycldwInfo=null
for (const dw of this.dw) { for (const dw of this.dw) {
@ -78,16 +105,52 @@ export default {
}).then(res=>{ }).then(res=>{
if (res.success){ if (res.success){
window.localStorage.removeItem('zyjh') window.localStorage.removeItem('zyjh')
this.initData(data.pwry,'51') this.initData(this.$props.worker().userCode,'51')
} }
}) })
}, },
fankgui(worker) {
const list = this.$refs.hxPgd.getCheckboxRecords()
const tmpArr = []
for (const item of list) {
const data = {
id: item.id,
hxfkry: worker.userCode,
zt:item.zt
}
tmpArr.push(data)
}
let ycldwInfo=null
// 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){
// ycldwInfo=info
// break
// }
// }
// }
if (!ycldwInfo){
ycldwInfo={}
}
const data = {
type: this.type,
field: 'hxfkrq',
zxZtName: 'HXFK',
list: tmpArr,
ycldwInfo:ycldwInfo
}
VXETable.modal.confirm('您确定报工吗?').then(res => {
res === 'confirm' && zx(data).then(res=>{
this.initData(this.$props.worker().userCode,'51')
})
})
},
initData(worker,zt){ initData(worker,zt){
getDw({type:'llj'}).then(res=>{ getDw({type:'llj'}).then(res=>{
this.gridOptions.ycldw=res.data this.gridOptions.ycldw=res.data
getForemanByWorker({worker:worker}).then(res=>{ getForemanByWorker({worker:worker}).then(res=>{
getYdjhByZtOrForeman({foreman:res.data.userCode,zt:zt,field:'hxpgry'}).then(res=>{ getYdjhByZtOrForeman({foreman:res.data.userCode,zt:zt,field:'hxpgry'}).then(res=>{
this.list=res.data this.list=res.data.filter(item=>item.hxfkry)
this.gridOptions.data=res.data this.gridOptions.data=res.data
this.setExt('workers',this.$props.workers) this.setExt('workers',this.$props.workers)
}) })

@ -148,6 +148,6 @@ export default function (width,height){
} }
return{ return{
container,person container,person,getCurrentWorker
} }
} }

@ -34,12 +34,8 @@ export default function () {
} }
const dwFormat=function ({cellValue}){ const dwFormat=function ({cellValue}){
for (const item of options.ycldw) { for (const item of options.ycldw) {
if (cellValue===(item.id+"")){ if (cellValue===item.id+''){
for (const it of ycldw){ return item.name
if (it.bm===item.tzbh){
return it.bmsm
}
}
} }
} }
} }
@ -57,6 +53,8 @@ export default function () {
{field: 'slwlh', title: '炉批号', width: 100}, {field: 'slwlh', title: '炉批号', width: 100},
{field: 'tzbh', title: '套料图号', width: 100}, {field: 'tzbh', title: '套料图号', width: 100},
{field: 'hxry', title: '接收人', width: 80,formatter: nameFormat}, {field: 'hxry', title: '接收人', width: 80,formatter: nameFormat},
{field: 'hxfkry', title: '报工人', width: 80,formatter:nameFormat},
{field: 'hxfkrq', title: '报工时间', width: 100},
{field: 'hxpgry', title: '派工人', width: 80,formatter: nameFormat}, {field: 'hxpgry', title: '派工人', width: 80,formatter: nameFormat},
{field: 'hxpgrq', title: '派工时间', width: 100}, {field: 'hxpgrq', title: '派工时间', width: 100},
] ]

@ -1,7 +1,7 @@
<template> <template>
<div class="container"> <div class="container">
<div id="pwpg" class="pwpg" ref="pwpg"></div> <div id="pwpg" class="pwpg" ref="pwpg"></div>
<HxianPgd id="hxpgd" ref="hxpgd" @initPgd="initPgd" :pgd="pgd" :workers="workers" :dw="dw" @pgdClick="pgdClick"/> <HxianPgd id="hxpgd" ref="hxpgd" @initPgd="initPgd" :pgd="pgd" :workers="workers" :worker="getWorker" :dw="dw" @pgdClick="pgdClick"/>
<ZyjhSelectComp id="selectComp" ref="selRef" @initWorkers="initWorkers"/> <ZyjhSelectComp id="selectComp" ref="selRef" @initWorkers="initWorkers"/>
<TipsComp /> <TipsComp />
<Drawer ref="drawer"/> <Drawer ref="drawer"/>
@ -149,6 +149,9 @@ export default {
} }
}) })
}, },
getWorker(){
return this.getCurrentWorker()
},
initWorkers(bzType){ initWorkers(bzType){
if (this.workerGroup){ if (this.workerGroup){
this.workerGroup.destroyChildren() this.workerGroup.destroyChildren()

@ -34,14 +34,14 @@ export default {
} }
// //
const djhWhLengh=3 const djhWhLengh=3
const tmpList=this.list.filter(item=>item.plxh===data.msg.orderNumber||item.plxh.slice(-djhWhLengh)===data.msg.orderNumber) const tmpList=this.list.filter(item=>item.plxh===data.msg.orderNumber||item.plxh?.slice(-djhWhLengh)===data.msg.orderNumber)
if (tmpList.length>1){ if (tmpList.length>1){
this.list=tmpList this.list=tmpList
this.$message.warning('短号有重复,请使用完整工单号重新派工!!!') this.$message.warning('短号有重复,请使用完整工单号重新派工!!!')
return return
} }
for (const item of this.list) { for (const item of this.list) {
if (item.plxh===data.msg.orderNumber||item.plxh.slice(-djhWhLengh)===data.msg.orderNumber){ if (item.plxh===data.msg.orderNumber||item.plxh?.slice(-djhWhLengh)===data.msg.orderNumber){
this.paigong0(item) this.paigong0(item)
break break
} }
@ -151,6 +151,14 @@ export default {
}) })
}) })
}, },
privateCheck(){
const worker=this.$props.worker()
if (!worker){
this.$message.warning('请选择操作人')
return false;
}
return true
},
cellClick({row}){ cellClick({row}){
// this.$emit('initPgd',row) // this.$emit('initPgd',row)
pdfList({ pdfList({

@ -3,11 +3,16 @@
</template> </template>
<script> <script>
import { VXETable } from 'vxe-table'
import paoWanPgdConfig from './pgdTable' import paoWanPgdConfig from './pgdTable'
import {getDw, getForeman, getForemanByWorker, getPgd, getYcldw, getYdjhByZtOrForeman, zx} from "@/api/zyjh"; import {getDw, getForeman, getForemanByWorker, getPgd, getYcldw, getYdjhByZtOrForeman, zx} from "@/api/zyjh";
export default { export default {
name:'PwanPgd', name:'PwanPgd',
props:{ props:{
worker:{
type:Function,
default:function (){}
},
workers:{ workers:{
type:Array, type:Array,
default:[] default:[]
@ -51,7 +56,8 @@ export default {
if (item.djh===data.msg.orderNumber||item.djh.slice(-djhWhLengh)===data.msg.orderNumber){ if (item.djh===data.msg.orderNumber||item.djh.slice(-djhWhLengh)===data.msg.orderNumber){
const tmpArr=[{ const tmpArr=[{
id:item.id, id:item.id,
pwfkry: item.pwry pwfkry: this.$props.worker().userCode,
zt:item.zt
}] }]
this.baogong(tmpArr,item) this.baogong(tmpArr,item)
break break
@ -66,9 +72,10 @@ export default {
checkboxChange({checked, row}) { checkboxChange({checked, row}) {
const tmpArr=[{ const tmpArr=[{
id:row.id, id:row.id,
pwfkry: row.pwry pwfkry: this.$props.worker().userCode,
zt:row.zt
}] }]
this.baogong(tmpArr,row) this.baogong0(tmpArr,row)
}, },
baogong(tmpArr,data){ baogong(tmpArr,data){
let ycldwInfo=null let ycldwInfo=null
@ -81,8 +88,9 @@ export default {
} }
} }
if (!ycldwInfo){ if (!ycldwInfo){
this.$message.warning(`预处理垛位上板材与记录不符,需查验后再进行报工!`) // this.$message.warning(`,!`)
return; // return;
ycldwInfo={}
} }
zx({ zx({
field:'pwfkrq', field:'pwfkrq',
@ -92,8 +100,37 @@ export default {
}).then(res=>{ }).then(res=>{
if (res.success){ if (res.success){
window.localStorage.removeItem('zyjh') window.localStorage.removeItem('zyjh')
this.initData(data.pwry,'31') this.initData(this.$props.worker().userCode,'31')
}
})
},
baogong0(tmpArr,data){
let ycldwInfo=null
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){
ycldwInfo=info
break
}
}
} }
if (!ycldwInfo){
// this.$message.warning(`,!`)
// return;
ycldwInfo={}
}
VXETable.modal.confirm('您确定报工吗?').then(res => {
res === 'confirm' && zx({
field:'pwfkrq',
zxZtName:'PWFK',
list:tmpArr,
ycldwInfo:ycldwInfo
}).then(res=>{
if (res.success){
window.localStorage.removeItem('zyjh')
this.initData(this.$props.worker().userCode,'31')
}
})
}) })
}, },
initData(worker,zt){ initData(worker,zt){

@ -136,7 +136,6 @@ export default function (width,height){
y:height, y:height,
width:width, width:width,
height:height*0.1, height:height*0.1,
fill:'#fff',
text: persons.userName, text: persons.userName,
align: 'center', align: 'center',
verticalAlign:'middle', verticalAlign:'middle',
@ -149,6 +148,6 @@ export default function (width,height){
} }
return{ return{
container,person container,person,getCurrentWorker
} }
} }

@ -67,7 +67,7 @@ export default function () {
{field: 'pwry', title: '接收人', width: 80,formatter:nameFormat}, {field: 'pwry', title: '接收人', width: 80,formatter:nameFormat},
{field: 'pwpgrq', title: '接收时间', width: 100}, {field: 'pwpgrq', title: '接收时间', width: 100},
{field: 'pwfkry', title: '报工人', width: 80,formatter:nameFormat}, {field: 'pwfkry', title: '报工人', width: 80,formatter:nameFormat},
{field: 'pwfksj', title: '报工时间', width: 100}, {field: 'pwfkrq', title: '报工时间', width: 100},
{field: 'pgr', title: '派工人', width: 80}, {field: 'pgr', title: '派工人', width: 80},
{field: 'pwpgrq', title: '派工时间', width: 100}, {field: 'pwpgrq', title: '派工时间', width: 100},
] ]

@ -1,7 +1,7 @@
<template> <template>
<div class="container"> <div class="container">
<div id="pwpg" class="pwpg" ref="pwpg"></div> <div id="pwpg" class="pwpg" ref="pwpg"></div>
<PWanPgd id="pwbgd" ref="pwpgd" @initPgd="initPgd" :pgd="pgd" :workers="workers" :dw="dw" @pgdClick="pgdClick"/> <PWanPgd id="pwbgd" ref="pwpgd" @initPgd="initPgd" :pgd="pgd" :worker="getWorker" :workers="workers" :dw="dw" @pgdClick="pgdClick"/>
<ZyjhSelectComp id="selectComp" ref="selRef" @initWorkers="initWorkers"/> <ZyjhSelectComp id="selectComp" ref="selRef" @initWorkers="initWorkers"/>
<TipsComp /> <TipsComp />
<Drawer ref="drawer"/> <Drawer ref="drawer"/>
@ -45,6 +45,7 @@ export default {
slGroup:null, slGroup:null,
dwGroup:null, dwGroup:null,
workerGroup:null, workerGroup:null,
getCurrentWorker:null,
person:null, person:null,
} }
}, },
@ -143,13 +144,17 @@ export default {
} }
}) })
}, },
getWorker(){
return this.getCurrentWorker()
},
initWorkers(bzType){ initWorkers(bzType){
const that=this const that=this
if (this.workerGroup){ if (this.workerGroup){
this.workerGroup.destroyChildren() this.workerGroup.destroyChildren()
}else{ }else{
const {container,person}=workers(this.width,this.height) const {container,person,getCurrentWorker}=workers(this.width,this.height)
this.person=person this.person=person
this.getCurrentWorker=getCurrentWorker
const {bgGroup,group}=container() const {bgGroup,group}=container()
this.workerGroup=group this.workerGroup=group
this.layer.add(bgGroup) this.layer.add(bgGroup)

@ -46,19 +46,20 @@ export default {
}, },
sockets:{ sockets:{
zyjhzx(data){ zyjhzx(data){
console.log(this.list)
if (this.deviceId!==data.msg.deviceId&&data.msg.actionType!=='开始派工'){ if (this.deviceId!==data.msg.deviceId&&data.msg.actionType!=='开始派工'){
return return
} }
// //
const djhWhLengh=3 const djhWhLengh=3
const tmpList=this.list.filter(item=>item.plxh===data.msg.orderNumber||item.plxh.slice(-djhWhLengh)===data.msg.orderNumber) const tmpList=this.list.filter(item=>item.plxh===data.msg.orderNumber||item.plxh?.slice(-djhWhLengh)===data.msg.orderNumber)
if (tmpList.length>1){ if (tmpList.length>1){
this.list=tmpList this.list=tmpList
this.$message.warning('短号有重复,请使用完整工单号重新派工!!!') this.$message.warning('短号有重复,请使用完整工单号重新派工!!!')
return return
} }
for (const item of this.list) { for (const item of this.list) {
if (item.plxh===data.msg.orderNumber||item.plxh.slice(-djhWhLengh)===data.msg.orderNumber){ if (item.plxh===data.msg.orderNumber||item.plxh?.slice(-djhWhLengh)===data.msg.orderNumber){
this.paigong0(item) this.paigong0(item)
break break
} }

@ -49,7 +49,8 @@ export default {
if (item.djh===data.msg.orderNumber||item.djh.slice(-djhWhLengh)===data.msg.orderNumber){ if (item.djh===data.msg.orderNumber||item.djh.slice(-djhWhLengh)===data.msg.orderNumber){
const tmpArr=[{ const tmpArr=[{
id:item.id, id:item.id,
qgfkry:item.hxry qgfkry:this.$props.worker().userCode,
zt:item.zt
}] }]
this.baogong(tmpArr,item) this.baogong(tmpArr,item)
break break
@ -86,7 +87,7 @@ export default {
}).then(res=>{ }).then(res=>{
if (res.success){ if (res.success){
window.localStorage.removeItem('zyjh') window.localStorage.removeItem('zyjh')
this.initData(data.qgry,'61') this.initData(this.$props.worker().userCode,'61')
} }
}) })
}, },
@ -155,7 +156,7 @@ export default {
} }
VXETable.modal.confirm('您确定报工吗?').then(res => { VXETable.modal.confirm('您确定报工吗?').then(res => {
res === 'confirm' && zx(data).then(res=>{ res === 'confirm' && zx(data).then(res=>{
this.initData(this.currentWorker,this.zt) this.initData(this.$props.worker().userCode,'61')
}) })
}) })
}, },

@ -58,6 +58,8 @@ export default function () {
{field: 'slwlh', title: '炉批号', width: 100}, {field: 'slwlh', title: '炉批号', width: 100},
{field: 'tzbh', title: '套料图号', width: 100}, {field: 'tzbh', title: '套料图号', width: 100},
{field: 'qgry', title: '接收人', width: 80,formatter: nameFormat}, {field: 'qgry', title: '接收人', width: 80,formatter: nameFormat},
{field: 'qgfkry', title: '报工人', width: 80,formatter:nameFormat},
{field: 'qgfkrq', title: '报工时间', width: 100},
{field: 'qgpgry', title: '派工人', width: 80,formatter: nameFormat}, {field: 'qgpgry', title: '派工人', width: 80,formatter: nameFormat},
{field: 'qgpgrq', title: '派工时间', width: 100}, {field: 'qgpgrq', title: '派工时间', width: 100},
] ]

@ -34,14 +34,14 @@ export default {
} }
// //
const djhWhLengh=3 const djhWhLengh=3
const tmpList=this.list.filter(item=>item.plxh===data.msg.orderNumber||item.plxh.slice(-djhWhLengh)===data.msg.orderNumber) const tmpList=this.list.filter(item=>item.plxh===data.msg.orderNumber||item.plxh?.slice(-djhWhLengh)===data.msg.orderNumber)
if (tmpList.length>1){ if (tmpList.length>1){
this.list=tmpList this.list=tmpList
this.$message.warning('短号有重复,请使用完整工单号重新派工!!!') this.$message.warning('短号有重复,请使用完整工单号重新派工!!!')
return return
} }
for (const item of this.list) { for (const item of this.list) {
if (item.plxh===data.msg.orderNumber||item.plxh.slice(-djhWhLengh)===data.msg.orderNumber){ if (item.plxh===data.msg.orderNumber||item.plxh?.slice(-djhWhLengh)===data.msg.orderNumber){
this.paigong0(item) this.paigong0(item)
break break
} }
@ -149,6 +149,14 @@ export default {
}) })
}) })
}, },
privateCheck(){
const worker=this.$props.worker()
if (!worker){
this.$message.warning('请选择操作人')
return false;
}
return true
},
cellClick({row}){ cellClick({row}){
// this.$emit('initPgd',row) // this.$emit('initPgd',row)
pdfList({ pdfList({

Loading…
Cancel
Save