feat(credit): 添加历史数据导入功能和操作人字段

- 在多个信用模块API中新增历史数据导入功能,包括行政许可、破产重整、失信被执行人、开庭公告、终本案件等
- 为信用相关页面表格增加操作人(realName)字段显示
- 新增历史数据导入弹窗组件,支持Excel文件上传和模板下载
- 实现导入历史数据的API接口函数,支持文件和公司ID参数
- 优化信用模块页面UI布局,添加历史导入按钮和相关组件引用
This commit is contained in:
2026-01-20 02:17:36 +08:00
parent 7890ec07d8
commit 183967ea4a
47 changed files with 1372 additions and 21 deletions

View File

@@ -0,0 +1,96 @@
<!-- 历史破产重整导入弹窗 -->
<template>
<ele-modal
:width="520"
:footer="null"
title="历史破产重整批量导入"
:visible="visible"
@update:visible="updateVisible"
>
<a-spin :spinning="loading">
<a-upload-dragger
accept=".xls,.xlsx"
:show-upload-list="false"
:customRequest="doUpload"
style="padding: 24px 0; margin-bottom: 16px"
>
<p class="ant-upload-drag-icon">
<cloud-upload-outlined />
</p>
<p class="ant-upload-hint">将文件拖到此处或点击上传</p>
</a-upload-dragger>
</a-spin>
<div class="ele-text-center">
<span>只能上传xlsxlsx文件</span>
<a :href="templateUrl" download="历史破产重整导入模板.xlsx">
下载导入模板
</a>
</div>
</ele-modal>
</template>
<script lang="ts" setup>
import { computed, ref } from 'vue';
import { message } from 'ant-design-vue/es';
import { CloudUploadOutlined } from '@ant-design/icons-vue';
import { importCreditBankruptcyHistory } from '@/api/credit/creditBankruptcy';
import { API_BASE_URL } from '@/config/setting';
const emit = defineEmits<{
(e: 'done'): void;
(e: 'update:visible', visible: boolean): void;
}>();
defineProps<{
// 是否打开弹窗
visible: boolean;
}>();
// 导入请求状态
const loading = ref(false);
// 模板下载地址,保持与当前接口域名一致
const templateUrl = computed(() => {
const base = (localStorage.getItem('ApiUrl') || API_BASE_URL || '').replace(
/\/$/,
''
);
return `${base}/credit/credit-bankruptcy/import/history/template`;
});
/* 上传 */
const doUpload = ({ file }) => {
if (
![
'application/vnd.ms-excel',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
].includes(file.type)
) {
message.error('只能选择 excel 文件');
return false;
}
if (file.size / 1024 / 1024 > 10) {
message.error('大小不能超过 10MB');
return false;
}
loading.value = true;
importCreditBankruptcyHistory(file)
.then((msg) => {
loading.value = false;
message.success(msg);
updateVisible(false);
emit('done');
})
.catch((e) => {
loading.value = false;
message.error(e.message);
});
return false;
};
/* 更新 visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
</script>