|
|
@@ -371,21 +371,38 @@ export default {
|
|
|
changeTransType(num){
|
|
|
let that = this
|
|
|
this.form.transType = num
|
|
|
+ this.form.sendCost = 0
|
|
|
if(this.getDictionariesInfo.transCost && !this.$util.isEmpty(this.getDictionariesInfo.transCost)){
|
|
|
let weight = this.allCountFun.weight ? Number(this.allCountFun.weight) : 0
|
|
|
+ let totalNum = this.allCountFun.bigLength ? Number(this.allCountFun.bigLength) : 0
|
|
|
for (const ele of this.getDictionariesInfo.transCost) {
|
|
|
if(ele.sign == num){
|
|
|
if(num == 2){
|
|
|
+ //冷链物流
|
|
|
let llOption = ele.option ? ele.option : ''
|
|
|
if(!this.$util.isEmpty(llOption)){
|
|
|
- for (const llEle of llOption) {
|
|
|
- if(Number(llEle.num)>=weight){
|
|
|
- this.form.sendCost = llEle.amount?llEle.amount:0
|
|
|
+
|
|
|
+ let long = llOption.length
|
|
|
+ let bigInfo = llOption[long-1]
|
|
|
+ let bigNum = bigInfo.num
|
|
|
+ let bigAmount = bigInfo.amount
|
|
|
+ let bs = parseInt(totalNum/bigNum)
|
|
|
+ if(bs > 0){
|
|
|
+ this.form.sendCost = this.form.sendCost + (bs*bigAmount)
|
|
|
+ this.form.sendCost = parseFloat(this.form.sendCost.toFixed(2))
|
|
|
+ totalNum = totalNum - (bs*bigNum)
|
|
|
+ totalNum = parseFloat(totalNum.toFixed(2))
|
|
|
+ }
|
|
|
+ for (const ele of llOption){
|
|
|
+ if(Number(ele.num) >= Number(totalNum)){
|
|
|
+ this.form.sendCost = Number(this.form.sendCost)+Number(ele.amount)
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}else{
|
|
|
+ //其它物流
|
|
|
let perKiloCost = ele.perKiloCost?Number(ele.perKiloCost):0
|
|
|
let sendCost = weight*perKiloCost
|
|
|
sendCost = parseFloat(sendCost.toFixed(2))
|