调整结算模块

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
+42 -22
View File
@@ -447,9 +447,6 @@
</template>
</el-table-column>
</el-table>
<div class="payment-form-page__reference-confirm">
<el-button type="primary" :disabled="!formalSelection.length" @click="confirmFormalSelection">确定</el-button>
</div>
<div class="payment-form-page__reference-pagination">
<el-pagination
v-model:current-page="formalPage.current"
@@ -486,12 +483,21 @@
@size-change="handlePreSizeChange"
/>
</div>
<div class="payment-form-page__reference-confirm">
<el-button type="primary" :disabled="!preSelection.length" @click="confirmPreSelection">确定</el-button>
</div>
</el-tab-pane>
</el-tabs></div
></el-dialog>
>
<template v-if="form.paymentType !== 'project_advance'" #footer>
<div class="payment-form-page__reference-footer">
<el-button @click="referenceVisible = false">取消</el-button>
<el-button
type="primary"
:disabled="!referenceSelection.length"
@click="confirmReferenceSelection"
>确定</el-button
>
</div>
</template>
</el-dialog>
<el-dialog v-model="billDialogVisible" title="选择汇票" width="80%" append-to-body>
<div class="payment-form-page__reference-search">
<el-form :model="billQuery" label-position="right" label-width="160px" @submit.prevent>
@@ -798,6 +804,9 @@ export default {
const amount = this.form.settlementAmount;
return Number(amount || 0);
},
referenceSelection() {
return (this.referenceTab === 'formal' ? this.formalSelection : this.preSelection) || [];
},
referenceLabel() {
if (this.referenceRows.length) {
return this.referenceRows
@@ -1484,16 +1493,23 @@ export default {
material.keywords.some(keyword => fileName.includes(keyword.toLocaleLowerCase())))
);
},
resolveAttachmentTypeByFileName(file) {
matchAttachmentMaterialByFileName(file, materials = Object.values(ATTACHMENT_MATERIALS)) {
const fileName = this.normalizedAttachmentFileName(file);
const material = [...Object.values(ATTACHMENT_MATERIALS)]
.sort(
(a, b) =>
Math.max(...b.keywords.map(String.length)) - Math.max(...a.keywords.map(String.length))
if (!fileName) return null;
const matched = (materials || [])
.flatMap(material =>
material.keywords.map(keyword => ({
material,
keyword: String(keyword).toLocaleLowerCase(),
}))
)
.find(item =>
item.keywords.some(keyword => fileName.includes(String(keyword).toLocaleLowerCase()))
);
.filter(item => item.keyword)
.sort((a, b) => b.keyword.length - a.keyword.length)
.find(item => fileName.includes(item.keyword));
return matched?.material || null;
},
resolveAttachmentTypeByFileName(file) {
const material = this.matchAttachmentMaterialByFileName(file);
return material ? MATERIAL_TYPE_MAP[material.key] : 'other';
},
hasAttachmentMaterial(material) {
@@ -1509,12 +1525,11 @@ export default {
return hasUploadedAttachment;
},
resolveAttachmentMaterial(file, materials = Object.values(ATTACHMENT_MATERIALS)) {
return [...materials]
.sort(
(a, b) =>
Math.max(...b.keywords.map(String.length)) - Math.max(...a.keywords.map(String.length))
)
.find(material => this.attachmentMatchesMaterial(file, material));
if (!this.attachmentFileUrl(file)) return null;
const typeMatched = (materials || []).find(
material => file.attachmentType === MATERIAL_TYPE_MAP[material.key]
);
return typeMatched || this.matchAttachmentMaterialByFileName(file, materials);
},
mergeAutomaticAttachments(files, materials, sourceName, defaultMaterial = null) {
const existingUrls = new Set(
@@ -2099,6 +2114,10 @@ export default {
]);
if (this.billPayment) this.loadBillOptions();
},
confirmReferenceSelection() {
if (this.referenceTab === 'formal') return this.confirmFormalSelection();
return this.confirmPreSelection();
},
async confirmFormalSelection() {
const rows = this.formalSelection || [];
if (!rows.length) return;
@@ -2370,7 +2389,8 @@ export default {
white-space: nowrap;
}
.payment-form-page__reference-search-actions,
.payment-form-page__reference-pagination {
.payment-form-page__reference-pagination,
.payment-form-page__reference-footer {
display: flex;
justify-content: flex-end;
}