|
|
@ -94,10 +94,19 @@ Scene({ |
|
|
onConfirm: function(e){ |
|
|
onConfirm: function(e){ |
|
|
this.data.cIndex = e.currentTarget.dataset.index |
|
|
this.data.cIndex = e.currentTarget.dataset.index |
|
|
this.data.nowItem = this.data.paperList[this.data.cIndex] |
|
|
this.data.nowItem = this.data.paperList[this.data.cIndex] |
|
|
|
|
|
if(this.data.form.categoryId == this.data.nowItem.id){ |
|
|
|
|
|
this.setData({ visible: false }) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
this.data.form.categoryId = this.data.nowItem.id |
|
|
this.data.form.categoryId = this.data.nowItem.id |
|
|
if(!util.isEmpty(this.data.nowItem.defaultUnitPrice) && Number(this.data.nowItem.defaultUnitPrice) > 0){ |
|
|
if(!util.isEmpty(this.data.nowItem.defaultUnitPrice) && Number(this.data.nowItem.defaultUnitPrice) > 0){ |
|
|
var price = math.times(this.data.nowItem.defaultUnitPrice, 1000) |
|
|
|
|
|
this.setData({ visible: false, ['form.categoryName']: this.data.nowItem.name, ['form.settleUnitPrice']: price, cIndex: this.data.cIndex }) |
|
|
|
|
|
|
|
|
this.setData({ |
|
|
|
|
|
visible: false, |
|
|
|
|
|
['form.categoryName']: this.data.nowItem.name, |
|
|
|
|
|
['form.settleUnitPrice']: '', |
|
|
|
|
|
['form.konePrice']: '指导价格:' + math.times(this.data.nowItem.defaultUnitPrice, 1000), |
|
|
|
|
|
cIndex: this.data.cIndex |
|
|
|
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
this.setData({ visible: false, ['form.categoryName']: this.data.nowItem.name, cIndex: this.data.cIndex }) |
|
|
this.setData({ visible: false, ['form.categoryName']: this.data.nowItem.name, cIndex: this.data.cIndex }) |
|
|
} |
|
|
} |
|
|
@ -159,6 +168,16 @@ Scene({ |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
printOrderInfo: function(){ |
|
|
|
|
|
wx.showLoading({ title: '正在处理', mask: true }) |
|
|
|
|
|
printOrder({id: this.data.orderInfo.id, printType: 3 }).then(result => { |
|
|
|
|
|
wx.hideLoading() |
|
|
|
|
|
util.showToast('即将打印,请稍后') |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
wx.hideLoading() |
|
|
|
|
|
util.showToast(err) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
settlementForm: function(){ |
|
|
settlementForm: function(){ |
|
|
if(util.isEmpty(this.data.form.categoryId) || Number(this.data.form.categoryId) <= 0){ |
|
|
if(util.isEmpty(this.data.form.categoryId) || Number(this.data.form.categoryId) <= 0){ |
|
|
util.showToast('请选择废纸品类') |
|
|
util.showToast('请选择废纸品类') |
|
|
|