|
|
|
@ -10,16 +10,22 @@ Component({ |
|
|
|
* 组件的属性列表 |
|
|
|
*/ |
|
|
|
properties: { |
|
|
|
orderInfo: { type: Object, value: null }, |
|
|
|
item: { type: Object, value: null } |
|
|
|
orderInfo: { |
|
|
|
type: Object, |
|
|
|
value: null |
|
|
|
}, |
|
|
|
item: { |
|
|
|
type: Object, |
|
|
|
value: null |
|
|
|
} |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 组件的初始数据 |
|
|
|
*/ |
|
|
|
data: { |
|
|
|
isShowtotalOtherAmount:true, |
|
|
|
firstMoneyStringTip:'', |
|
|
|
secondMoneyStringTip:'' |
|
|
|
isShowtotalOtherAmount: true, |
|
|
|
firstMoneyStringTip: '', |
|
|
|
secondMoneyStringTip: '' |
|
|
|
|
|
|
|
}, |
|
|
|
//组件的生命周期
|
|
|
|
@ -27,47 +33,59 @@ Component({ |
|
|
|
created: function () { |
|
|
|
// 在组件实例刚刚被创建时执行
|
|
|
|
}, |
|
|
|
attached: function() { |
|
|
|
attached: function () { |
|
|
|
// 在组件实例进入页面节点树时执行
|
|
|
|
console.log(this.data.item) |
|
|
|
console.log(this.data.item) |
|
|
|
this.data.item.otherAmountDtoList.forEach(element => { |
|
|
|
if(element.amount!=null){ |
|
|
|
if (element.amount != null) { |
|
|
|
this.setData({ |
|
|
|
isShowtotalOtherAmount:false |
|
|
|
isShowtotalOtherAmount: false |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
//首笔货款金额tiptip提示
|
|
|
|
var firstFkbl=(this.data.item.activitySettleType==0?'(×首付70%)':(this.data.item.activitySettleType==1?'(×首付85%)':'(×首付100%)')) |
|
|
|
var firstLeft='预估总金额'+firstFkbl+'-代码费总额' |
|
|
|
var firstFkbl = (this.data.item.activitySettleType == 0 ? '(×首付70%)' : (this.data.item.activitySettleType == 1 ? '(×首付85%)' : '(×首付100%)')) |
|
|
|
var firstLeft = '预估总金额' + firstFkbl + '-代码费总额' |
|
|
|
|
|
|
|
var rightFkbl=(this.data.item.activitySettleType==0?'70%':(this.data.item.activitySettleType==1?'85%':'100%')) |
|
|
|
var rightJsdj=(math.times(this.data.item.unitPrice, 1000)+'元/吨') |
|
|
|
var rightJsjz=(math.divide(this.data.item.weightnoteInfo.netWeight, 1000)+'吨') |
|
|
|
var rightDmf=this.data.item.unitSurcharge>0?('-'+math.times(this.data.item.unitSurcharge, 1000)+'元/吨'):(this.data.item.unitSurcharge<0?math.times(this.data.item.unitSurcharge, 1000)+'元/吨':'') |
|
|
|
var rightJz=math.times(this.data.item.unitSurcharge, 1000)+'吨' |
|
|
|
var rightFkbl = (this.data.item.activitySettleType == 0 ? '70%' : (this.data.item.activitySettleType == 1 ? '85%' : '100%')) |
|
|
|
var rightJsdj = (math.times(this.data.item.unitPrice, 1000) + '元/吨') |
|
|
|
var rightJsjz = (math.divide(this.data.item.weightnoteInfo.netWeight, 1000) + '吨') |
|
|
|
var rightDmf = this.data.item.unitSurcharge > 0 ? ('-' + math.times(this.data.item.unitSurcharge, 1000) + '元/吨') : (this.data.item.unitSurcharge < 0 ? math.times(this.data.item.unitSurcharge, 1000) + '元/吨' : '') |
|
|
|
var rightJz = math.times(this.data.item.unitSurcharge, 1000) + '吨' |
|
|
|
this.setData({ |
|
|
|
firstMoneyStringTip:firstLeft+'='+rightJsdj+'×'+rightJsjz+'×'+rightFkbl+rightDmf+'×'+rightJz |
|
|
|
firstMoneyStringTip: firstLeft + '=' + rightJsdj + '×' + rightJsjz + '×' + rightFkbl + rightDmf + '×' + rightJz |
|
|
|
}) |
|
|
|
//尾款金额toptip提示
|
|
|
|
if(this.data.item.activityOrderAuditPassNum!=null&&this.data.item.activityOrderAuditPassNum >= 2){ |
|
|
|
var secondLeft='结算单价x结算重量-首笔货款金额+'+(this.data.isShowtotalOtherAmount==false?'isShowtotalOtherAmount':'')+'+返还补贴+调节费' |
|
|
|
var secondJsdj=(math.times(this.data.item.unitPrice, 1000)+'元/吨') |
|
|
|
var secondJszl=(math.divide(this.data.item.weightnoteInfo.settleWeight, 1000)+'吨') |
|
|
|
var secondJsjz=(math.divide(this.data.item.weightnoteInfo.netWeight, 1000)+'吨') |
|
|
|
var secondSbhkje=this.data.item.preSettleMoney+'' |
|
|
|
var secondzcbtykk=this.data.isShowtotalOtherAmount==true?'':(this.data.item.totalOtherAmount>0?'+'+this.data.item.totalOtherAmount:''+this.data.item.totalOtherAmount) |
|
|
|
var secondbtdj=(math.times(this.data.item.unitRefundSubsidy, 1000)+'元/吨') |
|
|
|
var secondfhbt=this.data.itemrefundSubsidy==0?'':(this.data.itemrefundSubsidy>0?'+'+this.data.itemrefundSubsidy:this.data.itemrefundSubsidy) |
|
|
|
this.setData({ |
|
|
|
secondMoneyStringTip:secondLeft+'='+secondJsdj+'×'+secondJszl+'-'+this.data.item.preSettleMoney+secondzcbtykk+'+'+secondbtdj+'×'+secondJsjz+secondfhbt |
|
|
|
}) |
|
|
|
var secondLeft = '结算单价x结算重量-首笔货款金额' + firstFkbl + '+' + (this.data.isShowtotalOtherAmount == false ? 'isShowtotalOtherAmount' : '') + '+返还补贴+调节费' |
|
|
|
if (this.data.item.unitPrice) { |
|
|
|
var secondJsdj = (math.times(this.data.item.unitPrice, 1000) + '元/吨') |
|
|
|
}else{ |
|
|
|
var secondJsdj='' |
|
|
|
} |
|
|
|
if (this.data.item.weightnoteInfo.settleWeight) { |
|
|
|
var secondJszl = (math.divide(this.data.item.weightnoteInfo.settleWeight, 1000) + '吨') |
|
|
|
}else{ |
|
|
|
var secondJszl='' |
|
|
|
} |
|
|
|
if (this.data.item.weightnoteInfo.netWeight) { |
|
|
|
var secondJsjz = (math.divide(this.data.item.weightnoteInfo.netWeight, 1000) + '吨') |
|
|
|
}else{ |
|
|
|
var secondJsjz='' |
|
|
|
} |
|
|
|
|
|
|
|
var secondSbhkje = this.data.item.preSettleMoney + '' |
|
|
|
var secondzcbtykk = this.data.isShowtotalOtherAmount == true ? '' : (this.data.item.totalOtherAmount > 0 ? '+' + this.data.item.totalOtherAmount : '' + this.data.item.totalOtherAmount) |
|
|
|
var secondbtdj = (math.times(this.data.item.unitRefundSubsidy, 1000) + '元/吨') |
|
|
|
var secondfhbt = this.data.itemrefundSubsidy == 0 ? '' : (this.data.itemrefundSubsidy > 0 ? '+' + this.data.itemrefundSubsidy : this.data.itemrefundSubsidy) |
|
|
|
this.setData({ |
|
|
|
secondMoneyStringTip: secondLeft + '=' + secondJsdj + '×' + secondJszl + '-' + secondSbhkje + rightFkbl + '+' + secondzcbtykk + '+' + secondbtdj + '×' + secondJsjz + secondfhbt |
|
|
|
}) |
|
|
|
|
|
|
|
console.log(this.data.firstMoneyStringTip) |
|
|
|
console.log(this.data.secondMoneyStringTip) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
detached: function() { |
|
|
|
detached: function () { |
|
|
|
// 在组件实例被从页面节点树移除时执行
|
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -89,4 +107,4 @@ Component({ |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |