feat(credit): 新增附近企业批量导入功能并优化数据表结构
- 新增 importCreditNearbyCompanyMulti 函数支持多文件同时导入 - 提取 buildImportFormData 工具函数统一处理文件上传逻辑 - 在信用公司页面新增批量导入按钮和上传图标组件 - 将限制高消费表格中的发生时间字段从 occurrenceTime 改为 releaseDate - 调整股权冻结页面的数据状态列顺序和显示逻辑 - 移除附近企业页面中重复和不必要的表格列配置 - 修改附近企业页面通信地址邮箱列为正确的通信地址邮编 - 更新开发环境配置文件启用本地 API 地址并
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
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
|
||||
|
||||
|
||||
#VITE_API_URL=https://ysb-api.websoft.top/api
|
||||
VITE_SERVER_API_URL=https://server.websoft.top/api
|
||||
#VITE_SERVER_API_URL=https://server.websoft.top/api
|
||||
|
||||
@@ -115,11 +115,7 @@ export async function importCreditNearbyCompany(
|
||||
file: File,
|
||||
companyId?: number
|
||||
) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
if (companyId != null) {
|
||||
formData.append('companyId', String(companyId));
|
||||
}
|
||||
const formData = buildImportFormData(file, companyId);
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/credit/credit-nearby-company/import',
|
||||
formData,
|
||||
@@ -135,6 +131,49 @@ export async function importCreditNearbyCompany(
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入附近企业(多文件,同一次请求)
|
||||
*
|
||||
* 约定:后端需支持 multipart 同名字段 `file` 多次出现(常见于 MultipartFile[] file)
|
||||
*/
|
||||
export async function importCreditNearbyCompanyMulti(
|
||||
files: File[] | FileList,
|
||||
companyId?: number
|
||||
) {
|
||||
const formData = buildImportFormData(files, companyId);
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/credit/credit-nearby-company/import',
|
||||
formData,
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
function buildImportFormData(
|
||||
fileOrFiles: File | File[] | FileList,
|
||||
companyId?: number
|
||||
) {
|
||||
const formData = new FormData();
|
||||
if (Array.isArray(fileOrFiles)) {
|
||||
fileOrFiles.forEach((f) => formData.append('file', f));
|
||||
} else if (fileOrFiles instanceof FileList) {
|
||||
Array.from(fileOrFiles).forEach((f) => formData.append('file', f));
|
||||
} else {
|
||||
formData.append('file', fileOrFiles);
|
||||
}
|
||||
if (companyId != null) {
|
||||
formData.append('companyId', String(companyId));
|
||||
}
|
||||
return formData;
|
||||
}
|
||||
|
||||
export interface ImportBatchCreditNearbyCompanyItem {
|
||||
fileName: string;
|
||||
success: boolean;
|
||||
|
||||
@@ -952,6 +952,8 @@
|
||||
},
|
||||
hidden: ['historyId', 'historyName']
|
||||
},
|
||||
|
||||
|
||||
限制高消费: {
|
||||
columns: [
|
||||
{ dataIndex: 'id', title: 'ID' },
|
||||
@@ -963,7 +965,7 @@
|
||||
},
|
||||
{ dataIndex: 'appellee', title: '被告/被上诉人', key: 'appellee' },
|
||||
{ dataIndex: 'otherPartiesThirdParty', title: '其他当事人/第三人' },
|
||||
{ dataIndex: 'occurrenceTime', title: '发生时间' },
|
||||
{ dataIndex: 'releaseDate', title: '发生时间' },
|
||||
{ dataIndex: 'caseNumber', title: '案号' },
|
||||
{ dataIndex: 'involvedAmount', title: '涉案金额' },
|
||||
{ dataIndex: 'courtName', title: '法院' },
|
||||
@@ -1174,7 +1176,8 @@
|
||||
{ dataIndex: 'publicDate', title: '公示日期' },
|
||||
{ dataIndex: 'freezeDateStart', title: '冻结开始日期' },
|
||||
{ dataIndex: 'freezeDateEnd', title: '冻结结束日期' },
|
||||
{ dataIndex: 'dataStatus', title: '数据状态' },
|
||||
{ dataIndex: 'dataStatus', title: '状态' },
|
||||
{ dataIndex: 'dataType', title: '数据状态' },
|
||||
{ dataIndex: 'realName', title: '操作人' },
|
||||
{ dataIndex: 'createTime', title: '创建时间' }
|
||||
]
|
||||
|
||||
@@ -40,6 +40,9 @@
|
||||
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||
</template>
|
||||
<template v-if="column.key === 'dataType'">
|
||||
{{ record.dataType }}
|
||||
</template>
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a @click="openEdit(record)">修改</a>
|
||||
@@ -185,13 +188,13 @@
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'dataType',
|
||||
key: 'dataType'
|
||||
dataIndex: 'dataStatus',
|
||||
key: 'dataStatus'
|
||||
},
|
||||
{
|
||||
title: '数据状态',
|
||||
dataIndex: 'dataStatus',
|
||||
key: 'dataStatus'
|
||||
dataIndex: 'dataType',
|
||||
key: 'dataType'
|
||||
},
|
||||
{
|
||||
title: '操作人',
|
||||
|
||||
@@ -14,6 +14,12 @@
|
||||
>
|
||||
<template #toolbar>
|
||||
<a-space class="flex">
|
||||
<a-button class="ele-btn-icon" @click="openImport">
|
||||
<template #icon>
|
||||
<CloudUploadOutlined />
|
||||
</template>
|
||||
<span>导入(多)</span>
|
||||
</a-button>
|
||||
<RefreshCompanyIdButton
|
||||
module="credit-nearby-company"
|
||||
@done="reload"
|
||||
@@ -90,6 +96,7 @@
|
||||
import RefreshCompanyIdButton from '@/views/credit/components/RefreshCompanyIdButton.vue';
|
||||
import { exportCreditData } from '../utils/export';
|
||||
import { getPageTitle } from '@/utils/common';
|
||||
import { CloudUploadOutlined } from '@ant-design/icons-vue';
|
||||
import CreditNearbyCompanyEdit from './components/creditNearbyCompanyEdit.vue';
|
||||
import CreditNearbyCompanyImport from './components/credit-nearby-company-import.vue';
|
||||
import {
|
||||
@@ -213,12 +220,6 @@
|
||||
key: 'email',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '邮箱',
|
||||
dataIndex: 'moreEmail',
|
||||
key: 'moreEmail',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '所在国家',
|
||||
dataIndex: 'country',
|
||||
@@ -322,7 +323,7 @@
|
||||
key: 'mailingAddress'
|
||||
},
|
||||
{
|
||||
title: '通信地址邮箱',
|
||||
title: '通信地址邮编',
|
||||
dataIndex: 'mailingEmail',
|
||||
key: 'mailingEmail'
|
||||
},
|
||||
@@ -338,11 +339,6 @@
|
||||
key: 'natureOfBusiness',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: '电话',
|
||||
dataIndex: 'tel',
|
||||
key: 'tel'
|
||||
},
|
||||
{
|
||||
title: '企查查行业门类',
|
||||
dataIndex: 'nationalStandardIndustryCategories5',
|
||||
@@ -363,62 +359,33 @@
|
||||
dataIndex: 'nationalStandardIndustryCategories8',
|
||||
key: 'nationalStandardIndustryCategories8'
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
dataIndex: 'type',
|
||||
key: 'type',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '实缴资本',
|
||||
dataIndex: 'paidinCapital',
|
||||
key: 'paidinCapital'
|
||||
},
|
||||
{
|
||||
title: '登记机关',
|
||||
dataIndex: 'registrationAuthority',
|
||||
key: 'registrationAuthority'
|
||||
},
|
||||
{
|
||||
title: '纳税人资质',
|
||||
dataIndex: 'taxpayerQualification',
|
||||
key: 'taxpayerQualification'
|
||||
},
|
||||
{
|
||||
title: '最新年报年份',
|
||||
dataIndex: 'latestAnnualReportYear',
|
||||
key: 'latestAnnualReportYear'
|
||||
},
|
||||
{
|
||||
title: '最新年报营业收入',
|
||||
dataIndex: 'latestAnnualReportOnOperatingRevenue',
|
||||
key: 'latestAnnualReportOnOperatingRevenue'
|
||||
},
|
||||
{
|
||||
title: '企查分',
|
||||
dataIndex: 'enterpriseScoreCheck',
|
||||
key: 'enterpriseScoreCheck'
|
||||
},
|
||||
{
|
||||
title: '信用等级',
|
||||
dataIndex: 'creditRating',
|
||||
key: 'creditRating'
|
||||
},
|
||||
{
|
||||
title: '科创分',
|
||||
dataIndex: 'cechnologyScore',
|
||||
key: 'cechnologyScore'
|
||||
},
|
||||
{
|
||||
title: '科创等级',
|
||||
dataIndex: 'cechnologyLevel',
|
||||
key: 'cechnologyLevel'
|
||||
},
|
||||
{
|
||||
title: '是否小微企业',
|
||||
dataIndex: 'smallEnterprise',
|
||||
key: 'smallEnterprise'
|
||||
},
|
||||
// {
|
||||
// title: '实缴资本',
|
||||
// dataIndex: 'paidinCapital',
|
||||
// key: 'paidinCapital'
|
||||
// },
|
||||
// {
|
||||
// title: '登记机关',
|
||||
// dataIndex: 'registrationAuthority',
|
||||
// key: 'registrationAuthority'
|
||||
// },
|
||||
// {
|
||||
// title: '纳税人资质',
|
||||
// dataIndex: 'taxpayerQualification',
|
||||
// key: 'taxpayerQualification'
|
||||
// },
|
||||
// {
|
||||
// title: '最新年报年份',
|
||||
// dataIndex: 'latestAnnualReportYear',
|
||||
// key: 'latestAnnualReportYear'
|
||||
// },
|
||||
// {
|
||||
// title: '最新年报营业收入',
|
||||
// dataIndex: 'latestAnnualReportOnOperatingRevenue',
|
||||
// key: 'latestAnnualReportOnOperatingRevenue'
|
||||
// },
|
||||
|
||||
|
||||
// {
|
||||
// title: '备注',
|
||||
// dataIndex: 'comments',
|
||||
@@ -552,7 +519,6 @@
|
||||
{ title: '通信地址邮箱', dataIndex: 'mailingEmail' },
|
||||
{ title: '企业简介', dataIndex: 'companyProfile' },
|
||||
{ title: '经营范围', dataIndex: 'natureOfBusiness' },
|
||||
{ title: '电话', dataIndex: 'tel' },
|
||||
{
|
||||
title: '企查查行业门类',
|
||||
dataIndex: 'nationalStandardIndustryCategories5'
|
||||
|
||||
@@ -159,8 +159,8 @@
|
||||
},
|
||||
{
|
||||
title: '发生时间',
|
||||
dataIndex: 'occurrenceTime',
|
||||
key: 'occurrenceTime'
|
||||
dataIndex: 'releaseDate',
|
||||
key: 'releaseDate'
|
||||
},
|
||||
{
|
||||
title: '案号',
|
||||
|
||||
Reference in New Issue
Block a user