Commit 68e26117 authored by dragondean@qq.com's avatar dragondean@qq.com

订单费用汇总

parent 43798160
<template> <template>
<el-dialog visible width="1500px" title="NG23022222L费用汇总" :before-close="close"> <el-dialog visible width="1500px" title="NG23022222L费用汇总" :before-close="close">
<el-card> <el-card v-if="orderSummary">
<span slot="header" class="header-title">{{$t('订单收费汇总')}}</span> <span slot="header" class="header-title">{{$t('订单收费汇总')}}</span>
<el-descriptions :column="4"> <el-descriptions :column="4">
<el-descriptions-item :label="$t('应收运费')"></el-descriptions-item> <el-descriptions-item :label="$t('应收运费')">
<el-descriptions-item :label="$t('应收清关费')"></el-descriptions-item> {{orderSummary.receivableFreightFee}}{{currencyMap[orderSummary.seaFreightCurrency]}}
<el-descriptions-item :label="$t('应收额外费用')"></el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('应收总金额')"></el-descriptions-item> <el-descriptions-item :label="$t('应收清关费')">
<el-descriptions-item :label="$t('实收运费')"></el-descriptions-item> {{orderSummary.receivableClearanceFee}}{{currencyMap[orderSummary.clearanceFreightCurrency]}}
<el-descriptions-item :label="$t('实收清关费')"></el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('实收额外费用')"></el-descriptions-item> <el-descriptions-item :label="$t('应收额外费用')">
<el-descriptions-item :label="$t('实收总额')"></el-descriptions-item> {{orderSummary.receivableOtherFee}}{{currencyMap[orderSummary.clearanceOtherCurrency]}}
<el-descriptions-item :label="$t('运费优惠金额')"></el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('清关费优惠金额')"></el-descriptions-item> <el-descriptions-item :label="$t('应收总金额')">
<el-descriptions-item :label="$t('额外费用优惠金额')"></el-descriptions-item> {{orderSummary.receivableTotalAmount}}{{currencyMap[orderSummary.writeOffCurrencyId]}}
<el-descriptions-item :label="$t('订单优惠金额')"></el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('已核销总金额')"></el-descriptions-item> <el-descriptions-item :label="$t('实收运费')">
<el-descriptions-item :label="$t('已核销比例')"></el-descriptions-item> {{orderSummary.netReceiptsFreightFee}}{{currencyMap[orderSummary.seaFreightCurrency]}}
</el-descriptions-item>
<el-descriptions-item :label="$t('实收清关费')">
{{orderSummary.netReceiptsClearanceFee}}{{currencyMap[orderSummary.clearanceFreightCurrency]}}
</el-descriptions-item>
<el-descriptions-item :label="$t('实收额外费用')">
{{orderSummary.netReceiptsOtherFee}}{{currencyMap[orderSummary.clearanceOtherCurrency]}}
</el-descriptions-item>
<el-descriptions-item :label="$t('实收总额')">
{{orderSummary.netReceiptsTotalAmount}}{{currencyMap[orderSummary.writeOffCurrencyId]}}
</el-descriptions-item>
<el-descriptions-item :label="$t('运费优惠金额')">
{{orderSummary.discountFreightTotalPrice}}{{currencyMap[orderSummary.seaFreightCurrency]}}
</el-descriptions-item>
<el-descriptions-item :label="$t('清关费优惠金额')">
{{orderSummary.discountClearanceFee}}{{currencyMap[orderSummary.clearanceFreightCurrency]}}
</el-descriptions-item>
<el-descriptions-item :label="$t('额外费用优惠金额')">
{{orderSummary.discountOtherFee}}{{currencyMap[orderSummary.clearanceOtherCurrency]}}
</el-descriptions-item>
<el-descriptions-item :label="$t('订单优惠金额')">
{{orderSummary.discountTotalAmount}}{{currencyMap[orderSummary.writeOffCurrencyId]}}
</el-descriptions-item>
<el-descriptions-item :label="$t('已核销总金额')">
{{orderSummary.writeOffAmount}}{{currencyMap[orderSummary.writeOffCurrencyId]}}
</el-descriptions-item>
<el-descriptions-item :label="$t('已核销比例')">
{{orderSummary.writeOffRatio}}%
</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
<el-card class="mt-10"> <el-card class="mt-10" v-if="orderSummary">
<span slot="header">{{$t('入仓信息')}}</span> <span slot="header">{{$t('入仓信息')}}</span>
<!--仓库实测,是否重货,原重货标准,原收费数据 <!--仓库实测,是否重货,原重货标准,原收费数据
优惠重货标准,实际收费数据,货值--> 优惠重货标准,实际收费数据,货值-->
<el-descriptions :column="4"> <el-descriptions :column="4">
<el-descriptions-item :label="$t('仓库实测')"></el-descriptions-item> <el-descriptions-item :label="$t('仓库实测')">
<el-descriptions-item :label="$t('是否重货')"></el-descriptions-item> <span>{{orderSummary.sumNum}}{{$t('')}}</span>
<el-descriptions-item :label="$t('原重货标准')"></el-descriptions-item> <span class="ml-5">{{orderSummary.sumVolume}}</span>
<el-descriptions-item :label="$t('原收费数据')"></el-descriptions-item> <span class="ml-5">{{orderSummary.sumWeight}}kg</span>
<el-descriptions-item :label="$t('优惠重货标准')"></el-descriptions-item> <span class="ml-5" v-if="orderSummary.sumQuantity">{{orderSummary.sumQuantity}}{{$t('')}}</span>
<el-descriptions-item :label="$t('实际收费数据')"></el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('货值')"></el-descriptions-item> <el-descriptions-item :label="$t('是否重货')">
<!--1 普货 2 重货 3 泡货-->
<dict-tag :type="DICT_TYPE.ECW_YESNO" :value="orderSummary.itemType != 1 ? '1' : '0'"></dict-tag>
</el-descriptions-item>
<el-descriptions-item :label="$t('原重货标准')" v-if="[1,2].indexOf(orderSummary.transportId) > -1">
{{orderSummary.orgWeightUnit}}KG/m³
</el-descriptions-item>
<el-descriptions-item :label="$t('原泡货标准')" v-else>
{{orderSummary.orgVolumeUnit}}kg/m³
</el-descriptions-item>
<el-descriptions-item :label="$t('原收费数据')">
<span>{{orderSummary.orgChargeNum}}{{$t('')}}</span>
<span class="ml-5">{{orderSummary.orgChargeVolume}}</span>
<span class="ml-5">{{orderSummary.orgChargeWeight}}kg</span>
<span class="ml-5" v-if="orderSummary.orgChargeQuantity">{{orderSummary.orgChargeQuantity}}{{$t('')}}</span>
</el-descriptions-item>
<el-descriptions-item :label="$t('优惠重货标准')" v-if="[1,2].indexOf(orderSummary.transportId) > -1">
{{orderSummary.weightUnit}}KG/m³
</el-descriptions-item>
<el-descriptions-item :label="$t('优惠泡货标准')" v-else>
{{orderSummary.volumeUnit}}kg/m³
</el-descriptions-item>
<el-descriptions-item :label="$t('实际收费数据')">
<span>{{orderSummary.realityChargeNum}}{{$t('')}}</span>
<span class="ml-5">{{orderSummary.realityChargeVolume}}</span>
<span class="ml-5">{{orderSummary.realityChargeWeight}}kg</span>
<span class="ml-5" v-if="orderSummary.realityChargeQuantity">{{orderSummary.realityChargeQuantity}}{{$t('')}}</span>
</el-descriptions-item>
<el-descriptions-item :label="$t('货值')">
{{orderSummary.totalWorth}}{{currencyMap[orderSummary.worthCurrency]}}
</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
<el-card class="mt-10" v-if="orderDetailSummary"> <el-card class="mt-10" v-if="orderDetailSummary">
...@@ -189,7 +247,7 @@ ...@@ -189,7 +247,7 @@
<el-table-column :label="$t('特需类型')"> <el-table-column :label="$t('特需类型')">
<template slot-scope="{row}"> <template slot-scope="{row}">
<!--<dict-tag :type="DICT_TYPE.ORDER_SPECIAL_NEEDS" value="row."></dict-tag>--> <!--<dict-tag :type="DICT_TYPE.ORDER_SPECIAL_NEEDS" value="row."></dict-tag>-->
<dict-tag :type="DICT_TYPE.FEE_TYPE" value="row.feeType"></dict-tag> <dict-tag :type="DICT_TYPE.FEE_TYPE" :value="row.feeType"></dict-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('金额')" prop="realityTotalAmount"> <el-table-column :label="$t('金额')" prop="realityTotalAmount">
...@@ -231,53 +289,125 @@ ...@@ -231,53 +289,125 @@
</el-card> </el-card>
<el-card class="mt-10"> <el-card class="mt-10">
<span slot="header">{{$t('费用申请')}}</span> <span slot="header">{{$t('费用申请')}}</span>
<el-table :data="[]" show-summary :summary-method="getSpecialSummaries"> <el-table :data="feeApplicationList" show-summary :summary-method="getFeeApplicationSummaries">
<el-table-column :label="$t('费用类型')" width="120" prop="type"></el-table-column> <el-table-column :label="$t('费用类型')" prop="feeType">
<el-table-column :label="$t('金额')" width="120" prop="fee"></el-table-column> <template slot-scope="{row}">
<el-table-column :label="$t('付款类型')" width="120" prop="payType"></el-table-column> <dict-tag :type="DICT_TYPE.FEE_TYPE" :value="row.feeType"></dict-tag>
<el-table-column :label="$t('备注')" width="120" prop="remark"></el-table-column> </template>
<el-table-column :label="$t('应收金额')" width="120" prop="shouldFee"></el-table-column> </el-table-column>
<el-table-column :label="$t('收款优惠金额')" width="120" prop="discountFee"></el-table-column> <el-table-column :label="$t('金额')" prop="fee">
<el-table-column :label="$t('实收金额')" width="120" prop="realFee"></el-table-column> <template slot-scope="{row}">
<el-table-column :label="$t('确认收款')" width="120" prop="confirm"></el-table-column> TODO {{currencyMap[row.currencyId]}}
<el-table-column :label="$t('申请人')" width="120" prop="applyUser"></el-table-column> </template>
<el-table-column :label="$t('申请时间')" width="120" prop="applyTime"></el-table-column> </el-table-column>
<el-table-column :label="$t('付款类型')">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_PAY_ADVANCE" :value="row.isPayAdvance"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('备注')" prop="remark"></el-table-column>
<el-table-column :label="$t('应收金额')">
<template slot-scope="{row}">
{{row.receivableTotalAmount}}{{currencyMap[row.currencyId]}}
</template>
</el-table-column>
<el-table-column :label="$t('收款优惠金额')">
<template slot-scope="{row}">
{{row.discountTotal || 0}}{{currencyMap[row.currencyId]}}
</template>
</el-table-column>
<el-table-column :label="$t('实收金额')">
<template slot-scope="{row}">
{{row.realityTotalAmount}}{{currencyMap[row.currencyId]}}
</template>
</el-table-column>
<el-table-column :label="$t('确认收款')">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_RECEIVABLE_STATE" :value="row.state"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('申请人')" prop="author"></el-table-column>
<el-table-column :label="$t('申请时间')">
<template slot-scope="{row}">
{{row.createTime|parseTime}}
</template>
</el-table-column>
</el-table> </el-table>
</el-card> </el-card>
<el-card class="mt-10"> <el-card class="mt-10">
<span slot="header">{{$t('优惠活动')}}</span> <span slot="header">{{$t('优惠活动')}}</span>
<el-table :data="[]"> <el-table :data="[]">
<el-table-column :label="$t('优惠ID')" width="120" prop="id"></el-table-column> <el-table-column :label="$t('优惠ID')" width="100" prop="couponId"></el-table-column>
<el-table-column :label="$t('优惠名称')" width="120" prop="name"></el-table-column> <el-table-column :label="$t('优惠名称')" width="120">
<el-table-column :label="$t('类型')" width="120" prop="type"></el-table-column> <template slot-scope="{row}">{{$l(row, 'title')}}</template>
<el-table-column :label="$t('运费优惠')" width="120" prop="fee"></el-table-column> </el-table-column>
<el-table-column :label="$t('清关费优惠')" width="120" prop="clearFee"></el-table-column> <el-table-column :label="$t('类型')" prop="type">
<template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.ECW_COUPON_TYPE" :value="row.type"></dict-tag>
</template>
</el-table-column>
<el-table-column :label="$t('运费优惠')" prop="fee">
<template slot-scope="{row}">
{{row.freightReduceAmount}}{{currencyMap[row.freightReduceCurrencyId]}}
</template>
</el-table-column>
<el-table-column :label="$t('清关费优惠')" prop="clearFee">
<template slot-scope="{row}">
{{row.clearanceReduceAmount}}{{currencyMap[row.clearanceReduceCurrencyId]}}
</template>
</el-table-column>
</el-table> </el-table>
</el-card> </el-card>
<el-card class="mt-10"> <el-card class="mt-10">
<span slot="header">{{$t('特价折扣')}}</span> <span slot="header">{{$t('特价折扣')}}</span>
<el-table :data="[]"> <el-table :data="[]">
<el-table-column :label="$t('商品类型')" width="120" prop="type"></el-table-column> <el-table-column :label="$t('商品类型')" prop="prodType"></el-table-column>
<el-table-column :label="$t('商品名称')" width="120" prop="name"></el-table-column> <el-table-column :label="$t('商品名称')" prop="prodTitleEn"></el-table-column>
<el-table-column :label="$t('英文名称')" width="120" prop="enName"></el-table-column> <el-table-column :label="$t('英文名称')" prop="prodTitleEn"></el-table-column>
<el-table-column :label="$t('线路')" width="120" prop="line"></el-table-column> <!--<el-table-column :label="$t('线路')" width="120" prop="line">
<el-table-column :label="$t('是否预付')" width="120" prop="isPrepay"></el-table-column>
<el-table-column :label="$t('旧运费')" width="120" prop="oldFee"></el-table-column> </el-table-column>-->
<el-table-column :label="$t('新运费')" width="120" prop="newFee"></el-table-column> <el-table-column :label="$t('是否预付')" width="120" prop="isPrepay">
<el-table-column :label="$t('旧清关费')" width="120" prop="oldClearFee"></el-table-column> <template slot-scope="{row}">
<el-table-column :label="$t('新清关费')" width="120" prop="newClearFee"></el-table-column> <dict-tag :type="DICT_TYPE.ECW_PAY_ADVANCE" :value="row.isPayAdvance"></dict-tag>
<el-table-column :label="$t('申请人')" width="120" prop="applyUser"></el-table-column> </template>
<el-table-column :label="$t('申请时间')" width="120" prop="applyTime"></el-table-column> </el-table-column>
<el-table-column :label="$t('旧运费')">
<template slot-scope="{row}">
{{row.orgFreight}}{{currencyMap[row.freightCurrency]}}
</template>
</el-table-column>
<el-table-column :label="$t('新运费')">
<template slot-scope="{row}">
{{row.freight}}{{currencyMap[row.freightCurrency]}}
</template>
</el-table-column>
<el-table-column :label="$t('旧清关费')">
<template slot-scope="{row}">
{{row.orgClearanceFreight}}{{currencyMap[row.clearanceFreightCurrency]}}
</template>
</el-table-column>
<el-table-column :label="$t('新清关费')">
<template slot-scope="{row}">
{{row.clearanceFreight}}{{currencyMap[row.clearanceFreightCurrency]}}
</template>
</el-table-column>
<el-table-column :label="$t('申请人')">TODO</el-table-column>
<el-table-column :label="$t('申请时间')">
<template slot-scope="{row}">
{{row.createTime|parseTime}}
</template>
</el-table-column>
</el-table> </el-table>
</el-card> </el-card>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import {orderDetailSummary, orderSummary} from "@/api/ecw/order"; import {orderDetailSummary, orderSummary} from "@/api/ecw/order";
import {DICT_TYPE} from "@/utils/dict";
import Price from "@/views/ecw/order/components/price.vue"; import Price from "@/views/ecw/order/components/price.vue";
import {parseTime} from "@/utils/ruoyi"; import {parseTime} from "@/utils/ruoyi";
import Decimal from "decimal.js";
import {createElementVNode} from "@vue/runtime-dom";
export default { export default {
props:{ props:{
orderId: [Number, String], orderId: [Number, String],
...@@ -299,11 +429,17 @@ export default { ...@@ -299,11 +429,17 @@ export default {
} }
}, },
computed:{ computed:{
// 保费
insuranceFeeDto(){ insuranceFeeDto(){
return this.orderDetailSummary?.insuranceFeeDto return this.orderDetailSummary?.insuranceFeeDto
}, },
// 特需
specialNeedFeeList(){ specialNeedFeeList(){
return this.orderDetailSummary?.specialNeedFeeList || [] return this.orderDetailSummary?.specialNeedFeeList || []
},
// 费用申请
feeApplicationList(){
return this.orderDetailSummary?.feeApplicationList || []
} }
}, },
mounted() { mounted() {
...@@ -311,10 +447,45 @@ export default { ...@@ -311,10 +447,45 @@ export default {
this.getOrderDetailSummary() this.getOrderDetailSummary()
}, },
methods:{ methods:{
// 根据不同货币计算总额,返回currencyId: Decimal键值对
calcTotalByCurrency(arr, amountField, currencyField){
let total = {}
arr.forEach(item => {
const currency = item[currencyField]
if(!total[currency]){
total[currency] = new Decimal(0)
}
total[currency] = total[currency].plus(new Decimal(item[amountField] || 0))
})
console.log('currencyField', total)
return Object.keys(total).map(currencyId => {
return `${total[currencyId].toNumber()}${this.currencyMap[currencyId]}`
}).join(";")
},
// 特需汇总
getSpecialSummaries(){ getSpecialSummaries(){
return [ let arr = []
1,2,3,4,5,5,6,7,8,9 arr[3] = this.$t('合计')
] // 应收金额
arr[4] = this.calcTotalByCurrency(this.specialNeedFeeList, 'receivableTotalAmount', 'currencyId')
// 收款优惠金额
arr[5] = this.calcTotalByCurrency(this.specialNeedFeeList, 'discountTotal', 'currencyId')
// 实收金额
arr[6] = this.calcTotalByCurrency(this.specialNeedFeeList, 'realityTotalAmount', 'currencyId')
return arr
},
// 费用申请汇总
getFeeApplicationSummaries(){
if(!this.feeApplicationList) return []
let arr = []
arr[3] = this.$t('合计')
// 应收金额
arr[4] = this.calcTotalByCurrency(this.feeApplicationList, 'receivableTotalAmount', 'currencyId')
// 收款优惠金额
arr[5] = this.calcTotalByCurrency(this.feeApplicationList, 'discountTotal', 'currencyId')
// 实收金额
arr[6] = this.calcTotalByCurrency(this.feeApplicationList, 'realityTotalAmount', 'currencyId')
return arr
}, },
close(){ close(){
this.$emit('close') this.$emit('close')
......
...@@ -253,7 +253,7 @@ ...@@ -253,7 +253,7 @@
<el-button v-hasPermi="['ecw:order:show_customs']" type="text" @click="showDeclaration=true">{{$t('查看报关资料')}}</el-button> <el-button v-hasPermi="['ecw:order:show_customs']" type="text" @click="showDeclaration=true">{{$t('查看报关资料')}}</el-button>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('费用明细')" name="four"> <el-tab-pane :label="$t('费用明细')" name="four">
<el-button type="primary" @click="showFeeDetail=true">{{$t('费用汇总')}}</el-button> <el-button type="primary" @click="showFeeSummary=true">{{$t('费用汇总')}}</el-button>
<el-table :data="feeList"> <el-table :data="feeList">
<el-table-column :label="$t('订单号')" prop="orderNo"> <el-table-column :label="$t('订单号')" prop="orderNo">
<template slot-scope="{row}"> <template slot-scope="{row}">
...@@ -425,10 +425,10 @@ ...@@ -425,10 +425,10 @@
<declaration-documents v-if="showDeclaration" :order-id="order.orderId" :order-no="order.orderNo" @close="showDeclaration=false" /> <declaration-documents v-if="showDeclaration" :order-id="order.orderId" :order-no="order.orderNo" @close="showDeclaration=false" />
<!--费用汇总--> <!--费用汇总-->
<fee-detail <fee-detail
v-if="showFeeDetail" v-if="showFeeSummary"
:order-id="order.orderId" :order-id="order.orderId"
:currency-map="currencyMap" :currency-map="currencyMap"
@close="showFeeDetail=false" /> @close="showFeeSummary=false" />
</div> </div>
</template> </template>
...@@ -503,7 +503,7 @@ export default { ...@@ -503,7 +503,7 @@ export default {
consigneeText:this.$t('更多'), consigneeText:this.$t('更多'),
showLogDetailId: null, // 显示日志详情的ID, showLogDetailId: null, // 显示日志详情的ID,
showDeclaration:false, //显示报关资料 showDeclaration:false, //显示报关资料
showFeeDetail: false, // 是否显示费用汇总 showFeeSummary: false, // 是否显示费用汇总
} }
}, },
computed:{ computed:{
...@@ -559,14 +559,6 @@ export default { ...@@ -559,14 +559,6 @@ export default {
}) })
this.region = region this.region = region
}) })
},
showFeeDetail(){
if(!this.orderSummary){
this.getOrderSummary()
}
if(!this.orderDetailSummary){
this.getOrderDetailSummary()
}
} }
}, },
created() { created() {
......
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