调整基础数据、车船务、项目、合同
This commit is contained in:
@@ -769,7 +769,7 @@
|
||||
<el-table-column prop="statusName" label="状态" min-width="140" align="center" />
|
||||
<el-table-column label="操作" width="120" align="center" fixed="right">
|
||||
<template #default="{ row }"
|
||||
><el-link type="primary" @click="openFlow(row)">流程</el-link></template
|
||||
><el-link type="primary" @click="openDetailChangeRecord(row)">查看详情</el-link></template
|
||||
>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -780,6 +780,46 @@
|
||||
>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
v-model="detailChangeRecordVisible"
|
||||
title="变更记录详情"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
width="1100px"
|
||||
top="10px"
|
||||
class="contract-change-record-detail-dialog"
|
||||
>
|
||||
<div v-if="detailChangeRecord" class="contract-change-record-detail-meta">
|
||||
<span>变更日期:{{ detailChangeRecord.changeDate || '-' }}</span>
|
||||
<span>经办人:{{ detailChangeRecord.handlerUserName || '-' }}</span>
|
||||
<span>变更类型:{{ detailChangeRecord.changeType || '-' }}</span>
|
||||
<span>状态:{{ detailChangeRecord.statusName || detailChangeRecord.status || '-' }}</span>
|
||||
</div>
|
||||
<el-table :data="detailChangeRecordDetailRows" border :show-overflow-tooltip="false">
|
||||
<el-table-column prop="field" label="变更字段" min-width="180" />
|
||||
<el-table-column
|
||||
prop="before"
|
||||
label="变更前"
|
||||
min-width="360"
|
||||
class-name="contract-change-record-detail-value"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="after"
|
||||
label="变更后"
|
||||
min-width="500"
|
||||
class-name="contract-change-record-detail-value"
|
||||
/>
|
||||
</el-table>
|
||||
<el-empty
|
||||
v-if="!detailChangeRecordDetailRows.length"
|
||||
description="暂无变更内容"
|
||||
:image-size="60"
|
||||
/>
|
||||
<template #footer>
|
||||
<el-button type="primary" @click="detailChangeRecordVisible = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<billing-plan-editor
|
||||
v-model="detailBillingPlanBox"
|
||||
:value="detailBillingPlanForm"
|
||||
@@ -1220,6 +1260,9 @@ export default {
|
||||
detailFormalSettlementRuleForm: defaultSettlementRule(),
|
||||
detailPaymentRatioRows: [],
|
||||
detailChangeRecordRows: [],
|
||||
detailChangeRecordVisible: false,
|
||||
detailChangeRecord: null,
|
||||
detailChangeRecordDetailRows: [],
|
||||
flowBox: false,
|
||||
flowUrl: '',
|
||||
processInstanceId: '',
|
||||
@@ -1655,7 +1698,7 @@ export default {
|
||||
this.submitAction = action;
|
||||
const submit = {
|
||||
...this.normalizeSubmit(),
|
||||
contractStage: action === 'draft' ? 'draft' : 'temporary',
|
||||
contractStage: action === 'formal' ? 'temporary' : 'draft',
|
||||
approvalStatus: 'draft',
|
||||
};
|
||||
this.api
|
||||
@@ -1663,9 +1706,11 @@ export default {
|
||||
.then(res => {
|
||||
const saved = res.data?.data || {};
|
||||
const id = saved.id || this.form.id;
|
||||
if (action === 'formal') {
|
||||
if (!id) throw new Error('合同保存成功但未返回主键,无法提交正式合同');
|
||||
return this.api.submitFormal(id);
|
||||
if (action === 'temporary' || action === 'formal') {
|
||||
if (!id) throw new Error('合同保存成功但未返回主键,无法提交合同');
|
||||
return action === 'temporary'
|
||||
? this.api.toTemporary(id)
|
||||
: this.api.submitFormal(id);
|
||||
}
|
||||
return null;
|
||||
})
|
||||
@@ -2104,6 +2149,116 @@ export default {
|
||||
this.detailBillingPlanIndex = index;
|
||||
this.detailBillingPlanBox = true;
|
||||
},
|
||||
parseChangeRecordData(value) {
|
||||
if (!value) return {};
|
||||
if (typeof value === 'object') return value;
|
||||
try {
|
||||
const data = JSON.parse(value);
|
||||
return data && typeof data === 'object' && !Array.isArray(data) ? data : {};
|
||||
} catch (error) {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
normalizeChangeRecordValue(value) {
|
||||
if (typeof value !== 'string') return value;
|
||||
const text = value.trim();
|
||||
if (!text || (!text.startsWith('[') && !text.startsWith('{') && text !== 'null')) {
|
||||
return value;
|
||||
}
|
||||
try {
|
||||
return JSON.parse(text);
|
||||
} catch (error) {
|
||||
return value;
|
||||
}
|
||||
},
|
||||
isEmptyChangeRecordValue(value) {
|
||||
const normalized = this.normalizeChangeRecordValue(value);
|
||||
if (normalized === undefined || normalized === null || normalized === '') return true;
|
||||
if (Array.isArray(normalized)) return normalized.length === 0;
|
||||
if (typeof normalized === 'object') return Object.keys(normalized).length === 0;
|
||||
return false;
|
||||
},
|
||||
getContractChangeFieldLabel(field) {
|
||||
const labels = {
|
||||
contractName: '合同名称',
|
||||
partyB: '乙方',
|
||||
startDate: '开始日期',
|
||||
endDate: '结束日期',
|
||||
contractFormat: '合同格式',
|
||||
settlementMode: '结算方式',
|
||||
legalSealFlag: '是否需要加盖法人章',
|
||||
copyCount: '一式(份)',
|
||||
settlementCurrency: '结算币种',
|
||||
invoiceCycle: '开票周期',
|
||||
paymentDays: '回款账期',
|
||||
remark: '备注',
|
||||
feeGenerationMode: '费用生成模式',
|
||||
billingPlanJson: '计费方案',
|
||||
settlementRuleJson: '结算单规则',
|
||||
preSettlementConfigJson: '预结算配置',
|
||||
formalSettlementConfigJson: '正式结算配置',
|
||||
paymentRatioJson: '付款比例设置',
|
||||
contractFileJson: '合同文件',
|
||||
attachmentsJson: '其它附件',
|
||||
changeAttachmentsJson: '变更材料',
|
||||
};
|
||||
return labels[field] || field;
|
||||
},
|
||||
formatChangeRecordAttachments(value) {
|
||||
const attachments = Array.isArray(value)
|
||||
? value
|
||||
: parseArray(typeof value === 'string' ? value : JSON.stringify(value || []));
|
||||
const names = attachments
|
||||
.map(item =>
|
||||
typeof item === 'string'
|
||||
? item
|
||||
: item?.originalName || item?.name || item?.fileName || item?.url || item?.link || ''
|
||||
)
|
||||
.filter(Boolean);
|
||||
return names.length ? names.join('、') : '空';
|
||||
},
|
||||
formatContractChangeValue(field, value) {
|
||||
const normalized = this.normalizeChangeRecordValue(value);
|
||||
if (this.isEmptyChangeRecordValue(normalized)) return '空';
|
||||
if (['contractFileJson', 'attachmentsJson', 'changeAttachmentsJson'].includes(field)) {
|
||||
return this.formatChangeRecordAttachments(normalized);
|
||||
}
|
||||
if (field === 'legalSealFlag') return Number(normalized) === 1 ? '是' : '否';
|
||||
if (field === 'feeGenerationMode') return normalized === 'manual' ? '手动生成' : '系统生成';
|
||||
if (field === 'invoiceCycle' || field === 'paymentDays') return `${normalized}天`;
|
||||
if (Array.isArray(normalized) || typeof normalized === 'object') {
|
||||
return JSON.stringify(normalized);
|
||||
}
|
||||
return String(normalized);
|
||||
},
|
||||
buildDetailChangeRecordRows(row = {}) {
|
||||
const beforeData = this.parseChangeRecordData(row.beforeData);
|
||||
const afterData = this.parseChangeRecordData(row.afterData);
|
||||
const fields = [...new Set([...Object.keys(beforeData), ...Object.keys(afterData)])];
|
||||
const rows = fields
|
||||
.filter(
|
||||
field =>
|
||||
JSON.stringify(this.normalizeChangeRecordValue(beforeData[field])) !==
|
||||
JSON.stringify(this.normalizeChangeRecordValue(afterData[field]))
|
||||
)
|
||||
.map(field => ({
|
||||
field: this.getContractChangeFieldLabel(field),
|
||||
before: this.formatContractChangeValue(field, beforeData[field]),
|
||||
after: this.formatContractChangeValue(field, afterData[field]),
|
||||
}));
|
||||
if (row.changeContent) {
|
||||
rows.unshift({ field: '变更内容', before: '空', after: row.changeContent });
|
||||
}
|
||||
if (row.changeReason) {
|
||||
rows.push({ field: '变更原因', before: '空', after: row.changeReason });
|
||||
}
|
||||
return rows;
|
||||
},
|
||||
openDetailChangeRecord(row) {
|
||||
this.detailChangeRecord = row;
|
||||
this.detailChangeRecordDetailRows = this.buildDetailChangeRecordRows(row);
|
||||
this.detailChangeRecordVisible = true;
|
||||
},
|
||||
displayValue(value) {
|
||||
return value === undefined || value === null || value === '' ? '-' : value;
|
||||
},
|
||||
@@ -2310,6 +2465,23 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.contract-change-record-detail-meta {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px 32px;
|
||||
margin-bottom: 16px;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
:deep(.contract-change-record-detail-dialog .el-dialog__body) {
|
||||
padding-top: 12px;
|
||||
}
|
||||
|
||||
:deep(.contract-change-record-detail-dialog .contract-change-record-detail-value .cell) {
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
:global(.avue--collapse .contract-manage-page__footer) {
|
||||
left: 60px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user