From 077588bdec2523a63f268625e5dc65495bbd2174 Mon Sep 17 00:00:00 2001 From: wws <18630710203@163.com> Date: Thu, 27 Jul 2023 10:08:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=AE=A1=E7=90=86=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=A8=A1=E5=9D=97(=E9=A6=96=E9=A1=B5=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=BF=AE=E5=A4=8D)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mes/plan/index.vue | 156 ++++++++++++++---------------- src/views/mes/pro/order/index.vue | 4 +- 2 files changed, 73 insertions(+), 87 deletions(-) diff --git a/src/views/mes/plan/index.vue b/src/views/mes/plan/index.vue index 84bb34f..79f87a0 100644 --- a/src/views/mes/plan/index.vue +++ b/src/views/mes/plan/index.vue @@ -146,12 +146,12 @@ @selection-change="handleSelectionChange"> - - - - - - + + + + + + @@ -199,17 +199,17 @@ @selection-change="handleSelectionChange"> - - - - - - + + + + + + @@ -230,7 +230,7 @@ export default { // 当前计划日期下的BMS bmsList: null, // 新增下方的工单表 - newWorkOrderList: null, + newWorkOrderList: [], // 物料的选择list selectProductList: null, // 料罐的选择list @@ -289,7 +289,6 @@ export default { methods: { /** 新增-提交按钮 */ batchBtn() { - console.log(this.selectProductList) // 数据判空 if (this.selectList == null || this.selectList === undefined){ this.$message({ @@ -320,75 +319,68 @@ export default { materialId: this.form.productId, shiftId: this.selectList[0].shiftId, }); - for (let i = 0;i { - console.log("这里是你要的数据") - console.log(response.data) this.workOrderList = response.data; // 刷新表格 // 在获取到新的数据后执行以下代码 @@ -474,8 +464,6 @@ export default { }, /** 首-搜索按钮操作 */ handleQuery() { - console.log("这里是你要的数据"); - console.log(this.timeList); if (this.timeList.length-1>1){ // 赋值 const year = this.timeList[0].getFullYear(); // 获取年份 @@ -510,7 +498,7 @@ export default { // 初始化 this.checkSelect = true; // 如果选择中班次冲突 - for (let i = 0; i < selection.length-1; i++){ + for (let i = 0; i < selection.length; i++){ if (selection[0].shiftId != selection[i].shiftId){ this.$message({ message: '班次冲突!', @@ -533,7 +521,7 @@ export default { this.workOrderTime = null; this.workOrderList = []; this.selectProductList = null; - this.newWorkOrderList = null; + this.newWorkOrderList = []; this.bmapId = null; // 数据初始化 this.workOrderTime = new Date(); @@ -581,25 +569,21 @@ export default { this.title = "修改湿料计划管理"; }); }, - /** 提交按钮 */ - submitForm() { - this.$refs["form"].validate(valid => { - if (valid) { - if (this.form.id != null) { - updatePlan(this.form).then(response => { - this.$modal.msgSuccess("修改成功"); - this.open = false; - this.getList(); - }); - } else { - addPlan(this.form).then(response => { - this.$modal.msgSuccess("新增成功"); - this.open = false; - this.getList(); - }); - } - } - }); + /** 新增-提交按钮 */ + addSubmitForm() { + // 校验数据判断newList是否为空 + if (this.newWorkOrderList == [] || this.newWorkOrderList.length == 0 || this.newWorkOrderList == null){ + this.$message({ + message:'提交数据不能为空!', + type:'warning' + }) + return; + } + + + this.$modal.msgSuccess("新增成功"); + this.open = false; + this.getList(); }, /** 删除按钮操作 */ handleDelete(row) { diff --git a/src/views/mes/pro/order/index.vue b/src/views/mes/pro/order/index.vue index 0d9830a..f468a7d 100644 --- a/src/views/mes/pro/order/index.vue +++ b/src/views/mes/pro/order/index.vue @@ -106,6 +106,8 @@ - +