feat(credit): 在企业详情页面添加历史破产重整导入功能
- 在企业详情的破产重整标签页中增加导入历史破产重整按钮 - 修改credit-bankruptcy-history-import组件以支持传入企业ID参数 - 将历史破产重整导入功能集成到企业详情页面的抽屉组件中 - 移除原破产重整主页面的历史导入相关代码和按钮 - 添加企业ID验证逻辑确保导入操作的安全性 - 实现导入完成后的数据重新加载和分页重置功能
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
VITE_APP_NAME=后台管理(开发环境)
|
||||
VITE_API_URL=http://127.0.0.1:9200/api
|
||||
#VITE_API_URL=http://127.0.0.1:9200/api
|
||||
#VITE_SERVER_API_URL=http://127.0.0.1:8000/api
|
||||
|
||||
|
||||
|
||||
@@ -41,9 +41,11 @@
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
|
||||
defineProps<{
|
||||
const props = defineProps<{
|
||||
// 是否打开弹窗
|
||||
visible: boolean;
|
||||
// 关联企业ID(企业详情下导入时需要)
|
||||
companyId?: number;
|
||||
}>();
|
||||
|
||||
// 导入请求状态
|
||||
@@ -74,7 +76,7 @@
|
||||
return false;
|
||||
}
|
||||
loading.value = true;
|
||||
importCreditBankruptcyHistory(file)
|
||||
importCreditBankruptcyHistory(file, props.companyId)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
message.success(msg);
|
||||
@@ -93,4 +95,3 @@
|
||||
emit('update:visible', value);
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -22,12 +22,6 @@
|
||||
@importData="openImport"
|
||||
@exportData="exportData"
|
||||
/>
|
||||
<a-button type="dashed" class="ele-btn-icon" @click="openImport2">
|
||||
<template #icon>
|
||||
<CloudUploadOutlined />
|
||||
</template>
|
||||
<span class="text-red-500">导入历史破产重整</span>
|
||||
</a-button>
|
||||
</a-space>
|
||||
|
||||
</template>
|
||||
@@ -74,15 +68,13 @@
|
||||
/>
|
||||
<!-- 导入弹窗 -->
|
||||
<CreditBankruptcyImport v-model:visible="showImport" @done="reload" />
|
||||
<!-- 历史导入弹窗 -->
|
||||
<CreditBankruptcyHistoryImport v-model:visible="showImport2" @done="reload" />
|
||||
</a-page-header>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined, CloudUploadOutlined } from '@ant-design/icons-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import type {
|
||||
@@ -94,7 +86,6 @@
|
||||
import { getPageTitle } from '@/utils/common';
|
||||
import CreditBankruptcyEdit from './components/creditBankruptcyEdit.vue';
|
||||
import CreditBankruptcyImport from './components/credit-bankruptcy-import.vue';
|
||||
import CreditBankruptcyHistoryImport from './components/credit-bankruptcy-history-import.vue';
|
||||
import {
|
||||
pageCreditBankruptcy,
|
||||
listCreditBankruptcy,
|
||||
@@ -117,8 +108,6 @@
|
||||
const showEdit = ref(false);
|
||||
// 是否显示导入弹窗
|
||||
const showImport = ref(false);
|
||||
// 是否显示历史导入弹窗
|
||||
const showImport2 = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
@@ -240,11 +229,6 @@
|
||||
showImport.value = true;
|
||||
};
|
||||
|
||||
/* 打开历史导入弹窗 */
|
||||
const openImport2 = () => {
|
||||
showImport2.value = true;
|
||||
};
|
||||
|
||||
/* 导出 */
|
||||
const exportData = () => {
|
||||
exportCreditData<CreditBankruptcy>({
|
||||
|
||||
@@ -49,8 +49,20 @@
|
||||
>
|
||||
导入(多)
|
||||
</a-button>
|
||||
<a-button
|
||||
v-if="tab.key === '破产重整'"
|
||||
type="dashed"
|
||||
:disabled="!form.id"
|
||||
@click="openBankruptcyHistoryImport"
|
||||
>
|
||||
<template #icon>
|
||||
<CloudUploadOutlined />
|
||||
</template>
|
||||
导入历史破产重整
|
||||
</a-button>
|
||||
<a-button
|
||||
v-if="tab.key === '行政许可'"
|
||||
type="dashed"
|
||||
:disabled="!form.id"
|
||||
@click="openAdministrativeLicenseHistoryImport"
|
||||
>
|
||||
@@ -99,6 +111,13 @@
|
||||
:companyId="form.id"
|
||||
@done="handleAdministrativeLicenseHistoryImportDone"
|
||||
/>
|
||||
|
||||
<!-- 历史破产重整导入(企业详情-破产重整tab) -->
|
||||
<CreditBankruptcyHistoryImport
|
||||
v-model:visible="showBankruptcyHistoryImport"
|
||||
:companyId="form.id"
|
||||
@done="handleBankruptcyHistoryImportDone"
|
||||
/>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
@@ -112,6 +131,7 @@
|
||||
import { storeToRefs } from 'pinia';
|
||||
import CreditCompanyRelatedImport from './credit-company-related-import.vue';
|
||||
import CreditAdministrativeLicenseHistoryImport from '@/views/credit/creditAdministrativeLicense/components/credit-administrative-license-history-import.vue';
|
||||
import CreditBankruptcyHistoryImport from '@/views/credit/creditBankruptcy/components/credit-bankruptcy-history-import.vue';
|
||||
import {
|
||||
pageCreditAdministrativeLicense,
|
||||
importCreditAdministrativeLicense
|
||||
@@ -986,6 +1006,22 @@
|
||||
reloadTab('行政许可');
|
||||
};
|
||||
|
||||
// 历史破产重整导入弹窗(企业详情-破产重整tab)
|
||||
const showBankruptcyHistoryImport = ref(false);
|
||||
|
||||
const openBankruptcyHistoryImport = () => {
|
||||
if (!form.id) {
|
||||
message.error('缺少企业ID,无法导入');
|
||||
return;
|
||||
}
|
||||
showBankruptcyHistoryImport.value = true;
|
||||
};
|
||||
|
||||
const handleBankruptcyHistoryImportDone = () => {
|
||||
resetTabPagination('破产重整');
|
||||
reloadTab('破产重整');
|
||||
};
|
||||
|
||||
const defaultForm: CreditCompany = {
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
|
||||
Reference in New Issue
Block a user