✨ 结算单用印类型、合同甲乙丙列表与项目调整材料

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-09 22:53:55 +08:00
co-authored by Cursor
parent 748214a4b6
commit 1663b2d910
19 changed files with 695 additions and 35 deletions
@@ -12,6 +12,7 @@
* ⚠️ column 数组顺序 = 表格列顺序,搜索专用列统一放在数组最前面。
*/
import { formatSealTypes } from '@/utils/settlement-seal';
import {
approvalStatusOptions,
invoiceStatusOptions,
@@ -24,6 +25,8 @@ import { formalSettlementTableColumns } from './formalSettlementTable';
const textFormatter = (row, value) =>
value === null || value === undefined || value === '' ? '-' : value;
const sealTypesFormatter = (row, value) => formatSealTypes(value) || '-';
/** 金额统一展示:两位小数 + 币种 */
const moneyFormatter = (row, value) =>
`${Number(value || 0).toFixed(2)} ${row?.currency || 'RMB'}`;
@@ -72,6 +75,7 @@ const COLUMN_EXTRA = {
projectName: { search: true, searchSpan: 5, searchOrder: 11, searchPlaceholder: '请输入' },
deptName: { search: true, searchslot: true, searchSpan: 5, searchOrder: 10 },
contractNo: { search: true, searchSpan: 5, searchOrder: 9, searchPlaceholder: '请输入' },
sealTypes: { formatter: sealTypesFormatter },
invoiceStatusName: { slot: true },
paymentStatusName: { slot: true },
approvalStatusName: { slot: true },
@@ -10,6 +10,12 @@ export const formalSettlementFormFields = [
{ label: '结算金额', prop: 'settlementAmount', readonly: true, money: true },
{ label: '业务模式', prop: 'businessModel', type: 'select', optionsKey: 'businessModelOptions' },
{ label: '运输方式', prop: 'transportType', type: 'select', optionsKey: 'transportTypeOptions' },
{
label: '用印类型',
prop: 'sealTypes',
type: 'multi-select',
optionsKey: 'sealTypeOptions',
},
{ label: '汇率日期', prop: 'exchangeRateDate', type: 'date', required: true },
{ label: '结算汇率', prop: 'exchangeRate', type: 'number', required: true },
{ label: '本位币合计', prop: 'localSettlementAmount', readonly: true, money: true },
@@ -29,6 +35,7 @@ export const createFormalSettlementForm = () => ({
sourceDetailIds: [],
businessModel: '',
transportType: '',
sealTypes: [],
exchangeRateDate: '',
exchangeRate: 1,
createUserName: '',
@@ -10,6 +10,7 @@ export const formalSettlementTableColumns = [
{ label: '原币结算金额', prop: 'settlementAmount', minWidth: 145, money: true },
{ label: '业务模式', prop: 'businessModelName', minWidth: 120 },
{ label: '运输方式', prop: 'transportTypeName', minWidth: 120 },
{ label: '用印类型', prop: 'sealTypes', minWidth: 120 },
{ label: '本位币结算金额', prop: 'localSettlementAmount', minWidth: 155, money: true },
{ label: '结算汇率', prop: 'exchangeRate', minWidth: 110 },
{ label: '申请付款金额(含预付)', prop: 'appliedPaymentAmount', minWidth: 185, money: true },
@@ -26,6 +26,12 @@ export const preSettlementFormFields = [
{ label: '结算金额', prop: 'settlementAmount', readonly: true, money: true },
{ label: '业务模式', prop: 'businessModel', type: 'select', optionsKey: 'businessModelOptions' },
{ label: '运输方式', prop: 'transportType', type: 'select', optionsKey: 'transportTypeOptions' },
{
label: '用印类型',
prop: 'sealTypes',
type: 'multi-select',
optionsKey: 'sealTypeOptions',
},
{ label: '汇率日期', prop: 'exchangeRateDate', type: 'date' },
{ label: '结算汇率', prop: 'exchangeRate', type: 'number', class: 'exchange-rate-input' },
{ label: '本位币合计', prop: 'localSettlementAmount', readonly: true, money: true },
@@ -82,6 +88,7 @@ export const emptyPreSettlementForm = () => ({
settlementAmount: 0,
businessModel: '',
transportType: '',
sealTypes: [],
localCurrency: 'RMB',
localSettlementAmount: 0,
exchangeRateDate: '',
@@ -10,6 +10,7 @@ export const preSettlementTableColumns = [
{ label: '原币结算金额', prop: 'settlementAmount', minWidth: 140, money: true, precision: 2 },
{ label: '业务模式', prop: 'businessModelName', minWidth: 120 },
{ label: '运输方式', prop: 'transportTypeName', minWidth: 120 },
{ label: '用印类型', prop: 'sealTypes', minWidth: 120 },
{ label: '本位币结算金额', prop: 'localSettlementAmount', minWidth: 150, money: true, precision: 2 },
{ label: '结算汇率', prop: 'exchangeRate', minWidth: 110, precision: 2 },
{
+1 -1
View File
@@ -154,7 +154,7 @@ export function isMkApprovedStatus(bizType, approvalStatus) {
* @param {string} [options.subjectName] 标题后缀
* @param {string} [options.approvalStatus] 提交前的审批状态
* @param {boolean} [options.mkEnabled] 调用方已知开关时传入,false 时立即跳过
* @param {Object} [options.tempVarData] 传给 MK 的临时变量(如项目类型 projectType)
* @param {Object} [options.tempVarData] 传给 MK 的临时变量(如项目类型 projectType、用印类型 sealTypes)
* @returns {Promise<boolean>} true=已发起/复用 MK 流程,false=未开启或已跳过
*/
export async function submitMkApprovalFlow({
+31
View File
@@ -0,0 +1,31 @@
/** 结算单用印类型固定选项(展示顺序固定) */
export const SETTLEMENT_SEAL_TYPE_OPTIONS = [
{ dictKey: '公章', dictValue: '公章' },
{ dictKey: '业务章', dictValue: '业务章' },
];
const SEAL_TYPE_ORDER = SETTLEMENT_SEAL_TYPE_OPTIONS.map(item => item.dictKey);
/**
* 解析用印类型为数组(兼容顿号、逗号分隔)
*/
export const parseSealTypes = value => {
if (Array.isArray(value)) {
return value.map(item => String(item || '').trim()).filter(Boolean);
}
if (value === undefined || value === null || value === '') {
return [];
}
return String(value)
.split(/[、,,\s]+/)
.map(item => item.trim())
.filter(Boolean);
};
/**
* 用印类型按固定顺序顿号拼接,供保存与列表展示
*/
export const formatSealTypes = value => {
const selected = new Set(parseSealTypes(value));
return SEAL_TYPE_ORDER.filter(item => selected.has(item)).join('、');
};
@@ -13,8 +13,18 @@ export default {
components: { MkPublicShell, ContractManageChange },
methods: {
getForm() {
const row = this.$refs.page?.form || {};
return { ...row, subject: row.contractName || row.contractNo || '' };
const page = this.$refs.page;
const row = page?.form || {};
return {
...row,
partyAJson: row.partyAJson || '',
partyBJson: row.partyBJson || '',
partyCJson: row.partyCJson || '',
partyARows: page?.partyARows || [],
partyBRows: page?.partyBRows || [],
partyCRows: page?.partyCRows || [],
subject: row.contractName || row.contractNo || '',
};
},
},
};
+42 -5
View File
@@ -69,11 +69,8 @@
<el-form-item label="合同负责部门">
<el-input v-model="form.organizationName" disabled />
</el-form-item>
<el-form-item label="甲方">
<el-input v-model="form.partyA" disabled />
</el-form-item>
<el-form-item label="乙方">
<el-input v-model="form.partyB" disabled />
<el-form-item label="平台公司">
<el-input v-model="form.platformCompanyName" disabled />
</el-form-item>
<el-form-item label="签订日期">
<el-date-picker
@@ -272,6 +269,29 @@
</div>
</section>
<section
v-for="party in partySections"
:key="party.role"
class="change-section contract-party-section"
>
<div class="dialog-section-title">{{ party.label }}</div>
<el-table :data="party.rows" border empty-text="暂无数据" class="change-table">
<el-table-column type="index" label="序号" width="70" align="center" />
<el-table-column prop="customerName" label="客商名称" min-width="200" align="center">
<template #default="{ row }">{{ row.customerName || '-' }}</template>
</el-table-column>
<el-table-column prop="creditCode" label="统一信用代码" min-width="180" align="center">
<template #default="{ row }">{{ row.creditCode || '-' }}</template>
</el-table-column>
<el-table-column prop="contactName" label="联系人" min-width="160" align="center">
<template #default="{ row }">{{ row.contactName || '-' }}</template>
</el-table-column>
<el-table-column prop="contactPhone" label="联系电话" min-width="150" align="center">
<template #default="{ row }">{{ row.contactPhone || '-' }}</template>
</el-table-column>
</el-table>
</section>
<contract-attachment-section
title="用印材料"
description
@@ -799,6 +819,13 @@ export default {
.join('、');
return `【${parties || '相对方'}】:被列入外部黑名单;涉贪污受贿裁判相关提及方(3年以上及其他);被执行人信息;买卖合同纠纷;劳动纠纷;重大纠纷。提交变更前须上传「特批附件」类型附件`;
},
partySections() {
return [
{ role: 'A', label: '甲方', rows: this.partyARows },
{ role: 'B', label: '乙方', rows: this.partyBRows },
{ role: 'C', label: '丙方', rows: this.partyCRows },
];
},
isSettlementRuleChange() {
return this.form.changeType === '结算规则变更';
},
@@ -1253,6 +1280,16 @@ export default {
.contract-change-page :deep(.basic-container__card) { border: 0; background: transparent; box-shadow: none; }
.contract-change-form { background: #f5f6fa; }
.change-section { padding: 20px 24px; background: #fff; border-bottom: 1px solid #eff1f7; margin-top: 12px; }
.contract-party-section {
margin-bottom: 12px;
padding: 14px 16px 16px;
overflow: hidden;
background: #fff;
border-bottom: 0;
border-radius: 6px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.contract-party-section > .dialog-section-title { margin-bottom: 16px; color: #303133; }
.contract-basic-section { margin-bottom: 12px; padding: 14px 16px 16px; overflow: hidden; background: #fff; border-bottom: 0; border-radius: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); }
.contract-basic-section > .dialog-section-title { margin-bottom: 20px; color: #303133; }
.contract-basic-section__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 48px; }
@@ -13,8 +13,18 @@ export default {
components: { MkPublicShell, ContractManage },
methods: {
getForm() {
const row = this.$refs.page?.detailRow || {};
return { ...row, subject: row.contractName || row.contractNo || '' };
const page = this.$refs.page;
const row = page?.detailRow || {};
return {
...row,
partyAJson: row.partyAJson || '',
partyBJson: row.partyBJson || '',
partyCJson: row.partyCJson || '',
partyARows: page?.detailPartyARows || [],
partyBRows: page?.detailPartyBRows || [],
partyCRows: page?.detailPartyCRows || [],
subject: row.contractName || row.contractNo || '',
};
},
},
};
+36 -3
View File
@@ -174,9 +174,6 @@
<el-descriptions-item label="项目">{{
detailValue('projectName')
}}</el-descriptions-item>
<el-descriptions-item label="甲方">{{ detailValue('partyA') }}</el-descriptions-item>
<el-descriptions-item label="乙方">{{ detailValue('partyB') }}</el-descriptions-item>
<el-descriptions-item label="丙方">{{ detailValue('partyC') || '-' }}</el-descriptions-item>
<el-descriptions-item label="合同期限">{{ detailContractPeriod }}</el-descriptions-item>
<el-descriptions-item label="合同负责部门">{{
detailValue('organizationName')
@@ -239,6 +236,29 @@
</el-descriptions>
</section>
<section
v-for="party in detailPartySections"
:key="`detail-${party.role}`"
class="contract-manage-form__section contract-manage-form__section--panel"
>
<div class="dialog-section-title">{{ party.label }}</div>
<el-table :data="party.rows" border empty-text="暂无数据">
<el-table-column type="index" label="序号" width="70" align="center" />
<el-table-column prop="customerName" label="客商名称" min-width="200" align="center">
<template #default="{ row }">{{ row.customerName || '-' }}</template>
</el-table-column>
<el-table-column prop="creditCode" label="统一信用代码" min-width="180" align="center">
<template #default="{ row }">{{ row.creditCode || '-' }}</template>
</el-table-column>
<el-table-column prop="contactName" label="联系人" min-width="160" align="center">
<template #default="{ row }">{{ row.contactName || '-' }}</template>
</el-table-column>
<el-table-column prop="contactPhone" label="联系电话" min-width="150" align="center">
<template #default="{ row }">{{ row.contactPhone || '-' }}</template>
</el-table-column>
</el-table>
</section>
<hcs-contract-panel
v-if="!isPublicViewPage"
:contract="detailRow"
@@ -1580,6 +1600,9 @@ export default {
billCycleTypeOptions: ['固定截单日', '自然月', '自定义多周期'],
detailLoading: false,
detailRow: {},
detailPartyARows: [],
detailPartyBRows: [],
detailPartyCRows: [],
// 合规(HCS)推送/对账状态;受 thirdParty.hcs.push.immediate-enabled 控制显隐
hcsRepushingId: null,
hcsImmediateEnabled: false,
@@ -1708,6 +1731,13 @@ export default {
{ role: 'C', label: '丙方', rows: this.partyCRows },
];
},
detailPartySections() {
return [
{ role: 'A', label: '甲方', rows: this.detailPartyARows },
{ role: 'B', label: '乙方', rows: this.detailPartyBRows },
{ role: 'C', label: '丙方', rows: this.detailPartyCRows },
];
},
/**
* 计费方案适用客商:
* - 客户合同:仅甲方(仅 1 个甲方时编辑器自动选中)
@@ -3482,6 +3512,9 @@ export default {
invoiceCycle: normalizeOptionalInteger(detail.invoiceCycle),
paymentDays: normalizeOptionalInteger(detail.paymentDays),
};
this.detailPartyARows = this.normalizePartyRows(detail.partyAJson, detail.partyA, true);
this.detailPartyBRows = this.normalizePartyRows(detail.partyBJson, detail.partyB, true);
this.detailPartyCRows = this.normalizePartyRows(detail.partyCJson, detail.partyC, false);
this.detailContractFileRows = normalizeContractFileRows(parseArray(detail.contractFileJson));
this.detailAttachmentRows = parseArray(detail.attachmentsJson);
this.detailBillingPlanRows = parseArray(detail.billingPlanJson);
+329 -6
View File
@@ -676,7 +676,7 @@
<div class="project-apply-form__material-head">
<div class="dialog-section-title project-apply-form__material-title">项目材料</div>
<span
v-if="missingRequiredAttachmentTypes.length"
v-if="!isChangeDialog && missingRequiredAttachmentTypes.length"
class="project-apply-form__material-warn"
>
未上传:{{ missingRequiredAttachmentTypes.join('、') }}
@@ -698,7 +698,11 @@
<el-table-column type="index" label="序号" width="80" align="center" />
<el-table-column label="附件类型" min-width="160" align="center">
<template #default="{ row }">
<el-select v-model="row.fileType" placeholder="请选择" :disabled="dialogReadonly">
<el-select
v-model="row.fileType"
placeholder="请选择"
:disabled="dialogReadonly || isChangeDialog"
>
<el-option
v-for="item in projectAttachmentTypeOptions"
:key="item.value"
@@ -731,7 +735,7 @@
<el-input
v-model="row.description"
placeholder="请输入"
:disabled="dialogReadonly"
:disabled="dialogReadonly || isChangeDialog"
/>
</template>
</el-table-column>
@@ -741,14 +745,26 @@
<el-table-column prop="uploadUserName" label="上传人" min-width="140" align="center" />
<el-table-column prop="uploadTime" label="上传时间" min-width="170" align="center" sortable/>
<el-table-column label="操作" width="110" align="center">
<template #default="{ $index }">
<el-link v-if="!dialogReadonly" type="danger" @click="removeAttachment($index)"
>删除</el-link
<template #default="{ row, $index }">
<el-link
v-if="isChangeDialog && !dialogReadonly"
type="primary"
@click="openAdjustAttachmentDialog(row, $index)"
>
调整
</el-link>
<el-link
v-else-if="!dialogReadonly && !isChangeDialog"
type="danger"
@click="removeAttachment($index)"
>
删除
</el-link>
</template>
</el-table-column>
</el-table>
<vehicle-attachment-upload
v-if="!isChangeDialog"
v-model="attachmentRows"
class="project-apply-form__upload"
:readonly="dialogReadonly"
@@ -761,6 +777,57 @@
/>
</div>
<div v-if="isChangeDialog" class="project-apply-form__material-card">
<div class="project-apply-form__material-head">
<div class="dialog-section-title project-apply-form__material-title">调整材料</div>
</div>
<el-table :data="adjustAttachmentRows" border class="project-apply-form__material-table">
<el-table-column type="index" label="序号" width="80" align="center" />
<el-table-column label="原附件" min-width="180" align="center" show-overflow-tooltip>
<template #default="{ row }">
{{ attachmentName(row.originAttachment) || '-' }}
</template>
</el-table-column>
<el-table-column label="附件类型" min-width="160" align="center">
<template #default="{ row }">{{ row.fileType || '-' }}</template>
</el-table-column>
<el-table-column
label="文件名"
min-width="220"
align="center"
show-overflow-tooltip
class-name="is-ellipsis-link"
>
<template #default="{ row }">
<span
class="attachment-file-name"
role="button"
tabindex="0"
@click="previewAttachment(row)"
@keydown.enter="previewAttachment(row)"
@keydown.space.prevent="previewAttachment(row)"
>{{ attachmentName(row) }}</span>
</template>
</el-table-column>
<el-table-column label="附件描述" min-width="200" align="center" show-overflow-tooltip>
<template #default="{ row }">{{ row.description || '-' }}</template>
</el-table-column>
<el-table-column label="调整原因" min-width="180" align="center" show-overflow-tooltip>
<template #default="{ row }">{{ row.adjustReason || '-' }}</template>
</el-table-column>
<el-table-column label="文件大小" min-width="120" align="center">
<template #default="{ row }">{{ formatFileSize(row.size) }}</template>
</el-table-column>
<el-table-column prop="uploadUserName" label="上传人" min-width="140" align="center" />
<el-table-column prop="uploadTime" label="上传时间" min-width="170" align="center" />
<el-table-column v-if="!dialogReadonly" label="操作" width="110" align="center">
<template #default="{ $index }">
<el-link type="danger" @click="removeAdjustAttachment($index)">删除</el-link>
</template>
</el-table-column>
</el-table>
</div>
<template v-if="showProjectContractSection">
<div class="dialog-section-title project-apply-form__table-title">项目合同</div>
<el-table
@@ -1011,6 +1078,86 @@
@close="attachmentImagePreviewVisible = false"
/>
<el-dialog
v-model="adjustAttachmentBox"
title="调整材料"
append-to-body
destroy-on-close
width="720px"
class="project-apply-adjust-dialog"
@closed="resetAdjustAttachmentForm"
>
<el-form
ref="adjustAttachmentFormRef"
:model="adjustAttachmentForm"
:rules="adjustAttachmentRules"
label-position="right"
label-width="auto"
>
<el-form-item label="原附件">
<span>{{ attachmentName(adjustAttachmentForm.originAttachment) || '-' }}</span>
</el-form-item>
<el-form-item label="附件类型" prop="fileType">
<el-select v-model="adjustAttachmentForm.fileType" placeholder="请选择" clearable>
<el-option
v-for="item in projectAttachmentTypeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="附件文件" prop="url">
<div class="project-apply-adjust-dialog__upload">
<span
v-if="attachmentName(adjustAttachmentForm)"
class="attachment-file-name"
role="button"
tabindex="0"
@click="previewAttachment(adjustAttachmentForm)"
@keydown.enter="previewAttachment(adjustAttachmentForm)"
@keydown.space.prevent="previewAttachment(adjustAttachmentForm)"
>
{{ attachmentName(adjustAttachmentForm) }}
</span>
<span v-else class="project-apply-adjust-dialog__upload-empty">请上传新材料</span>
<vehicle-attachment-upload
v-model="adjustAttachmentUploadRows"
:readonly="false"
:multiple="false"
:limit="1"
:file-types="attachmentFileTypes"
:max-size="50"
:show-file-list="false"
button-text="上传附件"
tip="支持pdf、bmp、jpeg、png、jpg、doc、docx、ppt、pptx、xlsx、xls、eml、msg、zip,单个文件不超过50M"
@change="handleAdjustAttachmentUploadChange"
/>
</div>
</el-form-item>
<el-form-item label="附件描述" prop="description">
<el-input v-model="adjustAttachmentForm.description" placeholder="请输入" maxlength="200" />
</el-form-item>
<el-form-item label="文件大小">
<span>{{ formatFileSize(adjustAttachmentForm.size) || '-' }}</span>
</el-form-item>
<el-form-item label="调整原因" prop="adjustReason" class="project-apply-form__change-textarea">
<el-input
v-model="adjustAttachmentForm.adjustReason"
type="textarea"
:rows="3"
maxlength="2000"
show-word-limit
placeholder="请输入调整原因"
/>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="adjustAttachmentBox = false">取消</el-button>
<el-button type="primary" @click="confirmAdjustAttachment">确定</el-button>
</template>
</el-dialog>
<el-dialog
v-model="userBox"
title="选择用户"
@@ -1166,6 +1313,7 @@ const emptyForm = () => ({
customerJson: '',
carrierJson: '',
attachmentsJson: '',
adjustAttachmentsJson: '',
situationRemark: '',
projectIntro: '',
profitRemark: '',
@@ -1175,6 +1323,24 @@ const emptyForm = () => ({
changeReason: '',
});
const emptyAdjustAttachmentForm = () => ({
uid: '',
fileType: '',
originalName: '',
name: '',
fileName: '',
url: '',
link: '',
fileUrl: '',
description: '',
size: '',
uploadUserName: '',
uploadTime: '',
adjustReason: '',
originAttachment: null,
originKey: '',
});
const optionalSentinelFields = [
'projectScale',
'estimatedProfit',
@@ -1449,6 +1615,29 @@ export default {
customerRows: [],
carrierRows: [],
attachmentRows: [],
adjustAttachmentRows: [],
adjustAttachmentBox: false,
adjustAttachmentForm: emptyAdjustAttachmentForm(),
adjustAttachmentUploadRows: [],
adjustAttachmentRules: {
fileType: [{ required: true, message: '请选择附件类型', trigger: 'change' }],
url: [
{
validator: (rule, value, callback) => {
if (!this.attachmentUrl(this.adjustAttachmentForm)) {
callback(new Error('请上传新材料'));
return;
}
callback();
},
trigger: 'change',
},
],
adjustReason: [
{ required: true, message: '请输入调整原因', trigger: 'blur' },
{ max: 2000, message: '调整原因不能超过2000个字符', trigger: 'blur' },
],
},
selectedAttachmentRows: [],
attachmentImagePreviewVisible: false,
attachmentImagePreviewUrls: [],
@@ -2207,6 +2396,9 @@ export default {
this.customerRows = [];
this.carrierRows = [];
this.attachmentRows = [];
this.adjustAttachmentRows = [];
this.adjustAttachmentBox = false;
this.resetAdjustAttachmentForm();
this.selectedAttachmentRows = [];
this.changeRows = [];
this.projectContractRows = [];
@@ -2248,6 +2440,7 @@ export default {
this.carrierRows = carrierRows;
this.attachmentRows = this.parseJsonArray(displayRow.attachmentsJson);
this.normalizeAttachmentFileTypes();
this.adjustAttachmentRows = this.parseJsonArray(displayRow.adjustAttachmentsJson);
this.selectedAttachmentRows = [];
this.changeRows = this.buildChangeRows(displayRow);
this.selectedCustomerId = this.customerRows
@@ -2556,6 +2749,9 @@ export default {
customerJson: JSON.stringify(this.customerRows),
carrierJson: JSON.stringify(this.carrierRows),
attachmentsJson: JSON.stringify(this.attachmentRows),
adjustAttachmentsJson: this.isChangeDialog
? JSON.stringify(this.adjustAttachmentRows || [])
: undefined,
situationRemark: JSON.stringify({
projectIntro: this.form.projectIntro || '',
profitRemark: this.form.profitRemark || '',
@@ -2571,6 +2767,9 @@ export default {
if (this.isNewProjectDialog && !options.includeChangeType) {
delete submitRow.changeReason;
}
if (!this.isChangeDialog) {
delete submitRow.adjustAttachmentsJson;
}
['projectIntro', 'profitRemark', 'riskPoint', 'emergencyPlan'].forEach(
key => delete submitRow[key]
);
@@ -3191,6 +3390,112 @@ export default {
removeAttachment(index) {
this.attachmentRows.splice(index, 1);
},
attachmentIdentity(row = {}) {
const uid = String(row.uid || '').trim();
if (uid) return `uid:${uid}`;
const url = String(this.attachmentUrl(row) || '').trim();
if (url) return `url:${url}`;
const name = String(this.attachmentName(row) || '').trim();
const fileType = String(row.fileType || '').trim();
if (name || fileType) return `name:${fileType}|${name}`;
return '';
},
openAdjustAttachmentDialog(row) {
const originKey = this.attachmentIdentity(row);
const existing = this.adjustAttachmentRows.find(item => item.originKey === originKey);
if (existing) {
this.adjustAttachmentForm = {
...emptyAdjustAttachmentForm(),
...existing,
originAttachment: existing.originAttachment || { ...row },
originKey,
};
this.adjustAttachmentUploadRows = this.attachmentUrl(existing)
? [{ ...existing }]
: [];
} else {
this.adjustAttachmentForm = {
...emptyAdjustAttachmentForm(),
fileType: row.fileType || '',
description: row.description || '',
originAttachment: { ...row },
originKey,
};
this.adjustAttachmentUploadRows = [];
}
this.adjustAttachmentBox = true;
this.$nextTick(() => this.$refs.adjustAttachmentFormRef?.clearValidate?.());
},
resetAdjustAttachmentForm() {
this.adjustAttachmentForm = emptyAdjustAttachmentForm();
this.adjustAttachmentUploadRows = [];
this.$refs.adjustAttachmentFormRef?.clearValidate?.();
},
handleAdjustAttachmentUploadChange(list) {
const latest = Array.isArray(list) && list.length ? list[list.length - 1] : null;
if (!latest) {
this.adjustAttachmentForm = {
...this.adjustAttachmentForm,
uid: '',
originalName: '',
name: '',
fileName: '',
url: '',
link: '',
fileUrl: '',
size: '',
uploadUserName: '',
uploadTime: '',
};
this.adjustAttachmentUploadRows = [];
return;
}
const userName = this.userInfo?.realName || this.userInfo?.userName || '';
const uploadTime = this.$dayjs().format('YYYY-MM-DD HH:mm:ss');
this.adjustAttachmentForm = {
...this.adjustAttachmentForm,
...latest,
fileType:
this.adjustAttachmentForm.fileType || this.resolveAttachmentFileType(latest),
description: this.adjustAttachmentForm.description || latest.description || '',
uploadUserName: latest.uploadUserName || userName,
uploadTime: latest.uploadTime || uploadTime,
};
this.adjustAttachmentUploadRows = [{ ...latest }];
this.$refs.adjustAttachmentFormRef?.validateField?.('url');
},
confirmAdjustAttachment() {
this.$refs.adjustAttachmentFormRef?.validate(valid => {
if (!valid) return;
if (!this.attachmentUrl(this.adjustAttachmentForm)) {
this.$message.warning('请上传新材料');
return;
}
const nextRow = {
...this.adjustAttachmentForm,
fileType: this.adjustAttachmentForm.fileType,
description: this.adjustAttachmentForm.description || '',
adjustReason: String(this.adjustAttachmentForm.adjustReason || '').trim(),
originAttachment: this.adjustAttachmentForm.originAttachment
? { ...this.adjustAttachmentForm.originAttachment }
: null,
originKey: this.adjustAttachmentForm.originKey,
};
const index = this.adjustAttachmentRows.findIndex(
item => item.originKey === nextRow.originKey
);
if (index >= 0) {
this.adjustAttachmentRows.splice(index, 1, nextRow);
} else {
this.adjustAttachmentRows.push(nextRow);
}
this.adjustAttachmentBox = false;
this.$message.success('已加入调整材料');
});
},
removeAdjustAttachment(index) {
this.adjustAttachmentRows.splice(index, 1);
},
formatFileSize(size) {
const number = Number(size);
if (!number) return '';
@@ -3708,6 +4013,24 @@ export default {
}
}
.project-apply-adjust-dialog {
&__upload {
display: flex;
flex-direction: column;
gap: 8px;
width: 100%;
}
&__upload-empty {
color: #909399;
}
:deep(.el-select),
:deep(.el-input) {
width: 100%;
}
}
@media (max-width: 1200px) {
.project-apply-form {
&__grid {
+120 -11
View File
@@ -2,16 +2,40 @@
<div ref="page" class="mk-public-biz-view">
<basic-container>
<div class="mk-public-biz-view__title">{{ pageTitle }}</div>
<el-descriptions v-if="detail" :column="2" border>
<el-descriptions-item
v-for="item in visibleFields"
:key="item.prop"
:label="item.label"
:span="item.span || 1"
<template v-if="detail">
<el-descriptions :column="2" border>
<el-descriptions-item
v-for="item in visibleFields"
:key="item.prop"
:label="item.label"
:span="item.span || 1"
>
{{ fieldDisplayValue(item.prop, detail[item.prop]) }}
</el-descriptions-item>
</el-descriptions>
<section
v-for="party in partySections"
:key="party.role"
class="mk-public-biz-view__party"
>
{{ displayValue(detail[item.prop]) }}
</el-descriptions-item>
</el-descriptions>
<div class="mk-public-biz-view__party-title">{{ party.label }}</div>
<el-table :data="party.rows" border empty-text="暂无数据">
<el-table-column type="index" label="序号" width="70" align="center" />
<el-table-column prop="customerName" label="客商名称" min-width="180" align="center">
<template #default="{ row }">{{ row.customerName || '-' }}</template>
</el-table-column>
<el-table-column prop="creditCode" label="统一信用代码" min-width="160" align="center">
<template #default="{ row }">{{ row.creditCode || '-' }}</template>
</el-table-column>
<el-table-column prop="contactName" label="联系人" min-width="140" align="center">
<template #default="{ row }">{{ row.contactName || '-' }}</template>
</el-table-column>
<el-table-column prop="contactPhone" label="联系电话" min-width="140" align="center">
<template #default="{ row }">{{ row.contactPhone || '-' }}</template>
</el-table-column>
</el-table>
</section>
</template>
<el-empty v-else description="暂无数据" />
</basic-container>
</div>
@@ -19,6 +43,36 @@
<script>
import { getMkPublicDetail, postMkPublicProcessMessage } from '@/api/mk-process';
import { formatSealTypes } from '@/utils/settlement-seal';
const createPartyRow = (row = {}) => ({
customerId: row.customerId || '',
customerName: row.customerName || '',
creditCode: row.creditCode || row.unifiedCreditCode || '',
contactId: row.contactId || '',
contactName: row.contactName || '',
contactPhone: row.contactPhone || '',
});
const parsePartyRows = (partyJson, fallbackName) => {
const rows = (() => {
if (Array.isArray(partyJson)) return partyJson;
if (!partyJson) return [];
try {
const data = JSON.parse(partyJson);
return Array.isArray(data) ? data : [];
} catch (error) {
return [];
}
})().map(item => createPartyRow(item));
if (rows.length) return rows;
if (!fallbackName) return [];
return String(fallbackName)
.split(/[、,]/)
.map(name => name.trim())
.filter(Boolean)
.map(name => createPartyRow({ customerName: name }));
};
const FIELD_MAP = {
'project-apply': [
@@ -38,8 +92,6 @@ const FIELD_MAP = {
{ label: '审核状态', prop: 'approvalStatusName' },
{ label: '当前节点', prop: 'currentNode' },
{ label: '当前处理人', prop: 'currentProcessor' },
{ label: '甲方', prop: 'partyA' },
{ label: '乙方', prop: 'partyB' },
{ label: '项目名称', prop: 'projectName', span: 2 },
],
'pre-settlement': [
@@ -47,6 +99,7 @@ const FIELD_MAP = {
{ label: '合同名称', prop: 'contractName' },
{ label: '项目名称', prop: 'projectName' },
{ label: '结算金额', prop: 'settlementAmount' },
{ label: '用印类型', prop: 'sealTypes' },
{ label: '审核状态', prop: 'approvalStatusName' },
{ label: '当前节点', prop: 'currentNode' },
{ label: '当前处理人', prop: 'currentProcessor' },
@@ -58,6 +111,7 @@ const FIELD_MAP = {
{ label: '项目名称', prop: 'projectName' },
{ label: '合同名称', prop: 'contractName' },
{ label: '结算金额', prop: 'settlementAmount' },
{ label: '用印类型', prop: 'sealTypes' },
{ label: '审核状态', prop: 'approvalStatusName' },
{ label: '当前节点', prop: 'currentNode' },
{ label: '当前处理人', prop: 'currentProcessor' },
@@ -99,6 +153,26 @@ export default {
visibleFields() {
return FIELD_MAP[this.bizType] || [];
},
partySections() {
if (!this.detail || this.bizType !== 'contract-manage') return [];
return [
{
role: 'A',
label: '甲方',
rows: parsePartyRows(this.detail.partyAJson, this.detail.partyA),
},
{
role: 'B',
label: '乙方',
rows: parsePartyRows(this.detail.partyBJson, this.detail.partyB),
},
{
role: 'C',
label: '丙方',
rows: parsePartyRows(this.detail.partyCJson, this.detail.partyC),
},
];
},
},
created() {
this.handleIframeHeight = () => this.sendIframeHeight();
@@ -192,6 +266,7 @@ export default {
id: this.getFormId() || detail.id,
subject: this.pageTitle,
formInstanceId: this.getFormId(),
sealTypes: formatSealTypes(detail.sealTypes) || detail.sealTypes || '',
};
},
getFormId() {
@@ -205,6 +280,12 @@ export default {
''
);
},
fieldDisplayValue(prop, value) {
if (prop === 'sealTypes') {
return formatSealTypes(value) || '-';
}
return this.displayValue(value);
},
displayValue(value) {
if (value === null || value === undefined || value === '') return '-';
if (Array.isArray(value)) return value.join('、') || '-';
@@ -255,5 +336,33 @@ html.mk-iframe-page #app.mk-iframe-page {
background: #409eff;
}
}
&__party {
margin-top: 16px;
padding: 14px 16px 16px;
background: #fff;
border-radius: 6px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
&__party-title {
position: relative;
padding-left: 12px;
margin-bottom: 12px;
font-size: 14px;
font-weight: 600;
line-height: 22px;
color: #303133;
&::before {
content: '';
position: absolute;
left: 0;
top: 2px;
width: 4px;
height: 18px;
background: #409eff;
}
}
}
</style>
@@ -78,6 +78,22 @@
:value="item.dictKey"
/>
</el-select>
<el-select
v-else-if="field.type === 'multi-select' && editable"
v-model="form[field.prop]"
multiple
collapse-tags
collapse-tags-tooltip
clearable
placeholder="请选择"
>
<el-option
v-for="item in formSelectOptions(field)"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey"
/>
</el-select>
<span
v-else-if="field.prop === 'formalSettlementNo'"
:class="{ 'form-readonly--code': form.formalSettlementNo }"
@@ -85,7 +101,7 @@
{{ form.formalSettlementNo || (form.id ? '-' : '系统自动生成') }}
</span>
<span v-else-if="field.money">{{ formatMoney(form[field.prop]) }}</span>
<span v-else-if="field.type === 'select'">{{
<span v-else-if="field.type === 'select' || field.type === 'multi-select'">{{
formSelectLabel(field, form[field.prop])
}}</span>
<span v-else-if="field.type === 'contract'">{{
@@ -1144,6 +1160,11 @@ import ChangeRecordDetailDialog from '@/components/change-record-detail-dialog/m
import ProjectAdvanceWriteOff from './project-advance-write-off.vue';
import * as XLSX from 'xlsx';
import { isAdministrator } from '@/utils/auth';
import {
formatSealTypes,
parseSealTypes,
SETTLEMENT_SEAL_TYPE_OPTIONS,
} from '@/utils/settlement-seal';
import * as settlementAdjustmentApi from '@/api/settlement/settlementAdjustment';
// 结算币种为本位币(人民币)时汇率恒为1,汇率日期、结算汇率与按汇率换算的本位币合计都不展示
@@ -1235,6 +1256,7 @@ export default {
feeCategoryOptions: [],
businessModelOptions: [],
transportTypeOptions: [],
sealTypeOptions: SETTLEMENT_SEAL_TYPE_OPTIONS,
fields: formalSettlementFormFields,
sourceTableColumns: sourceColumns,
summaryTableColumns: summaryColumns,
@@ -1498,6 +1520,7 @@ export default {
this.form = {
...createFormalSettlementForm(),
...data,
sealTypes: parseSealTypes(data.sealTypes),
sourcePreSettlementIds: (data.sources || []).map(item => item.preSettlementId),
sourceDetailIds: (data.details || [])
.filter(item => !item.sourcePreSettlementId)
@@ -1702,6 +1725,7 @@ export default {
contractId,
settlementType,
settlementTypeName: settlementType === 'receivable' ? '应收' : '应付',
sealTypes: parseSealTypes(first.sealTypes),
sourcePreSettlementIds: this.form.sourcePreSettlementIds,
});
const responses = await Promise.all(
@@ -1944,6 +1968,7 @@ export default {
Object.assign(this.form, this.sources[0], {
contractId: this.sources[0].contractId,
formalSettlementNo: this.form.formalSettlementNo,
sealTypes: parseSealTypes(this.sources[0].sealTypes),
});
this.refreshFormalSettlementNo();
}
@@ -2993,6 +3018,7 @@ export default {
})),
businessModel: this.form.businessModel || undefined,
transportType: this.form.transportType || undefined,
sealTypes: formatSealTypes(this.form.sealTypes) || undefined,
exchangeRateDate: this.form.exchangeRateDate,
exchangeRate: this.form.exchangeRate,
summaryFees: this.summaryFees
@@ -3205,6 +3231,9 @@ export default {
return Array.isArray(options) ? options : [];
},
formSelectLabel(field, value) {
if (field?.type === 'multi-select') {
return formatSealTypes(value) || '-';
}
if (value === undefined || value === null || value === '') return '-';
const normalized = String(value).trim();
const option = this.formSelectOptions(field).find(
@@ -67,7 +67,26 @@
:value="item.dictKey"
/>
</el-select>
<span v-else-if="field.type === 'select'" class="form-readonly">
<el-select
v-else-if="field.type === 'multi-select' && editable"
v-model="form[field.prop]"
multiple
collapse-tags
collapse-tags-tooltip
clearable
placeholder="请选择"
>
<el-option
v-for="item in formSelectOptions(field)"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictKey"
/>
</el-select>
<span
v-else-if="field.type === 'select' || field.type === 'multi-select'"
class="form-readonly"
>
{{ formSelectLabel(field, form[field.prop]) }}
</span>
<el-input
@@ -1025,6 +1044,11 @@ import { downloadFileByUrl } from '@/utils/util';
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
import * as XLSX from 'xlsx';
import { isAdministrator } from '@/utils/auth';
import {
formatSealTypes,
parseSealTypes,
SETTLEMENT_SEAL_TYPE_OPTIONS,
} from '@/utils/settlement-seal';
// 结算币种为本位币(人民币)时汇率恒为1,汇率日期、结算汇率与按汇率换算的本位币合计都不展示
const LOCAL_CURRENCY_HIDDEN_FIELDS = ['exchangeRateDate', 'exchangeRate', 'localSettlementAmount'];
@@ -1117,6 +1141,7 @@ export default {
feeCategoryOptions: [],
businessModelOptions: [],
transportTypeOptions: [],
sealTypeOptions: SETTLEMENT_SEAL_TYPE_OPTIONS,
summaryFees: [],
details: [],
detailCollapsed: false,
@@ -1553,7 +1578,11 @@ export default {
? await getMkPublicDetail('pre-settlement', this.form.id || this.recordId)
: await getDetail(this.form.id || this.recordId);
const detail = response.data?.data || {};
this.form = { ...emptyPreSettlementForm(), ...detail };
this.form = {
...emptyPreSettlementForm(),
...detail,
sealTypes: parseSealTypes(detail.sealTypes),
};
this.summaryFees = (detail.summaryFees || []).map(row => ({ ...row }));
this.details = (detail.details || []).map(row => this.normalizeSourceDetail(row));
this.detailPage.current = 1;
@@ -1717,6 +1746,9 @@ export default {
return Array.isArray(options) ? options : [];
},
formSelectLabel(field, value) {
if (field?.type === 'multi-select') {
return formatSealTypes(value) || '-';
}
if (value === undefined || value === null || value === '') return '-';
const normalized = String(value).trim();
const option = this.formSelectOptions(field).find(
@@ -1942,6 +1974,9 @@ export default {
subjectName: this.form.preSettlementNo || this.form.contractName || '',
approvalStatus: previousApprovalStatus,
mkEnabled: await loadMkEnabled().catch(() => false),
tempVarData: {
sealTypes: formatSealTypes(this.form.sealTypes) || '',
},
});
this.$message.success(mkStarted ? '审批流程已发起' : '提交成功');
this.visible = false;
@@ -1961,6 +1996,7 @@ export default {
contractId: this.form.contractId,
businessModel: this.form.businessModel || undefined,
transportType: this.form.transportType || undefined,
sealTypes: formatSealTypes(this.form.sealTypes) || undefined,
exchangeRateDate: this.form.exchangeRateDate || undefined,
exchangeRate: this.form.exchangeRate,
attachmentsJson: JSON.stringify(this.attachments || []),
@@ -17,6 +17,7 @@
<script>
import MkPublicShell from '@/views/mk/mk-public-shell.vue';
import FormalSettlementEditor from '@/views/settlement/components/formal-settlement-editor.vue';
import { formatSealTypes } from '@/utils/settlement-seal';
export default {
name: 'FormalSettlementPublicView',
@@ -29,7 +30,11 @@ export default {
methods: {
getForm() {
const form = this.$refs.page?.form || {};
return { ...form, subject: form.formalSettlementNo || form.contractName || '' };
return {
...form,
sealTypes: formatSealTypes(form.sealTypes) || '',
subject: form.formalSettlementNo || form.contractName || '',
};
},
},
};
@@ -240,6 +240,7 @@ import FormalSettlementTablePanel from './components/formal-settlement-table-pan
import InvoiceReceiptCandidatesDialog from './components/invoice-receipt-candidates-dialog.vue';
import { submitMkApprovalFlow, loadMkEnabled } from '@/utils/mk-approval';
import { getMKApprovalUrl } from '@/api/system/business-process';
import { formatSealTypes } from '@/utils/settlement-seal';
export default {
name: 'FormalSettlement',
@@ -507,6 +508,9 @@ export default {
subjectName: row.formalSettlementNo || '',
approvalStatus: previousApprovalStatus,
mkEnabled: this.mkEnabled,
tempVarData: {
sealTypes: formatSealTypes(row.sealTypes) || '',
},
});
this.$message.success('提交成功');
this.onLoad(this.page);
@@ -17,6 +17,7 @@
<script>
import MkPublicShell from '@/views/mk/mk-public-shell.vue';
import PreSettlementEditor from '@/views/settlement/components/pre-settlement-editor.vue';
import { formatSealTypes } from '@/utils/settlement-seal';
export default {
name: 'PreSettlementPublicView',
@@ -29,7 +30,11 @@ export default {
methods: {
getForm() {
const form = this.$refs.page?.form || {};
return { ...form, subject: form.preSettlementNo || form.contractName || '' };
return {
...form,
sealTypes: formatSealTypes(form.sealTypes) || '',
subject: form.preSettlementNo || form.contractName || '',
};
},
},
};
+8
View File
@@ -148,6 +148,9 @@
<span v-else-if="column.prop === 'sourceType'">
{{ row[column.prop] === '应收应付' ? '应付' : displayValue(row[column.prop]) }}
</span>
<span v-else-if="column.prop === 'sealTypes'">
{{ formatSealTypes(row[column.prop]) || '-' }}
</span>
<span v-else>{{ displayValue(row[column.prop]) }}</span>
</template>
</el-table-column>
@@ -306,6 +309,7 @@ import { preSettlementSearchFields } from '@/option/settlement/preSettlementSear
import organizationSearch from '@/mixins/organization-search';
import { preSettlementTableColumns } from '@/option/settlement/preSettlementTable';
import { createSettlementTransfer } from '@/utils/settlement-transfer';
import { formatSealTypes } from '@/utils/settlement-seal';
import { downloadFile } from '@/utils/util';
import { getMKApprovalUrl } from '@/api/system/business-process';
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
@@ -401,6 +405,7 @@ export default {
});
},
methods: {
formatSealTypes,
hasPermission(code) {
return this.isAdmin || this.validData(this.permission?.[code], false);
},
@@ -670,6 +675,9 @@ export default {
subjectName: row.preSettlementNo || '',
approvalStatus: previousApprovalStatus,
mkEnabled: this.mkEnabled,
tempVarData: {
sealTypes: formatSealTypes(row.sealTypes) || '',
},
});
this.$message.success('提交成功');
this.loadTable();