From 0c17788c1bab0d7a73debef1cdea6508116c5d5a Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Wed, 20 Sep 2023 10:01:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E6=95=B0=E9=80=BB=E8=BE=91V1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/plan/whiteOrder/index.vue | 39 +++++++++++++++++++++++++++-- src/views/plan/workorder/index.vue | 33 +++++++++++++++++++++--- 2 files changed, 67 insertions(+), 5 deletions(-) diff --git a/src/views/plan/whiteOrder/index.vue b/src/views/plan/whiteOrder/index.vue index 87a36ef..d5fb2a5 100644 --- a/src/views/plan/whiteOrder/index.vue +++ b/src/views/plan/whiteOrder/index.vue @@ -432,7 +432,7 @@ - + @@ -516,6 +516,8 @@ export default { }, data() { return { + // 拆分车数换算值 + converCarNum: null, // 拆分-班次 workShift: [], // 拆分工艺 @@ -651,6 +653,17 @@ export default { }, // 拆分-拆分数量变化校验 splitNumChange(e) { + // 为了获取车数换算值-先选择工艺 + if (this.splitForm.routeCode == null) { + console.log("请先选择工艺") + this.$message({ + message: "请先选择工艺!", + type: "warning" + }) + this.splitForm.splitNum = null + return + } + console.log("变换了拆分数量") //不能为负数 if (e <= 0) { this.$message({ @@ -684,7 +697,18 @@ export default { this.proLoading = false // 设置加载状态为false,表示加载完成 }) } - this.product = this.productData[0] + this.product = this.productData[0]; + // 车数处理逻辑 + console.log("车数逻辑------>") + if (this.converCarNum != null) { + this.splitForm.carNum = Math.ceil(this.splitForm.splitNum / this.converCarNum); + }else { + this.$message({ + message: '获取车数换算值异常!', + type: 'error' + }) + } + }, // 拆分-校验工单日期 checkDate(e) { @@ -880,6 +904,10 @@ export default { changeRoute(routeCode) { // 选择好工艺进行设备选择 getProEquipment(routeCode).then(response => { + + // 清除车数缓存 + this.converCarNum = null; + this.eRouteOptions = response.data //默认全选 let selectAll = []; @@ -895,6 +923,13 @@ export default { } }) this.splitForm.prodLineCodeArray = selectAll + + // 设置车数换算值 + for (let i = 0; i < this.routes.length; i++) { + if (this.routes[i].routeCode == routeCode) { + this.converCarNum = this.routes[i].carNumUnit; + } + } }) }, // 拆分-动态删除批次 diff --git a/src/views/plan/workorder/index.vue b/src/views/plan/workorder/index.vue index 8d07da4..09f4749 100644 --- a/src/views/plan/workorder/index.vue +++ b/src/views/plan/workorder/index.vue @@ -467,6 +467,8 @@ export default { dicts: ['product_type', 'workorder_type', 'shift_type'], data() { return { + // 拆分车数换算值 + converCarNum: null, // 变更校验车数书否显示 checkType: false, // 暂存线体code @@ -686,6 +688,7 @@ export default { carNum: null } this.formFields = [] + this.converCarNum = null; //初始化日期为默认今天 this.splitForm.productDate = new Date() @@ -695,10 +698,22 @@ export default { }) // 获取工艺信息 getProRoutes(this.selectWork.productCode).then(response => { + console.log("这里是选中工单信息") + console.log(this.selectWork) + console.log("这里是开始获取工艺信息") + console.log(response.data) this.routes = response.data getProEquipment(this.selectWork.routeCode).then(response => { this.proline = response.data }) + // 设置车数换算值 + for (let i = 0; i < this.routes.length; i++) { + if (this.routes[i].routeCode == this.selectWork.routeCode) { + this.converCarNum = this.routes[i].carNumUnit; + } + } + console.log("车数设置成功") + console.log(this.converCarNum) }) // 获取工艺设备信息 getProEquipment(this.selectWork.routeCode).then(response2 => { @@ -795,11 +810,23 @@ export default { } }, // 变更-变更工艺 - routeChange(e) { - getProEquipment(e).then(response => { + routeChange(routeCode) { + console.log("工艺变更") + console.log(routeCode) + getProEquipment(routeCode).then(response => { this.eRouteOptions = response.data }) - this.workForm.routeCode = e + this.workForm.routeCode = routeCode + + // 设置车数换算值 + for (let i = 0; i < this.routes.length; i++) { + if (this.routes[i].routeCode == routeCode) { + this.converCarNum = this.routes[i].carNumUnit; + } + } + + console.log("设置好车数换算值") + console.log(this.converCarNum) }, // 变更-变更班次 shiftChange(e) {