feat(credit): 新增企业信用管理模块
- 添加企业信息模型定义,包含企业基本信息、联系方式、行业分类等字段 - 实现企业信息的增删改查接口,支持分页查询和批量操作 - 开发企业信息管理页面,包含表格展示、搜索筛选功能 - 添加企业信息编辑弹窗,支持新增和修改企业信息 - 实现企业信息导入功能,支持Excel文件批量导入 - 添加企业信息导入模板下载功能 - 实现企业信息的状态管理和排序功能 - 添加企业信息的详情展示和操作按钮 - 实现企业信息的批量删除功能 - 添加企业信息的搜索功能,支持关键词模糊查询
This commit is contained in:
@@ -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>只能上传xls、xlsx文件,</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 { importCreditBreachOfTrust } from '@/api/credit/creditBreachOfTrust';
|
||||
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-breach-of-trust/import/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;
|
||||
importCreditBreachOfTrust(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>
|
||||
|
||||
Reference in New Issue
Block a user