From 8030c117918eea4dd4ba1ee1b18c3d68c09410d4 Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Wed, 13 Sep 2023 17:50:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A7=84=E6=A0=BC=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/massif/agrSpecs.vue | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pages/massif/agrSpecs.vue b/pages/massif/agrSpecs.vue index c3e0bde..d4b17dc 100644 --- a/pages/massif/agrSpecs.vue +++ b/pages/massif/agrSpecs.vue @@ -152,9 +152,17 @@ - + {{formData.specDescribe||"请选择规格"}} + 剩余:{{formData.number}}{{specsVal.specs[2]}} + @@ -171,6 +179,7 @@ export default { tip:"", list:[] }, + inputQuantity:{ label:"投入数量", required:true, @@ -204,13 +213,14 @@ export default { specsVal(n){ 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[2]}`) + this.$set(this.inputQuantity, "tip", `共${Math.round(parseFloat(n.num)/parseFloat(n.specs[0])*100)/100}${n.specs[2]}`) }else{ this.$set(this.inputQuantity, "tip", "") } } }, async onLoad(options){ + window.the=this this.eventChannel=this.getOpenerEventChannel() this.eventChannel.on("detail", e=>{ this.agrDetail=e @@ -229,6 +239,8 @@ export default { this.$provise.emit("forming_agr", list=>{ this.specs.list=res.data.map(v=>{ v.number-=list.reduce((a,b)=>a+(b.inventoryId==v.id?b.inputQuantity:0),0) + v.value=v.specificationId + v.label=v.specDescribe return v }).filter(v=>v.number>0) }) @@ -256,7 +268,7 @@ export default { uni.showToast({title:"投入数量必填!",icon:"none"}) return false }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"}) + uni.showToast({title:`投入数量不能大于${Math.round(this.formData.number*this.specsVal.specs[0]*100)/100}${this.specsVal.specs[1]}!`,icon:"none"}) return false } return true