✨ 结算明细的单据号、运单号支持跳转应收应付明细与运单详情
This commit is contained in:
@@ -259,7 +259,14 @@
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<span v-if="column.money">{{ formatMoney(row[column.prop]) }}</span>
|
||||
<el-link
|
||||
v-if="column.link && row[column.prop] && !publicMode"
|
||||
type="primary"
|
||||
@click.stop="handleDetailLink(row, column)"
|
||||
>
|
||||
{{ row[column.prop] }}
|
||||
</el-link>
|
||||
<span v-else-if="column.money">{{ formatMoney(row[column.prop]) }}</span>
|
||||
<span v-else-if="column.prop === 'transportQuantity'">
|
||||
{{ formatDetailTransportQuantity(row[column.prop]) }}
|
||||
</span>
|
||||
@@ -993,6 +1000,11 @@ import {
|
||||
getDetailFees as getPreSettlementDetailFees,
|
||||
} from '@/api/settlement/preSettlement';
|
||||
import { calculateAdjustedFee, getFeeDetail } from '@/api/settlement/receivable-payable-detail';
|
||||
import {
|
||||
resolveReceivablePayableDetailId,
|
||||
resolveWaybillId,
|
||||
settlementDetailPath,
|
||||
} from '@/utils/settlement-detail-link';
|
||||
import { getBfiExchangeRate } from '@/api/base/currency';
|
||||
import {
|
||||
createFormalSettlementForm,
|
||||
@@ -2049,6 +2061,21 @@ export default {
|
||||
this.appliedDetailQuery = { ...this.detailQuery };
|
||||
this.detailPage.current = 1;
|
||||
},
|
||||
// 结算明细的「单据号」跳到该应收应付单据在应收明细/应付明细页的详情,「运单号」跳到运单详情
|
||||
async handleDetailLink(row, column) {
|
||||
if (column.prop === 'documentNo') {
|
||||
const settlementType = row.settlementType || this.form.settlementType || 'payable';
|
||||
const detailId = await resolveReceivablePayableDetailId(row, settlementType);
|
||||
if (!detailId) return this.$message.info('当前记录未找到对应的应收/应付明细');
|
||||
this.$router.push({ path: settlementDetailPath(settlementType), query: { detailId } });
|
||||
return;
|
||||
}
|
||||
if (column.prop === 'waybillNo') {
|
||||
const waybillId = await resolveWaybillId(row);
|
||||
if (!waybillId) return this.$message.info('当前记录未找到对应的运单详情');
|
||||
this.$router.push({ path: '/business/waybill-manage/detail', query: { id: waybillId } });
|
||||
}
|
||||
},
|
||||
resetDetailQuery(apply = true) {
|
||||
this.detailQuery = { documentNo: '', waybillNo: '', batchNo: '', cargoName: '' };
|
||||
if (apply) this.handleDetailQuery();
|
||||
|
||||
@@ -257,9 +257,9 @@
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-link
|
||||
v-if="column.link && row[column.prop]"
|
||||
v-if="column.link && row[column.prop] && !publicMode"
|
||||
type="primary"
|
||||
@click="openAdjustDialog(row, true)"
|
||||
@click.stop="handleDetailLink(row, column)"
|
||||
>
|
||||
{{ row[column.prop] }}
|
||||
</el-link>
|
||||
@@ -958,6 +958,11 @@ import {
|
||||
submit,
|
||||
} from '@/api/settlement/preSettlement';
|
||||
import { calculateAdjustedFee, getFeeDetail } from '@/api/settlement/receivable-payable-detail';
|
||||
import {
|
||||
resolveReceivablePayableDetailId,
|
||||
resolveWaybillId,
|
||||
settlementDetailPath,
|
||||
} from '@/utils/settlement-detail-link';
|
||||
import { getBfiExchangeRate } from '@/api/base/currency';
|
||||
import { getDictionary } from '@/api/system/dictbiz';
|
||||
import {
|
||||
@@ -2032,6 +2037,21 @@ export default {
|
||||
this.appliedDetailQuery = { ...this.detailQuery };
|
||||
this.detailPage.current = 1;
|
||||
},
|
||||
// 结算明细的「单据号」跳到该应收应付单据在应收明细/应付明细页的详情,「运单号」跳到运单详情
|
||||
async handleDetailLink(row, column) {
|
||||
if (column.prop === 'documentNo') {
|
||||
const settlementType = row.settlementType || this.form.settlementType || 'payable';
|
||||
const detailId = await resolveReceivablePayableDetailId(row, settlementType);
|
||||
if (!detailId) return this.$message.info('当前记录未找到对应的应收/应付明细');
|
||||
this.$router.push({ path: settlementDetailPath(settlementType), query: { detailId } });
|
||||
return;
|
||||
}
|
||||
if (column.prop === 'waybillNo') {
|
||||
const waybillId = await resolveWaybillId(row);
|
||||
if (!waybillId) return this.$message.info('当前记录未找到对应的运单详情');
|
||||
this.$router.push({ path: '/business/waybill-manage/detail', query: { id: waybillId } });
|
||||
}
|
||||
},
|
||||
resetDetailQuery() {
|
||||
this.detailQuery = {
|
||||
documentNo: '',
|
||||
|
||||
@@ -1719,11 +1719,12 @@ export default {
|
||||
this.$router.push({ path, query: { detailNo } });
|
||||
},
|
||||
async openRouteDetail(detailId = this.$route.query.detailId) {
|
||||
if (
|
||||
!detailId ||
|
||||
this.settlementType !== 'payable' ||
|
||||
this.$route.path !== '/settlement/payable-detail'
|
||||
) {
|
||||
// 结算明细点「单据号」会带 detailId 跳到本页;只有当前停在应收/应付明细页时才自动展开详情
|
||||
const routePath =
|
||||
this.settlementType === 'payable'
|
||||
? '/settlement/payable-detail'
|
||||
: '/settlement/receivable-detail';
|
||||
if (!detailId || this.$route.path !== routePath) {
|
||||
return;
|
||||
}
|
||||
let row = this.rows.find(item => String(item.id) === String(detailId));
|
||||
@@ -1736,7 +1737,9 @@ export default {
|
||||
if (data.records?.[0]) row = this.decorateRow(data.records[0]);
|
||||
}
|
||||
if (!row) {
|
||||
this.$message.info('当前记录未找到对应的应付明细');
|
||||
this.$message.info(
|
||||
`当前记录未找到对应的${this.settlementType === 'payable' ? '应付' : '应收'}明细`
|
||||
);
|
||||
return;
|
||||
}
|
||||
await this.openDetailDialog(row);
|
||||
|
||||
Reference in New Issue
Block a user