From 62d80d2138031959b17e441a206e91e255bb2202 Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Wed, 2 Aug 2023 10:29:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E7=AE=A1=E7=90=86(=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E4=BF=AE=E6=94=B9=E5=8A=9F=E8=83=BD=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=8F=AF=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/plan/workorder/index.vue | 173 ++++++++++++++--------------- 1 file changed, 81 insertions(+), 92 deletions(-) diff --git a/src/views/plan/workorder/index.vue b/src/views/plan/workorder/index.vue index ec1cf89..a0223d4 100644 --- a/src/views/plan/workorder/index.vue +++ b/src/views/plan/workorder/index.vue @@ -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) {