✨ 收票单推送金蝶与票池实时游标分页前端适配:选票弹窗hasMore分页,下线镜像补查与票池同步入口,保存时按票号重查回填
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
<el-col :span="6">
|
||||
<el-form-item label="开票金额">
|
||||
<el-input
|
||||
:model-value="form.kingdeeInvoicePoolId ? formatMoney(form.invoiceAmount) : ''"
|
||||
:model-value="form.invoiceNo ? formatMoney(form.invoiceAmount) : ''"
|
||||
disabled
|
||||
placeholder="从金蝶票据池带出"
|
||||
/>
|
||||
@@ -56,7 +56,7 @@
|
||||
<el-col :span="6">
|
||||
<el-form-item label="税额">
|
||||
<el-input
|
||||
:model-value="form.kingdeeInvoicePoolId ? formatMoney(form.taxAmount) : ''"
|
||||
:model-value="form.invoiceNo ? formatMoney(form.taxAmount) : ''"
|
||||
disabled
|
||||
placeholder="从金蝶票据池带出"
|
||||
/>
|
||||
@@ -154,8 +154,6 @@
|
||||
title="查询金蝶票据池"
|
||||
:initial-invoice-no="form.invoiceNo"
|
||||
:query-api="apiQueryInvoicePool"
|
||||
:fetch-api="apiFetchInvoicePool"
|
||||
:sync-api="apiSyncInvoicePool"
|
||||
@confirm="handleInvoicePicked"
|
||||
/>
|
||||
|
||||
@@ -217,7 +215,6 @@ import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.v
|
||||
|
||||
const emptyForm = () => ({
|
||||
id: null,
|
||||
kingdeeInvoicePoolId: null,
|
||||
invoiceNo: '',
|
||||
invoiceDate: '',
|
||||
invoiceType: '',
|
||||
@@ -302,12 +299,6 @@ export default {
|
||||
apiQueryInvoicePool(params) {
|
||||
return api.queryInvoicePool(params);
|
||||
},
|
||||
apiFetchInvoicePool(invoiceNo) {
|
||||
return api.fetchInvoicePoolByNo(invoiceNo);
|
||||
},
|
||||
apiSyncInvoicePool() {
|
||||
return api.syncInvoicePool();
|
||||
},
|
||||
handleInvoicePicked(rows) {
|
||||
this.confirmInvoice(rows[0]);
|
||||
},
|
||||
@@ -356,7 +347,7 @@ export default {
|
||||
if (this.settlementIds.length) await this.loadReferenceInformation();
|
||||
},
|
||||
validateInvoice(rule, value, callback) {
|
||||
if (!value || !this.form.kingdeeInvoicePoolId) {
|
||||
if (!value) {
|
||||
callback(new Error('请选择金蝶票据池发票'));
|
||||
return;
|
||||
}
|
||||
@@ -393,7 +384,6 @@ export default {
|
||||
}
|
||||
const preserveUserInput = options.preserveUserInput === true;
|
||||
Object.assign(this.form, {
|
||||
kingdeeInvoicePoolId: selected.id,
|
||||
invoiceNo: selected.invoiceNo,
|
||||
invoiceDate: selected.invoiceDate,
|
||||
invoiceType: selected.invoiceType,
|
||||
@@ -517,7 +507,6 @@ export default {
|
||||
payload() {
|
||||
return {
|
||||
id: this.form.id,
|
||||
kingdeeInvoicePoolId: this.form.kingdeeInvoicePoolId,
|
||||
invoiceNo: this.form.invoiceNo,
|
||||
invoiceDate: this.form.invoiceDate,
|
||||
invoiceType: this.form.invoiceType,
|
||||
@@ -567,8 +556,15 @@ export default {
|
||||
this.$message.warning('请先选择金蝶票据池发票');
|
||||
return;
|
||||
}
|
||||
const invoice = this.unwrapData(await api.fetchInvoicePoolByNo(this.form.invoiceNo));
|
||||
if (!invoice || !this.confirmInvoice(invoice, { preserveUserInput: true })) return;
|
||||
const data = this.unwrapData(
|
||||
await api.queryInvoicePool({ current: 1, size: 1, invoiceNo: this.form.invoiceNo })
|
||||
);
|
||||
const invoice = (data.records || []).find(item => item.invoiceNo === this.form.invoiceNo);
|
||||
if (!invoice) {
|
||||
this.$message.warning('金蝶票池未查询到该发票');
|
||||
return;
|
||||
}
|
||||
if (!this.confirmInvoice(invoice, { preserveUserInput: true })) return;
|
||||
if (this.settlementIds.length) await this.loadReferenceInformation();
|
||||
this.$message.success('同步成功');
|
||||
},
|
||||
|
||||
@@ -73,6 +73,13 @@
|
||||
@click="handleBatchSync"
|
||||
>批量同步</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="hasPermission('invoice_receipt_sync')"
|
||||
type="primary"
|
||||
plain
|
||||
@click="handlePushKingdee"
|
||||
>推送金蝶收票单</el-button
|
||||
>
|
||||
<el-button v-if="hasPermission('invoice_receipt_add')" type="primary" @click="openCreate"
|
||||
>新增</el-button
|
||||
>
|
||||
@@ -373,6 +380,19 @@ export default {
|
||||
this.$message.success(`已同步${rows.length}条收票登记`);
|
||||
this.loadTable();
|
||||
},
|
||||
async handlePushKingdee() {
|
||||
const rows = this.selection.filter(row => row.approvalStatus === 'approved');
|
||||
if (!rows.length) {
|
||||
this.$message.warning('请选择至少一条审批通过的收票登记');
|
||||
return;
|
||||
}
|
||||
await this.$confirm(`确认将选中的 ${rows.length} 条收票登记推送金蝶收票单?`, '提示', {
|
||||
type: 'warning',
|
||||
});
|
||||
const summary = this.unwrapData(await api.pushKingdee(rows.map(row => row.id)));
|
||||
this.$alert(summary || '推送完成', '推送结果', { confirmButtonText: '知道了' });
|
||||
this.loadTable();
|
||||
},
|
||||
async handleExport() {
|
||||
const data = this.unwrapData(await api.getList(1, 100000, this.query));
|
||||
const exportRows = (data.records || []).map(item => ({
|
||||
|
||||
Reference in New Issue
Block a user