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 @@ <u-swipe-action v-for="(v,k) in formData.inputList" :key="k"> <u-swipe-action-item> <view> - <text>{{v.goodsType}}</text> <text>{{v.substanceName}}</text> <text>{{v.total}}</text> + <text>{{v.goodsType}}</text> <text>{{v.substanceName}}</text> <text>{{v.inputQuantity*parseFloat(v.specs[0])}}{{v.specs[1]}}</text> </view> <view slot="button" class="u-swipe-action-item__right__button"> <button class="cu-btn bg-red" style="margin:auto;" @click="formData.inputList.splice(k,1)">删除</button> @@ -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, })