1.优化调整,修复bug

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

@ -1,13 +1,19 @@
<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>
<script>
import { VXETable } from 'vxe-table'
import paoWanPgdConfig from './pgdTable'
import {getDw, getForemanByWorker, getPgd, getPgd2, getYdjhByZtOrForeman, zx} from "@/api/zyjh";
export default {
name:'HxianPgd',
props:{
worker:{
type:Function,
default:function (){}
},
workers:{
type:Array,
default:[]
@ -41,7 +47,8 @@ export default {
if (item.djh===data.msg.orderNumber||item.djh.slice(-djhWhLengh)===data.msg.orderNumber){
const tmpArr=[{
id:item.id,
hxfkry:item.hxry
hxfkry:this.$props.worker().userCode,
zt:item.zt
}]
this.baogong(tmpArr,item)
break
@ -56,6 +63,26 @@ export default {
this.gridOptions.columns=columns
},
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){
let ycldwInfo=null
for (const dw of this.dw) {
@ -78,16 +105,52 @@ export default {
}).then(res=>{
if (res.success){
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){
getDw({type:'llj'}).then(res=>{
this.gridOptions.ycldw=res.data
getForemanByWorker({worker:worker}).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.setExt('workers',this.$props.workers)
})

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

@ -34,12 +34,8 @@ export default function () {
}
const dwFormat=function ({cellValue}){
for (const item of options.ycldw) {
if (cellValue===(item.id+"")){
for (const it of ycldw){
if (it.bm===item.tzbh){
return it.bmsm
}
}
if (cellValue===item.id+''){
return item.name
}
}
}
@ -57,6 +53,8 @@ export default function () {
{field: 'slwlh', title: '炉批号', width: 100},
{field: 'tzbh', title: '套料图号', width: 100},
{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: 'hxpgrq', title: '派工时间', width: 100},
]

@ -1,7 +1,7 @@
<template>
<div class="container">
<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"/>
<TipsComp />
<Drawer ref="drawer"/>
@ -149,6 +149,9 @@ export default {
}
})
},
getWorker(){
return this.getCurrentWorker()
},
initWorkers(bzType){
if (this.workerGroup){
this.workerGroup.destroyChildren()

@ -34,14 +34,14 @@ export default {
}
//
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){
this.list=tmpList
this.$message.warning('短号有重复,请使用完整工单号重新派工!!!')
return
}
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)
break
}
@ -151,6 +151,14 @@ export default {
})
})
},
privateCheck(){
const worker=this.$props.worker()
if (!worker){
this.$message.warning('请选择操作人')
return false;
}
return true
},
cellClick({row}){
// this.$emit('initPgd',row)
pdfList({

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

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

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

@ -1,7 +1,7 @@
<template>
<div class="container">
<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"/>
<TipsComp />
<Drawer ref="drawer"/>
@ -45,6 +45,7 @@ export default {
slGroup:null,
dwGroup:null,
workerGroup:null,
getCurrentWorker:null,
person:null,
}
},
@ -143,13 +144,17 @@ export default {
}
})
},
getWorker(){
return this.getCurrentWorker()
},
initWorkers(bzType){
const that=this
if (this.workerGroup){
this.workerGroup.destroyChildren()
}else{
const {container,person}=workers(this.width,this.height)
const {container,person,getCurrentWorker}=workers(this.width,this.height)
this.person=person
this.getCurrentWorker=getCurrentWorker
const {bgGroup,group}=container()
this.workerGroup=group
this.layer.add(bgGroup)

@ -46,19 +46,20 @@ export default {
},
sockets:{
zyjhzx(data){
console.log(this.list)
if (this.deviceId!==data.msg.deviceId&&data.msg.actionType!=='开始派工'){
return
}
//
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){
this.list=tmpList
this.$message.warning('短号有重复,请使用完整工单号重新派工!!!')
return
}
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)
break
}

@ -49,7 +49,8 @@ export default {
if (item.djh===data.msg.orderNumber||item.djh.slice(-djhWhLengh)===data.msg.orderNumber){
const tmpArr=[{
id:item.id,
qgfkry:item.hxry
qgfkry:this.$props.worker().userCode,
zt:item.zt
}]
this.baogong(tmpArr,item)
break
@ -86,7 +87,7 @@ export default {
}).then(res=>{
if (res.success){
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 => {
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: 'tzbh', title: '套料图号', width: 100},
{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: 'qgpgrq', title: '派工时间', width: 100},
]

@ -34,14 +34,14 @@ export default {
}
//
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){
this.list=tmpList
this.$message.warning('短号有重复,请使用完整工单号重新派工!!!')
return
}
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)
break
}
@ -149,6 +149,14 @@ export default {
})
})
},
privateCheck(){
const worker=this.$props.worker()
if (!worker){
this.$message.warning('请选择操作人')
return false;
}
return true
},
cellClick({row}){
// this.$emit('initPgd',row)
pdfList({

Loading…
Cancel
Save