feat(credit): 添加企业信用模块功能
- 在应用配置中注册公司管理页面路由 - 实现首页轮播图组件优化,支持CSS尺寸转换和图片加载 - 新增企业ID修正API功能 - 实现信用模块数据权限控制工具 - 添加客户、联系人、数据查询等页面配置 - 完善行政许可、破产重整、分支机构等信用数据模型 - 实现各类信用数据的增删改查和导入导出接口 - 建立企业信用数据完整管理功能体系
This commit is contained in:
28
src/api/credit/companyId.ts
Normal file
28
src/api/credit/companyId.ts
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修正某个信用模块数据的主体企业归属(按名称匹配回填 companyId)
|
||||||
|
*
|
||||||
|
* 后端约定: POST /api/credit/{module}/company-id/refresh
|
||||||
|
* 例如: module = "credit-judgment-debtor"
|
||||||
|
*/
|
||||||
|
export async function refreshCreditCompanyId(
|
||||||
|
module: string,
|
||||||
|
params?: {
|
||||||
|
onlyNull?: boolean;
|
||||||
|
limit?: number;
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
`/credit/${module}/company-id/refresh`,
|
||||||
|
undefined,
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
171
src/api/credit/creditAdministrativeLicense/index.ts
Normal file
171
src/api/credit/creditAdministrativeLicense/index.ts
Normal file
@@ -0,0 +1,171 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type {
|
||||||
|
CreditAdministrativeLicense,
|
||||||
|
CreditAdministrativeLicenseParam
|
||||||
|
} from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询行政许可
|
||||||
|
*/
|
||||||
|
export async function pageCreditAdministrativeLicense(
|
||||||
|
params: CreditAdministrativeLicenseParam
|
||||||
|
) {
|
||||||
|
const res = await request.get<
|
||||||
|
ApiResult<PageResult<CreditAdministrativeLicense>>
|
||||||
|
>('/credit/credit-administrative-license/page', {
|
||||||
|
params: withCreditUserScope(params)
|
||||||
|
});
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询行政许可列表
|
||||||
|
*/
|
||||||
|
export async function listCreditAdministrativeLicense(
|
||||||
|
params?: CreditAdministrativeLicenseParam
|
||||||
|
) {
|
||||||
|
const res = await request.get<ApiResult<CreditAdministrativeLicense[]>>(
|
||||||
|
'/credit/credit-administrative-license',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加行政许可
|
||||||
|
*/
|
||||||
|
export async function addCreditAdministrativeLicense(
|
||||||
|
data: CreditAdministrativeLicense
|
||||||
|
) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-administrative-license',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改行政许可
|
||||||
|
*/
|
||||||
|
export async function updateCreditAdministrativeLicense(
|
||||||
|
data: CreditAdministrativeLicense
|
||||||
|
) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-administrative-license',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除行政许可
|
||||||
|
*/
|
||||||
|
export async function removeCreditAdministrativeLicense(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-administrative-license/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除行政许可
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditAdministrativeLicense(
|
||||||
|
data: (number | undefined)[]
|
||||||
|
) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-administrative-license/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询行政许可
|
||||||
|
*/
|
||||||
|
export async function getCreditAdministrativeLicense(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditAdministrativeLicense>>(
|
||||||
|
'/credit/credit-administrative-license/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入行政许可
|
||||||
|
*/
|
||||||
|
export async function importCreditAdministrativeLicense(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-administrative-license/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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入历史行政许可
|
||||||
|
*/
|
||||||
|
export async function importCreditAdministrativeLicenseHistory(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-administrative-license/import/history',
|
||||||
|
formData,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
59
src/api/credit/creditAdministrativeLicense/model/index.ts
Normal file
59
src/api/credit/creditAdministrativeLicense/model/index.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行政许可
|
||||||
|
*/
|
||||||
|
export interface CreditAdministrativeLicense {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 决定文书/许可编号
|
||||||
|
code?: string;
|
||||||
|
// 决定文书/许可证名称
|
||||||
|
name?: string;
|
||||||
|
// 许可状态
|
||||||
|
statusText?: string;
|
||||||
|
// 许可类型
|
||||||
|
type?: string;
|
||||||
|
// 链接
|
||||||
|
url?: string;
|
||||||
|
// 有效期自
|
||||||
|
validityStart?: string;
|
||||||
|
// 有效期至
|
||||||
|
validityEnd?: string;
|
||||||
|
// 许可机关
|
||||||
|
licensingAuthority?: string;
|
||||||
|
// 许可内容
|
||||||
|
licenseContent?: string;
|
||||||
|
// 数据来源单位
|
||||||
|
dataSourceUnit?: string;
|
||||||
|
// 备注
|
||||||
|
comments?: string;
|
||||||
|
// 企业ID
|
||||||
|
companyId?: number;
|
||||||
|
// 是否推荐
|
||||||
|
recommend?: number;
|
||||||
|
// 排序(数字越小越靠前)
|
||||||
|
sortNumber?: number;
|
||||||
|
// 状态, 0正常, 1冻结
|
||||||
|
status?: number;
|
||||||
|
// 是否删除, 0否, 1是
|
||||||
|
deleted?: number;
|
||||||
|
// 用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行政许可搜索条件
|
||||||
|
*/
|
||||||
|
export interface CreditAdministrativeLicenseParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
156
src/api/credit/creditBankruptcy/index.ts
Normal file
156
src/api/credit/creditBankruptcy/index.ts
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditBankruptcy, CreditBankruptcyParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询破产重整
|
||||||
|
*/
|
||||||
|
export async function pageCreditBankruptcy(params: CreditBankruptcyParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditBankruptcy>>>(
|
||||||
|
'/credit/credit-bankruptcy/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询破产重整列表
|
||||||
|
*/
|
||||||
|
export async function listCreditBankruptcy(params?: CreditBankruptcyParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditBankruptcy[]>>(
|
||||||
|
'/credit/credit-bankruptcy',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加破产重整
|
||||||
|
*/
|
||||||
|
export async function addCreditBankruptcy(data: CreditBankruptcy) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-bankruptcy',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改破产重整
|
||||||
|
*/
|
||||||
|
export async function updateCreditBankruptcy(data: CreditBankruptcy) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-bankruptcy',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除破产重整
|
||||||
|
*/
|
||||||
|
export async function removeCreditBankruptcy(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-bankruptcy/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除破产重整
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditBankruptcy(
|
||||||
|
data: (number | undefined)[]
|
||||||
|
) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-bankruptcy/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询破产重整
|
||||||
|
*/
|
||||||
|
export async function getCreditBankruptcy(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditBankruptcy>>(
|
||||||
|
'/credit/credit-bankruptcy/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入破产重整
|
||||||
|
*/
|
||||||
|
export async function importCreditBankruptcy(file: File, companyId?: number) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-bankruptcy/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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入历史破产重整
|
||||||
|
*/
|
||||||
|
export async function importCreditBankruptcyHistory(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-bankruptcy/import/history',
|
||||||
|
formData,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
51
src/api/credit/creditBankruptcy/model/index.ts
Normal file
51
src/api/credit/creditBankruptcy/model/index.ts
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 破产重整
|
||||||
|
*/
|
||||||
|
export interface CreditBankruptcy {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 案号
|
||||||
|
code?: string;
|
||||||
|
// 案件类型
|
||||||
|
type?: string;
|
||||||
|
// 当事人
|
||||||
|
party?: string;
|
||||||
|
// 链接
|
||||||
|
url?: string;
|
||||||
|
// 经办法院
|
||||||
|
court?: string;
|
||||||
|
// 公开日期
|
||||||
|
publicDate?: string;
|
||||||
|
// 备注
|
||||||
|
comments?: string;
|
||||||
|
// 企业ID
|
||||||
|
companyId?: number;
|
||||||
|
// 是否推荐
|
||||||
|
recommend?: number;
|
||||||
|
// 排序(数字越小越靠前)
|
||||||
|
sortNumber?: number;
|
||||||
|
// 状态, 0正常, 1冻结
|
||||||
|
status?: number;
|
||||||
|
// 是否删除, 0否, 1是
|
||||||
|
deleted?: number;
|
||||||
|
// 用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 破产重整搜索条件
|
||||||
|
*/
|
||||||
|
export interface CreditBankruptcyParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
127
src/api/credit/creditBranch/index.ts
Normal file
127
src/api/credit/creditBranch/index.ts
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditBranch, CreditBranchParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询分支机构
|
||||||
|
*/
|
||||||
|
export async function pageCreditBranch(params: CreditBranchParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditBranch>>>(
|
||||||
|
'/credit/credit-branch/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询分支机构列表
|
||||||
|
*/
|
||||||
|
export async function listCreditBranch(params?: CreditBranchParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditBranch[]>>(
|
||||||
|
'/credit/credit-branch',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加分支机构
|
||||||
|
*/
|
||||||
|
export async function addCreditBranch(data: CreditBranch) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-branch',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改分支机构
|
||||||
|
*/
|
||||||
|
export async function updateCreditBranch(data: CreditBranch) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-branch',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除分支机构
|
||||||
|
*/
|
||||||
|
export async function removeCreditBranch(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-branch/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除分支机构
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditBranch(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-branch/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询分支机构
|
||||||
|
*/
|
||||||
|
export async function getCreditBranch(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditBranch>>(
|
||||||
|
'/credit/credit-branch/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入分支机构
|
||||||
|
*/
|
||||||
|
export async function importCreditBranch(file: File, companyId?: number) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-branch/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));
|
||||||
|
}
|
||||||
51
src/api/credit/creditBranch/model/index.ts
Normal file
51
src/api/credit/creditBranch/model/index.ts
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分支机构
|
||||||
|
*/
|
||||||
|
export interface CreditBranch {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 分支机构名称
|
||||||
|
name?: string;
|
||||||
|
// 负责人
|
||||||
|
curator?: string;
|
||||||
|
// 地区
|
||||||
|
region?: string;
|
||||||
|
// 链接
|
||||||
|
url?: string;
|
||||||
|
// 成立日期
|
||||||
|
establishDate?: string;
|
||||||
|
// 状态
|
||||||
|
statusText?: string;
|
||||||
|
// 备注
|
||||||
|
comments?: string;
|
||||||
|
// 企业ID
|
||||||
|
companyId?: number;
|
||||||
|
// 是否推荐
|
||||||
|
recommend?: number;
|
||||||
|
// 排序(数字越小越靠前)
|
||||||
|
sortNumber?: number;
|
||||||
|
// 状态, 0正常, 1冻结
|
||||||
|
status?: number;
|
||||||
|
// 是否删除, 0否, 1是
|
||||||
|
deleted?: number;
|
||||||
|
// 用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分支机构搜索条件
|
||||||
|
*/
|
||||||
|
export interface CreditBranchParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
163
src/api/credit/creditBreachOfTrust/index.ts
Normal file
163
src/api/credit/creditBreachOfTrust/index.ts
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditBreachOfTrust, CreditBreachOfTrustParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询失信被执行人
|
||||||
|
*/
|
||||||
|
export async function pageCreditBreachOfTrust(
|
||||||
|
params: CreditBreachOfTrustParam
|
||||||
|
) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditBreachOfTrust>>>(
|
||||||
|
'/credit/credit-breach-of-trust/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询失信被执行人列表
|
||||||
|
*/
|
||||||
|
export async function listCreditBreachOfTrust(
|
||||||
|
params?: CreditBreachOfTrustParam
|
||||||
|
) {
|
||||||
|
const res = await request.get<ApiResult<CreditBreachOfTrust[]>>(
|
||||||
|
'/credit/credit-breach-of-trust',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加失信被执行人
|
||||||
|
*/
|
||||||
|
export async function addCreditBreachOfTrust(data: CreditBreachOfTrust) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-breach-of-trust',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改失信被执行人
|
||||||
|
*/
|
||||||
|
export async function updateCreditBreachOfTrust(data: CreditBreachOfTrust) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-breach-of-trust',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除失信被执行人
|
||||||
|
*/
|
||||||
|
export async function removeCreditBreachOfTrust(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-breach-of-trust/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除失信被执行人
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditBreachOfTrust(
|
||||||
|
data: (number | undefined)[]
|
||||||
|
) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-breach-of-trust/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询失信被执行人
|
||||||
|
*/
|
||||||
|
export async function getCreditBreachOfTrust(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditBreachOfTrust>>(
|
||||||
|
'/credit/credit-breach-of-trust/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入失信被执行人
|
||||||
|
*/
|
||||||
|
export async function importCreditBreachOfTrust(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-breach-of-trust/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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入历史失信被执行人
|
||||||
|
*/
|
||||||
|
export async function importCreditBreachOfTrustHistory(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-breach-of-trust/import/history',
|
||||||
|
formData,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
59
src/api/credit/creditBreachOfTrust/model/index.ts
Normal file
59
src/api/credit/creditBreachOfTrust/model/index.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失信被执行人
|
||||||
|
*/
|
||||||
|
export interface CreditBreachOfTrust {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 数据类型
|
||||||
|
dataType?: string;
|
||||||
|
// 原告/上诉人
|
||||||
|
plaintiffAppellant?: string;
|
||||||
|
// 被告/被上诉人
|
||||||
|
appellee?: string;
|
||||||
|
// 链接地址
|
||||||
|
url?: string;
|
||||||
|
// 其他当事人/第三人
|
||||||
|
otherPartiesThirdParty?: string;
|
||||||
|
// 发生时间
|
||||||
|
occurrenceTime?: string;
|
||||||
|
// 案号
|
||||||
|
caseNumber?: string;
|
||||||
|
// 案由
|
||||||
|
causeOfAction?: string;
|
||||||
|
// 涉案金额
|
||||||
|
involvedAmount?: string;
|
||||||
|
// 法院
|
||||||
|
courtName?: string;
|
||||||
|
// 数据状态
|
||||||
|
dataStatus?: 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 CreditBreachOfTrustParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
156
src/api/credit/creditCaseFiling/index.ts
Normal file
156
src/api/credit/creditCaseFiling/index.ts
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditCaseFiling, CreditCaseFilingParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询司法大数据
|
||||||
|
*/
|
||||||
|
export async function pageCreditCaseFiling(params: CreditCaseFilingParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditCaseFiling>>>(
|
||||||
|
'/credit/credit-case-filing/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询司法大数据列表
|
||||||
|
*/
|
||||||
|
export async function listCreditCaseFiling(params?: CreditCaseFilingParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditCaseFiling[]>>(
|
||||||
|
'/credit/credit-case-filing',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加司法大数据
|
||||||
|
*/
|
||||||
|
export async function addCreditCaseFiling(data: CreditCaseFiling) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-case-filing',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改司法大数据
|
||||||
|
*/
|
||||||
|
export async function updateCreditCaseFiling(data: CreditCaseFiling) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-case-filing',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除司法大数据
|
||||||
|
*/
|
||||||
|
export async function removeCreditCaseFiling(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-case-filing/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除司法大数据
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditCaseFiling(
|
||||||
|
data: (number | undefined)[]
|
||||||
|
) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-case-filing/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询司法大数据
|
||||||
|
*/
|
||||||
|
export async function getCreditCaseFiling(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditCaseFiling>>(
|
||||||
|
'/credit/credit-case-filing/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入司法大数据
|
||||||
|
*/
|
||||||
|
export async function importCreditCaseFiling(file: File, companyId?: number) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-case-filing/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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入历史立案信息司法大数据
|
||||||
|
*/
|
||||||
|
export async function importCreditCaseFilingHistory(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-case-filing/import/history',
|
||||||
|
formData,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
59
src/api/credit/creditCaseFiling/model/index.ts
Normal file
59
src/api/credit/creditCaseFiling/model/index.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司法大数据
|
||||||
|
*/
|
||||||
|
export interface CreditCaseFiling {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 数据类型
|
||||||
|
dataType?: string;
|
||||||
|
// 原告/上诉人
|
||||||
|
plaintiffAppellant?: string;
|
||||||
|
// 被告/被上诉人
|
||||||
|
appellee?: string;
|
||||||
|
// 链接地址
|
||||||
|
url?: string;
|
||||||
|
// 其他当事人/第三人
|
||||||
|
otherPartiesThirdParty?: string;
|
||||||
|
// 发生时间
|
||||||
|
occurrenceTime?: string;
|
||||||
|
// 案号
|
||||||
|
caseNumber?: string;
|
||||||
|
// 案由
|
||||||
|
causeOfAction?: string;
|
||||||
|
// 涉案金额
|
||||||
|
involvedAmount?: string;
|
||||||
|
// 法院
|
||||||
|
courtName?: string;
|
||||||
|
// 数据状态
|
||||||
|
dataStatus?: 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 CreditCaseFilingParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
138
src/api/credit/creditCompany/index.ts
Normal file
138
src/api/credit/creditCompany/index.ts
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
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: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.code === 0) {
|
||||||
|
return res.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询企业列表
|
||||||
|
*/
|
||||||
|
export async function listCreditCompany(params?: CreditCompanyParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditCompany[]>>(
|
||||||
|
'/credit/credit-company',
|
||||||
|
{ params: withCreditUserScope(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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据企业匹配名称查询关联信息
|
||||||
|
*/
|
||||||
|
export async function getCompanyRelatedInfo(params: CreditCompanyParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditCompany>>(
|
||||||
|
'/credit/credit-company/related',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
189
src/api/credit/creditCompany/model/index.ts
Normal file
189
src/api/credit/creditCompany/model/index.ts
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业
|
||||||
|
*/
|
||||||
|
export interface CreditCompany {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 原文件导入名称
|
||||||
|
name?: string;
|
||||||
|
// 系统匹配企业名称
|
||||||
|
matchName?: string;
|
||||||
|
// 统一社会信用代码
|
||||||
|
code?: string;
|
||||||
|
// 链接地址
|
||||||
|
url?: 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;
|
||||||
|
// 记录数
|
||||||
|
creditAdministrativeLicense?: number;
|
||||||
|
// 记录数
|
||||||
|
creditBankruptcy?: number;
|
||||||
|
// 记录数
|
||||||
|
creditBranch?: number;
|
||||||
|
// 记录数
|
||||||
|
creditBreachOfTrust?: number;
|
||||||
|
// 记录数
|
||||||
|
creditCaseFiling?: number;
|
||||||
|
// 记录数
|
||||||
|
creditCompetitor?: number;
|
||||||
|
// 记录数
|
||||||
|
creditCourtAnnouncement?: number;
|
||||||
|
// 记录数
|
||||||
|
creditCourtSession?: number;
|
||||||
|
// 记录数
|
||||||
|
creditCustomer?: number;
|
||||||
|
// 记录数
|
||||||
|
creditDeliveryNotice?: number;
|
||||||
|
// 记录数
|
||||||
|
creditExternal?: number;
|
||||||
|
// 记录数
|
||||||
|
creditFinalVersion?: number;
|
||||||
|
// 记录数
|
||||||
|
creditGqdj?: number;
|
||||||
|
// 记录数
|
||||||
|
creditHistoricalLegalPerson?: number;
|
||||||
|
// 记录数
|
||||||
|
creditJudgmentDebtor?: number;
|
||||||
|
// 记录数
|
||||||
|
creditJudicialDocument?: number;
|
||||||
|
// 记录数
|
||||||
|
creditJudiciary?: number;
|
||||||
|
// 记录数
|
||||||
|
creditMediation?: number;
|
||||||
|
// 记录数
|
||||||
|
creditNearbyCompany?: number;
|
||||||
|
// 记录数
|
||||||
|
creditPatent?: number;
|
||||||
|
// 记录数
|
||||||
|
creditRiskRelation?: number;
|
||||||
|
// 记录数
|
||||||
|
creditSupplier?: number;
|
||||||
|
// 记录数
|
||||||
|
creditSuspectedRelationship?: number;
|
||||||
|
// 记录数
|
||||||
|
creditUser?: number;
|
||||||
|
// 记录数
|
||||||
|
creditXgxf?: number;
|
||||||
|
// 备注
|
||||||
|
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 {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
129
src/api/credit/creditCompetitor/index.ts
Normal file
129
src/api/credit/creditCompetitor/index.ts
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditCompetitor, CreditCompetitorParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询竞争对手
|
||||||
|
*/
|
||||||
|
export async function pageCreditCompetitor(params: CreditCompetitorParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditCompetitor>>>(
|
||||||
|
'/credit/credit-competitor/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询竞争对手列表
|
||||||
|
*/
|
||||||
|
export async function listCreditCompetitor(params?: CreditCompetitorParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditCompetitor[]>>(
|
||||||
|
'/credit/credit-competitor',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加竞争对手
|
||||||
|
*/
|
||||||
|
export async function addCreditCompetitor(data: CreditCompetitor) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-competitor',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改竞争对手
|
||||||
|
*/
|
||||||
|
export async function updateCreditCompetitor(data: CreditCompetitor) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-competitor',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除竞争对手
|
||||||
|
*/
|
||||||
|
export async function removeCreditCompetitor(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-competitor/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除竞争对手
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditCompetitor(
|
||||||
|
data: (number | undefined)[]
|
||||||
|
) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-competitor/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询竞争对手
|
||||||
|
*/
|
||||||
|
export async function getCreditCompetitor(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditCompetitor>>(
|
||||||
|
'/credit/credit-competitor/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入竞争对手
|
||||||
|
*/
|
||||||
|
export async function importCreditCompetitor(file: File, companyId?: number) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-competitor/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));
|
||||||
|
}
|
||||||
53
src/api/credit/creditCompetitor/model/index.ts
Normal file
53
src/api/credit/creditCompetitor/model/index.ts
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 竞争对手
|
||||||
|
*/
|
||||||
|
export interface CreditCompetitor {
|
||||||
|
// 序号
|
||||||
|
id?: number;
|
||||||
|
// 企业名称
|
||||||
|
name?: string;
|
||||||
|
// 法定代表人
|
||||||
|
legalRepresentative?: string;
|
||||||
|
// 注册资本
|
||||||
|
registeredCapital?: string;
|
||||||
|
// 成立日期
|
||||||
|
establishmentDate?: string;
|
||||||
|
// 登记状态
|
||||||
|
registrationStatus?: string;
|
||||||
|
// 所属行业
|
||||||
|
industry?: string;
|
||||||
|
// 所属省份
|
||||||
|
province?: string;
|
||||||
|
// 链接地址
|
||||||
|
url?: 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 CreditCompetitorParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
170
src/api/credit/creditCourtAnnouncement/index.ts
Normal file
170
src/api/credit/creditCourtAnnouncement/index.ts
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type {
|
||||||
|
CreditCourtAnnouncement,
|
||||||
|
CreditCourtAnnouncementParam
|
||||||
|
} from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询法院公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function pageCreditCourtAnnouncement(
|
||||||
|
params: CreditCourtAnnouncementParam
|
||||||
|
) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditCourtAnnouncement>>>(
|
||||||
|
'/credit/credit-court-announcement/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询法院公告司法大数据列表
|
||||||
|
*/
|
||||||
|
export async function listCreditCourtAnnouncement(
|
||||||
|
params?: CreditCourtAnnouncementParam
|
||||||
|
) {
|
||||||
|
const res = await request.get<ApiResult<CreditCourtAnnouncement[]>>(
|
||||||
|
'/credit/credit-court-announcement',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加法院公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function addCreditCourtAnnouncement(
|
||||||
|
data: CreditCourtAnnouncement
|
||||||
|
) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-court-announcement',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改法院公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function updateCreditCourtAnnouncement(
|
||||||
|
data: CreditCourtAnnouncement
|
||||||
|
) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-court-announcement',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除法院公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function removeCreditCourtAnnouncement(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-court-announcement/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除法院公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditCourtAnnouncement(
|
||||||
|
data: (number | undefined)[]
|
||||||
|
) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-court-announcement/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询法院公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function getCreditCourtAnnouncement(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditCourtAnnouncement>>(
|
||||||
|
'/credit/credit-court-announcement/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入法院公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function importCreditCourtAnnouncement(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-court-announcement/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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入历史开庭公告
|
||||||
|
*/
|
||||||
|
export async function importCreditCourtAnnouncementHistory(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-court-announcement/import/history',
|
||||||
|
formData,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
59
src/api/credit/creditCourtAnnouncement/model/index.ts
Normal file
59
src/api/credit/creditCourtAnnouncement/model/index.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法院公告司法大数据
|
||||||
|
*/
|
||||||
|
export interface CreditCourtAnnouncement {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 数据类型
|
||||||
|
dataType?: string;
|
||||||
|
// 原告/上诉人
|
||||||
|
plaintiffAppellant?: string;
|
||||||
|
// 被告/被上诉人
|
||||||
|
appellee?: string;
|
||||||
|
// 链接地址
|
||||||
|
url?: string;
|
||||||
|
// 其他当事人/第三人
|
||||||
|
otherPartiesThirdParty?: string;
|
||||||
|
// 发生时间
|
||||||
|
occurrenceTime?: string;
|
||||||
|
// 案号
|
||||||
|
caseNumber?: string;
|
||||||
|
// 案由
|
||||||
|
causeOfAction?: string;
|
||||||
|
// 涉案金额
|
||||||
|
involvedAmount?: string;
|
||||||
|
// 法院
|
||||||
|
courtName?: string;
|
||||||
|
// 数据状态
|
||||||
|
dataStatus?: 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 CreditCourtAnnouncementParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
156
src/api/credit/creditCourtSession/index.ts
Normal file
156
src/api/credit/creditCourtSession/index.ts
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditCourtSession, CreditCourtSessionParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询开庭公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function pageCreditCourtSession(params: CreditCourtSessionParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditCourtSession>>>(
|
||||||
|
'/credit/credit-court-session/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询开庭公告司法大数据列表
|
||||||
|
*/
|
||||||
|
export async function listCreditCourtSession(params?: CreditCourtSessionParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditCourtSession[]>>(
|
||||||
|
'/credit/credit-court-session',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加开庭公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function addCreditCourtSession(data: CreditCourtSession) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-court-session',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改开庭公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function updateCreditCourtSession(data: CreditCourtSession) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-court-session',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除开庭公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function removeCreditCourtSession(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-court-session/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除开庭公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditCourtSession(
|
||||||
|
data: (number | undefined)[]
|
||||||
|
) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-court-session/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询开庭公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function getCreditCourtSession(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditCourtSession>>(
|
||||||
|
'/credit/credit-court-session/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入开庭公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function importCreditCourtSession(file: File, companyId?: number) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-court-session/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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入历史开庭公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function importCreditCourtSessionHistory(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-court-session/import/history',
|
||||||
|
formData,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
59
src/api/credit/creditCourtSession/model/index.ts
Normal file
59
src/api/credit/creditCourtSession/model/index.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开庭公告司法大数据
|
||||||
|
*/
|
||||||
|
export interface CreditCourtSession {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 案号
|
||||||
|
caseNumber?: string;
|
||||||
|
// 案由
|
||||||
|
causeOfAction?: string;
|
||||||
|
// 其他当事人/第三人
|
||||||
|
otherPartiesThirdParty?: string;
|
||||||
|
// 法院
|
||||||
|
courtName?: string;
|
||||||
|
// 发生时间
|
||||||
|
occurrenceTime?: string;
|
||||||
|
// 数据类型
|
||||||
|
// dataType?: string;
|
||||||
|
// 原告/上诉人
|
||||||
|
// plaintiffAppellant?: string;
|
||||||
|
// 被告/被上诉人
|
||||||
|
// appellee?: string;
|
||||||
|
// 链接地址
|
||||||
|
url?: string;
|
||||||
|
// 涉案金额
|
||||||
|
// involvedAmount?: string;
|
||||||
|
// 数据状态
|
||||||
|
// dataStatus?: 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 CreditCourtSessionParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
127
src/api/credit/creditCustomer/index.ts
Normal file
127
src/api/credit/creditCustomer/index.ts
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditCustomer, CreditCustomerParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询客户
|
||||||
|
*/
|
||||||
|
export async function pageCreditCustomer(params: CreditCustomerParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditCustomer>>>(
|
||||||
|
'/credit/credit-customer/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询客户列表
|
||||||
|
*/
|
||||||
|
export async function listCreditCustomer(params?: CreditCustomerParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditCustomer[]>>(
|
||||||
|
'/credit/credit-customer',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加客户
|
||||||
|
*/
|
||||||
|
export async function addCreditCustomer(data: CreditCustomer) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-customer',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改客户
|
||||||
|
*/
|
||||||
|
export async function updateCreditCustomer(data: CreditCustomer) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-customer',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除客户
|
||||||
|
*/
|
||||||
|
export async function removeCreditCustomer(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-customer/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除客户
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditCustomer(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-customer/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询客户
|
||||||
|
*/
|
||||||
|
export async function getCreditCustomer(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditCustomer>>(
|
||||||
|
'/credit/credit-customer/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入客户
|
||||||
|
*/
|
||||||
|
export async function importCreditCustomer(file: File, companyId?: number) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-customer/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));
|
||||||
|
}
|
||||||
49
src/api/credit/creditCustomer/model/index.ts
Normal file
49
src/api/credit/creditCustomer/model/index.ts
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户
|
||||||
|
*/
|
||||||
|
export interface CreditCustomer {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 客户
|
||||||
|
name?: string;
|
||||||
|
// 状态
|
||||||
|
statusTxt?: string;
|
||||||
|
// 销售金额(万元)
|
||||||
|
price?: string;
|
||||||
|
// 公开日期
|
||||||
|
publicDate?: string;
|
||||||
|
// 数据来源
|
||||||
|
dataSource?: string;
|
||||||
|
// 链接地址
|
||||||
|
url?: 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 CreditCustomerParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
163
src/api/credit/creditDeliveryNotice/index.ts
Normal file
163
src/api/credit/creditDeliveryNotice/index.ts
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditDeliveryNotice, CreditDeliveryNoticeParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询送达公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function pageCreditDeliveryNotice(
|
||||||
|
params: CreditDeliveryNoticeParam
|
||||||
|
) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditDeliveryNotice>>>(
|
||||||
|
'/credit/credit-delivery-notice/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询送达公告司法大数据列表
|
||||||
|
*/
|
||||||
|
export async function listCreditDeliveryNotice(
|
||||||
|
params?: CreditDeliveryNoticeParam
|
||||||
|
) {
|
||||||
|
const res = await request.get<ApiResult<CreditDeliveryNotice[]>>(
|
||||||
|
'/credit/credit-delivery-notice',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加送达公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function addCreditDeliveryNotice(data: CreditDeliveryNotice) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-delivery-notice',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改送达公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function updateCreditDeliveryNotice(data: CreditDeliveryNotice) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-delivery-notice',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除送达公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function removeCreditDeliveryNotice(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-delivery-notice/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除送达公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditDeliveryNotice(
|
||||||
|
data: (number | undefined)[]
|
||||||
|
) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-delivery-notice/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询送达公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function getCreditDeliveryNotice(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditDeliveryNotice>>(
|
||||||
|
'/credit/credit-delivery-notice/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入送达公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function importCreditDeliveryNotice(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-delivery-notice/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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入历史送达公告司法大数据
|
||||||
|
*/
|
||||||
|
export async function importCreditDeliveryNoticeHistory(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-delivery-notice/import/history',
|
||||||
|
formData,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
59
src/api/credit/creditDeliveryNotice/model/index.ts
Normal file
59
src/api/credit/creditDeliveryNotice/model/index.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 送达公告司法大数据
|
||||||
|
*/
|
||||||
|
export interface CreditDeliveryNotice {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 数据类型
|
||||||
|
dataType?: string;
|
||||||
|
// 原告/上诉人
|
||||||
|
plaintiffAppellant?: string;
|
||||||
|
// 被告/被上诉人
|
||||||
|
appellee?: string;
|
||||||
|
// 其他当事人/第三人
|
||||||
|
otherPartiesThirdParty?: string;
|
||||||
|
// 发生时间
|
||||||
|
occurrenceTime?: string;
|
||||||
|
// 案号
|
||||||
|
caseNumber?: string;
|
||||||
|
// 案由
|
||||||
|
causeOfAction?: string;
|
||||||
|
// 涉案金额
|
||||||
|
involvedAmount?: string;
|
||||||
|
// 法院
|
||||||
|
courtName?: string;
|
||||||
|
// 数据状态
|
||||||
|
dataStatus?: string;
|
||||||
|
// 链接地址
|
||||||
|
url?: 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 CreditDeliveryNoticeParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
127
src/api/credit/creditExternal/index.ts
Normal file
127
src/api/credit/creditExternal/index.ts
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditExternal, CreditExternalParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询对外投资
|
||||||
|
*/
|
||||||
|
export async function pageCreditExternal(params: CreditExternalParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditExternal>>>(
|
||||||
|
'/credit/credit-external/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询对外投资列表
|
||||||
|
*/
|
||||||
|
export async function listCreditExternal(params?: CreditExternalParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditExternal[]>>(
|
||||||
|
'/credit/credit-external',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加对外投资
|
||||||
|
*/
|
||||||
|
export async function addCreditExternal(data: CreditExternal) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-external',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改对外投资
|
||||||
|
*/
|
||||||
|
export async function updateCreditExternal(data: CreditExternal) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-external',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除对外投资
|
||||||
|
*/
|
||||||
|
export async function removeCreditExternal(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-external/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除对外投资
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditExternal(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-external/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询对外投资
|
||||||
|
*/
|
||||||
|
export async function getCreditExternal(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditExternal>>(
|
||||||
|
'/credit/credit-external/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入对外投资
|
||||||
|
*/
|
||||||
|
export async function importCreditExternal(file: File, companyId?: number) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-external/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));
|
||||||
|
}
|
||||||
67
src/api/credit/creditExternal/model/index.ts
Normal file
67
src/api/credit/creditExternal/model/index.ts
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对外投资
|
||||||
|
*/
|
||||||
|
export interface CreditExternal {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 被投资企业名称
|
||||||
|
name?: string;
|
||||||
|
// 企业状态(如存续、注销等)
|
||||||
|
statusTxt?: string;
|
||||||
|
// 法定代表人姓名
|
||||||
|
legalRepresentative?: string;
|
||||||
|
// 注册资本(金额)
|
||||||
|
registeredCapital?: string;
|
||||||
|
// 成立日期
|
||||||
|
establishmentDate?: string;
|
||||||
|
// 持股比例
|
||||||
|
shareholdingRatio?: string;
|
||||||
|
// 认缴出资额
|
||||||
|
subscribedInvestmentAmount?: string;
|
||||||
|
// 认缴出资日期
|
||||||
|
subscribedInvestmentDate?: string;
|
||||||
|
// 间接持股比例
|
||||||
|
indirectShareholdingRatio?: string;
|
||||||
|
// 投资日期
|
||||||
|
investmentDate?: string;
|
||||||
|
// 所属地区
|
||||||
|
region?: string;
|
||||||
|
// 所属行业
|
||||||
|
industry?: string;
|
||||||
|
// 投资数量
|
||||||
|
investmentCount?: number;
|
||||||
|
// 关联产品/机构
|
||||||
|
relatedProductsInstitutions?: string;
|
||||||
|
// 链接地址
|
||||||
|
url?: 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 CreditExternalParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
156
src/api/credit/creditFinalVersion/index.ts
Normal file
156
src/api/credit/creditFinalVersion/index.ts
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditFinalVersion, CreditFinalVersionParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询终本案件
|
||||||
|
*/
|
||||||
|
export async function pageCreditFinalVersion(params: CreditFinalVersionParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditFinalVersion>>>(
|
||||||
|
'/credit/credit-final-version/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询终本案件列表
|
||||||
|
*/
|
||||||
|
export async function listCreditFinalVersion(params?: CreditFinalVersionParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditFinalVersion[]>>(
|
||||||
|
'/credit/credit-final-version',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加终本案件
|
||||||
|
*/
|
||||||
|
export async function addCreditFinalVersion(data: CreditFinalVersion) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-final-version',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改终本案件
|
||||||
|
*/
|
||||||
|
export async function updateCreditFinalVersion(data: CreditFinalVersion) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-final-version',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除终本案件
|
||||||
|
*/
|
||||||
|
export async function removeCreditFinalVersion(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-final-version/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除终本案件
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditFinalVersion(
|
||||||
|
data: (number | undefined)[]
|
||||||
|
) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-final-version/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询终本案件
|
||||||
|
*/
|
||||||
|
export async function getCreditFinalVersion(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditFinalVersion>>(
|
||||||
|
'/credit/credit-final-version/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入终本案件
|
||||||
|
*/
|
||||||
|
export async function importCreditFinalVersion(file: File, companyId?: number) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-final-version/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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入历史终本案件
|
||||||
|
*/
|
||||||
|
export async function importCreditFinalVersionHistory(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-final-version/import/history',
|
||||||
|
formData,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
48
src/api/credit/creditFinalVersion/model/index.ts
Normal file
48
src/api/credit/creditFinalVersion/model/index.ts
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终本案件
|
||||||
|
*/
|
||||||
|
export interface CreditFinalVersion {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 案号
|
||||||
|
caseNumber?: string;
|
||||||
|
appellee?: string;
|
||||||
|
plaintiffAppellant?: string;
|
||||||
|
unfulfilledAmount?: string;
|
||||||
|
involvedAmount?: string;
|
||||||
|
courtName?: string;
|
||||||
|
occurrenceTime?: string;
|
||||||
|
finalDate?: string;
|
||||||
|
// 链接地址
|
||||||
|
url?: 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 CreditFinalVersionParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
151
src/api/credit/creditGqdj/index.ts
Normal file
151
src/api/credit/creditGqdj/index.ts
Normal file
@@ -0,0 +1,151 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditGqdj, CreditGqdjParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询股权冻结
|
||||||
|
*/
|
||||||
|
export async function pageCreditGqdj(params: CreditGqdjParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditGqdj>>>(
|
||||||
|
'/credit/credit-gqdj/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询股权冻结列表
|
||||||
|
*/
|
||||||
|
export async function listCreditGqdj(params?: CreditGqdjParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditGqdj[]>>(
|
||||||
|
'/credit/credit-gqdj',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加股权冻结
|
||||||
|
*/
|
||||||
|
export async function addCreditGqdj(data: CreditGqdj) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-gqdj',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改股权冻结
|
||||||
|
*/
|
||||||
|
export async function updateCreditGqdj(data: CreditGqdj) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-gqdj',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除股权冻结
|
||||||
|
*/
|
||||||
|
export async function removeCreditGqdj(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-gqdj/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除股权冻结
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditGqdj(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-gqdj/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询股权冻结
|
||||||
|
*/
|
||||||
|
export async function getCreditGqdj(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditGqdj>>(
|
||||||
|
'/credit/credit-gqdj/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入股权冻结
|
||||||
|
*/
|
||||||
|
export async function importCreditGqdj(file: File, companyId?: number) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-gqdj/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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入历史股权冻结
|
||||||
|
*/
|
||||||
|
export async function importCreditGqdjHistory(file: File, companyId?: number) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-gqdj/import/history',
|
||||||
|
formData,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
65
src/api/credit/creditGqdj/model/index.ts
Normal file
65
src/api/credit/creditGqdj/model/index.ts
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 股权冻结
|
||||||
|
*/
|
||||||
|
export interface CreditGqdj {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 执行通知文书号
|
||||||
|
caseNumber?: string;
|
||||||
|
// 被执行人
|
||||||
|
appellee?: string;
|
||||||
|
// 冻结股权标的企业
|
||||||
|
plaintiffAppellant?: string;
|
||||||
|
// 被执行人持有股权、其他投资权益数额
|
||||||
|
involvedAmount?: string;
|
||||||
|
// 执行法院
|
||||||
|
courtName?: string;
|
||||||
|
// 类型
|
||||||
|
dataType?: string;
|
||||||
|
// 状态
|
||||||
|
dataStatus?: string;
|
||||||
|
// 冻结日期自
|
||||||
|
freezeDateStart?: string;
|
||||||
|
// 冻结日期至
|
||||||
|
freezeDateEnd?: string;
|
||||||
|
// 公示日期
|
||||||
|
publicDate?: string;
|
||||||
|
// 链接地址
|
||||||
|
url?: string;
|
||||||
|
// 其他当事人/第三人
|
||||||
|
otherPartiesThirdParty?: string;
|
||||||
|
// 发生时间
|
||||||
|
occurrenceTime?: string;
|
||||||
|
// 案由
|
||||||
|
causeOfAction?: 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 CreditGqdjParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
144
src/api/credit/creditHistoricalLegalPerson/index.ts
Normal file
144
src/api/credit/creditHistoricalLegalPerson/index.ts
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type {
|
||||||
|
CreditHistoricalLegalPerson,
|
||||||
|
CreditHistoricalLegalPersonParam
|
||||||
|
} from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询历史法定代表人
|
||||||
|
*/
|
||||||
|
export async function pageCreditHistoricalLegalPerson(
|
||||||
|
params: CreditHistoricalLegalPersonParam
|
||||||
|
) {
|
||||||
|
const res = await request.get<
|
||||||
|
ApiResult<PageResult<CreditHistoricalLegalPerson>>
|
||||||
|
>('/credit/credit-historical-legal-person/page', {
|
||||||
|
params: withCreditUserScope(params)
|
||||||
|
});
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询历史法定代表人列表
|
||||||
|
*/
|
||||||
|
export async function listCreditHistoricalLegalPerson(
|
||||||
|
params?: CreditHistoricalLegalPersonParam
|
||||||
|
) {
|
||||||
|
const res = await request.get<ApiResult<CreditHistoricalLegalPerson[]>>(
|
||||||
|
'/credit/credit-historical-legal-person',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加历史法定代表人
|
||||||
|
*/
|
||||||
|
export async function addCreditHistoricalLegalPerson(
|
||||||
|
data: CreditHistoricalLegalPerson
|
||||||
|
) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-historical-legal-person',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改历史法定代表人
|
||||||
|
*/
|
||||||
|
export async function updateCreditHistoricalLegalPerson(
|
||||||
|
data: CreditHistoricalLegalPerson
|
||||||
|
) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-historical-legal-person',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除历史法定代表人
|
||||||
|
*/
|
||||||
|
export async function removeCreditHistoricalLegalPerson(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-historical-legal-person/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除历史法定代表人
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditHistoricalLegalPerson(
|
||||||
|
data: (number | undefined)[]
|
||||||
|
) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-historical-legal-person/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询历史法定代表人
|
||||||
|
*/
|
||||||
|
export async function getCreditHistoricalLegalPerson(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditHistoricalLegalPerson>>(
|
||||||
|
'/credit/credit-historical-legal-person/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入历史法定代表人
|
||||||
|
*/
|
||||||
|
export async function importCreditHistoricalLegalPerson(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-historical-legal-person/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));
|
||||||
|
}
|
||||||
47
src/api/credit/creditHistoricalLegalPerson/model/index.ts
Normal file
47
src/api/credit/creditHistoricalLegalPerson/model/index.ts
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 历史法定代表人
|
||||||
|
*/
|
||||||
|
export interface CreditHistoricalLegalPerson {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 名称
|
||||||
|
name?: string;
|
||||||
|
// 任职日期
|
||||||
|
registerDate?: string;
|
||||||
|
// 卸任日期
|
||||||
|
publicDate?: string;
|
||||||
|
// 链接
|
||||||
|
url?: string;
|
||||||
|
// 备注
|
||||||
|
comments?: string;
|
||||||
|
// 企业ID
|
||||||
|
companyId?: number;
|
||||||
|
// 是否推荐
|
||||||
|
recommend?: number;
|
||||||
|
// 排序(数字越小越靠前)
|
||||||
|
sortNumber?: number;
|
||||||
|
// 状态, 0正常, 1冻结
|
||||||
|
status?: number;
|
||||||
|
// 是否删除, 0否, 1是
|
||||||
|
deleted?: number;
|
||||||
|
// 用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 历史法定代表人搜索条件
|
||||||
|
*/
|
||||||
|
export interface CreditHistoricalLegalPersonParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
185
src/api/credit/creditJudgmentDebtor/index.ts
Normal file
185
src/api/credit/creditJudgmentDebtor/index.ts
Normal file
@@ -0,0 +1,185 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditJudgmentDebtor, CreditJudgmentDebtorParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询被执行人
|
||||||
|
*/
|
||||||
|
export async function pageCreditJudgmentDebtor(
|
||||||
|
params: CreditJudgmentDebtorParam
|
||||||
|
) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditJudgmentDebtor>>>(
|
||||||
|
'/credit/credit-judgment-debtor/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询被执行人列表
|
||||||
|
*/
|
||||||
|
export async function listCreditJudgmentDebtor(
|
||||||
|
params?: CreditJudgmentDebtorParam
|
||||||
|
) {
|
||||||
|
const res = await request.get<ApiResult<CreditJudgmentDebtor[]>>(
|
||||||
|
'/credit/credit-judgment-debtor',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加被执行人
|
||||||
|
*/
|
||||||
|
export async function addCreditJudgmentDebtor(data: CreditJudgmentDebtor) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-judgment-debtor',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改被执行人
|
||||||
|
*/
|
||||||
|
export async function updateCreditJudgmentDebtor(data: CreditJudgmentDebtor) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-judgment-debtor',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除被执行人
|
||||||
|
*/
|
||||||
|
export async function removeCreditJudgmentDebtor(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-judgment-debtor/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除被执行人
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditJudgmentDebtor(
|
||||||
|
data: (number | undefined)[]
|
||||||
|
) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-judgment-debtor/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询被执行人
|
||||||
|
*/
|
||||||
|
export async function getCreditJudgmentDebtor(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditJudgmentDebtor>>(
|
||||||
|
'/credit/credit-judgment-debtor/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入被执行人
|
||||||
|
*/
|
||||||
|
export async function importCreditJudgmentDebtor(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-judgment-debtor/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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入历史被执行人
|
||||||
|
*/
|
||||||
|
export async function importCreditJudgmentDebtorHistory(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-judgment-debtor/import/history',
|
||||||
|
formData,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修正被执行人主体企业归属(按企业名称匹配回填 companyId)
|
||||||
|
*
|
||||||
|
* 后端: POST /api/credit/credit-judgment-debtor/company-id/refresh
|
||||||
|
* - onlyNull: 默认 true,仅更新 companyId 为空的数据
|
||||||
|
* - limit: 可选,限制处理条数
|
||||||
|
*/
|
||||||
|
export async function refreshCreditJudgmentDebtorCompanyId(params?: {
|
||||||
|
onlyNull?: boolean;
|
||||||
|
limit?: number;
|
||||||
|
}) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-judgment-debtor/company-id/refresh',
|
||||||
|
undefined,
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
65
src/api/credit/creditJudgmentDebtor/model/index.ts
Normal file
65
src/api/credit/creditJudgmentDebtor/model/index.ts
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 被执行人
|
||||||
|
*/
|
||||||
|
export interface CreditJudgmentDebtor {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 案号
|
||||||
|
caseNumber?: string;
|
||||||
|
//
|
||||||
|
name?: string;
|
||||||
|
// 证件号/组织机构代码
|
||||||
|
code?: string;
|
||||||
|
// 链接地址
|
||||||
|
url?: string;
|
||||||
|
// 立案日期
|
||||||
|
occurrenceTime?: string;
|
||||||
|
// 执行标的(元)
|
||||||
|
amount?: string;
|
||||||
|
// 法院
|
||||||
|
courtName?: string;
|
||||||
|
// 数据状态
|
||||||
|
dataStatus?: string;
|
||||||
|
// 备注
|
||||||
|
comments?: string;
|
||||||
|
// 是否推荐
|
||||||
|
recommend?: number;
|
||||||
|
// 排序(数字越小越靠前)
|
||||||
|
sortNumber?: number;
|
||||||
|
// 状态, 0正常, 1冻结
|
||||||
|
status?: number;
|
||||||
|
// 是否删除, 0否, 1是
|
||||||
|
deleted?: number;
|
||||||
|
// 用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 真实姓名
|
||||||
|
realName?: string;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
// 历史ID
|
||||||
|
historyId?: number;
|
||||||
|
// 原告/上诉人
|
||||||
|
plaintiffAppellant?: string;
|
||||||
|
// 被告/被上诉人
|
||||||
|
appellee?: string;
|
||||||
|
// 其他当事人/第三人
|
||||||
|
otherPartiesThirdParty?: string;
|
||||||
|
// 被执行人名称
|
||||||
|
name1?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 被执行人搜索条件
|
||||||
|
*/
|
||||||
|
export interface CreditJudgmentDebtorParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
168
src/api/credit/creditJudicialDocument/index.ts
Normal file
168
src/api/credit/creditJudicialDocument/index.ts
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type {
|
||||||
|
CreditJudicialDocument,
|
||||||
|
CreditJudicialDocumentParam
|
||||||
|
} from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询裁判文书司法大数据
|
||||||
|
*/
|
||||||
|
export async function pageCreditJudicialDocument(
|
||||||
|
params: CreditJudicialDocumentParam
|
||||||
|
) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditJudicialDocument>>>(
|
||||||
|
'/credit/credit-judicial-document/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询裁判文书司法大数据列表
|
||||||
|
*/
|
||||||
|
export async function listCreditJudicialDocument(
|
||||||
|
params?: CreditJudicialDocumentParam
|
||||||
|
) {
|
||||||
|
const res = await request.get<ApiResult<CreditJudicialDocument[]>>(
|
||||||
|
'/credit/credit-judicial-document',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加裁判文书司法大数据
|
||||||
|
*/
|
||||||
|
export async function addCreditJudicialDocument(data: CreditJudicialDocument) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-judicial-document',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改裁判文书司法大数据
|
||||||
|
*/
|
||||||
|
export async function updateCreditJudicialDocument(
|
||||||
|
data: CreditJudicialDocument
|
||||||
|
) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-judicial-document',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除裁判文书司法大数据
|
||||||
|
*/
|
||||||
|
export async function removeCreditJudicialDocument(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-judicial-document/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除裁判文书司法大数据
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditJudicialDocument(
|
||||||
|
data: (number | undefined)[]
|
||||||
|
) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-judicial-document/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询裁判文书司法大数据
|
||||||
|
*/
|
||||||
|
export async function getCreditJudicialDocument(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditJudicialDocument>>(
|
||||||
|
'/credit/credit-judicial-document/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入裁判文书司法大数据
|
||||||
|
*/
|
||||||
|
export async function importCreditJudicialDocument(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-judicial-document/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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入历史裁判文书
|
||||||
|
*/
|
||||||
|
export async function importCreditJudicialDocumentHistory(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-judicial-document/import/history',
|
||||||
|
formData,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
67
src/api/credit/creditJudicialDocument/model/index.ts
Normal file
67
src/api/credit/creditJudicialDocument/model/index.ts
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 裁判文书司法大数据
|
||||||
|
*/
|
||||||
|
export interface CreditJudicialDocument {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 文书标题
|
||||||
|
title?: string;
|
||||||
|
// 文书类型
|
||||||
|
documentType?: string;
|
||||||
|
// 数据类型
|
||||||
|
dataType?: string;
|
||||||
|
// 原告/上诉人
|
||||||
|
plaintiffAppellant?: string;
|
||||||
|
// 被告/被上诉人
|
||||||
|
appellee?: string;
|
||||||
|
// 链接地址
|
||||||
|
url?: string;
|
||||||
|
// 其他当事人/第三人
|
||||||
|
otherPartiesThirdParty?: string;
|
||||||
|
// 发生时间
|
||||||
|
occurrenceTime?: string;
|
||||||
|
// 发布日期
|
||||||
|
releaseDate?: string;
|
||||||
|
// 案号
|
||||||
|
caseNumber?: string;
|
||||||
|
// 案由
|
||||||
|
causeOfAction?: string;
|
||||||
|
// 涉案金额
|
||||||
|
involvedAmount?: string;
|
||||||
|
// 被告/被上诉人
|
||||||
|
defendantAppellee?: string;
|
||||||
|
// 法院
|
||||||
|
courtName?: string;
|
||||||
|
// 数据状态
|
||||||
|
dataStatus?: 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 CreditJudicialDocumentParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
127
src/api/credit/creditJudiciary/index.ts
Normal file
127
src/api/credit/creditJudiciary/index.ts
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditJudiciary, CreditJudiciaryParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询司法案件
|
||||||
|
*/
|
||||||
|
export async function pageCreditJudiciary(params: CreditJudiciaryParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditJudiciary>>>(
|
||||||
|
'/credit/credit-judiciary/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询司法案件列表
|
||||||
|
*/
|
||||||
|
export async function listCreditJudiciary(params?: CreditJudiciaryParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditJudiciary[]>>(
|
||||||
|
'/credit/credit-judiciary',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加司法案件
|
||||||
|
*/
|
||||||
|
export async function addCreditJudiciary(data: CreditJudiciary) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-judiciary',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改司法案件
|
||||||
|
*/
|
||||||
|
export async function updateCreditJudiciary(data: CreditJudiciary) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-judiciary',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除司法案件
|
||||||
|
*/
|
||||||
|
export async function removeCreditJudiciary(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-judiciary/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除司法案件
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditJudiciary(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-judiciary/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询司法案件
|
||||||
|
*/
|
||||||
|
export async function getCreditJudiciary(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditJudiciary>>(
|
||||||
|
'/credit/credit-judiciary/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入司法案件
|
||||||
|
*/
|
||||||
|
export async function importCreditJudiciaries(file: File, companyId?: number) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-judiciary/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));
|
||||||
|
}
|
||||||
73
src/api/credit/creditJudiciary/model/index.ts
Normal file
73
src/api/credit/creditJudiciary/model/index.ts
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司法案件
|
||||||
|
*/
|
||||||
|
export interface CreditJudiciary {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 案件名称
|
||||||
|
name?: string;
|
||||||
|
// 案号
|
||||||
|
code?: string;
|
||||||
|
// 链接地址
|
||||||
|
url?: string;
|
||||||
|
// 类型, 0普通用户, 1招投标
|
||||||
|
type?: number;
|
||||||
|
// 案由
|
||||||
|
reason?: string;
|
||||||
|
// 上级id, 0是顶级
|
||||||
|
parentId?: number;
|
||||||
|
// 案件类型
|
||||||
|
infoType?: string;
|
||||||
|
// 所在国家
|
||||||
|
country?: string;
|
||||||
|
// 所在省份
|
||||||
|
province?: string;
|
||||||
|
// 所在城市
|
||||||
|
city?: string;
|
||||||
|
// 所在辖区
|
||||||
|
region?: string;
|
||||||
|
// 街道地址
|
||||||
|
address?: string;
|
||||||
|
// 案件进程
|
||||||
|
caseProgress?: string;
|
||||||
|
// 案件身份
|
||||||
|
caseIdentity?: string;
|
||||||
|
// 法院
|
||||||
|
court?: string;
|
||||||
|
// 进程日期
|
||||||
|
processDate?: string;
|
||||||
|
// 案件金额(元)
|
||||||
|
caseAmount?: string;
|
||||||
|
// 备注
|
||||||
|
comments?: string;
|
||||||
|
// 是否推荐
|
||||||
|
recommend?: number;
|
||||||
|
// 到期时间
|
||||||
|
expirationTime?: string;
|
||||||
|
// 排序(数字越小越靠前)
|
||||||
|
sortNumber?: number;
|
||||||
|
// 状态, 0正常, 1冻结
|
||||||
|
status?: number;
|
||||||
|
// 是否删除, 0否, 1是
|
||||||
|
deleted?: number;
|
||||||
|
// 用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司法案件搜索条件
|
||||||
|
*/
|
||||||
|
export interface CreditJudiciaryParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
154
src/api/credit/creditMediation/index.ts
Normal file
154
src/api/credit/creditMediation/index.ts
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditMediation, CreditMediationParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询诉前调解司法大数据
|
||||||
|
*/
|
||||||
|
export async function pageCreditMediation(params: CreditMediationParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditMediation>>>(
|
||||||
|
'/credit/credit-mediation/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询诉前调解司法大数据列表
|
||||||
|
*/
|
||||||
|
export async function listCreditMediation(params?: CreditMediationParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditMediation[]>>(
|
||||||
|
'/credit/credit-mediation',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加诉前调解司法大数据
|
||||||
|
*/
|
||||||
|
export async function addCreditMediation(data: CreditMediation) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-mediation',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改诉前调解司法大数据
|
||||||
|
*/
|
||||||
|
export async function updateCreditMediation(data: CreditMediation) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-mediation',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除诉前调解司法大数据
|
||||||
|
*/
|
||||||
|
export async function removeCreditMediation(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-mediation/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除诉前调解司法大数据
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditMediation(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-mediation/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询诉前调解司法大数据
|
||||||
|
*/
|
||||||
|
export async function getCreditMediation(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditMediation>>(
|
||||||
|
'/credit/credit-mediation/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入诉前调解司法大数据
|
||||||
|
*/
|
||||||
|
export async function importCreditMediation(file: File, companyId?: number) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-mediation/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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入历史诉前调解司法大数据
|
||||||
|
*/
|
||||||
|
export async function importCreditMediationHistory(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-mediation/import/history',
|
||||||
|
formData,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
59
src/api/credit/creditMediation/model/index.ts
Normal file
59
src/api/credit/creditMediation/model/index.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 诉前调解司法大数据
|
||||||
|
*/
|
||||||
|
export interface CreditMediation {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 数据类型
|
||||||
|
dataType?: string;
|
||||||
|
// 原告/上诉人
|
||||||
|
plaintiffAppellant?: string;
|
||||||
|
// 被告/被上诉人
|
||||||
|
appellee?: string;
|
||||||
|
// 链接地址
|
||||||
|
url?: string;
|
||||||
|
// 其他当事人/第三人
|
||||||
|
otherPartiesThirdParty?: string;
|
||||||
|
// 发生时间
|
||||||
|
occurrenceTime?: string;
|
||||||
|
// 案号
|
||||||
|
caseNumber?: string;
|
||||||
|
// 案由
|
||||||
|
causeOfAction?: string;
|
||||||
|
// 涉案金额
|
||||||
|
involvedAmount?: string;
|
||||||
|
// 法院
|
||||||
|
courtName?: string;
|
||||||
|
// 数据状态
|
||||||
|
dataStatus?: 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 CreditMediationParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
233
src/api/credit/creditNearbyCompany/index.ts
Normal file
233
src/api/credit/creditNearbyCompany/index.ts
Normal file
@@ -0,0 +1,233 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditNearbyCompany, CreditNearbyCompanyParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询附近企业
|
||||||
|
*/
|
||||||
|
export async function pageCreditNearbyCompany(
|
||||||
|
params: CreditNearbyCompanyParam
|
||||||
|
) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditNearbyCompany>>>(
|
||||||
|
'/credit/credit-nearby-company/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询附近企业列表
|
||||||
|
*/
|
||||||
|
export async function listCreditNearbyCompany(
|
||||||
|
params?: CreditNearbyCompanyParam
|
||||||
|
) {
|
||||||
|
const res = await request.get<ApiResult<CreditNearbyCompany[]>>(
|
||||||
|
'/credit/credit-nearby-company',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加附近企业
|
||||||
|
*/
|
||||||
|
export async function addCreditNearbyCompany(data: CreditNearbyCompany) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-nearby-company',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改附近企业
|
||||||
|
*/
|
||||||
|
export async function updateCreditNearbyCompany(data: CreditNearbyCompany) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-nearby-company',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除附近企业
|
||||||
|
*/
|
||||||
|
export async function removeCreditNearbyCompany(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-nearby-company/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除附近企业
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditNearbyCompany(
|
||||||
|
data: (number | undefined)[]
|
||||||
|
) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-nearby-company/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询附近企业
|
||||||
|
*/
|
||||||
|
export async function getCreditNearbyCompany(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditNearbyCompany>>(
|
||||||
|
'/credit/credit-nearby-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 importCreditNearbyCompany(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = buildImportFormData(file, 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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入附近企业(多文件,同一次请求)
|
||||||
|
*
|
||||||
|
* 约定:后端需支持 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;
|
||||||
|
message: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ImportBatchCreditNearbyCompanyResult {
|
||||||
|
total: number;
|
||||||
|
success: number;
|
||||||
|
failure: number;
|
||||||
|
items: ImportBatchCreditNearbyCompanyItem[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入附近企业(多文件)
|
||||||
|
*
|
||||||
|
* 说明:
|
||||||
|
* - 目前复用单文件导入接口,前端循环调用实现“多文件导入”
|
||||||
|
* - 不会在有失败时 reject(便于上层展示部分成功/失败明细)
|
||||||
|
*/
|
||||||
|
export async function importBatchCreditNearbyCompany(
|
||||||
|
files: File[] | FileList,
|
||||||
|
companyId?: number,
|
||||||
|
options?: {
|
||||||
|
/** 遇到失败是否立即停止,默认 false(继续导入后续文件) */
|
||||||
|
stopOnError?: boolean;
|
||||||
|
}
|
||||||
|
): Promise<ImportBatchCreditNearbyCompanyResult> {
|
||||||
|
const list = Array.isArray(files) ? files : Array.from(files);
|
||||||
|
const items: ImportBatchCreditNearbyCompanyItem[] = [];
|
||||||
|
const stopOnError = options?.stopOnError ?? false;
|
||||||
|
|
||||||
|
for (const file of list) {
|
||||||
|
try {
|
||||||
|
const msg = await importCreditNearbyCompany(file, companyId);
|
||||||
|
items.push({ fileName: file.name, success: true, message: msg });
|
||||||
|
} catch (e: unknown) {
|
||||||
|
items.push({
|
||||||
|
fileName: file.name,
|
||||||
|
success: false,
|
||||||
|
message: e instanceof Error ? e.message : String(e)
|
||||||
|
});
|
||||||
|
if (stopOnError) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const success = items.filter((d) => d.success).length;
|
||||||
|
const failure = items.length - success;
|
||||||
|
return {
|
||||||
|
total: list.length,
|
||||||
|
success,
|
||||||
|
failure,
|
||||||
|
items
|
||||||
|
};
|
||||||
|
}
|
||||||
143
src/api/credit/creditNearbyCompany/model/index.ts
Normal file
143
src/api/credit/creditNearbyCompany/model/index.ts
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附近企业
|
||||||
|
*/
|
||||||
|
export interface CreditNearbyCompany {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 企业名称
|
||||||
|
name?: string;
|
||||||
|
// 登记状态
|
||||||
|
registrationStatus?: string;
|
||||||
|
// 法定代表人
|
||||||
|
legalPerson?: string;
|
||||||
|
// 注册资本
|
||||||
|
registeredCapital?: string;
|
||||||
|
// 成立日期
|
||||||
|
establishDate?: string;
|
||||||
|
// 统一社会信用代码
|
||||||
|
code?: string;
|
||||||
|
// 注册地址
|
||||||
|
address?: string;
|
||||||
|
// 注册地址邮编
|
||||||
|
postalCode?: string;
|
||||||
|
// 有效手机号
|
||||||
|
phone?: string;
|
||||||
|
// 更多电话
|
||||||
|
moreTel?: string;
|
||||||
|
// 邮箱
|
||||||
|
email?: string;
|
||||||
|
// 邮箱
|
||||||
|
moreEmail?: string;
|
||||||
|
// 所在国家
|
||||||
|
country?: string;
|
||||||
|
// 所属省份
|
||||||
|
province?: string;
|
||||||
|
// 所属城市
|
||||||
|
city?: string;
|
||||||
|
// 所属区县
|
||||||
|
region?: string;
|
||||||
|
// 纳税人识别号
|
||||||
|
taxpayerCode?: string;
|
||||||
|
// 注册号
|
||||||
|
registrationNumber?: string;
|
||||||
|
// 组织机构代码
|
||||||
|
organizationalCode?: string;
|
||||||
|
// 参保人数
|
||||||
|
numberOfInsuredPersons?: string;
|
||||||
|
// 参保人数所属年报
|
||||||
|
annualReport?: string;
|
||||||
|
// 企业(机构)类型
|
||||||
|
institutionType?: string;
|
||||||
|
// 企业规模
|
||||||
|
companySize?: string;
|
||||||
|
// 营业期限
|
||||||
|
businessTerm?: string;
|
||||||
|
// 国标行业门类
|
||||||
|
nationalStandardIndustryCategories?: string;
|
||||||
|
// 国标行业大类
|
||||||
|
nationalStandardIndustryCategories2?: string;
|
||||||
|
// 国标行业中类
|
||||||
|
nationalStandardIndustryCategories3?: string;
|
||||||
|
// 国标行业小类
|
||||||
|
nationalStandardIndustryCategories4?: string;
|
||||||
|
// 曾用名
|
||||||
|
formerName?: string;
|
||||||
|
// 英文名
|
||||||
|
englishName?: string;
|
||||||
|
// 官网网址
|
||||||
|
domain?: string;
|
||||||
|
// 通信地址
|
||||||
|
mailingAddress?: string;
|
||||||
|
// 通信地址邮箱
|
||||||
|
mailingEmail?: string;
|
||||||
|
// 企业简介
|
||||||
|
companyProfile?: string;
|
||||||
|
// 经营范围
|
||||||
|
natureOfBusiness?: string;
|
||||||
|
// 电话
|
||||||
|
tel?: string;
|
||||||
|
// 企查查行业门类
|
||||||
|
nationalStandardIndustryCategories5?: string;
|
||||||
|
// 企查查行业大类
|
||||||
|
nationalStandardIndustryCategories6?: string;
|
||||||
|
// 企查查行业中类
|
||||||
|
nationalStandardIndustryCategories7?: string;
|
||||||
|
// 企查查行业小类
|
||||||
|
nationalStandardIndustryCategories8?: string;
|
||||||
|
// 链接
|
||||||
|
url?: string;
|
||||||
|
// 类型
|
||||||
|
type?: number;
|
||||||
|
// 上级id, 0是顶级
|
||||||
|
parentId?: number;
|
||||||
|
// 实缴资本
|
||||||
|
paidinCapital?: 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 CreditNearbyCompanyParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
127
src/api/credit/creditPatent/index.ts
Normal file
127
src/api/credit/creditPatent/index.ts
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditPatent, CreditPatentParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询专利
|
||||||
|
*/
|
||||||
|
export async function pageCreditPatent(params: CreditPatentParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditPatent>>>(
|
||||||
|
'/credit/credit-patent/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询专利列表
|
||||||
|
*/
|
||||||
|
export async function listCreditPatent(params?: CreditPatentParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditPatent[]>>(
|
||||||
|
'/credit/credit-patent',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加专利
|
||||||
|
*/
|
||||||
|
export async function addCreditPatent(data: CreditPatent) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-patent',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改专利
|
||||||
|
*/
|
||||||
|
export async function updateCreditPatent(data: CreditPatent) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-patent',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除专利
|
||||||
|
*/
|
||||||
|
export async function removeCreditPatent(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-patent/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除专利
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditPatent(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-patent/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询专利
|
||||||
|
*/
|
||||||
|
export async function getCreditPatent(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditPatent>>(
|
||||||
|
'/credit/credit-patent/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入专利
|
||||||
|
*/
|
||||||
|
export async function importCreditPatent(file: File, companyId?: number) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-patent/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));
|
||||||
|
}
|
||||||
59
src/api/credit/creditPatent/model/index.ts
Normal file
59
src/api/credit/creditPatent/model/index.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 专利
|
||||||
|
*/
|
||||||
|
export interface CreditPatent {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 发明名称
|
||||||
|
name?: string;
|
||||||
|
// 专利类型
|
||||||
|
type?: string;
|
||||||
|
// 法律状态
|
||||||
|
statusText?: string;
|
||||||
|
// 申请号
|
||||||
|
registerNo?: string;
|
||||||
|
// 申请日
|
||||||
|
registerDate?: string;
|
||||||
|
// 公开(公告)号
|
||||||
|
publicNo?: string;
|
||||||
|
// 公开(公告)日期
|
||||||
|
publicDate?: string;
|
||||||
|
// 发明人
|
||||||
|
inventor?: string;
|
||||||
|
// 申请(专利权)人
|
||||||
|
patentApplicant?: string;
|
||||||
|
// 链接
|
||||||
|
url?: string;
|
||||||
|
// 备注
|
||||||
|
comments?: string;
|
||||||
|
// 企业ID
|
||||||
|
companyId?: number;
|
||||||
|
// 是否推荐
|
||||||
|
recommend?: number;
|
||||||
|
// 排序(数字越小越靠前)
|
||||||
|
sortNumber?: number;
|
||||||
|
// 状态, 0正常, 1冻结
|
||||||
|
status?: number;
|
||||||
|
// 是否删除, 0否, 1是
|
||||||
|
deleted?: number;
|
||||||
|
// 用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 专利搜索条件
|
||||||
|
*/
|
||||||
|
export interface CreditPatentParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
127
src/api/credit/creditProject/index.ts
Normal file
127
src/api/credit/creditProject/index.ts
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditProject, CreditProjectParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询招投标
|
||||||
|
*/
|
||||||
|
export async function pageCreditProject(params: CreditProjectParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditProject>>>(
|
||||||
|
'/credit/credit-project/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询招投标列表
|
||||||
|
*/
|
||||||
|
export async function listCreditProject(params?: CreditProjectParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditProject[]>>(
|
||||||
|
'/credit/credit-project',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加招投标
|
||||||
|
*/
|
||||||
|
export async function addCreditProject(data: CreditProject) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-project',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改招投标
|
||||||
|
*/
|
||||||
|
export async function updateCreditProject(data: CreditProject) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-project',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除招投标
|
||||||
|
*/
|
||||||
|
export async function removeCreditProject(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-project/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除招投标
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditProject(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-project/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询招投标
|
||||||
|
*/
|
||||||
|
export async function getCreditProject(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditProject>>(
|
||||||
|
'/credit/credit-project/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入招投标
|
||||||
|
*/
|
||||||
|
export async function importCreditProject(file: File, companyId?: number) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-project/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));
|
||||||
|
}
|
||||||
71
src/api/credit/creditProject/model/index.ts
Normal file
71
src/api/credit/creditProject/model/index.ts
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 招投标
|
||||||
|
*/
|
||||||
|
export interface CreditProject {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 项目名称
|
||||||
|
name?: string;
|
||||||
|
// 唯一标识
|
||||||
|
code?: string;
|
||||||
|
// 链接地址
|
||||||
|
url?: string;
|
||||||
|
// 类型, 0普通用户, 1招投标
|
||||||
|
type?: number;
|
||||||
|
// 企业角色
|
||||||
|
role?: string;
|
||||||
|
// 上级id, 0是顶级
|
||||||
|
parentId?: number;
|
||||||
|
// 信息类型
|
||||||
|
infoType?: string;
|
||||||
|
// 所在国家
|
||||||
|
country?: string;
|
||||||
|
// 所在省份
|
||||||
|
province?: string;
|
||||||
|
// 所在城市
|
||||||
|
city?: string;
|
||||||
|
// 所在辖区
|
||||||
|
region?: string;
|
||||||
|
// 街道地址
|
||||||
|
address?: string;
|
||||||
|
// 招采单位名称
|
||||||
|
procurementName?: string;
|
||||||
|
// 中标单位名称
|
||||||
|
winningName?: string;
|
||||||
|
// 中标金额
|
||||||
|
winningPrice?: string;
|
||||||
|
// 发布日期
|
||||||
|
releaseDate?: string;
|
||||||
|
// 备注
|
||||||
|
comments?: string;
|
||||||
|
// 是否推荐
|
||||||
|
recommend?: number;
|
||||||
|
// 到期时间
|
||||||
|
expirationTime?: string;
|
||||||
|
// 排序(数字越小越靠前)
|
||||||
|
sortNumber?: number;
|
||||||
|
// 状态, 0正常, 1冻结
|
||||||
|
status?: number;
|
||||||
|
// 是否删除, 0否, 1是
|
||||||
|
deleted?: number;
|
||||||
|
// 用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 招投标搜索条件
|
||||||
|
*/
|
||||||
|
export interface CreditProjectParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
129
src/api/credit/creditRiskRelation/index.ts
Normal file
129
src/api/credit/creditRiskRelation/index.ts
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditRiskRelation, CreditRiskRelationParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询风险关系表
|
||||||
|
*/
|
||||||
|
export async function pageCreditRiskRelation(params: CreditRiskRelationParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditRiskRelation>>>(
|
||||||
|
'/credit/credit-risk-relation/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询风险关系表列表
|
||||||
|
*/
|
||||||
|
export async function listCreditRiskRelation(params?: CreditRiskRelationParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditRiskRelation[]>>(
|
||||||
|
'/credit/credit-risk-relation',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加风险关系表
|
||||||
|
*/
|
||||||
|
export async function addCreditRiskRelation(data: CreditRiskRelation) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-risk-relation',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改风险关系表
|
||||||
|
*/
|
||||||
|
export async function updateCreditRiskRelation(data: CreditRiskRelation) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-risk-relation',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除风险关系表
|
||||||
|
*/
|
||||||
|
export async function removeCreditRiskRelation(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-risk-relation/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除风险关系表
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditRiskRelation(
|
||||||
|
data: (number | undefined)[]
|
||||||
|
) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-risk-relation/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询风险关系表
|
||||||
|
*/
|
||||||
|
export async function getCreditRiskRelation(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditRiskRelation>>(
|
||||||
|
'/credit/credit-risk-relation/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入风险关系表
|
||||||
|
*/
|
||||||
|
export async function importCreditRiskRelation(file: File, companyId?: number) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-risk-relation/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));
|
||||||
|
}
|
||||||
51
src/api/credit/creditRiskRelation/model/index.ts
Normal file
51
src/api/credit/creditRiskRelation/model/index.ts
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 风险关系表
|
||||||
|
*/
|
||||||
|
export interface CreditRiskRelation {
|
||||||
|
// 序号
|
||||||
|
id?: number;
|
||||||
|
// 主体名称
|
||||||
|
mainBodyName?: string;
|
||||||
|
// 登记状态
|
||||||
|
registrationStatus?: string;
|
||||||
|
// 注册资本
|
||||||
|
registeredCapital?: string;
|
||||||
|
// 省份地区
|
||||||
|
provinceRegion?: string;
|
||||||
|
// 关联关系
|
||||||
|
associatedRelation?: string;
|
||||||
|
// 风险关系
|
||||||
|
riskRelation?: string;
|
||||||
|
// 链接地址
|
||||||
|
url?: 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 CreditRiskRelationParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
127
src/api/credit/creditSupplier/index.ts
Normal file
127
src/api/credit/creditSupplier/index.ts
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditSupplier, CreditSupplierParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询供应商
|
||||||
|
*/
|
||||||
|
export async function pageCreditSupplier(params: CreditSupplierParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditSupplier>>>(
|
||||||
|
'/credit/credit-supplier/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询供应商列表
|
||||||
|
*/
|
||||||
|
export async function listCreditSupplier(params?: CreditSupplierParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditSupplier[]>>(
|
||||||
|
'/credit/credit-supplier',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加供应商
|
||||||
|
*/
|
||||||
|
export async function addCreditSupplier(data: CreditSupplier) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-supplier',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改供应商
|
||||||
|
*/
|
||||||
|
export async function updateCreditSupplier(data: CreditSupplier) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-supplier',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除供应商
|
||||||
|
*/
|
||||||
|
export async function removeCreditSupplier(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-supplier/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除供应商
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditSupplier(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-supplier/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询供应商
|
||||||
|
*/
|
||||||
|
export async function getCreditSupplier(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditSupplier>>(
|
||||||
|
'/credit/credit-supplier/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入供应商
|
||||||
|
*/
|
||||||
|
export async function importCreditSupplier(file: File, companyId?: number) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-supplier/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));
|
||||||
|
}
|
||||||
49
src/api/credit/creditSupplier/model/index.ts
Normal file
49
src/api/credit/creditSupplier/model/index.ts
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商
|
||||||
|
*/
|
||||||
|
export interface CreditSupplier {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 供应商
|
||||||
|
supplier?: string;
|
||||||
|
// 状态
|
||||||
|
statusTxt?: string;
|
||||||
|
// 采购金额(万元)
|
||||||
|
purchaseAmount?: string;
|
||||||
|
// 公开日期
|
||||||
|
publicDate?: string;
|
||||||
|
// 数据来源
|
||||||
|
dataSource?: string;
|
||||||
|
// 链接地址
|
||||||
|
url?: 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 CreditSupplierParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
144
src/api/credit/creditSuspectedRelationship/index.ts
Normal file
144
src/api/credit/creditSuspectedRelationship/index.ts
Normal file
@@ -0,0 +1,144 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type {
|
||||||
|
CreditSuspectedRelationship,
|
||||||
|
CreditSuspectedRelationshipParam
|
||||||
|
} from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询疑似关系
|
||||||
|
*/
|
||||||
|
export async function pageCreditSuspectedRelationship(
|
||||||
|
params: CreditSuspectedRelationshipParam
|
||||||
|
) {
|
||||||
|
const res = await request.get<
|
||||||
|
ApiResult<PageResult<CreditSuspectedRelationship>>
|
||||||
|
>('/credit/credit-suspected-relationship/page', {
|
||||||
|
params: withCreditUserScope(params)
|
||||||
|
});
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询疑似关系列表
|
||||||
|
*/
|
||||||
|
export async function listCreditSuspectedRelationship(
|
||||||
|
params?: CreditSuspectedRelationshipParam
|
||||||
|
) {
|
||||||
|
const res = await request.get<ApiResult<CreditSuspectedRelationship[]>>(
|
||||||
|
'/credit/credit-suspected-relationship',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加疑似关系
|
||||||
|
*/
|
||||||
|
export async function addCreditSuspectedRelationship(
|
||||||
|
data: CreditSuspectedRelationship
|
||||||
|
) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-suspected-relationship',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改疑似关系
|
||||||
|
*/
|
||||||
|
export async function updateCreditSuspectedRelationship(
|
||||||
|
data: CreditSuspectedRelationship
|
||||||
|
) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-suspected-relationship',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除疑似关系
|
||||||
|
*/
|
||||||
|
export async function removeCreditSuspectedRelationship(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-suspected-relationship/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除疑似关系
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditSuspectedRelationship(
|
||||||
|
data: (number | undefined)[]
|
||||||
|
) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-suspected-relationship/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询疑似关系
|
||||||
|
*/
|
||||||
|
export async function getCreditSuspectedRelationship(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditSuspectedRelationship>>(
|
||||||
|
'/credit/credit-suspected-relationship/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入疑似关系
|
||||||
|
*/
|
||||||
|
export async function importCreditSuspectedRelationship(
|
||||||
|
file: File,
|
||||||
|
companyId?: number
|
||||||
|
) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-suspected-relationship/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));
|
||||||
|
}
|
||||||
57
src/api/credit/creditSuspectedRelationship/model/index.ts
Normal file
57
src/api/credit/creditSuspectedRelationship/model/index.ts
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 疑似关系
|
||||||
|
*/
|
||||||
|
export interface CreditSuspectedRelationship {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 企业名称
|
||||||
|
name?: string;
|
||||||
|
// 状态
|
||||||
|
statusText?: string;
|
||||||
|
// 法定代表人
|
||||||
|
legalPerson?: string;
|
||||||
|
// 注册资本
|
||||||
|
registeredCapital?: string;
|
||||||
|
// 成立日期
|
||||||
|
createDate?: string;
|
||||||
|
// 关联方
|
||||||
|
relatedParty?: string;
|
||||||
|
// 疑似关系类型
|
||||||
|
type?: string;
|
||||||
|
// 疑似关系详情
|
||||||
|
detail?: string;
|
||||||
|
// 链接
|
||||||
|
url?: string;
|
||||||
|
// 备注
|
||||||
|
comments?: string;
|
||||||
|
// 企业ID
|
||||||
|
companyId?: number;
|
||||||
|
// 是否推荐
|
||||||
|
recommend?: number;
|
||||||
|
// 排序(数字越小越靠前)
|
||||||
|
sortNumber?: number;
|
||||||
|
// 状态, 0正常, 1冻结
|
||||||
|
status?: number;
|
||||||
|
// 是否删除, 0否, 1是
|
||||||
|
deleted?: number;
|
||||||
|
// 用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 疑似关系搜索条件
|
||||||
|
*/
|
||||||
|
export interface CreditSuspectedRelationshipParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
127
src/api/credit/creditUser/index.ts
Normal file
127
src/api/credit/creditUser/index.ts
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditUser, CreditUserParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询招投标信息表
|
||||||
|
*/
|
||||||
|
export async function pageCreditUser(params: CreditUserParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditUser>>>(
|
||||||
|
'/credit/credit-user/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询招投标信息表列表
|
||||||
|
*/
|
||||||
|
export async function listCreditUser(params?: CreditUserParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditUser[]>>(
|
||||||
|
'/credit/credit-user',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加招投标信息表
|
||||||
|
*/
|
||||||
|
export async function addCreditUser(data: CreditUser) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-user',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改招投标信息表
|
||||||
|
*/
|
||||||
|
export async function updateCreditUser(data: CreditUser) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-user',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除招投标信息表
|
||||||
|
*/
|
||||||
|
export async function removeCreditUser(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-user/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除招投标信息表
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditUser(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-user/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询招投标信息表
|
||||||
|
*/
|
||||||
|
export async function getCreditUser(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditUser>>(
|
||||||
|
'/credit/credit-user/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入招投标
|
||||||
|
*/
|
||||||
|
export async function importCreditUsers(file: File, companyId?: number) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-user/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));
|
||||||
|
}
|
||||||
71
src/api/credit/creditUser/model/index.ts
Normal file
71
src/api/credit/creditUser/model/index.ts
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 招投标信息表
|
||||||
|
*/
|
||||||
|
export interface CreditUser {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 客户名称
|
||||||
|
name?: string;
|
||||||
|
// 唯一标识
|
||||||
|
code?: string;
|
||||||
|
// 链接地址
|
||||||
|
url?: string;
|
||||||
|
// 类型, 0普通用户, 1招投标
|
||||||
|
type?: number;
|
||||||
|
// 企业角色
|
||||||
|
role?: string;
|
||||||
|
// 上级id, 0是顶级
|
||||||
|
parentId?: number;
|
||||||
|
// 信息类型
|
||||||
|
infoType?: string;
|
||||||
|
// 所在国家
|
||||||
|
country?: string;
|
||||||
|
// 所在省份
|
||||||
|
province?: string;
|
||||||
|
// 所在城市
|
||||||
|
city?: string;
|
||||||
|
// 所在辖区
|
||||||
|
region?: string;
|
||||||
|
// 街道地址
|
||||||
|
address?: string;
|
||||||
|
// 招采单位名称
|
||||||
|
procurementName?: string;
|
||||||
|
// 中标单位名称
|
||||||
|
winningName?: string;
|
||||||
|
// 中标单位名称
|
||||||
|
winningPrice?: string;
|
||||||
|
// 发布日期
|
||||||
|
releaseDate?: string;
|
||||||
|
// 备注
|
||||||
|
comments?: string;
|
||||||
|
// 是否推荐
|
||||||
|
recommend?: number;
|
||||||
|
// 到期时间
|
||||||
|
expirationTime?: string;
|
||||||
|
// 排序(数字越小越靠前)
|
||||||
|
sortNumber?: number;
|
||||||
|
// 状态, 0正常, 1冻结
|
||||||
|
status?: number;
|
||||||
|
// 是否删除, 0否, 1是
|
||||||
|
deleted?: number;
|
||||||
|
// 用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 招投标信息表搜索条件
|
||||||
|
*/
|
||||||
|
export interface CreditUserParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
151
src/api/credit/creditXgxf/index.ts
Normal file
151
src/api/credit/creditXgxf/index.ts
Normal file
@@ -0,0 +1,151 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||||
|
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditXgxf, CreditXgxfParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询限制高消费
|
||||||
|
*/
|
||||||
|
export async function pageCreditXgxf(params: CreditXgxfParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditXgxf>>>(
|
||||||
|
'/credit/credit-xgxf/page',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询限制高消费列表
|
||||||
|
*/
|
||||||
|
export async function listCreditXgxf(params?: CreditXgxfParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditXgxf[]>>(
|
||||||
|
'/credit/credit-xgxf',
|
||||||
|
{ params: withCreditUserScope(params) }
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加限制高消费
|
||||||
|
*/
|
||||||
|
export async function addCreditXgxf(data: CreditXgxf) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-xgxf',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改限制高消费
|
||||||
|
*/
|
||||||
|
export async function updateCreditXgxf(data: CreditXgxf) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-xgxf',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除限制高消费
|
||||||
|
*/
|
||||||
|
export async function removeCreditXgxf(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-xgxf/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除限制高消费
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditXgxf(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-xgxf/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询限制高消费
|
||||||
|
*/
|
||||||
|
export async function getCreditXgxf(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditXgxf>>(
|
||||||
|
'/credit/credit-xgxf/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入限制高消费
|
||||||
|
*/
|
||||||
|
export async function importCreditXgxf(file: File, companyId?: number) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-xgxf/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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入历史限制高消费
|
||||||
|
*/
|
||||||
|
export async function importCreditXgxfHistory(file: File, companyId?: number) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
if (companyId != null) {
|
||||||
|
formData.append('companyId', String(companyId));
|
||||||
|
}
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-xgxf/import/history',
|
||||||
|
formData,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
59
src/api/credit/creditXgxf/model/index.ts
Normal file
59
src/api/credit/creditXgxf/model/index.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 限制高消费
|
||||||
|
*/
|
||||||
|
export interface CreditXgxf {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 数据类型
|
||||||
|
dataType?: string;
|
||||||
|
// 原告/上诉人
|
||||||
|
plaintiffAppellant?: string;
|
||||||
|
// 被告/被上诉人
|
||||||
|
appellee?: string;
|
||||||
|
// 链接地址
|
||||||
|
url?: string;
|
||||||
|
// 其他当事人/第三人
|
||||||
|
otherPartiesThirdParty?: string;
|
||||||
|
// 发生时间
|
||||||
|
occurrenceTime?: string;
|
||||||
|
// 案号
|
||||||
|
caseNumber?: string;
|
||||||
|
// 案由
|
||||||
|
causeOfAction?: string;
|
||||||
|
// 涉案金额
|
||||||
|
involvedAmount?: string;
|
||||||
|
// 法院
|
||||||
|
courtName?: string;
|
||||||
|
// 数据状态
|
||||||
|
dataStatus?: 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 CreditXgxfParam extends PageParam {
|
||||||
|
userId?: number;
|
||||||
|
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
49
src/api/credit/utils/data-scope.ts
Normal file
49
src/api/credit/utils/data-scope.ts
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
import { hasRole } from '@/utils/permission';
|
||||||
|
import { useUserStore } from '@/store/modules/user';
|
||||||
|
|
||||||
|
function isSuperAdmin(): boolean {
|
||||||
|
try {
|
||||||
|
return hasRole('superAdmin');
|
||||||
|
} catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCurrentUserId(): number | undefined {
|
||||||
|
try {
|
||||||
|
const store = useUserStore();
|
||||||
|
const id = store?.info?.userId;
|
||||||
|
if (typeof id === 'number' && Number.isFinite(id) && id > 0) {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
// Pinia may not be active in some early-init code paths.
|
||||||
|
}
|
||||||
|
const raw = localStorage.getItem('UserId');
|
||||||
|
if (!raw) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
const n = Number(raw);
|
||||||
|
return Number.isFinite(n) && n > 0 ? n : undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Credit module data scope:
|
||||||
|
* - superAdmin: see all data
|
||||||
|
* - others: only see data published by themselves (userId)
|
||||||
|
*/
|
||||||
|
export function withCreditUserScope<T extends Record<string, any> | undefined>(
|
||||||
|
params: T
|
||||||
|
): T {
|
||||||
|
if (isSuperAdmin()) {
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
const userId = getCurrentUserId();
|
||||||
|
if (!userId) {
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
if (!params) {
|
||||||
|
return { userId } as T;
|
||||||
|
}
|
||||||
|
return { ...(params as any), userId } as T;
|
||||||
|
}
|
||||||
@@ -121,7 +121,8 @@ export default {
|
|||||||
"root": "credit",
|
"root": "credit",
|
||||||
"pages": [
|
"pages": [
|
||||||
"order/index",
|
"order/index",
|
||||||
"order/add"
|
"order/add",
|
||||||
|
"company/index"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
5
src/credit/company/index.config.ts
Normal file
5
src/credit/company/index.config.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '客户管理',
|
||||||
|
navigationBarTextStyle: 'black',
|
||||||
|
navigationBarBackgroundColor: '#ffffff'
|
||||||
|
})
|
||||||
874
src/credit/company/index.tsx
Normal file
874
src/credit/company/index.tsx
Normal file
@@ -0,0 +1,874 @@
|
|||||||
|
import { useCallback, useMemo, useRef, useState } from 'react'
|
||||||
|
import Taro, { useDidShow } from '@tarojs/taro'
|
||||||
|
import { View, Text } from '@tarojs/components'
|
||||||
|
import {
|
||||||
|
Address,
|
||||||
|
Button,
|
||||||
|
Cell,
|
||||||
|
CellGroup,
|
||||||
|
Checkbox,
|
||||||
|
ConfigProvider,
|
||||||
|
Dialog,
|
||||||
|
Empty,
|
||||||
|
InfiniteLoading,
|
||||||
|
Input,
|
||||||
|
Loading,
|
||||||
|
Popup,
|
||||||
|
PullToRefresh,
|
||||||
|
SearchBar,
|
||||||
|
Tag
|
||||||
|
} from '@nutui/nutui-react-taro'
|
||||||
|
import { Copy, Phone } from '@nutui/icons-react-taro'
|
||||||
|
|
||||||
|
import RegionData from '@/api/json/regions-data.json'
|
||||||
|
import { addCreditCompany, pageCreditCompany, updateCreditCompany } from '@/api/credit/creditCompany'
|
||||||
|
import type { CreditCompany } from '@/api/credit/creditCompany/model'
|
||||||
|
import { listUsers } from '@/api/system/user'
|
||||||
|
import type { User } from '@/api/system/user/model'
|
||||||
|
|
||||||
|
const PAGE_SIZE = 10
|
||||||
|
|
||||||
|
type FollowStatus = '全部' | '未联系' | '加微前沟通' | '跟进中' | '已成交' | '无意向'
|
||||||
|
|
||||||
|
const FOLLOW_STATUS_OPTIONS: FollowStatus[] = ['全部', '未联系', '加微前沟通', '跟进中', '已成交', '无意向']
|
||||||
|
|
||||||
|
const FOLLOW_MAP_STORAGE_KEY = 'credit_company_follow_status_map'
|
||||||
|
|
||||||
|
const safeParseJSON = <T,>(v: any): T | null => {
|
||||||
|
try {
|
||||||
|
if (!v) return null
|
||||||
|
if (typeof v === 'object') return v as T
|
||||||
|
if (typeof v === 'string') return JSON.parse(v) as T
|
||||||
|
return null
|
||||||
|
} catch (_e) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const getCompanyIdKey = (c: CreditCompany) => String(c?.id || '')
|
||||||
|
|
||||||
|
const splitPhones = (raw?: string) => {
|
||||||
|
const text = String(raw || '').trim()
|
||||||
|
if (!text) return []
|
||||||
|
// 常见分隔符:逗号/顿号/分号/换行/空格
|
||||||
|
return text
|
||||||
|
.split(/[\s,,;;、\n\r]+/g)
|
||||||
|
.map(s => s.trim())
|
||||||
|
.filter(Boolean)
|
||||||
|
}
|
||||||
|
|
||||||
|
const getCompanyPhones = (c: CreditCompany) => {
|
||||||
|
const arr = [...splitPhones(c.tel), ...splitPhones(c.moreTel)]
|
||||||
|
return Array.from(new Set(arr))
|
||||||
|
}
|
||||||
|
|
||||||
|
const getCompanyIndustry = (c: CreditCompany) => {
|
||||||
|
// 兼容:不同数据源字段可能不一致,优先取更具体的大类
|
||||||
|
return String(
|
||||||
|
c.nationalStandardIndustryCategories6 ||
|
||||||
|
c.nationalStandardIndustryCategories2 ||
|
||||||
|
c.nationalStandardIndustryCategories ||
|
||||||
|
c.institutionType ||
|
||||||
|
''
|
||||||
|
).trim()
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function CreditCompanyPage() {
|
||||||
|
const serverPageRef = useRef(1)
|
||||||
|
const [list, setList] = useState<CreditCompany[]>([])
|
||||||
|
const [hasMore, setHasMore] = useState(true)
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
const [error, setError] = useState<string | null>(null)
|
||||||
|
|
||||||
|
const [searchValue, setSearchValue] = useState('')
|
||||||
|
|
||||||
|
const [cityVisible, setCityVisible] = useState(false)
|
||||||
|
const [cityText, setCityText] = useState<string>('全部')
|
||||||
|
|
||||||
|
const [followVisible, setFollowVisible] = useState(false)
|
||||||
|
const [followStatus, setFollowStatus] = useState<FollowStatus>('全部')
|
||||||
|
|
||||||
|
const [industryVisible, setIndustryVisible] = useState(false)
|
||||||
|
const [industryText, setIndustryText] = useState<string>('全部')
|
||||||
|
|
||||||
|
const [selectMode, setSelectMode] = useState(false)
|
||||||
|
const [selectedIds, setSelectedIds] = useState<number[]>([])
|
||||||
|
|
||||||
|
const [staffPopupVisible, setStaffPopupVisible] = useState(false)
|
||||||
|
const [staffLoading, setStaffLoading] = useState(false)
|
||||||
|
const [staffList, setStaffList] = useState<User[]>([])
|
||||||
|
const [staffSelectedId, setStaffSelectedId] = useState<number | undefined>(undefined)
|
||||||
|
const [assigning, setAssigning] = useState(false)
|
||||||
|
|
||||||
|
const [addDialogVisible, setAddDialogVisible] = useState(false)
|
||||||
|
const [addStep, setAddStep] = useState<'search' | 'form'>('search')
|
||||||
|
const [addChecking, setAddChecking] = useState(false)
|
||||||
|
const [addSubmitting, setAddSubmitting] = useState(false)
|
||||||
|
const [addName, setAddName] = useState('')
|
||||||
|
const [addCode, setAddCode] = useState('')
|
||||||
|
const [addPhone, setAddPhone] = useState('')
|
||||||
|
const [addCityVisible, setAddCityVisible] = useState(false)
|
||||||
|
const [addCityText, setAddCityText] = useState('')
|
||||||
|
const [addIndustry, setAddIndustry] = useState('')
|
||||||
|
|
||||||
|
const [followMap, setFollowMap] = useState<Record<string, FollowStatus>>(() => {
|
||||||
|
const raw = Taro.getStorageSync(FOLLOW_MAP_STORAGE_KEY)
|
||||||
|
return safeParseJSON<Record<string, FollowStatus>>(raw) || {}
|
||||||
|
})
|
||||||
|
|
||||||
|
const currentUser = useMemo(() => {
|
||||||
|
return safeParseJSON<User>(Taro.getStorageSync('User')) || ({} as User)
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
const canAssign = useMemo(() => {
|
||||||
|
if (currentUser?.isSuperAdmin || currentUser?.isAdmin) return true
|
||||||
|
const roleName = String(currentUser?.roleName || currentUser?.roleCode || '').trim()
|
||||||
|
// 约定:销售助理无分配权限(后端若有更精确字段,可替换这里的判断)
|
||||||
|
if (roleName.includes('销售助理')) return false
|
||||||
|
return true
|
||||||
|
}, [currentUser?.isAdmin, currentUser?.isSuperAdmin, currentUser?.roleCode, currentUser?.roleName])
|
||||||
|
|
||||||
|
const cityOptions = useMemo(() => {
|
||||||
|
// NutUI Address options: [{ text, value, children }]
|
||||||
|
// @ts-ignore
|
||||||
|
return (RegionData || []).map(a => ({
|
||||||
|
value: a.label,
|
||||||
|
text: a.label,
|
||||||
|
children: (a.children || []).map(b => ({
|
||||||
|
value: b.label,
|
||||||
|
text: b.label,
|
||||||
|
children: (b.children || []).map(c => ({
|
||||||
|
value: c.label,
|
||||||
|
text: c.label
|
||||||
|
}))
|
||||||
|
}))
|
||||||
|
}))
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
const staffNameMap = useMemo(() => {
|
||||||
|
const map = new Map<number, string>()
|
||||||
|
for (const u of staffList) {
|
||||||
|
if (!u?.userId) continue
|
||||||
|
const name = String(u.realName || u.nickname || u.username || `员工${u.userId}`)
|
||||||
|
map.set(u.userId, name)
|
||||||
|
}
|
||||||
|
return map
|
||||||
|
}, [staffList])
|
||||||
|
|
||||||
|
const getFollowStatus = useCallback(
|
||||||
|
(c: CreditCompany): FollowStatus => {
|
||||||
|
const k = getCompanyIdKey(c)
|
||||||
|
const stored = k ? followMap[k] : undefined
|
||||||
|
if (stored) return stored
|
||||||
|
return '未联系'
|
||||||
|
},
|
||||||
|
[followMap]
|
||||||
|
)
|
||||||
|
|
||||||
|
const setFollowStatusFor = async (c: CreditCompany) => {
|
||||||
|
if (!c?.id) return
|
||||||
|
try {
|
||||||
|
const res = await Taro.showActionSheet({
|
||||||
|
itemList: FOLLOW_STATUS_OPTIONS.filter(s => s !== '全部')
|
||||||
|
})
|
||||||
|
const next = FOLLOW_STATUS_OPTIONS.filter(s => s !== '全部')[res.tapIndex] as FollowStatus | undefined
|
||||||
|
if (!next) return
|
||||||
|
|
||||||
|
setFollowMap(prev => {
|
||||||
|
const k = getCompanyIdKey(c)
|
||||||
|
const merged = { ...prev, [k]: next }
|
||||||
|
Taro.setStorageSync(FOLLOW_MAP_STORAGE_KEY, merged)
|
||||||
|
return merged
|
||||||
|
})
|
||||||
|
|
||||||
|
// 若当前正在按状态筛选,则即时移除不匹配项,避免“改完状态但列表不变”的割裂感。
|
||||||
|
if (followStatus !== '全部' && next !== followStatus && c.id) {
|
||||||
|
const cid = Number(c.id)
|
||||||
|
setList(prev => prev.filter(x => Number(x.id) !== cid))
|
||||||
|
setSelectedIds(prev => prev.filter(id => id !== cid))
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
const msg = String((e as any)?.errMsg || (e as any)?.message || e || '')
|
||||||
|
if (msg.includes('cancel')) return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const applyFilters = useCallback(
|
||||||
|
(incoming: CreditCompany[]) => {
|
||||||
|
const city = cityText === '全部' ? '' : cityText
|
||||||
|
const industry = industryText === '全部' ? '' : industryText
|
||||||
|
const follow = followStatus === '全部' ? '' : followStatus
|
||||||
|
|
||||||
|
return incoming.filter(c => {
|
||||||
|
if (c?.deleted === 1) return false
|
||||||
|
|
||||||
|
if (city) {
|
||||||
|
const full = [c.province, c.city, c.region].filter(Boolean).join(' ')
|
||||||
|
if (!full.includes(city) && String(c.city || '') !== city) return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (industry) {
|
||||||
|
const ind = getCompanyIndustry(c)
|
||||||
|
if (!ind.includes(industry)) return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (follow) {
|
||||||
|
if (getFollowStatus(c) !== follow) return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
},
|
||||||
|
[cityText, followStatus, getFollowStatus, industryText]
|
||||||
|
)
|
||||||
|
|
||||||
|
const reload = useCallback(
|
||||||
|
async (resetPage = false) => {
|
||||||
|
if (loading) return
|
||||||
|
setLoading(true)
|
||||||
|
setError(null)
|
||||||
|
|
||||||
|
if (resetPage) {
|
||||||
|
serverPageRef.current = 1
|
||||||
|
setHasMore(true)
|
||||||
|
setSelectedIds([])
|
||||||
|
setSelectMode(false)
|
||||||
|
}
|
||||||
|
|
||||||
|
let nextList = resetPage ? [] : list
|
||||||
|
let page = serverPageRef.current
|
||||||
|
let serverHasMore = true
|
||||||
|
|
||||||
|
// 当筛选条件较严格时,可能需要多拉几页才能拿到“至少一条匹配数据”
|
||||||
|
const MAX_PAGE_TRIES = 8
|
||||||
|
let tries = 0
|
||||||
|
|
||||||
|
try {
|
||||||
|
while (tries < MAX_PAGE_TRIES) {
|
||||||
|
tries += 1
|
||||||
|
const params: any = {
|
||||||
|
page,
|
||||||
|
limit: PAGE_SIZE,
|
||||||
|
keywords: searchValue?.trim() || undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
const res = await pageCreditCompany(params)
|
||||||
|
const incoming = (res?.list || []) as CreditCompany[]
|
||||||
|
const filtered = applyFilters(incoming)
|
||||||
|
|
||||||
|
if (resetPage) {
|
||||||
|
nextList = filtered
|
||||||
|
resetPage = false
|
||||||
|
} else {
|
||||||
|
nextList = nextList.concat(filtered)
|
||||||
|
}
|
||||||
|
|
||||||
|
page += 1
|
||||||
|
|
||||||
|
// 服务端无更多页:终止
|
||||||
|
if (incoming.length < PAGE_SIZE) {
|
||||||
|
serverHasMore = false
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
// 已拿到可展示数据:先返回,让用户继续滚动触发下一次加载
|
||||||
|
if (filtered.length > 0) break
|
||||||
|
}
|
||||||
|
|
||||||
|
serverPageRef.current = page
|
||||||
|
setList(nextList)
|
||||||
|
setHasMore(serverHasMore)
|
||||||
|
} catch (e) {
|
||||||
|
console.error('加载客户列表失败:', e)
|
||||||
|
setError('加载失败,请重试')
|
||||||
|
setHasMore(false)
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[applyFilters, list, loading, searchValue]
|
||||||
|
)
|
||||||
|
|
||||||
|
const handleRefresh = useCallback(async () => {
|
||||||
|
await reload(true)
|
||||||
|
}, [reload])
|
||||||
|
|
||||||
|
const loadMore = useCallback(async () => {
|
||||||
|
if (loading || !hasMore) return
|
||||||
|
await reload(false)
|
||||||
|
}, [hasMore, loading, reload])
|
||||||
|
|
||||||
|
useDidShow(() => {
|
||||||
|
reload(true).then()
|
||||||
|
})
|
||||||
|
|
||||||
|
const visibleIndustryOptions = useMemo(() => {
|
||||||
|
const uniq = new Set<string>()
|
||||||
|
for (const m of list) {
|
||||||
|
const ind = getCompanyIndustry(m)
|
||||||
|
if (ind) uniq.add(ind)
|
||||||
|
}
|
||||||
|
const arr = Array.from(uniq)
|
||||||
|
arr.sort()
|
||||||
|
return ['全部'].concat(arr)
|
||||||
|
}, [list])
|
||||||
|
|
||||||
|
const toggleSelectId = (companyId?: number, checked?: boolean) => {
|
||||||
|
if (!companyId) return
|
||||||
|
setSelectedIds(prev => {
|
||||||
|
if (checked) return prev.includes(companyId) ? prev : prev.concat(companyId)
|
||||||
|
return prev.filter(id => id !== companyId)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const copyPhones = async () => {
|
||||||
|
const pool = selectMode && selectedIds.length ? list.filter(c => selectedIds.includes(Number(c.id))) : list
|
||||||
|
const phones = pool.flatMap(c => getCompanyPhones(c))
|
||||||
|
const unique = Array.from(new Set(phones)).filter(Boolean)
|
||||||
|
if (!unique.length) {
|
||||||
|
Taro.showToast({ title: '暂无可复制的电话', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
await Taro.setClipboardData({ data: unique.join('\n') })
|
||||||
|
Taro.showToast({ title: `已复制${unique.length}个电话`, icon: 'success' })
|
||||||
|
}
|
||||||
|
|
||||||
|
const callPhone = async (phone?: string) => {
|
||||||
|
const num = String(phone || '').trim()
|
||||||
|
if (!num) {
|
||||||
|
Taro.showToast({ title: '暂无电话', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
await Taro.makePhoneCall({ phoneNumber: num })
|
||||||
|
} catch (e) {
|
||||||
|
console.error('拨号失败:', e)
|
||||||
|
Taro.showToast({ title: '拨号失败', icon: 'none' })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const openAddCustomer = () => {
|
||||||
|
setAddStep('search')
|
||||||
|
setAddName('')
|
||||||
|
setAddCode('')
|
||||||
|
setAddPhone('')
|
||||||
|
setAddCityText('')
|
||||||
|
setAddIndustry('')
|
||||||
|
setAddDialogVisible(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
const checkCompanyExists = async () => {
|
||||||
|
if (addChecking) return
|
||||||
|
const name = addName.trim()
|
||||||
|
const code = addCode.trim()
|
||||||
|
const keywords = (name || code).trim()
|
||||||
|
if (!keywords) {
|
||||||
|
Taro.showToast({ title: '请输入公司名称或统一代码', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
setAddChecking(true)
|
||||||
|
try {
|
||||||
|
const res = await pageCreditCompany({ page: 1, limit: 1, keywords } as any)
|
||||||
|
const exists = ((res?.list || []) as CreditCompany[]).some(c => c?.deleted !== 1)
|
||||||
|
if (exists) {
|
||||||
|
await Taro.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '该公司信息已存在,请联系管理员核实',
|
||||||
|
showCancel: false
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 未存在:进入录入表单
|
||||||
|
setAddStep('form')
|
||||||
|
} catch (e) {
|
||||||
|
console.error('查询公司失败:', e)
|
||||||
|
Taro.showToast({ title: '查询失败,请重试', icon: 'none' })
|
||||||
|
} finally {
|
||||||
|
setAddChecking(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const submitAddCustomer = async () => {
|
||||||
|
if (addSubmitting) return
|
||||||
|
const name = addName.trim()
|
||||||
|
const code = addCode.trim()
|
||||||
|
const phone = addPhone.trim()
|
||||||
|
|
||||||
|
if (!name) {
|
||||||
|
Taro.showToast({ title: '请输入公司名称', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
setAddSubmitting(true)
|
||||||
|
try {
|
||||||
|
const regionParts = addCityText.split(' ').map(s => s.trim()).filter(Boolean)
|
||||||
|
const province = regionParts.length >= 2 ? regionParts[0] : undefined
|
||||||
|
const city = regionParts.length >= 2 ? regionParts[1] : (regionParts[0] || undefined)
|
||||||
|
const payload: CreditCompany = {
|
||||||
|
name,
|
||||||
|
matchName: name,
|
||||||
|
code: code || undefined,
|
||||||
|
tel: phone || undefined,
|
||||||
|
province,
|
||||||
|
city,
|
||||||
|
nationalStandardIndustryCategories: addIndustry || undefined
|
||||||
|
}
|
||||||
|
await addCreditCompany(payload)
|
||||||
|
Taro.showToast({ title: '添加成功', icon: 'success' })
|
||||||
|
setAddDialogVisible(false)
|
||||||
|
await reload(true)
|
||||||
|
} catch (e) {
|
||||||
|
console.error('添加客户失败:', e)
|
||||||
|
Taro.showToast({ title: '添加失败,请重试', icon: 'none' })
|
||||||
|
} finally {
|
||||||
|
setAddSubmitting(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const ensureStaffLoaded = async () => {
|
||||||
|
if (staffLoading) return
|
||||||
|
if (staffList.length) return
|
||||||
|
setStaffLoading(true)
|
||||||
|
try {
|
||||||
|
const res = await listUsers({ isStaff: true } as any)
|
||||||
|
setStaffList((res || []) as User[])
|
||||||
|
} catch (e) {
|
||||||
|
console.error('加载员工列表失败:', e)
|
||||||
|
Taro.showToast({ title: '加载员工失败', icon: 'none' })
|
||||||
|
} finally {
|
||||||
|
setStaffLoading(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const openAssign = async () => {
|
||||||
|
if (!canAssign) {
|
||||||
|
Taro.showToast({ title: '当前角色无分配权限', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!selectMode) {
|
||||||
|
setSelectMode(true)
|
||||||
|
setSelectedIds([])
|
||||||
|
Taro.showToast({ title: '请选择要分配的客户', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!selectedIds.length) {
|
||||||
|
Taro.showToast({ title: '请先勾选客户', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
await ensureStaffLoaded()
|
||||||
|
setStaffPopupVisible(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
const submitAssign = async () => {
|
||||||
|
if (!staffSelectedId) {
|
||||||
|
Taro.showToast({ title: '请选择分配对象', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!selectedIds.length) {
|
||||||
|
Taro.showToast({ title: '请先勾选客户', icon: 'none' })
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
setAssigning(true)
|
||||||
|
try {
|
||||||
|
for (const id of selectedIds) {
|
||||||
|
await updateCreditCompany({ id, userId: staffSelectedId } as any)
|
||||||
|
}
|
||||||
|
Taro.showToast({ title: '分配成功', icon: 'success' })
|
||||||
|
setStaffPopupVisible(false)
|
||||||
|
setSelectMode(false)
|
||||||
|
setSelectedIds([])
|
||||||
|
await reload(true)
|
||||||
|
} catch (e) {
|
||||||
|
console.error('分配失败:', e)
|
||||||
|
Taro.showToast({ title: '分配失败,请重试', icon: 'none' })
|
||||||
|
} finally {
|
||||||
|
setAssigning(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View className="bg-gray-50 min-h-screen">
|
||||||
|
<ConfigProvider>
|
||||||
|
<View className="py-2">
|
||||||
|
<SearchBar
|
||||||
|
placeholder="公司名称 / 统一代码"
|
||||||
|
value={searchValue}
|
||||||
|
onChange={setSearchValue}
|
||||||
|
onSearch={() => reload(true)}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View className="px-3 pb-2 flex items-center gap-2">
|
||||||
|
<Button size="small" fill="outline" onClick={() => setCityVisible(true)}>
|
||||||
|
{cityText === '全部' ? '地区' : cityText}
|
||||||
|
</Button>
|
||||||
|
<Button size="small" fill="outline" onClick={() => setFollowVisible(true)}>
|
||||||
|
{followStatus === '全部' ? '跟进状态' : followStatus}
|
||||||
|
</Button>
|
||||||
|
<Button size="small" fill="outline" onClick={() => setIndustryVisible(true)}>
|
||||||
|
{industryText === '全部' ? '行业' : industryText}
|
||||||
|
</Button>
|
||||||
|
<View className="flex-1" />
|
||||||
|
<Button size="small" fill="outline" icon={<Copy />} onClick={copyPhones}>
|
||||||
|
复制电话
|
||||||
|
</Button>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{!!error && (
|
||||||
|
<View className="px-4 pb-2 text-sm text-red-500">
|
||||||
|
{error}
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<PullToRefresh onRefresh={handleRefresh} headHeight={60}>
|
||||||
|
<View className="px-3" style={{ height: 'calc(100vh - 190px)', overflowY: 'auto' }} id="credit-company-scroll">
|
||||||
|
{list.length === 0 && !loading ? (
|
||||||
|
<View className="flex flex-col justify-center items-center" style={{ height: 'calc(100vh - 240px)' }}>
|
||||||
|
<Empty description="暂无客户数据" style={{ backgroundColor: 'transparent' }} />
|
||||||
|
</View>
|
||||||
|
) : (
|
||||||
|
<InfiniteLoading
|
||||||
|
target="credit-company-scroll"
|
||||||
|
hasMore={hasMore}
|
||||||
|
onLoadMore={loadMore}
|
||||||
|
loadingText={
|
||||||
|
<View className="flex justify-center items-center py-4">
|
||||||
|
<Loading />
|
||||||
|
<View className="ml-2">加载中...</View>
|
||||||
|
</View>
|
||||||
|
}
|
||||||
|
loadMoreText={
|
||||||
|
<View className="text-center py-4 text-gray-500">
|
||||||
|
{list.length === 0 ? '暂无数据' : '没有更多了'}
|
||||||
|
</View>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{list.map((c, idx) => {
|
||||||
|
const id = Number(c.id)
|
||||||
|
const selected = !!id && selectedIds.includes(id)
|
||||||
|
const follow = getFollowStatus(c)
|
||||||
|
const ownerName = c.userId ? staffNameMap.get(Number(c.userId)) : undefined
|
||||||
|
const name = c.matchName || c.name || `企业${c.id || ''}`
|
||||||
|
const industry = getCompanyIndustry(c)
|
||||||
|
const phones = getCompanyPhones(c)
|
||||||
|
const primaryPhone = phones[0]
|
||||||
|
return (
|
||||||
|
<CellGroup key={c.id || idx} className="mb-3">
|
||||||
|
<Cell>
|
||||||
|
<View className="flex gap-3 items-start w-full">
|
||||||
|
{selectMode && (
|
||||||
|
<View className="pt-1">
|
||||||
|
<Checkbox
|
||||||
|
checked={selected}
|
||||||
|
onChange={(checked) => toggleSelectId(id, checked)}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<View className="flex-1 min-w-0">
|
||||||
|
<View className="flex items-start justify-between gap-2">
|
||||||
|
<View className="min-w-0 flex-1">
|
||||||
|
<View className="text-base font-bold text-gray-900 truncate">
|
||||||
|
{name}
|
||||||
|
</View>
|
||||||
|
{!!industry && (
|
||||||
|
<View className="text-xs text-gray-500 truncate mt-1">
|
||||||
|
{industry}
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
<Tag
|
||||||
|
type={follow === '无意向' ? 'danger' : follow === '已成交' ? 'success' : 'primary'}
|
||||||
|
onClick={(e: any) => {
|
||||||
|
e?.stopPropagation?.()
|
||||||
|
setFollowStatusFor(c)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{follow}
|
||||||
|
</Tag>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View className="mt-2 flex items-center justify-between gap-2">
|
||||||
|
<View className="text-xs text-gray-600 truncate">
|
||||||
|
<Text className="mr-2">
|
||||||
|
{primaryPhone ? primaryPhone : '暂无电话'}
|
||||||
|
</Text>
|
||||||
|
{ownerName && (
|
||||||
|
<Text className="text-gray-500">
|
||||||
|
跟进人:{ownerName}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View className="flex items-center gap-2">
|
||||||
|
<Button
|
||||||
|
size="small"
|
||||||
|
fill="outline"
|
||||||
|
icon={<Phone />}
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation()
|
||||||
|
callPhone(primaryPhone)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
拨打
|
||||||
|
</Button>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{!!(c.province || c.city || c.region) && (
|
||||||
|
<View className="mt-2 text-xs text-gray-500 truncate">
|
||||||
|
{[c.province, c.city, c.region].filter(Boolean).join(' ')}
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</Cell>
|
||||||
|
</CellGroup>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
</InfiniteLoading>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
</PullToRefresh>
|
||||||
|
|
||||||
|
<View className="h-20 w-full" />
|
||||||
|
<View className="fixed z-50 bottom-0 left-0 right-0 bg-white border-t border-gray-200 px-3 py-3 safe-area-bottom">
|
||||||
|
<View className="flex items-center gap-3">
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
style={{ background: '#ef4444' }}
|
||||||
|
block
|
||||||
|
onClick={openAddCustomer}
|
||||||
|
>
|
||||||
|
添加客户
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
style={{ background: canAssign ? '#3b82f6' : '#94a3b8' }}
|
||||||
|
disabled={!canAssign || assigning}
|
||||||
|
block
|
||||||
|
onClick={openAssign}
|
||||||
|
>
|
||||||
|
{selectMode ? '分配所选' : '分配客户'}
|
||||||
|
</Button>
|
||||||
|
</View>
|
||||||
|
{selectMode && (
|
||||||
|
<View className="mt-2 flex items-center justify-between text-xs text-gray-500">
|
||||||
|
<Text>已选 {selectedIds.length} 个</Text>
|
||||||
|
<View className="flex items-center justify-end gap-3">
|
||||||
|
<Text
|
||||||
|
className="text-blue-600"
|
||||||
|
onClick={() => copyPhones()}
|
||||||
|
>
|
||||||
|
复制所选电话
|
||||||
|
</Text>
|
||||||
|
<Text
|
||||||
|
className="text-gray-500"
|
||||||
|
onClick={() => {
|
||||||
|
setSelectMode(false)
|
||||||
|
setSelectedIds([])
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
取消
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<Address
|
||||||
|
visible={cityVisible}
|
||||||
|
options={cityOptions as any}
|
||||||
|
title="选择地区(到城市)"
|
||||||
|
onChange={(value: any[]) => {
|
||||||
|
const txt = value.filter(Boolean).slice(0, 2).join(' ')
|
||||||
|
setCityText(txt || '全部')
|
||||||
|
setCityVisible(false)
|
||||||
|
reload(true).then()
|
||||||
|
}}
|
||||||
|
onClose={() => setCityVisible(false)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Popup
|
||||||
|
visible={followVisible}
|
||||||
|
position="bottom"
|
||||||
|
style={{ height: '45vh' }}
|
||||||
|
onClose={() => setFollowVisible(false)}
|
||||||
|
>
|
||||||
|
<View className="p-4">
|
||||||
|
<View className="flex items-center justify-between mb-3">
|
||||||
|
<Text className="text-base font-medium">跟进状态</Text>
|
||||||
|
<Text className="text-sm text-gray-500" onClick={() => setFollowVisible(false)}>
|
||||||
|
关闭
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<CellGroup>
|
||||||
|
{FOLLOW_STATUS_OPTIONS.map(s => (
|
||||||
|
<Cell
|
||||||
|
key={s}
|
||||||
|
title={<Text className={s === followStatus ? 'text-blue-600' : ''}>{s}</Text>}
|
||||||
|
onClick={() => {
|
||||||
|
setFollowStatus(s)
|
||||||
|
setFollowVisible(false)
|
||||||
|
reload(true).then()
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</CellGroup>
|
||||||
|
</View>
|
||||||
|
</Popup>
|
||||||
|
|
||||||
|
<Popup
|
||||||
|
visible={industryVisible}
|
||||||
|
position="bottom"
|
||||||
|
style={{ height: '45vh' }}
|
||||||
|
onClose={() => setIndustryVisible(false)}
|
||||||
|
>
|
||||||
|
<View className="p-4">
|
||||||
|
<View className="flex items-center justify-between mb-3">
|
||||||
|
<Text className="text-base font-medium">行业</Text>
|
||||||
|
<Text className="text-sm text-gray-500" onClick={() => setIndustryVisible(false)}>
|
||||||
|
关闭
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
<CellGroup>
|
||||||
|
{visibleIndustryOptions.map(s => (
|
||||||
|
<Cell
|
||||||
|
key={s}
|
||||||
|
title={<Text className={s === industryText ? 'text-blue-600' : ''}>{s}</Text>}
|
||||||
|
onClick={() => {
|
||||||
|
setIndustryText(s)
|
||||||
|
setIndustryVisible(false)
|
||||||
|
reload(true).then()
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</CellGroup>
|
||||||
|
</View>
|
||||||
|
</Popup>
|
||||||
|
|
||||||
|
<Popup
|
||||||
|
visible={staffPopupVisible}
|
||||||
|
position="bottom"
|
||||||
|
style={{ height: '65vh' }}
|
||||||
|
onClose={() => {
|
||||||
|
if (assigning) return
|
||||||
|
setStaffPopupVisible(false)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<View className="p-4 flex flex-col" style={{ height: '65vh' }}>
|
||||||
|
<View className="flex items-center justify-between mb-3">
|
||||||
|
<Text className="text-base font-medium">选择分配对象</Text>
|
||||||
|
<Text className="text-sm text-gray-500" onClick={() => !assigning && setStaffPopupVisible(false)}>
|
||||||
|
关闭
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View className="flex-1 overflow-y-auto">
|
||||||
|
{staffLoading ? (
|
||||||
|
<View className="py-10 flex justify-center items-center text-gray-500">
|
||||||
|
<Loading />
|
||||||
|
<Text className="ml-2">加载中...</Text>
|
||||||
|
</View>
|
||||||
|
) : (
|
||||||
|
<CellGroup>
|
||||||
|
{staffList.map(u => (
|
||||||
|
<Cell
|
||||||
|
key={u.userId}
|
||||||
|
title={
|
||||||
|
<Text className={u.userId === staffSelectedId ? 'text-blue-600' : ''}>
|
||||||
|
{u.realName || u.nickname || u.username || `员工${u.userId}`}
|
||||||
|
</Text>
|
||||||
|
}
|
||||||
|
description={u.phone || ''}
|
||||||
|
onClick={() => setStaffSelectedId(u.userId)}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
{!staffList.length && (
|
||||||
|
<Cell title={<Text className="text-gray-500">暂无员工数据</Text>} />
|
||||||
|
)}
|
||||||
|
</CellGroup>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View className="pt-3">
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
block
|
||||||
|
disabled={assigning || !staffSelectedId}
|
||||||
|
onClick={submitAssign}
|
||||||
|
>
|
||||||
|
{assigning ? '分配中...' : `确认分配(${selectedIds.length}个)`}
|
||||||
|
</Button>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</Popup>
|
||||||
|
|
||||||
|
<Dialog
|
||||||
|
title={addStep === 'search' ? '添加客户(查重)' : '添加客户'}
|
||||||
|
visible={addDialogVisible}
|
||||||
|
confirmText={
|
||||||
|
addStep === 'search'
|
||||||
|
? (addChecking ? '查询中...' : '查询')
|
||||||
|
: (addSubmitting ? '提交中...' : '提交')
|
||||||
|
}
|
||||||
|
cancelText="取消"
|
||||||
|
onCancel={() => {
|
||||||
|
if (addChecking || addSubmitting) return
|
||||||
|
setAddDialogVisible(false)
|
||||||
|
}}
|
||||||
|
onConfirm={() => {
|
||||||
|
if (addStep === 'search') return checkCompanyExists()
|
||||||
|
return submitAddCustomer()
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<View className="text-sm text-gray-700">
|
||||||
|
<View className="text-xs text-gray-500 mb-2">
|
||||||
|
先查询系统是否存在公司;不存在则可直接添加企业信息。
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<CellGroup>
|
||||||
|
<Cell title="公司名称">
|
||||||
|
<Input value={addName} onChange={setAddName} placeholder="请输入公司名称" />
|
||||||
|
</Cell>
|
||||||
|
<Cell title="统一代码">
|
||||||
|
<Input value={addCode} onChange={setAddCode} placeholder="请输入统一代码(可选)" />
|
||||||
|
</Cell>
|
||||||
|
|
||||||
|
{addStep === 'form' && (
|
||||||
|
<>
|
||||||
|
<Cell title="电话">
|
||||||
|
<Input value={addPhone} onChange={setAddPhone} placeholder="请输入联系电话(可选)" />
|
||||||
|
</Cell>
|
||||||
|
<Cell
|
||||||
|
title="地区"
|
||||||
|
description={addCityText || '选择到城市'}
|
||||||
|
onClick={() => setAddCityVisible(true)}
|
||||||
|
/>
|
||||||
|
<Cell title="行业">
|
||||||
|
<Input value={addIndustry} onChange={setAddIndustry} placeholder="请输入行业(可选)" />
|
||||||
|
</Cell>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</CellGroup>
|
||||||
|
|
||||||
|
<Address
|
||||||
|
visible={addCityVisible}
|
||||||
|
options={cityOptions as any}
|
||||||
|
title="选择地区(到城市)"
|
||||||
|
onChange={(value: any[]) => {
|
||||||
|
const txt = value.filter(Boolean).slice(0, 2).join(' ')
|
||||||
|
setAddCityText(txt)
|
||||||
|
setAddCityVisible(false)
|
||||||
|
}}
|
||||||
|
onClose={() => setAddCityVisible(false)}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</Dialog>
|
||||||
|
</ConfigProvider>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
5
src/credit/customer/index.config.ts
Normal file
5
src/credit/customer/index.config.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '客户联系人管理',
|
||||||
|
navigationBarTextStyle: 'black',
|
||||||
|
navigationBarBackgroundColor: '#ffffff'
|
||||||
|
})
|
||||||
11
src/credit/customer/index.tsx
Normal file
11
src/credit/customer/index.tsx
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import Taro, { useDidShow } from '@tarojs/taro'
|
||||||
|
import { View, Text } from '@tarojs/components'
|
||||||
|
|
||||||
|
export default function index() {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View className="bg-gray-50 min-h-screen">
|
||||||
|
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
5
src/credit/data/index.config.ts
Normal file
5
src/credit/data/index.config.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '数据查询',
|
||||||
|
navigationBarTextStyle: 'black',
|
||||||
|
navigationBarBackgroundColor: '#ffffff'
|
||||||
|
})
|
||||||
11
src/credit/data/index.tsx
Normal file
11
src/credit/data/index.tsx
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import Taro, { useDidShow } from '@tarojs/taro'
|
||||||
|
import { View, Text } from '@tarojs/components'
|
||||||
|
|
||||||
|
export default function index() {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View className="bg-gray-50 min-h-screen">
|
||||||
|
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -5,11 +5,22 @@ import {Image} from '@nutui/nutui-react-taro'
|
|||||||
import {getCmsAdByCode} from "@/api/cms/cmsAd";
|
import {getCmsAdByCode} from "@/api/cms/cmsAd";
|
||||||
|
|
||||||
const MyPage = () => {
|
const MyPage = () => {
|
||||||
const [item, setItem] = useState<CmsAd>()
|
const [ad, setAd] = useState<CmsAd>()
|
||||||
|
|
||||||
|
const toCssSize = (value?: string | number) => {
|
||||||
|
if (value === undefined || value === null) return undefined
|
||||||
|
const s = String(value).trim()
|
||||||
|
if (!s) return undefined
|
||||||
|
// If it's a pure number, default unit is px; otherwise keep backend-provided unit (e.g. rpx/px/%).
|
||||||
|
return Number.isNaN(Number(s)) ? s : `${Number(s)}px`
|
||||||
|
}
|
||||||
|
|
||||||
|
const bannerHeight = toCssSize(ad?.height)
|
||||||
|
|
||||||
const reload = async () => {
|
const reload = async () => {
|
||||||
const flash = await getCmsAdByCode('flash')
|
const flash = await getCmsAdByCode('flash')
|
||||||
console.log(flash)
|
console.log(flash)
|
||||||
setItem(flash)
|
setAd(flash)
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -18,12 +29,22 @@ const MyPage = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Swiper defaultValue={0} height={item?.height} indicator style={{ height: item?.height + 'px' }}>
|
<Swiper defaultValue={0} height={170} indicator>
|
||||||
{item?.imageList?.map((item) => (
|
{ad?.imageList?.map((img, idx) => {
|
||||||
<Swiper.Item key={item}>
|
const url = typeof img === 'string' ? img : img?.url
|
||||||
<Image width="100%" height="100%" src={item.url} mode={'scaleToFill'} lazyLoad={false} style={{ height: item.height + 'px' }} />
|
if (!url) return null
|
||||||
|
return (
|
||||||
|
<Swiper.Item key={url || idx}>
|
||||||
|
<Image
|
||||||
|
width='100%'
|
||||||
|
height='100%'
|
||||||
|
src={url}
|
||||||
|
mode='scaleToFill'
|
||||||
|
lazyLoad={false}
|
||||||
|
/>
|
||||||
</Swiper.Item>
|
</Swiper.Item>
|
||||||
))}
|
)
|
||||||
|
})}
|
||||||
</Swiper>
|
</Swiper>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,15 +1,20 @@
|
|||||||
import Taro, {useShareAppMessage, useShareTimeline} from '@tarojs/taro'
|
import Taro, {useShareAppMessage, useShareTimeline} from '@tarojs/taro'
|
||||||
import {Image, Swiper, SwiperItem, Text, View} from '@tarojs/components'
|
import {Image, Text, View} from '@tarojs/components'
|
||||||
import {useEffect, useState} from 'react'
|
import {useEffect, useState} from 'react'
|
||||||
|
import Banner from './Banner'
|
||||||
import iconShop from '@/assets/tabbar/shop.png'
|
import iconShop from '@/assets/tabbar/shop.png'
|
||||||
import iconFind from '@/assets/tabbar/find.png'
|
import iconFind from '@/assets/tabbar/find.png'
|
||||||
import iconKefu from '@/assets/tabbar/kefu.png'
|
import iconKefu from '@/assets/tabbar/kefu.png'
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
import navTo from "@/utils/common";
|
import navTo from "@/utils/common";
|
||||||
import {pageCmsArticle} from '@/api/cms/cmsArticle'
|
import {getByCode as getArticleByCode, pageCmsArticle} from '@/api/cms/cmsArticle'
|
||||||
import type {CmsArticle} from '@/api/cms/cmsArticle/model'
|
import type {CmsArticle} from '@/api/cms/cmsArticle/model'
|
||||||
|
import {useUser} from '@/hooks/useUser'
|
||||||
|
|
||||||
function Home() {
|
function Home() {
|
||||||
|
const {isAdmin} = useUser()
|
||||||
|
const admin = isAdmin()
|
||||||
|
|
||||||
useShareTimeline(() => {
|
useShareTimeline(() => {
|
||||||
return {
|
return {
|
||||||
title: '易赊宝',
|
title: '易赊宝',
|
||||||
@@ -40,12 +45,19 @@ function Home() {
|
|||||||
Taro.showToast({title: `${textMap[type]}(示例)`, icon: 'none'})
|
Taro.showToast({title: `${textMap[type]}(示例)`, icon: 'none'})
|
||||||
}
|
}
|
||||||
|
|
||||||
const onDemand = () => {
|
|
||||||
Taro.showToast({title: '发需求(示例)', icon: 'none'})
|
|
||||||
}
|
|
||||||
|
|
||||||
const FAQ_CATEGORY_ID = 4558
|
const FAQ_CATEGORY_ID = 4558
|
||||||
const [faqList, setFaqList] = useState<CmsArticle[]>([])
|
const [faqList, setFaqList] = useState<CmsArticle[]>([])
|
||||||
|
const [aboutArticle, setAboutArticle] = useState<CmsArticle | null>(null)
|
||||||
|
|
||||||
|
const loadAbout = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getArticleByCode('about')
|
||||||
|
setAboutArticle(res || null)
|
||||||
|
} catch (e) {
|
||||||
|
console.error('loadAbout error:', e)
|
||||||
|
setAboutArticle(null)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const loadFaq = async () => {
|
const loadFaq = async () => {
|
||||||
try {
|
try {
|
||||||
@@ -65,40 +77,25 @@ function Home() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
loadFaq().then()
|
loadFaq().then()
|
||||||
|
loadAbout().then()
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
const aboutText =
|
||||||
|
(aboutArticle?.comments || '')
|
||||||
|
.replace(/<[^>]*>/g, '')
|
||||||
|
.replace(/ | /g, ' ')
|
||||||
|
.trim() ||
|
||||||
|
'易赊宝是提供专业回款咨询服务的小程序!我们重视企业需求,加速回款咨询服务能力助力企业资金流动畅通循环,服务团队全国覆盖。'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className='home'>
|
<View className='home'>
|
||||||
<View className='bannerCard'>
|
<View className='bannerCard'>
|
||||||
<Swiper
|
{/* 顶部活动主视觉:使用 Banner 组件 */}
|
||||||
className='bannerSwiper'
|
<Banner />
|
||||||
circular
|
|
||||||
autoplay
|
|
||||||
interval={3500}
|
|
||||||
duration={400}
|
|
||||||
indicatorDots
|
|
||||||
indicatorColor='rgba(255,255,255,0.55)'
|
|
||||||
indicatorActiveColor='#ffffff'
|
|
||||||
>
|
|
||||||
<SwiperItem>
|
|
||||||
<View className='bannerSlide bannerSlide1'>
|
|
||||||
<View className='bannerLogo'>
|
|
||||||
<Text className='bannerLogoText'>易赊宝</Text>
|
|
||||||
</View>
|
|
||||||
<Text className='bannerSlogan'>咨询加速回款,助力经济循环</Text>
|
|
||||||
</View>
|
|
||||||
</SwiperItem>
|
|
||||||
<SwiperItem>
|
|
||||||
<View className='bannerSlide bannerSlide2'>
|
|
||||||
<View className='bannerLogo'>
|
|
||||||
<Text className='bannerLogoText'>易赊宝</Text>
|
|
||||||
</View>
|
|
||||||
<Text className='bannerSlogan'>专业回款咨询服务,团队全国覆盖</Text>
|
|
||||||
</View>
|
|
||||||
</SwiperItem>
|
|
||||||
</Swiper>
|
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
{!admin && (
|
||||||
<View className='actionCard'>
|
<View className='actionCard'>
|
||||||
<View className='actionRow'>
|
<View className='actionRow'>
|
||||||
<View className='actionItem' onClick={() => onAction('progress')}>
|
<View className='actionItem' onClick={() => onAction('progress')}>
|
||||||
@@ -123,28 +120,60 @@ function Home() {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
<View className='sectionCard'>
|
<View className='sectionCard'>
|
||||||
<View className='sectionHeader'>
|
<View className='sectionHeader'>
|
||||||
<View className='sectionAccent' />
|
<View className='sectionAccent' />
|
||||||
<Text className='sectionTitle'>简介</Text>
|
<Text className='sectionTitle'>简介</Text>
|
||||||
<Text className='sectionMore'>更多</Text>
|
<Text
|
||||||
|
className='sectionMore'
|
||||||
|
onClick={() => {
|
||||||
|
if (aboutArticle?.articleId) {
|
||||||
|
navTo(`/cms/detail/index?id=${aboutArticle.articleId}`)
|
||||||
|
} else {
|
||||||
|
Taro.showToast({title: '暂无简介内容', icon: 'none'})
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
更多
|
||||||
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View className='introBox'>
|
<View className='introBox'>
|
||||||
<Text className='introText'>
|
<Text className='introText'>
|
||||||
易赊宝是提供专业回款咨询服务的小程序!我们重视企业需求,加速回款咨询服务能力助力企业资金流动畅通循环,服务团队全国覆盖。
|
{aboutText}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
{admin && (
|
||||||
|
<View className='ctaWrap gap-2'>
|
||||||
|
<View className='ctaBtn' onClick={() => navTo('/credit/company/index', true)}>
|
||||||
|
<Text className='ctaBtnText'>客户管理</Text>
|
||||||
|
</View>
|
||||||
|
<View className='ctaBtn' onClick={() => navTo('/credit/order/index', true)}>
|
||||||
|
<Text className='ctaBtnText'>订单管理</Text>
|
||||||
|
</View>
|
||||||
|
<View className='ctaBtn' onClick={() => navTo('/credit/data/index', true)}>
|
||||||
|
<Text className='ctaBtnText'>数据查询</Text>
|
||||||
|
</View>
|
||||||
|
<View className='ctaBtn' onClick={() => navTo('/credit/customer/index', true)}>
|
||||||
|
<Text className='ctaBtnText'>客户联系人管理</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{!admin && (
|
||||||
<View className='ctaWrap'>
|
<View className='ctaWrap'>
|
||||||
<View className='ctaBtn' onClick={() => navTo('/credit/order/add', true)}>
|
<View className='ctaBtn' onClick={() => navTo('/credit/order/add', true)}>
|
||||||
<Text className='ctaBtnText'>发需求</Text>
|
<Text className='ctaBtnText'>发需求</Text>
|
||||||
</View>
|
</View>
|
||||||
<Text className='ctaHint'>提出您的述求,免费获取解决方案</Text>
|
<Text className='ctaHint'>提出您的述求,免费获取解决方案</Text>
|
||||||
</View>
|
</View>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
{!admin && (
|
||||||
<View className='sectionCard'>
|
<View className='sectionCard'>
|
||||||
<View className='sectionHeader'>
|
<View className='sectionHeader'>
|
||||||
<View className='sectionAccent' />
|
<View className='sectionAccent' />
|
||||||
@@ -177,6 +206,8 @@ function Home() {
|
|||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
|
||||||
<View className='bottomSpacer' />
|
<View className='bottomSpacer' />
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
import {useEffect, useRef, useState} from 'react'
|
import {useEffect, useRef, useState} from 'react'
|
||||||
import {PullToRefresh} from '@nutui/nutui-react-taro'
|
import {PullToRefresh} from '@nutui/nutui-react-taro'
|
||||||
import UserCard from "./components/UserCard";
|
import UserCard from "./components/UserCard";
|
||||||
import UserOrder from "./components/UserOrder";
|
|
||||||
import UserFooter from "./components/UserFooter";
|
import UserFooter from "./components/UserFooter";
|
||||||
import {View} from '@tarojs/components';
|
import {View} from '@tarojs/components';
|
||||||
import './user.scss'
|
import './user.scss'
|
||||||
import IsDealer from "./components/IsDealer";
|
|
||||||
import {useThemeStyles} from "@/hooks/useTheme";
|
import {useThemeStyles} from "@/hooks/useTheme";
|
||||||
import UserGrid from "@/pages/user/components/UserGrid";
|
import UserGrid from "@/pages/user/components/UserGrid";
|
||||||
import { useDidShow } from '@tarojs/taro'
|
import { useDidShow } from '@tarojs/taro'
|
||||||
|
|||||||
Reference in New Issue
Block a user