diff --git a/pages/massif/add_farming.vue b/pages/massif/add_farming.vue index f88611b..c38fba0 100644 --- a/pages/massif/add_farming.vue +++ b/pages/massif/add_farming.vue @@ -192,7 +192,7 @@ - {{v.goodsType}} {{v.substanceName}} {{v.inputQuantity*parseFloat(v.specs[0])}}{{v.specs[1]}} + {{v.goodsType}} {{v.substanceName}} {{v.inputQuantity}}{{v.specs[1]}} diff --git a/pages/massif/agrSpecs.vue b/pages/massif/agrSpecs.vue index 84df3ff..c3e0bde 100644 --- a/pages/massif/agrSpecs.vue +++ b/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