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