Browse Source

no message

feature/v2.3
xpz2018 4 years ago
parent
commit
9d275830dc
3 changed files with 15 additions and 8 deletions
  1. 2
      pages/index/index.js
  2. 19
      pages/storage/order-settlement/index.js
  3. 2
      pages/storage/order-settlement/index.wxml

2
pages/index/index.js

@ -94,7 +94,7 @@ Scene({
})
event.on('EventMessage', this, this.onEvent)
// this.worker = wx.createWorker('/workers/process.js')
this.data.setInter = setInterval(this.fetchMessage, 10000)
// this.data.setInter = setInterval(this.fetchMessage, 10000)
},
/************************************** 生命周期函数--监听页面初次渲染完成 ********************************************/
onShow: function () {

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

@ -52,9 +52,9 @@ Scene({
if(result.data.outboundDeliveryOrderSettlementInfo.id){
result.data.outboundDeliveryOrderSettlementInfo.netWeight = math.divide(result.data.outboundDeliveryOrderSettlementInfo.netWeight, 1000)
this.data.imageList = []
if(result.data.outboundDeliveryOrderSettlementInfo.weightNoteImageUrlsArr){
for (let index = 0; index < result.data.outboundDeliveryOrderSettlementInfo.weightNoteImageUrlsArr.length; index++) {
const element = result.data.outboundDeliveryOrderSettlementInfo.weightNoteImageUrlsArr[index]
if(result.data.weightNote.weightNoteImageUrlsArr){
for (let index = 0; index < result.data.weightNote.weightNoteImageUrlsArr.length; index++) {
const element = result.data.weightNote.weightNoteImageUrlsArr[index]
if(!util.isEmpty(element)){
this.data.imageList.push({ url: element})
}
@ -76,6 +76,7 @@ Scene({
form: result.data.outboundDeliveryOrderSettlementInfo,
imageList: this.data.imageList
})
this.statAmount()
} else {
this.data.form.id = result.data.outboundDeliveryOrder.id
this.setData({
@ -163,10 +164,16 @@ Scene({
this.statAmount()
},
statAmount: function(){
if(util.isEmpty(this.data.form.receivablePrice)){
var amout = this.data.form.settlePrice
if(util.isEmpty(amout) || Number(amout) <= 0){
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(amout) || Number(amout) <= 0){
return
}
var amout = Number(this.data.form.receivablePrice)
this.data.form.settlePrice = amout
if(!util.isEmpty(this.data.form.freight)){
amout = math.minus(amout, this.data.form.freight)
}
@ -179,7 +186,7 @@ Scene({
if(!util.isEmpty(this.data.form.subsidy)){
amout = math.plus(amout, this.data.form.subsidy)
}
this.setData({ amout })
this.setData({ ['form.settlePrice']: this.data.form.settlePrice, amout })
},
fileChange: function({detail}){
this.data.fileList = detail.fileList

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

@ -26,7 +26,7 @@
<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="otherFee" value="{{ form.otherFee || '' }}" 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="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="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="otherFee" value="{{ form.otherFee || '' }}" label="其他费用(元)" maxlength="8" type="digit" placeholder="请输入其他费用" clearable input-align="right" bind:change="bindInput"></van-field>

Loading…
Cancel
Save