From 5ce7e84c4c8342014e14ca7f5d5723c9eb0274a3 Mon Sep 17 00:00:00 2001 From: liuxy Date: Wed, 14 Sep 2022 15:41:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wms/sb/repair/devicerepairpa/index.vue | 49 +++++++++++++++++- .../sb/upkeep/devicemaintenancepa/index.vue | 51 +++++++++++++++++-- 2 files changed, 94 insertions(+), 6 deletions(-) diff --git a/mes/qd/src/views/wms/sb/repair/devicerepairpa/index.vue b/mes/qd/src/views/wms/sb/repair/devicerepairpa/index.vue index a9bec490..2d1d304e 100644 --- a/mes/qd/src/views/wms/sb/repair/devicerepairpa/index.vue +++ b/mes/qd/src/views/wms/sb/repair/devicerepairpa/index.vue @@ -146,7 +146,7 @@ - + @@ -365,6 +365,53 @@ export default { } else { this.crud.notify('状态不正确', CRUD.NOTIFICATION_TYPE.INFO) } + }, + mySelectionChange(rows) { + this.buttonChange(rows) + }, + // 处理按钮是否显示 + buttonChange(rows) { + if (rows.length !== 0) { + this.start_flag = false + this.execu_flag = false + this.end_flag = false + this.open_flag = false + this.confirm_flag = false + this.result_flag = false + for (let i = 0; i < rows.length; i++) { + if ('01,03,04,05,06,07,99'.includes(rows[i].invstatus)) { + this.start_flag = true + } + if ('01,02,06,07,99'.includes(rows[i].invstatus)) { + this.execu_flag = true + } + if ('01,02,04,06,07,99'.includes(rows[i].invstatus)) { + this.end_flag = true + } + if ('01,02,06,07,99'.includes(rows[i].invstatus)) { + this.open_flag = true + } + if ('01,02,03,04,05,07,99'.includes(rows[i].invstatus)) { + this.confirm_flag = true + } + if ('01,02,07,99'.includes(rows[i].invstatus)) { + this.result_flag = true + } + if (rows.length > 1) { + this.handleCurrentChange() + } + } + } else { + this.handleCurrentChange() + } + }, + handleCurrentChange() { + this.start_flag = true + this.execu_flag = true + this.end_flag = true + this.open_flag = true + this.confirm_flag = true + this.result_flag = true } } } diff --git a/mes/qd/src/views/wms/sb/upkeep/devicemaintenancepa/index.vue b/mes/qd/src/views/wms/sb/upkeep/devicemaintenancepa/index.vue index 465a0f34..8022d616 100644 --- a/mes/qd/src/views/wms/sb/upkeep/devicemaintenancepa/index.vue +++ b/mes/qd/src/views/wms/sb/upkeep/devicemaintenancepa/index.vue @@ -84,7 +84,7 @@ type="success" icon="el-icon-position" size="mini" - :disabled="crud.selections.length !== 1" + :disabled="start_flag" @click="startMaintain" > 开始保养 @@ -95,7 +95,7 @@ type="success" icon="el-icon-position" size="mini" - :disabled="crud.selections.length !== 1" + :disabled="execu_flag" @click="executeMaintain" > 保养执行 @@ -106,7 +106,7 @@ type="success" icon="el-icon-position" size="mini" - :disabled="crud.selections.length !== 1" + :disabled="end_flag" @click="endMaintain" > 结束保养 @@ -117,14 +117,14 @@ type="success" icon="el-icon-position" size="mini" - :disabled="crud.selections.length !== 1" + :disabled="confirm_flag" @click="confirmMaintain" > 保养确认 - + @@ -190,6 +190,10 @@ export default { }, data() { return { + start_flag: true, + execu_flag: true, + end_flag: true, + confirm_flag: true, classes: [], class_idStr: null, materOpt_code: '23', @@ -298,6 +302,43 @@ export default { this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS) this.crud.toQuery() }) + }, + mySelectionChange(rows) { + this.buttonChange(rows) + }, + // 处理按钮是否显示 + buttonChange(rows) { + if (rows.length !== 0) { + this.start_flag = false + this.execu_flag = false + this.end_flag = false + this.confirm_flag = false + for (let i = 0; i < rows.length; i++) { + if ('01,03,04,05,99'.includes(rows[i].invstatus)) { + this.start_flag = true + } + if ('01,02,04,05,99'.includes(rows[i].invstatus)) { + this.execu_flag = true + } + if ('01,02,04,05,99'.includes(rows[i].invstatus)) { + this.end_flag = true + } + if ('01,02,03,05,99'.includes(rows[i].invstatus)) { + this.confirm_flag = true + } + if (rows.length > 1) { + this.handleCurrentChange() + } + } + } else { + this.handleCurrentChange() + } + }, + handleCurrentChange() { + this.start_flag = true + this.execu_flag = true + this.end_flag = true + this.confirm_flag = true } } }