|
|
|
@ -41,7 +41,7 @@ Component({ |
|
|
|
} |
|
|
|
}, |
|
|
|
bindInput: function (e) { |
|
|
|
this.data.item[e.currentTarget.id] = e.detail |
|
|
|
this.data.item[e.currentTarget.id] = e.detail.value |
|
|
|
if(e.currentTarget.id == 'grossWeight' || e.currentTarget.id == 'tareWeight'){ |
|
|
|
if(Number(this.data.item.grossWeight) > 0){ |
|
|
|
if(Number(this.data.item.tareWeight) > 0){ |
|
|
|
@ -59,19 +59,19 @@ Component({ |
|
|
|
this.setData({['item.netWeight']: null, ['item.estimatedAmount']: null}) |
|
|
|
} |
|
|
|
} else if(e.currentTarget.id == 'deductPercent'){ |
|
|
|
if(util.isEmpty(e.detail) || Number(e.detail) <= 0){ |
|
|
|
if(util.isEmpty(e.detail.value) || Number(e.detail.value) <= 0){ |
|
|
|
this.data.item.deductWeight = null |
|
|
|
this.data.item.deductPercent = null |
|
|
|
} else { |
|
|
|
this.data.item.deductWeight = math.divide(math.times(this.data.item.netWeight, Number(e.detail)), 100).toFixed(2) |
|
|
|
this.data.item.deductWeight = math.divide(math.times(this.data.item.netWeight, Number(e.detail.value)), 100).toFixed(2) |
|
|
|
} |
|
|
|
this.statAmount() |
|
|
|
} else if(e.currentTarget.id == 'deductWeight'){ |
|
|
|
if(util.isEmpty(e.detail) || Number(e.detail) <= 0){ |
|
|
|
if(util.isEmpty(e.detail.value) || Number(e.detail.value) <= 0){ |
|
|
|
this.data.item.deductWeight = null |
|
|
|
this.data.item.deductPercent = null |
|
|
|
} else { |
|
|
|
this.data.item.deductPercent = math.times(math.divide(Number(e.detail), this.data.item.netWeight), 100).toFixed(2) |
|
|
|
this.data.item.deductPercent = math.times(math.divide(Number(e.detail.value), this.data.item.netWeight), 100).toFixed(2) |
|
|
|
} |
|
|
|
this.statAmount() |
|
|
|
} else if(e.currentTarget.id == 'settleUnitPrice'){ |
|
|
|
@ -102,7 +102,6 @@ Component({ |
|
|
|
changeDeductType: function(e){ |
|
|
|
var type = Number(e.currentTarget.dataset.type) |
|
|
|
this.setData({ ['item.sign']: type, focus: type }) |
|
|
|
console.log(this.data.item) |
|
|
|
}, |
|
|
|
fileChange: function({detail}){ |
|
|
|
this.data.fileList = detail.fileList |
|
|
|
|