From 64f8a09543e39af8f5e8022e290e6e1a600c1351 Mon Sep 17 00:00:00 2001 From: nieli <329261568@qq.com> Date: Mon, 28 Nov 2022 11:46:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A1=B9=E7=9B=AE=E7=94=B5=E4=BB=B7?= =?UTF-8?q?=E5=90=88=E5=90=8C=20=E9=98=B6=E6=A2=AF=E8=AE=A1=E4=BB=B7=20?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/project/profileV2/EPrice/index.vue | 26 +++++++------------ .../profileV2/EPrice/profile/timePicker.vue | 19 +++++++------- 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/src/views/iot/project/profileV2/EPrice/index.vue b/src/views/iot/project/profileV2/EPrice/index.vue index cdabeabd..27b2130a 100644 --- a/src/views/iot/project/profileV2/EPrice/index.vue +++ b/src/views/iot/project/profileV2/EPrice/index.vue @@ -164,11 +164,11 @@ 添加规则 -
+
{ this.form = response.data; - var arr = []; - response.data.priceContractRuleList.forEach(v => { - arr.push(Object.assign(v, { guid: this.getGuid() })); - }); - this.form.priceContractRuleList = arr || []; this.open = true; this.tempType = 'update' this.title = "修改电价合同"; + this.$forceUpdate(); }); }, handleDestail(row) { @@ -439,11 +436,6 @@ export default { const contractId = row.contractId || this.ids; getContract(contractId).then(response => { this.form = response.data; - var arr = []; - response.data.priceContractRuleList.forEach(v => { - arr.push(Object.assign(v, { guid: this.getGuid() })); - }); - this.form.priceContractRuleList = arr || []; this.tempType = 'destail' this.open = true; this.title = "电价合同详情"; diff --git a/src/views/iot/project/profileV2/EPrice/profile/timePicker.vue b/src/views/iot/project/profileV2/EPrice/profile/timePicker.vue index 7d3fe317..b3d9189d 100644 --- a/src/views/iot/project/profileV2/EPrice/profile/timePicker.vue +++ b/src/views/iot/project/profileV2/EPrice/profile/timePicker.vue @@ -34,7 +34,6 @@ v-model="form.maxVal" :precision="2" class="form-input" - :min="form.minVal" label="最大值" > @@ -88,7 +87,7 @@ export default { created() { this.form = this.priceList; if (this.contractType === "LADDER") { - this.valSet(this.nodeMaxVal); + this.handleUpdateValue(this.nodeMaxVal); } else { this.timtSet(this.nodeMaxTime); } @@ -96,13 +95,13 @@ export default { watch: { form: { handler(val, oldVal) { - this.reultEventFu(); if ( this.contractType === "LADDER" && this.form.minVal >= this.form.maxVal ) { this.form.maxVal = this.form.minVal; } + this.reultEventFu(); }, deep: true }, @@ -113,13 +112,13 @@ export default { }, nodeMaxVal(val) { if (val || val === 0) { - this.valSet(val); + this.handleUpdateValue(val); } }, contractType(val) { this.form = this.priceList; if (val === "LADDER") { - this.valSet(this.nodeMaxVal); + this.handleUpdateValue(this.nodeMaxVal); } else { this.timtSet(this.nodeMaxTime); } @@ -140,11 +139,13 @@ export default { this.times = [this.form.minTime, this.form.maxTime]; this.$forceUpdate(); }, - valSet(val) { + handleUpdateValue(val) { this.form.minVal = this.priceList.minVal || 0; - if (val === "" || val === 0) { - this.form.minVal = 0; - this.form.maxVal = this.form.minVal + 1; + this.form.maxVal = this.priceList.maxVal + if ((val === "" || val === 0)) { + this.form.minVal = this.priceList.minVal || 0; + this.form.maxVal = this.priceList.maxVal || this.form.minVal + 1; + } else { this.form.minVal = val; if (this.form.minVal >= this.form.maxVal) {