Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a4b9af694 | ||
|
|
4b31f7ee78 | ||
|
|
0764bf3a42 | ||
|
|
921ca3cd7a | ||
|
|
799220642b | ||
|
|
44cec23147 | ||
|
|
b218fc2345 | ||
|
|
eb74466c30 | ||
|
|
79e903bcd8 | ||
|
|
119d71b4f5 | ||
|
|
d57d3f86da |
@@ -34,6 +34,15 @@ export const syncKingdeeBatch = ids =>
|
||||
// 回写任务按 paymentNo 分批远程查询 A103-2/A103-4,同样可能超过全局超时
|
||||
export const syncKingdeeResult = () =>
|
||||
request({ url: `${baseUrl}/sync-kingdee-result`, method: 'post', timeout: APPROVE_TIMEOUT });
|
||||
// 付款记录付款凭证下载(后端代理 A801-2 流式回源),耗时较普通接口长,放宽到 120s
|
||||
export const downloadRecordVoucher = recordId =>
|
||||
request({
|
||||
url: `${baseUrl}/record/download-voucher`,
|
||||
method: 'get',
|
||||
params: { recordId },
|
||||
responseType: 'blob',
|
||||
timeout: 120000,
|
||||
});
|
||||
|
||||
export const paymentTypeOptions = [
|
||||
{ label: '项目预付', value: 'project_advance' },
|
||||
|
||||
@@ -91,14 +91,3 @@ export const recognizeBaiduOcr = (imageUrl, type, side = '') => {
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
export const recognizeQualificationCertificateOcr = imageUrl => {
|
||||
return request({
|
||||
url: '/blade-transport/baidu-ocr/qualification-certificate',
|
||||
method: 'post',
|
||||
timeout: 60000,
|
||||
params: {
|
||||
imageUrl,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
<template>
|
||||
<div class="invoice-write-off-table">
|
||||
<el-table v-loading="loading" :data="rows" border>
|
||||
<el-table-column type="index" label="序号" width="64" fixed="left" align="center" />
|
||||
<el-table-column prop="arrivalAddress" label="到货地址" min-width="150" align="center" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.manualFlag === 1 ? '—' : displayValue(row.arrivalAddress) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="actualDepartureTime" label="实际发货时间" width="150" align="center">
|
||||
<template #default="{ row }">{{ row.manualFlag === 1 ? '—' : formatDateTime(row.actualDepartureTime) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="completionTime" label="实际完成时间" width="150" align="center">
|
||||
<template #default="{ row }">{{ row.manualFlag === 1 ? '—' : formatDateTime(row.completionTime) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="transportType" label="运输类型" width="100" align="center">
|
||||
<template #default="{ row }">{{ row.manualFlag === 1 ? '—' : displayValue(row.transportType) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="cargoName" label="货物名称" min-width="110" align="center" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.manualFlag === 1 ? '—' : displayValue(row.cargoName) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="cargoType" label="货物类型" min-width="110" align="center" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.manualFlag === 1 ? '—' : displayValue(row.cargoType) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="transportQuantity" label="运输总量" width="110" align="center">
|
||||
<template #default="{ row }">{{ row.manualFlag === 1 ? '—' : displayValue(row.transportQuantity) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="mileage" label="里程 (KM)" width="100" align="center">
|
||||
<template #default="{ row }">{{ row.manualFlag === 1 ? '—' : displayValue(row.mileage) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="batchNo" label="批次号" width="100" align="center" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.manualFlag === 1 ? '—' : displayValue(row.batchNo) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="invoiceNo" label="发票号" min-width="160" align="center" show-overflow-tooltip />
|
||||
<!-- 按费用项目动态分组列头,每组三列:结算金额/未开票费用/本次开票金额 -->
|
||||
<el-table-column v-for="group in feeItemGroups" :key="group.name" :label="group.name" align="center">
|
||||
<el-table-column :label="'结算金额'" width="110" align="center">
|
||||
<template #default="{ row }">{{ formatMoney(row.settlementAmounts[group.name]) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="'未开票费用'" width="110" align="center">
|
||||
<template #default="{ row }">{{ formatMoney(row.beforeRemainAmounts[group.name]) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="'本次开票金额'" width="120" align="center">
|
||||
<template #default="{ row }">{{ formatMoney(row.writeOffAmounts[group.name]) }}</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div v-if="!loading && !rows.length" class="invoice-write-off-table__empty">暂无冲销明细</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/axios';
|
||||
|
||||
/**
|
||||
* 发票冲销明细公共表格(开票申请/收票登记/付款申请通用)
|
||||
* 数据源:/blade-transport/invoice-write-off/list?bizType=&bizId=
|
||||
* 行按运单完成时间升序(先完成的运单先冲销),手动添加费用无运输信息显示"—"
|
||||
*/
|
||||
export default {
|
||||
name: 'InvoiceWriteOffTable',
|
||||
props: {
|
||||
// invoice_apply-开票申请 receipt-收票登记 payment_receipt-付款申请生成的收票单
|
||||
bizType: { type: String, required: true },
|
||||
bizId: { type: [String, Number], default: null },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
rows: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
feeItemGroups() {
|
||||
const names = [];
|
||||
this.rows.forEach(row => {
|
||||
if (row.feeItemName && !names.includes(row.feeItemName)) names.push(row.feeItemName);
|
||||
});
|
||||
return names.map(name => ({ name }));
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
bizId: {
|
||||
immediate: true,
|
||||
handler(value) {
|
||||
if (value) this.load();
|
||||
},
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
load() {
|
||||
this.loading = true;
|
||||
request({
|
||||
url: '/blade-transport/invoice-write-off/list',
|
||||
method: 'get',
|
||||
params: { bizType: this.bizType, bizId: this.bizId },
|
||||
})
|
||||
.then(res => {
|
||||
const list = res.data.data || [];
|
||||
// 同一运单同一费用项目可能被多张发票分段冲抵(跨发票拆分),按运单+费用项目归并展示
|
||||
const merged = new Map();
|
||||
list.forEach(row => {
|
||||
const key = `${row.waybillId || row.summaryFeeId || ''}|${row.feeItemName}`;
|
||||
if (!merged.has(key)) {
|
||||
merged.set(key, {
|
||||
...row,
|
||||
settlementAmounts: { [row.feeItemName]: row.settlementAmount },
|
||||
beforeRemainAmounts: { [row.feeItemName]: row.beforeRemainAmount },
|
||||
writeOffAmounts: { [row.feeItemName]: row.writeOffAmount },
|
||||
});
|
||||
return;
|
||||
}
|
||||
const target = merged.get(key);
|
||||
target.writeOffAmounts[row.feeItemName] = Number(target.writeOffAmounts[row.feeItemName] || 0) + Number(row.writeOffAmount || 0);
|
||||
// 未开票费用取首段冲抵前余额,发票号追加展示
|
||||
if (!String(target.invoiceNo).includes(row.invoiceNo)) {
|
||||
target.invoiceNo = `${target.invoiceNo},${row.invoiceNo}`;
|
||||
}
|
||||
});
|
||||
this.rows = [...merged.values()];
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
displayValue(value) {
|
||||
return value === null || value === undefined || value === '' ? '-' : value;
|
||||
},
|
||||
formatDateTime(value) {
|
||||
if (!value) return '-';
|
||||
return this.$dayjs(value).format('YYYY-MM-DD HH:mm:ss');
|
||||
},
|
||||
formatMoney(value) {
|
||||
return Number(value || 0).toFixed(2);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.invoice-write-off-table__empty {
|
||||
padding: 24px 0;
|
||||
text-align: center;
|
||||
color: #909399;
|
||||
font-size: 13px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<el-dialog v-model="visible" :title="title" width="92%" append-to-body destroy-on-close @open="handleOpen">
|
||||
<el-form :model="query" inline label-width="130px" @submit.prevent>
|
||||
<el-dialog v-model="visible" :title="title" width="92%" append-to-body align-center destroy-on-close @open="handleOpen">
|
||||
<el-form class="kingdee-pool-dialog__form" :model="query" inline label-position="right" label-width="120px" @submit.prevent>
|
||||
<el-form-item label="发票号码">
|
||||
<el-input v-model="query.invoiceNo" clearable @keyup.enter="handleQuery" />
|
||||
<el-input v-model="query.invoiceNo" clearable placeholder="请输入" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开票日期">
|
||||
<el-date-picker
|
||||
@@ -10,15 +10,16 @@
|
||||
type="daterange"
|
||||
value-format="YYYY-MM-DD"
|
||||
format="YYYY-MM-DD"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
range-separator="-"
|
||||
start-placeholder="请选择"
|
||||
end-placeholder="请选择"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="开票单位">
|
||||
<el-input v-model="query.salerName" clearable @keyup.enter="handleQuery" />
|
||||
<el-input v-model="query.salerName" clearable placeholder="请输入" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="受票单位">
|
||||
<el-input v-model="query.buyerName" clearable @keyup.enter="handleQuery" />
|
||||
<el-input v-model="query.buyerName" clearable placeholder="请输入" @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开票单位(销方)">
|
||||
<el-select
|
||||
@@ -93,6 +94,9 @@
|
||||
<el-form-item>
|
||||
<el-button :disabled="loading" @click="resetQuery">重置</el-button>
|
||||
<el-button type="primary" :disabled="loading" @click="handleQuery">查询</el-button>
|
||||
<el-tooltip content="按名称检索范围为已同步票,未找到请改用发票号码或税号精确查找" placement="top">
|
||||
<el-icon class="kingdee-pool-dialog__query-tip"><QuestionFilled /></el-icon>
|
||||
</el-tooltip>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
@@ -101,7 +105,7 @@
|
||||
:data="rows"
|
||||
:row-key="rowKey"
|
||||
border
|
||||
height="520"
|
||||
max-height="50vh"
|
||||
:highlight-current-row="!multiple"
|
||||
@selection-change="selection => (selected = selection)"
|
||||
@row-dblclick="handleRowDblclick"
|
||||
@@ -118,6 +122,7 @@
|
||||
</el-radio>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column type="index" label="序号" width="70" align="center" :index="indexMethod" />
|
||||
<el-table-column prop="invoiceNo" label="发票号码" min-width="180" />
|
||||
<el-table-column prop="invoiceDate" label="开票日期" min-width="120" />
|
||||
<el-table-column prop="invoiceType" label="发票类型" min-width="140" />
|
||||
@@ -172,8 +177,8 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="kingdee-pool-dialog__pager">
|
||||
<span class="kingdee-pool-dialog__pager-tip">按名称检索范围为已同步票,未找到请改用发票号码或税号精确查找</span>
|
||||
<div class="kingdee-pool-dialog__pagination">
|
||||
<span class="kingdee-pool-dialog__pagination-tip">按名称检索范围为已同步票,未找到请改用发票号码或税号精确查找</span>
|
||||
<el-pagination
|
||||
v-model:current-page="page.current"
|
||||
v-model:page-size="page.size"
|
||||
@@ -323,6 +328,9 @@ export default {
|
||||
this.page.current = 1;
|
||||
this.load();
|
||||
},
|
||||
indexMethod(index) {
|
||||
return (this.page.current - 1) * this.page.size + index + 1;
|
||||
},
|
||||
resetQuery() {
|
||||
this.query = this.emptyQuery();
|
||||
this.handleQuery();
|
||||
@@ -420,15 +428,28 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.kingdee-pool-dialog__pager {
|
||||
.kingdee-pool-dialog__form {
|
||||
margin-bottom: 16px;
|
||||
padding: 12px 12px 4px;
|
||||
background: #fff;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
.kingdee-pool-dialog__pagination {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 12px;
|
||||
padding: 16px 0;
|
||||
gap: 16px;
|
||||
}
|
||||
.kingdee-pool-dialog__pager-tip {
|
||||
.kingdee-pool-dialog__pagination-tip {
|
||||
color: #909399;
|
||||
font-size: 12px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.kingdee-pool-dialog__query-tip {
|
||||
margin-left: 8px;
|
||||
color: #909399;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -253,18 +253,16 @@ export const option = createCrudOption([
|
||||
label: '客商',
|
||||
prop: 'partyName',
|
||||
search: true,
|
||||
searchOrder: 14,
|
||||
searchPlaceholder: '请输入甲/乙方名称',
|
||||
searchOrder: 11,
|
||||
searchPlaceholder: '请输入',
|
||||
hide: true,
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
},
|
||||
{
|
||||
label: '合同编号',
|
||||
prop: 'contractNo',
|
||||
search: true,
|
||||
searchOrder: 8,
|
||||
searchOrder: 6,
|
||||
searchPlaceholder: '请输入',
|
||||
order: 185,
|
||||
maxlength: 100,
|
||||
@@ -289,7 +287,7 @@ export const option = createCrudOption([
|
||||
label: '所属项目',
|
||||
prop: 'projectName',
|
||||
search: true,
|
||||
searchOrder: 11,
|
||||
searchOrder: 8,
|
||||
searchType: 'select',
|
||||
searchPlaceholder: '请选择',
|
||||
formslot: true,
|
||||
@@ -336,7 +334,7 @@ export const option = createCrudOption([
|
||||
prop: 'contractCategory',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 12,
|
||||
searchOrder: 9,
|
||||
searchPlaceholder: '请选择',
|
||||
order: 170,
|
||||
dicData: contractCategoryOptions,
|
||||
@@ -348,7 +346,7 @@ export const option = createCrudOption([
|
||||
prop: 'signType',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 13,
|
||||
searchOrder: 10,
|
||||
searchPlaceholder: '请选择',
|
||||
span: 8,
|
||||
order: 190,
|
||||
@@ -361,7 +359,7 @@ export const option = createCrudOption([
|
||||
prop: 'effectiveType',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 6,
|
||||
searchOrder: 5,
|
||||
searchPlaceholder: '请选择',
|
||||
dicData: effectiveTypeOptions,
|
||||
hide: true,
|
||||
@@ -632,7 +630,7 @@ export const option = createCrudOption([
|
||||
prop: 'hcsSyncStatus',
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchOrder: 7,
|
||||
searchOrder: 6,
|
||||
searchPlaceholder: '请选择',
|
||||
slot: true,
|
||||
dicData: hcsSyncStatusOptions,
|
||||
@@ -662,7 +660,7 @@ export const option = createCrudOption([
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchPlaceholder: '请选择',
|
||||
searchOrder: 9,
|
||||
searchOrder: 7,
|
||||
dicData: yesNoOptions,
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
@@ -674,7 +672,7 @@ export const option = createCrudOption([
|
||||
type: 'select',
|
||||
search: true,
|
||||
searchPlaceholder: '请选择',
|
||||
searchOrder: 10,
|
||||
searchOrder: 8,
|
||||
dicData: yesNoOptions,
|
||||
hide: true,
|
||||
addDisplay: false,
|
||||
|
||||
@@ -124,8 +124,7 @@ const formatGoodsInfo = row => {
|
||||
const text = Object.entries(groups)
|
||||
.map(([unit, group]) => {
|
||||
const quantity = formatGoodsQuantity(group.quantity);
|
||||
const typeName = group.count > 1 ? `${group.typeName}等${group.count}种货物` : group.typeName;
|
||||
return `${typeName} | ${quantity}${unit ? ` ${unit}` : ''}`;
|
||||
return `${group.typeName}等${group.count}种货物 | ${quantity}${unit ? ` ${unit}` : ''}`;
|
||||
})
|
||||
.join('; ');
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ export const invoiceApplicationTableColumns = [
|
||||
{ prop: 'issuerName', label: '开票方', minWidth: 150 },
|
||||
{ prop: 'receiverName', label: '受票方', minWidth: 150 },
|
||||
{ prop: 'invoiceAmount', label: '开票金额', minWidth: 130, money: true },
|
||||
{ prop: 'estimatedCost', label: '暂估成本', minWidth: 130, money: true },
|
||||
{ prop: 'createUserName', label: '创建人', minWidth: 110 },
|
||||
{ prop: 'createTime', label: '创建时间', minWidth: 170 },
|
||||
{ prop: 'approvalStatusName', label: '状态', minWidth: 110, status: true },
|
||||
|
||||
@@ -12,7 +12,7 @@ export const invoiceReceiptTableColumns = [
|
||||
{ prop: 'createUserName', label: '创建人', minWidth: 110 },
|
||||
{ prop: 'createTime', label: '创建时间', minWidth: 170 },
|
||||
{ prop: 'kingdeeReceivedInvoiceNo', label: '金蝶单据号', minWidth: 150 },
|
||||
{ prop: 'kingdeePushStatusName', label: '金蝶状态', minWidth: 130 },
|
||||
{ prop: 'kingdeePushStatusName', label: '金蝶状态', minWidth: 130, kingdeeStatus: true },
|
||||
{ prop: 'kingdeePushMsg', label: '失败原因', minWidth: 160 },
|
||||
{ prop: 'attachmentSyncStatusName', label: '附件同步', minWidth: 100 },
|
||||
];
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
* ⚠️ column 数组顺序 = 表格列顺序,搜索专用列统一放在数组最前面。
|
||||
*/
|
||||
|
||||
import { formatSealTypes } from '@/utils/settlement-seal';
|
||||
import {
|
||||
approvalStatusOptions,
|
||||
invoiceStatusOptions,
|
||||
@@ -25,8 +24,6 @@ import { formalSettlementTableColumns } from './formalSettlementTable';
|
||||
const textFormatter = (row, value) =>
|
||||
value === null || value === undefined || value === '' ? '-' : value;
|
||||
|
||||
const sealTypesFormatter = (row, value) => formatSealTypes(value) || '-';
|
||||
|
||||
/** 金额统一展示:两位小数 + 币种 */
|
||||
const moneyFormatter = (row, value) =>
|
||||
`${Number(value || 0).toFixed(2)} ${row?.currency || 'RMB'}`;
|
||||
@@ -75,7 +72,6 @@ const COLUMN_EXTRA = {
|
||||
projectName: { search: true, searchSpan: 5, searchOrder: 11, searchPlaceholder: '请输入' },
|
||||
deptName: { search: true, searchslot: true, searchSpan: 5, searchOrder: 10 },
|
||||
contractNo: { search: true, searchSpan: 5, searchOrder: 9, searchPlaceholder: '请输入' },
|
||||
sealTypes: { formatter: sealTypesFormatter },
|
||||
invoiceStatusName: { slot: true },
|
||||
paymentStatusName: { slot: true },
|
||||
approvalStatusName: { slot: true },
|
||||
|
||||
@@ -10,12 +10,6 @@ export const formalSettlementFormFields = [
|
||||
{ label: '结算金额', prop: 'settlementAmount', readonly: true, money: true },
|
||||
{ label: '业务模式', prop: 'businessModel', type: 'select', optionsKey: 'businessModelOptions' },
|
||||
{ label: '运输方式', prop: 'transportType', type: 'select', optionsKey: 'transportTypeOptions' },
|
||||
{
|
||||
label: '用印类型',
|
||||
prop: 'sealTypes',
|
||||
type: 'multi-select',
|
||||
optionsKey: 'sealTypeOptions',
|
||||
},
|
||||
{ label: '汇率日期', prop: 'exchangeRateDate', type: 'date', required: true },
|
||||
{ label: '结算汇率', prop: 'exchangeRate', type: 'number', required: true },
|
||||
{ label: '本位币合计', prop: 'localSettlementAmount', readonly: true, money: true },
|
||||
@@ -35,7 +29,6 @@ export const createFormalSettlementForm = () => ({
|
||||
sourceDetailIds: [],
|
||||
businessModel: '',
|
||||
transportType: '',
|
||||
sealTypes: [],
|
||||
exchangeRateDate: '',
|
||||
exchangeRate: 1,
|
||||
createUserName: '',
|
||||
|
||||
@@ -10,7 +10,6 @@ export const formalSettlementTableColumns = [
|
||||
{ label: '原币结算金额', prop: 'settlementAmount', minWidth: 145, money: true },
|
||||
{ label: '业务模式', prop: 'businessModelName', minWidth: 120 },
|
||||
{ label: '运输方式', prop: 'transportTypeName', minWidth: 120 },
|
||||
{ label: '用印类型', prop: 'sealTypes', minWidth: 120 },
|
||||
{ label: '本位币结算金额', prop: 'localSettlementAmount', minWidth: 155, money: true },
|
||||
{ label: '结算汇率', prop: 'exchangeRate', minWidth: 110 },
|
||||
{ label: '申请付款金额(含预付)', prop: 'appliedPaymentAmount', minWidth: 185, money: true },
|
||||
|
||||
@@ -26,12 +26,6 @@ export const preSettlementFormFields = [
|
||||
{ label: '结算金额', prop: 'settlementAmount', readonly: true, money: true },
|
||||
{ label: '业务模式', prop: 'businessModel', type: 'select', optionsKey: 'businessModelOptions' },
|
||||
{ label: '运输方式', prop: 'transportType', type: 'select', optionsKey: 'transportTypeOptions' },
|
||||
{
|
||||
label: '用印类型',
|
||||
prop: 'sealTypes',
|
||||
type: 'multi-select',
|
||||
optionsKey: 'sealTypeOptions',
|
||||
},
|
||||
{ label: '汇率日期', prop: 'exchangeRateDate', type: 'date' },
|
||||
{ label: '结算汇率', prop: 'exchangeRate', type: 'number', class: 'exchange-rate-input' },
|
||||
{ label: '本位币合计', prop: 'localSettlementAmount', readonly: true, money: true },
|
||||
@@ -88,7 +82,6 @@ export const emptyPreSettlementForm = () => ({
|
||||
settlementAmount: 0,
|
||||
businessModel: '',
|
||||
transportType: '',
|
||||
sealTypes: [],
|
||||
localCurrency: 'RMB',
|
||||
localSettlementAmount: 0,
|
||||
exchangeRateDate: '',
|
||||
|
||||
@@ -10,7 +10,6 @@ export const preSettlementTableColumns = [
|
||||
{ label: '原币结算金额', prop: 'settlementAmount', minWidth: 140, money: true, precision: 2 },
|
||||
{ label: '业务模式', prop: 'businessModelName', minWidth: 120 },
|
||||
{ label: '运输方式', prop: 'transportTypeName', minWidth: 120 },
|
||||
{ label: '用印类型', prop: 'sealTypes', minWidth: 120 },
|
||||
{ label: '本位币结算金额', prop: 'localSettlementAmount', minWidth: 150, money: true, precision: 2 },
|
||||
{ label: '结算汇率', prop: 'exchangeRate', minWidth: 110, precision: 2 },
|
||||
{
|
||||
|
||||
@@ -492,35 +492,17 @@ export const treeOption = {
|
||||
nodeKey: 'id',
|
||||
lazy: true,
|
||||
treeLoad: function (node, resolve) {
|
||||
const toTreeNode = item => ({
|
||||
const parentId = node.level === 0 ? 0 : node.data.id;
|
||||
getDeptLazyTree(parentId).then(res => {
|
||||
resolve(
|
||||
res.data.data.map(item => {
|
||||
return {
|
||||
...item,
|
||||
leaf: !item.hasChildren,
|
||||
});
|
||||
// 用户管理组织树从第二级开始展示:根层隐藏一级组织,直接展示其子节点
|
||||
if (node.level === 0) {
|
||||
getDeptLazyTree(0)
|
||||
.then(res => {
|
||||
const roots = res.data.data || [];
|
||||
if (!roots.length) {
|
||||
resolve([]);
|
||||
return;
|
||||
}
|
||||
return Promise.all(roots.map(root => getDeptLazyTree(root.id))).then(childResults => {
|
||||
const secondLevel = [];
|
||||
childResults.forEach(childRes => {
|
||||
(childRes.data.data || []).forEach(item => secondLevel.push(toTreeNode(item)));
|
||||
});
|
||||
resolve(secondLevel);
|
||||
});
|
||||
};
|
||||
})
|
||||
.catch(() => resolve([]));
|
||||
return;
|
||||
}
|
||||
getDeptLazyTree(node.data.id)
|
||||
.then(res => {
|
||||
resolve((res.data.data || []).map(toTreeNode));
|
||||
})
|
||||
.catch(() => resolve([]));
|
||||
);
|
||||
});
|
||||
},
|
||||
addBtn: false,
|
||||
menu: false,
|
||||
|
||||
@@ -77,6 +77,19 @@ export default [
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
// 发票冲销明细独立页(不挂菜单,供开票申请/收票登记/付款申请页面跳转引用)
|
||||
path: '/payment/invoice-write-off',
|
||||
component: Layout,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: '发票冲销明细',
|
||||
meta: { keepAlive: false, activeMenu: '/payment/invoice-application' },
|
||||
component: loadView(() => import('@/views/payment/invoice-write-off.vue')),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/payment/payment-application/form',
|
||||
component: Layout,
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
/**
|
||||
* 业务部门下拉规范化。
|
||||
* rawLabel 保留原始部门名供落库;展示名优先追加所属公司,缺省时用上级组织。
|
||||
*
|
||||
* @param {Array} list 业务部门原始列表
|
||||
* @param {{ alwaysShowCompany?: boolean }} [options]
|
||||
* alwaysShowCompany=true 时始终展示「部门(公司)」;默认仅同名时追加
|
||||
*/
|
||||
export function normalizeBusinessDeptOptions(list, options = {}) {
|
||||
const alwaysShowCompany = !!options.alwaysShowCompany;
|
||||
const source = Array.isArray(list) ? list : [];
|
||||
const nameCount = {};
|
||||
source.forEach(item => {
|
||||
const name = String(item?.deptName || item?.fullName || '').trim();
|
||||
if (!name) return;
|
||||
nameCount[name] = (nameCount[name] || 0) + 1;
|
||||
});
|
||||
return source
|
||||
.map(item => {
|
||||
const id = item?.id == null || item?.id === '' ? '' : String(item.id);
|
||||
if (!id) return null;
|
||||
const rawLabel = item.deptName || item.fullName || id;
|
||||
const companyName = String(item.belongCompanyName || item.parentName || '').trim();
|
||||
const label =
|
||||
companyName && (alwaysShowCompany || nameCount[rawLabel] > 1)
|
||||
? `${rawLabel}(${companyName})`
|
||||
: rawLabel;
|
||||
return {
|
||||
id,
|
||||
value: id,
|
||||
label,
|
||||
rawLabel,
|
||||
parentName: String(item.parentName || '').trim(),
|
||||
belongCompanyName: String(item.belongCompanyName || '').trim(),
|
||||
kingdeeDeptCode: item.kingdeeDeptCode || '',
|
||||
};
|
||||
})
|
||||
.filter(Boolean);
|
||||
}
|
||||
@@ -21,16 +21,17 @@ export const isKingdeePathAttachment = attachment => {
|
||||
};
|
||||
|
||||
/**
|
||||
* 请求金蝶文件流:成功返回 Blob;业务失败为 HTTP 200 + R.fail JSON(响应通道未写流时后端即失败),
|
||||
* 按 Content-Type 识别并抛出带 msg 的错误;网络级失败拦截器已提示,标记 silent 避免重复提示。
|
||||
* 请求金蝶文件流(公共核):成功返回 Blob;业务失败为 HTTP 200 + R.fail JSON
|
||||
* (响应通道未写流时后端即失败),按 Content-Type 识别并抛出带 msg 的错误;
|
||||
* 网络级失败拦截器已提示,标记 silent 避免重复提示。
|
||||
* 供查看(弹窗内预览)/下载两类入口复用
|
||||
* @param {String} invoiceNo 发票号码
|
||||
* @param {Function} fetcher 文件流请求函数(返回 axios blob 响应)
|
||||
* @returns {Promise<Blob>}
|
||||
*/
|
||||
export const requestKingdeeFile = async invoiceNo => {
|
||||
const fetchKingdeeBlob = async fetcher => {
|
||||
let res;
|
||||
try {
|
||||
res = await downloadInvoicePoolAttachment(invoiceNo);
|
||||
res = await fetcher();
|
||||
} catch (error) {
|
||||
throw Object.assign(new Error(error?.message || '附件下载失败'), { silent: true });
|
||||
}
|
||||
@@ -51,6 +52,45 @@ export const requestKingdeeFile = async invoiceNo => {
|
||||
return blob;
|
||||
};
|
||||
|
||||
/**
|
||||
* 请求金蝶文件流:票池发票按发票号回源(后端代理 A801-2)
|
||||
* @param {String} invoiceNo 发票号码
|
||||
* @returns {Promise<Blob>}
|
||||
*/
|
||||
export const requestKingdeeFile = invoiceNo => fetchKingdeeBlob(() => downloadInvoicePoolAttachment(invoiceNo));
|
||||
|
||||
/**
|
||||
* 下载金蝶侧附件(经 A801-2 后端代理,公共入口),失败统一 ElMessage 提示
|
||||
* @param {Function} fetcher 文件流请求函数
|
||||
* @param {String} fileName 下载文件名
|
||||
*/
|
||||
export const downloadKingdeeFile = async (fetcher, fileName) => {
|
||||
try {
|
||||
const blob = await fetchKingdeeBlob(fetcher);
|
||||
downloadFile(blob, fileName);
|
||||
} catch (error) {
|
||||
if (!error?.silent) ElMessage.error(error?.message || '金蝶附件下载失败');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 新窗口预览金蝶侧附件(经 A801-2 后端代理,公共入口):拉取 Blob 转 objectURL
|
||||
* (PDF 可预览;OFD 等浏览器不可预览的格式由浏览器触发下载)
|
||||
* @param {Function} fetcher 文件流请求函数
|
||||
* @param {String} fileName 预览文件名
|
||||
*/
|
||||
export const viewKingdeeFile = async (fetcher, fileName) => {
|
||||
try {
|
||||
const blob = await fetchKingdeeBlob(fetcher);
|
||||
const url = URL.createObjectURL(blob);
|
||||
window.open(url, '_blank');
|
||||
// 延迟释放 objectURL:立即回收可能导致新窗口尚未加载完成即失效
|
||||
setTimeout(() => URL.revokeObjectURL(url), 60000);
|
||||
} catch (error) {
|
||||
if (!error?.silent) ElMessage.error(error?.message || '金蝶附件预览失败');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 下载金蝶侧发票附件(经 A801-2 后端代理),失败统一 ElMessage 提示
|
||||
* @param {String} invoiceNo 发票号码
|
||||
@@ -61,12 +101,7 @@ export const downloadKingdeeInvoiceFile = async (invoiceNo, fileName) => {
|
||||
ElMessage.warning('当前发票缺少发票号码,无法下载金蝶侧附件');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const blob = await requestKingdeeFile(invoiceNo);
|
||||
downloadFile(blob, fileName || `${invoiceNo}.pdf`);
|
||||
} catch (error) {
|
||||
if (!error?.silent) ElMessage.error(error?.message || '金蝶附件下载失败');
|
||||
}
|
||||
await downloadKingdeeFile(() => downloadInvoicePoolAttachment(invoiceNo), fileName || `${invoiceNo}.pdf`);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -79,13 +114,5 @@ export const viewKingdeeInvoiceFile = async (invoiceNo, fileName) => {
|
||||
ElMessage.warning('当前发票缺少发票号码,无法预览金蝶侧附件');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const blob = await requestKingdeeFile(invoiceNo);
|
||||
const url = URL.createObjectURL(blob);
|
||||
window.open(url, '_blank');
|
||||
// 延迟释放 objectURL:立即回收可能导致新窗口尚未加载完成即失效
|
||||
setTimeout(() => URL.revokeObjectURL(url), 60000);
|
||||
} catch (error) {
|
||||
if (!error?.silent) ElMessage.error(error?.message || '金蝶附件预览失败');
|
||||
}
|
||||
await viewKingdeeFile(() => downloadInvoicePoolAttachment(invoiceNo), fileName || `${invoiceNo}.pdf`);
|
||||
};
|
||||
|
||||
@@ -14,6 +14,17 @@ export const KINGDEE_STATUS_TAG_TYPES = {
|
||||
/** 金蝶单据状态 → el-tag 颜色类型,未映射状态返回 info */
|
||||
export const kingdeeStatusType = status => KINGDEE_STATUS_TAG_TYPES[status] || 'info';
|
||||
|
||||
/** 收票登记推送状态 → el-tag 颜色类型(已指定应付=绿、已保存收票单=黄、推送失败=红、未推送=灰) */
|
||||
export const KINGDEE_PUSH_STATUS_TAG_TYPES = {
|
||||
unsynced: 'info',
|
||||
pushed: 'warning',
|
||||
assigned: 'success',
|
||||
failed: 'danger',
|
||||
};
|
||||
|
||||
/** 收票登记推送状态 → el-tag 颜色类型,未映射状态返回 info */
|
||||
export const kingdeePushStatusType = status => KINGDEE_PUSH_STATUS_TAG_TYPES[status] || 'info';
|
||||
|
||||
/** 金蝶冲销状态 → el-tag 颜色类型(已冲销=绿、未冲销=黄) */
|
||||
export const KINGDEE_WRITEOFF_TAG_TYPES = {
|
||||
writtenoff: 'success',
|
||||
|
||||
@@ -154,7 +154,7 @@ export function isMkApprovedStatus(bizType, approvalStatus) {
|
||||
* @param {string} [options.subjectName] 标题后缀
|
||||
* @param {string} [options.approvalStatus] 提交前的审批状态
|
||||
* @param {boolean} [options.mkEnabled] 调用方已知开关时传入,false 时立即跳过
|
||||
* @param {Object} [options.tempVarData] 传给 MK 的临时变量(如项目类型 projectType、用印类型 sealTypes)
|
||||
* @param {Object} [options.tempVarData] 传给 MK 的临时变量(如项目类型 projectType)
|
||||
* @returns {Promise<boolean>} true=已发起/复用 MK 流程,false=未开启或已跳过
|
||||
*/
|
||||
export async function submitMkApprovalFlow({
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
/** 结算单用印类型固定选项(展示顺序固定) */
|
||||
export const SETTLEMENT_SEAL_TYPE_OPTIONS = [
|
||||
{ dictKey: '公章', dictValue: '公章' },
|
||||
{ dictKey: '业务章', dictValue: '业务章' },
|
||||
];
|
||||
|
||||
const SEAL_TYPE_ORDER = SETTLEMENT_SEAL_TYPE_OPTIONS.map(item => item.dictKey);
|
||||
|
||||
/**
|
||||
* 解析用印类型为数组(兼容顿号、逗号分隔)
|
||||
*/
|
||||
export const parseSealTypes = value => {
|
||||
if (Array.isArray(value)) {
|
||||
return value.map(item => String(item || '').trim()).filter(Boolean);
|
||||
}
|
||||
if (value === undefined || value === null || value === '') {
|
||||
return [];
|
||||
}
|
||||
return String(value)
|
||||
.split(/[、,,\s]+/)
|
||||
.map(item => item.trim())
|
||||
.filter(Boolean);
|
||||
};
|
||||
|
||||
/**
|
||||
* 用印类型按固定顺序顿号拼接,供保存与列表展示
|
||||
*/
|
||||
export const formatSealTypes = value => {
|
||||
const selected = new Set(parseSealTypes(value));
|
||||
return SEAL_TYPE_ORDER.filter(item => selected.has(item)).join('、');
|
||||
};
|
||||
@@ -6,7 +6,6 @@
|
||||
:data="data"
|
||||
ref="crud"
|
||||
v-model="form"
|
||||
v-model:page="page"
|
||||
:permission="permissionList"
|
||||
:before-open="beforeOpen"
|
||||
@row-del="rowDel"
|
||||
@@ -102,7 +101,7 @@
|
||||
style="margin-bottom: 12px; background: #f5f7fa; padding: 6px 10px; border-radius: 4px"
|
||||
>
|
||||
<span style="color: #606266; font-size: 13px"
|
||||
>仅展示菜单权限已勾选的菜单,已配置的数据权限会保留。勾选多个菜单后点击「设置」可批量配置</span
|
||||
>勾选多个菜单后点击「设置」,可批量配置数据权限;设置后菜单旁展示当前范围</span
|
||||
>
|
||||
<el-button type="primary" size="small" @click="openDataScopeSetting">设置</el-button>
|
||||
</el-row>
|
||||
@@ -730,9 +729,7 @@ export default {
|
||||
onLoad(page, params = {}) {
|
||||
this.loading = true;
|
||||
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
|
||||
const data = res.data.data || {};
|
||||
this.data = data.records || [];
|
||||
this.page.total = data.total || 0;
|
||||
this.data = res.data.data;
|
||||
this.loading = false;
|
||||
this.selectionClear();
|
||||
});
|
||||
|
||||
+295
-82
@@ -8,9 +8,6 @@
|
||||
:data="data"
|
||||
:table-loading="loading"
|
||||
:permission="permissionList"
|
||||
:before-open="beforeOpen"
|
||||
@row-save="rowSave"
|
||||
@row-update="rowUpdate"
|
||||
@row-del="rowDel"
|
||||
@search-change="searchChange"
|
||||
@search-reset="searchReset"
|
||||
@@ -20,11 +17,21 @@
|
||||
@refresh-change="refreshChange"
|
||||
@on-load="onLoad"
|
||||
>
|
||||
<template #menu-left>
|
||||
<el-button
|
||||
v-if="permission.invoice_item_add"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="openDialog()"
|
||||
>
|
||||
新增
|
||||
</el-button>
|
||||
</template>
|
||||
<template #menu="scope">
|
||||
<el-link
|
||||
v-if="permission.invoice_item_edit"
|
||||
type="primary"
|
||||
@click="$refs.crud.rowEdit(scope.row, scope.index)"
|
||||
@click="openDialog(scope.row)"
|
||||
>
|
||||
修改
|
||||
</el-link>
|
||||
@@ -37,9 +44,36 @@
|
||||
</el-link>
|
||||
</template>
|
||||
<template #defaultTaxRate="scope">{{ scope.row.defaultTaxRate }}%</template>
|
||||
<template #defaultTaxRate-form>
|
||||
</avue-crud>
|
||||
|
||||
<el-dialog
|
||||
v-model="dialog.visible"
|
||||
:title="dialog.title"
|
||||
width="900px"
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="dialogForm" :model="dialog.form" label-width="130px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="货物或服务简称" required prop="shortName">
|
||||
<el-input v-model="dialog.form.shortName" maxlength="100" clearable placeholder="请输入货物或服务简称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="税收分类编码" required prop="taxClassificationCode">
|
||||
<el-input v-model="dialog.form.taxClassificationCode" maxlength="30" clearable placeholder="请输入税收分类编码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="商品和服务分类名称" required prop="categoryName">
|
||||
<el-input v-model="dialog.form.categoryName" maxlength="200" clearable placeholder="请输入商品和服务分类名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="默认税率" required prop="defaultTaxRate">
|
||||
<el-input
|
||||
v-model="form.defaultTaxRate"
|
||||
v-model="dialog.form.defaultTaxRate"
|
||||
inputmode="decimal"
|
||||
maxlength="6"
|
||||
clearable
|
||||
@@ -48,13 +82,87 @@
|
||||
>
|
||||
<template #append>%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="关联费用项目">
|
||||
<div class="fee-item-box">
|
||||
<span class="fee-item-tip">可拖动排序,发票冲抵费用项目时,按设置的顺序冲抵费用</span>
|
||||
<el-button type="primary" size="small" @click="addFeeItem">添加</el-button>
|
||||
<table class="fee-item-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="36"></th>
|
||||
<th width="60">序号</th>
|
||||
<th>费用类型</th>
|
||||
<th>费用项目</th>
|
||||
<th width="60">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="(item, index) in dialog.form.feeItems"
|
||||
:key="index"
|
||||
draggable="true"
|
||||
@dragstart="onFeeDragStart(index, $event)"
|
||||
@dragover.prevent
|
||||
@drop="onFeeDrop(index, $event)"
|
||||
@dragend="onFeeDragEnd"
|
||||
>
|
||||
<td class="fee-item-drag" :class="{ 'is-dragging': feeDragIndex === index }">≡</td>
|
||||
<td>{{ index + 1 }}</td>
|
||||
<td>
|
||||
<el-select v-model="item.feeCategory" placeholder="请选择" clearable filterable @change="() => onFeeCategoryChange(item)">
|
||||
<el-option
|
||||
v-for="category in feeCategoryOptions"
|
||||
:key="category.value"
|
||||
:label="category.label"
|
||||
:value="category.value"
|
||||
/>
|
||||
</el-select>
|
||||
</td>
|
||||
<td>
|
||||
<el-select
|
||||
v-model="item.feeItemId"
|
||||
placeholder="请先选择费用类型"
|
||||
:disabled="!item.feeCategory"
|
||||
clearable
|
||||
filterable
|
||||
@change="onFeeItemChange(item)"
|
||||
>
|
||||
<el-option
|
||||
v-for="fee in feeItemsOfCategory(item.feeCategory)"
|
||||
:key="fee.id"
|
||||
:label="fee.name"
|
||||
:value="fee.id"
|
||||
/>
|
||||
</el-select>
|
||||
</td>
|
||||
<td>
|
||||
<el-link type="danger" @click="removeFeeItem(index)">删除</el-link>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-if="!dialog.form.feeItems.length">
|
||||
<td colspan="5" class="fee-item-empty">暂无数据</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="dialog.visible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="dialog.saving" @click="saveDialog">保存</el-button>
|
||||
</template>
|
||||
</avue-crud>
|
||||
</el-dialog>
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getList, getDetail, submit, remove } from '@/api/base/invoice-item';
|
||||
import { getList as getFeeItemList } from '@/api/base/fee-item';
|
||||
import { getDictionaryAll } from '@/api/system/dictbiz';
|
||||
import { mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
@@ -65,6 +173,16 @@ export default {
|
||||
loading: true,
|
||||
query: {},
|
||||
selectionList: [],
|
||||
feeItemOptions: [],
|
||||
// 费用类型字典选项(fee_category 字典:dictKey-编码A01,dictValue-名称运输)
|
||||
feeCategoryDictOptions: [],
|
||||
feeDragIndex: null,
|
||||
dialog: {
|
||||
visible: false,
|
||||
title: '新增',
|
||||
saving: false,
|
||||
form: this.emptyForm(),
|
||||
},
|
||||
page: {
|
||||
pageSize: 10,
|
||||
pageSizes: [10, 30, 50, 100, 200],
|
||||
@@ -81,13 +199,11 @@ export default {
|
||||
indexLabel: '序号',
|
||||
indexWidth: 70,
|
||||
selection: false,
|
||||
addBtn: true,
|
||||
addBtn: false,
|
||||
editBtn: false,
|
||||
delBtn: false,
|
||||
viewBtn: false,
|
||||
menuWidth: 140,
|
||||
dialogWidth: 900,
|
||||
dialogClickModal: false,
|
||||
labelPosition: 'right',
|
||||
labelWidth: 'auto',
|
||||
searchShow: true,
|
||||
@@ -100,49 +216,22 @@ export default {
|
||||
label: '货物或服务简称',
|
||||
prop: 'shortName',
|
||||
minWidth: 160,
|
||||
span: 12,
|
||||
maxlength: 100,
|
||||
rules: [{ required: true, message: '请输入货物或服务简称', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '税收分类编码',
|
||||
prop: 'taxClassificationCode',
|
||||
minWidth: 190,
|
||||
span: 12,
|
||||
maxlength: 30,
|
||||
rules: [{ required: true, message: '请输入税收分类编码', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '商品和服务分类名称',
|
||||
prop: 'categoryName',
|
||||
minWidth: 220,
|
||||
span: 12,
|
||||
maxlength: 200,
|
||||
rules: [{ required: true, message: '请输入商品和服务分类名称', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
label: '默认税率',
|
||||
prop: 'defaultTaxRate',
|
||||
type: 'input',
|
||||
formslot: true,
|
||||
slot: true,
|
||||
minWidth: 120,
|
||||
span: 12,
|
||||
rules: [
|
||||
{ required: true, message: '请输入默认税率', trigger: 'blur' },
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
const text = String(value ?? '');
|
||||
const rate = Number(text);
|
||||
if (!/^\d+(\.\d+)?$/.test(text) || rate < 0 || rate > 100) {
|
||||
callback(new Error('默认税率必须是0到100之间的数字'));
|
||||
return;
|
||||
}
|
||||
callback();
|
||||
},
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
slot: true,
|
||||
},
|
||||
{
|
||||
label: '税收项目',
|
||||
@@ -193,27 +282,131 @@ export default {
|
||||
delBtn: false,
|
||||
};
|
||||
},
|
||||
// 费用类型下拉选项:优先字典(显示"名称/编码"),无字典数据时兜底费用项目库提取
|
||||
feeCategoryOptions() {
|
||||
if (this.feeCategoryDictOptions.length) return this.feeCategoryDictOptions;
|
||||
return [...new Set(this.feeItemOptions.map(fee => fee.feeCategory).filter(Boolean))]
|
||||
.map(category => ({ label: category, value: category }));
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
rowSave(row, done, loading) {
|
||||
submit(this.normalizeTaxRateRow(row)).then(
|
||||
() => {
|
||||
this.onLoad(this.page);
|
||||
emptyForm() {
|
||||
return {
|
||||
id: null,
|
||||
shortName: '',
|
||||
taxClassificationCode: '',
|
||||
categoryName: '',
|
||||
defaultTaxRate: 0,
|
||||
feeItems: [],
|
||||
};
|
||||
},
|
||||
openDialog(row) {
|
||||
this.dialog.form = this.emptyForm();
|
||||
this.dialog.title = row ? '编辑' : '新增';
|
||||
this.dialog.visible = true;
|
||||
this.loadFeeItemOptions();
|
||||
this.initFeeCategoryOptions();
|
||||
if (row) {
|
||||
// 编辑回填:后端 detail 返回关联费用项目(按排序号升序)
|
||||
getDetail(row.id).then(res => {
|
||||
const detail = res.data.data || {};
|
||||
this.dialog.form = {
|
||||
...this.emptyForm(),
|
||||
...detail,
|
||||
defaultTaxRate: detail.defaultTaxRate ?? 0,
|
||||
feeItems: (detail.feeItems || []).map(item => ({
|
||||
feeItemId: item.feeItemId,
|
||||
feeItemName: item.feeItemName,
|
||||
feeCategory: item.feeCategory,
|
||||
})),
|
||||
};
|
||||
});
|
||||
}
|
||||
},
|
||||
loadFeeItemOptions() {
|
||||
if (this.feeItemOptions.length) return;
|
||||
getFeeItemList(1, 1000, { status: 1 }).then(res => {
|
||||
this.feeItemOptions = (res.data.data?.records) || [];
|
||||
});
|
||||
},
|
||||
// 费用类型字典:code=fee_category(dictKey-编码如A01,dictValue-名称如运输),label 显示"名称/编码"与费用项目页一致
|
||||
initFeeCategoryOptions() {
|
||||
if (this.feeCategoryDictOptions.length) return;
|
||||
getDictionaryAll().then(res => {
|
||||
this.feeCategoryDictOptions = (res.data.data || [])
|
||||
.filter(item => item.code === 'fee_category' && Number(item.parentId) > 0)
|
||||
.sort((first, second) => Number(first.sort || 0) - Number(second.sort || 0))
|
||||
.map(item => ({
|
||||
label: `${item.dictValue}/${item.dictKey}`,
|
||||
value: String(item.dictKey),
|
||||
}));
|
||||
});
|
||||
},
|
||||
// 级联:该费用类型下的费用项目选项
|
||||
feeItemsOfCategory(feeCategory) {
|
||||
if (!feeCategory) return [];
|
||||
return this.feeItemOptions.filter(fee => fee.feeCategory === feeCategory);
|
||||
},
|
||||
// 先选费用类型:清空原费用项目(原项目可能不属于新类型)
|
||||
onFeeCategoryChange(item) {
|
||||
item.feeItemId = null;
|
||||
item.feeItemName = '';
|
||||
},
|
||||
// 后选费用项目:带出名称(费用类型已由上级确定)
|
||||
onFeeItemChange(item) {
|
||||
const fee = this.feeItemsOfCategory(item.feeCategory).find(option => option.id === item.feeItemId);
|
||||
item.feeItemName = fee ? fee.name : '';
|
||||
},
|
||||
addFeeItem() {
|
||||
this.dialog.form.feeItems.push({ feeItemId: null, feeItemName: '', feeCategory: '' });
|
||||
},
|
||||
removeFeeItem(index) {
|
||||
this.dialog.form.feeItems.splice(index, 1);
|
||||
},
|
||||
onFeeDragStart(index, event) {
|
||||
this.feeDragIndex = index;
|
||||
event.dataTransfer.effectAllowed = 'move';
|
||||
},
|
||||
onFeeDrop(index) {
|
||||
const from = this.feeDragIndex;
|
||||
if (from === null || from === index) return;
|
||||
const items = this.dialog.form.feeItems;
|
||||
items.splice(index, 0, items.splice(from, 1)[0]);
|
||||
this.feeDragIndex = null;
|
||||
},
|
||||
onFeeDragEnd() {
|
||||
this.feeDragIndex = null;
|
||||
},
|
||||
saveDialog() {
|
||||
const formItem = this.dialog.form;
|
||||
if (!formItem.shortName) return this.$message.warning('请输入货物或服务简称');
|
||||
if (!formItem.taxClassificationCode) return this.$message.warning('请输入税收分类编码');
|
||||
if (!formItem.categoryName) return this.$message.warning('请输入商品和服务分类名称');
|
||||
const rate = Number(formItem.defaultTaxRate);
|
||||
if (!/^\d+(\.\d+)?$/.test(String(formItem.defaultTaxRate ?? '')) || rate < 0 || rate > 100) {
|
||||
return this.$message.warning('默认税率必须是0到100之间的数字');
|
||||
}
|
||||
if (formItem.feeItems.some(item => !item.feeItemId)) {
|
||||
return this.$message.warning('请选择关联费用项目');
|
||||
}
|
||||
this.dialog.saving = true;
|
||||
submit({
|
||||
...formItem,
|
||||
defaultTaxRate: rate,
|
||||
feeItems: formItem.feeItems.map(item => ({
|
||||
feeItemId: item.feeItemId,
|
||||
feeItemName: item.feeItemName,
|
||||
feeCategory: item.feeCategory,
|
||||
})),
|
||||
})
|
||||
.then(() => {
|
||||
this.$message.success('操作成功');
|
||||
done();
|
||||
},
|
||||
() => loading()
|
||||
);
|
||||
},
|
||||
rowUpdate(row, index, done, loading) {
|
||||
submit(this.normalizeTaxRateRow(row)).then(
|
||||
() => {
|
||||
this.dialog.visible = false;
|
||||
this.onLoad(this.page);
|
||||
this.$message.success('操作成功');
|
||||
done();
|
||||
},
|
||||
() => loading()
|
||||
);
|
||||
})
|
||||
.finally(() => {
|
||||
this.dialog.saving = false;
|
||||
});
|
||||
},
|
||||
rowDel(row) {
|
||||
this.$confirm('确定将选择数据删除?', '提示', { type: 'warning' })
|
||||
@@ -223,27 +416,11 @@ export default {
|
||||
this.$message.success('操作成功');
|
||||
});
|
||||
},
|
||||
beforeOpen(done, type) {
|
||||
if (['edit', 'view'].includes(type)) {
|
||||
getDetail(this.form.id).then(res => {
|
||||
this.form = res.data.data || {};
|
||||
done();
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.form = { defaultTaxRate: 0 };
|
||||
done();
|
||||
},
|
||||
handleTaxRateInput(value) {
|
||||
let normalized = String(value || '').replace(/[^\d.]/g, '');
|
||||
normalized = normalized.replace(/(\..*)\./g, '$1');
|
||||
if (normalized.startsWith('.')) normalized = `0${normalized}`;
|
||||
this.form.defaultTaxRate = normalized;
|
||||
},
|
||||
normalizeTaxRateRow(row) {
|
||||
const values = { ...row };
|
||||
values.defaultTaxRate = Number(values.defaultTaxRate);
|
||||
return values;
|
||||
this.dialog.form.defaultTaxRate = normalized;
|
||||
},
|
||||
searchChange(params, done) {
|
||||
this.query = {
|
||||
@@ -292,17 +469,53 @@ export default {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.invoice-item-page :deep(.avue-crud__dialog .el-form-item) {
|
||||
margin-bottom: 28px;
|
||||
}
|
||||
|
||||
.invoice-item-page :deep(.avue-crud__dialog .el-form-item__error) {
|
||||
position: relative;
|
||||
line-height: 20px;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.invoice-item-page :deep(.avue-crud__menu .el-link) {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.fee-item-box {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.fee-item-tip {
|
||||
display: inline-block;
|
||||
margin-right: 12px;
|
||||
color: #f56c6c;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.fee-item-table {
|
||||
width: 100%;
|
||||
margin-top: 8px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.fee-item-table th,
|
||||
.fee-item-table td {
|
||||
padding: 8px;
|
||||
border: 1px solid #ebeef5;
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.fee-item-table th {
|
||||
background: #f8f8f9;
|
||||
color: #515a6e;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.fee-item-drag {
|
||||
cursor: move;
|
||||
color: #909399;
|
||||
font-size: 16px;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.fee-item-drag.is-dragging {
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
.fee-item-empty {
|
||||
color: #909399;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -3949,9 +3949,9 @@ export default {
|
||||
return Object.values(groups)
|
||||
.map(group => {
|
||||
const quantity = this.formatDispatchQuantity(group.quantity);
|
||||
const typeName =
|
||||
group.count > 1 ? `${group.typeName}等${group.count}种货物` : group.typeName;
|
||||
return `${typeName} | ${quantity}${group.unit ? ` ${group.unit}` : ''}`;
|
||||
return `${group.typeName}等${group.count}种货物 | ${quantity}${
|
||||
group.unit ? ` ${group.unit}` : ''
|
||||
}`;
|
||||
})
|
||||
.join('; ');
|
||||
},
|
||||
@@ -7549,13 +7549,12 @@ export default {
|
||||
}, {});
|
||||
|
||||
const cargoInfo = Object.values(groups)
|
||||
.map(group => {
|
||||
const typeName =
|
||||
group.count > 1 ? `${group.cargoType}等${group.count}种货物` : group.cargoType;
|
||||
return `${typeName} | ${this.formatDispatchQuantity(group.quantity)}${
|
||||
group.unit ? ` ${group.unit}` : ''
|
||||
}`;
|
||||
})
|
||||
.map(
|
||||
group =>
|
||||
`${group.cargoType}等${group.count}种货物 | ${this.formatDispatchQuantity(
|
||||
group.quantity
|
||||
)}${group.unit ? ` ${group.unit}` : ''}`
|
||||
)
|
||||
.join('; ');
|
||||
return cargoInfo || plan.goodsInfo || '';
|
||||
},
|
||||
|
||||
@@ -5018,9 +5018,9 @@ export default {
|
||||
return Object.values(groups)
|
||||
.map(group => {
|
||||
const quantity = this.formatQuantity(group.quantity);
|
||||
const typeName =
|
||||
group.count > 1 ? `${group.typeName}等${group.count}种货物` : group.typeName;
|
||||
return `${typeName} | ${quantity}${group.unit ? ` ${group.unit}` : ''}`;
|
||||
return `${group.typeName}等${group.count}种货物 | ${quantity}${
|
||||
group.unit ? ` ${group.unit}` : ''
|
||||
}`;
|
||||
})
|
||||
.join('; ');
|
||||
},
|
||||
|
||||
@@ -13,18 +13,8 @@ export default {
|
||||
components: { MkPublicShell, ContractManageChange },
|
||||
methods: {
|
||||
getForm() {
|
||||
const page = this.$refs.page;
|
||||
const row = page?.form || {};
|
||||
return {
|
||||
...row,
|
||||
partyAJson: row.partyAJson || '',
|
||||
partyBJson: row.partyBJson || '',
|
||||
partyCJson: row.partyCJson || '',
|
||||
partyARows: page?.partyARows || [],
|
||||
partyBRows: page?.partyBRows || [],
|
||||
partyCRows: page?.partyCRows || [],
|
||||
subject: row.contractName || row.contractNo || '',
|
||||
};
|
||||
const row = this.$refs.page?.form || {};
|
||||
return { ...row, subject: row.contractName || row.contractNo || '' };
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -69,8 +69,11 @@
|
||||
<el-form-item label="合同负责部门">
|
||||
<el-input v-model="form.organizationName" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="平台公司">
|
||||
<el-input v-model="form.platformCompanyName" disabled />
|
||||
<el-form-item label="甲方">
|
||||
<el-input v-model="form.partyA" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="乙方">
|
||||
<el-input v-model="form.partyB" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="签订日期">
|
||||
<el-date-picker
|
||||
@@ -269,29 +272,6 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section
|
||||
v-for="party in partySections"
|
||||
:key="party.role"
|
||||
class="change-section contract-party-section"
|
||||
>
|
||||
<div class="dialog-section-title">{{ party.label }}</div>
|
||||
<el-table :data="party.rows" border empty-text="暂无数据" class="change-table">
|
||||
<el-table-column type="index" label="序号" width="70" align="center" />
|
||||
<el-table-column prop="customerName" label="客商名称" min-width="200" align="center">
|
||||
<template #default="{ row }">{{ row.customerName || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creditCode" label="统一信用代码" min-width="180" align="center">
|
||||
<template #default="{ row }">{{ row.creditCode || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="contactName" label="联系人" min-width="160" align="center">
|
||||
<template #default="{ row }">{{ row.contactName || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="contactPhone" label="联系电话" min-width="150" align="center">
|
||||
<template #default="{ row }">{{ row.contactPhone || '-' }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</section>
|
||||
|
||||
<contract-attachment-section
|
||||
title="用印材料"
|
||||
description
|
||||
@@ -819,13 +799,6 @@ export default {
|
||||
.join('、');
|
||||
return `【${parties || '相对方'}】:被列入外部黑名单;涉贪污受贿裁判相关提及方(3年以上及其他);被执行人信息;买卖合同纠纷;劳动纠纷;重大纠纷。提交变更前须上传「特批附件」类型附件`;
|
||||
},
|
||||
partySections() {
|
||||
return [
|
||||
{ role: 'A', label: '甲方', rows: this.partyARows },
|
||||
{ role: 'B', label: '乙方', rows: this.partyBRows },
|
||||
{ role: 'C', label: '丙方', rows: this.partyCRows },
|
||||
];
|
||||
},
|
||||
isSettlementRuleChange() {
|
||||
return this.form.changeType === '结算规则变更';
|
||||
},
|
||||
@@ -1280,16 +1253,6 @@ export default {
|
||||
.contract-change-page :deep(.basic-container__card) { border: 0; background: transparent; box-shadow: none; }
|
||||
.contract-change-form { background: #f5f6fa; }
|
||||
.change-section { padding: 20px 24px; background: #fff; border-bottom: 1px solid #eff1f7; margin-top: 12px; }
|
||||
.contract-party-section {
|
||||
margin-bottom: 12px;
|
||||
padding: 14px 16px 16px;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
border-bottom: 0;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
.contract-party-section > .dialog-section-title { margin-bottom: 16px; color: #303133; }
|
||||
.contract-basic-section { margin-bottom: 12px; padding: 14px 16px 16px; overflow: hidden; background: #fff; border-bottom: 0; border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); }
|
||||
.contract-basic-section > .dialog-section-title { margin-bottom: 20px; color: #303133; }
|
||||
.contract-basic-section__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 48px; }
|
||||
|
||||
@@ -13,18 +13,8 @@ export default {
|
||||
components: { MkPublicShell, ContractManage },
|
||||
methods: {
|
||||
getForm() {
|
||||
const page = this.$refs.page;
|
||||
const row = page?.detailRow || {};
|
||||
return {
|
||||
...row,
|
||||
partyAJson: row.partyAJson || '',
|
||||
partyBJson: row.partyBJson || '',
|
||||
partyCJson: row.partyCJson || '',
|
||||
partyARows: page?.detailPartyARows || [],
|
||||
partyBRows: page?.detailPartyBRows || [],
|
||||
partyCRows: page?.detailPartyCRows || [],
|
||||
subject: row.contractName || row.contractNo || '',
|
||||
};
|
||||
const row = this.$refs.page?.detailRow || {};
|
||||
return { ...row, subject: row.contractName || row.contractNo || '' };
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -174,6 +174,9 @@
|
||||
<el-descriptions-item label="项目">{{
|
||||
detailValue('projectName')
|
||||
}}</el-descriptions-item>
|
||||
<el-descriptions-item label="甲方">{{ detailValue('partyA') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="乙方">{{ detailValue('partyB') }}</el-descriptions-item>
|
||||
<el-descriptions-item label="丙方">{{ detailValue('partyC') || '-' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="合同期限">{{ detailContractPeriod }}</el-descriptions-item>
|
||||
<el-descriptions-item label="合同负责部门">{{
|
||||
detailValue('organizationName')
|
||||
@@ -236,29 +239,6 @@
|
||||
</el-descriptions>
|
||||
</section>
|
||||
|
||||
<section
|
||||
v-for="party in detailPartySections"
|
||||
:key="`detail-${party.role}`"
|
||||
class="contract-manage-form__section contract-manage-form__section--panel"
|
||||
>
|
||||
<div class="dialog-section-title">{{ party.label }}</div>
|
||||
<el-table :data="party.rows" border empty-text="暂无数据">
|
||||
<el-table-column type="index" label="序号" width="70" align="center" />
|
||||
<el-table-column prop="customerName" label="客商名称" min-width="200" align="center">
|
||||
<template #default="{ row }">{{ row.customerName || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creditCode" label="统一信用代码" min-width="180" align="center">
|
||||
<template #default="{ row }">{{ row.creditCode || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="contactName" label="联系人" min-width="160" align="center">
|
||||
<template #default="{ row }">{{ row.contactName || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="contactPhone" label="联系电话" min-width="150" align="center">
|
||||
<template #default="{ row }">{{ row.contactPhone || '-' }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</section>
|
||||
|
||||
<hcs-contract-panel
|
||||
v-if="!isPublicViewPage"
|
||||
:contract="detailRow"
|
||||
@@ -1225,8 +1205,7 @@ import {
|
||||
getDetail as getCustomerArchiveDetail,
|
||||
getList as getCustomerArchiveList,
|
||||
} from '@/api/vehicle/customer-archive';
|
||||
import { getBusinessDeptSelect, getDeptTree, getPlatformCompanySelect } from '@/api/system/dept';
|
||||
import { normalizeBusinessDeptOptions } from '@/utils/dept';
|
||||
import { getBusinessDeptSelect, getDeptTree } from '@/api/system/dept';
|
||||
import { getDictionary as getSystemDictionary } from '@/api/system/dict';
|
||||
import { getDictionary as getBizDictionary } from '@/api/system/dictbiz';
|
||||
import { config, option } from '@/option/business/contract-manage';
|
||||
@@ -1600,9 +1579,6 @@ export default {
|
||||
billCycleTypeOptions: ['固定截单日', '自然月', '自定义多周期'],
|
||||
detailLoading: false,
|
||||
detailRow: {},
|
||||
detailPartyARows: [],
|
||||
detailPartyBRows: [],
|
||||
detailPartyCRows: [],
|
||||
// 合规(HCS)推送/对账状态;受 thirdParty.hcs.push.immediate-enabled 控制显隐
|
||||
hcsRepushingId: null,
|
||||
hcsImmediateEnabled: false,
|
||||
@@ -1731,13 +1707,6 @@ export default {
|
||||
{ role: 'C', label: '丙方', rows: this.partyCRows },
|
||||
];
|
||||
},
|
||||
detailPartySections() {
|
||||
return [
|
||||
{ role: 'A', label: '甲方', rows: this.detailPartyARows },
|
||||
{ role: 'B', label: '乙方', rows: this.detailPartyBRows },
|
||||
{ role: 'C', label: '丙方', rows: this.detailPartyCRows },
|
||||
];
|
||||
},
|
||||
/**
|
||||
* 计费方案适用客商:
|
||||
* - 客户合同:仅甲方(仅 1 个甲方时编辑器自动选中)
|
||||
@@ -2709,12 +2678,13 @@ export default {
|
||||
applyProjectPlatformCompanies(project, autoSelect = false) {
|
||||
const ids = this.parseUndertakeDeptIds(project?.undertakeDeptId);
|
||||
const names = this.parseUndertakeDeptNames(project?.undertakeDeptName);
|
||||
// 项目可能仍挂旧组织 ID(已删/非平台公司),按名称映射到现行「是否平台公司=是」的组织
|
||||
return this.resolveProjectPlatformCompanyOptions(ids, names).then(options => {
|
||||
this.platformCompanyOptions = options;
|
||||
this.platformCompanyOptions = ids.map((id, index) => ({
|
||||
id: String(id),
|
||||
label: names[index] || String(id),
|
||||
}));
|
||||
if (!autoSelect) {
|
||||
this.syncCurrentPlatformCompanyOption();
|
||||
return options;
|
||||
return;
|
||||
}
|
||||
if (this.platformCompanyOptions.length === 1) {
|
||||
this.form.platformCompanyId = this.platformCompanyOptions[0].id;
|
||||
@@ -2730,34 +2700,6 @@ export default {
|
||||
this.handlePlatformCompanyChange(this.form.platformCompanyId);
|
||||
}
|
||||
if (this.formMode === 'add') this.refreshPreviewContractNo();
|
||||
return options;
|
||||
});
|
||||
},
|
||||
resolveProjectPlatformCompanyOptions(ids, names) {
|
||||
const fallback = ids.map((id, index) => ({
|
||||
id: String(id),
|
||||
label: names[index] || String(id),
|
||||
}));
|
||||
if (!ids.length) return Promise.resolve([]);
|
||||
return getPlatformCompanySelect()
|
||||
.then(res => {
|
||||
const liveList = (res.data?.data || []).map(item => ({
|
||||
id: String(item.id),
|
||||
label: item.deptName || item.fullName || String(item.id),
|
||||
}));
|
||||
return ids.map((id, index) => {
|
||||
const name = String(names[index] || '').trim();
|
||||
const byId = liveList.find(item => String(item.id) === String(id));
|
||||
if (byId) return byId;
|
||||
const byName = name ? liveList.find(item => item.label === name) : null;
|
||||
if (byName) return byName;
|
||||
return {
|
||||
id: String(id),
|
||||
label: name || String(id),
|
||||
};
|
||||
});
|
||||
})
|
||||
.catch(() => fallback);
|
||||
},
|
||||
handlePlatformCompanyChange(value) {
|
||||
const matched = this.platformCompanyOptions.find(item => String(item.id) === String(value));
|
||||
@@ -3151,8 +3093,11 @@ export default {
|
||||
this.businessDeptLoading = true;
|
||||
getBusinessDeptSelect()
|
||||
.then(res => {
|
||||
// 同名业务部门(不同上级公司)展示「部门(上级)」;落库仍用 rawLabel 原始部门名
|
||||
this.businessDeptOptions = normalizeBusinessDeptOptions(res.data?.data || []);
|
||||
this.businessDeptOptions = (res.data?.data || []).map(item => ({
|
||||
id: String(item.id),
|
||||
label: item.deptName || item.fullName || String(item.id),
|
||||
rawLabel: item.deptName || item.fullName || String(item.id),
|
||||
}));
|
||||
this.syncCurrentBusinessDeptOption();
|
||||
})
|
||||
.finally(() => {
|
||||
@@ -3168,7 +3113,6 @@ export default {
|
||||
}
|
||||
this.businessDeptOptions.unshift({
|
||||
id: String(this.form.organizationId),
|
||||
value: String(this.form.organizationId),
|
||||
label: this.form.organizationName,
|
||||
rawLabel: this.form.organizationName,
|
||||
});
|
||||
@@ -3512,9 +3456,6 @@ export default {
|
||||
invoiceCycle: normalizeOptionalInteger(detail.invoiceCycle),
|
||||
paymentDays: normalizeOptionalInteger(detail.paymentDays),
|
||||
};
|
||||
this.detailPartyARows = this.normalizePartyRows(detail.partyAJson, detail.partyA, true);
|
||||
this.detailPartyBRows = this.normalizePartyRows(detail.partyBJson, detail.partyB, true);
|
||||
this.detailPartyCRows = this.normalizePartyRows(detail.partyCJson, detail.partyC, false);
|
||||
this.detailContractFileRows = normalizeContractFileRows(parseArray(detail.contractFileJson));
|
||||
this.detailAttachmentRows = parseArray(detail.attachmentsJson);
|
||||
this.detailBillingPlanRows = parseArray(detail.billingPlanJson);
|
||||
|
||||
@@ -2545,9 +2545,9 @@ export default {
|
||||
Object.values(groups)
|
||||
.map(group => {
|
||||
const quantity = this.formatGoodsQuantity(group.quantity);
|
||||
const typeName =
|
||||
group.count > 1 ? `${group.typeName}等${group.count}种货物` : group.typeName;
|
||||
return `${typeName} | ${quantity}${group.unit ? ` ${group.unit}` : ''}`;
|
||||
return `${group.typeName}等${group.count}种货物 | ${quantity}${
|
||||
group.unit ? ` ${group.unit}` : ''
|
||||
}`;
|
||||
})
|
||||
.join('; ') || '-'
|
||||
);
|
||||
|
||||
@@ -489,12 +489,6 @@ const NODE_TEMPLATES = [
|
||||
},
|
||||
];
|
||||
|
||||
// 过程配置必须覆盖装货端与卸货端各一个节点;货量下限只看装货端——
|
||||
// 到场没有货量开关,不能拿它顶替货量采集
|
||||
const PICKUP_NODE_KEYS = ['arrive_scene', 'load', 'dispatch'];
|
||||
const DELIVERY_NODE_KEYS = ['unload', 'arrival', 'sign', 'return'];
|
||||
const CARGO_NODE_KEYS = ['load', 'dispatch'];
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -922,24 +916,8 @@ export default {
|
||||
this.$message.warning('备注不能超过500个字符');
|
||||
return false;
|
||||
}
|
||||
const isEnabledNode = key => this.nodeRows.some(item => item.key === key && item.enabled);
|
||||
if (!PICKUP_NODE_KEYS.some(isEnabledNode)) {
|
||||
this.$message.warning('发货、装货、到场至少选择一个');
|
||||
return false;
|
||||
}
|
||||
if (!DELIVERY_NODE_KEYS.some(isEnabledNode)) {
|
||||
this.$message.warning('卸货、到货、签收、回单至少选择一个');
|
||||
return false;
|
||||
}
|
||||
// 装货端没有节点采集货量时,整条配置在小程序侧等于不采集货量
|
||||
const collectsCargo = CARGO_NODE_KEYS.some(key =>
|
||||
this.nodeRows.some(
|
||||
item =>
|
||||
item.key === key && item.enabled && item.uploadCargo && (item.cargoTypes || []).length
|
||||
)
|
||||
);
|
||||
if (!collectsCargo) {
|
||||
this.$message.warning('发货或装货至少勾选一个货量类型');
|
||||
if (!this.enabledNodes.length) {
|
||||
this.$message.warning('请至少选择一个过程节点');
|
||||
return false;
|
||||
}
|
||||
const transit = this.nodeRows.find(item => item.key === 'transit');
|
||||
|
||||
@@ -676,7 +676,7 @@
|
||||
<div class="project-apply-form__material-head">
|
||||
<div class="dialog-section-title project-apply-form__material-title">项目材料</div>
|
||||
<span
|
||||
v-if="!isChangeDialog && missingRequiredAttachmentTypes.length"
|
||||
v-if="missingRequiredAttachmentTypes.length"
|
||||
class="project-apply-form__material-warn"
|
||||
>
|
||||
未上传:{{ missingRequiredAttachmentTypes.join('、') }}
|
||||
@@ -698,11 +698,7 @@
|
||||
<el-table-column type="index" label="序号" width="80" align="center" />
|
||||
<el-table-column label="附件类型" min-width="160" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-select
|
||||
v-model="row.fileType"
|
||||
placeholder="请选择"
|
||||
:disabled="dialogReadonly || isChangeDialog"
|
||||
>
|
||||
<el-select v-model="row.fileType" placeholder="请选择" :disabled="dialogReadonly">
|
||||
<el-option
|
||||
v-for="item in projectAttachmentTypeOptions"
|
||||
:key="item.value"
|
||||
@@ -735,7 +731,7 @@
|
||||
<el-input
|
||||
v-model="row.description"
|
||||
placeholder="请输入"
|
||||
:disabled="dialogReadonly || isChangeDialog"
|
||||
:disabled="dialogReadonly"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -745,26 +741,14 @@
|
||||
<el-table-column prop="uploadUserName" label="上传人" min-width="140" align="center" />
|
||||
<el-table-column prop="uploadTime" label="上传时间" min-width="170" align="center" sortable/>
|
||||
<el-table-column label="操作" width="110" align="center">
|
||||
<template #default="{ row, $index }">
|
||||
<el-link
|
||||
v-if="isChangeDialog && !dialogReadonly"
|
||||
type="primary"
|
||||
@click="openAdjustAttachmentDialog(row, $index)"
|
||||
<template #default="{ $index }">
|
||||
<el-link v-if="!dialogReadonly" type="danger" @click="removeAttachment($index)"
|
||||
>删除</el-link
|
||||
>
|
||||
调整
|
||||
</el-link>
|
||||
<el-link
|
||||
v-else-if="!dialogReadonly && !isChangeDialog"
|
||||
type="danger"
|
||||
@click="removeAttachment($index)"
|
||||
>
|
||||
删除
|
||||
</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<vehicle-attachment-upload
|
||||
v-if="!isChangeDialog"
|
||||
v-model="attachmentRows"
|
||||
class="project-apply-form__upload"
|
||||
:readonly="dialogReadonly"
|
||||
@@ -777,57 +761,6 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div v-if="isChangeDialog" class="project-apply-form__material-card">
|
||||
<div class="project-apply-form__material-head">
|
||||
<div class="dialog-section-title project-apply-form__material-title">调整材料</div>
|
||||
</div>
|
||||
<el-table :data="adjustAttachmentRows" border class="project-apply-form__material-table">
|
||||
<el-table-column type="index" label="序号" width="80" align="center" />
|
||||
<el-table-column label="原附件" min-width="180" align="center" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
{{ attachmentName(row.originAttachment) || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="附件类型" min-width="160" align="center">
|
||||
<template #default="{ row }">{{ row.fileType || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="文件名"
|
||||
min-width="220"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
class-name="is-ellipsis-link"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<span
|
||||
class="attachment-file-name"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
@click="previewAttachment(row)"
|
||||
@keydown.enter="previewAttachment(row)"
|
||||
@keydown.space.prevent="previewAttachment(row)"
|
||||
>{{ attachmentName(row) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="附件描述" min-width="200" align="center" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.description || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="调整原因" min-width="180" align="center" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.adjustReason || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="文件大小" min-width="120" align="center">
|
||||
<template #default="{ row }">{{ formatFileSize(row.size) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="uploadUserName" label="上传人" min-width="140" align="center" />
|
||||
<el-table-column prop="uploadTime" label="上传时间" min-width="170" align="center" />
|
||||
<el-table-column v-if="!dialogReadonly" label="操作" width="110" align="center">
|
||||
<template #default="{ $index }">
|
||||
<el-link type="danger" @click="removeAdjustAttachment($index)">删除</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<template v-if="showProjectContractSection">
|
||||
<div class="dialog-section-title project-apply-form__table-title">项目合同</div>
|
||||
<el-table
|
||||
@@ -1078,86 +1011,6 @@
|
||||
@close="attachmentImagePreviewVisible = false"
|
||||
/>
|
||||
|
||||
<el-dialog
|
||||
v-model="adjustAttachmentBox"
|
||||
title="调整材料"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
width="720px"
|
||||
class="project-apply-adjust-dialog"
|
||||
@closed="resetAdjustAttachmentForm"
|
||||
>
|
||||
<el-form
|
||||
ref="adjustAttachmentFormRef"
|
||||
:model="adjustAttachmentForm"
|
||||
:rules="adjustAttachmentRules"
|
||||
label-position="right"
|
||||
label-width="auto"
|
||||
>
|
||||
<el-form-item label="原附件">
|
||||
<span>{{ attachmentName(adjustAttachmentForm.originAttachment) || '-' }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="附件类型" prop="fileType">
|
||||
<el-select v-model="adjustAttachmentForm.fileType" placeholder="请选择" clearable>
|
||||
<el-option
|
||||
v-for="item in projectAttachmentTypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="附件文件" prop="url">
|
||||
<div class="project-apply-adjust-dialog__upload">
|
||||
<span
|
||||
v-if="attachmentName(adjustAttachmentForm)"
|
||||
class="attachment-file-name"
|
||||
role="button"
|
||||
tabindex="0"
|
||||
@click="previewAttachment(adjustAttachmentForm)"
|
||||
@keydown.enter="previewAttachment(adjustAttachmentForm)"
|
||||
@keydown.space.prevent="previewAttachment(adjustAttachmentForm)"
|
||||
>
|
||||
{{ attachmentName(adjustAttachmentForm) }}
|
||||
</span>
|
||||
<span v-else class="project-apply-adjust-dialog__upload-empty">请上传新材料</span>
|
||||
<vehicle-attachment-upload
|
||||
v-model="adjustAttachmentUploadRows"
|
||||
:readonly="false"
|
||||
:multiple="false"
|
||||
:limit="1"
|
||||
:file-types="attachmentFileTypes"
|
||||
:max-size="50"
|
||||
:show-file-list="false"
|
||||
button-text="上传附件"
|
||||
tip="支持pdf、bmp、jpeg、png、jpg、doc、docx、ppt、pptx、xlsx、xls、eml、msg、zip,单个文件不超过50M"
|
||||
@change="handleAdjustAttachmentUploadChange"
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="附件描述" prop="description">
|
||||
<el-input v-model="adjustAttachmentForm.description" placeholder="请输入" maxlength="200" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件大小">
|
||||
<span>{{ formatFileSize(adjustAttachmentForm.size) || '-' }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="调整原因" prop="adjustReason" class="project-apply-form__change-textarea">
|
||||
<el-input
|
||||
v-model="adjustAttachmentForm.adjustReason"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
maxlength="2000"
|
||||
show-word-limit
|
||||
placeholder="请输入调整原因"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="adjustAttachmentBox = false">取消</el-button>
|
||||
<el-button type="primary" @click="confirmAdjustAttachment">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
v-model="userBox"
|
||||
title="选择用户"
|
||||
@@ -1241,7 +1094,6 @@ import {
|
||||
getDetail as getCustomerArchiveDetail,
|
||||
} from '@/api/vehicle/customer-archive';
|
||||
import { getBusinessDeptSelect, getPlatformCompanySelect } from '@/api/system/dept';
|
||||
import { normalizeBusinessDeptOptions } from '@/utils/dept';
|
||||
import { getDictionary as getSystemDictionary } from '@/api/system/dict';
|
||||
import { getDictionary as getBizDictionary } from '@/api/system/dictbiz';
|
||||
import { getList as getUserList } from '@/api/system/user';
|
||||
@@ -1313,7 +1165,6 @@ const emptyForm = () => ({
|
||||
customerJson: '',
|
||||
carrierJson: '',
|
||||
attachmentsJson: '',
|
||||
adjustAttachmentsJson: '',
|
||||
situationRemark: '',
|
||||
projectIntro: '',
|
||||
profitRemark: '',
|
||||
@@ -1323,24 +1174,6 @@ const emptyForm = () => ({
|
||||
changeReason: '',
|
||||
});
|
||||
|
||||
const emptyAdjustAttachmentForm = () => ({
|
||||
uid: '',
|
||||
fileType: '',
|
||||
originalName: '',
|
||||
name: '',
|
||||
fileName: '',
|
||||
url: '',
|
||||
link: '',
|
||||
fileUrl: '',
|
||||
description: '',
|
||||
size: '',
|
||||
uploadUserName: '',
|
||||
uploadTime: '',
|
||||
adjustReason: '',
|
||||
originAttachment: null,
|
||||
originKey: '',
|
||||
});
|
||||
|
||||
const optionalSentinelFields = [
|
||||
'projectScale',
|
||||
'estimatedProfit',
|
||||
@@ -1615,29 +1448,6 @@ export default {
|
||||
customerRows: [],
|
||||
carrierRows: [],
|
||||
attachmentRows: [],
|
||||
adjustAttachmentRows: [],
|
||||
adjustAttachmentBox: false,
|
||||
adjustAttachmentForm: emptyAdjustAttachmentForm(),
|
||||
adjustAttachmentUploadRows: [],
|
||||
adjustAttachmentRules: {
|
||||
fileType: [{ required: true, message: '请选择附件类型', trigger: 'change' }],
|
||||
url: [
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
if (!this.attachmentUrl(this.adjustAttachmentForm)) {
|
||||
callback(new Error('请上传新材料'));
|
||||
return;
|
||||
}
|
||||
callback();
|
||||
},
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
adjustReason: [
|
||||
{ required: true, message: '请输入调整原因', trigger: 'blur' },
|
||||
{ max: 2000, message: '调整原因不能超过2000个字符', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
selectedAttachmentRows: [],
|
||||
attachmentImagePreviewVisible: false,
|
||||
attachmentImagePreviewUrls: [],
|
||||
@@ -2396,9 +2206,6 @@ export default {
|
||||
this.customerRows = [];
|
||||
this.carrierRows = [];
|
||||
this.attachmentRows = [];
|
||||
this.adjustAttachmentRows = [];
|
||||
this.adjustAttachmentBox = false;
|
||||
this.resetAdjustAttachmentForm();
|
||||
this.selectedAttachmentRows = [];
|
||||
this.changeRows = [];
|
||||
this.projectContractRows = [];
|
||||
@@ -2440,7 +2247,6 @@ export default {
|
||||
this.carrierRows = carrierRows;
|
||||
this.attachmentRows = this.parseJsonArray(displayRow.attachmentsJson);
|
||||
this.normalizeAttachmentFileTypes();
|
||||
this.adjustAttachmentRows = this.parseJsonArray(displayRow.adjustAttachmentsJson);
|
||||
this.selectedAttachmentRows = [];
|
||||
this.changeRows = this.buildChangeRows(displayRow);
|
||||
this.selectedCustomerId = this.customerRows
|
||||
@@ -2749,9 +2555,6 @@ export default {
|
||||
customerJson: JSON.stringify(this.customerRows),
|
||||
carrierJson: JSON.stringify(this.carrierRows),
|
||||
attachmentsJson: JSON.stringify(this.attachmentRows),
|
||||
adjustAttachmentsJson: this.isChangeDialog
|
||||
? JSON.stringify(this.adjustAttachmentRows || [])
|
||||
: undefined,
|
||||
situationRemark: JSON.stringify({
|
||||
projectIntro: this.form.projectIntro || '',
|
||||
profitRemark: this.form.profitRemark || '',
|
||||
@@ -2767,9 +2570,6 @@ export default {
|
||||
if (this.isNewProjectDialog && !options.includeChangeType) {
|
||||
delete submitRow.changeReason;
|
||||
}
|
||||
if (!this.isChangeDialog) {
|
||||
delete submitRow.adjustAttachmentsJson;
|
||||
}
|
||||
['projectIntro', 'profitRemark', 'riskPoint', 'emergencyPlan'].forEach(
|
||||
key => delete submitRow[key]
|
||||
);
|
||||
@@ -3179,8 +2979,19 @@ export default {
|
||||
loadDeptOptions() {
|
||||
getBusinessDeptSelect()
|
||||
.then(res => {
|
||||
// 仅展示「是否业务部门=是」;同名部门追加上级组织名区分
|
||||
this.deptOptions = normalizeBusinessDeptOptions(res.data.data || []);
|
||||
const bizList = res.data.data || [];
|
||||
// 仅展示「是否业务部门=是」的本级部门,扁平下拉
|
||||
this.deptOptions = bizList
|
||||
.map(item => {
|
||||
const value = item.id == null || item.id === '' ? '' : String(item.id);
|
||||
const label = item.deptName || item.fullName || item.title || item.name || value;
|
||||
return {
|
||||
label,
|
||||
rawLabel: label,
|
||||
value,
|
||||
};
|
||||
})
|
||||
.filter(item => item.value);
|
||||
this.fillDefaultBusinessDept();
|
||||
this.ensureCurrentBusinessDeptOption();
|
||||
})
|
||||
@@ -3390,112 +3201,6 @@ export default {
|
||||
removeAttachment(index) {
|
||||
this.attachmentRows.splice(index, 1);
|
||||
},
|
||||
attachmentIdentity(row = {}) {
|
||||
const uid = String(row.uid || '').trim();
|
||||
if (uid) return `uid:${uid}`;
|
||||
const url = String(this.attachmentUrl(row) || '').trim();
|
||||
if (url) return `url:${url}`;
|
||||
const name = String(this.attachmentName(row) || '').trim();
|
||||
const fileType = String(row.fileType || '').trim();
|
||||
if (name || fileType) return `name:${fileType}|${name}`;
|
||||
return '';
|
||||
},
|
||||
openAdjustAttachmentDialog(row) {
|
||||
const originKey = this.attachmentIdentity(row);
|
||||
const existing = this.adjustAttachmentRows.find(item => item.originKey === originKey);
|
||||
if (existing) {
|
||||
this.adjustAttachmentForm = {
|
||||
...emptyAdjustAttachmentForm(),
|
||||
...existing,
|
||||
originAttachment: existing.originAttachment || { ...row },
|
||||
originKey,
|
||||
};
|
||||
this.adjustAttachmentUploadRows = this.attachmentUrl(existing)
|
||||
? [{ ...existing }]
|
||||
: [];
|
||||
} else {
|
||||
this.adjustAttachmentForm = {
|
||||
...emptyAdjustAttachmentForm(),
|
||||
fileType: row.fileType || '',
|
||||
description: row.description || '',
|
||||
originAttachment: { ...row },
|
||||
originKey,
|
||||
};
|
||||
this.adjustAttachmentUploadRows = [];
|
||||
}
|
||||
this.adjustAttachmentBox = true;
|
||||
this.$nextTick(() => this.$refs.adjustAttachmentFormRef?.clearValidate?.());
|
||||
},
|
||||
resetAdjustAttachmentForm() {
|
||||
this.adjustAttachmentForm = emptyAdjustAttachmentForm();
|
||||
this.adjustAttachmentUploadRows = [];
|
||||
this.$refs.adjustAttachmentFormRef?.clearValidate?.();
|
||||
},
|
||||
handleAdjustAttachmentUploadChange(list) {
|
||||
const latest = Array.isArray(list) && list.length ? list[list.length - 1] : null;
|
||||
if (!latest) {
|
||||
this.adjustAttachmentForm = {
|
||||
...this.adjustAttachmentForm,
|
||||
uid: '',
|
||||
originalName: '',
|
||||
name: '',
|
||||
fileName: '',
|
||||
url: '',
|
||||
link: '',
|
||||
fileUrl: '',
|
||||
size: '',
|
||||
uploadUserName: '',
|
||||
uploadTime: '',
|
||||
};
|
||||
this.adjustAttachmentUploadRows = [];
|
||||
return;
|
||||
}
|
||||
const userName = this.userInfo?.realName || this.userInfo?.userName || '';
|
||||
const uploadTime = this.$dayjs().format('YYYY-MM-DD HH:mm:ss');
|
||||
this.adjustAttachmentForm = {
|
||||
...this.adjustAttachmentForm,
|
||||
...latest,
|
||||
fileType:
|
||||
this.adjustAttachmentForm.fileType || this.resolveAttachmentFileType(latest),
|
||||
description: this.adjustAttachmentForm.description || latest.description || '',
|
||||
uploadUserName: latest.uploadUserName || userName,
|
||||
uploadTime: latest.uploadTime || uploadTime,
|
||||
};
|
||||
this.adjustAttachmentUploadRows = [{ ...latest }];
|
||||
this.$refs.adjustAttachmentFormRef?.validateField?.('url');
|
||||
},
|
||||
confirmAdjustAttachment() {
|
||||
this.$refs.adjustAttachmentFormRef?.validate(valid => {
|
||||
if (!valid) return;
|
||||
if (!this.attachmentUrl(this.adjustAttachmentForm)) {
|
||||
this.$message.warning('请上传新材料');
|
||||
return;
|
||||
}
|
||||
const nextRow = {
|
||||
...this.adjustAttachmentForm,
|
||||
fileType: this.adjustAttachmentForm.fileType,
|
||||
description: this.adjustAttachmentForm.description || '',
|
||||
adjustReason: String(this.adjustAttachmentForm.adjustReason || '').trim(),
|
||||
originAttachment: this.adjustAttachmentForm.originAttachment
|
||||
? { ...this.adjustAttachmentForm.originAttachment }
|
||||
: null,
|
||||
originKey: this.adjustAttachmentForm.originKey,
|
||||
};
|
||||
const index = this.adjustAttachmentRows.findIndex(
|
||||
item => item.originKey === nextRow.originKey
|
||||
);
|
||||
if (index >= 0) {
|
||||
this.adjustAttachmentRows.splice(index, 1, nextRow);
|
||||
} else {
|
||||
this.adjustAttachmentRows.push(nextRow);
|
||||
}
|
||||
this.adjustAttachmentBox = false;
|
||||
this.$message.success('已加入调整材料');
|
||||
});
|
||||
},
|
||||
removeAdjustAttachment(index) {
|
||||
this.adjustAttachmentRows.splice(index, 1);
|
||||
},
|
||||
formatFileSize(size) {
|
||||
const number = Number(size);
|
||||
if (!number) return '';
|
||||
@@ -4013,24 +3718,6 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.project-apply-adjust-dialog {
|
||||
&__upload {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&__upload-empty {
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
:deep(.el-select),
|
||||
:deep(.el-input) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
.project-apply-form {
|
||||
&__grid {
|
||||
|
||||
@@ -2,40 +2,16 @@
|
||||
<div ref="page" class="mk-public-biz-view">
|
||||
<basic-container>
|
||||
<div class="mk-public-biz-view__title">{{ pageTitle }}</div>
|
||||
<template v-if="detail">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions v-if="detail" :column="2" border>
|
||||
<el-descriptions-item
|
||||
v-for="item in visibleFields"
|
||||
:key="item.prop"
|
||||
:label="item.label"
|
||||
:span="item.span || 1"
|
||||
>
|
||||
{{ fieldDisplayValue(item.prop, detail[item.prop]) }}
|
||||
{{ displayValue(detail[item.prop]) }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<section
|
||||
v-for="party in partySections"
|
||||
:key="party.role"
|
||||
class="mk-public-biz-view__party"
|
||||
>
|
||||
<div class="mk-public-biz-view__party-title">{{ party.label }}</div>
|
||||
<el-table :data="party.rows" border empty-text="暂无数据">
|
||||
<el-table-column type="index" label="序号" width="70" align="center" />
|
||||
<el-table-column prop="customerName" label="客商名称" min-width="180" align="center">
|
||||
<template #default="{ row }">{{ row.customerName || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="creditCode" label="统一信用代码" min-width="160" align="center">
|
||||
<template #default="{ row }">{{ row.creditCode || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="contactName" label="联系人" min-width="140" align="center">
|
||||
<template #default="{ row }">{{ row.contactName || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="contactPhone" label="联系电话" min-width="140" align="center">
|
||||
<template #default="{ row }">{{ row.contactPhone || '-' }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</section>
|
||||
</template>
|
||||
<el-empty v-else description="暂无数据" />
|
||||
</basic-container>
|
||||
</div>
|
||||
@@ -43,36 +19,6 @@
|
||||
|
||||
<script>
|
||||
import { getMkPublicDetail, postMkPublicProcessMessage } from '@/api/mk-process';
|
||||
import { formatSealTypes } from '@/utils/settlement-seal';
|
||||
|
||||
const createPartyRow = (row = {}) => ({
|
||||
customerId: row.customerId || '',
|
||||
customerName: row.customerName || '',
|
||||
creditCode: row.creditCode || row.unifiedCreditCode || '',
|
||||
contactId: row.contactId || '',
|
||||
contactName: row.contactName || '',
|
||||
contactPhone: row.contactPhone || '',
|
||||
});
|
||||
|
||||
const parsePartyRows = (partyJson, fallbackName) => {
|
||||
const rows = (() => {
|
||||
if (Array.isArray(partyJson)) return partyJson;
|
||||
if (!partyJson) return [];
|
||||
try {
|
||||
const data = JSON.parse(partyJson);
|
||||
return Array.isArray(data) ? data : [];
|
||||
} catch (error) {
|
||||
return [];
|
||||
}
|
||||
})().map(item => createPartyRow(item));
|
||||
if (rows.length) return rows;
|
||||
if (!fallbackName) return [];
|
||||
return String(fallbackName)
|
||||
.split(/[、,]/)
|
||||
.map(name => name.trim())
|
||||
.filter(Boolean)
|
||||
.map(name => createPartyRow({ customerName: name }));
|
||||
};
|
||||
|
||||
const FIELD_MAP = {
|
||||
'project-apply': [
|
||||
@@ -92,6 +38,8 @@ const FIELD_MAP = {
|
||||
{ label: '审核状态', prop: 'approvalStatusName' },
|
||||
{ label: '当前节点', prop: 'currentNode' },
|
||||
{ label: '当前处理人', prop: 'currentProcessor' },
|
||||
{ label: '甲方', prop: 'partyA' },
|
||||
{ label: '乙方', prop: 'partyB' },
|
||||
{ label: '项目名称', prop: 'projectName', span: 2 },
|
||||
],
|
||||
'pre-settlement': [
|
||||
@@ -99,7 +47,6 @@ const FIELD_MAP = {
|
||||
{ label: '合同名称', prop: 'contractName' },
|
||||
{ label: '项目名称', prop: 'projectName' },
|
||||
{ label: '结算金额', prop: 'settlementAmount' },
|
||||
{ label: '用印类型', prop: 'sealTypes' },
|
||||
{ label: '审核状态', prop: 'approvalStatusName' },
|
||||
{ label: '当前节点', prop: 'currentNode' },
|
||||
{ label: '当前处理人', prop: 'currentProcessor' },
|
||||
@@ -111,7 +58,6 @@ const FIELD_MAP = {
|
||||
{ label: '项目名称', prop: 'projectName' },
|
||||
{ label: '合同名称', prop: 'contractName' },
|
||||
{ label: '结算金额', prop: 'settlementAmount' },
|
||||
{ label: '用印类型', prop: 'sealTypes' },
|
||||
{ label: '审核状态', prop: 'approvalStatusName' },
|
||||
{ label: '当前节点', prop: 'currentNode' },
|
||||
{ label: '当前处理人', prop: 'currentProcessor' },
|
||||
@@ -153,26 +99,6 @@ export default {
|
||||
visibleFields() {
|
||||
return FIELD_MAP[this.bizType] || [];
|
||||
},
|
||||
partySections() {
|
||||
if (!this.detail || this.bizType !== 'contract-manage') return [];
|
||||
return [
|
||||
{
|
||||
role: 'A',
|
||||
label: '甲方',
|
||||
rows: parsePartyRows(this.detail.partyAJson, this.detail.partyA),
|
||||
},
|
||||
{
|
||||
role: 'B',
|
||||
label: '乙方',
|
||||
rows: parsePartyRows(this.detail.partyBJson, this.detail.partyB),
|
||||
},
|
||||
{
|
||||
role: 'C',
|
||||
label: '丙方',
|
||||
rows: parsePartyRows(this.detail.partyCJson, this.detail.partyC),
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.handleIframeHeight = () => this.sendIframeHeight();
|
||||
@@ -266,7 +192,6 @@ export default {
|
||||
id: this.getFormId() || detail.id,
|
||||
subject: this.pageTitle,
|
||||
formInstanceId: this.getFormId(),
|
||||
sealTypes: formatSealTypes(detail.sealTypes) || detail.sealTypes || '',
|
||||
};
|
||||
},
|
||||
getFormId() {
|
||||
@@ -280,12 +205,6 @@ export default {
|
||||
''
|
||||
);
|
||||
},
|
||||
fieldDisplayValue(prop, value) {
|
||||
if (prop === 'sealTypes') {
|
||||
return formatSealTypes(value) || '-';
|
||||
}
|
||||
return this.displayValue(value);
|
||||
},
|
||||
displayValue(value) {
|
||||
if (value === null || value === undefined || value === '') return '-';
|
||||
if (Array.isArray(value)) return value.join('、') || '-';
|
||||
@@ -336,33 +255,5 @@ html.mk-iframe-page #app.mk-iframe-page {
|
||||
background: #409eff;
|
||||
}
|
||||
}
|
||||
|
||||
&__party {
|
||||
margin-top: 16px;
|
||||
padding: 14px 16px 16px;
|
||||
background: #fff;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
&__party-title {
|
||||
position: relative;
|
||||
padding-left: 12px;
|
||||
margin-bottom: 12px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
line-height: 22px;
|
||||
color: #303133;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 2px;
|
||||
width: 4px;
|
||||
height: 18px;
|
||||
background: #409eff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -86,6 +86,27 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="项目利润率">
|
||||
<el-input
|
||||
:model-value="profitRatePercent"
|
||||
:disabled="readonly"
|
||||
placeholder="选结算单后自动带出,可修改"
|
||||
@input="handleProfitRateInput"
|
||||
>
|
||||
<template #append>%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="暂估成本(不含税)">
|
||||
<el-input
|
||||
:model-value="estimatedCost > 0 ? formatMoney(estimatedCost) : ''"
|
||||
disabled
|
||||
placeholder="开票不含税金额合计×项目利润率"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="部门邮箱" prop="departmentEmails">
|
||||
<el-select
|
||||
@@ -326,12 +347,18 @@
|
||||
<el-table-column label="结算总金额" min-width="140" align="right">
|
||||
<template #default="{ row }">{{ formatMoney(row.settlementAmount) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="历史累计开票金额" min-width="150" align="right">
|
||||
<template #default="{ row }">{{ formatMoney(row.historyInvoicedAmount) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="本次开票金额" min-width="140" align="right">
|
||||
<template #default="{ row }">{{ formatMoney(row.allocatedInvoiceAmount) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="剩余未开票金额" min-width="150" align="right">
|
||||
<template #default="{ row }">{{ formatMoney(row.remainingUninvoicedAmount) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="可开票金额" min-width="140" align="right">
|
||||
<template #default="{ row }">{{ formatMoney(row.availableInvoiceAmount) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="分摊发票金额" min-width="140" align="right">
|
||||
<template #default="{ row }">{{ formatMoney(row.allocatedInvoiceAmount) }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</section-card>
|
||||
|
||||
@@ -385,6 +412,10 @@
|
||||
</el-table>
|
||||
</section-card>
|
||||
|
||||
<section-card v-if="recordId" title="发票冲销明细">
|
||||
<invoice-write-off-table biz-type="invoice_apply" :biz-id="recordId" />
|
||||
</section-card>
|
||||
|
||||
<section-card title="附件信息">
|
||||
<vehicle-attachment-table v-model="form.attachments" :readonly="readonly" />
|
||||
</section-card>
|
||||
@@ -491,6 +522,7 @@ import { getList as getReceivablePayableDetailList } from '@/api/settlement/rece
|
||||
import { getDictionary } from '@/api/system/dictbiz';
|
||||
import { invoiceApplicationDetailColumns } from '@/option/payment/invoiceApplication';
|
||||
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
|
||||
import InvoiceWriteOffTable from '@/components/invoice-write-off-table/main.vue';
|
||||
import { getMkPublicDetail } from '@/api/mk-process';
|
||||
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
|
||||
@@ -538,12 +570,15 @@ const emptyForm = () => ({
|
||||
sheets: [emptySheet()],
|
||||
attachments: [],
|
||||
remark: '',
|
||||
// 项目利润率(小数,如0.04表示4%;保存时后端快照并重算暂估成本)
|
||||
profitRate: null,
|
||||
});
|
||||
|
||||
export default {
|
||||
name: 'InvoiceApplicationForm',
|
||||
components: {
|
||||
VehicleAttachmentTable,
|
||||
InvoiceWriteOffTable,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -621,6 +656,24 @@ export default {
|
||||
0
|
||||
);
|
||||
},
|
||||
// 项目利润率百分数展示/输入(后端存小数:0.04 ↔ 4)
|
||||
profitRatePercent() {
|
||||
const rate = Number(this.form.profitRate);
|
||||
if (!Number.isFinite(rate) || rate <= 0) return '';
|
||||
return String(Math.round(rate * 10000) / 100);
|
||||
},
|
||||
// 暂估成本 = 开票不含税金额合计 × 项目利润率(实时计算,后端保存时重算覆盖)
|
||||
estimatedCost() {
|
||||
const rate = Number(this.form.profitRate);
|
||||
if (!Number.isFinite(rate) || rate <= 0) return 0;
|
||||
const amountNoTaxTotal = this.form.sheets.reduce(
|
||||
(sheetTotal, sheet) =>
|
||||
sheetTotal +
|
||||
sheet.lines.reduce((lineTotal, line) => lineTotal + Number(line.amountNoTax || 0), 0),
|
||||
0
|
||||
);
|
||||
return amountNoTaxTotal * rate;
|
||||
},
|
||||
detailColumns() {
|
||||
return [...this.detailBaseColumns, ...this.feeItemColumns];
|
||||
},
|
||||
@@ -732,6 +785,13 @@ export default {
|
||||
this.transportTypeOptions.find(item => String(item.value) === String(value))?.label || value
|
||||
);
|
||||
},
|
||||
// 项目利润率输入(百分数),转小数存储:4 → 0.04
|
||||
handleProfitRateInput(value) {
|
||||
let normalized = String(value || '').replace(/[^\d.]/g, '');
|
||||
normalized = normalized.replace(/(\..*)\./g, '$1');
|
||||
const percent = Number(normalized);
|
||||
this.form.profitRate = Number.isFinite(percent) && percent > 0 ? percent / 100 : null;
|
||||
},
|
||||
invoiceItemNames(categoryName) {
|
||||
return this.invoiceItems.filter(item => item.categoryName === categoryName);
|
||||
},
|
||||
@@ -1173,6 +1233,7 @@ export default {
|
||||
contactName: this.form.contactName,
|
||||
contactPhone: this.form.contactPhone,
|
||||
email: this.form.email,
|
||||
profitRate: Number(this.form.profitRate) > 0 ? Number(this.form.profitRate) : null,
|
||||
attachmentsJson: JSON.stringify(this.form.attachments || []),
|
||||
remark: this.form.remark,
|
||||
settlements: this.form.settlements.map(item => ({
|
||||
|
||||
@@ -128,7 +128,12 @@
|
||||
</section-card>
|
||||
|
||||
<section-card title="发票明细">
|
||||
<el-table :data="invoiceItems" border empty-text="选择金蝶票据池发票后带出发票明细行">
|
||||
<template #extra>
|
||||
<el-button size="small" type="primary" :loading="invoiceDetailLoading" :disabled="!form.invoiceNo" @click="reloadInvoiceDetail">
|
||||
查询明细
|
||||
</el-button>
|
||||
</template>
|
||||
<el-table v-loading="invoiceDetailLoading" :data="invoiceItems" border empty-text="选择金蝶票据池发票后带出发票明细行">
|
||||
<el-table-column type="index" label="序号" width="64" align="center" />
|
||||
<el-table-column prop="goodsName" label="货物名称" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="specModel" label="规格型号" min-width="120" show-overflow-tooltip />
|
||||
@@ -179,6 +184,10 @@
|
||||
</el-table>
|
||||
</section-card>
|
||||
|
||||
<section-card v-if="recordId" title="发票冲销明细">
|
||||
<invoice-write-off-table biz-type="receipt" :biz-id="recordId" />
|
||||
</section-card>
|
||||
|
||||
<section-card title="附件信息">
|
||||
<!-- 金蝶票池认领的发票附件为 piaozone path 型,需带发票号走 A801-2 代理查看/下载 -->
|
||||
<vehicle-attachment-table
|
||||
@@ -276,6 +285,7 @@ import * as api from '@/api/payment/invoiceReceipt';
|
||||
import { getList as getContractList } from '@/api/business/contract-manage';
|
||||
import KingdeeInvoicePoolDialog from '@/components/kingdee-invoice-pool-dialog/main.vue';
|
||||
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
|
||||
import InvoiceWriteOffTable from '@/components/invoice-write-off-table/main.vue';
|
||||
import { getMkPublicDetail } from '@/api/mk-process';
|
||||
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
|
||||
@@ -315,6 +325,7 @@ export default {
|
||||
components: {
|
||||
KingdeeInvoicePoolDialog,
|
||||
VehicleAttachmentTable,
|
||||
InvoiceWriteOffTable,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -323,6 +334,7 @@ export default {
|
||||
customerEmailOptions: [],
|
||||
departmentEmailOptions: [],
|
||||
invoiceItems: [],
|
||||
invoiceDetailLoading: false,
|
||||
contractDialog: {
|
||||
visible: false,
|
||||
loading: false,
|
||||
@@ -504,6 +516,18 @@ export default {
|
||||
this.invoiceItems = [];
|
||||
}
|
||||
},
|
||||
// 手动按发票号查询金蝶发票明细(历史单据无缓存明细时点击刷新)
|
||||
async reloadInvoiceDetail() {
|
||||
this.invoiceDetailLoading = true;
|
||||
try {
|
||||
this.invoiceItems = this.unwrapData(await api.invoiceDetailQuery(this.form.invoiceNo)) || [];
|
||||
if (!this.invoiceItems.length) this.$message.info('未查询到该发票的明细行');
|
||||
} catch {
|
||||
this.$message.error('查询金蝶发票明细失败');
|
||||
} finally {
|
||||
this.invoiceDetailLoading = false;
|
||||
}
|
||||
},
|
||||
// 所属合同=承运商合同:选择后带出承办部门(结算组织=承办部门对应平台公司金蝶编码,后端派生)
|
||||
openContractDialog() {
|
||||
this.contractDialog.visible = true;
|
||||
|
||||
@@ -119,6 +119,9 @@
|
||||
<el-tag v-else-if="column.status" :type="statusType(row.approvalStatus)" class="status-text">
|
||||
{{ displayValue(row[column.prop]) }}
|
||||
</el-tag>
|
||||
<el-tag v-else-if="column.kingdeeStatus" :type="kingdeePushStatusType(row.kingdeePushStatus)">
|
||||
{{ displayValue(row[column.prop]) }}
|
||||
</el-tag>
|
||||
<span v-else-if="column.money">{{ formatMoney(row[column.prop]) }}</span>
|
||||
<span v-else>{{ displayValue(row[column.prop]) }}</span>
|
||||
</template>
|
||||
@@ -222,6 +225,7 @@ import TableHeaderTools from '@/components/table-header-tools/main.vue';
|
||||
import organizationSearch from '@/mixins/organization-search';
|
||||
import { getMKApprovalUrl } from '@/api/system/business-process';
|
||||
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
import { kingdeePushStatusType } from '@/utils/kingdee';
|
||||
|
||||
// 表单提交成功后带标记返回,keep-alive 缓存的列表页据此重新拉取
|
||||
const invoiceReceiptListRefreshKey = 'invoice-receipt-list-refresh';
|
||||
@@ -480,6 +484,7 @@ export default {
|
||||
''
|
||||
);
|
||||
},
|
||||
kingdeePushStatusType,
|
||||
displayValue(value) {
|
||||
return value === null || value === undefined || value === '' ? '-' : value;
|
||||
},
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<template>
|
||||
<basic-container>
|
||||
<section-card title="发票冲销明细">
|
||||
<invoice-write-off-table :biz-type="bizType" :biz-id="bizId" />
|
||||
</section-card>
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import InvoiceWriteOffTable from '@/components/invoice-write-off-table/main.vue';
|
||||
|
||||
/**
|
||||
* 发票冲销明细独立页(不挂菜单,供其他页面 $router 跳转引用)
|
||||
* 用法:$router.push({ path: '/payment/invoice-write-off', query: { bizType: 'invoice_apply', bizId: id } })
|
||||
*/
|
||||
export default {
|
||||
name: 'InvoiceWriteOff',
|
||||
components: { InvoiceWriteOffTable },
|
||||
computed: {
|
||||
bizType() {
|
||||
return String(this.$route.query.bizType || 'invoice_apply');
|
||||
},
|
||||
bizId() {
|
||||
return this.$route.query.bizId || null;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -316,6 +316,13 @@
|
||||
<el-table-column label="匹配金额(含税)" min-width="150">
|
||||
<template #default="{ row }">{{ formatMoney(row.matchedAmount) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="冲销状态" width="110" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.writeOffStatus === 'finished'" type="success">已完成</el-tag>
|
||||
<el-tag v-else-if="row.invoiceNo" type="warning">未完成</el-tag>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="220" fixed="right" align="center">
|
||||
<template #default="{ row, $index }">
|
||||
<div class="payment-form-page__invoice-actions">
|
||||
@@ -343,6 +350,9 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</section-card>
|
||||
<section-card v-if="recordId" title="发票冲销明细">
|
||||
<invoice-write-off-table biz-type="payment_receipt" :biz-id="recordId" />
|
||||
</section-card>
|
||||
<section-card title="付款记录">
|
||||
<el-table :data="paymentRecords" border
|
||||
><el-table-column type="index" label="序号" width="70" /><el-table-column
|
||||
@@ -354,11 +364,23 @@
|
||||
><el-table-column prop="paidDate" label="付款日期" min-width="150" /><el-table-column
|
||||
prop="paymentNo"
|
||||
label="付款单号"
|
||||
min-width="160" /><el-table-column
|
||||
prop="kingdeeBillNo"
|
||||
label="付款凭证"
|
||||
min-width="160"
|
||||
/></el-table>
|
||||
min-width="160" /><el-table-column label="付款凭证" min-width="160"
|
||||
><template #default="{ row }"
|
||||
><div v-if="row.voucherFileName" class="payment-form-page__invoice-actions"
|
||||
><el-link
|
||||
type="primary"
|
||||
:disabled="kingdeeAttachmentBusy"
|
||||
@click="viewRecordVoucher(row)"
|
||||
>查看</el-link
|
||||
><el-link
|
||||
type="primary"
|
||||
:disabled="kingdeeAttachmentBusy"
|
||||
@click="downloadRecordVoucher(row)"
|
||||
>下载</el-link
|
||||
></div
|
||||
><span v-else>-</span></template
|
||||
></el-table-column
|
||||
></el-table>
|
||||
</section-card>
|
||||
<section-card>
|
||||
<template #title>
|
||||
@@ -733,14 +755,15 @@ import {
|
||||
} from '@/api/vehicle/customer-archive';
|
||||
import { readSettlementTransfer, removeSettlementTransfer } from '@/utils/settlement-transfer';
|
||||
import { formatContractOptionLabel } from '@/utils/contract';
|
||||
import { downloadFileByUrl } from '@/utils/util';
|
||||
import { downloadFile, downloadFileByUrl } from '@/utils/util';
|
||||
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
import {
|
||||
downloadKingdeeInvoiceFile,
|
||||
isKingdeePathAttachment,
|
||||
viewKingdeeInvoiceFile,
|
||||
downloadKingdeeFile,
|
||||
requestKingdeeFile,
|
||||
viewKingdeeFile,
|
||||
} from '@/utils/kingdee-attachment';
|
||||
import PdfPreview from '@/components/pdf-preview/main.vue';
|
||||
import InvoiceWriteOffTable from '@/components/invoice-write-off-table/main.vue';
|
||||
|
||||
const attachmentViewerPlugins = [
|
||||
imagePlugin(),
|
||||
@@ -817,6 +840,7 @@ export default {
|
||||
ElImageViewer,
|
||||
OpenFileViewer,
|
||||
PdfPreview,
|
||||
InvoiceWriteOffTable,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -1899,55 +1923,80 @@ export default {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
invoiceAttachmentUrl(row) {
|
||||
return this.attachmentFileUrl(this.invoiceAttachment(row));
|
||||
},
|
||||
invoiceAttachmentName(row) {
|
||||
return (
|
||||
this.attachmentFileName(this.invoiceAttachment(row)) || `${row.invoiceNo || '发票'}.pdf`
|
||||
);
|
||||
},
|
||||
async viewInvoiceAttachment(row) {
|
||||
const attachment = this.invoiceAttachment(row);
|
||||
// 金蝶侧附件(path 型)经后端代理 A801-2 预览,OSS 直链维持本地预览组件
|
||||
if (isKingdeePathAttachment(attachment)) {
|
||||
/** 金蝶附件查看/下载互斥闸门(A801-2 拉流较慢,进行中忽略重复点击,结束自动释放) */
|
||||
async withKingdeeAttachmentBusy(action) {
|
||||
if (this.kingdeeAttachmentBusy) return;
|
||||
this.kingdeeAttachmentBusy = true;
|
||||
try {
|
||||
await viewKingdeeInvoiceFile(row.invoiceNo, this.invoiceAttachmentName(row));
|
||||
await action();
|
||||
} finally {
|
||||
this.kingdeeAttachmentBusy = false;
|
||||
}
|
||||
},
|
||||
async viewInvoiceAttachment(row) {
|
||||
await this.withKingdeeAttachmentBusy(async () => {
|
||||
// 发票版式文件按票号走金蝶票池(A801-2 镜像优先/实时回源),登记扫描件仅在票池无此票时兜底
|
||||
try {
|
||||
const blob = await requestKingdeeFile(row.invoiceNo);
|
||||
const url = URL.createObjectURL(blob);
|
||||
window.open(url, '_blank');
|
||||
// 延迟释放 objectURL:立即回收可能导致新窗口尚未加载完成即失效
|
||||
setTimeout(() => URL.revokeObjectURL(url), 60000);
|
||||
return;
|
||||
} catch (error) {
|
||||
// 网络级失败(silent,拦截器已提示)不再回退;票池无此票回退登记附件
|
||||
if (error?.silent) return;
|
||||
}
|
||||
const attachment = this.invoiceAttachment(row);
|
||||
if (!this.attachmentFileUrl(attachment)) {
|
||||
this.$message.warning('当前发票暂无可查看附件');
|
||||
this.$message.warning('当前发票没有金蝶版式文件,也没有登记附件');
|
||||
return;
|
||||
}
|
||||
this.previewAttachment(
|
||||
{ ...attachment, name: this.invoiceAttachmentName(row) },
|
||||
[attachment]
|
||||
);
|
||||
});
|
||||
},
|
||||
async downloadInvoiceAttachment(row) {
|
||||
const attachment = this.invoiceAttachment(row);
|
||||
// 金蝶侧附件(path 型)经后端代理 A801-2 下载,OSS 直链维持前端直连下载
|
||||
if (isKingdeePathAttachment(attachment)) {
|
||||
if (this.kingdeeAttachmentBusy) return;
|
||||
this.kingdeeAttachmentBusy = true;
|
||||
await this.withKingdeeAttachmentBusy(async () => {
|
||||
try {
|
||||
await downloadKingdeeInvoiceFile(row.invoiceNo, this.invoiceAttachmentName(row));
|
||||
} finally {
|
||||
this.kingdeeAttachmentBusy = false;
|
||||
}
|
||||
const blob = await requestKingdeeFile(row.invoiceNo);
|
||||
downloadFile(blob, this.invoiceAttachmentName(row));
|
||||
return;
|
||||
} catch (error) {
|
||||
if (error?.silent) return;
|
||||
}
|
||||
const attachment = this.invoiceAttachment(row);
|
||||
const url = this.attachmentFileUrl(attachment);
|
||||
if (!url) {
|
||||
this.$message.warning('当前发票暂无可下载附件');
|
||||
this.$message.warning('当前发票没有金蝶版式文件,也没有登记附件');
|
||||
return;
|
||||
}
|
||||
downloadFileByUrl(url, this.invoiceAttachmentName(row));
|
||||
});
|
||||
},
|
||||
/** 付款记录付款凭证(金蝶电子回单,A801-2 代理):查看=新窗口预览,下载=保存文件 */
|
||||
viewRecordVoucher(row) {
|
||||
return this.withKingdeeAttachmentBusy(() =>
|
||||
viewKingdeeFile(
|
||||
() => api.downloadRecordVoucher(row.id),
|
||||
`${row.paymentNo || '付款记录'}-付款凭证.pdf`
|
||||
)
|
||||
);
|
||||
},
|
||||
downloadRecordVoucher(row) {
|
||||
return this.withKingdeeAttachmentBusy(() =>
|
||||
downloadKingdeeFile(
|
||||
() => api.downloadRecordVoucher(row.id),
|
||||
`${row.paymentNo || '付款记录'}-付款凭证.pdf`
|
||||
)
|
||||
);
|
||||
},
|
||||
attachmentFileName(file) {
|
||||
return String(file?.originalName || file?.name || file?.fileName || '').trim();
|
||||
|
||||
@@ -78,22 +78,6 @@
|
||||
:value="item.dictKey"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-else-if="field.type === 'multi-select' && editable"
|
||||
v-model="form[field.prop]"
|
||||
multiple
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in formSelectOptions(field)"
|
||||
:key="item.dictKey"
|
||||
:label="item.dictValue"
|
||||
:value="item.dictKey"
|
||||
/>
|
||||
</el-select>
|
||||
<span
|
||||
v-else-if="field.prop === 'formalSettlementNo'"
|
||||
:class="{ 'form-readonly--code': form.formalSettlementNo }"
|
||||
@@ -101,7 +85,7 @@
|
||||
{{ form.formalSettlementNo || (form.id ? '-' : '系统自动生成') }}
|
||||
</span>
|
||||
<span v-else-if="field.money">{{ formatMoney(form[field.prop]) }}</span>
|
||||
<span v-else-if="field.type === 'select' || field.type === 'multi-select'">{{
|
||||
<span v-else-if="field.type === 'select'">{{
|
||||
formSelectLabel(field, form[field.prop])
|
||||
}}</span>
|
||||
<span v-else-if="field.type === 'contract'">{{
|
||||
@@ -1149,22 +1133,13 @@ import {
|
||||
settlementRecordTypeName,
|
||||
settlementStatusName,
|
||||
} from '@/utils/settlementStatus';
|
||||
import { downloadFileByUrl } from '@/utils/util';
|
||||
import {
|
||||
downloadKingdeeInvoiceFile,
|
||||
isKingdeePathAttachment,
|
||||
viewKingdeeInvoiceFile,
|
||||
} from '@/utils/kingdee-attachment';
|
||||
import { downloadFile, downloadFileByUrl } from '@/utils/util';
|
||||
import { requestKingdeeFile } from '@/utils/kingdee-attachment';
|
||||
import KingdeeInvoicePoolDialog from '@/components/kingdee-invoice-pool-dialog/main.vue';
|
||||
import ChangeRecordDetailDialog from '@/components/change-record-detail-dialog/main.vue';
|
||||
import ProjectAdvanceWriteOff from './project-advance-write-off.vue';
|
||||
import * as XLSX from 'xlsx';
|
||||
import { isAdministrator } from '@/utils/auth';
|
||||
import {
|
||||
formatSealTypes,
|
||||
parseSealTypes,
|
||||
SETTLEMENT_SEAL_TYPE_OPTIONS,
|
||||
} from '@/utils/settlement-seal';
|
||||
import * as settlementAdjustmentApi from '@/api/settlement/settlementAdjustment';
|
||||
|
||||
// 结算币种为本位币(人民币)时汇率恒为1,汇率日期、结算汇率与按汇率换算的本位币合计都不展示
|
||||
@@ -1256,7 +1231,6 @@ export default {
|
||||
feeCategoryOptions: [],
|
||||
businessModelOptions: [],
|
||||
transportTypeOptions: [],
|
||||
sealTypeOptions: SETTLEMENT_SEAL_TYPE_OPTIONS,
|
||||
fields: formalSettlementFormFields,
|
||||
sourceTableColumns: sourceColumns,
|
||||
summaryTableColumns: summaryColumns,
|
||||
@@ -1520,7 +1494,6 @@ export default {
|
||||
this.form = {
|
||||
...createFormalSettlementForm(),
|
||||
...data,
|
||||
sealTypes: parseSealTypes(data.sealTypes),
|
||||
sourcePreSettlementIds: (data.sources || []).map(item => item.preSettlementId),
|
||||
sourceDetailIds: (data.details || [])
|
||||
.filter(item => !item.sourcePreSettlementId)
|
||||
@@ -1725,7 +1698,6 @@ export default {
|
||||
contractId,
|
||||
settlementType,
|
||||
settlementTypeName: settlementType === 'receivable' ? '应收' : '应付',
|
||||
sealTypes: parseSealTypes(first.sealTypes),
|
||||
sourcePreSettlementIds: this.form.sourcePreSettlementIds,
|
||||
});
|
||||
const responses = await Promise.all(
|
||||
@@ -1968,7 +1940,6 @@ export default {
|
||||
Object.assign(this.form, this.sources[0], {
|
||||
contractId: this.sources[0].contractId,
|
||||
formalSettlementNo: this.form.formalSettlementNo,
|
||||
sealTypes: parseSealTypes(this.sources[0].sealTypes),
|
||||
});
|
||||
this.refreshFormalSettlementNo();
|
||||
}
|
||||
@@ -2943,38 +2914,45 @@ export default {
|
||||
return attachment.originalName || attachment.name || `${row.invoiceNo || '发票'}.pdf`;
|
||||
},
|
||||
async viewInvoiceAttachment(row) {
|
||||
const attachment = this.invoiceAttachment(row);
|
||||
// 金蝶侧附件(path 型)经后端代理 A801-2 预览,OSS 直链维持 window.open
|
||||
if (isKingdeePathAttachment(attachment)) {
|
||||
if (this.kingdeeAttachmentBusy) return;
|
||||
this.kingdeeAttachmentBusy = true;
|
||||
try {
|
||||
await viewKingdeeInvoiceFile(row.invoiceNo, this.invoiceAttachmentName(row));
|
||||
// 发票版式文件按票号走金蝶票池(A801-2 镜像优先/实时回源),登记扫描件仅在票池无此票时兜底
|
||||
try {
|
||||
const blob = await requestKingdeeFile(row.invoiceNo);
|
||||
const url = URL.createObjectURL(blob);
|
||||
window.open(url, '_blank');
|
||||
// 延迟释放 objectURL:立即回收可能导致新窗口尚未加载完成即失效
|
||||
setTimeout(() => URL.revokeObjectURL(url), 60000);
|
||||
return;
|
||||
} catch (error) {
|
||||
// 网络级失败(silent,拦截器已提示)不再回退;票池无此票回退登记附件
|
||||
if (error?.silent) return;
|
||||
}
|
||||
const url = this.invoiceAttachmentUrl(row);
|
||||
if (!url) return this.$message.warning('当前发票没有金蝶版式文件,也没有登记附件');
|
||||
window.open(url, '_blank');
|
||||
} finally {
|
||||
this.kingdeeAttachmentBusy = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
const url = this.invoiceAttachmentUrl(row);
|
||||
if (!url) return this.$message.warning('当前发票暂无可查看附件');
|
||||
window.open(url, '_blank');
|
||||
},
|
||||
async downloadInvoiceAttachment(row) {
|
||||
const attachment = this.invoiceAttachment(row);
|
||||
// 金蝶侧附件(path 型)经后端代理 A801-2 下载,OSS 直链维持前端直连下载
|
||||
if (isKingdeePathAttachment(attachment)) {
|
||||
if (this.kingdeeAttachmentBusy) return;
|
||||
this.kingdeeAttachmentBusy = true;
|
||||
try {
|
||||
await downloadKingdeeInvoiceFile(row.invoiceNo, this.invoiceAttachmentName(row));
|
||||
try {
|
||||
const blob = await requestKingdeeFile(row.invoiceNo);
|
||||
downloadFile(blob, this.invoiceAttachmentName(row));
|
||||
return;
|
||||
} catch (error) {
|
||||
if (error?.silent) return;
|
||||
}
|
||||
const url = this.invoiceAttachmentUrl(row);
|
||||
if (!url) return this.$message.warning('当前发票没有金蝶版式文件,也没有登记附件');
|
||||
downloadFileByUrl(url, this.invoiceAttachmentName(row));
|
||||
} finally {
|
||||
this.kingdeeAttachmentBusy = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
const url = this.invoiceAttachmentUrl(row);
|
||||
if (!url) return this.$message.warning('当前发票暂无可下载附件');
|
||||
downloadFileByUrl(url, this.invoiceAttachmentName(row));
|
||||
},
|
||||
// 开票发票预览地址:数电PDF优先(OFD浏览器无法预览),退预览图、板式文件
|
||||
issuedInvoicePreviewUrl(row) {
|
||||
@@ -3018,7 +2996,6 @@ export default {
|
||||
})),
|
||||
businessModel: this.form.businessModel || undefined,
|
||||
transportType: this.form.transportType || undefined,
|
||||
sealTypes: formatSealTypes(this.form.sealTypes) || undefined,
|
||||
exchangeRateDate: this.form.exchangeRateDate,
|
||||
exchangeRate: this.form.exchangeRate,
|
||||
summaryFees: this.summaryFees
|
||||
@@ -3231,9 +3208,6 @@ export default {
|
||||
return Array.isArray(options) ? options : [];
|
||||
},
|
||||
formSelectLabel(field, value) {
|
||||
if (field?.type === 'multi-select') {
|
||||
return formatSealTypes(value) || '-';
|
||||
}
|
||||
if (value === undefined || value === null || value === '') return '-';
|
||||
const normalized = String(value).trim();
|
||||
const option = this.formSelectOptions(field).find(
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
|
||||
<script>
|
||||
import { claimCandidates } from '@/api/payment/invoiceReceipt';
|
||||
import { kingdeePushStatusType } from '@/utils/kingdee';
|
||||
|
||||
export default {
|
||||
name: 'InvoiceReceiptCandidatesDialog',
|
||||
@@ -152,7 +153,7 @@ export default {
|
||||
);
|
||||
},
|
||||
pushStatusType(value) {
|
||||
return { pushed: 'warning', assigned: 'success', failed: 'danger', unsynced: 'info' }[value] || 'info';
|
||||
return kingdeePushStatusType(value);
|
||||
},
|
||||
formatMoney(value) {
|
||||
const number = Number(value);
|
||||
|
||||
@@ -67,26 +67,7 @@
|
||||
:value="item.dictKey"
|
||||
/>
|
||||
</el-select>
|
||||
<el-select
|
||||
v-else-if="field.type === 'multi-select' && editable"
|
||||
v-model="form[field.prop]"
|
||||
multiple
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in formSelectOptions(field)"
|
||||
:key="item.dictKey"
|
||||
:label="item.dictValue"
|
||||
:value="item.dictKey"
|
||||
/>
|
||||
</el-select>
|
||||
<span
|
||||
v-else-if="field.type === 'select' || field.type === 'multi-select'"
|
||||
class="form-readonly"
|
||||
>
|
||||
<span v-else-if="field.type === 'select'" class="form-readonly">
|
||||
{{ formSelectLabel(field, form[field.prop]) }}
|
||||
</span>
|
||||
<el-input
|
||||
@@ -1044,11 +1025,6 @@ import { downloadFileByUrl } from '@/utils/util';
|
||||
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
import * as XLSX from 'xlsx';
|
||||
import { isAdministrator } from '@/utils/auth';
|
||||
import {
|
||||
formatSealTypes,
|
||||
parseSealTypes,
|
||||
SETTLEMENT_SEAL_TYPE_OPTIONS,
|
||||
} from '@/utils/settlement-seal';
|
||||
|
||||
// 结算币种为本位币(人民币)时汇率恒为1,汇率日期、结算汇率与按汇率换算的本位币合计都不展示
|
||||
const LOCAL_CURRENCY_HIDDEN_FIELDS = ['exchangeRateDate', 'exchangeRate', 'localSettlementAmount'];
|
||||
@@ -1141,7 +1117,6 @@ export default {
|
||||
feeCategoryOptions: [],
|
||||
businessModelOptions: [],
|
||||
transportTypeOptions: [],
|
||||
sealTypeOptions: SETTLEMENT_SEAL_TYPE_OPTIONS,
|
||||
summaryFees: [],
|
||||
details: [],
|
||||
detailCollapsed: false,
|
||||
@@ -1578,11 +1553,7 @@ export default {
|
||||
? await getMkPublicDetail('pre-settlement', this.form.id || this.recordId)
|
||||
: await getDetail(this.form.id || this.recordId);
|
||||
const detail = response.data?.data || {};
|
||||
this.form = {
|
||||
...emptyPreSettlementForm(),
|
||||
...detail,
|
||||
sealTypes: parseSealTypes(detail.sealTypes),
|
||||
};
|
||||
this.form = { ...emptyPreSettlementForm(), ...detail };
|
||||
this.summaryFees = (detail.summaryFees || []).map(row => ({ ...row }));
|
||||
this.details = (detail.details || []).map(row => this.normalizeSourceDetail(row));
|
||||
this.detailPage.current = 1;
|
||||
@@ -1746,9 +1717,6 @@ export default {
|
||||
return Array.isArray(options) ? options : [];
|
||||
},
|
||||
formSelectLabel(field, value) {
|
||||
if (field?.type === 'multi-select') {
|
||||
return formatSealTypes(value) || '-';
|
||||
}
|
||||
if (value === undefined || value === null || value === '') return '-';
|
||||
const normalized = String(value).trim();
|
||||
const option = this.formSelectOptions(field).find(
|
||||
@@ -1974,9 +1942,6 @@ export default {
|
||||
subjectName: this.form.preSettlementNo || this.form.contractName || '',
|
||||
approvalStatus: previousApprovalStatus,
|
||||
mkEnabled: await loadMkEnabled().catch(() => false),
|
||||
tempVarData: {
|
||||
sealTypes: formatSealTypes(this.form.sealTypes) || '',
|
||||
},
|
||||
});
|
||||
this.$message.success(mkStarted ? '审批流程已发起' : '提交成功');
|
||||
this.visible = false;
|
||||
@@ -1996,7 +1961,6 @@ export default {
|
||||
contractId: this.form.contractId,
|
||||
businessModel: this.form.businessModel || undefined,
|
||||
transportType: this.form.transportType || undefined,
|
||||
sealTypes: formatSealTypes(this.form.sealTypes) || undefined,
|
||||
exchangeRateDate: this.form.exchangeRateDate || undefined,
|
||||
exchangeRate: this.form.exchangeRate,
|
||||
attachmentsJson: JSON.stringify(this.attachments || []),
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
<script>
|
||||
import MkPublicShell from '@/views/mk/mk-public-shell.vue';
|
||||
import FormalSettlementEditor from '@/views/settlement/components/formal-settlement-editor.vue';
|
||||
import { formatSealTypes } from '@/utils/settlement-seal';
|
||||
|
||||
export default {
|
||||
name: 'FormalSettlementPublicView',
|
||||
@@ -30,11 +29,7 @@ export default {
|
||||
methods: {
|
||||
getForm() {
|
||||
const form = this.$refs.page?.form || {};
|
||||
return {
|
||||
...form,
|
||||
sealTypes: formatSealTypes(form.sealTypes) || '',
|
||||
subject: form.formalSettlementNo || form.contractName || '',
|
||||
};
|
||||
return { ...form, subject: form.formalSettlementNo || form.contractName || '' };
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -145,10 +145,10 @@
|
||||
<el-descriptions-item label="创建时间">
|
||||
{{ invoiceRegisterDialog.row.createTime || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="金蝶同步状态" :span="2">
|
||||
<el-descriptions-item label="金蝶同步状态">
|
||||
{{ kingdeeSyncName(invoiceRegisterDialog.row.kingdeeSyncStatus) }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" :span="2">
|
||||
<el-descriptions-item label="备注">
|
||||
{{ invoiceRegisterDialog.row.remark || '-' }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
@@ -240,7 +240,6 @@ import FormalSettlementTablePanel from './components/formal-settlement-table-pan
|
||||
import InvoiceReceiptCandidatesDialog from './components/invoice-receipt-candidates-dialog.vue';
|
||||
import { submitMkApprovalFlow, loadMkEnabled } from '@/utils/mk-approval';
|
||||
import { getMKApprovalUrl } from '@/api/system/business-process';
|
||||
import { formatSealTypes } from '@/utils/settlement-seal';
|
||||
|
||||
export default {
|
||||
name: 'FormalSettlement',
|
||||
@@ -508,9 +507,6 @@ export default {
|
||||
subjectName: row.formalSettlementNo || '',
|
||||
approvalStatus: previousApprovalStatus,
|
||||
mkEnabled: this.mkEnabled,
|
||||
tempVarData: {
|
||||
sealTypes: formatSealTypes(row.sealTypes) || '',
|
||||
},
|
||||
});
|
||||
this.$message.success('提交成功');
|
||||
this.onLoad(this.page);
|
||||
@@ -851,6 +847,10 @@ export default {
|
||||
settlementTypeName(value) {
|
||||
return { payable: '付款', receivable: '收款' }[value] || '-';
|
||||
},
|
||||
// 模板无法直接访问 script 顶部 import,包装成实例方法(与 formal-settlement-table-panel 同模式)
|
||||
kingdeeSyncName(value) {
|
||||
return kingdeeSyncName(value);
|
||||
},
|
||||
unwrapData(response) {
|
||||
const body = response?.data || response || {};
|
||||
return body?.data || body;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
<script>
|
||||
import MkPublicShell from '@/views/mk/mk-public-shell.vue';
|
||||
import PreSettlementEditor from '@/views/settlement/components/pre-settlement-editor.vue';
|
||||
import { formatSealTypes } from '@/utils/settlement-seal';
|
||||
|
||||
export default {
|
||||
name: 'PreSettlementPublicView',
|
||||
@@ -30,11 +29,7 @@ export default {
|
||||
methods: {
|
||||
getForm() {
|
||||
const form = this.$refs.page?.form || {};
|
||||
return {
|
||||
...form,
|
||||
sealTypes: formatSealTypes(form.sealTypes) || '',
|
||||
subject: form.preSettlementNo || form.contractName || '',
|
||||
};
|
||||
return { ...form, subject: form.preSettlementNo || form.contractName || '' };
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -148,9 +148,6 @@
|
||||
<span v-else-if="column.prop === 'sourceType'">
|
||||
{{ row[column.prop] === '应收应付' ? '应付' : displayValue(row[column.prop]) }}
|
||||
</span>
|
||||
<span v-else-if="column.prop === 'sealTypes'">
|
||||
{{ formatSealTypes(row[column.prop]) || '-' }}
|
||||
</span>
|
||||
<span v-else>{{ displayValue(row[column.prop]) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -309,7 +306,6 @@ import { preSettlementSearchFields } from '@/option/settlement/preSettlementSear
|
||||
import organizationSearch from '@/mixins/organization-search';
|
||||
import { preSettlementTableColumns } from '@/option/settlement/preSettlementTable';
|
||||
import { createSettlementTransfer } from '@/utils/settlement-transfer';
|
||||
import { formatSealTypes } from '@/utils/settlement-seal';
|
||||
import { downloadFile } from '@/utils/util';
|
||||
import { getMKApprovalUrl } from '@/api/system/business-process';
|
||||
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
@@ -405,7 +401,6 @@ export default {
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
formatSealTypes,
|
||||
hasPermission(code) {
|
||||
return this.isAdmin || this.validData(this.permission?.[code], false);
|
||||
},
|
||||
@@ -675,9 +670,6 @@ export default {
|
||||
subjectName: row.preSettlementNo || '',
|
||||
approvalStatus: previousApprovalStatus,
|
||||
mkEnabled: this.mkEnabled,
|
||||
tempVarData: {
|
||||
sealTypes: formatSealTypes(row.sealTypes) || '',
|
||||
},
|
||||
});
|
||||
this.$message.success('提交成功');
|
||||
this.loadTable();
|
||||
|
||||
@@ -1067,8 +1067,7 @@ import { formatContractOptionLabel } from '@/utils/contract';
|
||||
import { isTierUnitPrice, isUnitPriceAdjustable } from '@/utils/settlement-adjust-rule';
|
||||
import { downloadXls } from '@/utils/util';
|
||||
import { createSettlementTransfer } from '@/utils/settlement-transfer';
|
||||
import { settlementBillLabel, settlementListPath } from '@/utils/settlement-menu';
|
||||
import { getList as getFormalSettlementList } from '@/api/settlement/formalSettlement';
|
||||
import { settlementListPath } from '@/utils/settlement-menu';
|
||||
import {
|
||||
contractApprovalStatusOptions,
|
||||
contractCategoryOptions,
|
||||
@@ -1922,9 +1921,8 @@ export default {
|
||||
this.openSettlementDetail('/settlement/pre-settlement', row.preSettlementNo);
|
||||
return;
|
||||
}
|
||||
// 正式结算单号:跳转付款/收款结算单表单页并打开详情(与开票申请等入口一致)
|
||||
if (column.prop === 'formalSettlementNo') {
|
||||
this.openFormalSettlementDetail(row.formalSettlementNo);
|
||||
if (this.settlementType === 'payable' && column.prop === 'formalSettlementNo') {
|
||||
this.openSettlementDetail('/settlement/payment-settlement', row.formalSettlementNo);
|
||||
return;
|
||||
}
|
||||
this.openDetailDialog(row);
|
||||
@@ -1936,42 +1934,6 @@ export default {
|
||||
}
|
||||
this.$router.push({ path, query: { detailNo } });
|
||||
},
|
||||
async openFormalSettlementDetail(formalSettlementNo) {
|
||||
const normalizedNo = String(formalSettlementNo || '')
|
||||
.split(/[、,,]/)
|
||||
.map(item => item.trim())
|
||||
.find(Boolean);
|
||||
if (!normalizedNo) {
|
||||
this.$message.info('当前记录未关联结算单详情');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const data = this.unwrapPage(
|
||||
await getFormalSettlementList(1, 10, { formalSettlementNo: normalizedNo })
|
||||
);
|
||||
const row = (data.records || []).find(
|
||||
item => String(item.formalSettlementNo || '').trim() === normalizedNo
|
||||
);
|
||||
if (!row?.id) {
|
||||
this.$message.warning('未找到对应的正式结算单');
|
||||
return;
|
||||
}
|
||||
const settlementType = row.settlementType || this.settlementType || 'payable';
|
||||
const listPath = settlementListPath(settlementType);
|
||||
await this.$router.push({
|
||||
path: `${listPath}/form`,
|
||||
query: {
|
||||
mode: 'view',
|
||||
id: row.id,
|
||||
settlementType,
|
||||
listPath,
|
||||
name: `查看${settlementBillLabel(settlementType)}`,
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
this.$message.error('正式结算单详情加载失败');
|
||||
}
|
||||
},
|
||||
async openRouteDetail(detailId = this.$route.query.detailId) {
|
||||
// 结算明细点「单据号」会带 detailId 跳到本页;只有当前停在应收/应付明细页时才自动展开详情
|
||||
const routePath =
|
||||
|
||||
@@ -93,7 +93,6 @@
|
||||
<script>
|
||||
import { getList, getDetail, submit, remove } from '@/api/system/business-dept-config';
|
||||
import { getBusinessDeptSelect, getPlatformCompanySelect } from '@/api/system/dept';
|
||||
import { normalizeBusinessDeptOptions } from '@/utils/dept';
|
||||
import { mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
@@ -155,9 +154,8 @@ export default {
|
||||
{
|
||||
label: '业务部门',
|
||||
prop: 'businessDeptName',
|
||||
minWidth: 260,
|
||||
minWidth: 160,
|
||||
display: false,
|
||||
formatter: row => this.formatBusinessDeptLabel(row),
|
||||
},
|
||||
{
|
||||
label: '平台公司',
|
||||
@@ -279,16 +277,11 @@ export default {
|
||||
Promise.all([getPlatformCompanySelect(), getBusinessDeptSelect()]).then(
|
||||
([platformRes, businessRes]) => {
|
||||
this.platformCompanyOptions = this.normalizeDeptOptions(platformRes?.data?.data);
|
||||
// 业务部门配置页始终展示「部门(所属公司)」,便于与平台公司配对
|
||||
this.businessDeptOptions = normalizeBusinessDeptOptions(businessRes?.data?.data, {
|
||||
alwaysShowCompany: true,
|
||||
});
|
||||
this.businessDeptOptions = this.normalizeDeptOptions(businessRes?.data?.data);
|
||||
const platformColumn = this.findColumn(this.option.column, 'platformCompanyId');
|
||||
if (platformColumn) platformColumn.dicData = this.platformCompanyOptions;
|
||||
const businessColumn = this.findColumn(this.option.column, 'businessDeptId');
|
||||
if (businessColumn) businessColumn.dicData = this.businessDeptOptions;
|
||||
// 下拉选项就绪后刷新列表展示名(避免列表先于选项返回时只显示裸部门名)
|
||||
this.refreshBusinessDeptLabels();
|
||||
}
|
||||
);
|
||||
},
|
||||
@@ -299,19 +292,6 @@ export default {
|
||||
kingdeeDeptCode: item.kingdeeDeptCode || '',
|
||||
}));
|
||||
},
|
||||
/** 列表业务部门列:部门名(所属公司) */
|
||||
formatBusinessDeptLabel(row) {
|
||||
if (!row) return '-';
|
||||
const matched = this.businessDeptOptions.find(
|
||||
item => String(item.value) === String(row.businessDeptId)
|
||||
);
|
||||
if (matched?.label) return matched.label;
|
||||
return row.businessDeptName || '-';
|
||||
},
|
||||
refreshBusinessDeptLabels() {
|
||||
if (!this.data?.length) return;
|
||||
this.data = this.data.map(row => ({ ...row }));
|
||||
},
|
||||
formatSerial(value) {
|
||||
// Avue number 空值常落成 -1,历史脏数据也按空展示
|
||||
if (value === null || value === undefined || value === '' || value === -1 || value === '-1') {
|
||||
@@ -337,15 +317,13 @@ export default {
|
||||
},
|
||||
handleBusinessDeptChange(value) {
|
||||
const matched = this.businessDeptOptions.find(item => String(item.value) === String(value));
|
||||
this.form.businessDeptName = matched ? matched.rawLabel || matched.label : '';
|
||||
this.form.businessDeptName = matched ? matched.label : '';
|
||||
},
|
||||
beforeOpen(done, type) {
|
||||
const loadOptions = Promise.all([getPlatformCompanySelect(), getBusinessDeptSelect()]).then(
|
||||
([platformRes, businessRes]) => {
|
||||
this.platformCompanyOptions = this.normalizeDeptOptions(platformRes?.data?.data);
|
||||
this.businessDeptOptions = normalizeBusinessDeptOptions(businessRes?.data?.data, {
|
||||
alwaysShowCompany: true,
|
||||
});
|
||||
this.businessDeptOptions = this.normalizeDeptOptions(businessRes?.data?.data);
|
||||
const platformColumn = this.findColumn(this.option.column, 'platformCompanyId');
|
||||
if (platformColumn) platformColumn.dicData = this.platformCompanyOptions;
|
||||
const businessColumn = this.findColumn(this.option.column, 'businessDeptId');
|
||||
|
||||
@@ -66,21 +66,17 @@
|
||||
/>
|
||||
</template>
|
||||
<template #dataScopeDeptIds-form>
|
||||
<!-- 与用户管理「数据管理权限」一致:组织多选级联,数据源同左侧组织树 -->
|
||||
<el-cascader
|
||||
<el-tree
|
||||
v-if="Number(form.dataScopeRange) === 3"
|
||||
v-model="dataScopeCascaderValue"
|
||||
:options="permissionDeptTree"
|
||||
:props="deptCascaderProps"
|
||||
:disabled="isViewMode"
|
||||
clearable
|
||||
filterable
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
placeholder="请选择数据权限组织(可多选)"
|
||||
style="width: 100%"
|
||||
ref="dataScopeTree"
|
||||
:data="permissionDeptTree"
|
||||
show-checkbox
|
||||
node-key="id"
|
||||
:default-checked-keys="form.dataScopeDeptIds || []"
|
||||
:props="{ label: 'title', children: 'children' }"
|
||||
@check="handleDataScopeCheck"
|
||||
/>
|
||||
<span v-else class="form-tip">选择「自定义」后可选择数据权限组织</span>
|
||||
<span v-else class="form-tip">选择「自定义」后可勾选数据权限组织</span>
|
||||
</template>
|
||||
<template #menu="{ row, index }">
|
||||
<el-link
|
||||
@@ -197,26 +193,6 @@ export default {
|
||||
: [];
|
||||
},
|
||||
},
|
||||
// 自定义数据权限组织:与用户管理数据管理权限相同的多选级联
|
||||
dataScopeCascaderValue: {
|
||||
get() {
|
||||
const ids = Array.isArray(this.form.dataScopeDeptIds)
|
||||
? this.form.dataScopeDeptIds
|
||||
: this.form.dataScopeDeptIds
|
||||
? String(this.form.dataScopeDeptIds).split(',').filter(Boolean)
|
||||
: [];
|
||||
return ids
|
||||
.filter(item => item !== undefined && item !== null && item !== '')
|
||||
.map(item => (typeof item === 'number' ? item : String(item)));
|
||||
},
|
||||
set(value) {
|
||||
this.form.dataScopeDeptIds = Array.isArray(value)
|
||||
? value.filter(item => item !== undefined && item !== null && item !== '')
|
||||
: value
|
||||
? [value]
|
||||
: [];
|
||||
},
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.sensitiveManager = sensitive.create({
|
||||
@@ -252,6 +228,12 @@ export default {
|
||||
this.permissionDeptTree = res.data.data || [];
|
||||
});
|
||||
},
|
||||
handleDataScopeCheck(_, checked) {
|
||||
if (this.isViewMode) {
|
||||
return;
|
||||
}
|
||||
this.form.dataScopeDeptIds = checked.checkedKeys || [];
|
||||
},
|
||||
normalizeSubmitRow(row = {}, isUpdate = false) {
|
||||
let payload = { ...row };
|
||||
// 编辑时剔除未改动的脱敏字段,避免把 138****8000 写回库
|
||||
@@ -296,19 +278,17 @@ export default {
|
||||
detail.identities = detail.identities.split(',').filter(Boolean);
|
||||
}
|
||||
const deptIds = func.split(detail.deptId || '');
|
||||
const dataScopeDeptIds = Array.isArray(detail.dataScopeDeptIds)
|
||||
? detail.dataScopeDeptIds.map(item => String(item))
|
||||
: detail.dataScopeDeptIds
|
||||
? String(detail.dataScopeDeptIds).split(',').filter(Boolean)
|
||||
: [];
|
||||
this.form = {
|
||||
...detail,
|
||||
deptId: Array.isArray(deptIds) ? deptIds : [],
|
||||
dataScopeRange: detail.dataScopeRange || 1,
|
||||
dataLevelRange: detail.dataLevelRange || 1,
|
||||
dataScopeDeptIds,
|
||||
dataScopeDeptIds: detail.dataScopeDeptIds || [],
|
||||
};
|
||||
this.sensitiveManager?.saveInitialData(this.form);
|
||||
this.$nextTick(() => {
|
||||
this.$refs.dataScopeTree?.setCheckedKeys?.(this.form.dataScopeDeptIds || []);
|
||||
});
|
||||
done();
|
||||
});
|
||||
return;
|
||||
|
||||
@@ -713,12 +713,6 @@ export default {
|
||||
}
|
||||
this.selectDeptOnTree(deptId);
|
||||
},
|
||||
startDeptTreeFromSecondLevel(tree) {
|
||||
if (!Array.isArray(tree) || !tree.length) {
|
||||
return [];
|
||||
}
|
||||
return tree.flatMap(node => (Array.isArray(node.children) ? node.children : []));
|
||||
},
|
||||
findDeptIdByName(name, tree = this.permissionDeptTree) {
|
||||
if (!name) return null;
|
||||
for (const node of tree || []) {
|
||||
@@ -739,7 +733,7 @@ export default {
|
||||
const tenantId = this.userInfo.tenantId || this.website.tenantId;
|
||||
try {
|
||||
const res = await getDeptTree(tenantId);
|
||||
this.permissionDeptTree = this.startDeptTreeFromSecondLevel(res.data.data || []);
|
||||
this.permissionDeptTree = res.data.data || [];
|
||||
} catch (error) {
|
||||
this.$message.error('组织树加载失败');
|
||||
return;
|
||||
@@ -969,11 +963,9 @@ export default {
|
||||
column.dicData = res.data.data;
|
||||
});
|
||||
getDeptTree(tenantId).then(res => {
|
||||
// 用户管理组织从第二级开始展示:去掉一级根节点,保留其子节点
|
||||
const deptTree = this.startDeptTreeFromSecondLevel(res.data.data || []);
|
||||
this.permissionDeptTree = deptTree;
|
||||
this.permissionDeptTree = res.data.data;
|
||||
const column = this.findColumn(this.userOption.group, 'deptId');
|
||||
column.dicData = deptTree;
|
||||
column.dicData = res.data.data;
|
||||
});
|
||||
getPostList(tenantId).then(res => {
|
||||
this.postList = res.data.data;
|
||||
|
||||
@@ -689,7 +689,6 @@ import {
|
||||
recognitionIDCard,
|
||||
recognitionTransportCertificates,
|
||||
recognizeBaiduOcr,
|
||||
recognizeQualificationCertificateOcr,
|
||||
} from '@/api/transportCapacity/driver';
|
||||
import { getList as getVehicleList } from '@/api/transportCapacity/transport-vehicle';
|
||||
import { getDeptTree } from '@/api/system/dept';
|
||||
@@ -1323,28 +1322,8 @@ export default {
|
||||
},
|
||||
handleQualificationUploadSuccess(prop, url) {
|
||||
this.setImage(prop, url);
|
||||
this.recognizeQualificationCertificate(url);
|
||||
},
|
||||
recognizeQualificationCertificate(url) {
|
||||
if (!url) {
|
||||
this.$message.warning('从业资格证图片上传成功,未获取到图片地址,无法自动识别');
|
||||
return;
|
||||
}
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: '从业资格证识别中',
|
||||
background: 'rgba(255, 255, 255, 0.7)',
|
||||
});
|
||||
recognizeQualificationCertificateOcr(url)
|
||||
.then(res => {
|
||||
this.applyQualificationRecognition(res?.data?.data || {});
|
||||
this.$message.success('从业资格证识别完成');
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message.warning('从业资格证图片上传成功,自动识别失败,请手动填写相关信息');
|
||||
})
|
||||
.finally(() => {
|
||||
loading.close();
|
||||
this.recognizeBaiduOcr(url, 'general', '', '从业资格证', data => {
|
||||
this.applyQualificationRecognition(data);
|
||||
});
|
||||
},
|
||||
recognizeBaiduOcr(url, type, side, documentName, applyRecognition) {
|
||||
@@ -1635,69 +1614,48 @@ export default {
|
||||
return typeof value === 'object' ? value.words || value.value || '' : value || '';
|
||||
},
|
||||
applyQualificationRecognition(data = {}) {
|
||||
const fields = this.normalizeQualificationOcrFields(data);
|
||||
const qualificationType = this.getQualificationOcrValue(fields, [
|
||||
'qualification_category',
|
||||
'从业资格类别',
|
||||
'从业资格类型',
|
||||
]).replace(/[,,;;]+$/, '');
|
||||
const qualificationNo = this.getQualificationOcrValue(fields, [
|
||||
'certificate_no',
|
||||
'证号',
|
||||
'从业资格证号',
|
||||
'资格证号',
|
||||
'证书编号',
|
||||
]);
|
||||
const validFrom = this.getQualificationOcrValue(fields, ['valid_from', '有效起始日期']);
|
||||
const validUntil = this.getQualificationOcrValue(fields, ['valid_until', '有效期限', '有效期']);
|
||||
const qualificationType = this.getQualificationType(data);
|
||||
const qualificationNo = this.getQualificationNo(data);
|
||||
const matchedType = this.matchQualificationType(qualificationType);
|
||||
if (matchedType) {
|
||||
this.driverForm.qualificationType = matchedType;
|
||||
} else if (qualificationType && !this.qualificationTypeOptions.length) {
|
||||
this.driverForm.qualificationType = qualificationType;
|
||||
}
|
||||
if (qualificationNo) {
|
||||
if (qualificationNo && !this.driverForm.qualificationNo) {
|
||||
this.driverForm.qualificationNo = String(qualificationNo).replace(/\s/g, '');
|
||||
}
|
||||
const startDate = this.normalizeBirthday(validFrom);
|
||||
if (startDate) {
|
||||
this.driverForm.qualificationStartDate = startDate;
|
||||
}
|
||||
if (/(长期|永久)/.test(validUntil)) {
|
||||
const words = this.getBaiduOcrWords(data).join(' ');
|
||||
const dateList = words.match(/\d{4}[-/.年]\d{1,2}[-/.月]\d{1,2}日?/g) || [];
|
||||
if (/(长期|永久有效)/.test(words)) {
|
||||
this.driverForm.qualificationLongTerm = 1;
|
||||
this.driverForm.qualificationEndDate = '';
|
||||
} else {
|
||||
const endDate = this.normalizeBirthday(validUntil);
|
||||
if (endDate) {
|
||||
this.driverForm.qualificationEndDate = endDate;
|
||||
} else if (dateList.length) {
|
||||
this.driverForm.qualificationEndDate = this.normalizeBirthday(dateList[dateList.length - 1]);
|
||||
this.driverForm.qualificationLongTerm = 0;
|
||||
}
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
['qualificationType', 'qualificationNo', 'qualificationEndDate'].forEach(prop => {
|
||||
this.$refs.driverForm?.validateField(prop);
|
||||
});
|
||||
});
|
||||
},
|
||||
normalizeQualificationOcrFields(result = {}) {
|
||||
if (result.fields && typeof result.fields === 'object' && !Array.isArray(result.fields)) {
|
||||
return result.fields;
|
||||
getQualificationType(data = {}) {
|
||||
const fieldValue = this.getOcrValue(data, ['从业资格类别', '从业资格类型']);
|
||||
if (fieldValue) return String(fieldValue).trim();
|
||||
const words = this.getBaiduOcrWords(data);
|
||||
const labelIndex = words.findIndex(word => /从业资格类别|从业资格类型/.test(word));
|
||||
if (labelIndex < 0) return '';
|
||||
const firstValue = words[labelIndex].replace(/^.*?(?:从业资格类别|从业资格类型)\s*[::]?/, '').trim();
|
||||
const values = firstValue ? [firstValue] : [];
|
||||
for (let index = labelIndex + 1; index < words.length; index += 1) {
|
||||
const word = String(words[index] || '').trim();
|
||||
if (!word || /^(有效起始日期|有效期限|核发机关|继续教育信息|诚信考核信息)/.test(word)) {
|
||||
break;
|
||||
}
|
||||
const keyInfos = result.key_info || result.keyInfo || result.keyInfos || [];
|
||||
if (!Array.isArray(keyInfos)) return {};
|
||||
return Object.fromEntries(
|
||||
keyInfos
|
||||
.filter(item => item && item.key)
|
||||
.map(item => [String(item.key).trim(), String(item.value ?? '').trim()])
|
||||
.filter(([, value]) => value)
|
||||
);
|
||||
},
|
||||
getQualificationOcrValue(fields = {}, keys = []) {
|
||||
const normalizedKeys = keys.map(key => String(key).toLowerCase());
|
||||
const entry = Object.entries(fields).find(([key]) =>
|
||||
normalizedKeys.includes(String(key).toLowerCase())
|
||||
);
|
||||
return entry ? String(entry[1] || '').trim() : '';
|
||||
values.push(word);
|
||||
}
|
||||
return values.join('').replace(/[,,;;]+$/, '').trim();
|
||||
},
|
||||
matchQualificationType(value = '') {
|
||||
const text = String(value || '').replace(/\s/g, '');
|
||||
@@ -1715,6 +1673,27 @@ export default {
|
||||
);
|
||||
return matched?.value || '';
|
||||
},
|
||||
getQualificationNo(data = {}) {
|
||||
const fieldValue = this.getOcrValue(data, ['从业资格证号', '资格证号', '证书编号']);
|
||||
if (fieldValue) return fieldValue;
|
||||
const words = this.getBaiduOcrWords(data);
|
||||
const labelIndex = words.findIndex(word => /^(?:(?:从业)?资格证号?|证书编号)[::]?$/.test(word));
|
||||
if (labelIndex >= 0 && words[labelIndex + 1]) {
|
||||
return words[labelIndex + 1];
|
||||
}
|
||||
const certificateLine = words.find(word => /(?:从业)?资格证号?|证书编号/.test(word));
|
||||
const match = certificateLine?.match(/(?:(?:从业)?资格证号?|证书编号)\s*[::]?\s*([A-Z0-9-]{6,})/i);
|
||||
return match?.[1] || '';
|
||||
},
|
||||
getBaiduOcrWords(data = {}) {
|
||||
const wordsResult = data.words_result || data.wordsResult || {};
|
||||
if (Array.isArray(wordsResult)) {
|
||||
return wordsResult.map(item => item.words || item.value || '').filter(Boolean);
|
||||
}
|
||||
return Object.values(wordsResult)
|
||||
.map(item => (typeof item === 'object' ? item.words || item.value || '' : item || ''))
|
||||
.filter(Boolean);
|
||||
},
|
||||
normalizeNation(value = '') {
|
||||
const nation = String(value || '').trim();
|
||||
if (!nation) return '';
|
||||
|
||||
@@ -310,7 +310,6 @@
|
||||
v-model="archiveForm.customerCode"
|
||||
maxlength="20"
|
||||
show-word-limit
|
||||
:disabled="Boolean(archiveForm.id)"
|
||||
placeholder="请输入,留空则自动生成"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -379,7 +378,7 @@
|
||||
placeholder="请输入"
|
||||
maxlength="18"
|
||||
show-word-limit
|
||||
:disabled="Boolean(archiveForm.id)"
|
||||
:disabled="kingdeeLocked && Boolean(archiveForm.id)"
|
||||
@input="
|
||||
archiveForm.unifiedCreditCode = String(
|
||||
archiveForm.unifiedCreditCode || ''
|
||||
@@ -395,7 +394,7 @@
|
||||
placeholder="请输入"
|
||||
maxlength="100"
|
||||
show-word-limit
|
||||
:disabled="kingdeeLocked && !archiveForm.id"
|
||||
:disabled="kingdeeLocked"
|
||||
@blur="checkArchiveNameRisk"
|
||||
/>
|
||||
<el-tooltip
|
||||
@@ -435,7 +434,7 @@
|
||||
v-model="archiveForm.legalPerson"
|
||||
maxlength="10"
|
||||
show-word-limit
|
||||
:disabled="kingdeeLocked && !archiveForm.id"
|
||||
:disabled="kingdeeLocked"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -536,7 +535,7 @@
|
||||
<el-input
|
||||
v-model="archiveForm.registeredCapital"
|
||||
maxlength="18"
|
||||
:disabled="kingdeeLocked && !archiveForm.id"
|
||||
:disabled="kingdeeLocked"
|
||||
@input="value => handleDecimalInput('registeredCapital', value)"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -546,7 +545,7 @@
|
||||
<el-input
|
||||
v-model="archiveForm.paidInCapital"
|
||||
maxlength="18"
|
||||
:disabled="kingdeeLocked && !archiveForm.id"
|
||||
:disabled="kingdeeLocked"
|
||||
@input="value => handleDecimalInput('paidInCapital', value)"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -1410,10 +1409,9 @@
|
||||
<el-form-item label="自评得分" :required="isOfflineScore">
|
||||
<el-input
|
||||
v-if="isOfflineScore"
|
||||
:model-value="formatScoreValue(currentScore.selfScore)"
|
||||
v-model="currentScore.selfScore"
|
||||
maxlength="10"
|
||||
:disabled="readonly"
|
||||
placeholder="请输入自评得分"
|
||||
@input="handleOfflineSelfScoreInput"
|
||||
@blur="recalculateOfflineScore"
|
||||
>
|
||||
@@ -2491,14 +2489,8 @@ export default {
|
||||
];
|
||||
const rows = categoryMap.map((category, index) => {
|
||||
const details = this.getScoreCategoryDetails(category.categoryCode);
|
||||
const sumCategoryScore = prop =>
|
||||
details.reduce((sum, item) => {
|
||||
if (this.isBlankScore(item[prop])) return sum;
|
||||
const value = Number(item[prop]);
|
||||
return sum + (Number.isFinite(value) ? value : 0);
|
||||
}, 0);
|
||||
let selfScore = sumCategoryScore('selfScore');
|
||||
let reviewScore = sumCategoryScore('reviewScore');
|
||||
let selfScore = details.reduce((sum, item) => sum + Number(item.selfScore || 0), 0);
|
||||
let reviewScore = details.reduce((sum, item) => sum + Number(item.reviewScore || 0), 0);
|
||||
// 暂定:加分/减分合计最高按 15 分计(分类汇总展示封顶后值)
|
||||
if (category.categoryCode === 'plus') {
|
||||
selfScore = Math.min(selfScore, HARDCODED_MAX_PLUS_SCORE);
|
||||
@@ -4246,9 +4238,7 @@ export default {
|
||||
'核准日期',
|
||||
]);
|
||||
const scope = this.getBusinessLicenseOcrValue(fields, ['经营范围']);
|
||||
if (code && !this.archiveForm.id) {
|
||||
this.archiveForm.unifiedCreditCode = code.replace(/\s/g, '').toUpperCase();
|
||||
}
|
||||
if (code) this.archiveForm.unifiedCreditCode = code.replace(/\s/g, '').toUpperCase();
|
||||
if (name) this.archiveForm.fullName = name;
|
||||
if (name) this.checkArchiveNameRisk();
|
||||
if (legalPerson) this.archiveForm.legalPerson = legalPerson;
|
||||
@@ -4562,9 +4552,6 @@ export default {
|
||||
quantificationId: score.quantificationId ? String(score.quantificationId) : '',
|
||||
evaluateMode: score.evaluateMode === 'offline' ? 'offline' : 'online',
|
||||
nextEvaluateDate: score.nextEvaluateDate || '',
|
||||
selfScore: this.normalizeScoreInputValue(score.selfScore),
|
||||
reviewScore: this.normalizeScoreInputValue(score.reviewScore),
|
||||
finalScore: this.normalizeScoreInputValue(score.finalScore),
|
||||
applyCreditLimit: this.normalizeOptionalAmount(
|
||||
score.applyCreditLimit === undefined
|
||||
? this.archiveForm.applyCreditLimit
|
||||
@@ -4578,8 +4565,6 @@ export default {
|
||||
details: (score.details || []).map(detail => ({
|
||||
...detail,
|
||||
scoreInput: this.normalizeScoreInputValue(detail.scoreInput),
|
||||
selfScore: this.normalizeScoreInputValue(detail.selfScore),
|
||||
reviewScore: this.normalizeScoreInputValue(detail.reviewScore),
|
||||
})),
|
||||
};
|
||||
},
|
||||
@@ -5360,9 +5345,7 @@ export default {
|
||||
return this.getScoreDetailCategoryCode(detail) === 'basic';
|
||||
},
|
||||
getSignedScore(detail, prop) {
|
||||
if (this.isBlankScore(detail[prop])) return '';
|
||||
const score = Number(detail[prop]);
|
||||
if (!Number.isFinite(score)) return '';
|
||||
const score = Number(detail[prop] || 0);
|
||||
return this.isMinusScoreDetail(detail) && score > 0 ? -score : score;
|
||||
},
|
||||
getScoreItemFullScore(detail = {}) {
|
||||
@@ -5436,12 +5419,7 @@ export default {
|
||||
const basicDetails = this.getScoreCategoryDetailsByList(details, 'basic');
|
||||
const plusDetails = this.getScoreCategoryDetailsByList(details, 'plus');
|
||||
const minusDetails = this.getScoreCategoryDetailsByList(details, 'minus');
|
||||
const sumScore = (list, prop) =>
|
||||
list.reduce((sum, item) => {
|
||||
if (this.isBlankScore(item[prop])) return sum;
|
||||
const value = Number(item[prop]);
|
||||
return sum + (Number.isFinite(value) ? value : 0);
|
||||
}, 0);
|
||||
const sumScore = (list, prop) => list.reduce((sum, item) => sum + Number(item[prop] || 0), 0);
|
||||
const rawPlusSelf = sumScore(plusDetails, 'selfScore');
|
||||
const rawPlusReview = sumScore(plusDetails, 'reviewScore');
|
||||
const rawMinusSelf = sumScore(minusDetails, 'selfScore');
|
||||
@@ -5456,51 +5434,33 @@ export default {
|
||||
const hasReviewScore = details.some(
|
||||
item => !this.isBlankScore(item.reviewScore)
|
||||
);
|
||||
// 线下模式允许手工改自评得分:有手工值时优先采用,否则回退明细合计;-1 视为未填
|
||||
// 线下模式允许手工改自评得分:有手工值时优先采用,否则回退明细合计
|
||||
const isOffline = String(score.evaluateMode || '') === 'offline';
|
||||
const hasManualSelfScore = isOffline && !this.isBlankScore(score.selfScore);
|
||||
const hasFilledDetail = details.some(item => {
|
||||
if (this.isScoreTypeDetail(item)) {
|
||||
const input = String(item.scoreInput ?? '').trim();
|
||||
return input !== '' && input !== '-' && input !== '.';
|
||||
}
|
||||
return !this.isBlankScore(item.selectedOption);
|
||||
});
|
||||
const manualSelfScore = Number(score.selfScore);
|
||||
const selfScore =
|
||||
hasManualSelfScore && Number.isFinite(manualSelfScore) ? manualSelfScore : computedSelfScore;
|
||||
isOffline && Number.isFinite(manualSelfScore) && String(score.selfScore ?? '').trim() !== ''
|
||||
? manualSelfScore
|
||||
: computedSelfScore;
|
||||
const finalScore = hasReviewScore ? reviewScore : selfScore;
|
||||
const fullMark = this.getScoreFullMark(details);
|
||||
const scoreRate =
|
||||
fullMark > 0 ? Math.max(0, Math.min(100, (finalScore / fullMark) * 100)) : 0;
|
||||
const standard = this.matchCreditStandard(score, scoreRate);
|
||||
const hasStandards = (score.standards || []).some(item => item && item.creditLevel);
|
||||
// 线下未手工填写且明细未实际填报时保留空,避免默认写出 -1/0
|
||||
const keepOfflineScoreBlank = isOffline && !hasManualSelfScore && !hasFilledDetail;
|
||||
score.selfScore = keepOfflineScoreBlank ? '' : Number(Number(selfScore).toFixed(2));
|
||||
score.selfScore = Number(Number(selfScore).toFixed(2));
|
||||
score.reviewScore = Number(reviewScore.toFixed(2));
|
||||
score.finalScore =
|
||||
keepOfflineScoreBlank && !hasReviewScore ? '' : Number(Number(finalScore).toFixed(2));
|
||||
score.scoreRate = keepOfflineScoreBlank && !hasReviewScore ? '' : Number(scoreRate.toFixed(2));
|
||||
score.finalScore = Number(Number(finalScore).toFixed(2));
|
||||
score.scoreRate = Number(scoreRate.toFixed(2));
|
||||
if (hasStandards) {
|
||||
score.creditLevel = keepOfflineScoreBlank && !hasReviewScore ? '' : standard?.creditLevel || '';
|
||||
score.maxCreditLimit =
|
||||
keepOfflineScoreBlank && !hasReviewScore
|
||||
? ''
|
||||
: standard
|
||||
score.creditLevel = standard?.creditLevel || '';
|
||||
score.maxCreditLimit = standard
|
||||
? this.calculateCreditLimitByStandard(standard, scoreRate)
|
||||
: '';
|
||||
}
|
||||
return score;
|
||||
},
|
||||
isBlankScore(value) {
|
||||
return (
|
||||
value === undefined ||
|
||||
value === null ||
|
||||
value === -1 ||
|
||||
value === '-1' ||
|
||||
String(value).trim() === ''
|
||||
);
|
||||
return value === undefined || value === null || String(value).trim() === '';
|
||||
},
|
||||
hasIncompleteBasicScoreDetail(details = []) {
|
||||
return this.getScoreCategoryDetailsByList(details, 'basic').some(item => {
|
||||
@@ -6008,27 +5968,6 @@ export default {
|
||||
this.currentScore.evaluateMode = mode === 'offline' ? 'offline' : 'online';
|
||||
if (this.isOfflineScore) {
|
||||
this.expandedScoreCategoryKeys = [];
|
||||
// 切到线下且明细尚未实际填报时清空自评,避免沿用线上合计或 -1 哨兵值
|
||||
const hasFilledDetail = (this.currentScore.details || []).some(item => {
|
||||
if (this.isScoreTypeDetail(item)) {
|
||||
const input = String(item.scoreInput ?? '').trim();
|
||||
return input !== '' && input !== '-' && input !== '.';
|
||||
}
|
||||
return !this.isBlankScore(item.selectedOption);
|
||||
});
|
||||
if (!hasFilledDetail || this.isBlankScore(this.currentScore.selfScore)) {
|
||||
this.currentScore.selfScore = '';
|
||||
}
|
||||
if (!hasFilledDetail || this.isBlankScore(this.currentScore.finalScore)) {
|
||||
this.currentScore.finalScore = '';
|
||||
}
|
||||
if (!hasFilledDetail) {
|
||||
this.currentScore.scoreRate = '';
|
||||
this.currentScore.creditLevel = '';
|
||||
this.currentScore.maxCreditLimit = '';
|
||||
}
|
||||
} else {
|
||||
this.calculateScore(this.currentScore);
|
||||
}
|
||||
},
|
||||
handleOfflineSelfScoreInput(value) {
|
||||
@@ -6042,19 +5981,6 @@ export default {
|
||||
},
|
||||
recalculateOfflineScore() {
|
||||
if (!this.isOfflineScore) return;
|
||||
if (this.isBlankScore(this.currentScore.selfScore)) {
|
||||
this.currentScore.selfScore = '';
|
||||
const hasReviewScore = (this.currentScore.details || []).some(
|
||||
item => !this.isBlankScore(item.reviewScore)
|
||||
);
|
||||
if (!hasReviewScore) {
|
||||
this.currentScore.finalScore = '';
|
||||
}
|
||||
this.currentScore.scoreRate = '';
|
||||
this.currentScore.creditLevel = '';
|
||||
this.currentScore.maxCreditLimit = '';
|
||||
return;
|
||||
}
|
||||
const selfScore = Number(this.currentScore.selfScore);
|
||||
if (!Number.isFinite(selfScore)) return;
|
||||
this.currentScore.selfScore = Number(selfScore.toFixed(2));
|
||||
|
||||
Reference in New Issue
Block a user