From ae3af49c3dcf82e05713add46697f889a55cc3cb Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp <m13724205240@163.com> Date: Thu, 29 Jun 2023 11:48:22 +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=E8=A7=84=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/massif/add_farming.vue | 2 +- pages/massif/agrSpecs.vue | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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 @@ <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> 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