调整结算模块

This commit is contained in:
2026-09-07 19:37:27 +08:00
parent 0d070d4b34
commit a7315b4491
21 changed files with 1876 additions and 635 deletions
+45 -14
View File
@@ -907,6 +907,27 @@ const defaultForm = () => ({
feeGenerationMode: 'system',
remark: '',
});
// 复制新增:仅保留可编辑字段与明细,剔除主键、编号、审批与流程信息
const createCopiedDetail = (detail = {}) => {
const form = defaultForm();
Object.keys(form).forEach(prop => {
if (Object.prototype.hasOwnProperty.call(detail, prop)) form[prop] = detail[prop];
});
return {
...form,
contractNo: '',
feeGenerationMode: detail.feeGenerationMode || '',
billingEnabled: detail.billingEnabled,
contractFileJson: detail.contractFileJson || '',
attachmentsJson: detail.attachmentsJson || '',
billingPlanJson: detail.billingPlanJson || '',
paymentRatioJson: detail.paymentRatioJson || '',
settlementRuleJson: detail.settlementRuleJson || '',
preSettlementConfigJson: detail.preSettlementConfigJson || '',
formalSettlementConfigJson: detail.formalSettlementConfigJson || '',
changeRecordJson: '',
};
};
const parseArray = value => {
if (Array.isArray(value)) return value;
if (!value) return [];
@@ -1458,11 +1479,7 @@ export default {
);
},
canCopy(row) {
return (
this.hasPermission(`${this.config.permission}_copy`) &&
!row.readonly &&
typeof this.api.copy === 'function'
);
return this.hasPermission(`${this.config.permission}_copy`) && !row.readonly;
},
editLabel(row) {
return this.config.editLabelStatusMap?.[row.approvalStatus] || '编辑';
@@ -1559,6 +1576,11 @@ export default {
initFormPage() {
this.resetFormState();
if (this.formMode === 'add') {
const copyId = this.$route.query.copyId;
if (copyId) {
this.api.getDetail(copyId).then(res => this.applyCopyDetail(res.data?.data || {}));
return;
}
this.loadContractPartyOptions();
return;
}
@@ -1624,6 +1646,12 @@ export default {
this.syncCurrentOrganizationOption();
this.loadContractPartyOptions();
},
applyCopyDetail(detail) {
this.applyDetail(createCopiedDetail(detail));
this.form.handlerUserName =
this.userInfo?.realName || this.userInfo?.userName || this.userInfo?.account || '';
this.$nextTick(() => this.$refs.contractForm?.clearValidate());
},
closeForm() {
this.$router.$avueRouter?.closeTag?.();
this.$router.push('/business/contract-manage');
@@ -1796,10 +1824,15 @@ export default {
if (this.contractPartyLoading) return;
const requestId = ++this.contractPartyRequestId;
this.contractPartyLoading = true;
getCustomerArchiveList(1, 9999, { status: 1, approvalStatus: 'approved' })
.then(res => {
const queryParams = { status: 1, approvalStatus: 'approved' };
Promise.all([
getCustomerArchiveList(1, 9999, queryParams),
getCustomerArchiveList(1, 9999, { ...queryParams, accessType: 'temporary' }),
])
.then(responses => {
if (requestId !== this.contractPartyRequestId) return;
const names = extractRecords(res)
const names = responses
.flatMap(extractRecords)
.map(item => item.fullName || item.shortName || item.customerName || item.customerCode)
.map(name => String(name || '').trim())
.filter(Boolean);
@@ -2336,12 +2369,10 @@ export default {
});
},
handleCopy(row) {
this.$confirm('确定复制该合同?', '提示', { type: 'warning' })
.then(() => this.api.copy(row.id))
.then(() => {
this.$message.success('复制成功');
this.onLoad(this.page, this.query);
});
this.$router.push({
path: '/business/contract-manage/form',
query: { mode: 'add', copyId: row.id, name: '新增合同管理' },
});
},
openFlow(row, loaded = false) {
const processInstanceId = row.processInstanceId || row.processInstanceID || row.procInstId;