feat: 开票申请接入暂估成本与冲销明细展示
This commit is contained in:
@@ -6,6 +6,7 @@ export const invoiceApplicationTableColumns = [
|
||||
{ prop: 'issuerName', label: '开票方', minWidth: 150 },
|
||||
{ prop: 'receiverName', label: '受票方', minWidth: 150 },
|
||||
{ prop: 'invoiceAmount', label: '开票金额', minWidth: 130, money: true },
|
||||
{ prop: 'estimatedCost', label: '暂估成本', minWidth: 130, money: true },
|
||||
{ prop: 'createUserName', label: '创建人', minWidth: 110 },
|
||||
{ prop: 'createTime', label: '创建时间', minWidth: 170 },
|
||||
{ prop: 'approvalStatusName', label: '状态', minWidth: 110, status: true },
|
||||
|
||||
@@ -86,6 +86,27 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</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-form-item label="部门邮箱" prop="departmentEmails">
|
||||
<el-select
|
||||
@@ -326,12 +347,18 @@
|
||||
<el-table-column label="结算总金额" min-width="140" align="right">
|
||||
<template #default="{ row }">{{ formatMoney(row.settlementAmount) }}</template>
|
||||
</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">
|
||||
<template #default="{ row }">{{ formatMoney(row.availableInvoiceAmount) }}</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>
|
||||
</section-card>
|
||||
|
||||
@@ -385,6 +412,10 @@
|
||||
</el-table>
|
||||
</section-card>
|
||||
|
||||
<section-card v-if="recordId" title="发票冲销明细">
|
||||
<invoice-write-off-table biz-type="invoice_apply" :biz-id="recordId" />
|
||||
</section-card>
|
||||
|
||||
<section-card title="附件信息">
|
||||
<vehicle-attachment-table v-model="form.attachments" :readonly="readonly" />
|
||||
</section-card>
|
||||
@@ -491,6 +522,7 @@ import { getList as getReceivablePayableDetailList } from '@/api/settlement/rece
|
||||
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 { getMkPublicDetail } from '@/api/mk-process';
|
||||
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
|
||||
@@ -538,12 +570,15 @@ const emptyForm = () => ({
|
||||
sheets: [emptySheet()],
|
||||
attachments: [],
|
||||
remark: '',
|
||||
// 项目利润率(小数,如0.04表示4%;保存时后端快照并重算暂估成本)
|
||||
profitRate: null,
|
||||
});
|
||||
|
||||
export default {
|
||||
name: 'InvoiceApplicationForm',
|
||||
components: {
|
||||
VehicleAttachmentTable,
|
||||
InvoiceWriteOffTable,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -621,6 +656,24 @@ export default {
|
||||
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() {
|
||||
return [...this.detailBaseColumns, ...this.feeItemColumns];
|
||||
},
|
||||
@@ -732,6 +785,13 @@ export default {
|
||||
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) {
|
||||
return this.invoiceItems.filter(item => item.categoryName === categoryName);
|
||||
},
|
||||
@@ -1173,6 +1233,7 @@ export default {
|
||||
contactName: this.form.contactName,
|
||||
contactPhone: this.form.contactPhone,
|
||||
email: this.form.email,
|
||||
profitRate: Number(this.form.profitRate) > 0 ? Number(this.form.profitRate) : null,
|
||||
attachmentsJson: JSON.stringify(this.form.attachments || []),
|
||||
remark: this.form.remark,
|
||||
settlements: this.form.settlements.map(item => ({
|
||||
|
||||
Reference in New Issue
Block a user