✨ 金蝶票池选票统一查镜像前端接线(新增统一选票弹窗组件,替换收票与结算认领弹窗并删除Mock)
This commit is contained in:
@@ -412,126 +412,16 @@
|
||||
</el-table>
|
||||
</section-card>
|
||||
|
||||
<el-dialog
|
||||
<kingdee-invoice-pool-dialog
|
||||
v-model="invoiceClaimDialog.visible"
|
||||
title="查询可认领发票"
|
||||
width="92%"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
>
|
||||
<el-form
|
||||
:model="invoiceClaimDialog.query"
|
||||
inline
|
||||
label-position="right"
|
||||
label-width="100px"
|
||||
class="formal-editor__invoice-claim-search"
|
||||
@submit.prevent
|
||||
>
|
||||
<el-form-item label="发票号码">
|
||||
<el-input
|
||||
v-model="invoiceClaimDialog.query.invoiceNo"
|
||||
clearable
|
||||
@keyup.enter="handleInvoiceClaimQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="开票日期">
|
||||
<el-date-picker
|
||||
v-model="invoiceClaimDialog.query.invoiceDateRange"
|
||||
type="daterange"
|
||||
value-format="YYYY-MM-DD"
|
||||
format="YYYY-MM-DD"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="销方税号">
|
||||
<el-input
|
||||
v-model="invoiceClaimDialog.query.salerTaxNo"
|
||||
clearable
|
||||
@keyup.enter="handleInvoiceClaimQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="购方税号">
|
||||
<el-input
|
||||
v-model="invoiceClaimDialog.query.buyerTaxNo"
|
||||
clearable
|
||||
@keyup.enter="handleInvoiceClaimQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单据使用状态">
|
||||
<el-select
|
||||
v-model="invoiceClaimDialog.query.expenseStatus"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in expenseStatusOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="resetInvoiceClaimQuery">重置</el-button>
|
||||
<el-button type="primary" @click="handleInvoiceClaimQuery">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
ref="invoiceClaimTable"
|
||||
v-loading="invoiceClaimDialog.loading"
|
||||
:data="invoiceClaimDialog.rows"
|
||||
row-key="serialNo"
|
||||
border
|
||||
height="520"
|
||||
@selection-change="invoiceClaimDialog.selected = $event"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="52"
|
||||
fixed="left"
|
||||
align="center"
|
||||
reserve-selection
|
||||
/>
|
||||
<el-table-column type="index" label="序号" width="64" align="center" />
|
||||
<el-table-column prop="invoiceNo" label="发票号" min-width="180" align="center" />
|
||||
<el-table-column prop="invoiceDate" label="开票日期" min-width="130" align="center" />
|
||||
<el-table-column prop="invoiceTypeName" label="发票类型" min-width="150" align="center" />
|
||||
<el-table-column prop="salerName" label="开票单位" min-width="180" align="center" />
|
||||
<el-table-column prop="buyerName" label="受票单位" min-width="180" align="center" />
|
||||
<el-table-column
|
||||
prop="invoiceAmount"
|
||||
label="发票金额(含税)"
|
||||
min-width="160"
|
||||
align="right"
|
||||
>
|
||||
<template #default="{ row }">{{ formatMoney(row.invoiceAmount) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="matchedAmount" label="认领金额" min-width="140" align="right">
|
||||
<template #default="{ row }">{{ formatMoney(row.matchedAmount) }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="formal-editor__pagination">
|
||||
<el-pagination
|
||||
v-model:current-page="invoiceClaimDialog.page.current"
|
||||
v-model:page-size="invoiceClaimDialog.page.size"
|
||||
:total="invoiceClaimDialog.page.total"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@current-change="loadInvoiceClaims"
|
||||
@size-change="handleInvoiceClaimSizeChange"
|
||||
/>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="invoiceClaimDialog.visible = false">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:loading="invoiceClaimDialog.confirming"
|
||||
@click="confirmInvoiceClaims"
|
||||
>确认认领</el-button
|
||||
>
|
||||
</template>
|
||||
</el-dialog>
|
||||
confirm-text="确认认领"
|
||||
multiple
|
||||
:initial-invoice-no="String(invoiceClaimNo || '').trim()"
|
||||
:query-api="invoicePoolQueryApi"
|
||||
:fetch-api="invoicePoolFetchApi"
|
||||
@confirm="handleInvoiceClaimConfirm"
|
||||
/>
|
||||
|
||||
<section-card
|
||||
v-if="readonly"
|
||||
@@ -1002,6 +892,7 @@ import {
|
||||
getReceiptClaims,
|
||||
claimInvoices as claimInvoicesApi,
|
||||
queryInvoicePool,
|
||||
fetchInvoicePoolByNo,
|
||||
save,
|
||||
} from '@/api/settlement/formalSettlement';
|
||||
import {
|
||||
@@ -1026,11 +917,12 @@ import { h } from 'vue';
|
||||
import { InfoFilled } from '@element-plus/icons-vue';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { downloadFileByUrl } from '@/utils/util';
|
||||
import KingdeeInvoicePoolDialog from '@/components/kingdee-invoice-pool-dialog/main.vue';
|
||||
import * as XLSX from 'xlsx';
|
||||
|
||||
export default {
|
||||
name: 'FormalSettlementEditor',
|
||||
components: { InfoFilled },
|
||||
components: { InfoFilled, KingdeeInvoicePoolDialog },
|
||||
props: {
|
||||
modelValue: Boolean,
|
||||
recordId: [String, Number],
|
||||
@@ -1062,25 +954,9 @@ export default {
|
||||
invoiceClaimLoading: false,
|
||||
invoiceClaimDialog: {
|
||||
visible: false,
|
||||
loading: false,
|
||||
confirming: false,
|
||||
rows: [],
|
||||
selected: [],
|
||||
page: { current: 1, size: 10, total: 0 },
|
||||
query: {
|
||||
invoiceNo: '',
|
||||
invoiceDateRange: [],
|
||||
salerTaxNo: '',
|
||||
buyerTaxNo: '',
|
||||
expenseStatus: '',
|
||||
},
|
||||
confirming: false,
|
||||
},
|
||||
expenseStatusOptions: [
|
||||
{ value: '1', label: '未用' },
|
||||
{ value: '30', label: '在用' },
|
||||
{ value: '60', label: '已用' },
|
||||
{ value: '65', label: '已入账' },
|
||||
],
|
||||
attachmentUploadFiles: [],
|
||||
attachmentTypeOptions: [],
|
||||
attachmentFileTypes: [
|
||||
@@ -1300,15 +1176,7 @@ export default {
|
||||
this.invoices = [];
|
||||
this.invoiceClaimNo = '';
|
||||
this.invoiceClaimDialog.visible = false;
|
||||
this.invoiceClaimDialog.rows = [];
|
||||
this.invoiceClaimDialog.selected = [];
|
||||
this.invoiceClaimDialog.query = {
|
||||
invoiceNo: '',
|
||||
invoiceDateRange: [],
|
||||
salerTaxNo: '',
|
||||
buyerTaxNo: '',
|
||||
expenseStatus: '',
|
||||
};
|
||||
this.attachmentUploadFiles = [];
|
||||
this.billingRuleDialog = {
|
||||
visible: false,
|
||||
@@ -2300,50 +2168,21 @@ export default {
|
||||
}
|
||||
},
|
||||
openInvoiceClaimDialog() {
|
||||
this.invoiceClaimDialog.query.invoiceNo = String(this.invoiceClaimNo || '').trim();
|
||||
this.invoiceClaimDialog.visible = true;
|
||||
this.handleInvoiceClaimQuery();
|
||||
},
|
||||
handleInvoiceClaimQuery() {
|
||||
this.invoiceClaimDialog.page.current = 1;
|
||||
this.loadInvoiceClaims();
|
||||
invoicePoolQueryApi(params) {
|
||||
return queryInvoicePool(params);
|
||||
},
|
||||
resetInvoiceClaimQuery() {
|
||||
this.invoiceClaimDialog.query = {
|
||||
invoiceNo: '',
|
||||
invoiceDateRange: [],
|
||||
salerTaxNo: '',
|
||||
buyerTaxNo: '',
|
||||
expenseStatus: '',
|
||||
};
|
||||
this.handleInvoiceClaimQuery();
|
||||
invoicePoolFetchApi(invoiceNo) {
|
||||
return fetchInvoicePoolByNo(invoiceNo);
|
||||
},
|
||||
handleInvoiceClaimSizeChange() {
|
||||
this.invoiceClaimDialog.page.current = 1;
|
||||
this.loadInvoiceClaims();
|
||||
},
|
||||
async loadInvoiceClaims() {
|
||||
this.invoiceClaimDialog.loading = true;
|
||||
try {
|
||||
const query = this.invoiceClaimDialog.query;
|
||||
const range = query.invoiceDateRange || [];
|
||||
const data = this.unwrapData(
|
||||
await queryInvoicePool({
|
||||
current: this.invoiceClaimDialog.page.current,
|
||||
size: this.invoiceClaimDialog.page.size,
|
||||
invoiceNo: query.invoiceNo || undefined,
|
||||
invoiceDateStart: range[0] || undefined,
|
||||
invoiceDateEnd: range[1] || undefined,
|
||||
salerTaxNo: query.salerTaxNo || undefined,
|
||||
buyerTaxNo: query.buyerTaxNo || undefined,
|
||||
expenseStatus: query.expenseStatus || undefined,
|
||||
})
|
||||
);
|
||||
this.invoiceClaimDialog.rows = data.records || [];
|
||||
this.invoiceClaimDialog.page.total = Number(data.total || 0);
|
||||
} finally {
|
||||
this.invoiceClaimDialog.loading = false;
|
||||
}
|
||||
async handleInvoiceClaimConfirm(rows) {
|
||||
// 统一票池行附件字段为复数 attachmentsJson,认领请求契约是单数 attachmentJson,中转处归一
|
||||
this.invoiceClaimDialog.selected = rows.map(row => ({
|
||||
...row,
|
||||
attachmentJson: row.attachmentJson || row.attachmentsJson,
|
||||
}));
|
||||
await this.confirmInvoiceClaims();
|
||||
},
|
||||
async confirmInvoiceClaims() {
|
||||
if (!this.invoiceClaimDialog.selected.length) {
|
||||
|
||||
Reference in New Issue
Block a user