调整结算
This commit is contained in:
@@ -228,11 +228,6 @@
|
||||
<div
|
||||
class="settlement-detail-page__detail-panel-body settlement-detail-page__adjust-panel-body"
|
||||
>
|
||||
<div v-if="isPayable" class="settlement-detail-page__adjust-toolbar">
|
||||
<el-button type="primary" :disabled="adjustDialog.loading" @click="addAdjustFee">
|
||||
新增费用
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table v-loading="adjustDialog.loading" :data="adjustRows" border>
|
||||
<el-table-column type="index" label="序号" width="64" align="center" />
|
||||
<el-table-column label="来源" width="110" align="center">
|
||||
@@ -1139,13 +1134,21 @@ export default {
|
||||
return this.searchExpanded ? this.searchFields : this.searchFields.slice(0, 4);
|
||||
},
|
||||
feeDetailColumns() {
|
||||
return [...feeDetailBaseColumns, ...this.dynamicFeeColumns, ...feeDetailTailColumns];
|
||||
const baseColumns = feeDetailBaseColumns.filter(column => column.prop !== 'freightAmount');
|
||||
return [...baseColumns, ...this.dynamicFeeColumns, ...feeDetailTailColumns];
|
||||
},
|
||||
displayTableColumns() {
|
||||
const columns = this.tableColumns.filter(
|
||||
column => this.settlementType !== 'receivable' || column.prop !== 'preSettlementNo'
|
||||
);
|
||||
const totalIndex = columns.findIndex(column => column.prop === 'totalAmountText');
|
||||
const otherFeeColumn = {
|
||||
label: '其他费用',
|
||||
prop: 'tableOtherFeeAmount',
|
||||
feeSummaryType: 'other',
|
||||
minWidth: 130,
|
||||
align: 'right',
|
||||
};
|
||||
const dynamicColumns = this.isPayable
|
||||
? [
|
||||
{
|
||||
@@ -1155,22 +1158,19 @@ export default {
|
||||
minWidth: 130,
|
||||
align: 'right',
|
||||
},
|
||||
{
|
||||
label: '其他费用',
|
||||
prop: 'tableOtherFeeAmount',
|
||||
feeSummaryType: 'other',
|
||||
otherFeeColumn,
|
||||
]
|
||||
: [
|
||||
...this.tableFeeItemNames.map((name, index) => ({
|
||||
label: name,
|
||||
prop: `tableFeeItem${index}`,
|
||||
feeItemName: name,
|
||||
dynamic: true,
|
||||
minWidth: 130,
|
||||
align: 'right',
|
||||
},
|
||||
]
|
||||
: this.tableFeeItemNames.map((name, index) => ({
|
||||
label: name,
|
||||
prop: `tableFeeItem${index}`,
|
||||
feeItemName: name,
|
||||
dynamic: true,
|
||||
minWidth: 130,
|
||||
align: 'right',
|
||||
}));
|
||||
})),
|
||||
otherFeeColumn,
|
||||
];
|
||||
if (totalIndex < 0) return [...columns, ...dynamicColumns];
|
||||
columns.splice(totalIndex, 0, ...dynamicColumns);
|
||||
return columns;
|
||||
@@ -1179,6 +1179,7 @@ export default {
|
||||
return [...generatePreviewColumns, ...this.dynamicFeeColumns, ...feeDetailTailColumns];
|
||||
},
|
||||
adjustFeeColumns() {
|
||||
const baseColumns = feeDetailBaseColumns.filter(column => column.prop !== 'freightAmount');
|
||||
const tailColumns = feeDetailTailColumns.filter(column => column.prop !== 'remark');
|
||||
const afterAmountIndex = tailColumns.findIndex(column => column.prop === 'afterAmountText');
|
||||
tailColumns.splice(afterAmountIndex + 1, 0, {
|
||||
@@ -1186,7 +1187,7 @@ export default {
|
||||
prop: 'changeReason',
|
||||
minWidth: 220,
|
||||
});
|
||||
return [...feeDetailBaseColumns, ...this.adjustDynamicFeeColumns, ...tailColumns];
|
||||
return [...baseColumns, ...this.adjustDynamicFeeColumns, ...tailColumns];
|
||||
},
|
||||
transportCargoTypeOptions() {
|
||||
return this.cargoTypeOptions.filter(item => item.children?.length);
|
||||
@@ -1741,6 +1742,7 @@ export default {
|
||||
freightAmount: Number(item.freightAmount || 0),
|
||||
originalAmount: Number(item.originalAmount || 0),
|
||||
feeItems,
|
||||
changeReason: '',
|
||||
dataSource:
|
||||
item.dataSource || (item.billingFactor === '手工调整' ? '手动录入' : '自动生成'),
|
||||
manualFee:
|
||||
@@ -1758,39 +1760,6 @@ export default {
|
||||
this.adjustDialog.loading = false;
|
||||
}
|
||||
},
|
||||
addAdjustFee() {
|
||||
if (!this.isPayable) return;
|
||||
const feeItems = this.adjustDynamicFeeColumns.reduce((items, column) => {
|
||||
items[column.feeItemName] = 0;
|
||||
return items;
|
||||
}, {});
|
||||
this.adjustRows.push({
|
||||
dataSource: '手动录入',
|
||||
cargoName: '',
|
||||
cargoType: '',
|
||||
cargoTypePath: [],
|
||||
specification: '',
|
||||
model: '',
|
||||
billingFactor: '',
|
||||
billingType: '',
|
||||
transportQuantity: '',
|
||||
priceUnit: '',
|
||||
unitPrice: '',
|
||||
mileage: null,
|
||||
freightAmount: '',
|
||||
originalAmount: 0,
|
||||
originalAmountText: '-',
|
||||
adjustAmount: 0,
|
||||
afterAmount: 0,
|
||||
feeItems,
|
||||
manualFee: true,
|
||||
remark: '',
|
||||
changeReason: '',
|
||||
calculating: false,
|
||||
adjustCalculateTimer: null,
|
||||
adjustCalculateVersion: 0,
|
||||
});
|
||||
},
|
||||
feeSourceLabel(value) {
|
||||
return ['手动录入', '手动添加', '手工录入'].includes(value) ? '手动录入' : '自动生成';
|
||||
},
|
||||
@@ -1908,6 +1877,11 @@ export default {
|
||||
try {
|
||||
await api.adjustFee({
|
||||
detailId: this.adjustDialog.row.id,
|
||||
adjustReason: [
|
||||
...new Set(
|
||||
this.adjustRows.map(row => String(row.changeReason || '').trim()).filter(Boolean)
|
||||
),
|
||||
].join(';'),
|
||||
rows: this.adjustRows.map(row => ({
|
||||
id: row.id,
|
||||
cargoName: String(row.cargoName || '').trim(),
|
||||
@@ -2768,14 +2742,6 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.settlement-detail-page__adjust-toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 12px;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.settlement-detail-page__adjust-control {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user