From da5be0285d492ee73e1a50e53b7b6e00c98890d2 Mon Sep 17 00:00:00 2001 From: qiezi <15576055375@163.com> Date: Sun, 29 Sep 2024 17:04:18 +0800 Subject: [PATCH] =?UTF-8?q?24-05-16=20=E6=A0=87=E7=AD=BE=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/production/reworkRecord.vue | 49 ++++++++++++++++--- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/src/views/modules/production/reworkRecord.vue b/src/views/modules/production/reworkRecord.vue index fdb94cd..bdd03dd 100644 --- a/src/views/modules/production/reworkRecord.vue +++ b/src/views/modules/production/reworkRecord.vue @@ -96,7 +96,6 @@ export default { this.numberOrWeight = undefined; }, startRework(){ - this.saveRework.createTime = dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss") this.saveRework.createBy = this.$store.state.user.name startRework(this.saveRework).then(({data})=>{ if (data && data.code === 0){ @@ -104,13 +103,17 @@ export default { this.startReworkRecordDialog = false; this.selectRework(); }else { - this.$alert(data.msg, '错误信息', { + this.$confirm(data.msg, '错误信息', { confirmButtonText: '确定' + }).then(()=>{ + this.$refs.seqNo.focus(); }) } }).catch((error)=>{ - this.$alert(error, '错误信息', { + this.$confirm(error, '错误信息', { confirmButtonText: '确定' + }).then(()=>{ + this.$refs.seqNo.focus(); }) }) }, @@ -216,12 +219,14 @@ export default { getRework(params).then(({data})=>{ if (data && data.code === 0){ this.seqNoReworkRecordDialog = false; - this.reportWorkDialog = true this.$nextTick(()=>{ this.saveRework = data.row; this.saveRework.reworkStartDate = new Date() this.saveRework.reworkEndDate = new Date() + this.saveRework.productionTime = new Decimal(dayjs(new Date()).diff(this.saveRework.createTime,'hour',true)).toFixed(2, Decimal.ROUND_HALF_UP) + this.saveRework.productionTime = new Decimal(this.saveRework.productionTime).toSignificantDigits() }) + this.reportWorkDialog = true }else { this.$alert(data.msg, '错误信息', { confirmButtonText: '确定' @@ -238,6 +243,8 @@ export default { seqNo: undefined, site:this.$store.state.user.site, type:"修边返工", + operatorId:undefined, + operatorName:undefined, } if (this.startReworkRecordDialog === true){ this.$nextTick(()=>{ @@ -251,6 +258,13 @@ export default { } } }, + watch:{ + 'saveRework.operatorId'(newVal, oldVal){ + if (!newVal){ + this.saveRework.operatorName = undefined; + } + } + }, created () { this.selectRework(); }, @@ -260,7 +274,7 @@ export default {