Commit 3a86cc5b authored by 邓春圆's avatar 邓春圆

Merge remote-tracking branch 'origin/release2.2new' into release2.2new

parents 68069da4 bb46ca10
......@@ -183,7 +183,7 @@
<el-descriptions :column="5" border>
<el-descriptions-item :label="$t('保价费')">
{{list.estCostVO?list.estCostVO.insuranceFee: 0}} {{$t('美元')}}
{{list.estCostVO?list.estCostVO.insuranceFee: 0}} {{ selectedRouter ? currentcyMap[selectedRouter.currencyUnit || 1] : '' }}
</el-descriptions-item>
<el-descriptions-item :label="$t('总运费')">
<template v-if="freightFeeList.length>0" v-for="item in freightFeeList">
......@@ -431,6 +431,11 @@
return this.$l(row, 'prodTitle')
}
},
selectedRouter(){
// otherService 1 送货上门,2非控货订单代收货款
if(!this.list.lineId) return null
return this.routerList.find(item => item.id == this.list.lineId)
},
currentcyMap(){
let map = {}
this.currencyList.forEach(item => {
......@@ -491,32 +496,32 @@
originalFeeList(){
let arr = []
this.clearanceFeeList.forEach(item => {
let it = {...item}
let it = {
src: this.$t('清关费'),
currencyId: item.currencyId,
amount: Decimal(item.amount)
}
let freight = this.freightFeeList.find(fee => fee.currencyId == item.currencyId)
if(freight){
it.amount += freight.amount
it.amount = it.amount.plus(freight.amount)
}
arr.push(it)
})
// 判断是否有运费单位不在清关费里的
this.freightFeeList.forEach(item => {
if(!arr.find(items=>items.currencyId==item.currencyId)){
let its = {...item}
// let freights = this.clearanceFeeList.find(fee => fee.currencyId == item.currencyId)
// if(freights){
// its.amount += freights.amount
// }
arr.push(its)
if(!arr.find(arrItem => arrItem.currencyId == item.currencyId)){
arr.push({
src: this.$t('未计算的运费'),
currencyId: item.currencyId,
amount: Decimal(item.amount)
})
}
})
return arr
},
// 预计费用(原价 - 优惠金额)
estimatedCosts(){
let arr = []
let withInsuranceFee = false
let withOtherFee = false
this.originalFeeList.forEach(item => {
let it = {
currencyId: item.currencyId,
......@@ -526,56 +531,38 @@
if(coupon){
it.amount = it.amount.minus(coupon.reduceAmount)
}
// if(this.list.otherFee && this.list.otherFeeCurrencyId == item.currencyId){
// it.amount = it.amount.plus(this.list.otherFee)
// withOtherFee = true
// }
let otherFee = this.otherFeeList.find(fee => fee.currencyId == item.currencyId)
if(otherFee){
it.amount = it.amount.plus(otherFee.amount || 0)
withOtherFee = true
}
// 保价费(美元)
if(item.currencyId == 1 && this.fee && this.fee.insuranceFee){
it.amount = it.amount.plus(this.fee.insuranceFee)
withInsuranceFee = true
}
arr.push(it)
})
// 累加保价费
const insuranceFeeIndex = arr.findIndex(item => item.currencyId == this.insuranceFeeCurrency)
const insuranceFee = this.list&&this.list.estCostVO&&this.list.estCostVO.insuranceFee
if(insuranceFeeIndex > -1){
arr[insuranceFeeIndex].amount = arr[insuranceFeeIndex].amount.plus(insuranceFee || 0)
}else{
arr.push({
currencyId: this.insuranceFeeCurrency,
amount: Decimal(insuranceFee || 0)
})
}
// 如果没有累加其他费用,则另外增加货币
if(!withOtherFee && this.list.otherFee){
let fee = {
currencyId: this.list.otherFeeCurrencyId,
amount: Decimal(this.list.otherFee)
}
// 如果保价费跟其他费用是同一种货币(都是美元)
if(!withInsuranceFee && this.fee && this.fee.insuranceFee && this.list.otherFeeCurrencyId == 1){
fee.amount = fee.amount.plus(this.fee.insuranceFee)
}
arr.push(fee)
}
// 没有累加保价费(没有美元计价)但是有保价费则需要加上去
if(!withInsuranceFee && this.fee && this.fee.insuranceFee){
// 累加其他费用
const otherFeeIndex = arr.findIndex(item => item.currencyId == this.list.otherFeeCurrencyId)
if(otherFeeIndex > -1){
arr[otherFeeIndex].amount = arr[otherFeeIndex].amount.plus(this.list.otherFee || 0)
}else{
if(this.list.otherFee>0){
arr.push({
currencyId: 1,
amount: Decimal(this.fee.insuranceFee)
currencyId: this.list.otherFeeCurrencyId,
amount: Decimal(this.list.otherFee || 0)
})
}
this.otherFeeList.forEach(item => {
if(!arr.find(items=>items.currencyId==item.currencyId)){
let its = {...item}
// let freights = this.clearanceFeeList.find(fee => fee.currencyId == item.currencyId)
// if(freights){
// its.amount += freights.amount
// }
arr.push(its)
}
})
return arr
}
}
}
return arr
},
// 保价费单位(路线里设置,默认美元)
insuranceFeeCurrency() {
return this.selectedRouter?.currencyUnit || 1;
},
},
created() {
getCurrencyList().then(res => this.currencyList = res.data)
......
......@@ -758,10 +758,12 @@ export default {
if(otherFeeIndex > -1){
arr[otherFeeIndex].amount = arr[otherFeeIndex].amount.plus(this.form.otherFee || 0)
}else{
arr.push({
currencyId: this.form.otherFeeCurrencyId,
amount: Decimal(this.form.otherFee || 0)
})
if(this.form.otherFee>0){
arr.push({
currencyId: this.form.otherFeeCurrencyId,
amount: Decimal(this.form.otherFee || 0)
})
}
}
return arr
......
......@@ -186,11 +186,11 @@
<span v-if="scope.row.orderStatus >= 5 ">{{scope.row.volume+"m³/"+scope.row.weight+"kg"}}</span>
<span v-else>{{scope.row.totalVolume+"m³/"+scope.row.totalWeight+"kg"}}</span>
</div>
<el-tooltip v-if="scope.row.orderExceptionType=='order_heavy_cargo_exception'" class="item" effect="dark" :content="(scope.row.wvolume||0)+'m³'" placement="bottom">
<el-tooltip v-else-if="scope.row.orderExceptionType=='order_heavy_cargo_exception'||scope.row.allExceptionType.indexOf('order_heavy_cargo_exception')>-1" class="item" effect="dark" :content="(scope.row.wvolume||0)+'m³'" placement="bottom">
<span style="color:#ff4949" v-if="scope.row.orderStatus >= 5 ">{{scope.row.volume+"m³/"+scope.row.weight+"kg"}}</span>
<span style="color:#ff4949" v-else>{{scope.row.totalVolume+"m³/"+scope.row.totalWeight+"kg"}}</span>
</el-tooltip>
<el-tooltip v-if="scope.row.orderExceptionType=='order_bulky_cargo_exception'" class="item" effect="dark" :content="(scope.row.vweight||0)+'kg'" placement="bottom">
<el-tooltip v-else-if="scope.row.orderExceptionType=='order_bulky_cargo_exception'" class="item" effect="dark" :content="(scope.row.vweight||0)+'kg'" placement="bottom">
<span style="color:#ff4949" v-if="scope.row.orderStatus >= 5 ">{{scope.row.volume+"m³/"+scope.row.weight+"kg"}}</span>
<span style="color:#ff4949" v-else>{{scope.row.totalVolume+"m³/"+scope.row.totalWeight+"kg"}}</span>
</el-tooltip>
......
......@@ -55,10 +55,10 @@
</el-table-column>
<el-table-column :label="$t('操作')">
<template v-slot:default = 'scope'>
<!--<el-button type="text" v-if="scope.row.status !== 0&&scope.row.status !== 1">{{STATUS[scope.row.status]}}</el-button>
<el-button type="text" v-if="scope.row.status == 1" @click="examineFn">{{$t('审核中')}}</el-button>
<el-button type="text" v-if="scope.row.status !== 0&&scope.row.status !== 1">{{STATUS[scope.row.status]}}</el-button>
<!--el-button type="text" v-if="scope.row.status == 1" @click="examineFn">{{$t('审核中')}}</el-button>
<el-button type="text" v-if="scope.row.status === 2" @click="modify(scope.row)">{{$t('修改')}}</el-button>-->
<el-button type="text" :disabled="!!scope.row.status" @click="del(scope.$index)">删除</el-button>
<el-button type="text" v-if="scope.row.status === 0" @click="del(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
......@@ -66,7 +66,7 @@
<work-flow xmlkey="free_apply" v-model="selectedUsers" />
</div>
<div style="text-align: center;margin-top: 20px;">
<el-button type="primary" v-if="!processInstanceId" style="margin-right: 30px;" @click="submit">{{$t('提交')}}</el-button>
<el-button type="primary" v-if="!processInstanceId" style="margin-right: 30px;" :disabled="!feeList.length" @click="submit">{{$t('提交')}}</el-button>
<el-button type="primary" v-if="processInstanceId" style="margin-right: 30px;" @click="goProcessDetail">{{$t('审核中')}}</el-button>
<el-button type="primary" v-if="processInstanceId" style="margin-right: 30px;" @click="cancel">{{$t('取消审核')}}</el-button>
<el-button @click="$emit('update:dialogVisible',false)">{{$t('返回')}}</el-button>
......@@ -117,6 +117,11 @@ export default {
selectedUsers:[]
}
},
computed:{
feeList(){
return this.list.filter(item => item.status === 0)
}
},
created() {
this.getDictDatas(this.DICT_TYPE.AUDIT_STATUS).forEach( e =>{
this.STATUS[e.value] = e.label
......@@ -160,8 +165,15 @@ export default {
})
},
submit(){
// 判断费用申请是否有未填项
const errList = this.feeList.filter(item => {
return !item['feeType'] || !item['applicationFee'] || !item['applicationFeeCurrency'] || !item['payType']
})
if(errList.length){
return this.$message.error('请填写完整费用申请信息')
}
feeApplicationCreateBatch( {
orderFeeApplicationCreateReqVOList: this.list.filter(item => !item.status),
orderFeeApplicationCreateReqVOList: this.feeList,
copyUserId:this.selectedUsers,
orderId: this.orderId
}).then(r=>{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment