|
|
|
@ -51,12 +51,12 @@ Scene({ |
|
|
|
} |
|
|
|
if(result.data.outboundDeliveryOrderSettlementInfo.id){ |
|
|
|
result.data.outboundDeliveryOrderSettlementInfo.netWeight = math.divide(result.data.outboundDeliveryOrderSettlementInfo.netWeight, 1000) |
|
|
|
this.data.imageList = [] |
|
|
|
if(result.data.weightNote.weightNoteImageUrlsArr){ |
|
|
|
for (let index = 0; index < result.data.weightNote.weightNoteImageUrlsArr.length; index++) { |
|
|
|
const element = result.data.weightNote.weightNoteImageUrlsArr[index] |
|
|
|
this.data.fileList = [] |
|
|
|
if(result.data.outboundDeliveryOrderSettlementInfo.weightNoteImageUrlsArr){ |
|
|
|
for (let index = 0; index < result.data.outboundDeliveryOrderSettlementInfo.weightNoteImageUrlsArr.length; index++) { |
|
|
|
const element = result.data.outboundDeliveryOrderSettlementInfo.weightNoteImageUrlsArr[index] |
|
|
|
if(!util.isEmpty(element)){ |
|
|
|
this.data.imageList.push({ url: element}) |
|
|
|
this.data.fileList.push({ url: element}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -74,7 +74,7 @@ Scene({ |
|
|
|
poundInfo: result.data.weightNote, |
|
|
|
orderInfo: result.data.outboundDeliveryOrder, |
|
|
|
form: result.data.outboundDeliveryOrderSettlementInfo, |
|
|
|
imageList: this.data.imageList |
|
|
|
fileList: this.data.fileList |
|
|
|
}) |
|
|
|
this.statAmount() |
|
|
|
} else { |
|
|
|
@ -141,6 +141,7 @@ Scene({ |
|
|
|
this.data.form.deductWeight = 0 |
|
|
|
this.setData({ ['form.settleWeight']: e.detail }) |
|
|
|
} |
|
|
|
this.statPrice() |
|
|
|
} else if(e.target.id == 'deductPercent'){ |
|
|
|
if(!util.isEmpty(this.data.form.netWeight) && Number(this.data.form.netWeight) > 0){ |
|
|
|
if(Number(this.data.form.deductPercent) < 100){ |
|
|
|
@ -152,6 +153,7 @@ Scene({ |
|
|
|
this.setData({ ['form.settleWeight']: '' }) |
|
|
|
} |
|
|
|
} |
|
|
|
this.statPrice() |
|
|
|
} else if(e.target.id == 'settleWeight'){ |
|
|
|
if(!util.isEmpty(this.data.form.netWeight) && Number(this.data.form.netWeight) > 0){ |
|
|
|
if(Number(this.data.form.netWeight) > Number(this.data.form.settleWeight)){ |
|
|
|
@ -165,20 +167,22 @@ Scene({ |
|
|
|
} else { |
|
|
|
this.setData({ ['form.netWeight']: e.detail }) |
|
|
|
} |
|
|
|
this.statPrice() |
|
|
|
} else if(e.target.id == 'settleUnitPrice'){ |
|
|
|
this.statPrice() |
|
|
|
} |
|
|
|
this.statAmount() |
|
|
|
}, |
|
|
|
statPrice: function(){ |
|
|
|
if(!util.isEmpty(this.data.form.settleUnitPrice) && !util.isEmpty(this.data.form.settleWeight)){ |
|
|
|
this.data.form.settlePrice = math.times(this.data.form.settleUnitPrice, this.data.form.settleWeight) |
|
|
|
} |
|
|
|
}, |
|
|
|
statAmount: function(){ |
|
|
|
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 |
|
|
|
} |
|
|
|
this.data.form.settlePrice = amout |
|
|
|
if(!util.isEmpty(this.data.form.freight)){ |
|
|
|
amout = math.minus(amout, this.data.form.freight) |
|
|
|
} |
|
|
|
|