Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2f756bc21 | ||
|
|
1663b2d910 | ||
|
|
748214a4b6 | ||
|
|
d3ba0ce38b | ||
|
|
f5be5245d6 | ||
|
|
baf54efb7b | ||
|
|
7ff2b3fe28 | ||
|
|
17d2766f82 | ||
|
|
32065b9c54 | ||
|
|
799a87641e | ||
|
|
28baa69e8f | ||
|
|
4ed80268b4 | ||
|
|
30c59c2acb | ||
|
|
39560bde79 |
@@ -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,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|||||||
@@ -253,16 +253,18 @@ export const option = createCrudOption([
|
|||||||
label: '客商',
|
label: '客商',
|
||||||
prop: 'partyName',
|
prop: 'partyName',
|
||||||
search: true,
|
search: true,
|
||||||
searchOrder: 11,
|
searchOrder: 14,
|
||||||
searchPlaceholder: '请输入',
|
searchPlaceholder: '请输入甲/乙方名称',
|
||||||
hide: true,
|
hide: true,
|
||||||
display: false,
|
display: false,
|
||||||
|
addDisplay: false,
|
||||||
|
editDisplay: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '合同编号',
|
label: '合同编号',
|
||||||
prop: 'contractNo',
|
prop: 'contractNo',
|
||||||
search: true,
|
search: true,
|
||||||
searchOrder: 6,
|
searchOrder: 8,
|
||||||
searchPlaceholder: '请输入',
|
searchPlaceholder: '请输入',
|
||||||
order: 185,
|
order: 185,
|
||||||
maxlength: 100,
|
maxlength: 100,
|
||||||
@@ -287,7 +289,7 @@ export const option = createCrudOption([
|
|||||||
label: '所属项目',
|
label: '所属项目',
|
||||||
prop: 'projectName',
|
prop: 'projectName',
|
||||||
search: true,
|
search: true,
|
||||||
searchOrder: 8,
|
searchOrder: 11,
|
||||||
searchType: 'select',
|
searchType: 'select',
|
||||||
searchPlaceholder: '请选择',
|
searchPlaceholder: '请选择',
|
||||||
formslot: true,
|
formslot: true,
|
||||||
@@ -334,7 +336,7 @@ export const option = createCrudOption([
|
|||||||
prop: 'contractCategory',
|
prop: 'contractCategory',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
search: true,
|
search: true,
|
||||||
searchOrder: 9,
|
searchOrder: 12,
|
||||||
searchPlaceholder: '请选择',
|
searchPlaceholder: '请选择',
|
||||||
order: 170,
|
order: 170,
|
||||||
dicData: contractCategoryOptions,
|
dicData: contractCategoryOptions,
|
||||||
@@ -346,7 +348,7 @@ export const option = createCrudOption([
|
|||||||
prop: 'signType',
|
prop: 'signType',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
search: true,
|
search: true,
|
||||||
searchOrder: 10,
|
searchOrder: 13,
|
||||||
searchPlaceholder: '请选择',
|
searchPlaceholder: '请选择',
|
||||||
span: 8,
|
span: 8,
|
||||||
order: 190,
|
order: 190,
|
||||||
@@ -359,7 +361,7 @@ export const option = createCrudOption([
|
|||||||
prop: 'effectiveType',
|
prop: 'effectiveType',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
search: true,
|
search: true,
|
||||||
searchOrder: 5,
|
searchOrder: 6,
|
||||||
searchPlaceholder: '请选择',
|
searchPlaceholder: '请选择',
|
||||||
dicData: effectiveTypeOptions,
|
dicData: effectiveTypeOptions,
|
||||||
hide: true,
|
hide: true,
|
||||||
@@ -630,7 +632,7 @@ export const option = createCrudOption([
|
|||||||
prop: 'hcsSyncStatus',
|
prop: 'hcsSyncStatus',
|
||||||
type: 'select',
|
type: 'select',
|
||||||
search: true,
|
search: true,
|
||||||
searchOrder: 6,
|
searchOrder: 7,
|
||||||
searchPlaceholder: '请选择',
|
searchPlaceholder: '请选择',
|
||||||
slot: true,
|
slot: true,
|
||||||
dicData: hcsSyncStatusOptions,
|
dicData: hcsSyncStatusOptions,
|
||||||
@@ -660,7 +662,7 @@ export const option = createCrudOption([
|
|||||||
type: 'select',
|
type: 'select',
|
||||||
search: true,
|
search: true,
|
||||||
searchPlaceholder: '请选择',
|
searchPlaceholder: '请选择',
|
||||||
searchOrder: 7,
|
searchOrder: 9,
|
||||||
dicData: yesNoOptions,
|
dicData: yesNoOptions,
|
||||||
hide: true,
|
hide: true,
|
||||||
addDisplay: false,
|
addDisplay: false,
|
||||||
@@ -672,7 +674,7 @@ export const option = createCrudOption([
|
|||||||
type: 'select',
|
type: 'select',
|
||||||
search: true,
|
search: true,
|
||||||
searchPlaceholder: '请选择',
|
searchPlaceholder: '请选择',
|
||||||
searchOrder: 8,
|
searchOrder: 10,
|
||||||
dicData: yesNoOptions,
|
dicData: yesNoOptions,
|
||||||
hide: true,
|
hide: true,
|
||||||
addDisplay: false,
|
addDisplay: false,
|
||||||
|
|||||||
@@ -124,7 +124,8 @@ const formatGoodsInfo = row => {
|
|||||||
const text = Object.entries(groups)
|
const text = Object.entries(groups)
|
||||||
.map(([unit, group]) => {
|
.map(([unit, group]) => {
|
||||||
const quantity = formatGoodsQuantity(group.quantity);
|
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('; ');
|
.join('; ');
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
* ⚠️ column 数组顺序 = 表格列顺序,搜索专用列统一放在数组最前面。
|
* ⚠️ column 数组顺序 = 表格列顺序,搜索专用列统一放在数组最前面。
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { formatSealTypes } from '@/utils/settlement-seal';
|
||||||
import {
|
import {
|
||||||
approvalStatusOptions,
|
approvalStatusOptions,
|
||||||
invoiceStatusOptions,
|
invoiceStatusOptions,
|
||||||
@@ -24,6 +25,8 @@ import { formalSettlementTableColumns } from './formalSettlementTable';
|
|||||||
const textFormatter = (row, value) =>
|
const textFormatter = (row, value) =>
|
||||||
value === null || value === undefined || value === '' ? '-' : value;
|
value === null || value === undefined || value === '' ? '-' : value;
|
||||||
|
|
||||||
|
const sealTypesFormatter = (row, value) => formatSealTypes(value) || '-';
|
||||||
|
|
||||||
/** 金额统一展示:两位小数 + 币种 */
|
/** 金额统一展示:两位小数 + 币种 */
|
||||||
const moneyFormatter = (row, value) =>
|
const moneyFormatter = (row, value) =>
|
||||||
`${Number(value || 0).toFixed(2)} ${row?.currency || 'RMB'}`;
|
`${Number(value || 0).toFixed(2)} ${row?.currency || 'RMB'}`;
|
||||||
@@ -72,6 +75,7 @@ const COLUMN_EXTRA = {
|
|||||||
projectName: { search: true, searchSpan: 5, searchOrder: 11, searchPlaceholder: '请输入' },
|
projectName: { search: true, searchSpan: 5, searchOrder: 11, searchPlaceholder: '请输入' },
|
||||||
deptName: { search: true, searchslot: true, searchSpan: 5, searchOrder: 10 },
|
deptName: { search: true, searchslot: true, searchSpan: 5, searchOrder: 10 },
|
||||||
contractNo: { search: true, searchSpan: 5, searchOrder: 9, searchPlaceholder: '请输入' },
|
contractNo: { search: true, searchSpan: 5, searchOrder: 9, searchPlaceholder: '请输入' },
|
||||||
|
sealTypes: { formatter: sealTypesFormatter },
|
||||||
invoiceStatusName: { slot: true },
|
invoiceStatusName: { slot: true },
|
||||||
paymentStatusName: { slot: true },
|
paymentStatusName: { slot: true },
|
||||||
approvalStatusName: { slot: true },
|
approvalStatusName: { slot: true },
|
||||||
|
|||||||
@@ -10,6 +10,12 @@ export const formalSettlementFormFields = [
|
|||||||
{ label: '结算金额', prop: 'settlementAmount', readonly: true, money: true },
|
{ label: '结算金额', prop: 'settlementAmount', readonly: true, money: true },
|
||||||
{ label: '业务模式', prop: 'businessModel', type: 'select', optionsKey: 'businessModelOptions' },
|
{ label: '业务模式', prop: 'businessModel', type: 'select', optionsKey: 'businessModelOptions' },
|
||||||
{ label: '运输方式', prop: 'transportType', type: 'select', optionsKey: 'transportTypeOptions' },
|
{ label: '运输方式', prop: 'transportType', type: 'select', optionsKey: 'transportTypeOptions' },
|
||||||
|
{
|
||||||
|
label: '用印类型',
|
||||||
|
prop: 'sealTypes',
|
||||||
|
type: 'multi-select',
|
||||||
|
optionsKey: 'sealTypeOptions',
|
||||||
|
},
|
||||||
{ label: '汇率日期', prop: 'exchangeRateDate', type: 'date', required: true },
|
{ label: '汇率日期', prop: 'exchangeRateDate', type: 'date', required: true },
|
||||||
{ label: '结算汇率', prop: 'exchangeRate', type: 'number', required: true },
|
{ label: '结算汇率', prop: 'exchangeRate', type: 'number', required: true },
|
||||||
{ label: '本位币合计', prop: 'localSettlementAmount', readonly: true, money: true },
|
{ label: '本位币合计', prop: 'localSettlementAmount', readonly: true, money: true },
|
||||||
@@ -29,6 +35,7 @@ export const createFormalSettlementForm = () => ({
|
|||||||
sourceDetailIds: [],
|
sourceDetailIds: [],
|
||||||
businessModel: '',
|
businessModel: '',
|
||||||
transportType: '',
|
transportType: '',
|
||||||
|
sealTypes: [],
|
||||||
exchangeRateDate: '',
|
exchangeRateDate: '',
|
||||||
exchangeRate: 1,
|
exchangeRate: 1,
|
||||||
createUserName: '',
|
createUserName: '',
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export const formalSettlementTableColumns = [
|
|||||||
{ label: '原币结算金额', prop: 'settlementAmount', minWidth: 145, money: true },
|
{ label: '原币结算金额', prop: 'settlementAmount', minWidth: 145, money: true },
|
||||||
{ label: '业务模式', prop: 'businessModelName', minWidth: 120 },
|
{ label: '业务模式', prop: 'businessModelName', minWidth: 120 },
|
||||||
{ label: '运输方式', prop: 'transportTypeName', minWidth: 120 },
|
{ label: '运输方式', prop: 'transportTypeName', minWidth: 120 },
|
||||||
|
{ label: '用印类型', prop: 'sealTypes', minWidth: 120 },
|
||||||
{ label: '本位币结算金额', prop: 'localSettlementAmount', minWidth: 155, money: true },
|
{ label: '本位币结算金额', prop: 'localSettlementAmount', minWidth: 155, money: true },
|
||||||
{ label: '结算汇率', prop: 'exchangeRate', minWidth: 110 },
|
{ label: '结算汇率', prop: 'exchangeRate', minWidth: 110 },
|
||||||
{ label: '申请付款金额(含预付)', prop: 'appliedPaymentAmount', minWidth: 185, money: true },
|
{ label: '申请付款金额(含预付)', prop: 'appliedPaymentAmount', minWidth: 185, money: true },
|
||||||
|
|||||||
@@ -26,6 +26,12 @@ export const preSettlementFormFields = [
|
|||||||
{ label: '结算金额', prop: 'settlementAmount', readonly: true, money: true },
|
{ label: '结算金额', prop: 'settlementAmount', readonly: true, money: true },
|
||||||
{ label: '业务模式', prop: 'businessModel', type: 'select', optionsKey: 'businessModelOptions' },
|
{ label: '业务模式', prop: 'businessModel', type: 'select', optionsKey: 'businessModelOptions' },
|
||||||
{ label: '运输方式', prop: 'transportType', type: 'select', optionsKey: 'transportTypeOptions' },
|
{ label: '运输方式', prop: 'transportType', type: 'select', optionsKey: 'transportTypeOptions' },
|
||||||
|
{
|
||||||
|
label: '用印类型',
|
||||||
|
prop: 'sealTypes',
|
||||||
|
type: 'multi-select',
|
||||||
|
optionsKey: 'sealTypeOptions',
|
||||||
|
},
|
||||||
{ label: '汇率日期', prop: 'exchangeRateDate', type: 'date' },
|
{ label: '汇率日期', prop: 'exchangeRateDate', type: 'date' },
|
||||||
{ label: '结算汇率', prop: 'exchangeRate', type: 'number', class: 'exchange-rate-input' },
|
{ label: '结算汇率', prop: 'exchangeRate', type: 'number', class: 'exchange-rate-input' },
|
||||||
{ label: '本位币合计', prop: 'localSettlementAmount', readonly: true, money: true },
|
{ label: '本位币合计', prop: 'localSettlementAmount', readonly: true, money: true },
|
||||||
@@ -82,6 +88,7 @@ export const emptyPreSettlementForm = () => ({
|
|||||||
settlementAmount: 0,
|
settlementAmount: 0,
|
||||||
businessModel: '',
|
businessModel: '',
|
||||||
transportType: '',
|
transportType: '',
|
||||||
|
sealTypes: [],
|
||||||
localCurrency: 'RMB',
|
localCurrency: 'RMB',
|
||||||
localSettlementAmount: 0,
|
localSettlementAmount: 0,
|
||||||
exchangeRateDate: '',
|
exchangeRateDate: '',
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export const preSettlementTableColumns = [
|
|||||||
{ label: '原币结算金额', prop: 'settlementAmount', minWidth: 140, money: true, precision: 2 },
|
{ label: '原币结算金额', prop: 'settlementAmount', minWidth: 140, money: true, precision: 2 },
|
||||||
{ label: '业务模式', prop: 'businessModelName', minWidth: 120 },
|
{ label: '业务模式', prop: 'businessModelName', minWidth: 120 },
|
||||||
{ label: '运输方式', prop: 'transportTypeName', minWidth: 120 },
|
{ label: '运输方式', prop: 'transportTypeName', minWidth: 120 },
|
||||||
|
{ label: '用印类型', prop: 'sealTypes', minWidth: 120 },
|
||||||
{ label: '本位币结算金额', prop: 'localSettlementAmount', minWidth: 150, money: true, precision: 2 },
|
{ label: '本位币结算金额', prop: 'localSettlementAmount', minWidth: 150, money: true, precision: 2 },
|
||||||
{ label: '结算汇率', prop: 'exchangeRate', minWidth: 110, precision: 2 },
|
{ label: '结算汇率', prop: 'exchangeRate', minWidth: 110, precision: 2 },
|
||||||
{
|
{
|
||||||
|
|||||||
+28
-10
@@ -492,17 +492,35 @@ export const treeOption = {
|
|||||||
nodeKey: 'id',
|
nodeKey: 'id',
|
||||||
lazy: true,
|
lazy: true,
|
||||||
treeLoad: function (node, resolve) {
|
treeLoad: function (node, resolve) {
|
||||||
const parentId = node.level === 0 ? 0 : node.data.id;
|
const toTreeNode = item => ({
|
||||||
getDeptLazyTree(parentId).then(res => {
|
...item,
|
||||||
resolve(
|
leaf: !item.hasChildren,
|
||||||
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,
|
addBtn: false,
|
||||||
menu: false,
|
menu: false,
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
@@ -154,7 +154,7 @@ export function isMkApprovedStatus(bizType, approvalStatus) {
|
|||||||
* @param {string} [options.subjectName] 标题后缀
|
* @param {string} [options.subjectName] 标题后缀
|
||||||
* @param {string} [options.approvalStatus] 提交前的审批状态
|
* @param {string} [options.approvalStatus] 提交前的审批状态
|
||||||
* @param {boolean} [options.mkEnabled] 调用方已知开关时传入,false 时立即跳过
|
* @param {boolean} [options.mkEnabled] 调用方已知开关时传入,false 时立即跳过
|
||||||
* @param {Object} [options.tempVarData] 传给 MK 的临时变量(如项目类型 projectType)
|
* @param {Object} [options.tempVarData] 传给 MK 的临时变量(如项目类型 projectType、用印类型 sealTypes)
|
||||||
* @returns {Promise<boolean>} true=已发起/复用 MK 流程,false=未开启或已跳过
|
* @returns {Promise<boolean>} true=已发起/复用 MK 流程,false=未开启或已跳过
|
||||||
*/
|
*/
|
||||||
export async function submitMkApprovalFlow({
|
export async function submitMkApprovalFlow({
|
||||||
|
|||||||
@@ -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('、');
|
||||||
|
};
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
:data="data"
|
:data="data"
|
||||||
ref="crud"
|
ref="crud"
|
||||||
v-model="form"
|
v-model="form"
|
||||||
|
v-model:page="page"
|
||||||
:permission="permissionList"
|
:permission="permissionList"
|
||||||
:before-open="beforeOpen"
|
:before-open="beforeOpen"
|
||||||
@row-del="rowDel"
|
@row-del="rowDel"
|
||||||
@@ -101,7 +102,7 @@
|
|||||||
style="margin-bottom: 12px; background: #f5f7fa; padding: 6px 10px; border-radius: 4px"
|
style="margin-bottom: 12px; background: #f5f7fa; padding: 6px 10px; border-radius: 4px"
|
||||||
>
|
>
|
||||||
<span style="color: #606266; font-size: 13px"
|
<span style="color: #606266; font-size: 13px"
|
||||||
>勾选多个菜单后点击「设置」,可批量配置数据权限;设置后菜单旁展示当前范围</span
|
>仅展示菜单权限已勾选的菜单,已配置的数据权限会保留。勾选多个菜单后点击「设置」可批量配置</span
|
||||||
>
|
>
|
||||||
<el-button type="primary" size="small" @click="openDataScopeSetting">设置</el-button>
|
<el-button type="primary" size="small" @click="openDataScopeSetting">设置</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -729,7 +730,9 @@ export default {
|
|||||||
onLoad(page, params = {}) {
|
onLoad(page, params = {}) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
|
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.loading = false;
|
||||||
this.selectionClear();
|
this.selectionClear();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3949,9 +3949,9 @@ export default {
|
|||||||
return Object.values(groups)
|
return Object.values(groups)
|
||||||
.map(group => {
|
.map(group => {
|
||||||
const quantity = this.formatDispatchQuantity(group.quantity);
|
const quantity = this.formatDispatchQuantity(group.quantity);
|
||||||
return `${group.typeName}等${group.count}种货物 | ${quantity}${
|
const typeName =
|
||||||
group.unit ? ` ${group.unit}` : ''
|
group.count > 1 ? `${group.typeName}等${group.count}种货物` : group.typeName;
|
||||||
}`;
|
return `${typeName} | ${quantity}${group.unit ? ` ${group.unit}` : ''}`;
|
||||||
})
|
})
|
||||||
.join('; ');
|
.join('; ');
|
||||||
},
|
},
|
||||||
@@ -7549,12 +7549,13 @@ export default {
|
|||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
const cargoInfo = Object.values(groups)
|
const cargoInfo = Object.values(groups)
|
||||||
.map(
|
.map(group => {
|
||||||
group =>
|
const typeName =
|
||||||
`${group.cargoType}等${group.count}种货物 | ${this.formatDispatchQuantity(
|
group.count > 1 ? `${group.cargoType}等${group.count}种货物` : group.cargoType;
|
||||||
group.quantity
|
return `${typeName} | ${this.formatDispatchQuantity(group.quantity)}${
|
||||||
)}${group.unit ? ` ${group.unit}` : ''}`
|
group.unit ? ` ${group.unit}` : ''
|
||||||
)
|
}`;
|
||||||
|
})
|
||||||
.join('; ');
|
.join('; ');
|
||||||
return cargoInfo || plan.goodsInfo || '';
|
return cargoInfo || plan.goodsInfo || '';
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5018,9 +5018,9 @@ export default {
|
|||||||
return Object.values(groups)
|
return Object.values(groups)
|
||||||
.map(group => {
|
.map(group => {
|
||||||
const quantity = this.formatQuantity(group.quantity);
|
const quantity = this.formatQuantity(group.quantity);
|
||||||
return `${group.typeName}等${group.count}种货物 | ${quantity}${
|
const typeName =
|
||||||
group.unit ? ` ${group.unit}` : ''
|
group.count > 1 ? `${group.typeName}等${group.count}种货物` : group.typeName;
|
||||||
}`;
|
return `${typeName} | ${quantity}${group.unit ? ` ${group.unit}` : ''}`;
|
||||||
})
|
})
|
||||||
.join('; ');
|
.join('; ');
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -13,8 +13,18 @@ export default {
|
|||||||
components: { MkPublicShell, ContractManageChange },
|
components: { MkPublicShell, ContractManageChange },
|
||||||
methods: {
|
methods: {
|
||||||
getForm() {
|
getForm() {
|
||||||
const row = this.$refs.page?.form || {};
|
const page = this.$refs.page;
|
||||||
return { ...row, subject: row.contractName || row.contractNo || '' };
|
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 || '',
|
||||||
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -69,11 +69,8 @@
|
|||||||
<el-form-item label="合同负责部门">
|
<el-form-item label="合同负责部门">
|
||||||
<el-input v-model="form.organizationName" disabled />
|
<el-input v-model="form.organizationName" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="甲方">
|
<el-form-item label="平台公司">
|
||||||
<el-input v-model="form.partyA" disabled />
|
<el-input v-model="form.platformCompanyName" disabled />
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="乙方">
|
|
||||||
<el-input v-model="form.partyB" disabled />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="签订日期">
|
<el-form-item label="签订日期">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
@@ -272,6 +269,29 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</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
|
<contract-attachment-section
|
||||||
title="用印材料"
|
title="用印材料"
|
||||||
description
|
description
|
||||||
@@ -799,6 +819,13 @@ export default {
|
|||||||
.join('、');
|
.join('、');
|
||||||
return `【${parties || '相对方'}】:被列入外部黑名单;涉贪污受贿裁判相关提及方(3年以上及其他);被执行人信息;买卖合同纠纷;劳动纠纷;重大纠纷。提交变更前须上传「特批附件」类型附件`;
|
return `【${parties || '相对方'}】:被列入外部黑名单;涉贪污受贿裁判相关提及方(3年以上及其他);被执行人信息;买卖合同纠纷;劳动纠纷;重大纠纷。提交变更前须上传「特批附件」类型附件`;
|
||||||
},
|
},
|
||||||
|
partySections() {
|
||||||
|
return [
|
||||||
|
{ role: 'A', label: '甲方', rows: this.partyARows },
|
||||||
|
{ role: 'B', label: '乙方', rows: this.partyBRows },
|
||||||
|
{ role: 'C', label: '丙方', rows: this.partyCRows },
|
||||||
|
];
|
||||||
|
},
|
||||||
isSettlementRuleChange() {
|
isSettlementRuleChange() {
|
||||||
return this.form.changeType === '结算规则变更';
|
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-page :deep(.basic-container__card) { border: 0; background: transparent; box-shadow: none; }
|
||||||
.contract-change-form { background: #f5f6fa; }
|
.contract-change-form { background: #f5f6fa; }
|
||||||
.change-section { padding: 20px 24px; background: #fff; border-bottom: 1px solid #eff1f7; margin-top: 12px; }
|
.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 { 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 > .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; }
|
.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 },
|
components: { MkPublicShell, ContractManage },
|
||||||
methods: {
|
methods: {
|
||||||
getForm() {
|
getForm() {
|
||||||
const row = this.$refs.page?.detailRow || {};
|
const page = this.$refs.page;
|
||||||
return { ...row, subject: row.contractName || row.contractNo || '' };
|
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 || '',
|
||||||
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -174,9 +174,6 @@
|
|||||||
<el-descriptions-item label="项目">{{
|
<el-descriptions-item label="项目">{{
|
||||||
detailValue('projectName')
|
detailValue('projectName')
|
||||||
}}</el-descriptions-item>
|
}}</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="合同期限">{{ detailContractPeriod }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="合同负责部门">{{
|
<el-descriptions-item label="合同负责部门">{{
|
||||||
detailValue('organizationName')
|
detailValue('organizationName')
|
||||||
@@ -239,6 +236,29 @@
|
|||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</section>
|
</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
|
<hcs-contract-panel
|
||||||
v-if="!isPublicViewPage"
|
v-if="!isPublicViewPage"
|
||||||
:contract="detailRow"
|
:contract="detailRow"
|
||||||
@@ -1205,7 +1225,8 @@ import {
|
|||||||
getDetail as getCustomerArchiveDetail,
|
getDetail as getCustomerArchiveDetail,
|
||||||
getList as getCustomerArchiveList,
|
getList as getCustomerArchiveList,
|
||||||
} from '@/api/vehicle/customer-archive';
|
} 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 getSystemDictionary } from '@/api/system/dict';
|
||||||
import { getDictionary as getBizDictionary } from '@/api/system/dictbiz';
|
import { getDictionary as getBizDictionary } from '@/api/system/dictbiz';
|
||||||
import { config, option } from '@/option/business/contract-manage';
|
import { config, option } from '@/option/business/contract-manage';
|
||||||
@@ -1579,6 +1600,9 @@ export default {
|
|||||||
billCycleTypeOptions: ['固定截单日', '自然月', '自定义多周期'],
|
billCycleTypeOptions: ['固定截单日', '自然月', '自定义多周期'],
|
||||||
detailLoading: false,
|
detailLoading: false,
|
||||||
detailRow: {},
|
detailRow: {},
|
||||||
|
detailPartyARows: [],
|
||||||
|
detailPartyBRows: [],
|
||||||
|
detailPartyCRows: [],
|
||||||
// 合规(HCS)推送/对账状态;受 thirdParty.hcs.push.immediate-enabled 控制显隐
|
// 合规(HCS)推送/对账状态;受 thirdParty.hcs.push.immediate-enabled 控制显隐
|
||||||
hcsRepushingId: null,
|
hcsRepushingId: null,
|
||||||
hcsImmediateEnabled: false,
|
hcsImmediateEnabled: false,
|
||||||
@@ -1707,6 +1731,13 @@ export default {
|
|||||||
{ role: 'C', label: '丙方', rows: this.partyCRows },
|
{ 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 个甲方时编辑器自动选中)
|
* - 客户合同:仅甲方(仅 1 个甲方时编辑器自动选中)
|
||||||
@@ -2678,28 +2709,55 @@ export default {
|
|||||||
applyProjectPlatformCompanies(project, autoSelect = false) {
|
applyProjectPlatformCompanies(project, autoSelect = false) {
|
||||||
const ids = this.parseUndertakeDeptIds(project?.undertakeDeptId);
|
const ids = this.parseUndertakeDeptIds(project?.undertakeDeptId);
|
||||||
const names = this.parseUndertakeDeptNames(project?.undertakeDeptName);
|
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),
|
id: String(id),
|
||||||
label: names[index] || String(id),
|
label: names[index] || String(id),
|
||||||
}));
|
}));
|
||||||
if (!autoSelect) {
|
if (!ids.length) return Promise.resolve([]);
|
||||||
this.syncCurrentPlatformCompanyOption();
|
return getPlatformCompanySelect()
|
||||||
return;
|
.then(res => {
|
||||||
}
|
const liveList = (res.data?.data || []).map(item => ({
|
||||||
if (this.platformCompanyOptions.length === 1) {
|
id: String(item.id),
|
||||||
this.form.platformCompanyId = this.platformCompanyOptions[0].id;
|
label: item.deptName || item.fullName || String(item.id),
|
||||||
this.form.platformCompanyName = this.platformCompanyOptions[0].label;
|
}));
|
||||||
} else if (
|
return ids.map((id, index) => {
|
||||||
!this.platformCompanyOptions.some(
|
const name = String(names[index] || '').trim();
|
||||||
item => String(item.id) === String(this.form.platformCompanyId)
|
const byId = liveList.find(item => String(item.id) === String(id));
|
||||||
)
|
if (byId) return byId;
|
||||||
) {
|
const byName = name ? liveList.find(item => item.label === name) : null;
|
||||||
this.form.platformCompanyId = '';
|
if (byName) return byName;
|
||||||
this.form.platformCompanyName = '';
|
return {
|
||||||
} else {
|
id: String(id),
|
||||||
this.handlePlatformCompanyChange(this.form.platformCompanyId);
|
label: name || String(id),
|
||||||
}
|
};
|
||||||
if (this.formMode === 'add') this.refreshPreviewContractNo();
|
});
|
||||||
|
})
|
||||||
|
.catch(() => fallback);
|
||||||
},
|
},
|
||||||
handlePlatformCompanyChange(value) {
|
handlePlatformCompanyChange(value) {
|
||||||
const matched = this.platformCompanyOptions.find(item => String(item.id) === String(value));
|
const matched = this.platformCompanyOptions.find(item => String(item.id) === String(value));
|
||||||
@@ -3093,11 +3151,8 @@ export default {
|
|||||||
this.businessDeptLoading = true;
|
this.businessDeptLoading = true;
|
||||||
getBusinessDeptSelect()
|
getBusinessDeptSelect()
|
||||||
.then(res => {
|
.then(res => {
|
||||||
this.businessDeptOptions = (res.data?.data || []).map(item => ({
|
// 同名业务部门(不同上级公司)展示「部门(上级)」;落库仍用 rawLabel 原始部门名
|
||||||
id: String(item.id),
|
this.businessDeptOptions = normalizeBusinessDeptOptions(res.data?.data || []);
|
||||||
label: item.deptName || item.fullName || String(item.id),
|
|
||||||
rawLabel: item.deptName || item.fullName || String(item.id),
|
|
||||||
}));
|
|
||||||
this.syncCurrentBusinessDeptOption();
|
this.syncCurrentBusinessDeptOption();
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
@@ -3113,6 +3168,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.businessDeptOptions.unshift({
|
this.businessDeptOptions.unshift({
|
||||||
id: String(this.form.organizationId),
|
id: String(this.form.organizationId),
|
||||||
|
value: String(this.form.organizationId),
|
||||||
label: this.form.organizationName,
|
label: this.form.organizationName,
|
||||||
rawLabel: this.form.organizationName,
|
rawLabel: this.form.organizationName,
|
||||||
});
|
});
|
||||||
@@ -3456,6 +3512,9 @@ export default {
|
|||||||
invoiceCycle: normalizeOptionalInteger(detail.invoiceCycle),
|
invoiceCycle: normalizeOptionalInteger(detail.invoiceCycle),
|
||||||
paymentDays: normalizeOptionalInteger(detail.paymentDays),
|
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.detailContractFileRows = normalizeContractFileRows(parseArray(detail.contractFileJson));
|
||||||
this.detailAttachmentRows = parseArray(detail.attachmentsJson);
|
this.detailAttachmentRows = parseArray(detail.attachmentsJson);
|
||||||
this.detailBillingPlanRows = parseArray(detail.billingPlanJson);
|
this.detailBillingPlanRows = parseArray(detail.billingPlanJson);
|
||||||
|
|||||||
@@ -2545,9 +2545,9 @@ export default {
|
|||||||
Object.values(groups)
|
Object.values(groups)
|
||||||
.map(group => {
|
.map(group => {
|
||||||
const quantity = this.formatGoodsQuantity(group.quantity);
|
const quantity = this.formatGoodsQuantity(group.quantity);
|
||||||
return `${group.typeName}等${group.count}种货物 | ${quantity}${
|
const typeName =
|
||||||
group.unit ? ` ${group.unit}` : ''
|
group.count > 1 ? `${group.typeName}等${group.count}种货物` : group.typeName;
|
||||||
}`;
|
return `${typeName} | ${quantity}${group.unit ? ` ${group.unit}` : ''}`;
|
||||||
})
|
})
|
||||||
.join('; ') || '-'
|
.join('; ') || '-'
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -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 {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -916,8 +922,24 @@ export default {
|
|||||||
this.$message.warning('备注不能超过500个字符');
|
this.$message.warning('备注不能超过500个字符');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!this.enabledNodes.length) {
|
const isEnabledNode = key => this.nodeRows.some(item => item.key === key && item.enabled);
|
||||||
this.$message.warning('请至少选择一个过程节点');
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
const transit = this.nodeRows.find(item => item.key === 'transit');
|
const transit = this.nodeRows.find(item => item.key === 'transit');
|
||||||
|
|||||||
@@ -676,7 +676,7 @@
|
|||||||
<div class="project-apply-form__material-head">
|
<div class="project-apply-form__material-head">
|
||||||
<div class="dialog-section-title project-apply-form__material-title">项目材料</div>
|
<div class="dialog-section-title project-apply-form__material-title">项目材料</div>
|
||||||
<span
|
<span
|
||||||
v-if="missingRequiredAttachmentTypes.length"
|
v-if="!isChangeDialog && missingRequiredAttachmentTypes.length"
|
||||||
class="project-apply-form__material-warn"
|
class="project-apply-form__material-warn"
|
||||||
>
|
>
|
||||||
未上传:{{ missingRequiredAttachmentTypes.join('、') }}
|
未上传:{{ missingRequiredAttachmentTypes.join('、') }}
|
||||||
@@ -698,7 +698,11 @@
|
|||||||
<el-table-column type="index" label="序号" width="80" align="center" />
|
<el-table-column type="index" label="序号" width="80" align="center" />
|
||||||
<el-table-column label="附件类型" min-width="160" align="center">
|
<el-table-column label="附件类型" min-width="160" align="center">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-select v-model="row.fileType" placeholder="请选择" :disabled="dialogReadonly">
|
<el-select
|
||||||
|
v-model="row.fileType"
|
||||||
|
placeholder="请选择"
|
||||||
|
:disabled="dialogReadonly || isChangeDialog"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in projectAttachmentTypeOptions"
|
v-for="item in projectAttachmentTypeOptions"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
@@ -731,7 +735,7 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="row.description"
|
v-model="row.description"
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
:disabled="dialogReadonly"
|
:disabled="dialogReadonly || isChangeDialog"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -741,14 +745,26 @@
|
|||||||
<el-table-column prop="uploadUserName" label="上传人" min-width="140" align="center" />
|
<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 prop="uploadTime" label="上传时间" min-width="170" align="center" sortable/>
|
||||||
<el-table-column label="操作" width="110" align="center">
|
<el-table-column label="操作" width="110" align="center">
|
||||||
<template #default="{ $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-link v-if="!dialogReadonly" type="danger" @click="removeAttachment($index)"
|
<el-link
|
||||||
>删除</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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<vehicle-attachment-upload
|
<vehicle-attachment-upload
|
||||||
|
v-if="!isChangeDialog"
|
||||||
v-model="attachmentRows"
|
v-model="attachmentRows"
|
||||||
class="project-apply-form__upload"
|
class="project-apply-form__upload"
|
||||||
:readonly="dialogReadonly"
|
:readonly="dialogReadonly"
|
||||||
@@ -761,6 +777,57 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</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">
|
<template v-if="showProjectContractSection">
|
||||||
<div class="dialog-section-title project-apply-form__table-title">项目合同</div>
|
<div class="dialog-section-title project-apply-form__table-title">项目合同</div>
|
||||||
<el-table
|
<el-table
|
||||||
@@ -1011,6 +1078,86 @@
|
|||||||
@close="attachmentImagePreviewVisible = false"
|
@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
|
<el-dialog
|
||||||
v-model="userBox"
|
v-model="userBox"
|
||||||
title="选择用户"
|
title="选择用户"
|
||||||
@@ -1094,6 +1241,7 @@ import {
|
|||||||
getDetail as getCustomerArchiveDetail,
|
getDetail as getCustomerArchiveDetail,
|
||||||
} from '@/api/vehicle/customer-archive';
|
} from '@/api/vehicle/customer-archive';
|
||||||
import { getBusinessDeptSelect, getPlatformCompanySelect } from '@/api/system/dept';
|
import { getBusinessDeptSelect, getPlatformCompanySelect } from '@/api/system/dept';
|
||||||
|
import { normalizeBusinessDeptOptions } from '@/utils/dept';
|
||||||
import { getDictionary as getSystemDictionary } from '@/api/system/dict';
|
import { getDictionary as getSystemDictionary } from '@/api/system/dict';
|
||||||
import { getDictionary as getBizDictionary } from '@/api/system/dictbiz';
|
import { getDictionary as getBizDictionary } from '@/api/system/dictbiz';
|
||||||
import { getList as getUserList } from '@/api/system/user';
|
import { getList as getUserList } from '@/api/system/user';
|
||||||
@@ -1165,6 +1313,7 @@ const emptyForm = () => ({
|
|||||||
customerJson: '',
|
customerJson: '',
|
||||||
carrierJson: '',
|
carrierJson: '',
|
||||||
attachmentsJson: '',
|
attachmentsJson: '',
|
||||||
|
adjustAttachmentsJson: '',
|
||||||
situationRemark: '',
|
situationRemark: '',
|
||||||
projectIntro: '',
|
projectIntro: '',
|
||||||
profitRemark: '',
|
profitRemark: '',
|
||||||
@@ -1174,6 +1323,24 @@ const emptyForm = () => ({
|
|||||||
changeReason: '',
|
changeReason: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const emptyAdjustAttachmentForm = () => ({
|
||||||
|
uid: '',
|
||||||
|
fileType: '',
|
||||||
|
originalName: '',
|
||||||
|
name: '',
|
||||||
|
fileName: '',
|
||||||
|
url: '',
|
||||||
|
link: '',
|
||||||
|
fileUrl: '',
|
||||||
|
description: '',
|
||||||
|
size: '',
|
||||||
|
uploadUserName: '',
|
||||||
|
uploadTime: '',
|
||||||
|
adjustReason: '',
|
||||||
|
originAttachment: null,
|
||||||
|
originKey: '',
|
||||||
|
});
|
||||||
|
|
||||||
const optionalSentinelFields = [
|
const optionalSentinelFields = [
|
||||||
'projectScale',
|
'projectScale',
|
||||||
'estimatedProfit',
|
'estimatedProfit',
|
||||||
@@ -1448,6 +1615,29 @@ export default {
|
|||||||
customerRows: [],
|
customerRows: [],
|
||||||
carrierRows: [],
|
carrierRows: [],
|
||||||
attachmentRows: [],
|
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: [],
|
selectedAttachmentRows: [],
|
||||||
attachmentImagePreviewVisible: false,
|
attachmentImagePreviewVisible: false,
|
||||||
attachmentImagePreviewUrls: [],
|
attachmentImagePreviewUrls: [],
|
||||||
@@ -2206,6 +2396,9 @@ export default {
|
|||||||
this.customerRows = [];
|
this.customerRows = [];
|
||||||
this.carrierRows = [];
|
this.carrierRows = [];
|
||||||
this.attachmentRows = [];
|
this.attachmentRows = [];
|
||||||
|
this.adjustAttachmentRows = [];
|
||||||
|
this.adjustAttachmentBox = false;
|
||||||
|
this.resetAdjustAttachmentForm();
|
||||||
this.selectedAttachmentRows = [];
|
this.selectedAttachmentRows = [];
|
||||||
this.changeRows = [];
|
this.changeRows = [];
|
||||||
this.projectContractRows = [];
|
this.projectContractRows = [];
|
||||||
@@ -2247,6 +2440,7 @@ export default {
|
|||||||
this.carrierRows = carrierRows;
|
this.carrierRows = carrierRows;
|
||||||
this.attachmentRows = this.parseJsonArray(displayRow.attachmentsJson);
|
this.attachmentRows = this.parseJsonArray(displayRow.attachmentsJson);
|
||||||
this.normalizeAttachmentFileTypes();
|
this.normalizeAttachmentFileTypes();
|
||||||
|
this.adjustAttachmentRows = this.parseJsonArray(displayRow.adjustAttachmentsJson);
|
||||||
this.selectedAttachmentRows = [];
|
this.selectedAttachmentRows = [];
|
||||||
this.changeRows = this.buildChangeRows(displayRow);
|
this.changeRows = this.buildChangeRows(displayRow);
|
||||||
this.selectedCustomerId = this.customerRows
|
this.selectedCustomerId = this.customerRows
|
||||||
@@ -2555,6 +2749,9 @@ export default {
|
|||||||
customerJson: JSON.stringify(this.customerRows),
|
customerJson: JSON.stringify(this.customerRows),
|
||||||
carrierJson: JSON.stringify(this.carrierRows),
|
carrierJson: JSON.stringify(this.carrierRows),
|
||||||
attachmentsJson: JSON.stringify(this.attachmentRows),
|
attachmentsJson: JSON.stringify(this.attachmentRows),
|
||||||
|
adjustAttachmentsJson: this.isChangeDialog
|
||||||
|
? JSON.stringify(this.adjustAttachmentRows || [])
|
||||||
|
: undefined,
|
||||||
situationRemark: JSON.stringify({
|
situationRemark: JSON.stringify({
|
||||||
projectIntro: this.form.projectIntro || '',
|
projectIntro: this.form.projectIntro || '',
|
||||||
profitRemark: this.form.profitRemark || '',
|
profitRemark: this.form.profitRemark || '',
|
||||||
@@ -2570,6 +2767,9 @@ export default {
|
|||||||
if (this.isNewProjectDialog && !options.includeChangeType) {
|
if (this.isNewProjectDialog && !options.includeChangeType) {
|
||||||
delete submitRow.changeReason;
|
delete submitRow.changeReason;
|
||||||
}
|
}
|
||||||
|
if (!this.isChangeDialog) {
|
||||||
|
delete submitRow.adjustAttachmentsJson;
|
||||||
|
}
|
||||||
['projectIntro', 'profitRemark', 'riskPoint', 'emergencyPlan'].forEach(
|
['projectIntro', 'profitRemark', 'riskPoint', 'emergencyPlan'].forEach(
|
||||||
key => delete submitRow[key]
|
key => delete submitRow[key]
|
||||||
);
|
);
|
||||||
@@ -2979,19 +3179,8 @@ export default {
|
|||||||
loadDeptOptions() {
|
loadDeptOptions() {
|
||||||
getBusinessDeptSelect()
|
getBusinessDeptSelect()
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const bizList = res.data.data || [];
|
// 仅展示「是否业务部门=是」;同名部门追加上级组织名区分
|
||||||
// 仅展示「是否业务部门=是」的本级部门,扁平下拉
|
this.deptOptions = normalizeBusinessDeptOptions(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.fillDefaultBusinessDept();
|
||||||
this.ensureCurrentBusinessDeptOption();
|
this.ensureCurrentBusinessDeptOption();
|
||||||
})
|
})
|
||||||
@@ -3201,6 +3390,112 @@ export default {
|
|||||||
removeAttachment(index) {
|
removeAttachment(index) {
|
||||||
this.attachmentRows.splice(index, 1);
|
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) {
|
formatFileSize(size) {
|
||||||
const number = Number(size);
|
const number = Number(size);
|
||||||
if (!number) return '';
|
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) {
|
@media (max-width: 1200px) {
|
||||||
.project-apply-form {
|
.project-apply-form {
|
||||||
&__grid {
|
&__grid {
|
||||||
|
|||||||
@@ -2,16 +2,40 @@
|
|||||||
<div ref="page" class="mk-public-biz-view">
|
<div ref="page" class="mk-public-biz-view">
|
||||||
<basic-container>
|
<basic-container>
|
||||||
<div class="mk-public-biz-view__title">{{ pageTitle }}</div>
|
<div class="mk-public-biz-view__title">{{ pageTitle }}</div>
|
||||||
<el-descriptions v-if="detail" :column="2" border>
|
<template v-if="detail">
|
||||||
<el-descriptions-item
|
<el-descriptions :column="2" border>
|
||||||
v-for="item in visibleFields"
|
<el-descriptions-item
|
||||||
:key="item.prop"
|
v-for="item in visibleFields"
|
||||||
:label="item.label"
|
:key="item.prop"
|
||||||
:span="item.span || 1"
|
: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]) }}
|
<div class="mk-public-biz-view__party-title">{{ party.label }}</div>
|
||||||
</el-descriptions-item>
|
<el-table :data="party.rows" border empty-text="暂无数据">
|
||||||
</el-descriptions>
|
<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="暂无数据" />
|
<el-empty v-else description="暂无数据" />
|
||||||
</basic-container>
|
</basic-container>
|
||||||
</div>
|
</div>
|
||||||
@@ -19,6 +43,36 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getMkPublicDetail, postMkPublicProcessMessage } from '@/api/mk-process';
|
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 = {
|
const FIELD_MAP = {
|
||||||
'project-apply': [
|
'project-apply': [
|
||||||
@@ -38,8 +92,6 @@ const FIELD_MAP = {
|
|||||||
{ label: '审核状态', prop: 'approvalStatusName' },
|
{ label: '审核状态', prop: 'approvalStatusName' },
|
||||||
{ label: '当前节点', prop: 'currentNode' },
|
{ label: '当前节点', prop: 'currentNode' },
|
||||||
{ label: '当前处理人', prop: 'currentProcessor' },
|
{ label: '当前处理人', prop: 'currentProcessor' },
|
||||||
{ label: '甲方', prop: 'partyA' },
|
|
||||||
{ label: '乙方', prop: 'partyB' },
|
|
||||||
{ label: '项目名称', prop: 'projectName', span: 2 },
|
{ label: '项目名称', prop: 'projectName', span: 2 },
|
||||||
],
|
],
|
||||||
'pre-settlement': [
|
'pre-settlement': [
|
||||||
@@ -47,6 +99,7 @@ const FIELD_MAP = {
|
|||||||
{ label: '合同名称', prop: 'contractName' },
|
{ label: '合同名称', prop: 'contractName' },
|
||||||
{ label: '项目名称', prop: 'projectName' },
|
{ label: '项目名称', prop: 'projectName' },
|
||||||
{ label: '结算金额', prop: 'settlementAmount' },
|
{ label: '结算金额', prop: 'settlementAmount' },
|
||||||
|
{ label: '用印类型', prop: 'sealTypes' },
|
||||||
{ label: '审核状态', prop: 'approvalStatusName' },
|
{ label: '审核状态', prop: 'approvalStatusName' },
|
||||||
{ label: '当前节点', prop: 'currentNode' },
|
{ label: '当前节点', prop: 'currentNode' },
|
||||||
{ label: '当前处理人', prop: 'currentProcessor' },
|
{ label: '当前处理人', prop: 'currentProcessor' },
|
||||||
@@ -58,6 +111,7 @@ const FIELD_MAP = {
|
|||||||
{ label: '项目名称', prop: 'projectName' },
|
{ label: '项目名称', prop: 'projectName' },
|
||||||
{ label: '合同名称', prop: 'contractName' },
|
{ label: '合同名称', prop: 'contractName' },
|
||||||
{ label: '结算金额', prop: 'settlementAmount' },
|
{ label: '结算金额', prop: 'settlementAmount' },
|
||||||
|
{ label: '用印类型', prop: 'sealTypes' },
|
||||||
{ label: '审核状态', prop: 'approvalStatusName' },
|
{ label: '审核状态', prop: 'approvalStatusName' },
|
||||||
{ label: '当前节点', prop: 'currentNode' },
|
{ label: '当前节点', prop: 'currentNode' },
|
||||||
{ label: '当前处理人', prop: 'currentProcessor' },
|
{ label: '当前处理人', prop: 'currentProcessor' },
|
||||||
@@ -99,6 +153,26 @@ export default {
|
|||||||
visibleFields() {
|
visibleFields() {
|
||||||
return FIELD_MAP[this.bizType] || [];
|
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() {
|
created() {
|
||||||
this.handleIframeHeight = () => this.sendIframeHeight();
|
this.handleIframeHeight = () => this.sendIframeHeight();
|
||||||
@@ -192,6 +266,7 @@ export default {
|
|||||||
id: this.getFormId() || detail.id,
|
id: this.getFormId() || detail.id,
|
||||||
subject: this.pageTitle,
|
subject: this.pageTitle,
|
||||||
formInstanceId: this.getFormId(),
|
formInstanceId: this.getFormId(),
|
||||||
|
sealTypes: formatSealTypes(detail.sealTypes) || detail.sealTypes || '',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
getFormId() {
|
getFormId() {
|
||||||
@@ -205,6 +280,12 @@ export default {
|
|||||||
''
|
''
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
fieldDisplayValue(prop, value) {
|
||||||
|
if (prop === 'sealTypes') {
|
||||||
|
return formatSealTypes(value) || '-';
|
||||||
|
}
|
||||||
|
return this.displayValue(value);
|
||||||
|
},
|
||||||
displayValue(value) {
|
displayValue(value) {
|
||||||
if (value === null || value === undefined || value === '') return '-';
|
if (value === null || value === undefined || value === '') return '-';
|
||||||
if (Array.isArray(value)) return value.join('、') || '-';
|
if (Array.isArray(value)) return value.join('、') || '-';
|
||||||
@@ -255,5 +336,33 @@ html.mk-iframe-page #app.mk-iframe-page {
|
|||||||
background: #409eff;
|
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>
|
</style>
|
||||||
|
|||||||
@@ -78,6 +78,22 @@
|
|||||||
:value="item.dictKey"
|
:value="item.dictKey"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</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
|
<span
|
||||||
v-else-if="field.prop === 'formalSettlementNo'"
|
v-else-if="field.prop === 'formalSettlementNo'"
|
||||||
:class="{ 'form-readonly--code': form.formalSettlementNo }"
|
:class="{ 'form-readonly--code': form.formalSettlementNo }"
|
||||||
@@ -85,7 +101,7 @@
|
|||||||
{{ form.formalSettlementNo || (form.id ? '-' : '系统自动生成') }}
|
{{ form.formalSettlementNo || (form.id ? '-' : '系统自动生成') }}
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="field.money">{{ formatMoney(form[field.prop]) }}</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])
|
formSelectLabel(field, form[field.prop])
|
||||||
}}</span>
|
}}</span>
|
||||||
<span v-else-if="field.type === 'contract'">{{
|
<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 ProjectAdvanceWriteOff from './project-advance-write-off.vue';
|
||||||
import * as XLSX from 'xlsx';
|
import * as XLSX from 'xlsx';
|
||||||
import { isAdministrator } from '@/utils/auth';
|
import { isAdministrator } from '@/utils/auth';
|
||||||
|
import {
|
||||||
|
formatSealTypes,
|
||||||
|
parseSealTypes,
|
||||||
|
SETTLEMENT_SEAL_TYPE_OPTIONS,
|
||||||
|
} from '@/utils/settlement-seal';
|
||||||
import * as settlementAdjustmentApi from '@/api/settlement/settlementAdjustment';
|
import * as settlementAdjustmentApi from '@/api/settlement/settlementAdjustment';
|
||||||
|
|
||||||
// 结算币种为本位币(人民币)时汇率恒为1,汇率日期、结算汇率与按汇率换算的本位币合计都不展示
|
// 结算币种为本位币(人民币)时汇率恒为1,汇率日期、结算汇率与按汇率换算的本位币合计都不展示
|
||||||
@@ -1235,6 +1256,7 @@ export default {
|
|||||||
feeCategoryOptions: [],
|
feeCategoryOptions: [],
|
||||||
businessModelOptions: [],
|
businessModelOptions: [],
|
||||||
transportTypeOptions: [],
|
transportTypeOptions: [],
|
||||||
|
sealTypeOptions: SETTLEMENT_SEAL_TYPE_OPTIONS,
|
||||||
fields: formalSettlementFormFields,
|
fields: formalSettlementFormFields,
|
||||||
sourceTableColumns: sourceColumns,
|
sourceTableColumns: sourceColumns,
|
||||||
summaryTableColumns: summaryColumns,
|
summaryTableColumns: summaryColumns,
|
||||||
@@ -1498,6 +1520,7 @@ export default {
|
|||||||
this.form = {
|
this.form = {
|
||||||
...createFormalSettlementForm(),
|
...createFormalSettlementForm(),
|
||||||
...data,
|
...data,
|
||||||
|
sealTypes: parseSealTypes(data.sealTypes),
|
||||||
sourcePreSettlementIds: (data.sources || []).map(item => item.preSettlementId),
|
sourcePreSettlementIds: (data.sources || []).map(item => item.preSettlementId),
|
||||||
sourceDetailIds: (data.details || [])
|
sourceDetailIds: (data.details || [])
|
||||||
.filter(item => !item.sourcePreSettlementId)
|
.filter(item => !item.sourcePreSettlementId)
|
||||||
@@ -1702,6 +1725,7 @@ export default {
|
|||||||
contractId,
|
contractId,
|
||||||
settlementType,
|
settlementType,
|
||||||
settlementTypeName: settlementType === 'receivable' ? '应收' : '应付',
|
settlementTypeName: settlementType === 'receivable' ? '应收' : '应付',
|
||||||
|
sealTypes: parseSealTypes(first.sealTypes),
|
||||||
sourcePreSettlementIds: this.form.sourcePreSettlementIds,
|
sourcePreSettlementIds: this.form.sourcePreSettlementIds,
|
||||||
});
|
});
|
||||||
const responses = await Promise.all(
|
const responses = await Promise.all(
|
||||||
@@ -1944,6 +1968,7 @@ export default {
|
|||||||
Object.assign(this.form, this.sources[0], {
|
Object.assign(this.form, this.sources[0], {
|
||||||
contractId: this.sources[0].contractId,
|
contractId: this.sources[0].contractId,
|
||||||
formalSettlementNo: this.form.formalSettlementNo,
|
formalSettlementNo: this.form.formalSettlementNo,
|
||||||
|
sealTypes: parseSealTypes(this.sources[0].sealTypes),
|
||||||
});
|
});
|
||||||
this.refreshFormalSettlementNo();
|
this.refreshFormalSettlementNo();
|
||||||
}
|
}
|
||||||
@@ -2993,6 +3018,7 @@ export default {
|
|||||||
})),
|
})),
|
||||||
businessModel: this.form.businessModel || undefined,
|
businessModel: this.form.businessModel || undefined,
|
||||||
transportType: this.form.transportType || undefined,
|
transportType: this.form.transportType || undefined,
|
||||||
|
sealTypes: formatSealTypes(this.form.sealTypes) || undefined,
|
||||||
exchangeRateDate: this.form.exchangeRateDate,
|
exchangeRateDate: this.form.exchangeRateDate,
|
||||||
exchangeRate: this.form.exchangeRate,
|
exchangeRate: this.form.exchangeRate,
|
||||||
summaryFees: this.summaryFees
|
summaryFees: this.summaryFees
|
||||||
@@ -3205,6 +3231,9 @@ export default {
|
|||||||
return Array.isArray(options) ? options : [];
|
return Array.isArray(options) ? options : [];
|
||||||
},
|
},
|
||||||
formSelectLabel(field, value) {
|
formSelectLabel(field, value) {
|
||||||
|
if (field?.type === 'multi-select') {
|
||||||
|
return formatSealTypes(value) || '-';
|
||||||
|
}
|
||||||
if (value === undefined || value === null || value === '') return '-';
|
if (value === undefined || value === null || value === '') return '-';
|
||||||
const normalized = String(value).trim();
|
const normalized = String(value).trim();
|
||||||
const option = this.formSelectOptions(field).find(
|
const option = this.formSelectOptions(field).find(
|
||||||
|
|||||||
@@ -67,7 +67,26 @@
|
|||||||
:value="item.dictKey"
|
:value="item.dictKey"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</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]) }}
|
{{ formSelectLabel(field, form[field.prop]) }}
|
||||||
</span>
|
</span>
|
||||||
<el-input
|
<el-input
|
||||||
@@ -1025,6 +1044,11 @@ import { downloadFileByUrl } from '@/utils/util';
|
|||||||
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||||
import * as XLSX from 'xlsx';
|
import * as XLSX from 'xlsx';
|
||||||
import { isAdministrator } from '@/utils/auth';
|
import { isAdministrator } from '@/utils/auth';
|
||||||
|
import {
|
||||||
|
formatSealTypes,
|
||||||
|
parseSealTypes,
|
||||||
|
SETTLEMENT_SEAL_TYPE_OPTIONS,
|
||||||
|
} from '@/utils/settlement-seal';
|
||||||
|
|
||||||
// 结算币种为本位币(人民币)时汇率恒为1,汇率日期、结算汇率与按汇率换算的本位币合计都不展示
|
// 结算币种为本位币(人民币)时汇率恒为1,汇率日期、结算汇率与按汇率换算的本位币合计都不展示
|
||||||
const LOCAL_CURRENCY_HIDDEN_FIELDS = ['exchangeRateDate', 'exchangeRate', 'localSettlementAmount'];
|
const LOCAL_CURRENCY_HIDDEN_FIELDS = ['exchangeRateDate', 'exchangeRate', 'localSettlementAmount'];
|
||||||
@@ -1117,6 +1141,7 @@ export default {
|
|||||||
feeCategoryOptions: [],
|
feeCategoryOptions: [],
|
||||||
businessModelOptions: [],
|
businessModelOptions: [],
|
||||||
transportTypeOptions: [],
|
transportTypeOptions: [],
|
||||||
|
sealTypeOptions: SETTLEMENT_SEAL_TYPE_OPTIONS,
|
||||||
summaryFees: [],
|
summaryFees: [],
|
||||||
details: [],
|
details: [],
|
||||||
detailCollapsed: false,
|
detailCollapsed: false,
|
||||||
@@ -1553,7 +1578,11 @@ export default {
|
|||||||
? await getMkPublicDetail('pre-settlement', this.form.id || this.recordId)
|
? await getMkPublicDetail('pre-settlement', this.form.id || this.recordId)
|
||||||
: await getDetail(this.form.id || this.recordId);
|
: await getDetail(this.form.id || this.recordId);
|
||||||
const detail = response.data?.data || {};
|
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.summaryFees = (detail.summaryFees || []).map(row => ({ ...row }));
|
||||||
this.details = (detail.details || []).map(row => this.normalizeSourceDetail(row));
|
this.details = (detail.details || []).map(row => this.normalizeSourceDetail(row));
|
||||||
this.detailPage.current = 1;
|
this.detailPage.current = 1;
|
||||||
@@ -1717,6 +1746,9 @@ export default {
|
|||||||
return Array.isArray(options) ? options : [];
|
return Array.isArray(options) ? options : [];
|
||||||
},
|
},
|
||||||
formSelectLabel(field, value) {
|
formSelectLabel(field, value) {
|
||||||
|
if (field?.type === 'multi-select') {
|
||||||
|
return formatSealTypes(value) || '-';
|
||||||
|
}
|
||||||
if (value === undefined || value === null || value === '') return '-';
|
if (value === undefined || value === null || value === '') return '-';
|
||||||
const normalized = String(value).trim();
|
const normalized = String(value).trim();
|
||||||
const option = this.formSelectOptions(field).find(
|
const option = this.formSelectOptions(field).find(
|
||||||
@@ -1942,6 +1974,9 @@ export default {
|
|||||||
subjectName: this.form.preSettlementNo || this.form.contractName || '',
|
subjectName: this.form.preSettlementNo || this.form.contractName || '',
|
||||||
approvalStatus: previousApprovalStatus,
|
approvalStatus: previousApprovalStatus,
|
||||||
mkEnabled: await loadMkEnabled().catch(() => false),
|
mkEnabled: await loadMkEnabled().catch(() => false),
|
||||||
|
tempVarData: {
|
||||||
|
sealTypes: formatSealTypes(this.form.sealTypes) || '',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
this.$message.success(mkStarted ? '审批流程已发起' : '提交成功');
|
this.$message.success(mkStarted ? '审批流程已发起' : '提交成功');
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
@@ -1961,6 +1996,7 @@ export default {
|
|||||||
contractId: this.form.contractId,
|
contractId: this.form.contractId,
|
||||||
businessModel: this.form.businessModel || undefined,
|
businessModel: this.form.businessModel || undefined,
|
||||||
transportType: this.form.transportType || undefined,
|
transportType: this.form.transportType || undefined,
|
||||||
|
sealTypes: formatSealTypes(this.form.sealTypes) || undefined,
|
||||||
exchangeRateDate: this.form.exchangeRateDate || undefined,
|
exchangeRateDate: this.form.exchangeRateDate || undefined,
|
||||||
exchangeRate: this.form.exchangeRate,
|
exchangeRate: this.form.exchangeRate,
|
||||||
attachmentsJson: JSON.stringify(this.attachments || []),
|
attachmentsJson: JSON.stringify(this.attachments || []),
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import MkPublicShell from '@/views/mk/mk-public-shell.vue';
|
import MkPublicShell from '@/views/mk/mk-public-shell.vue';
|
||||||
import FormalSettlementEditor from '@/views/settlement/components/formal-settlement-editor.vue';
|
import FormalSettlementEditor from '@/views/settlement/components/formal-settlement-editor.vue';
|
||||||
|
import { formatSealTypes } from '@/utils/settlement-seal';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'FormalSettlementPublicView',
|
name: 'FormalSettlementPublicView',
|
||||||
@@ -29,7 +30,11 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
getForm() {
|
getForm() {
|
||||||
const form = this.$refs.page?.form || {};
|
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 InvoiceReceiptCandidatesDialog from './components/invoice-receipt-candidates-dialog.vue';
|
||||||
import { submitMkApprovalFlow, loadMkEnabled } from '@/utils/mk-approval';
|
import { submitMkApprovalFlow, loadMkEnabled } from '@/utils/mk-approval';
|
||||||
import { getMKApprovalUrl } from '@/api/system/business-process';
|
import { getMKApprovalUrl } from '@/api/system/business-process';
|
||||||
|
import { formatSealTypes } from '@/utils/settlement-seal';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'FormalSettlement',
|
name: 'FormalSettlement',
|
||||||
@@ -507,6 +508,9 @@ export default {
|
|||||||
subjectName: row.formalSettlementNo || '',
|
subjectName: row.formalSettlementNo || '',
|
||||||
approvalStatus: previousApprovalStatus,
|
approvalStatus: previousApprovalStatus,
|
||||||
mkEnabled: this.mkEnabled,
|
mkEnabled: this.mkEnabled,
|
||||||
|
tempVarData: {
|
||||||
|
sealTypes: formatSealTypes(row.sealTypes) || '',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
this.$message.success('提交成功');
|
this.$message.success('提交成功');
|
||||||
this.onLoad(this.page);
|
this.onLoad(this.page);
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import MkPublicShell from '@/views/mk/mk-public-shell.vue';
|
import MkPublicShell from '@/views/mk/mk-public-shell.vue';
|
||||||
import PreSettlementEditor from '@/views/settlement/components/pre-settlement-editor.vue';
|
import PreSettlementEditor from '@/views/settlement/components/pre-settlement-editor.vue';
|
||||||
|
import { formatSealTypes } from '@/utils/settlement-seal';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'PreSettlementPublicView',
|
name: 'PreSettlementPublicView',
|
||||||
@@ -29,7 +30,11 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
getForm() {
|
getForm() {
|
||||||
const form = this.$refs.page?.form || {};
|
const form = this.$refs.page?.form || {};
|
||||||
return { ...form, subject: form.preSettlementNo || form.contractName || '' };
|
return {
|
||||||
|
...form,
|
||||||
|
sealTypes: formatSealTypes(form.sealTypes) || '',
|
||||||
|
subject: form.preSettlementNo || form.contractName || '',
|
||||||
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -148,6 +148,9 @@
|
|||||||
<span v-else-if="column.prop === 'sourceType'">
|
<span v-else-if="column.prop === 'sourceType'">
|
||||||
{{ row[column.prop] === '应收应付' ? '应付' : displayValue(row[column.prop]) }}
|
{{ row[column.prop] === '应收应付' ? '应付' : displayValue(row[column.prop]) }}
|
||||||
</span>
|
</span>
|
||||||
|
<span v-else-if="column.prop === 'sealTypes'">
|
||||||
|
{{ formatSealTypes(row[column.prop]) || '-' }}
|
||||||
|
</span>
|
||||||
<span v-else>{{ displayValue(row[column.prop]) }}</span>
|
<span v-else>{{ displayValue(row[column.prop]) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -306,6 +309,7 @@ import { preSettlementSearchFields } from '@/option/settlement/preSettlementSear
|
|||||||
import organizationSearch from '@/mixins/organization-search';
|
import organizationSearch from '@/mixins/organization-search';
|
||||||
import { preSettlementTableColumns } from '@/option/settlement/preSettlementTable';
|
import { preSettlementTableColumns } from '@/option/settlement/preSettlementTable';
|
||||||
import { createSettlementTransfer } from '@/utils/settlement-transfer';
|
import { createSettlementTransfer } from '@/utils/settlement-transfer';
|
||||||
|
import { formatSealTypes } from '@/utils/settlement-seal';
|
||||||
import { downloadFile } from '@/utils/util';
|
import { downloadFile } from '@/utils/util';
|
||||||
import { getMKApprovalUrl } from '@/api/system/business-process';
|
import { getMKApprovalUrl } from '@/api/system/business-process';
|
||||||
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||||
@@ -401,6 +405,7 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
formatSealTypes,
|
||||||
hasPermission(code) {
|
hasPermission(code) {
|
||||||
return this.isAdmin || this.validData(this.permission?.[code], false);
|
return this.isAdmin || this.validData(this.permission?.[code], false);
|
||||||
},
|
},
|
||||||
@@ -670,6 +675,9 @@ export default {
|
|||||||
subjectName: row.preSettlementNo || '',
|
subjectName: row.preSettlementNo || '',
|
||||||
approvalStatus: previousApprovalStatus,
|
approvalStatus: previousApprovalStatus,
|
||||||
mkEnabled: this.mkEnabled,
|
mkEnabled: this.mkEnabled,
|
||||||
|
tempVarData: {
|
||||||
|
sealTypes: formatSealTypes(row.sealTypes) || '',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
this.$message.success('提交成功');
|
this.$message.success('提交成功');
|
||||||
this.loadTable();
|
this.loadTable();
|
||||||
|
|||||||
@@ -1067,7 +1067,8 @@ import { formatContractOptionLabel } from '@/utils/contract';
|
|||||||
import { isTierUnitPrice, isUnitPriceAdjustable } from '@/utils/settlement-adjust-rule';
|
import { isTierUnitPrice, isUnitPriceAdjustable } from '@/utils/settlement-adjust-rule';
|
||||||
import { downloadXls } from '@/utils/util';
|
import { downloadXls } from '@/utils/util';
|
||||||
import { createSettlementTransfer } from '@/utils/settlement-transfer';
|
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 {
|
import {
|
||||||
contractApprovalStatusOptions,
|
contractApprovalStatusOptions,
|
||||||
contractCategoryOptions,
|
contractCategoryOptions,
|
||||||
@@ -1921,8 +1922,9 @@ export default {
|
|||||||
this.openSettlementDetail('/settlement/pre-settlement', row.preSettlementNo);
|
this.openSettlementDetail('/settlement/pre-settlement', row.preSettlementNo);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.settlementType === 'payable' && column.prop === 'formalSettlementNo') {
|
// 正式结算单号:跳转付款/收款结算单表单页并打开详情(与开票申请等入口一致)
|
||||||
this.openSettlementDetail('/settlement/payment-settlement', row.formalSettlementNo);
|
if (column.prop === 'formalSettlementNo') {
|
||||||
|
this.openFormalSettlementDetail(row.formalSettlementNo);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.openDetailDialog(row);
|
this.openDetailDialog(row);
|
||||||
@@ -1934,6 +1936,42 @@ export default {
|
|||||||
}
|
}
|
||||||
this.$router.push({ path, query: { detailNo } });
|
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) {
|
async openRouteDetail(detailId = this.$route.query.detailId) {
|
||||||
// 结算明细点「单据号」会带 detailId 跳到本页;只有当前停在应收/应付明细页时才自动展开详情
|
// 结算明细点「单据号」会带 detailId 跳到本页;只有当前停在应收/应付明细页时才自动展开详情
|
||||||
const routePath =
|
const routePath =
|
||||||
|
|||||||
@@ -93,6 +93,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { getList, getDetail, submit, remove } from '@/api/system/business-dept-config';
|
import { getList, getDetail, submit, remove } from '@/api/system/business-dept-config';
|
||||||
import { getBusinessDeptSelect, getPlatformCompanySelect } from '@/api/system/dept';
|
import { getBusinessDeptSelect, getPlatformCompanySelect } from '@/api/system/dept';
|
||||||
|
import { normalizeBusinessDeptOptions } from '@/utils/dept';
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -154,8 +155,9 @@ export default {
|
|||||||
{
|
{
|
||||||
label: '业务部门',
|
label: '业务部门',
|
||||||
prop: 'businessDeptName',
|
prop: 'businessDeptName',
|
||||||
minWidth: 160,
|
minWidth: 260,
|
||||||
display: false,
|
display: false,
|
||||||
|
formatter: row => this.formatBusinessDeptLabel(row),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '平台公司',
|
label: '平台公司',
|
||||||
@@ -277,11 +279,16 @@ export default {
|
|||||||
Promise.all([getPlatformCompanySelect(), getBusinessDeptSelect()]).then(
|
Promise.all([getPlatformCompanySelect(), getBusinessDeptSelect()]).then(
|
||||||
([platformRes, businessRes]) => {
|
([platformRes, businessRes]) => {
|
||||||
this.platformCompanyOptions = this.normalizeDeptOptions(platformRes?.data?.data);
|
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');
|
const platformColumn = this.findColumn(this.option.column, 'platformCompanyId');
|
||||||
if (platformColumn) platformColumn.dicData = this.platformCompanyOptions;
|
if (platformColumn) platformColumn.dicData = this.platformCompanyOptions;
|
||||||
const businessColumn = this.findColumn(this.option.column, 'businessDeptId');
|
const businessColumn = this.findColumn(this.option.column, 'businessDeptId');
|
||||||
if (businessColumn) businessColumn.dicData = this.businessDeptOptions;
|
if (businessColumn) businessColumn.dicData = this.businessDeptOptions;
|
||||||
|
// 下拉选项就绪后刷新列表展示名(避免列表先于选项返回时只显示裸部门名)
|
||||||
|
this.refreshBusinessDeptLabels();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -292,6 +299,19 @@ export default {
|
|||||||
kingdeeDeptCode: item.kingdeeDeptCode || '',
|
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) {
|
formatSerial(value) {
|
||||||
// Avue number 空值常落成 -1,历史脏数据也按空展示
|
// Avue number 空值常落成 -1,历史脏数据也按空展示
|
||||||
if (value === null || value === undefined || value === '' || value === -1 || value === '-1') {
|
if (value === null || value === undefined || value === '' || value === -1 || value === '-1') {
|
||||||
@@ -317,13 +337,15 @@ export default {
|
|||||||
},
|
},
|
||||||
handleBusinessDeptChange(value) {
|
handleBusinessDeptChange(value) {
|
||||||
const matched = this.businessDeptOptions.find(item => String(item.value) === String(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) {
|
beforeOpen(done, type) {
|
||||||
const loadOptions = Promise.all([getPlatformCompanySelect(), getBusinessDeptSelect()]).then(
|
const loadOptions = Promise.all([getPlatformCompanySelect(), getBusinessDeptSelect()]).then(
|
||||||
([platformRes, businessRes]) => {
|
([platformRes, businessRes]) => {
|
||||||
this.platformCompanyOptions = this.normalizeDeptOptions(platformRes?.data?.data);
|
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');
|
const platformColumn = this.findColumn(this.option.column, 'platformCompanyId');
|
||||||
if (platformColumn) platformColumn.dicData = this.platformCompanyOptions;
|
if (platformColumn) platformColumn.dicData = this.platformCompanyOptions;
|
||||||
const businessColumn = this.findColumn(this.option.column, 'businessDeptId');
|
const businessColumn = this.findColumn(this.option.column, 'businessDeptId');
|
||||||
|
|||||||
@@ -66,17 +66,21 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #dataScopeDeptIds-form>
|
<template #dataScopeDeptIds-form>
|
||||||
<el-tree
|
<!-- 与用户管理「数据管理权限」一致:组织多选级联,数据源同左侧组织树 -->
|
||||||
|
<el-cascader
|
||||||
v-if="Number(form.dataScopeRange) === 3"
|
v-if="Number(form.dataScopeRange) === 3"
|
||||||
ref="dataScopeTree"
|
v-model="dataScopeCascaderValue"
|
||||||
:data="permissionDeptTree"
|
:options="permissionDeptTree"
|
||||||
show-checkbox
|
:props="deptCascaderProps"
|
||||||
node-key="id"
|
:disabled="isViewMode"
|
||||||
:default-checked-keys="form.dataScopeDeptIds || []"
|
clearable
|
||||||
:props="{ label: 'title', children: 'children' }"
|
filterable
|
||||||
@check="handleDataScopeCheck"
|
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>
|
||||||
<template #menu="{ row, index }">
|
<template #menu="{ row, index }">
|
||||||
<el-link
|
<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() {
|
created() {
|
||||||
this.sensitiveManager = sensitive.create({
|
this.sensitiveManager = sensitive.create({
|
||||||
@@ -228,12 +252,6 @@ export default {
|
|||||||
this.permissionDeptTree = res.data.data || [];
|
this.permissionDeptTree = res.data.data || [];
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleDataScopeCheck(_, checked) {
|
|
||||||
if (this.isViewMode) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.form.dataScopeDeptIds = checked.checkedKeys || [];
|
|
||||||
},
|
|
||||||
normalizeSubmitRow(row = {}, isUpdate = false) {
|
normalizeSubmitRow(row = {}, isUpdate = false) {
|
||||||
let payload = { ...row };
|
let payload = { ...row };
|
||||||
// 编辑时剔除未改动的脱敏字段,避免把 138****8000 写回库
|
// 编辑时剔除未改动的脱敏字段,避免把 138****8000 写回库
|
||||||
@@ -278,17 +296,19 @@ export default {
|
|||||||
detail.identities = detail.identities.split(',').filter(Boolean);
|
detail.identities = detail.identities.split(',').filter(Boolean);
|
||||||
}
|
}
|
||||||
const deptIds = func.split(detail.deptId || '');
|
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 = {
|
this.form = {
|
||||||
...detail,
|
...detail,
|
||||||
deptId: Array.isArray(deptIds) ? deptIds : [],
|
deptId: Array.isArray(deptIds) ? deptIds : [],
|
||||||
dataScopeRange: detail.dataScopeRange || 1,
|
dataScopeRange: detail.dataScopeRange || 1,
|
||||||
dataLevelRange: detail.dataLevelRange || 1,
|
dataLevelRange: detail.dataLevelRange || 1,
|
||||||
dataScopeDeptIds: detail.dataScopeDeptIds || [],
|
dataScopeDeptIds,
|
||||||
};
|
};
|
||||||
this.sensitiveManager?.saveInitialData(this.form);
|
this.sensitiveManager?.saveInitialData(this.form);
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.dataScopeTree?.setCheckedKeys?.(this.form.dataScopeDeptIds || []);
|
|
||||||
});
|
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -713,6 +713,12 @@ export default {
|
|||||||
}
|
}
|
||||||
this.selectDeptOnTree(deptId);
|
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) {
|
findDeptIdByName(name, tree = this.permissionDeptTree) {
|
||||||
if (!name) return null;
|
if (!name) return null;
|
||||||
for (const node of tree || []) {
|
for (const node of tree || []) {
|
||||||
@@ -733,7 +739,7 @@ export default {
|
|||||||
const tenantId = this.userInfo.tenantId || this.website.tenantId;
|
const tenantId = this.userInfo.tenantId || this.website.tenantId;
|
||||||
try {
|
try {
|
||||||
const res = await getDeptTree(tenantId);
|
const res = await getDeptTree(tenantId);
|
||||||
this.permissionDeptTree = res.data.data || [];
|
this.permissionDeptTree = this.startDeptTreeFromSecondLevel(res.data.data || []);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.$message.error('组织树加载失败');
|
this.$message.error('组织树加载失败');
|
||||||
return;
|
return;
|
||||||
@@ -963,9 +969,11 @@ export default {
|
|||||||
column.dicData = res.data.data;
|
column.dicData = res.data.data;
|
||||||
});
|
});
|
||||||
getDeptTree(tenantId).then(res => {
|
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');
|
const column = this.findColumn(this.userOption.group, 'deptId');
|
||||||
column.dicData = res.data.data;
|
column.dicData = deptTree;
|
||||||
});
|
});
|
||||||
getPostList(tenantId).then(res => {
|
getPostList(tenantId).then(res => {
|
||||||
this.postList = res.data.data;
|
this.postList = res.data.data;
|
||||||
|
|||||||
@@ -689,6 +689,7 @@ import {
|
|||||||
recognitionIDCard,
|
recognitionIDCard,
|
||||||
recognitionTransportCertificates,
|
recognitionTransportCertificates,
|
||||||
recognizeBaiduOcr,
|
recognizeBaiduOcr,
|
||||||
|
recognizeQualificationCertificateOcr,
|
||||||
} from '@/api/transportCapacity/driver';
|
} from '@/api/transportCapacity/driver';
|
||||||
import { getList as getVehicleList } from '@/api/transportCapacity/transport-vehicle';
|
import { getList as getVehicleList } from '@/api/transportCapacity/transport-vehicle';
|
||||||
import { getDeptTree } from '@/api/system/dept';
|
import { getDeptTree } from '@/api/system/dept';
|
||||||
@@ -1322,9 +1323,29 @@ export default {
|
|||||||
},
|
},
|
||||||
handleQualificationUploadSuccess(prop, url) {
|
handleQualificationUploadSuccess(prop, url) {
|
||||||
this.setImage(prop, url);
|
this.setImage(prop, url);
|
||||||
this.recognizeBaiduOcr(url, 'general', '', '从业资格证', data => {
|
this.recognizeQualificationCertificate(url);
|
||||||
this.applyQualificationRecognition(data);
|
},
|
||||||
|
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) {
|
recognizeBaiduOcr(url, type, side, documentName, applyRecognition) {
|
||||||
if (!url) {
|
if (!url) {
|
||||||
@@ -1614,25 +1635,43 @@ export default {
|
|||||||
return typeof value === 'object' ? value.words || value.value || '' : value || '';
|
return typeof value === 'object' ? value.words || value.value || '' : value || '';
|
||||||
},
|
},
|
||||||
applyQualificationRecognition(data = {}) {
|
applyQualificationRecognition(data = {}) {
|
||||||
const qualificationType = this.getQualificationType(data);
|
const fields = this.normalizeQualificationOcrFields(data);
|
||||||
const qualificationNo = this.getQualificationNo(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);
|
const matchedType = this.matchQualificationType(qualificationType);
|
||||||
if (matchedType) {
|
if (matchedType) {
|
||||||
this.driverForm.qualificationType = matchedType;
|
this.driverForm.qualificationType = matchedType;
|
||||||
} else if (qualificationType && !this.qualificationTypeOptions.length) {
|
} else if (qualificationType && !this.qualificationTypeOptions.length) {
|
||||||
this.driverForm.qualificationType = qualificationType;
|
this.driverForm.qualificationType = qualificationType;
|
||||||
}
|
}
|
||||||
if (qualificationNo && !this.driverForm.qualificationNo) {
|
if (qualificationNo) {
|
||||||
this.driverForm.qualificationNo = String(qualificationNo).replace(/\s/g, '');
|
this.driverForm.qualificationNo = String(qualificationNo).replace(/\s/g, '');
|
||||||
}
|
}
|
||||||
const words = this.getBaiduOcrWords(data).join(' ');
|
const startDate = this.normalizeBirthday(validFrom);
|
||||||
const dateList = words.match(/\d{4}[-/.年]\d{1,2}[-/.月]\d{1,2}日?/g) || [];
|
if (startDate) {
|
||||||
if (/(长期|永久有效)/.test(words)) {
|
this.driverForm.qualificationStartDate = startDate;
|
||||||
|
}
|
||||||
|
if (/(长期|永久)/.test(validUntil)) {
|
||||||
this.driverForm.qualificationLongTerm = 1;
|
this.driverForm.qualificationLongTerm = 1;
|
||||||
this.driverForm.qualificationEndDate = '';
|
this.driverForm.qualificationEndDate = '';
|
||||||
} else if (dateList.length) {
|
} else {
|
||||||
this.driverForm.qualificationEndDate = this.normalizeBirthday(dateList[dateList.length - 1]);
|
const endDate = this.normalizeBirthday(validUntil);
|
||||||
this.driverForm.qualificationLongTerm = 0;
|
if (endDate) {
|
||||||
|
this.driverForm.qualificationEndDate = endDate;
|
||||||
|
this.driverForm.qualificationLongTerm = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
['qualificationType', 'qualificationNo', 'qualificationEndDate'].forEach(prop => {
|
['qualificationType', 'qualificationNo', 'qualificationEndDate'].forEach(prop => {
|
||||||
@@ -1640,22 +1679,25 @@ export default {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getQualificationType(data = {}) {
|
normalizeQualificationOcrFields(result = {}) {
|
||||||
const fieldValue = this.getOcrValue(data, ['从业资格类别', '从业资格类型']);
|
if (result.fields && typeof result.fields === 'object' && !Array.isArray(result.fields)) {
|
||||||
if (fieldValue) return String(fieldValue).trim();
|
return result.fields;
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
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 = '') {
|
matchQualificationType(value = '') {
|
||||||
const text = String(value || '').replace(/\s/g, '');
|
const text = String(value || '').replace(/\s/g, '');
|
||||||
@@ -1673,27 +1715,6 @@ export default {
|
|||||||
);
|
);
|
||||||
return matched?.value || '';
|
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 = '') {
|
normalizeNation(value = '') {
|
||||||
const nation = String(value || '').trim();
|
const nation = String(value || '').trim();
|
||||||
if (!nation) return '';
|
if (!nation) return '';
|
||||||
|
|||||||
@@ -310,6 +310,7 @@
|
|||||||
v-model="archiveForm.customerCode"
|
v-model="archiveForm.customerCode"
|
||||||
maxlength="20"
|
maxlength="20"
|
||||||
show-word-limit
|
show-word-limit
|
||||||
|
:disabled="Boolean(archiveForm.id)"
|
||||||
placeholder="请输入,留空则自动生成"
|
placeholder="请输入,留空则自动生成"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -378,7 +379,7 @@
|
|||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
maxlength="18"
|
maxlength="18"
|
||||||
show-word-limit
|
show-word-limit
|
||||||
:disabled="kingdeeLocked && Boolean(archiveForm.id)"
|
:disabled="Boolean(archiveForm.id)"
|
||||||
@input="
|
@input="
|
||||||
archiveForm.unifiedCreditCode = String(
|
archiveForm.unifiedCreditCode = String(
|
||||||
archiveForm.unifiedCreditCode || ''
|
archiveForm.unifiedCreditCode || ''
|
||||||
@@ -394,7 +395,7 @@
|
|||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
maxlength="100"
|
maxlength="100"
|
||||||
show-word-limit
|
show-word-limit
|
||||||
:disabled="kingdeeLocked"
|
:disabled="kingdeeLocked && !archiveForm.id"
|
||||||
@blur="checkArchiveNameRisk"
|
@blur="checkArchiveNameRisk"
|
||||||
/>
|
/>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
@@ -434,7 +435,7 @@
|
|||||||
v-model="archiveForm.legalPerson"
|
v-model="archiveForm.legalPerson"
|
||||||
maxlength="10"
|
maxlength="10"
|
||||||
show-word-limit
|
show-word-limit
|
||||||
:disabled="kingdeeLocked"
|
:disabled="kingdeeLocked && !archiveForm.id"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -535,7 +536,7 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="archiveForm.registeredCapital"
|
v-model="archiveForm.registeredCapital"
|
||||||
maxlength="18"
|
maxlength="18"
|
||||||
:disabled="kingdeeLocked"
|
:disabled="kingdeeLocked && !archiveForm.id"
|
||||||
@input="value => handleDecimalInput('registeredCapital', value)"
|
@input="value => handleDecimalInput('registeredCapital', value)"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -545,7 +546,7 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="archiveForm.paidInCapital"
|
v-model="archiveForm.paidInCapital"
|
||||||
maxlength="18"
|
maxlength="18"
|
||||||
:disabled="kingdeeLocked"
|
:disabled="kingdeeLocked && !archiveForm.id"
|
||||||
@input="value => handleDecimalInput('paidInCapital', value)"
|
@input="value => handleDecimalInput('paidInCapital', value)"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -1409,9 +1410,10 @@
|
|||||||
<el-form-item label="自评得分" :required="isOfflineScore">
|
<el-form-item label="自评得分" :required="isOfflineScore">
|
||||||
<el-input
|
<el-input
|
||||||
v-if="isOfflineScore"
|
v-if="isOfflineScore"
|
||||||
v-model="currentScore.selfScore"
|
:model-value="formatScoreValue(currentScore.selfScore)"
|
||||||
maxlength="10"
|
maxlength="10"
|
||||||
:disabled="readonly"
|
:disabled="readonly"
|
||||||
|
placeholder="请输入自评得分"
|
||||||
@input="handleOfflineSelfScoreInput"
|
@input="handleOfflineSelfScoreInput"
|
||||||
@blur="recalculateOfflineScore"
|
@blur="recalculateOfflineScore"
|
||||||
>
|
>
|
||||||
@@ -2489,8 +2491,14 @@ export default {
|
|||||||
];
|
];
|
||||||
const rows = categoryMap.map((category, index) => {
|
const rows = categoryMap.map((category, index) => {
|
||||||
const details = this.getScoreCategoryDetails(category.categoryCode);
|
const details = this.getScoreCategoryDetails(category.categoryCode);
|
||||||
let selfScore = details.reduce((sum, item) => sum + Number(item.selfScore || 0), 0);
|
const sumCategoryScore = prop =>
|
||||||
let reviewScore = details.reduce((sum, item) => sum + Number(item.reviewScore || 0), 0);
|
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 分计(分类汇总展示封顶后值)
|
// 暂定:加分/减分合计最高按 15 分计(分类汇总展示封顶后值)
|
||||||
if (category.categoryCode === 'plus') {
|
if (category.categoryCode === 'plus') {
|
||||||
selfScore = Math.min(selfScore, HARDCODED_MAX_PLUS_SCORE);
|
selfScore = Math.min(selfScore, HARDCODED_MAX_PLUS_SCORE);
|
||||||
@@ -4238,7 +4246,9 @@ export default {
|
|||||||
'核准日期',
|
'核准日期',
|
||||||
]);
|
]);
|
||||||
const scope = this.getBusinessLicenseOcrValue(fields, ['经营范围']);
|
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.archiveForm.fullName = name;
|
||||||
if (name) this.checkArchiveNameRisk();
|
if (name) this.checkArchiveNameRisk();
|
||||||
if (legalPerson) this.archiveForm.legalPerson = legalPerson;
|
if (legalPerson) this.archiveForm.legalPerson = legalPerson;
|
||||||
@@ -4552,6 +4562,9 @@ export default {
|
|||||||
quantificationId: score.quantificationId ? String(score.quantificationId) : '',
|
quantificationId: score.quantificationId ? String(score.quantificationId) : '',
|
||||||
evaluateMode: score.evaluateMode === 'offline' ? 'offline' : 'online',
|
evaluateMode: score.evaluateMode === 'offline' ? 'offline' : 'online',
|
||||||
nextEvaluateDate: score.nextEvaluateDate || '',
|
nextEvaluateDate: score.nextEvaluateDate || '',
|
||||||
|
selfScore: this.normalizeScoreInputValue(score.selfScore),
|
||||||
|
reviewScore: this.normalizeScoreInputValue(score.reviewScore),
|
||||||
|
finalScore: this.normalizeScoreInputValue(score.finalScore),
|
||||||
applyCreditLimit: this.normalizeOptionalAmount(
|
applyCreditLimit: this.normalizeOptionalAmount(
|
||||||
score.applyCreditLimit === undefined
|
score.applyCreditLimit === undefined
|
||||||
? this.archiveForm.applyCreditLimit
|
? this.archiveForm.applyCreditLimit
|
||||||
@@ -4565,6 +4578,8 @@ export default {
|
|||||||
details: (score.details || []).map(detail => ({
|
details: (score.details || []).map(detail => ({
|
||||||
...detail,
|
...detail,
|
||||||
scoreInput: this.normalizeScoreInputValue(detail.scoreInput),
|
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';
|
return this.getScoreDetailCategoryCode(detail) === 'basic';
|
||||||
},
|
},
|
||||||
getSignedScore(detail, prop) {
|
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;
|
return this.isMinusScoreDetail(detail) && score > 0 ? -score : score;
|
||||||
},
|
},
|
||||||
getScoreItemFullScore(detail = {}) {
|
getScoreItemFullScore(detail = {}) {
|
||||||
@@ -5419,7 +5436,12 @@ export default {
|
|||||||
const basicDetails = this.getScoreCategoryDetailsByList(details, 'basic');
|
const basicDetails = this.getScoreCategoryDetailsByList(details, 'basic');
|
||||||
const plusDetails = this.getScoreCategoryDetailsByList(details, 'plus');
|
const plusDetails = this.getScoreCategoryDetailsByList(details, 'plus');
|
||||||
const minusDetails = this.getScoreCategoryDetailsByList(details, 'minus');
|
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 rawPlusSelf = sumScore(plusDetails, 'selfScore');
|
||||||
const rawPlusReview = sumScore(plusDetails, 'reviewScore');
|
const rawPlusReview = sumScore(plusDetails, 'reviewScore');
|
||||||
const rawMinusSelf = sumScore(minusDetails, 'selfScore');
|
const rawMinusSelf = sumScore(minusDetails, 'selfScore');
|
||||||
@@ -5434,33 +5456,51 @@ export default {
|
|||||||
const hasReviewScore = details.some(
|
const hasReviewScore = details.some(
|
||||||
item => !this.isBlankScore(item.reviewScore)
|
item => !this.isBlankScore(item.reviewScore)
|
||||||
);
|
);
|
||||||
// 线下模式允许手工改自评得分:有手工值时优先采用,否则回退明细合计
|
// 线下模式允许手工改自评得分:有手工值时优先采用,否则回退明细合计;-1 视为未填
|
||||||
const isOffline = String(score.evaluateMode || '') === 'offline';
|
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 manualSelfScore = Number(score.selfScore);
|
||||||
const selfScore =
|
const selfScore =
|
||||||
isOffline && Number.isFinite(manualSelfScore) && String(score.selfScore ?? '').trim() !== ''
|
hasManualSelfScore && Number.isFinite(manualSelfScore) ? manualSelfScore : computedSelfScore;
|
||||||
? manualSelfScore
|
|
||||||
: computedSelfScore;
|
|
||||||
const finalScore = hasReviewScore ? reviewScore : selfScore;
|
const finalScore = hasReviewScore ? reviewScore : selfScore;
|
||||||
const fullMark = this.getScoreFullMark(details);
|
const fullMark = this.getScoreFullMark(details);
|
||||||
const scoreRate =
|
const scoreRate =
|
||||||
fullMark > 0 ? Math.max(0, Math.min(100, (finalScore / fullMark) * 100)) : 0;
|
fullMark > 0 ? Math.max(0, Math.min(100, (finalScore / fullMark) * 100)) : 0;
|
||||||
const standard = this.matchCreditStandard(score, scoreRate);
|
const standard = this.matchCreditStandard(score, scoreRate);
|
||||||
const hasStandards = (score.standards || []).some(item => item && item.creditLevel);
|
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.reviewScore = Number(reviewScore.toFixed(2));
|
||||||
score.finalScore = Number(Number(finalScore).toFixed(2));
|
score.finalScore =
|
||||||
score.scoreRate = Number(scoreRate.toFixed(2));
|
keepOfflineScoreBlank && !hasReviewScore ? '' : Number(Number(finalScore).toFixed(2));
|
||||||
|
score.scoreRate = keepOfflineScoreBlank && !hasReviewScore ? '' : Number(scoreRate.toFixed(2));
|
||||||
if (hasStandards) {
|
if (hasStandards) {
|
||||||
score.creditLevel = standard?.creditLevel || '';
|
score.creditLevel = keepOfflineScoreBlank && !hasReviewScore ? '' : standard?.creditLevel || '';
|
||||||
score.maxCreditLimit = standard
|
score.maxCreditLimit =
|
||||||
? this.calculateCreditLimitByStandard(standard, scoreRate)
|
keepOfflineScoreBlank && !hasReviewScore
|
||||||
: '';
|
? ''
|
||||||
|
: standard
|
||||||
|
? this.calculateCreditLimitByStandard(standard, scoreRate)
|
||||||
|
: '';
|
||||||
}
|
}
|
||||||
return score;
|
return score;
|
||||||
},
|
},
|
||||||
isBlankScore(value) {
|
isBlankScore(value) {
|
||||||
return value === undefined || value === null || String(value).trim() === '';
|
return (
|
||||||
|
value === undefined ||
|
||||||
|
value === null ||
|
||||||
|
value === -1 ||
|
||||||
|
value === '-1' ||
|
||||||
|
String(value).trim() === ''
|
||||||
|
);
|
||||||
},
|
},
|
||||||
hasIncompleteBasicScoreDetail(details = []) {
|
hasIncompleteBasicScoreDetail(details = []) {
|
||||||
return this.getScoreCategoryDetailsByList(details, 'basic').some(item => {
|
return this.getScoreCategoryDetailsByList(details, 'basic').some(item => {
|
||||||
@@ -5968,6 +6008,27 @@ export default {
|
|||||||
this.currentScore.evaluateMode = mode === 'offline' ? 'offline' : 'online';
|
this.currentScore.evaluateMode = mode === 'offline' ? 'offline' : 'online';
|
||||||
if (this.isOfflineScore) {
|
if (this.isOfflineScore) {
|
||||||
this.expandedScoreCategoryKeys = [];
|
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) {
|
handleOfflineSelfScoreInput(value) {
|
||||||
@@ -5981,6 +6042,19 @@ export default {
|
|||||||
},
|
},
|
||||||
recalculateOfflineScore() {
|
recalculateOfflineScore() {
|
||||||
if (!this.isOfflineScore) return;
|
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);
|
const selfScore = Number(this.currentScore.selfScore);
|
||||||
if (!Number.isFinite(selfScore)) return;
|
if (!Number.isFinite(selfScore)) return;
|
||||||
this.currentScore.selfScore = Number(selfScore.toFixed(2));
|
this.currentScore.selfScore = Number(selfScore.toFixed(2));
|
||||||
|
|||||||
Reference in New Issue
Block a user