1、调整合同

2、调整项目
3、调整付款管理
This commit is contained in:
2026-08-26 02:31:12 +08:00
parent 3da2d428f3
commit dc5a2235eb
13 changed files with 1184 additions and 235 deletions
+23 -6
View File
@@ -804,6 +804,13 @@ import '@open-file-viewer/core/style.css';
import pdfWorkerSrc from 'pdfjs-dist/build/pdf.worker.mjs?url';
const clone = value => JSON.parse(JSON.stringify(value));
const normalizeOptionalInteger = (value, emptyValue = null) => {
if (value === undefined || value === null || value === '' || Number(value) < 0) {
return emptyValue;
}
const number = Number(value);
return Number.isFinite(number) ? Math.trunc(number) : emptyValue;
};
const defaultSettlementRule = () => ({
autoGenerate: 1,
billStartDate: '',
@@ -1480,6 +1487,8 @@ export default {
this.form = {
...defaultForm(),
...detail,
copyCount: normalizeOptionalInteger(detail.copyCount, ''),
paymentDays: normalizeOptionalInteger(detail.paymentDays, ''),
feeGenerationMode:
detail.feeGenerationMode || (Number(detail.billingEnabled) === 0 ? 'manual' : 'system'),
};
@@ -1554,6 +1563,8 @@ export default {
this.syncSettlementConfig();
return {
...this.form,
copyCount: normalizeOptionalInteger(this.form.copyCount),
paymentDays: normalizeOptionalInteger(this.form.paymentDays),
billingEnabled: this.form.feeGenerationMode === 'manual' ? 0 : 1,
contractFileJson: JSON.stringify(this.contractFileRows),
attachmentsJson: JSON.stringify(this.attachmentRows),
@@ -1914,7 +1925,11 @@ export default {
});
},
applyDetailState(detail = {}) {
this.detailRow = { ...detail };
this.detailRow = {
...detail,
copyCount: normalizeOptionalInteger(detail.copyCount),
paymentDays: normalizeOptionalInteger(detail.paymentDays),
};
this.detailContractFileRows = parseArray(detail.contractFileJson);
this.detailAttachmentRows = parseArray(detail.attachmentsJson);
this.detailBillingPlanRows = parseArray(detail.billingPlanJson);
@@ -1946,7 +1961,9 @@ export default {
},
detailUnitValue(prop, unit) {
const value = this.detailRow[prop];
return value === undefined || value === null || value === '' ? '-' : `${value}${unit}`;
return value === undefined || value === null || value === '' || Number(value) < 0
? ''
: `${value}${unit}`;
},
detailObjectUnitValue(row, prop, unit) {
const value = row?.[prop];
@@ -1985,7 +2002,7 @@ export default {
const run = value => {
const args = operation.prompt ? [row.id, value] : [row.id];
this.api[operation.action](...args).then(() => {
this.$message.success(`${operation.label}成功`);
this.$message.success(operation.successMessage || `${operation.label}成功`);
this.onLoad(this.page, this.query);
});
};
@@ -1997,9 +2014,9 @@ export default {
inputErrorMessage: '请输入内容',
}).then(({ value }) => run(value));
} else {
this.$confirm(`确定${operation.label}该合同?`, '提示', { type: 'warning' }).then(() =>
run()
);
this.$confirm(operation.confirmMessage || `确定${operation.label}该合同?`, '提示', {
type: 'warning',
}).then(() => run());
}
},
removeRow(row) {