|
|
@ -75,20 +75,20 @@ Page({ |
|
|
this.data.form[e.target.id] = e.detail.value |
|
|
this.data.form[e.target.id] = e.detail.value |
|
|
if(e.target.id == 'deductPercent'){ |
|
|
if(e.target.id == 'deductPercent'){ |
|
|
if(util.isEmpty(e.detail.value) || Number(e.detail.value) <= 0){ |
|
|
if(util.isEmpty(e.detail.value) || Number(e.detail.value) <= 0){ |
|
|
this.setData({ ['form.deductWeight']: null }) |
|
|
|
|
|
|
|
|
this.setData({ ['form.deductWeight']: null, ['form.deductPercent']: null }) |
|
|
} else { |
|
|
} else { |
|
|
this.setData({ ['form.deductWeight']: math.divide(math.times(this.data.form.totalWeight, Number(e.detail.value)), 100).toFixed(3) }) |
|
|
this.setData({ ['form.deductWeight']: math.divide(math.times(this.data.form.totalWeight, Number(e.detail.value)), 100).toFixed(3) }) |
|
|
} |
|
|
} |
|
|
} else if(e.target.id == 'deductWeight'){ |
|
|
} else if(e.target.id == 'deductWeight'){ |
|
|
if(util.isEmpty(e.detail.value) || Number(e.detail.value) <= 0){ |
|
|
if(util.isEmpty(e.detail.value) || Number(e.detail.value) <= 0){ |
|
|
this.setData({ ['form.deductPercent']: null }) |
|
|
|
|
|
|
|
|
this.setData({ ['form.deductWeight']: null, ['form.deductPercent']: null }) |
|
|
} else { |
|
|
} else { |
|
|
this.setData({ ['form.deductPercent']: math.times(math.divide(Number(e.detail.value), this.data.form.totalWeight), 100).toFixed(2) }) |
|
|
this.setData({ ['form.deductPercent']: math.times(math.divide(Number(e.detail.value), this.data.form.totalWeight), 100).toFixed(2) }) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onChange: function(e) { |
|
|
onChange: function(e) { |
|
|
this.data.form.remark = e.detail |
|
|
|
|
|
|
|
|
this.data.form.inspectionRemark = e.detail |
|
|
}, |
|
|
}, |
|
|
paddingOrder: function(){ |
|
|
paddingOrder: function(){ |
|
|
this.setData({ ['form.isWithoutTare']: !this.data.form.isWithoutTare }) |
|
|
this.setData({ ['form.isWithoutTare']: !this.data.form.isWithoutTare }) |
|
|
@ -143,6 +143,7 @@ Page({ |
|
|
} |
|
|
} |
|
|
data.plateNumber = this.data.form.plateNumber |
|
|
data.plateNumber = this.data.form.plateNumber |
|
|
data.productId = this.data.form.productId |
|
|
data.productId = this.data.form.productId |
|
|
|
|
|
data.sign = this.data.form.sign |
|
|
data.unitPrice = Number(this.data.form.unitPrice) |
|
|
data.unitPrice = Number(this.data.form.unitPrice) |
|
|
data.isWithoutTare = Number(this.data.form.isWithoutTare) |
|
|
data.isWithoutTare = Number(this.data.form.isWithoutTare) |
|
|
pricingOrder(data).then(result => { |
|
|
pricingOrder(data).then(result => { |
|
|
|