Browse Source

添加农事 修改规格

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

2
pages/massif/add_farming.vue

@ -192,7 +192,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.inputQuantity*parseFloat(v.specs[0])}}{{v.specs[1]}}</text>
<text>{{v.goodsType}}</text> <text>{{v.substanceName}}</text> <text>{{v.inputQuantity}}{{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>

8
pages/massif/agrSpecs.vue

@ -202,9 +202,9 @@ export default {
},
watch:{
specsVal(n){
this.inputQuantity.suffix=n.specs[2]
this.inputQuantity.suffix=n.specs[1]
if(n.num>0 && n.specs[0]>0){
this.$set(this.inputQuantity, "tip", `${parseFloat(n.num)*parseFloat(n.specs[0])}${n.specs[1]}`)
this.$set(this.inputQuantity, "tip", `${parseFloat(n.num)/parseFloat(n.specs[0])}${n.specs[2]}`)
}else{
this.$set(this.inputQuantity, "tip", "")
}
@ -255,8 +255,8 @@ export default {
}else if(!(this.formData.inputQuantity>0)){
uni.showToast({title:"投入数量必填!",icon:"none"})
return false
}else if(this.formData.inputQuantity>this.formData.number){
uni.showToast({title:`投入数量不能大于剩余数量${this.formData.number}`,icon:"none"})
}else if(parseFloat(this.specsVal.num)/parseFloat(this.specsVal.specs[0])>this.formData.number){
uni.showToast({title:`投入数量不能大于${this.formData.number}${this.specsVal.specs[2]}`,icon:"none"})
return false
}
return true

Loading…
Cancel
Save