@@ -1011,12 +1021,13 @@ import {
viewKingdeeInvoiceFile,
} from '@/utils/kingdee-attachment';
import KingdeeInvoicePoolDialog from '@/components/kingdee-invoice-pool-dialog/main.vue';
+import ProjectAdvanceWriteOff from './project-advance-write-off.vue';
import * as XLSX from 'xlsx';
import { isAdministrator } from '@/utils/auth';
export default {
name: 'FormalSettlementEditor',
- components: { InfoFilled, KingdeeInvoicePoolDialog },
+ components: { InfoFilled, KingdeeInvoicePoolDialog, ProjectAdvanceWriteOff },
props: {
modelValue: Boolean,
recordId: [String, Number],
@@ -1045,6 +1056,7 @@ export default {
receiptClaims: [],
adjustments: [],
changeRecords: [],
+ projectAdvanceWriteOffs: [],
attachments: [],
selectedAttachmentRows: [],
invoices: [],
@@ -1275,6 +1287,13 @@ export default {
}
this.adjustments = data.adjustments || [];
this.changeRecords = data.changeRecords || [];
+ this.projectAdvanceWriteOffs = (data.projectAdvanceWriteOffs || []).map(row => ({
+ ...row,
+ writeOffAmount: Number(row.writeOffAmount || 0),
+ projectAdvanceAmount: Number(row.projectAdvanceAmount || 0),
+ availableWriteOffAmount: Number(row.availableWriteOffAmount || 0),
+ createTime: row.paymentCreateTime || row.createTime,
+ }));
this.attachments = this.parseAttachments(data.attachmentsJson);
this.selectedAttachmentRows = [];
this.invoices = data.invoices || [];
@@ -1305,6 +1324,7 @@ export default {
this.receiptClaims = [];
this.adjustments = [];
this.changeRecords = [];
+ this.projectAdvanceWriteOffs = [];
this.attachments = [];
this.selectedAttachmentRows = [];
this.invoices = [];
@@ -2549,6 +2569,7 @@ export default {
matchedAmount: Number(row.matchedAmount || 0),
attachmentJson: row.attachmentJson || '',
})),
+ projectAdvanceWriteOffs: this.$refs.projectAdvanceWriteOffRef?.toSavePayload?.() || [],
remark: this.form.remark,
};
},
@@ -2557,6 +2578,9 @@ export default {
},
async handleDraftSave() {
// 保存草稿:不做表单校验,直接落草稿并返回列表刷新
+ if (this.$refs.projectAdvanceWriteOffRef?.validateBeforeSave?.() === false) {
+ return;
+ }
this.draftSaving = true;
try {
await save({
@@ -2584,6 +2608,9 @@ export default {
return this.$message.warning('请完善手工费用的费用类型和费用项');
}
if (!this.validateInvoices()) return;
+ if (this.$refs.projectAdvanceWriteOffRef?.validateBeforeSave?.() === false) {
+ return;
+ }
// 附件类型仅做提示,不阻断正式结算单新增/保存提交。
// this.validateAttachments();
this.saving = true;
diff --git a/src/views/settlement/components/pre-settlement-editor.vue b/src/views/settlement/components/pre-settlement-editor.vue
index b46cec5..e60bedc 100644
--- a/src/views/settlement/components/pre-settlement-editor.vue
+++ b/src/views/settlement/components/pre-settlement-editor.vue
@@ -421,6 +421,16 @@
+