|
|
|
@ -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 // 先将refreshProTable设置为false,隐藏表格
|
|
|
|
|
this.refreshWorkerTable = false // 先将refreshProTable设置为false,隐藏表格
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
// 使用$nextTick来等待DOM更新完成
|
|
|
|
|
this.refreshProTable = true // 立即将refreshProTable设置为true,显示表格
|
|
|
|
|
this.proLoading = false // 设置加载状态为false,表示加载完成
|
|
|
|
|
})
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
// 使用$nextTick来等待DOM更新完成
|
|
|
|
|
this.refreshWorkerTable = true // 立即将refreshProTable设置为true,显示表格
|
|
|
|
|
this.workerLoading = false // 设置加载状态为false,表示加载完成
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.refreshProTable = false // 先将refreshProTable设置为false,隐藏表格
|
|
|
|
|
this.refreshWorkerTable = false // 先将refreshProTable设置为false,隐藏表格
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
// 使用$nextTick来等待DOM更新完成
|
|
|
|
|
this.refreshProTable = true // 立即将refreshProTable设置为true,显示表格
|
|
|
|
|
this.proLoading = false // 设置加载状态为false,表示加载完成
|
|
|
|
|
})
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
// 使用$nextTick来等待DOM更新完成
|
|
|
|
|
this.refreshWorkerTable = true // 立即将refreshProTable设置为true,显示表格
|
|
|
|
|
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) {
|
|
|
|
|