Browse Source

no message

feature/v1.5
xpz2018 4 years ago
parent
commit
a2c8be90aa
5 changed files with 79 additions and 13 deletions
  1. 24
      pages/process/index/index.js
  2. 10
      pages/process/outside-info/index.js
  3. 4
      pages/process/outside-info/index.wxml
  4. 48
      pages/process/payment/index.js
  5. 6
      pages/process/payment/index.wxml

24
pages/process/index/index.js

@ -136,6 +136,28 @@ Component({
} else { } else {
this.data.tabList[2].badge = '' this.data.tabList[2].badge = ''
} }
if(Number(result.data.offsiteWaitReceiptNum) > 0){
this.data.tabList1[0].badge = Number(result.data.offsiteWaitReceiptNum)
} else {
this.data.tabList1[0].badge = ''
}
if(Number(result.data.offsiteWaitPriceNum) > 0){
this.data.tabList1[1].badge = Number(result.data.offsiteWaitPriceNum)
} else {
this.data.tabList1[1].badge = ''
}
if(Number(result.data.offsiteWaitPayOrderNum) > 0){
this.data.tabList1[2].badge = Number(result.data.offsiteWaitPayOrderNum)
} else {
this.data.tabList1[2].badge = ''
}
if(Number(result.data.offsiteCompleted) > 0){
this.data.tabList1[3].badge = Number(result.data.offsiteCompleted)
} else {
this.data.tabList1[3].badge = ''
}
if(util.isEmpty(result.data.availableCreditLine)){ if(util.isEmpty(result.data.availableCreditLine)){
result.data.availableCreditLine = app.userInfo.availableCreditLine result.data.availableCreditLine = app.userInfo.availableCreditLine
} }
@ -143,7 +165,7 @@ Component({
result.data.usedCreditLine = app.userInfo.usedCreditLine result.data.usedCreditLine = app.userInfo.usedCreditLine
} }
var vdateString = util.formatDate(new Date(vdate[0]), 'Y-M-D') + '至' + util.formatDate(new Date(vdate[1]), 'Y-M-D') var vdateString = util.formatDate(new Date(vdate[0]), 'Y-M-D') + '至' + util.formatDate(new Date(vdate[1]), 'Y-M-D')
this.setData({ tabList: this.data.tabList, totalInfo: result.data, vdate, vdateString })
this.setData({ tabList: this.data.tabList, tabList1: this.data.tabList1, totalInfo: result.data, vdate, vdateString })
if(loading){ if(loading){
wx.hideLoading() wx.hideLoading()
} }

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

@ -70,5 +70,15 @@ Scene({
wx.hideLoading() wx.hideLoading()
util.showToast(err) util.showToast(err)
}) })
},
paymentOrder: function(){
let pages = getCurrentPages() //当前页面栈
for (let index = 0; index < pages.length; index++) {
if (pages[index].route.indexOf('pages/process/payment/index') >= 0) {
wx.navigateBack()
return
}
}
wx.navigateTo({ url: `/pages/process/payment/index?id=${this.data.form.scrapPaperReceiptId}` })
} }
}) })

4
pages/process/outside-info/index.wxml

@ -144,6 +144,10 @@
<van-button plain type="default" custom-style="height:88rpx;width:254rpx" bind:click="checkForm">重新定价</van-button> <van-button plain type="default" custom-style="height:88rpx;width:254rpx" bind:click="checkForm">重新定价</van-button>
<van-button type="info" custom-style="margin-left:32rpx;height:88rpx;width:400rpx" bind:click="submitForm">审核通过</van-button> <van-button type="info" custom-style="margin-left:32rpx;height:88rpx;width:400rpx" bind:click="submitForm">审核通过</van-button>
</submit-layout> </submit-layout>
<submit-layout wx:if="{{form && admin && (form.orderStatus == 4 || form.orderStatus == 42)}}">
<van-button type="info" custom-style="height:88rpx;width:686rpx" bind:click="paymentOrder" wx:if="{{form.orderStatus == 4}}">进行支付</van-button>
<van-button type="info" custom-style="height:88rpx;width:686rpx" bind:click="paymentOrder" wx:if="{{form.orderStatus == 42}}">客户结算</van-button>
</submit-layout>
<view style="border-radius: 50rpx;position: fixed;bottom:160rpx;right:50rpx" wx:if="{{form}}"> <view style="border-radius: 50rpx;position: fixed;bottom:160rpx;right:50rpx" wx:if="{{form}}">
<van-button round type="info" bind:click="printOrder" custom-style="width: 100rpx;height: 100rpx;"> <van-button round type="info" bind:click="printOrder" custom-style="width: 100rpx;height: 100rpx;">

