This commit is contained in:
linfso 2025-02-25 07:54:07 +08:00
parent e657094723
commit 5b2cb96ec1
3 changed files with 49 additions and 7 deletions

View File

@ -75,6 +75,7 @@
<el-radio label="2">重量计算</el-radio> <el-radio label="2">重量计算</el-radio>
<el-radio label="3">体积计算</el-radio> <el-radio label="3">体积计算</el-radio>
<el-radio label="4">包裹数</el-radio> <el-radio label="4">包裹数</el-radio>
<el-radio label="5">按柜计算</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>

View File

@ -67,7 +67,7 @@
slot-scope="slotProps" slot-scope="slotProps"
:height="(slotProps.contentHeight)+'px'" :height="(slotProps.contentHeight)+'px'"
storageName="emisTmsCostFeeList_main3" storageName="emisTmsCostFeeList_main5"
v-loading="loading" v-loading="loading"
border stripe border stripe
@ -162,7 +162,9 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('账期')" align="center" prop="billMonth" min-width="100" /> <el-table-column :label="$t('账期')" align="center" prop="billMonth" min-width="100" />
<el-table-column :label="$t('成本时间')" align="center" prop="tradeDate" min-width="170" /> <el-table-column :label="$t('成本时间')" align="center" prop="tradeDate" min-width="170" />
<el-table-column :label="$t('总费用')" align="center" prop="costFee" min-width="100" /> <el-table-column :label="$t('费用(CNY)')" align="center" prop="costFee" min-width="110" />
<el-table-column :label="$t('费用(USD)')" align="center" prop="usdCostFee" min-width="110" />
<el-table-column :label="$t('总票数')" align="center" prop="sendPieceSum" min-width="100" /> <el-table-column :label="$t('总票数')" align="center" prop="sendPieceSum" min-width="100" />
<!-- <el-table-column :label="$t('总件数')" align="center" prop="pieceNumber" min-width="100" /> --> <!-- <el-table-column :label="$t('总件数')" align="center" prop="pieceNumber" min-width="100" /> -->
<!-- <el-table-column :label="$t('运单总重')" align="center" prop="totalWeight" min-width="100" /> --> <!-- <el-table-column :label="$t('运单总重')" align="center" prop="totalWeight" min-width="100" /> -->
@ -386,6 +388,22 @@ export default {
}, 0); }, 0);
sums[index] = sums[index].toFixed(2); //保留0位小数 sums[index] = sums[index].toFixed(2); //保留0位小数
} }
if (
column.property === 'usdCostFee'
) {
const values = data.map(item => Number(item.usdCostFee));
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] = sums[index].toFixed(2); //保留0位小数
}
else if ( else if (
column.property === 'sendPieceSum' column.property === 'sendPieceSum'

View File

@ -42,6 +42,11 @@
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="费用列表" prop="feeType"> <el-form-item label="费用列表" prop="feeType">
<!-- max-height="200px" -->
<!-- :header-cell-style="{
'font-size':'12px'
}" -->
<!-- style="width: 100%" -->
<el-table <el-table
class="cargoList" class="cargoList"
:cell-style="{ :cell-style="{
@ -50,16 +55,17 @@
'padding-right': '0px!important', 'padding-right': '0px!important',
'font-size':'12px' 'font-size':'12px'
}" }"
:header-cell-style="{ :header-cell-style="{
'font-size':'12px' 'font-size':'12px'
}" }"
border border
stripe stripe
:data="form.feeItemList" :data="form.feeItemList"
size="mini" size="mini"
max-height="200px"
style="width: 100%"
show-summary show-summary
:summary-method="getSummaries" :summary-method="getSummaries"
> >
@ -643,8 +649,9 @@ export default {
if ( if (
column.property === 'fee' column.property === 'fee'
) { ) {
const values = data.map(item => Number(item.fee)); // CNY FEE
sums[index] = values.reduce((prev, curr) => { const cnyValues = data.map(item => Number(item.currency=='CNY'?item.fee:0));
let cnyFee = cnyValues.reduce((prev, curr) => {
const value = Number(curr); const value = Number(curr);
if (!isNaN(value)) { if (!isNaN(value)) {
return prev + curr; return prev + curr;
@ -652,9 +659,25 @@ export default {
return prev; return prev;
} }
}, 0); }, 0);
// USD FEE
const usdValues = data.map(item => Number(item.currency=='USD'?item.fee:0));
let usdFee = usdValues.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] = 'CNY:' + cnyFee.toFixed(2) + ' USD:'+usdFee.toFixed(2);
// sums[index] = sums[index].toFixed(2); //保留0位小数 // sums[index] = sums[index].toFixed(2); //保留0位小数
let costFee=sums[index].toFixed(2); let costFee=cnyFee.toFixed(2);
let usdCostFee=usdFee.toFixed(2);
this.form.costFee=costFee; this.form.costFee=costFee;
this.form.usdCostFee=usdCostFee;
} }
}); });