Browse Source

添加农事 修改农资总量

master
邓宏 2 years ago
parent
commit
b2a58e5574
  1. 13
      pages/massif/add_farming.vue
  2. 2
      pages/massif/agrSpecs.vue

13
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)
}
} }
})
},

2
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,
})

Loading…
Cancel
Save