♻️ 收票管理仅保留推送金蝶收票单并统一命名为批量同步
This commit is contained in:
@@ -25,8 +25,6 @@ export const submit = data => request({ url: `${baseUrl}/submit`, method: 'post'
|
||||
export const approve = data => request({ url: `${baseUrl}/approve`, method: 'post', data });
|
||||
export const returnBill = data => request({ url: `${baseUrl}/return`, method: 'post', data });
|
||||
export const voidBill = data => request({ url: `${baseUrl}/void`, method: 'post', data });
|
||||
export const syncKingdee = id =>
|
||||
request({ url: `${baseUrl}/sync-kingdee`, method: 'post', params: { id } });
|
||||
export const pushKingdee = ids =>
|
||||
request({ url: `${baseUrl}/push-kingdee`, method: 'post', data: ids });
|
||||
|
||||
@@ -38,8 +36,9 @@ export const approvalStatusOptions = [
|
||||
{ label: '已作废', value: 'voided' },
|
||||
];
|
||||
|
||||
export const kingdeeStatusOptions = [
|
||||
{ label: '未同步', value: 'unsynced' },
|
||||
{ label: '已同步', value: 'synced' },
|
||||
{ label: '同步失败', value: 'failed' },
|
||||
export const kingdeePushStatusOptions = [
|
||||
{ label: '未推送', value: 'unsynced' },
|
||||
{ label: '已保存收票单', value: 'pushed' },
|
||||
{ label: '已指定应付', value: 'assigned' },
|
||||
{ label: '推送失败', value: 'failed' },
|
||||
];
|
||||
|
||||
@@ -11,6 +11,7 @@ export const invoiceReceiptTableColumns = [
|
||||
{ prop: 'currentProcessor', label: '当前处理人', minWidth: 130 },
|
||||
{ prop: 'createUserName', label: '创建人', minWidth: 110 },
|
||||
{ prop: 'createTime', label: '创建时间', minWidth: 170 },
|
||||
{ prop: 'kingdeeBillNo', label: '金蝶单据号', minWidth: 150 },
|
||||
{ prop: 'kingdeeStatusName', label: '金蝶单据状态', minWidth: 140 },
|
||||
{ prop: 'kingdeeReceivedInvoiceNo', label: '金蝶单据号', minWidth: 150 },
|
||||
{ prop: 'kingdeePushStatusName', label: '金蝶状态', minWidth: 130 },
|
||||
{ prop: 'kingdeePushMsg', label: '失败原因', minWidth: 160 },
|
||||
];
|
||||
|
||||
@@ -226,8 +226,6 @@ const emptyForm = () => ({
|
||||
bankName: '',
|
||||
bankAccount: '',
|
||||
issuingBank: '',
|
||||
kingdeeBillNo: '',
|
||||
kingdeeStatus: 'unsynced',
|
||||
phone: '',
|
||||
customerEmails: [],
|
||||
departmentEmails: [],
|
||||
@@ -395,8 +393,6 @@ export default {
|
||||
bankName: selected.bankName,
|
||||
bankAccount: selected.bankAccount,
|
||||
issuingBank: selected.issuingBank,
|
||||
kingdeeBillNo: selected.kingdeeBillNo || '',
|
||||
kingdeeStatus: selected.kingdeeStatus || 'unsynced',
|
||||
phone: preserveUserInput ? this.form.phone : selected.phone || '',
|
||||
customerEmails: preserveUserInput
|
||||
? this.form.customerEmails
|
||||
@@ -518,8 +514,6 @@ export default {
|
||||
bankName: this.form.bankName,
|
||||
bankAccount: this.form.bankAccount,
|
||||
issuingBank: this.form.issuingBank,
|
||||
kingdeeBillNo: this.form.kingdeeBillNo,
|
||||
kingdeeStatus: this.form.kingdeeStatus,
|
||||
phone: this.form.phone,
|
||||
customerEmails: this.form.customerEmails.join(';'),
|
||||
departmentEmails: this.form.departmentEmails.join(';'),
|
||||
|
||||
@@ -40,10 +40,10 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="searchExpanded" label="金蝶单据状态">
|
||||
<el-select v-model="query.kingdeeStatus" clearable placeholder="请选择">
|
||||
<el-form-item v-if="searchExpanded" label="金蝶状态">
|
||||
<el-select v-model="query.kingdeePushStatus" clearable placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in kingdeeStatusOptions"
|
||||
v-for="item in kingdeePushStatusOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
@@ -66,19 +66,12 @@
|
||||
<section class="receipt-page__table-panel">
|
||||
<div class="receipt-page__toolbar">
|
||||
<div class="receipt-page__toolbar-left">
|
||||
<el-button
|
||||
v-if="hasPermission('invoice_receipt_sync')"
|
||||
type="primary"
|
||||
plain
|
||||
@click="handleBatchSync"
|
||||
>批量同步</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="hasPermission('invoice_receipt_sync')"
|
||||
type="primary"
|
||||
plain
|
||||
@click="handlePushKingdee"
|
||||
>推送金蝶收票单</el-button
|
||||
>批量同步</el-button
|
||||
>
|
||||
<el-button v-if="hasPermission('invoice_receipt_add')" type="primary" @click="openCreate"
|
||||
>新增</el-button
|
||||
@@ -251,7 +244,7 @@ const emptyQuery = () => ({
|
||||
deptName: '',
|
||||
deptPath: [],
|
||||
approvalStatus: '',
|
||||
kingdeeStatus: '',
|
||||
kingdeePushStatus: '',
|
||||
});
|
||||
|
||||
export default {
|
||||
@@ -265,7 +258,7 @@ export default {
|
||||
query: emptyQuery(),
|
||||
searchExpanded: false,
|
||||
approvalStatusOptions: api.approvalStatusOptions,
|
||||
kingdeeStatusOptions: api.kingdeeStatusOptions,
|
||||
kingdeePushStatusOptions: api.kingdeePushStatusOptions,
|
||||
columns: invoiceReceiptTableColumns,
|
||||
rows: [],
|
||||
selection: [],
|
||||
@@ -370,23 +363,13 @@ export default {
|
||||
this.$message.success('作废成功');
|
||||
this.loadTable();
|
||||
},
|
||||
async handleBatchSync() {
|
||||
const rows = this.selection.filter(row => row.approvalStatus === 'approved');
|
||||
if (!rows.length) {
|
||||
this.$message.warning('请选择至少一条审批通过的收票登记');
|
||||
return;
|
||||
}
|
||||
await Promise.all(rows.map(row => api.syncKingdee(row.id)));
|
||||
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} 条收票登记推送金蝶收票单?`, '提示', {
|
||||
await this.$confirm(`确认将选中的 ${rows.length} 条收票登记同步至金蝶?`, '提示', {
|
||||
type: 'warning',
|
||||
});
|
||||
const summary = this.unwrapData(await api.pushKingdee(rows.map(row => row.id)));
|
||||
@@ -408,8 +391,9 @@ export default {
|
||||
当前处理人: item.currentProcessor,
|
||||
创建人: item.createUserName,
|
||||
创建时间: item.createTime,
|
||||
金蝶单据号: item.kingdeeBillNo,
|
||||
金蝶单据状态: item.kingdeeStatusName,
|
||||
金蝶单据号: item.kingdeeReceivedInvoiceNo,
|
||||
金蝶状态: item.kingdeePushStatusName,
|
||||
失败原因: item.kingdeePushMsg,
|
||||
}));
|
||||
const workbook = XLSX.utils.book_new();
|
||||
XLSX.utils.book_append_sheet(workbook, XLSX.utils.json_to_sheet(exportRows), '收票登记');
|
||||
|
||||
Reference in New Issue
Block a user