|
|
|
@ -17,6 +17,7 @@ Scene({ |
|
|
|
activeNames: ['1'], |
|
|
|
paperList: [], |
|
|
|
visible: false, |
|
|
|
cIndex: -1 |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
@ -109,8 +110,9 @@ Scene({ |
|
|
|
onHide: function() { |
|
|
|
this.setData({ visible: false }) |
|
|
|
}, |
|
|
|
onConfirm: function({detail}){ |
|
|
|
this.data.nowItem = this.data.paperList[detail.index] |
|
|
|
onConfirm: function(e){ |
|
|
|
this.data.cIndex = e.currentTarget.dataset.index |
|
|
|
this.data.nowItem = this.data.paperList[this.data.cIndex] |
|
|
|
this.data.form.productId = this.data.nowItem.id |
|
|
|
var unitPrice = this.data.nowItem.defaultUnitPrice |
|
|
|
var amount = '' |
|
|
|
@ -118,7 +120,9 @@ Scene({ |
|
|
|
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']: this.data.nowItem.name, |
|
|
|
['form.unitPrice']: this.data.form.unitPrice, ['form.estimatedAmount']: amount, cIndex: this.data.cIndex }) |
|
|
|
}, |
|
|
|
onChange: function({detail}) { |
|
|
|
this.setData({ activeNames: detail }) |
|
|
|
|