|
|
@ -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 // 先将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.splitForm.splitNum = this.splitData[0].quantitySplit
|
|
|
|
this.$nextTick(() => {
|
|
|
|
// 设置选择机型
|
|
|
|
// 使用$nextTick来等待DOM更新完成
|
|
|
|
this.splitForm.prodLineCode = this.splitData[0].prodLineCode
|
|
|
|
this.refreshProTable = true // 立即将refreshProTable设置为true,显示表格
|
|
|
|
// 设置班次
|
|
|
|
this.proLoading = false // 设置加载状态为false,表示加载完成
|
|
|
|
this.splitForm.shiftId = this.splitData[0].shiftDesc
|
|
|
|
})
|
|
|
|
// 设置工艺
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.splitForm.routeCode = this.splitData[0].routeCode
|
|
|
|
// 使用$nextTick来等待DOM更新完成
|
|
|
|
|
|
|
|
this.refreshWorkerTable = true // 立即将refreshProTable设置为true,显示表格
|
|
|
|
// 递归将拆分数量还原
|
|
|
|
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) {
|
|
|
|