feat: 开票付款申请发票冲销改底部弹窗展示并选结算单带出项目利润率

This commit is contained in:
刘泉佳
2026-11-10 12:19:34 +08:00
parent 29a0cdf9fd
commit 0cd2e3b28f
4 changed files with 162 additions and 16 deletions
+29 -4
View File
@@ -91,7 +91,7 @@
<el-input
:model-value="profitRatePercent"
:disabled="readonly"
placeholder="选结算单后自动带出,可修改"
placeholder="选结算单带出,可修改"
@input="handleProfitRateInput"
>
<template #append>%</template>
@@ -363,6 +363,11 @@
</section-card>
<section-card title="开票明细">
<template #extra>
<el-button v-if="recordId" type="primary" @click="writeOffPanelVisible = true"
>发票冲销</el-button
>
</template>
<el-table
ref="detailTable"
:data="detailRows"
@@ -412,9 +417,9 @@
</el-table>
</section-card>
<section-card v-if="recordId" title="发票冲销明细">
<bottom-detail-panel v-model="writeOffPanelVisible" title="发票冲销明细">
<invoice-write-off-table biz-type="invoice_apply" :biz-id="recordId" />
</section-card>
</bottom-detail-panel>
<section-card title="附件信息">
<vehicle-attachment-table v-model="form.attachments" :readonly="readonly" />
@@ -519,10 +524,12 @@ import * as api from '@/api/payment/invoiceApplication';
import { getAll as getInvoiceItems } from '@/api/base/invoice-item';
import { getList as getWaybillList } from '@/api/business/waybill-manage';
import { getList as getReceivablePayableDetailList } from '@/api/settlement/receivable-payable-detail';
import { getDetail as getProjectApplyDetail } from '@/api/business/project-apply';
import { getDictionary } from '@/api/system/dictbiz';
import { invoiceApplicationDetailColumns } from '@/option/payment/invoiceApplication';
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
import InvoiceWriteOffTable from '@/components/invoice-write-off-table/main.vue';
import BottomDetailPanel from '@/components/bottom-detail-panel/main.vue';
import { getMkPublicDetail } from '@/api/mk-process';
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
@@ -579,12 +586,14 @@ export default {
components: {
VehicleAttachmentTable,
InvoiceWriteOffTable,
BottomDetailPanel,
},
data() {
return {
form: emptyForm(),
detailRows: [],
selectedDetailIds: [],
writeOffPanelVisible: false,
receiverInvoiceOptions: [],
contactOptions: [],
departmentEmailOptions: [],
@@ -978,11 +987,27 @@ export default {
allocatedInvoiceAmount: 0,
}));
this.form.projectName = first.projectName;
this.form.projectId = first.projectId;
this.form.deptName = first.deptName;
this.form.issuerName = first.issuerName;
this.form.undertakingDeptName = first.deptName;
this.settlementDialog.visible = false;
await Promise.all([this.loadSettlementDetails(), this.loadReceiverInformation()]);
await Promise.all([
this.loadSettlementDetails(),
this.loadReceiverInformation(),
this.loadProjectProfitRate(),
]);
},
// 项目利润率:选结算单后带出项目立项利润率(百分数转小数存 form),已手填时不覆盖
async loadProjectProfitRate() {
if (!this.form.projectId || Number(this.form.profitRate) > 0) return;
try {
const data = this.unwrapData(await getProjectApplyDetail(this.form.projectId));
const rate = Number(data?.profitRate);
if (Number.isFinite(rate) && rate > 0) this.form.profitRate = rate / 100;
} catch {
// 带出失败不阻断选单,保存时后端仍会兜底取项目立项利润率
}
},
async loadSettlementDetails(resetSelection = true) {
this.detailRows =
+10 -2
View File
@@ -290,6 +290,11 @@
</el-table>
</section-card>
<section-card v-if="showInvoiceSection" title="发票信息">
<template #extra>
<el-button v-if="recordId" type="primary" @click="writeOffPanelVisible = true"
>发票冲销</el-button
>
</template>
<el-table :data="form.invoices" border>
<el-table-column type="index" label="序号" width="70" />
<el-table-column prop="settlementNo" label="结算单号" min-width="120">
@@ -350,9 +355,9 @@
</el-table-column>
</el-table>
</section-card>
<section-card v-if="recordId" title="发票冲销明细">
<bottom-detail-panel v-model="writeOffPanelVisible" title="发票冲销明细">
<invoice-write-off-table biz-type="payment_receipt" :biz-id="recordId" />
</section-card>
</bottom-detail-panel>
<section-card title="付款记录">
<el-table :data="paymentRecords" border
><el-table-column type="index" label="序号" width="70" /><el-table-column
@@ -764,6 +769,7 @@ import {
} from '@/utils/kingdee-attachment';
import PdfPreview from '@/components/pdf-preview/main.vue';
import InvoiceWriteOffTable from '@/components/invoice-write-off-table/main.vue';
import BottomDetailPanel from '@/components/bottom-detail-panel/main.vue';
const attachmentViewerPlugins = [
imagePlugin(),
@@ -841,12 +847,14 @@ export default {
OpenFileViewer,
PdfPreview,
InvoiceWriteOffTable,
BottomDetailPanel,
},
data() {
return {
form: emptyForm(),
amountSyncing: false,
transferPayload: null,
writeOffPanelVisible: false,
// 金蝶侧发票附件查看/下载进行中(行组级 loading 守卫)
kingdeeAttachmentBusy: false,
referenceRows: [],