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

master
wws 1 year ago
parent 442b669145
commit 62d80d2138

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

Loading…
Cancel
Save