Browse Source

no message

feature/v2.3
xpz2018 4 years ago
parent
commit
a58f332643
4 changed files with 30 additions and 14 deletions
  1. 10
      pages/process/payment/index.js
  2. 2
      pages/process/payment/index.wxml
  3. 25
      pages/storage/order-settlement/index.js
  4. 7
      pages/storage/order-settlement/index.wxml

10
pages/process/payment/index.js

@ -104,12 +104,16 @@ Scene({
if (orderList && orderList.length) { if (orderList && orderList.length) {
for (let index = 0; index < orderList.length; index++) { for (let index = 0; index < orderList.length; index++) {
const element = orderList[index] const element = orderList[index]
amount = math.plus(amount, element.settlePrice)
amount = math.plus(amount, element.adjustedPrice)
this.data.params.ids.push(element.id) this.data.params.ids.push(element.id)
if(!util.isEmpty(element.bankCardNo)){ if(!util.isEmpty(element.bankCardNo)){
this.data.params.bankCardNo = element.bankCardNo this.data.params.bankCardNo = element.bankCardNo
} }
this.data.settleType = String(element.settleType)
// this.data.settleType = String(element.settleType)
}
var settleType = app.userInfo.factory.settleType
if(settleType){
this.data.settleType = String(settleType)
} }
this.data.orderStatus = orderList[0].status this.data.orderStatus = orderList[0].status
this.setData({ this.setData({
@ -142,7 +146,7 @@ Scene({
this.data.params.ids = [] this.data.params.ids = []
for (let index = 0; index < this.data.orderList.length; index++) { for (let index = 0; index < this.data.orderList.length; index++) {
if(!this.data.orderList[index].checked){ if(!this.data.orderList[index].checked){
amount = math.plus(amount, this.data.orderList[index].settlePrice)
amount = math.plus(amount, this.data.orderList[index].adjustedPrice)
this.data.params.ids.push(this.data.orderList[index].id) this.data.params.ids.push(this.data.orderList[index].id)
} }
} }

2
pages/process/payment/index.wxml

@ -61,7 +61,7 @@
<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:24rpx">重量:{{item.settleWeight}}公斤</text> <text style="margin-left:24rpx">重量:{{item.settleWeight}}公斤</text>
<text style="margin-left:24rpx">金额:{{formate.formateAmount(item.settlePrice, 2)}}元</text>
<text style="margin-left:24rpx">金额:{{formate.formateAmount(item.adjustedPrice, 2)}}元</text>
</view> </view>
</view> </view>
</view> </view>

25
pages/storage/order-settlement/index.js

@ -152,17 +152,28 @@ Scene({
} else { } else {
this.setData({ ['form.netWeight']: e.detail }) this.setData({ ['form.netWeight']: e.detail })
} }
} else {
this.statAmount()
} }
this.statAmount()
}, },
statAmount: function(){ statAmount: function(){
if(!util.isEmpty(this.data.form.settleUnitPrice) && !util.isEmpty(this.data.form.settleWeight)){
var amout = math.times(this.data.form.settleUnitPrice, this.data.form.settleWeight)
if(!util.isEmpty(this.data.form.otherFee)){
amout = math.minus(amout, this.data.form.otherFee)
}
this.setData({ ['form.settlePrice']: amout })
if(util.isEmpty(this.data.form.receivablePrice)){
return
}
var amout = Number(this.data.form.receivablePrice)
if(!util.isEmpty(this.data.form.freight)){
amout = math.minus(amout, this.data.form.freight)
}
if(!util.isEmpty(this.data.form.proxyPaySurcharge)){
amout = math.minus(amout, this.data.form.proxyPaySurcharge)
}
if(!util.isEmpty(this.data.form.otherFee)){
amout = math.minus(amout, this.data.form.otherFee)
}
if(!util.isEmpty(this.data.form.subsidy)){
amout = math.plus(amout, this.data.form.subsidy)
} }
this.setData({ amout })
}, },
fileChange: function({detail}){ fileChange: function({detail}){
this.data.fileList = detail.fileList this.data.fileList = detail.fileList

7
pages/storage/order-settlement/index.wxml

@ -10,8 +10,8 @@
<view style="height:30rpx;width:6rpx;background-image: linear-gradient(180deg, #007AFF 0%, #027BFF 15%, #5AABFF 45%, #CAF4FE 100%);"></view> <view style="height:30rpx;width:6rpx;background-image: linear-gradient(180deg, #007AFF 0%, #027BFF 15%, #5AABFF 45%, #CAF4FE 100%);"></view>
<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 class="text-red text-cancel" style="padding:4rpx 0rpx 4rpx 4rpx" bindtap="closeForm">关闭订单</view> -->
<van-button type="danger" round custom-style="width:120rpx" size="mini" bind:click="closeForm">关闭订单</van-button>
<view class="text-red text-cancel" style="padding:4rpx 0rpx 4rpx 4rpx" bindtap="closeForm">关闭订单</view>
<!-- <van-button type="danger" round custom-style="width:120rpx" size="mini" bind:click="closeForm">关闭订单</van-button> -->
</view> </view>
<van-cell center required clickable is-link arrow-direction="down" bind:click="showCategory"> <van-cell center required clickable is-link arrow-direction="down" bind:click="showCategory">
<view slot="title" class="flex flex-justify"> <view slot="title" class="flex flex-justify">
@ -26,11 +26,12 @@
<van-field id="deductPercent" value="{{ form.deductPercent || '' }}" label="扣点(%)" maxlength="4" type="digit" placeholder="请输入扣点" clearable input-align="right" bind:change="bindInput"></van-field> <van-field id="deductPercent" value="{{ form.deductPercent || '' }}" label="扣点(%)" maxlength="4" type="digit" placeholder="请输入扣点" clearable input-align="right" bind:change="bindInput"></van-field>
<van-field id="settleWeight" value="{{ form.settleWeight || '' }}" label="结算重量(吨)" maxlength="8" type="digit" placeholder="请输入结算重量" clearable input-align="right" bind:change="bindInput"></van-field> <van-field id="settleWeight" value="{{ form.settleWeight || '' }}" label="结算重量(吨)" maxlength="8" type="digit" placeholder="请输入结算重量" clearable input-align="right" bind:change="bindInput"></van-field>
<!-- <van-field id="otherFee" value="{{ form.otherFee || '' }}" label="其他费用(元)" maxlength="8" type="digit" placeholder="请输入其他费用" clearable input-align="right" bind:change="bindInput"></van-field> --> <!-- <van-field id="otherFee" value="{{ form.otherFee || '' }}" label="其他费用(元)" maxlength="8" type="digit" placeholder="请输入其他费用" clearable input-align="right" bind:change="bindInput"></van-field> -->
<van-field id="settlePrice" value="{{ form.settlePrice || '' }}" title-width="240rpx" label="纸厂结算金额(元)" maxlength="8" type="digit" placeholder="请输入结算金额" clearable input-align="right" bind:change="bindInput"></van-field>
<van-field id="receivablePrice" value="{{ form.receivablePrice || '' }}" title-width="240rpx" label="纸厂结算金额(元)" maxlength="8" type="digit" placeholder="请输入结算金额" clearable input-align="right" bind:change="bindInput"></van-field>
<van-field id="proxyPaySurcharge" value="{{ form.proxyPaySurcharge || '' }}" label="代卖费(元)" maxlength="8" type="digit" placeholder="请输入代卖费" clearable input-align="right" bind:change="bindInput"></van-field> <van-field id="proxyPaySurcharge" value="{{ form.proxyPaySurcharge || '' }}" label="代卖费(元)" maxlength="8" type="digit" placeholder="请输入代卖费" clearable input-align="right" bind:change="bindInput"></van-field>
<van-field id="freight" value="{{ form.freight || '' }}" label="运费(元)" maxlength="8" type="digit" placeholder="请输入运费" clearable input-align="right" bind:change="bindInput"></van-field> <van-field id="freight" value="{{ form.freight || '' }}" label="运费(元)" maxlength="8" type="digit" placeholder="请输入运费" clearable input-align="right" bind:change="bindInput"></van-field>
<van-field id="otherFee" value="{{ form.otherFee || '' }}" label="其他费用(元)" maxlength="8" type="digit" placeholder="请输入其他费用" clearable input-align="right" bind:change="bindInput"></van-field> <van-field id="otherFee" value="{{ form.otherFee || '' }}" label="其他费用(元)" maxlength="8" type="digit" placeholder="请输入其他费用" clearable input-align="right" bind:change="bindInput"></van-field>
<van-field id="subsidy" value="{{ form.subsidy || '' }}" label="补贴(元)" maxlength="8" type="digit" placeholder="请输入补贴" clearable input-align="right" bind:change="bindInput"></van-field> <van-field id="subsidy" value="{{ form.subsidy || '' }}" label="补贴(元)" maxlength="8" type="digit" placeholder="请输入补贴" clearable input-align="right" bind:change="bindInput"></van-field>
<van-field value="{{ amout || '- -' }}" label="结算金额(元)" type="digit" disabled input-align="right"></van-field>
<view class="bg-white" style="padding: 24rpx 32rpx 20rpx 32rpx"> <view class="bg-white" style="padding: 24rpx 32rpx 20rpx 32rpx">
<view class="flex flex-justify" style="padding-bottom: 24rpx"> <view class="flex flex-justify" style="padding-bottom: 24rpx">

Loading…
Cancel
Save