Commit a63f4f2c authored by dragondean@qq.com's avatar dragondean@qq.com

自编号报表汇总

parent b4cb0d66
...@@ -68,7 +68,15 @@ ...@@ -68,7 +68,15 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-card> </el-card>
<el-table v-loading="loading" :data="list" border class="card" :element-loading-text="$t('汇总计算中...')"> <el-table
v-loading="loading"
:data="list"
border
class="card"
:element-loading-text="$t('汇总计算中...')"
show-summary
:summary-method="getSummary"
>
<el-table-column :label="$t('是否结算')" align="center"> <el-table-column :label="$t('是否结算')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :type="DICT_TYPE.SETTLEMENT_STATUS" :value="scope.row.slStatus"></dict-tag> <dict-tag :type="DICT_TYPE.SETTLEMENT_STATUS" :value="scope.row.slStatus"></dict-tag>
...@@ -122,7 +130,7 @@ ...@@ -122,7 +130,7 @@
<el-table-column :label="$t('received in China(中国实收)')" align="center" prop="" > <el-table-column :label="$t('received in China(中国实收)')" align="center" prop="" >
<el-table-column :label="$t('运费') + ColumnCurrencyName('Freight')" prop="summaryInfo.netReceiptsAdvanceFreightFeeGroup"> <el-table-column :label="$t('运费') + ColumnCurrencyName('Freight')" prop="summaryInfo.netReceiptsAdvanceFreightFeeGroup">
<template slot-scope="{row}"> <template slot-scope="{row}">
{{row.summaryInfo.netReceiptsAdvanceFreightFeeCurrency}}{{row.summaryInfo.totalFreightFeeCurrency}} {{row.summaryInfo.netReceiptsAdvanceFreightFee}}{{row.summaryInfo.totalFreightFeeCurrency}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('清关费') + ColumnCurrencyName('Clearance')" prop="summaryInfo.netReceiptsAdvanceClearanceFeeGroup"> <el-table-column :label="$t('清关费') + ColumnCurrencyName('Clearance')" prop="summaryInfo.netReceiptsAdvanceClearanceFeeGroup">
...@@ -175,7 +183,7 @@ import {getWarehouseList} from '@/api/ecw/warehouse' ...@@ -175,7 +183,7 @@ import {getWarehouseList} from '@/api/ecw/warehouse'
import store from "@/store"; import store from "@/store";
import {boxSettlementPage, exportSettlementExcel} from "@/api/ecw/box"; import {boxSettlementPage, exportSettlementExcel} from "@/api/ecw/box";
import {getListTree} from "@/api/ecw/region"; import {getListTree} from "@/api/ecw/region";
import Decimal from 'decimal.js'
export default { export default {
name: 'EcwFinancialSelfnoreport', name: 'EcwFinancialSelfnoreport',
data() { data() {
...@@ -279,6 +287,48 @@ export default { ...@@ -279,6 +287,48 @@ export default {
this.loading = false; this.loading = false;
}) })
}, },
getTotal(field){
let total = new Decimal(0)
this.list.forEach(item => {
total = total.plus(item.summaryInfo[field] || 0)
})
return total.toNumber()
},
// 返回汇总行数据
getSummary(){
const data = [
this.$t('合计'),
'',
// 应收款
this.getTotal('receivableTotalFee'),
// 应收运费
this.getTotal('totalReceivableFreightFee'),
// 应收清关费
this.getTotal('totalReceivableClearanceFee'),
// 应收其他费用
this.getTotal('totalReceivableOtherFee'),
// 目的地实收运费
this.getTotal('totalNetReceiptsCollectFreightFee'),
// 目的地实收清关费
this.getTotal('totalNetReceiptsCollectClearanceFee'),
// 目的地实收其他费用
this.getTotal('totalNetReceiptsCollectOtherFee'),
// 中国实收运费
this.getTotal('netReceiptsAdvanceFreightFee'),
// 中国实收清关费
this.getTotal('netReceiptsAdvanceClearanceFee'),
// 中国实收其他费用
this.getTotal('netReceiptsAdvanceOtherFee'),
// 运费折扣
this.getTotal('discountFreightFee'),
// 清关费折扣
this.getTotal('discountClearanceFee'),
// 其他费用折扣
this.getTotal('discountOtherFee')
]
console.log('sum', {data})
return data
},
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.$refs.queryForm.validate().then(() => { this.$refs.queryForm.validate().then(() => {
......
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