|
|
@ -122,10 +122,11 @@ Scene({ |
|
|
onConfirm: function({detail}){ |
|
|
onConfirm: function({detail}){ |
|
|
this.data.nowItem = this.data.paperList[detail.index] |
|
|
this.data.nowItem = this.data.paperList[detail.index] |
|
|
this.data.form.productId = this.data.nowItem.id |
|
|
this.data.form.productId = this.data.nowItem.id |
|
|
this.data.form.unitPrice = this.data.nowItem.defaultUnitPrice |
|
|
|
|
|
|
|
|
var unitPrice = this.data.nowItem.defaultUnitPrice |
|
|
var amount = '' |
|
|
var amount = '' |
|
|
if(!util.isEmpty(this.data.form.unitPrice) && Number(this.data.form.unitPrice) > 0){ |
|
|
|
|
|
amount = math.times(this.data.form.unitPrice, this.data.poundInfo.netWeight) |
|
|
|
|
|
|
|
|
if(!util.isEmpty(unitPrice) && Number(unitPrice) > 0){ |
|
|
|
|
|
this.data.form.unitPrice = math.times(unitPrice, 1000) |
|
|
|
|
|
amount = math.times(unitPrice, this.data.poundInfo.netWeight) |
|
|
} |
|
|
} |
|
|
this.setData({ visible: false, ['form.productName']: detail.value, ['form.unitPrice']: this.data.form.unitPrice, ['form.estimatedAmount']: amount }) |
|
|
this.setData({ visible: false, ['form.productName']: detail.value, ['form.unitPrice']: this.data.form.unitPrice, ['form.estimatedAmount']: amount }) |
|
|
}, |
|
|
}, |
|
|
@ -137,7 +138,7 @@ Scene({ |
|
|
if(e.currentTarget.id == 'unitPrice'){ |
|
|
if(e.currentTarget.id == 'unitPrice'){ |
|
|
var amount = '' |
|
|
var amount = '' |
|
|
if(!util.isEmpty(this.data.form.unitPrice) && Number(this.data.form.unitPrice) > 0){ |
|
|
if(!util.isEmpty(this.data.form.unitPrice) && Number(this.data.form.unitPrice) > 0){ |
|
|
amount = math.times(this.data.form.unitPrice, this.data.poundInfo.netWeight) |
|
|
|
|
|
|
|
|
amount = math.divide(math.times(this.data.form.unitPrice, this.data.poundInfo.netWeight), 1000) |
|
|
} |
|
|
} |
|
|
this.setData({ visible: false, ['form.estimatedAmount']: amount }) |
|
|
this.setData({ visible: false, ['form.estimatedAmount']: amount }) |
|
|
} |
|
|
} |
|
|
|