Browse Source

订阅通知

feature/v2.2
xpz2018 4 years ago
parent
commit
0ac8ecdc86
7 changed files with 74 additions and 36 deletions
  1. 24
      pages/process/order-check/index.js
  2. 22
      pages/process/order-info/index.js
  3. 2
      pages/process/outside-add/index.js
  4. 25
      pages/process/outside-check/index.js
  5. 22
      pages/process/outside-info/index.js
  6. 2
      pages/process/outside-price/index.js
  7. 13
      pages/process/payment/index.js

24
pages/process/order-check/index.js

@ -144,7 +144,7 @@ Scene({
util.showToast('扣点范围:0-100') util.showToast('扣点范围:0-100')
return return
} }
wx.showLoading({ title: '处理中', mask: true })
var data = {id: this.data.form.id} var data = {id: this.data.form.id}
if(Number(this.data.form.deductWeight) > 0){ if(Number(this.data.form.deductWeight) > 0){
data.deductWeight = Number(this.data.form.deductWeight) data.deductWeight = Number(this.data.form.deductWeight)
@ -157,13 +157,21 @@ Scene({
data.deductType = this.data.form.deductType data.deductType = this.data.form.deductType
data.unitPrice = Number(this.data.form.unitPrice) data.unitPrice = Number(this.data.form.unitPrice)
var factoryCustomerId = this.data.form.factoryCustomerId var factoryCustomerId = this.data.form.factoryCustomerId
checkingOrder({ id: this.data.form.id, factoryCustomerId, editOrderPriceDto: data }).then(result => {
wx.hideLoading()
event.emit('OrderMessage', { what: 12, desc: 'checkingOrder' })
util.showBackToast('订单审核已通过')
}).catch(err => {
wx.hideLoading()
util.showToast(err)
var that = this
wx.requestSubscribeMessage({
tmplIds: ['DJaSy0a5TNp9v_ICQ0ZY5-hkZ91dEXZuKq_hQVBTnOA', '4IWtlcg1HhLN7AFepB3VeZF-4D0b9gbjwWBruKMhAJM'],
complete(res) {
wx.showLoading({ title: '处理中', mask: true })
checkingOrder({ id: that.data.form.id, factoryCustomerId, editOrderPriceDto: data }).then(result => {
wx.hideLoading()
event.emit('OrderMessage', { what: 12, desc: 'checkingOrder' })
util.showBackToast('订单审核已通过')
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
}
}) })
}, },
viewImage: function (e) { viewImage: function (e) {

22
pages/process/order-info/index.js

@ -136,14 +136,20 @@ Scene({
wx.redirectTo({ url: `/pages/process/order-check/index?id=${this.data.form.id}` }) wx.redirectTo({ url: `/pages/process/order-check/index?id=${this.data.form.id}` })
}, },
checkOrder: function(e){ checkOrder: function(e){
wx.showLoading({ title: '正在处理', mask: true })
checkingOrder({ id: this.data.form.id }).then(result => {
wx.hideLoading()
util.showBackToast('订单审核已通过')
event.emit('OrderMessage', { what: 12, desc: 'checkingOrder' })
}).catch(err => {
wx.hideLoading()
util.showToast(err)
var that = this
wx.requestSubscribeMessage({
tmplIds: ['DJaSy0a5TNp9v_ICQ0ZY5-hkZ91dEXZuKq_hQVBTnOA', '4IWtlcg1HhLN7AFepB3VeZF-4D0b9gbjwWBruKMhAJM'],
complete(res) {
wx.showLoading({ title: '正在处理', mask: true })
checkingOrder({ id: that.data.form.id }).then(result => {
wx.hideLoading()
util.showBackToast('订单审核已通过')
event.emit('OrderMessage', { what: 12, desc: 'checkingOrder' })
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
}
}) })
}, },
viewImage: function (e) { viewImage: function (e) {

2
pages/process/outside-add/index.js

@ -211,7 +211,7 @@ Scene({
} else { } else {
var that = this var that = this
wx.requestSubscribeMessage({ wx.requestSubscribeMessage({
tmplIds: ['DJaSy0a5TNp9v_ICQ0ZY5-hkZ91dEXZuKq_hQVBTnOA'],
tmplIds: ['zOH2Mbzn6vVUaS_11s2cW4Mr0Y52O-i6gvu8AWlpOi8', 'DJaSy0a5TNp9v_ICQ0ZY5-hkZ91dEXZuKq_hQVBTnOA'],
complete(res) { complete(res) {
wx.showLoading({ title: '处理中', mask: true }) wx.showLoading({ title: '处理中', mask: true })
createSideOrder(that.data.form).then(result => { createSideOrder(that.data.form).then(result => {

25
pages/process/outside-check/index.js

@ -77,7 +77,7 @@ Scene({
return null return null
}, },
checkOrder: function(){ checkOrder: function(){
var weightNoteList = []
var productCategorySettleInfoDtoList = []
for (let index = 0; index < this.data.form.productCategoryInfos.length; index++) { for (let index = 0; index < this.data.form.productCategoryInfos.length; index++) {
const element = this.data.form.productCategoryInfos[index] const element = this.data.form.productCategoryInfos[index]
if(util.isEmpty(element.settleUnitPrice) || Number(element.settleUnitPrice) <= 0){ if(util.isEmpty(element.settleUnitPrice) || Number(element.settleUnitPrice) <= 0){
@ -101,15 +101,22 @@ Scene({
item.deductWeight = element.deductWeight item.deductWeight = element.deductWeight
item.deductPercent = element.deductPercent item.deductPercent = element.deductPercent
item.settleUnitPrice = element.settleUnitPrice item.settleUnitPrice = element.settleUnitPrice
weightNoteList.push(item)
productCategorySettleInfoDtoList.push(item)
} }
repeatSideOrder({scrapPaperReceiptId: this.data.form.scrapPaperReceiptId, productCategorySettleInfoDtoList: weightNoteList }).then(result => {
wx.hideLoading()
event.emit('OrderMessage', { what: 12, desc: 'repeatSideOrder' })
util.showBackToast('订单审核已通过')
}).catch(err => {
wx.hideLoading()
util.showToast(err)
var that = this
wx.requestSubscribeMessage({
tmplIds: ['DJaSy0a5TNp9v_ICQ0ZY5-hkZ91dEXZuKq_hQVBTnOA', '4IWtlcg1HhLN7AFepB3VeZF-4D0b9gbjwWBruKMhAJM'],
complete(res) {
wx.showLoading({ title: '处理中', mask: true })
repeatSideOrder({scrapPaperReceiptId: that.data.form.scrapPaperReceiptId, productCategorySettleInfoDtoList }).then(result => {
wx.hideLoading()
event.emit('OrderMessage', { what: 12, desc: 'repeatSideOrder' })
util.showBackToast('订单审核已通过')
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
}
}) })
} }
}) })

22
pages/process/outside-info/index.js

@ -109,14 +109,20 @@ Scene({
} }
}, },
checkPass: function(){ checkPass: function(){
wx.showLoading({ title: '处理中', mask: true })
repeatSideOrder({scrapPaperReceiptId: this.data.form.scrapPaperReceiptId }).then(result => {
wx.hideLoading()
util.showBackToast('订单审核已通过')
event.emit('OrderMessage', { what: 12, desc: 'pricingOrder' })
}).catch(err => {
wx.hideLoading()
util.showToast(err)
var that = this
wx.requestSubscribeMessage({
tmplIds: ['DJaSy0a5TNp9v_ICQ0ZY5-hkZ91dEXZuKq_hQVBTnOA', '4IWtlcg1HhLN7AFepB3VeZF-4D0b9gbjwWBruKMhAJM'],
complete(res) {
wx.showLoading({ title: '处理中', mask: true })
repeatSideOrder({scrapPaperReceiptId: that.data.form.scrapPaperReceiptId }).then(result => {
wx.hideLoading()
util.showBackToast('订单审核已通过')
event.emit('OrderMessage', { what: 12, desc: 'pricingOrder' })
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
}
}) })
}, },
paymentOrder: function(){ paymentOrder: function(){

2
pages/process/outside-price/index.js

@ -213,7 +213,7 @@ Scene({
var that = this var that = this
wx.requestSubscribeMessage({ wx.requestSubscribeMessage({
tmplIds: ['DJaSy0a5TNp9v_ICQ0ZY5-hkZ91dEXZuKq_hQVBTnOA'],
tmplIds: ['DJaSy0a5TNp9v_ICQ0ZY5-hkZ91dEXZuKq_hQVBTnOA', '4IWtlcg1HhLN7AFepB3VeZF-4D0b9gbjwWBruKMhAJM'],
complete(res) { complete(res) {
wx.showLoading({ title: '处理中', mask: true }) wx.showLoading({ title: '处理中', mask: true })
priceSideOrder(data).then(result => { priceSideOrder(data).then(result => {

13
pages/process/payment/index.js

@ -163,6 +163,7 @@ Scene({
wx.showLoading({ title: '正在处理', mask: true }) wx.showLoading({ title: '正在处理', mask: true })
this.data.requesting = true this.data.requesting = true
this.data.params.settleType = Number(settleType) this.data.params.settleType = Number(settleType)
paymentOrder(this.data.params).then(result => { paymentOrder(this.data.params).then(result => {
wx.hideLoading() wx.hideLoading()
if(!util.isEmpty(result.message)){ if(!util.isEmpty(result.message)){
@ -212,7 +213,17 @@ Scene({
return return
} }
Dialog.confirm({ title: '温馨提示', message: '操作后不能撤销,确认付款吗?' }).then(() => { Dialog.confirm({ title: '温馨提示', message: '操作后不能撤销,确认付款吗?' }).then(() => {
this.agentPayment(this.data.settleType)
if(Number(this.data.settleType) == 3) {
var that = this
wx.requestSubscribeMessage({
tmplIds: ['4IWtlcg1HhLN7AFepB3VeZF-4D0b9gbjwWBruKMhAJM', 'DJaSy0a5TNp9v_ICQ0ZY5-hkZ91dEXZuKq_hQVBTnOA'],
complete(res) {
that.agentPayment(that.data.settleType)
}
})
} else {
this.agentPayment(this.data.settleType)
}
}).catch(err => { }).catch(err => {
}) })
}, },

Loading…
Cancel
Save