From c4880a5a21241b69c5755c85bc1e62a61335f992 Mon Sep 17 00:00:00 2001 From: xiangxy Date: Thu, 14 Jul 2022 15:49:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9calc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/xinrui/equipment/RunLogFill.vue | 37 +++++++++++++++++------ 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/src/pages/xinrui/equipment/RunLogFill.vue b/src/pages/xinrui/equipment/RunLogFill.vue index 9e3b514..9ae026f 100644 --- a/src/pages/xinrui/equipment/RunLogFill.vue +++ b/src/pages/xinrui/equipment/RunLogFill.vue @@ -60,8 +60,8 @@
- - + +
@@ -94,7 +94,8 @@ export default { show: false, minDate: new Date(2000, 0, 1), defaultDate: new Date(), - disabled1: false + disabled1: false, + disabled2: false } }, beforeRouteLeave (to, from, next) { @@ -138,10 +139,6 @@ export default { } }, calform () { - if (!(this.val3 >= 0 && this.val4 >= 0 && this.val5 >= 0 && this.val6 >= 0 && this.val7 >= 0 && this.val8 >= 0)) { - this.toast('值须>=0') - return - } this.form = { device_code: this.val1, run_date: this.date, @@ -154,6 +151,26 @@ export default { oee_value: this.val9 } }, + toCount () { + if (JSON.stringify(this.robj) === '{}') { + return + } + if (!(this.val3 >= 0 && this.val4 >= 0 && this.val5 >= 0 && this.val6 >= 0 && this.val7 >= 0 && this.val8 >= 0)) { + this.toast('值须>=0') + return + } + this.calculate() + }, + toSave () { + if (JSON.stringify(this.robj) === '{}') { + return + } + if (!(this.val3 >= 0 && this.val4 >= 0 && this.val5 >= 0 && this.val6 >= 0 && this.val7 >= 0 && this.val8 >= 0)) { + this.toast('值须>=0') + return + } + this.save() + }, async calculate () { this.disabled1 = true this.calform() @@ -174,7 +191,7 @@ export default { } }, async save () { - this.disabled1 = true + this.disabled2 = true this.calform() try { let res = await save(this.form) @@ -186,9 +203,9 @@ export default { } else { this.Dialog(res.desc) } - this.disabled1 = false + this.disabled2 = false } catch (error) { - this.disabled1 = false + this.disabled2 = false } } }