From 46afbde808a0835775bfef0e69fe280f4f9b7da7 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Fri, 8 Dec 2023 17:12:10 +0800 Subject: [PATCH] =?UTF-8?q?2023-12-08=20=E8=AE=BE=E5=A4=87=E5=92=8C?= =?UTF-8?q?=E8=B4=A8=E9=87=8F=E4=BF=AE=E6=94=B92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/eam/eamWorkOrderForCheck.vue | 29 ++-- .../modules/eam/eamWorkOrderForDefect.vue | 126 ++++++++---------- .../eam/eamWorkOrderForMaintenance.vue | 27 ++-- .../reportWorkOrder/reportDefectOrder.vue | 36 +---- 4 files changed, 92 insertions(+), 126 deletions(-) diff --git a/src/views/modules/eam/eamWorkOrderForCheck.vue b/src/views/modules/eam/eamWorkOrderForCheck.vue index 8fc9824..6c20ba0 100644 --- a/src/views/modules/eam/eamWorkOrderForCheck.vue +++ b/src/views/modules/eam/eamWorkOrderForCheck.vue @@ -160,8 +160,8 @@ - - + + 取消审核 @@ -872,6 +872,18 @@ }, methods: { + // ======= 正则校验 ======= + handleInput (value, type) { + // 大于等于0,且只能输入4位小数 + let val = value.replace(/^\D*([0-9]\d*\.?\d{0,4})?.*$/,'$1') + if (val === null || val === undefined || val === '') { + val = 0 + } + if (type === 1) { + this.saveData.workTime = val + } + }, + // 控制单行的背景颜色 controlRowStyle({row, rowIndex}) { // 区分不同的样式对应不同的颜色 @@ -1285,18 +1297,14 @@ }) }, - updateWorkOrder(){ + updateWorkOrder () { let tempFlag = 'N' if (this.saveData.checkResult === '' || this.saveData.checkResult == null) { this.$message.warning('请选择点检结论!') return } - if(this.saveData.workTime === 0){ - this.$message.warning('工作时长不能为0!') - return - } - if(this.saveData.workTime < 0){ - this.$message.warning('工作时长不能小于0!') + if(this.saveData.workTime <= 0){ + this.$message.warning('工作时长不能 <= 0!') return } for (let i = 0; i < this.detailList.length; i++) { @@ -1330,8 +1338,7 @@ message: '操作成功', type: 'success', duration: 1500, - onClose: () => { - } + onClose: () => {} }) } else { this.$alert(data.msg, '错误', { diff --git a/src/views/modules/eam/eamWorkOrderForDefect.vue b/src/views/modules/eam/eamWorkOrderForDefect.vue index cf1f490..1dc782e 100644 --- a/src/views/modules/eam/eamWorkOrderForDefect.vue +++ b/src/views/modules/eam/eamWorkOrderForDefect.vue @@ -183,96 +183,86 @@ - + - - + + - - + + - - 取消审核 - 审核 + + + + + - - + + + + + - + - - - - 故障图片 - - - 备件图片 + - - + + - - - - + + - - + + - - + + - - + + - - + + 取消审核 + 审核 - - + + 故障图片 - - - - + + 备件图片 + + + + - - + + - + + + + + - - + + - - 保存 + + 保存 关闭 @@ -376,12 +366,12 @@ this.modalData.groupID = this.modalData.groupID.toUpperCase() } }, - detailData: { - deep: true, - handler: function (newV, oldV) { - this.detailData.workTime = Math.ceil(Math.floor(this.dayjs(this.detailData.actualDate).diff(this.detailData.reachDate, 'seconds') / 30) / 2) - } - } + // detailData: { + // deep: true, + // handler: function (newV, oldV) { + // this.detailData.workTime = Math.ceil(Math.floor(this.dayjs(this.detailData.actualDate).diff(this.detailData.reachDate, 'seconds') / 30) / 2) + // } + // } }, data () { return { @@ -1224,7 +1214,9 @@ handlingMethod: row.handlingMethod, functionType: row.functionType, resourceDesc: row.resourceDesc, - feedBackDesc: row.feedBackDesc + feedBackDesc: row.feedBackDesc, + faultReason: row.faultReason, + preventiveMeasure: row.preventiveMeasure } this.detailModelFlag = true }, @@ -1243,7 +1235,7 @@ return } if (this.detailData.reachDate > this.detailData.actualDate) { - this.$message.warning('到达时间不能小于实际执行时间!') + this.$message.warning('到达时间不能大于实际执行时间!') return } updateReportResult(this.detailData).then(({data}) => { diff --git a/src/views/modules/eam/eamWorkOrderForMaintenance.vue b/src/views/modules/eam/eamWorkOrderForMaintenance.vue index 4a57933..df16386 100644 --- a/src/views/modules/eam/eamWorkOrderForMaintenance.vue +++ b/src/views/modules/eam/eamWorkOrderForMaintenance.vue @@ -163,8 +163,7 @@ - - + @@ -199,7 +198,7 @@ - + @@ -404,12 +403,12 @@ this.modalData.groupID = this.modalData.groupID.toUpperCase() } }, - saveData: { - deep: true, - handler: function (newV, oldV) { - this.saveData.workTime = Math.ceil(Math.floor(this.dayjs(this.saveData.actualDate).diff(this.saveData.reachDate, 'seconds') / 30) / 2) - } - } + // saveData: { + // deep: true, + // handler: function (newV, oldV) { + // this.saveData.workTime = Math.ceil(Math.floor(this.dayjs(this.saveData.actualDate).diff(this.saveData.reachDate, 'seconds') / 30) / 2) + // } + // } }, data () { return { @@ -1431,18 +1430,14 @@ this.operatorModelFlag = false }, - updateWorkOrder (){ + updateWorkOrder () { let tempFlag = 'N' if (this.saveData.checkResult === '' || this.saveData.checkResult == null) { this.$message.warning('请选择维保结论!') return } - if(this.saveData.workTime === 0){ - this.$message.warning('工作时长不能为0!') - return - } - if(this.saveData.workTime < 0){ - this.$message.warning('工作时长不能小于0!') + if (this.saveData.reachDate > this.saveData.actualDate) { + this.$message.warning('到达时间不能小于实际执行时间!') return } if (this.saveData.checkResult === '不合格') { diff --git a/src/views/modules/reportWorkOrder/reportDefectOrder.vue b/src/views/modules/reportWorkOrder/reportDefectOrder.vue index 07800c9..c689961 100644 --- a/src/views/modules/reportWorkOrder/reportDefectOrder.vue +++ b/src/views/modules/reportWorkOrder/reportDefectOrder.vue @@ -171,46 +171,18 @@ - - + - - + - - + - - +