feat(credit): 新增企业信用管理模块
- 添加企业信息模型定义,包含企业基本信息、联系方式、行业分类等字段 - 实现企业信息的增删改查接口,支持分页查询和批量操作 - 开发企业信息管理页面,包含表格展示、搜索筛选功能 - 添加企业信息编辑弹窗,支持新增和修改企业信息 - 实现企业信息导入功能,支持Excel文件批量导入 - 添加企业信息导入模板下载功能 - 实现企业信息的状态管理和排序功能 - 添加企业信息的详情展示和操作按钮 - 实现企业信息的批量删除功能 - 添加企业信息的搜索功能,支持关键词模糊查询
This commit is contained in:
126
src/api/credit/creditCompany/index.ts
Normal file
126
src/api/credit/creditCompany/index.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { CreditCompany, CreditCompanyParam } from './model';
|
||||
|
||||
/**
|
||||
* 分页查询企业
|
||||
*/
|
||||
export async function pageCreditCompany(params: CreditCompanyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<CreditCompany>>>(
|
||||
'/credit/credit-company/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询企业列表
|
||||
*/
|
||||
export async function listCreditCompany(params?: CreditCompanyParam) {
|
||||
const res = await request.get<ApiResult<CreditCompany[]>>(
|
||||
'/credit/credit-company',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加企业
|
||||
*/
|
||||
export async function addCreditCompany(data: CreditCompany) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/credit/credit-company',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改企业
|
||||
*/
|
||||
export async function updateCreditCompany(data: CreditCompany) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/credit/credit-company',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除企业
|
||||
*/
|
||||
export async function removeCreditCompany(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/credit/credit-company/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除企业
|
||||
*/
|
||||
export async function removeBatchCreditCompany(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/credit/credit-company/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询企业
|
||||
*/
|
||||
export async function getCreditCompany(id: number) {
|
||||
const res = await request.get<ApiResult<CreditCompany>>(
|
||||
'/credit/credit-company/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入企业
|
||||
*/
|
||||
export async function importCreditCompany(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/credit/credit-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));
|
||||
}
|
||||
135
src/api/credit/creditCompany/model/index.ts
Normal file
135
src/api/credit/creditCompany/model/index.ts
Normal file
@@ -0,0 +1,135 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 企业
|
||||
*/
|
||||
export interface CreditCompany {
|
||||
// ID
|
||||
id?: number;
|
||||
// 原文件导入名称
|
||||
name?: string;
|
||||
// 系统匹配企业名称
|
||||
matchName?: string;
|
||||
// 统一社会信用代码
|
||||
code?: string;
|
||||
// 类型
|
||||
type?: number;
|
||||
// 上级id, 0是顶级
|
||||
parentId?: number;
|
||||
// 登记状态
|
||||
registrationStatus?: string;
|
||||
// 法定代表人
|
||||
legalPerson?: string;
|
||||
// 注册资本
|
||||
registeredCapital?: string;
|
||||
// 实缴资本
|
||||
paidinCapital?: string;
|
||||
// 成立日期
|
||||
establishDate?: string;
|
||||
// 企业地址
|
||||
address?: string;
|
||||
// 电话
|
||||
tel?: string;
|
||||
// 更多电话
|
||||
moreTel?: string;
|
||||
// 邮箱
|
||||
email?: string;
|
||||
// 更多邮箱
|
||||
moreEmail?: string;
|
||||
// 所在国家
|
||||
country?: string;
|
||||
// 所属省份
|
||||
province?: string;
|
||||
// 所属城市
|
||||
city?: string;
|
||||
// 所属区县
|
||||
region?: string;
|
||||
// 企业(机构)类型
|
||||
institutionType?: string;
|
||||
// 纳税人识别号
|
||||
taxpayerCode?: string;
|
||||
// 注册号
|
||||
registrationNumber?: string;
|
||||
// 组织机构代码
|
||||
organizationalCode?: string;
|
||||
// 参保人数
|
||||
numberOfInsuredPersons?: string;
|
||||
// 参保人数所属年报
|
||||
annualReport?: string;
|
||||
// 营业期限
|
||||
businessTerm?: string;
|
||||
// 国标行业门类
|
||||
nationalStandardIndustryCategories?: string;
|
||||
// 国标行业大类
|
||||
nationalStandardIndustryCategories2?: string;
|
||||
// 国标行业中类
|
||||
nationalStandardIndustryCategories3?: string;
|
||||
// 国标行业小类
|
||||
nationalStandardIndustryCategories4?: string;
|
||||
// 企查查行业门类
|
||||
nationalStandardIndustryCategories5?: string;
|
||||
// 企查查行业大类
|
||||
nationalStandardIndustryCategories6?: string;
|
||||
// 企查查行业中类
|
||||
nationalStandardIndustryCategories7?: string;
|
||||
// 企查查行业小类
|
||||
nationalStandardIndustryCategories8?: string;
|
||||
// 企业规模
|
||||
companySize?: string;
|
||||
// 曾用名
|
||||
formerName?: string;
|
||||
// 英文名
|
||||
englishName?: string;
|
||||
// 官网
|
||||
domain?: string;
|
||||
// 通信地址
|
||||
mailingAddress?: string;
|
||||
// 企业简介
|
||||
companyProfile?: string;
|
||||
// 经营范围
|
||||
natureOfBusiness?: string;
|
||||
// 登记机关
|
||||
registrationAuthority?: string;
|
||||
// 纳税人资质
|
||||
taxpayerQualification?: string;
|
||||
// 最新年报年份
|
||||
latestAnnualReportYear?: string;
|
||||
// 最新年报营业收入
|
||||
latestAnnualReportOnOperatingRevenue?: string;
|
||||
// 企查分
|
||||
enterpriseScoreCheck?: string;
|
||||
// 信用等级
|
||||
creditRating?: string;
|
||||
// 科创分
|
||||
cechnologyScore?: string;
|
||||
// 科创等级
|
||||
cechnologyLevel?: string;
|
||||
// 是否小微企业
|
||||
smallEnterprise?: string;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 是否推荐
|
||||
recommend?: number;
|
||||
// 排序(数字越小越靠前)
|
||||
sortNumber?: number;
|
||||
// 状态, 0正常, 1冻结
|
||||
status?: number;
|
||||
// 是否删除, 0否, 1是
|
||||
deleted?: number;
|
||||
// 用户ID
|
||||
userId?: number;
|
||||
// 租户id
|
||||
tenantId?: number;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 修改时间
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业搜索条件
|
||||
*/
|
||||
export interface CreditCompanyParam extends PageParam {
|
||||
id?: number;
|
||||
keywords?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user