From b2a58e55746b3b26500aa150238aad9b82c85349 Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Wed, 15 Feb 2023 15:12:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=86=9C=E4=BA=8B=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=86=9C=E8=B5=84=E6=80=BB=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/massif/add_farming.vue | 13 +++++++++++-- pages/massif/agrSpecs.vue | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pages/massif/add_farming.vue b/pages/massif/add_farming.vue index 7f8f141..cc071de 100644 --- a/pages/massif/add_farming.vue +++ b/pages/massif/add_farming.vue @@ -166,7 +166,7 @@ - {{v.goodsType}} {{v.substanceName}} {{v.total}} + {{v.goodsType}} {{v.substanceName}} {{v.inputQuantity*parseFloat(v.specs[0])}}{{v.specs[1]}} @@ -282,7 +282,16 @@ export default { uni.navigateTo({ url:"/pages/massif/collectList", events:{ addSpecs: e=>{ - this.formData.inputList.push(e) + if(!this.formData.inputList.some(v=>{ + if(v.inventoryId==e.inventoryId){ + v.inputQuantity=Math.round((v.inputQuantity+e.inputQuantity)*100)/100 + return true + }else{ + return false + } + })){ + this.formData.inputList.push(e) + } } } }) }, diff --git a/pages/massif/agrSpecs.vue b/pages/massif/agrSpecs.vue index dbda1fc..bacb27a 100644 --- a/pages/massif/agrSpecs.vue +++ b/pages/massif/agrSpecs.vue @@ -265,7 +265,7 @@ export default { if(this.check()){ this.eventChannel.emit("update", { ...this.formData, - total: `${parseFloat(this.specsVal.num)*parseFloat(this.specsVal.specs[0])}${this.specsVal.specs[1]}`, + specs:this.specsVal.specs, goodsType: this.agrDetail.goodsType, substanceName: this.agrDetail.substanceName, })