工单管理(点击修改功能判断是否可修改问题修复)

yangwl
wws 1 year ago
parent 442b669145
commit 62d80d2138

@ -673,107 +673,96 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
//
let check = 0;
checkWorkOrder(this.selectWork.workorderId).then(response => {
if (response.code == 500){
check = 1;
}
})
if (check == 1){
this.$message({
message:'该工单已有湿料计划,不可修改!',
type:'warning'
})
return;
}
console.log("这里是你要的数据")
console.log(this.selectWork)
//
this.reset();
this.splitData = [];
this.productData =[];
this.splitForm={
prodLineCode: null,
splitNum: null,
productDate: null,
shiftId: null,
routeCode: null,
}
this.formFields=[]
//
this.splitForm.productDate = new Date()
//
getprodLineShift(row.orderType).then(response => {
this.proline = response.data.lines
this.workShift = response.data.shifts
this.routes = response.data.routes
})
// list
getWorkBatchList(this.selectWork).then(response => {
this.formFields = response.data
console.log("这里是批次数据")
console.log(response.data)
})
this.$message({
message:'该工单已有湿料计划,不可修改!',
type:'warning'
})
return;
}else {
console.log("这里是你要的数据")
console.log(this.selectWork)
//
this.reset();
this.splitData = [];
this.productData =[];
this.splitForm={
prodLineCode: null,
splitNum: null,
productDate: null,
shiftId: null,
routeCode: null,
}
this.formFields=[]
//
this.splitForm.productDate = new Date()
//
getprodLineShift(row.orderType).then(response => {
this.proline = response.data.lines
this.workShift = response.data.shifts
this.routes = response.data.routes
})
// list
getWorkBatchList(this.selectWork).then(response => {
this.formFields = response.data
console.log("这里是批次数据")
console.log(response.data)
})
//
//
this.proLoading = true // true
this.workerLoading = true // true
getOrderAndWork(this.selectWork).then(response =>{
console.log("这里是返回数据")
console.log(response)
this.splitData.push(response.data.workOrder)
this.productData.push(response.data.order)
//
//
this.proLoading = true // true
this.workerLoading = true // true
getOrderAndWork(this.selectWork).then(response =>{
console.log("这里是返回数据")
console.log(response)
this.splitData.push(response.data.workOrder)
this.productData.push(response.data.order)
this.refreshProTable = false // refreshProTablefalse
this.refreshWorkerTable = false // refreshProTablefalse
this.$nextTick(() => {
// 使$nextTickDOM
this.refreshProTable = true // refreshProTabletrue
this.proLoading = false // false
})
this.$nextTick(() => {
// 使$nextTickDOM
this.refreshWorkerTable = true // refreshProTabletrue
this.workerLoading = false // false
})
this.refreshProTable = false // refreshProTablefalse
this.refreshWorkerTable = false // refreshProTablefalse
this.$nextTick(() => {
// 使$nextTickDOM
this.refreshProTable = true // refreshProTabletrue
this.proLoading = false // false
})
this.$nextTick(() => {
// 使$nextTickDOM
this.refreshWorkerTable = true // refreshProTabletrue
this.workerLoading = false // false
})
//
this.splitForm.splitNum = this.splitData[0].quantitySplit
//
this.splitForm.prodLineCode = this.splitData[0].prodLineCode
//
this.splitForm.shiftId = this.splitData[0].shiftDesc
//
this.splitForm.routeCode = this.splitData[0].routeCode
//
function setAtrr1(order, work) {
order.quantitySplit = Number(order.quantitySplit) - Number(work.quantitySplit);
order.atrr1 = work.quantitySplit;
if (order.children !== undefined && work.children !== undefined) {
setAtrr1(order.children[0], work.children[0]);
}
}
//
this.splitForm.splitNum = this.splitData[0].quantitySplit
//
this.splitForm.prodLineCode = this.splitData[0].prodLineCode
//
this.splitForm.shiftId = this.splitData[0].shiftDesc
//
this.splitForm.routeCode = this.splitData[0].routeCode
//
function setAtrr1(order, work) {
order.quantitySplit = Number(order.quantitySplit) - Number(work.quantitySplit);
order.atrr1 = work.quantitySplit;
if (order.children !== undefined && work.children !== undefined) {
setAtrr1(order.children[0], work.children[0]);
}
}
setAtrr1(this.productData[0], this.splitData[0]);
setAtrr1(this.productData[0], this.splitData[0]);
})
this.open = true;
this.title = "修改生产工单";
}
})
// function setAtrr1(order,work) {
// order.quantitySplit = Number(order.quantitySplit) - Number(work.quantitySplit)
// order.atrr1 = work.quantitySplit
// if (order.children !== undefined) {
// setAtrr1(order.children[0],work.children[0])
// }
// }
//
// setAtrr1(this.productData[0],this.splitData[0])
this.open = true;
this.title = "修改生产工单";
},
/**下达工单**/
handleUpdateDown(row) {

Loading…
Cancel
Save