48
pages/process/payment/index.js

@ -1,7 +1,7 @@
// pages/process/payment/index.js // pages/process/payment/index.js
import Scene from '../../index/scene' import Scene from '../../index/scene'
import Dialog from '../../../components/dialog/dialog' import Dialog from '../../../components/dialog/dialog'
import { getPeymentList, paymentOrder, getFactoryOrderInfo, getSideOrderInfo } from "../../../api/saas"
import { getPeymentList, paymentOrder, getFactoryOrderInfo, getSideOrderInfo, getCustomerInfo } from "../../../api/saas"
const event = require('../../../utils/event') const event = require('../../../utils/event')
const util = require('../../../utils/util') const util = require('../../../utils/util')
const math = require('../../../utils/math') //导入模块 const math = require('../../../utils/math') //导入模块
@ -28,6 +28,7 @@ Scene({
ids: [], ids: [],
payRemark: '' payRemark: ''
}, },
settleType: '1',
requesting: false, requesting: false,
popup: false, popup: false,
show: false, show: false,
@ -58,24 +59,49 @@ Scene({
this.data.id = options.id this.data.id = options.id
wx.showLoading({ title: '正在获取', mask: true }) wx.showLoading({ title: '正在获取', mask: true })
getSideOrderInfo({id: options.id}).then(result => { getSideOrderInfo({id: options.id}).then(result => {
wx.hideLoading()
this.data.amount = 0 this.data.amount = 0
var settleWeight = 0
var productName = ''
for (let index = 0; index < result.data.productCategoryInfos.length; index++) { for (let index = 0; index < result.data.productCategoryInfos.length; index++) {
const element = result.data.productCategoryInfos[index] const element = result.data.productCategoryInfos[index]
element.fileList = []
for (let k = 0; k < element.weightNoteImages.length; k++) {
element.fileList.push({url: element.weightNoteImages[k]})
// element.fileList = []
// for (let k = 0; k < element.weightNoteImages.length; k++) {
// element.fileList.push({url: element.weightNoteImages[k]})
// }
if(util.isEmpty(productName)){
productName = element.productCategoryName
} else {
productName += ',' + element.productCategoryName
} }
settleWeight = math.plus(element.settleWeight, settleWeight)
element.settlePrice = math.times(element.settleWeight, element.settleUnitPrice) element.settlePrice = math.times(element.settleWeight, element.settleUnitPrice)
this.data.amount = math.plus(this.data.amount, element.settlePrice) this.data.amount = math.plus(this.data.amount, element.settlePrice)
} }
result.data.id = result.data.scrapPaperReceiptId
result.data.productName = productName
result.data.settleWeight = settleWeight
result.data.settlePrice = this.data.amount
this.setData({ orderList: [result.data], amount: this.data.amount, orderStatus: result.data.orderStatus }) this.setData({ orderList: [result.data], amount: this.data.amount, orderStatus: result.data.orderStatus })
this.fetchCustomerInfo(result.data)
}).catch(err => { }).catch(err => {
wx.hideLoading() wx.hideLoading()
util.showToast(err) util.showToast(err)
}) })
} }
}, },
fetchCustomerInfo: function(orderInfo){
getCustomerInfo(orderInfo.factoryCustomerId).then(result => {
wx.hideLoading()
this.data.params.bankCardNo = result.data.bankCardNo
this.data.settleType = '' + result.data.defaultPaymentMethod
this.data.params.ids = []
this.data.params.ids.push(orderInfo.scrapPaperReceiptId)
this.setData({ params: this.data.params })
}).catch(err => {
wx.hideLoading()
util.showToast(err)
})
},
amountList: function(orderList){ amountList: function(orderList){
var amount = 0 var amount = 0
this.data.params.ids = [] this.data.params.ids = []
@ -85,7 +111,7 @@ Scene({
amount = math.plus(amount, element.settlePrice) amount = math.plus(amount, element.settlePrice)
this.data.params.ids.push(element.id) this.data.params.ids.push(element.id)
if(index == 0 && Number(element.settleType) == 2 && !util.isEmpty(element.bankCardNo)){ if(index == 0 && Number(element.settleType) == 2 && !util.isEmpty(element.bankCardNo)){
this.data.params.settleType = '2'
this.data.settleType = '2'
this.data.params.bankCardNo = element.bankCardNo this.data.params.bankCardNo = element.bankCardNo
} }
} }
@ -103,14 +129,14 @@ Scene({
} }
}, },
onTypeChange: function({detail}){ onTypeChange: function({detail}){
this.setData({ ['params.settleType']: detail })
this.setData({ settleType: detail })
}, },
onTypeClick(e) { onTypeClick(e) {
if(Number(e.currentTarget.dataset.name == 2) && util.isEmpty(this.data.params.bankCardNo)){ if(Number(e.currentTarget.dataset.name == 2) && util.isEmpty(this.data.params.bankCardNo)){
util.showToast('暂无客户银行卡信息,无法进行银行卡转账') util.showToast('暂无客户银行卡信息,无法进行银行卡转账')
return return
} }
this.setData({ ['params.settleType']: e.currentTarget.dataset.name })
this.setData({ settleType: e.currentTarget.dataset.name })
}, },
onChange: function(e){ onChange: function(e){
var item = this.data.orderList[e.currentTarget.dataset.index] var item = this.data.orderList[e.currentTarget.dataset.index]
@ -127,6 +153,10 @@ Scene({
}, },
lookItem: function(e){ lookItem: function(e){
var item = this.data.orderList[e.currentTarget.dataset.index] var item = this.data.orderList[e.currentTarget.dataset.index]
if(!util.isEmpty(item.scrapPaperReceiptId)){
wx.navigateTo({ url: `/pages/process/outside-info/index?id=${item.scrapPaperReceiptId}` })
return
}
wx.showLoading({ title: '正在获取', mask: true }) wx.showLoading({ title: '正在获取', mask: true })
getFactoryOrderInfo(item.id).then(result => { getFactoryOrderInfo(item.id).then(result => {
this.setData({ popup: true, detail: result.data }) this.setData({ popup: true, detail: result.data })
@ -190,7 +220,7 @@ Scene({
return return
} }
Dialog.confirm({ title: '温馨提示', message: '订单已经付款,在此进行确认?' }).then(() => { Dialog.confirm({ title: '温馨提示', message: '订单已经付款,在此进行确认?' }).then(() => {
this.agentPayment(this.data.params.settleType)
this.agentPayment(this.data.settleType)
}).catch(err => { }).catch(err => {
}) })
}, },

6
pages/process/payment/index.wxml

@ -15,7 +15,7 @@
<view class="text-black text-sg text-bold" style="margin-left: 12rpx">付款方式</view> <view class="text-black text-sg text-bold" style="margin-left: 12rpx">付款方式</view>
</view> </view>
<view style="min-height:90rpx;padding-right:32rpx"> <view style="min-height:90rpx;padding-right:32rpx">
<van-radio-group value="{{ params.settleType }}" bind:change="onTypeChange">
<van-radio-group value="{{ settleType }}" bind:change="onTypeChange">
<van-cell-group> <van-cell-group>
<van-cell title="现金" clickable data-name="1" bind:click="onTypeClick"> <van-cell title="现金" clickable data-name="1" bind:click="onTypeClick">
<van-radio slot="right-icon" name="1" /> <van-radio slot="right-icon" name="1" />
@ -62,8 +62,8 @@
</view> </view>
<view class="text-sm text-gray" style="line-height:54rpx"> <view class="text-sm text-gray" style="line-height:54rpx">
<text>品类:{{item.productName}}</text> <text>品类:{{item.productName}}</text>
<text style="margin-left:16rpx">重量:{{item.settleWeight}}公斤</text>
<text style="margin-left:16rpx">金额:{{formate.formateAmount(item.settlePrice)}}元</text>
<text style="margin-left:24rpx">重量:{{item.settleWeight}}公斤</text>
<text style="margin-left:24rpx">金额:{{formate.formateAmount(item.settlePrice, 2)}}元</text>
</view> </view>
</view> </view>
</view> </view>

Loading…
Cancel
Save