Compare commits

...
Author SHA1 Message Date
b2894lxlxandCursor d2f756bc21 ⚡ 优化用户组织树展示与客商档案编辑锁定
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-09 22:55:12 +08:00
b2894lxlxandCursor 1663b2d910 ✨ 结算单用印类型、合同甲乙丙列表与项目调整材料
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-09 22:53:55 +08:00
b2894lxlxandCursor 748214a4b6 🐛 业务部门下拉展示所属公司,并映射项目旧平台公司ID
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-09 12:44:44 +08:00
b2894lxlx d3ba0ce38b Merge remote-tracking branch 'websoft/dev' 2026-11-06 09:36:51 +08:00
b2894lxlxandCursor f5be5245d6 ✨ 角色管理列表接入分页
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-06 09:32:50 +08:00
b2894lxlxandCursor baf54efb7b 🐛 修复评分-1空值、结算单号跳转与小程序用户数据权限组织选择
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-06 09:32:36 +08:00
b2894lxlxandCursor 7ff2b3fe28 ✨ 司机从业资格证改为调用专用识别接口
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-05 15:09:16 +08:00
b2894lxlx 17d2766f82 Merge pull request '收票登记新增所属合同带出承办部门替代手选结算组织' (#13) from feature/20261104-bfi-project-web into master
Reviewed-on: #13
2026-11-05 15:04:42 +08:00
weicw 32065b9c54 🔀 合并主干 master 到 dev 2026-11-04 18:24:39 +08:00
weicw 799a87641e ✨ 合同管理搜索表单新增客商筛选,合同名称移到最后,生效类型改为合同状态 2026-11-03 21:16:00 +08:00
weicw 28baa69e8f 🐛 装货管理与运输计划货物信息列统一为仅一种货物时不显示等N种货物 2026-11-03 19:41:25 +08:00
weicw 4ed80268b4 🐛 运单管理货物信息列仅一种货物时不显示等N种货物 2026-11-03 19:37:23 +08:00
weicw 30c59c2acb 🔀 合并主干 master 到 dev 2026-11-03 19:30:03 +08:00
weicw 39560bde79 ✨ 过程配置新增装货端/卸货端节点与货量类型校验 2026-11-02 15:22:42 +08:00
35 changed files with 1168 additions and 212 deletions
+11
View File
@@ -91,3 +91,14 @@ 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,
},
});
};
+12 -10
View File
@@ -253,16 +253,18 @@ export const option = createCrudOption([
label: '客商',
prop: 'partyName',
search: true,
searchOrder: 11,
searchPlaceholder: '请输入',
searchOrder: 14,
searchPlaceholder: '请输入甲/乙方名称',
hide: true,
display: false,
addDisplay: false,
editDisplay: false,
},
{
label: '合同编号',
prop: 'contractNo',
search: true,
searchOrder: 6,
searchOrder: 8,
searchPlaceholder: '请输入',
order: 185,
maxlength: 100,
@@ -287,7 +289,7 @@ export const option = createCrudOption([
label: '所属项目',
prop: 'projectName',
search: true,
searchOrder: 8,
searchOrder: 11,
searchType: 'select',
searchPlaceholder: '请选择',
formslot: true,
@@ -334,7 +336,7 @@ export const option = createCrudOption([
prop: 'contractCategory',
type: 'select',
search: true,
searchOrder: 9,
searchOrder: 12,
searchPlaceholder: '请选择',
order: 170,
dicData: contractCategoryOptions,
@@ -346,7 +348,7 @@ export const option = createCrudOption([
prop: 'signType',
type: 'select',
search: true,
searchOrder: 10,
searchOrder: 13,
searchPlaceholder: '请选择',
span: 8,
order: 190,
@@ -359,7 +361,7 @@ export const option = createCrudOption([
prop: 'effectiveType',
type: 'select',
search: true,
searchOrder: 5,
searchOrder: 6,
searchPlaceholder: '请选择',
dicData: effectiveTypeOptions,
hide: true,
@@ -630,7 +632,7 @@ export const option = createCrudOption([
prop: 'hcsSyncStatus',
type: 'select',
search: true,
searchOrder: 6,
searchOrder: 7,
searchPlaceholder: '请选择',
slot: true,
dicData: hcsSyncStatusOptions,
@@ -660,7 +662,7 @@ export const option = createCrudOption([
type: 'select',
search: true,
searchPlaceholder: '请选择',
searchOrder: 7,
searchOrder: 9,
dicData: yesNoOptions,
hide: true,
addDisplay: false,
@@ -672,7 +674,7 @@ export const option = createCrudOption([
type: 'select',
search: true,
searchPlaceholder: '请选择',
searchOrder: 8,
searchOrder: 10,
dicData: yesNoOptions,
hide: true,
addDisplay: false,
+2 -1
View File
@@ -124,7 +124,8 @@ const formatGoodsInfo = row => {
const text = Object.entries(groups)
.map(([unit, group]) => {
const quantity = formatGoodsQuantity(group.quantity);
return `${group.typeName}等${group.count}种货物 | ${quantity}${unit ? ` ${unit}` : ''}`;
const typeName = group.count > 1 ? `${group.typeName}等${group.count}种货物` : group.typeName;
return `${typeName} | ${quantity}${unit ? ` ${unit}` : ''}`;
})
.join('; ');
@@ -12,6 +12,7 @@
* ⚠️ column 数组顺序 = 表格列顺序,搜索专用列统一放在数组最前面。
*/
import { formatSealTypes } from '@/utils/settlement-seal';
import {
approvalStatusOptions,
invoiceStatusOptions,
@@ -24,6 +25,8 @@ 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'}`;
@@ -72,6 +75,7 @@ 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,6 +10,12 @@ 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 },
@@ -29,6 +35,7 @@ export const createFormalSettlementForm = () => ({
sourceDetailIds: [],
businessModel: '',
transportType: '',
sealTypes: [],
exchangeRateDate: '',
exchangeRate: 1,
createUserName: '',
@@ -10,6 +10,7 @@ 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,6 +26,12 @@ 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 },
@@ -82,6 +88,7 @@ export const emptyPreSettlementForm = () => ({
settlementAmount: 0,
businessModel: '',
transportType: '',
sealTypes: [],
localCurrency: 'RMB',
localSettlementAmount: 0,
exchangeRateDate: '',
@@ -10,6 +10,7 @@ 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 },
{
+28 -10
View File
@@ -492,17 +492,35 @@ export const treeOption = {
nodeKey: 'id',
lazy: true,
treeLoad: function (node, resolve) {
const parentId = node.level === 0 ? 0 : node.data.id;
getDeptLazyTree(parentId).then(res => {
resolve(
res.data.data.map(item => {
return {
...item,
leaf: !item.hasChildren,
};
})
);
const toTreeNode = item => ({
...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,
+39
View File
@@ -0,0 +1,39 @@
/**
* 业务部门下拉规范化。
* 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);
}
+1 -1
View File
@@ -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)
* @param {Object} [options.tempVarData] 传给 MK 的临时变量(如项目类型 projectType、用印类型 sealTypes)
* @returns {Promise<boolean>} true=已发起/复用 MK 流程,false=未开启或已跳过
*/
export async function submitMkApprovalFlow({
+31
View File
@@ -0,0 +1,31 @@
/** 结算单用印类型固定选项(展示顺序固定) */
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('、');
};
+5 -2
View File
@@ -6,6 +6,7 @@
:data="data"
ref="crud"
v-model="form"
v-model:page="page"
:permission="permissionList"
:before-open="beforeOpen"
@row-del="rowDel"
@@ -101,7 +102,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>
@@ -729,7 +730,9 @@ export default {
onLoad(page, params = {}) {
this.loading = true;
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
this.data = res.data.data;
const data = res.data.data || {};
this.data = data.records || [];
this.page.total = data.total || 0;
this.loading = false;
this.selectionClear();
});
@@ -3949,9 +3949,9 @@ export default {
return Object.values(groups)
.map(group => {
const quantity = this.formatDispatchQuantity(group.quantity);
return `${group.typeName}等${group.count}种货物 | ${quantity}${
group.unit ? ` ${group.unit}` : ''
}`;
const typeName =
group.count > 1 ? `${group.typeName}等${group.count}种货物` : group.typeName;
return `${typeName} | ${quantity}${group.unit ? ` ${group.unit}` : ''}`;
})
.join('; ');
},
@@ -7549,12 +7549,13 @@ export default {
}, {});
const cargoInfo = Object.values(groups)
.map(
group =>
`${group.cargoType}等${group.count}种货物 | ${this.formatDispatchQuantity(
group.quantity
)}${group.unit ? ` ${group.unit}` : ''}`
)
.map(group => {
const typeName =
group.count > 1 ? `${group.cargoType}等${group.count}种货物` : group.cargoType;
return `${typeName} | ${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);
return `${group.typeName}等${group.count}种货物 | ${quantity}${
group.unit ? ` ${group.unit}` : ''
}`;
const typeName =
group.count > 1 ? `${group.typeName}等${group.count}种货物` : group.typeName;
return `${typeName} | ${quantity}${group.unit ? ` ${group.unit}` : ''}`;
})
.join('; ');
},
@@ -13,8 +13,18 @@ export default {
components: { MkPublicShell, ContractManageChange },
methods: {
getForm() {
const row = this.$refs.page?.form || {};
return { ...row, subject: row.contractName || row.contractNo || '' };
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 || '',
};
},
},
};
+42 -5
View File
@@ -69,11 +69,8 @@
<el-form-item label="合同负责部门">
<el-input v-model="form.organizationName" disabled />
</el-form-item>
<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 label="平台公司">
<el-input v-model="form.platformCompanyName" disabled />
</el-form-item>
<el-form-item label="签订日期">
<el-date-picker
@@ -272,6 +269,29 @@
</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
@@ -799,6 +819,13 @@ 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 === '结算规则变更';
},
@@ -1253,6 +1280,16 @@ 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,8 +13,18 @@ export default {
components: { MkPublicShell, ContractManage },
methods: {
getForm() {
const row = this.$refs.page?.detailRow || {};
return { ...row, subject: row.contractName || row.contractNo || '' };
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 || '',
};
},
},
};
+87 -28
View File
@@ -174,9 +174,6 @@
<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')
@@ -239,6 +236,29 @@
</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"
@@ -1205,7 +1225,8 @@ import {
getDetail as getCustomerArchiveDetail,
getList as getCustomerArchiveList,
} from '@/api/vehicle/customer-archive';
import { getBusinessDeptSelect, getDeptTree } from '@/api/system/dept';
import { getBusinessDeptSelect, getDeptTree, 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 { config, option } from '@/option/business/contract-manage';
@@ -1579,6 +1600,9 @@ export default {
billCycleTypeOptions: ['固定截单日', '自然月', '自定义多周期'],
detailLoading: false,
detailRow: {},
detailPartyARows: [],
detailPartyBRows: [],
detailPartyCRows: [],
// 合规(HCS)推送/对账状态;受 thirdParty.hcs.push.immediate-enabled 控制显隐
hcsRepushingId: null,
hcsImmediateEnabled: false,
@@ -1707,6 +1731,13 @@ 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 个甲方时编辑器自动选中)
@@ -2678,28 +2709,55 @@ export default {
applyProjectPlatformCompanies(project, autoSelect = false) {
const ids = this.parseUndertakeDeptIds(project?.undertakeDeptId);
const names = this.parseUndertakeDeptNames(project?.undertakeDeptName);
this.platformCompanyOptions = ids.map((id, index) => ({
// 项目可能仍挂旧组织 ID(已删/非平台公司),按名称映射到现行「是否平台公司=是」的组织
return this.resolveProjectPlatformCompanyOptions(ids, names).then(options => {
this.platformCompanyOptions = options;
if (!autoSelect) {
this.syncCurrentPlatformCompanyOption();
return options;
}
if (this.platformCompanyOptions.length === 1) {
this.form.platformCompanyId = this.platformCompanyOptions[0].id;
this.form.platformCompanyName = this.platformCompanyOptions[0].label;
} else if (
!this.platformCompanyOptions.some(
item => String(item.id) === String(this.form.platformCompanyId)
)
) {
this.form.platformCompanyId = '';
this.form.platformCompanyName = '';
} else {
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 (!autoSelect) {
this.syncCurrentPlatformCompanyOption();
return;
}
if (this.platformCompanyOptions.length === 1) {
this.form.platformCompanyId = this.platformCompanyOptions[0].id;
this.form.platformCompanyName = this.platformCompanyOptions[0].label;
} else if (
!this.platformCompanyOptions.some(
item => String(item.id) === String(this.form.platformCompanyId)
)
) {
this.form.platformCompanyId = '';
this.form.platformCompanyName = '';
} else {
this.handlePlatformCompanyChange(this.form.platformCompanyId);
}
if (this.formMode === 'add') this.refreshPreviewContractNo();
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));
@@ -3093,11 +3151,8 @@ export default {
this.businessDeptLoading = true;
getBusinessDeptSelect()
.then(res => {
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),
}));
// 同名业务部门(不同上级公司)展示「部门(上级)」;落库仍用 rawLabel 原始部门名
this.businessDeptOptions = normalizeBusinessDeptOptions(res.data?.data || []);
this.syncCurrentBusinessDeptOption();
})
.finally(() => {
@@ -3113,6 +3168,7 @@ export default {
}
this.businessDeptOptions.unshift({
id: String(this.form.organizationId),
value: String(this.form.organizationId),
label: this.form.organizationName,
rawLabel: this.form.organizationName,
});
@@ -3456,6 +3512,9 @@ 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);
+3 -3
View File
@@ -2545,9 +2545,9 @@ export default {
Object.values(groups)
.map(group => {
const quantity = this.formatGoodsQuantity(group.quantity);
return `${group.typeName}等${group.count}种货物 | ${quantity}${
group.unit ? ` ${group.unit}` : ''
}`;
const typeName =
group.count > 1 ? `${group.typeName}等${group.count}种货物` : group.typeName;
return `${typeName} | ${quantity}${group.unit ? ` ${group.unit}` : ''}`;
})
.join('; ') || '-'
);
+24 -2
View File
@@ -489,6 +489,12 @@ 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 {
@@ -916,8 +922,24 @@ export default {
this.$message.warning('备注不能超过500个字符');
return false;
}
if (!this.enabledNodes.length) {
this.$message.warning('请至少选择一个过程节点');
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('发货或装货至少勾选一个货量类型');
return false;
}
const transit = this.nodeRows.find(item => item.key === 'transit');
+332 -19
View File
@@ -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="missingRequiredAttachmentTypes.length"
v-if="!isChangeDialog && missingRequiredAttachmentTypes.length"
class="project-apply-form__material-warn"
>
未上传:{{ missingRequiredAttachmentTypes.join('、') }}
@@ -698,7 +698,11 @@
<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">
<el-select
v-model="row.fileType"
placeholder="请选择"
:disabled="dialogReadonly || isChangeDialog"
>
<el-option
v-for="item in projectAttachmentTypeOptions"
:key="item.value"
@@ -731,7 +735,7 @@
<el-input
v-model="row.description"
placeholder="请输入"
:disabled="dialogReadonly"
:disabled="dialogReadonly || isChangeDialog"
/>
</template>
</el-table-column>
@@ -741,14 +745,26 @@
<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="{ $index }">
<el-link v-if="!dialogReadonly" type="danger" @click="removeAttachment($index)"
>删除</el-link
<template #default="{ row, $index }">
<el-link
v-if="isChangeDialog && !dialogReadonly"
type="primary"
@click="openAdjustAttachmentDialog(row, $index)"
>
调整
</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"
@@ -761,6 +777,57 @@
/>
</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
@@ -1011,6 +1078,86 @@
@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="选择用户"
@@ -1094,6 +1241,7 @@ 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';
@@ -1165,6 +1313,7 @@ const emptyForm = () => ({
customerJson: '',
carrierJson: '',
attachmentsJson: '',
adjustAttachmentsJson: '',
situationRemark: '',
projectIntro: '',
profitRemark: '',
@@ -1174,6 +1323,24 @@ 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',
@@ -1448,6 +1615,29 @@ 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: [],
@@ -2206,6 +2396,9 @@ export default {
this.customerRows = [];
this.carrierRows = [];
this.attachmentRows = [];
this.adjustAttachmentRows = [];
this.adjustAttachmentBox = false;
this.resetAdjustAttachmentForm();
this.selectedAttachmentRows = [];
this.changeRows = [];
this.projectContractRows = [];
@@ -2247,6 +2440,7 @@ 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
@@ -2555,6 +2749,9 @@ 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 || '',
@@ -2570,6 +2767,9 @@ 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]
);
@@ -2979,19 +3179,8 @@ export default {
loadDeptOptions() {
getBusinessDeptSelect()
.then(res => {
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.deptOptions = normalizeBusinessDeptOptions(res.data.data || []);
this.fillDefaultBusinessDept();
this.ensureCurrentBusinessDeptOption();
})
@@ -3201,6 +3390,112 @@ 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 '';
@@ -3718,6 +4013,24 @@ 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 {
+120 -11
View File
@@ -2,16 +2,40 @@
<div ref="page" class="mk-public-biz-view">
<basic-container>
<div class="mk-public-biz-view__title">{{ pageTitle }}</div>
<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"
<template v-if="detail">
<el-descriptions :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]) }}
</el-descriptions-item>
</el-descriptions>
<section
v-for="party in partySections"
:key="party.role"
class="mk-public-biz-view__party"
>
{{ displayValue(detail[item.prop]) }}
</el-descriptions-item>
</el-descriptions>
<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>
@@ -19,6 +43,36 @@
<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': [
@@ -38,8 +92,6 @@ 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': [
@@ -47,6 +99,7 @@ const FIELD_MAP = {
{ label: '合同名称', prop: 'contractName' },
{ label: '项目名称', prop: 'projectName' },
{ label: '结算金额', prop: 'settlementAmount' },
{ label: '用印类型', prop: 'sealTypes' },
{ label: '审核状态', prop: 'approvalStatusName' },
{ label: '当前节点', prop: 'currentNode' },
{ label: '当前处理人', prop: 'currentProcessor' },
@@ -58,6 +111,7 @@ const FIELD_MAP = {
{ label: '项目名称', prop: 'projectName' },
{ label: '合同名称', prop: 'contractName' },
{ label: '结算金额', prop: 'settlementAmount' },
{ label: '用印类型', prop: 'sealTypes' },
{ label: '审核状态', prop: 'approvalStatusName' },
{ label: '当前节点', prop: 'currentNode' },
{ label: '当前处理人', prop: 'currentProcessor' },
@@ -99,6 +153,26 @@ 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();
@@ -192,6 +266,7 @@ export default {
id: this.getFormId() || detail.id,
subject: this.pageTitle,
formInstanceId: this.getFormId(),
sealTypes: formatSealTypes(detail.sealTypes) || detail.sealTypes || '',
};
},
getFormId() {
@@ -205,6 +280,12 @@ 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('、') || '-';
@@ -255,5 +336,33 @@ 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>
@@ -78,6 +78,22 @@
: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 }"
@@ -85,7 +101,7 @@
{{ form.formalSettlementNo || (form.id ? '-' : '系统自动生成') }}
</span>
<span v-else-if="field.money">{{ formatMoney(form[field.prop]) }}</span>
<span v-else-if="field.type === 'select'">{{
<span v-else-if="field.type === 'select' || field.type === 'multi-select'">{{
formSelectLabel(field, form[field.prop])
}}</span>
<span v-else-if="field.type === 'contract'">{{
@@ -1144,6 +1160,11 @@ import ChangeRecordDetailDialog from '@/components/change-record-detail-dialog/m
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,汇率日期、结算汇率与按汇率换算的本位币合计都不展示
@@ -1235,6 +1256,7 @@ export default {
feeCategoryOptions: [],
businessModelOptions: [],
transportTypeOptions: [],
sealTypeOptions: SETTLEMENT_SEAL_TYPE_OPTIONS,
fields: formalSettlementFormFields,
sourceTableColumns: sourceColumns,
summaryTableColumns: summaryColumns,
@@ -1498,6 +1520,7 @@ export default {
this.form = {
...createFormalSettlementForm(),
...data,
sealTypes: parseSealTypes(data.sealTypes),
sourcePreSettlementIds: (data.sources || []).map(item => item.preSettlementId),
sourceDetailIds: (data.details || [])
.filter(item => !item.sourcePreSettlementId)
@@ -1702,6 +1725,7 @@ export default {
contractId,
settlementType,
settlementTypeName: settlementType === 'receivable' ? '应收' : '应付',
sealTypes: parseSealTypes(first.sealTypes),
sourcePreSettlementIds: this.form.sourcePreSettlementIds,
});
const responses = await Promise.all(
@@ -1944,6 +1968,7 @@ 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();
}
@@ -2993,6 +3018,7 @@ 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
@@ -3205,6 +3231,9 @@ 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(
@@ -67,7 +67,26 @@
:value="item.dictKey"
/>
</el-select>
<span v-else-if="field.type === 'select'" class="form-readonly">
<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"
>
{{ formSelectLabel(field, form[field.prop]) }}
</span>
<el-input
@@ -1025,6 +1044,11 @@ 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'];
@@ -1117,6 +1141,7 @@ export default {
feeCategoryOptions: [],
businessModelOptions: [],
transportTypeOptions: [],
sealTypeOptions: SETTLEMENT_SEAL_TYPE_OPTIONS,
summaryFees: [],
details: [],
detailCollapsed: false,
@@ -1553,7 +1578,11 @@ 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 };
this.form = {
...emptyPreSettlementForm(),
...detail,
sealTypes: parseSealTypes(detail.sealTypes),
};
this.summaryFees = (detail.summaryFees || []).map(row => ({ ...row }));
this.details = (detail.details || []).map(row => this.normalizeSourceDetail(row));
this.detailPage.current = 1;
@@ -1717,6 +1746,9 @@ 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(
@@ -1942,6 +1974,9 @@ 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;
@@ -1961,6 +1996,7 @@ 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,6 +17,7 @@
<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',
@@ -29,7 +30,11 @@ export default {
methods: {
getForm() {
const form = this.$refs.page?.form || {};
return { ...form, subject: form.formalSettlementNo || form.contractName || '' };
return {
...form,
sealTypes: formatSealTypes(form.sealTypes) || '',
subject: form.formalSettlementNo || form.contractName || '',
};
},
},
};
@@ -240,6 +240,7 @@ 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',
@@ -507,6 +508,9 @@ export default {
subjectName: row.formalSettlementNo || '',
approvalStatus: previousApprovalStatus,
mkEnabled: this.mkEnabled,
tempVarData: {
sealTypes: formatSealTypes(row.sealTypes) || '',
},
});
this.$message.success('提交成功');
this.onLoad(this.page);
@@ -17,6 +17,7 @@
<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',
@@ -29,7 +30,11 @@ export default {
methods: {
getForm() {
const form = this.$refs.page?.form || {};
return { ...form, subject: form.preSettlementNo || form.contractName || '' };
return {
...form,
sealTypes: formatSealTypes(form.sealTypes) || '',
subject: form.preSettlementNo || form.contractName || '',
};
},
},
};
+8
View File
@@ -148,6 +148,9 @@
<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>
@@ -306,6 +309,7 @@ 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';
@@ -401,6 +405,7 @@ export default {
});
},
methods: {
formatSealTypes,
hasPermission(code) {
return this.isAdmin || this.validData(this.permission?.[code], false);
},
@@ -670,6 +675,9 @@ export default {
subjectName: row.preSettlementNo || '',
approvalStatus: previousApprovalStatus,
mkEnabled: this.mkEnabled,
tempVarData: {
sealTypes: formatSealTypes(row.sealTypes) || '',
},
});
this.$message.success('提交成功');
this.loadTable();
@@ -1067,7 +1067,8 @@ 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 { settlementListPath } from '@/utils/settlement-menu';
import { settlementBillLabel, settlementListPath } from '@/utils/settlement-menu';
import { getList as getFormalSettlementList } from '@/api/settlement/formalSettlement';
import {
contractApprovalStatusOptions,
contractCategoryOptions,
@@ -1921,8 +1922,9 @@ export default {
this.openSettlementDetail('/settlement/pre-settlement', row.preSettlementNo);
return;
}
if (this.settlementType === 'payable' && column.prop === 'formalSettlementNo') {
this.openSettlementDetail('/settlement/payment-settlement', row.formalSettlementNo);
// 正式结算单号:跳转付款/收款结算单表单页并打开详情(与开票申请等入口一致)
if (column.prop === 'formalSettlementNo') {
this.openFormalSettlementDetail(row.formalSettlementNo);
return;
}
this.openDetailDialog(row);
@@ -1934,6 +1936,42 @@ 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 =
+26 -4
View File
@@ -93,6 +93,7 @@
<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 {
@@ -154,8 +155,9 @@ export default {
{
label: '业务部门',
prop: 'businessDeptName',
minWidth: 160,
minWidth: 260,
display: false,
formatter: row => this.formatBusinessDeptLabel(row),
},
{
label: '平台公司',
@@ -277,11 +279,16 @@ export default {
Promise.all([getPlatformCompanySelect(), getBusinessDeptSelect()]).then(
([platformRes, businessRes]) => {
this.platformCompanyOptions = this.normalizeDeptOptions(platformRes?.data?.data);
this.businessDeptOptions = this.normalizeDeptOptions(businessRes?.data?.data);
// 业务部门配置页始终展示「部门(所属公司)」,便于与平台公司配对
this.businessDeptOptions = normalizeBusinessDeptOptions(businessRes?.data?.data, {
alwaysShowCompany: true,
});
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();
}
);
},
@@ -292,6 +299,19 @@ 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') {
@@ -317,13 +337,15 @@ export default {
},
handleBusinessDeptChange(value) {
const matched = this.businessDeptOptions.find(item => String(item.value) === String(value));
this.form.businessDeptName = matched ? matched.label : '';
this.form.businessDeptName = matched ? matched.rawLabel || matched.label : '';
},
beforeOpen(done, type) {
const loadOptions = Promise.all([getPlatformCompanySelect(), getBusinessDeptSelect()]).then(
([platformRes, businessRes]) => {
this.platformCompanyOptions = this.normalizeDeptOptions(platformRes?.data?.data);
this.businessDeptOptions = this.normalizeDeptOptions(businessRes?.data?.data);
this.businessDeptOptions = normalizeBusinessDeptOptions(businessRes?.data?.data, {
alwaysShowCompany: true,
});
const platformColumn = this.findColumn(this.option.column, 'platformCompanyId');
if (platformColumn) platformColumn.dicData = this.platformCompanyOptions;
const businessColumn = this.findColumn(this.option.column, 'businessDeptId');
+39 -19
View File
@@ -66,17 +66,21 @@
/>
</template>
<template #dataScopeDeptIds-form>
<el-tree
<!-- 与用户管理「数据管理权限」一致:组织多选级联,数据源同左侧组织树 -->
<el-cascader
v-if="Number(form.dataScopeRange) === 3"
ref="dataScopeTree"
:data="permissionDeptTree"
show-checkbox
node-key="id"
:default-checked-keys="form.dataScopeDeptIds || []"
:props="{ label: 'title', children: 'children' }"
@check="handleDataScopeCheck"
v-model="dataScopeCascaderValue"
:options="permissionDeptTree"
:props="deptCascaderProps"
:disabled="isViewMode"
clearable
filterable
collapse-tags
collapse-tags-tooltip
placeholder="请选择数据权限组织(可多选)"
style="width: 100%"
/>
<span v-else class="form-tip">选择「自定义」后可勾选数据权限组织</span>
<span v-else class="form-tip">选择「自定义」后可选择数据权限组织</span>
</template>
<template #menu="{ row, index }">
<el-link
@@ -193,6 +197,26 @@ 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({
@@ -228,12 +252,6 @@ 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 写回库
@@ -278,17 +296,19 @@ 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: detail.dataScopeDeptIds || [],
dataScopeDeptIds,
};
this.sensitiveManager?.saveInitialData(this.form);
this.$nextTick(() => {
this.$refs.dataScopeTree?.setCheckedKeys?.(this.form.dataScopeDeptIds || []);
});
done();
});
return;
+11 -3
View File
@@ -713,6 +713,12 @@ 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 || []) {
@@ -733,7 +739,7 @@ export default {
const tenantId = this.userInfo.tenantId || this.website.tenantId;
try {
const res = await getDeptTree(tenantId);
this.permissionDeptTree = res.data.data || [];
this.permissionDeptTree = this.startDeptTreeFromSecondLevel(res.data.data || []);
} catch (error) {
this.$message.error('组织树加载失败');
return;
@@ -963,9 +969,11 @@ export default {
column.dicData = res.data.data;
});
getDeptTree(tenantId).then(res => {
this.permissionDeptTree = res.data.data;
// 用户管理组织从第二级开始展示:去掉一级根节点,保留其子节点
const deptTree = this.startDeptTreeFromSecondLevel(res.data.data || []);
this.permissionDeptTree = deptTree;
const column = this.findColumn(this.userOption.group, 'deptId');
column.dicData = res.data.data;
column.dicData = deptTree;
});
getPostList(tenantId).then(res => {
this.postList = res.data.data;
+68 -47
View File
@@ -689,6 +689,7 @@ import {
recognitionIDCard,
recognitionTransportCertificates,
recognizeBaiduOcr,
recognizeQualificationCertificateOcr,
} from '@/api/transportCapacity/driver';
import { getList as getVehicleList } from '@/api/transportCapacity/transport-vehicle';
import { getDeptTree } from '@/api/system/dept';
@@ -1322,9 +1323,29 @@ export default {
},
handleQualificationUploadSuccess(prop, url) {
this.setImage(prop, url);
this.recognizeBaiduOcr(url, 'general', '', '从业资格证', data => {
this.applyQualificationRecognition(data);
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();
});
},
recognizeBaiduOcr(url, type, side, documentName, applyRecognition) {
if (!url) {
@@ -1614,25 +1635,43 @@ export default {
return typeof value === 'object' ? value.words || value.value || '' : value || '';
},
applyQualificationRecognition(data = {}) {
const qualificationType = this.getQualificationType(data);
const qualificationNo = this.getQualificationNo(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 matchedType = this.matchQualificationType(qualificationType);
if (matchedType) {
this.driverForm.qualificationType = matchedType;
} else if (qualificationType && !this.qualificationTypeOptions.length) {
this.driverForm.qualificationType = qualificationType;
}
if (qualificationNo && !this.driverForm.qualificationNo) {
if (qualificationNo) {
this.driverForm.qualificationNo = String(qualificationNo).replace(/\s/g, '');
}
const words = this.getBaiduOcrWords(data).join(' ');
const dateList = words.match(/\d{4}[-/.年]\d{1,2}[-/.月]\d{1,2}日?/g) || [];
if (/(长期|永久有效)/.test(words)) {
const startDate = this.normalizeBirthday(validFrom);
if (startDate) {
this.driverForm.qualificationStartDate = startDate;
}
if (/(长期|永久)/.test(validUntil)) {
this.driverForm.qualificationLongTerm = 1;
this.driverForm.qualificationEndDate = '';
} else if (dateList.length) {
this.driverForm.qualificationEndDate = this.normalizeBirthday(dateList[dateList.length - 1]);
this.driverForm.qualificationLongTerm = 0;
} else {
const endDate = this.normalizeBirthday(validUntil);
if (endDate) {
this.driverForm.qualificationEndDate = endDate;
this.driverForm.qualificationLongTerm = 0;
}
}
this.$nextTick(() => {
['qualificationType', 'qualificationNo', 'qualificationEndDate'].forEach(prop => {
@@ -1640,22 +1679,25 @@ export default {
});
});
},
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;
}
values.push(word);
normalizeQualificationOcrFields(result = {}) {
if (result.fields && typeof result.fields === 'object' && !Array.isArray(result.fields)) {
return result.fields;
}
return values.join('').replace(/[,,;;]+$/, '').trim();
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() : '';
},
matchQualificationType(value = '') {
const text = String(value || '').replace(/\s/g, '');
@@ -1673,27 +1715,6 @@ 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 '';
+97 -23
View File
@@ -310,6 +310,7 @@
v-model="archiveForm.customerCode"
maxlength="20"
show-word-limit
:disabled="Boolean(archiveForm.id)"
placeholder="请输入,留空则自动生成"
/>
</el-form-item>
@@ -378,7 +379,7 @@
placeholder="请输入"
maxlength="18"
show-word-limit
:disabled="kingdeeLocked && Boolean(archiveForm.id)"
:disabled="Boolean(archiveForm.id)"
@input="
archiveForm.unifiedCreditCode = String(
archiveForm.unifiedCreditCode || ''
@@ -394,7 +395,7 @@
placeholder="请输入"
maxlength="100"
show-word-limit
:disabled="kingdeeLocked"
:disabled="kingdeeLocked && !archiveForm.id"
@blur="checkArchiveNameRisk"
/>
<el-tooltip
@@ -434,7 +435,7 @@
v-model="archiveForm.legalPerson"
maxlength="10"
show-word-limit
:disabled="kingdeeLocked"
:disabled="kingdeeLocked && !archiveForm.id"
/>
</el-form-item>
</el-col>
@@ -535,7 +536,7 @@
<el-input
v-model="archiveForm.registeredCapital"
maxlength="18"
:disabled="kingdeeLocked"
:disabled="kingdeeLocked && !archiveForm.id"
@input="value => handleDecimalInput('registeredCapital', value)"
/>
</el-form-item>
@@ -545,7 +546,7 @@
<el-input
v-model="archiveForm.paidInCapital"
maxlength="18"
:disabled="kingdeeLocked"
:disabled="kingdeeLocked && !archiveForm.id"
@input="value => handleDecimalInput('paidInCapital', value)"
/>
</el-form-item>
@@ -1409,9 +1410,10 @@
<el-form-item label="自评得分" :required="isOfflineScore">
<el-input
v-if="isOfflineScore"
v-model="currentScore.selfScore"
:model-value="formatScoreValue(currentScore.selfScore)"
maxlength="10"
:disabled="readonly"
placeholder="请输入自评得分"
@input="handleOfflineSelfScoreInput"
@blur="recalculateOfflineScore"
>
@@ -2489,8 +2491,14 @@ export default {
];
const rows = categoryMap.map((category, index) => {
const details = this.getScoreCategoryDetails(category.categoryCode);
let selfScore = details.reduce((sum, item) => sum + Number(item.selfScore || 0), 0);
let reviewScore = details.reduce((sum, item) => sum + Number(item.reviewScore || 0), 0);
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');
// 暂定:加分/减分合计最高按 15 分计(分类汇总展示封顶后值)
if (category.categoryCode === 'plus') {
selfScore = Math.min(selfScore, HARDCODED_MAX_PLUS_SCORE);
@@ -4238,7 +4246,9 @@ export default {
'核准日期',
]);
const scope = this.getBusinessLicenseOcrValue(fields, ['经营范围']);
if (code) this.archiveForm.unifiedCreditCode = code.replace(/\s/g, '').toUpperCase();
if (code && !this.archiveForm.id) {
this.archiveForm.unifiedCreditCode = code.replace(/\s/g, '').toUpperCase();
}
if (name) this.archiveForm.fullName = name;
if (name) this.checkArchiveNameRisk();
if (legalPerson) this.archiveForm.legalPerson = legalPerson;
@@ -4552,6 +4562,9 @@ 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
@@ -4565,6 +4578,8 @@ export default {
details: (score.details || []).map(detail => ({
...detail,
scoreInput: this.normalizeScoreInputValue(detail.scoreInput),
selfScore: this.normalizeScoreInputValue(detail.selfScore),
reviewScore: this.normalizeScoreInputValue(detail.reviewScore),
})),
};
},
@@ -5345,7 +5360,9 @@ export default {
return this.getScoreDetailCategoryCode(detail) === 'basic';
},
getSignedScore(detail, prop) {
const score = Number(detail[prop] || 0);
if (this.isBlankScore(detail[prop])) return '';
const score = Number(detail[prop]);
if (!Number.isFinite(score)) return '';
return this.isMinusScoreDetail(detail) && score > 0 ? -score : score;
},
getScoreItemFullScore(detail = {}) {
@@ -5419,7 +5436,12 @@ 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) => sum + Number(item[prop] || 0), 0);
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 rawPlusSelf = sumScore(plusDetails, 'selfScore');
const rawPlusReview = sumScore(plusDetails, 'reviewScore');
const rawMinusSelf = sumScore(minusDetails, 'selfScore');
@@ -5434,33 +5456,51 @@ 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 =
isOffline && Number.isFinite(manualSelfScore) && String(score.selfScore ?? '').trim() !== ''
? manualSelfScore
: computedSelfScore;
hasManualSelfScore && Number.isFinite(manualSelfScore) ? 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);
score.selfScore = Number(Number(selfScore).toFixed(2));
// 线下未手工填写且明细未实际填报时保留空,避免默认写出 -1/0
const keepOfflineScoreBlank = isOffline && !hasManualSelfScore && !hasFilledDetail;
score.selfScore = keepOfflineScoreBlank ? '' : Number(Number(selfScore).toFixed(2));
score.reviewScore = Number(reviewScore.toFixed(2));
score.finalScore = Number(Number(finalScore).toFixed(2));
score.scoreRate = Number(scoreRate.toFixed(2));
score.finalScore =
keepOfflineScoreBlank && !hasReviewScore ? '' : Number(Number(finalScore).toFixed(2));
score.scoreRate = keepOfflineScoreBlank && !hasReviewScore ? '' : Number(scoreRate.toFixed(2));
if (hasStandards) {
score.creditLevel = standard?.creditLevel || '';
score.maxCreditLimit = standard
? this.calculateCreditLimitByStandard(standard, scoreRate)
: '';
score.creditLevel = keepOfflineScoreBlank && !hasReviewScore ? '' : standard?.creditLevel || '';
score.maxCreditLimit =
keepOfflineScoreBlank && !hasReviewScore
? ''
: standard
? this.calculateCreditLimitByStandard(standard, scoreRate)
: '';
}
return score;
},
isBlankScore(value) {
return value === undefined || value === null || String(value).trim() === '';
return (
value === undefined ||
value === null ||
value === -1 ||
value === '-1' ||
String(value).trim() === ''
);
},
hasIncompleteBasicScoreDetail(details = []) {
return this.getScoreCategoryDetailsByList(details, 'basic').some(item => {
@@ -5968,6 +6008,27 @@ 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) {
@@ -5981,6 +6042,19 @@ 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));