feat: 开票申请接入暂估成本与冲销明细展示
This commit is contained in:
@@ -6,6 +6,7 @@ export const invoiceApplicationTableColumns = [
|
|||||||
{ prop: 'issuerName', label: '开票方', minWidth: 150 },
|
{ prop: 'issuerName', label: '开票方', minWidth: 150 },
|
||||||
{ prop: 'receiverName', label: '受票方', minWidth: 150 },
|
{ prop: 'receiverName', label: '受票方', minWidth: 150 },
|
||||||
{ prop: 'invoiceAmount', label: '开票金额', minWidth: 130, money: true },
|
{ prop: 'invoiceAmount', label: '开票金额', minWidth: 130, money: true },
|
||||||
|
{ prop: 'estimatedCost', label: '暂估成本', minWidth: 130, money: true },
|
||||||
{ prop: 'createUserName', label: '创建人', minWidth: 110 },
|
{ prop: 'createUserName', label: '创建人', minWidth: 110 },
|
||||||
{ prop: 'createTime', label: '创建时间', minWidth: 170 },
|
{ prop: 'createTime', label: '创建时间', minWidth: 170 },
|
||||||
{ prop: 'approvalStatusName', label: '状态', minWidth: 110, status: true },
|
{ prop: 'approvalStatusName', label: '状态', minWidth: 110, status: true },
|
||||||
|
|||||||
@@ -86,6 +86,27 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="项目利润率">
|
||||||
|
<el-input
|
||||||
|
:model-value="profitRatePercent"
|
||||||
|
:disabled="readonly"
|
||||||
|
placeholder="选结算单后自动带出,可修改"
|
||||||
|
@input="handleProfitRateInput"
|
||||||
|
>
|
||||||
|
<template #append>%</template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="暂估成本(不含税)">
|
||||||
|
<el-input
|
||||||
|
:model-value="estimatedCost > 0 ? formatMoney(estimatedCost) : ''"
|
||||||
|
disabled
|
||||||
|
placeholder="开票不含税金额合计×项目利润率"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="部门邮箱" prop="departmentEmails">
|
<el-form-item label="部门邮箱" prop="departmentEmails">
|
||||||
<el-select
|
<el-select
|
||||||
@@ -326,12 +347,18 @@
|
|||||||
<el-table-column label="结算总金额" min-width="140" align="right">
|
<el-table-column label="结算总金额" min-width="140" align="right">
|
||||||
<template #default="{ row }">{{ formatMoney(row.settlementAmount) }}</template>
|
<template #default="{ row }">{{ formatMoney(row.settlementAmount) }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="历史累计开票金额" min-width="150" align="right">
|
||||||
|
<template #default="{ row }">{{ formatMoney(row.historyInvoicedAmount) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="本次开票金额" min-width="140" align="right">
|
||||||
|
<template #default="{ row }">{{ formatMoney(row.allocatedInvoiceAmount) }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="剩余未开票金额" min-width="150" align="right">
|
||||||
|
<template #default="{ row }">{{ formatMoney(row.remainingUninvoicedAmount) }}</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="可开票金额" min-width="140" align="right">
|
<el-table-column label="可开票金额" min-width="140" align="right">
|
||||||
<template #default="{ row }">{{ formatMoney(row.availableInvoiceAmount) }}</template>
|
<template #default="{ row }">{{ formatMoney(row.availableInvoiceAmount) }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="分摊发票金额" min-width="140" align="right">
|
|
||||||
<template #default="{ row }">{{ formatMoney(row.allocatedInvoiceAmount) }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
</section-card>
|
</section-card>
|
||||||
|
|
||||||
@@ -385,6 +412,10 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</section-card>
|
</section-card>
|
||||||
|
|
||||||
|
<section-card v-if="recordId" title="发票冲销明细">
|
||||||
|
<invoice-write-off-table biz-type="invoice_apply" :biz-id="recordId" />
|
||||||
|
</section-card>
|
||||||
|
|
||||||
<section-card title="附件信息">
|
<section-card title="附件信息">
|
||||||
<vehicle-attachment-table v-model="form.attachments" :readonly="readonly" />
|
<vehicle-attachment-table v-model="form.attachments" :readonly="readonly" />
|
||||||
</section-card>
|
</section-card>
|
||||||
@@ -491,6 +522,7 @@ import { getList as getReceivablePayableDetailList } from '@/api/settlement/rece
|
|||||||
import { getDictionary } from '@/api/system/dictbiz';
|
import { getDictionary } from '@/api/system/dictbiz';
|
||||||
import { invoiceApplicationDetailColumns } from '@/option/payment/invoiceApplication';
|
import { invoiceApplicationDetailColumns } from '@/option/payment/invoiceApplication';
|
||||||
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
|
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
|
||||||
|
import InvoiceWriteOffTable from '@/components/invoice-write-off-table/main.vue';
|
||||||
import { getMkPublicDetail } from '@/api/mk-process';
|
import { getMkPublicDetail } from '@/api/mk-process';
|
||||||
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||||
|
|
||||||
@@ -538,12 +570,15 @@ const emptyForm = () => ({
|
|||||||
sheets: [emptySheet()],
|
sheets: [emptySheet()],
|
||||||
attachments: [],
|
attachments: [],
|
||||||
remark: '',
|
remark: '',
|
||||||
|
// 项目利润率(小数,如0.04表示4%;保存时后端快照并重算暂估成本)
|
||||||
|
profitRate: null,
|
||||||
});
|
});
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'InvoiceApplicationForm',
|
name: 'InvoiceApplicationForm',
|
||||||
components: {
|
components: {
|
||||||
VehicleAttachmentTable,
|
VehicleAttachmentTable,
|
||||||
|
InvoiceWriteOffTable,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -621,6 +656,24 @@ export default {
|
|||||||
0
|
0
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
// 项目利润率百分数展示/输入(后端存小数:0.04 ↔ 4)
|
||||||
|
profitRatePercent() {
|
||||||
|
const rate = Number(this.form.profitRate);
|
||||||
|
if (!Number.isFinite(rate) || rate <= 0) return '';
|
||||||
|
return String(Math.round(rate * 10000) / 100);
|
||||||
|
},
|
||||||
|
// 暂估成本 = 开票不含税金额合计 × 项目利润率(实时计算,后端保存时重算覆盖)
|
||||||
|
estimatedCost() {
|
||||||
|
const rate = Number(this.form.profitRate);
|
||||||
|
if (!Number.isFinite(rate) || rate <= 0) return 0;
|
||||||
|
const amountNoTaxTotal = this.form.sheets.reduce(
|
||||||
|
(sheetTotal, sheet) =>
|
||||||
|
sheetTotal +
|
||||||
|
sheet.lines.reduce((lineTotal, line) => lineTotal + Number(line.amountNoTax || 0), 0),
|
||||||
|
0
|
||||||
|
);
|
||||||
|
return amountNoTaxTotal * rate;
|
||||||
|
},
|
||||||
detailColumns() {
|
detailColumns() {
|
||||||
return [...this.detailBaseColumns, ...this.feeItemColumns];
|
return [...this.detailBaseColumns, ...this.feeItemColumns];
|
||||||
},
|
},
|
||||||
@@ -732,6 +785,13 @@ export default {
|
|||||||
this.transportTypeOptions.find(item => String(item.value) === String(value))?.label || value
|
this.transportTypeOptions.find(item => String(item.value) === String(value))?.label || value
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
// 项目利润率输入(百分数),转小数存储:4 → 0.04
|
||||||
|
handleProfitRateInput(value) {
|
||||||
|
let normalized = String(value || '').replace(/[^\d.]/g, '');
|
||||||
|
normalized = normalized.replace(/(\..*)\./g, '$1');
|
||||||
|
const percent = Number(normalized);
|
||||||
|
this.form.profitRate = Number.isFinite(percent) && percent > 0 ? percent / 100 : null;
|
||||||
|
},
|
||||||
invoiceItemNames(categoryName) {
|
invoiceItemNames(categoryName) {
|
||||||
return this.invoiceItems.filter(item => item.categoryName === categoryName);
|
return this.invoiceItems.filter(item => item.categoryName === categoryName);
|
||||||
},
|
},
|
||||||
@@ -1173,6 +1233,7 @@ export default {
|
|||||||
contactName: this.form.contactName,
|
contactName: this.form.contactName,
|
||||||
contactPhone: this.form.contactPhone,
|
contactPhone: this.form.contactPhone,
|
||||||
email: this.form.email,
|
email: this.form.email,
|
||||||
|
profitRate: Number(this.form.profitRate) > 0 ? Number(this.form.profitRate) : null,
|
||||||
attachmentsJson: JSON.stringify(this.form.attachments || []),
|
attachmentsJson: JSON.stringify(this.form.attachments || []),
|
||||||
remark: this.form.remark,
|
remark: this.form.remark,
|
||||||
settlements: this.form.settlements.map(item => ({
|
settlements: this.form.settlements.map(item => ({
|
||||||
|
|||||||
Reference in New Issue
Block a user