Compare commits
15 Commits
66cd1dbf11
...
9d5896dc86
| Author | SHA1 | Date | |
|---|---|---|---|
| 9d5896dc86 | |||
| 268f8994ca | |||
| f9c94a0590 | |||
| ecd571c60b | |||
| ebdc9b5933 | |||
| f87103119a | |||
| 3c8ede258c | |||
| 5872043040 | |||
| 958cbc4d20 | |||
| 2962689f2f | |||
| b15d0010ad | |||
| cea60d96d7 | |||
| e82a4ce865 | |||
| 5c783c2f51 | |||
| 89d359b40e |
@@ -1,5 +1,5 @@
|
|||||||
VITE_APP_NAME=后台管理(开发环境)
|
VITE_APP_NAME=后台管理(开发环境)
|
||||||
#VITE_API_URL=http://127.0.0.1:9200/api
|
VITE_API_URL=http://127.0.0.1:9200/api
|
||||||
#VITE_SERVER_API_URL=http://127.0.0.1:8000/api
|
#VITE_SERVER_API_URL=http://127.0.0.1:8000/api
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
126
src/api/credit/creditBreachOfTrust/index.ts
Normal file
126
src/api/credit/creditBreachOfTrust/index.ts
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
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));
|
||||||
|
}
|
||||||
55
src/api/credit/creditBreachOfTrust/model/index.ts
Normal file
55
src/api/credit/creditBreachOfTrust/model/index.ts
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失信被执行人
|
||||||
|
*/
|
||||||
|
export interface CreditBreachOfTrust {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 数据类型
|
||||||
|
dataType?: string;
|
||||||
|
// 原告/上诉人
|
||||||
|
plaintiffAppellant?: string;
|
||||||
|
// 被告/被上诉人
|
||||||
|
appellee?: 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 {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
126
src/api/credit/creditCaseFiling/index.ts
Normal file
126
src/api/credit/creditCaseFiling/index.ts
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
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));
|
||||||
|
}
|
||||||
55
src/api/credit/creditCaseFiling/model/index.ts
Normal file
55
src/api/credit/creditCaseFiling/model/index.ts
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司法大数据
|
||||||
|
*/
|
||||||
|
export interface CreditCaseFiling {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 数据类型
|
||||||
|
dataType?: string;
|
||||||
|
// 原告/上诉人
|
||||||
|
plaintiffAppellant?: string;
|
||||||
|
// 被告/被上诉人
|
||||||
|
appellee?: 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 {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
142
src/api/credit/creditCompany/index.ts
Normal file
142
src/api/credit/creditCompany/index.ts
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
|
import type { CreditCompany, CreditCompanyParam } from './model';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询企业
|
||||||
|
*/
|
||||||
|
export async function pageCreditCompany(params: CreditCompanyParam) {
|
||||||
|
const res = await request.get<ApiResult<PageResult<CreditCompany>>>(
|
||||||
|
'/credit/credit-company/page',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询企业列表
|
||||||
|
*/
|
||||||
|
export async function listCreditCompany(params?: CreditCompanyParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditCompany[]>>(
|
||||||
|
'/credit/credit-company',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加企业
|
||||||
|
*/
|
||||||
|
export async function addCreditCompany(data: CreditCompany) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-company',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改企业
|
||||||
|
*/
|
||||||
|
export async function updateCreditCompany(data: CreditCompany) {
|
||||||
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-company',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除企业
|
||||||
|
*/
|
||||||
|
export async function removeCreditCompany(id?: number) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-company/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除企业
|
||||||
|
*/
|
||||||
|
export async function removeBatchCreditCompany(data: (number | undefined)[]) {
|
||||||
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-company/batch',
|
||||||
|
{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询企业
|
||||||
|
*/
|
||||||
|
export async function getCreditCompany(id: number) {
|
||||||
|
const res = await request.get<ApiResult<CreditCompany>>(
|
||||||
|
'/credit/credit-company/' + id
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入企业
|
||||||
|
*/
|
||||||
|
export async function importCreditCompany(file: File) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
'/credit/credit-company/import',
|
||||||
|
formData,
|
||||||
|
{
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'multipart/form-data'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.message;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据企业匹配名称查询关联信息
|
||||||
|
*/
|
||||||
|
export async function getCompanyRelatedInfo(params: CreditCompanyParam) {
|
||||||
|
const res = await request.get<ApiResult<CreditCompany>>(
|
||||||
|
'/credit/credit-company/related',
|
||||||
|
{
|
||||||
|
params
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (res.data.code === 0 && res.data.data) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
135
src/api/credit/creditCompany/model/index.ts
Normal file
135
src/api/credit/creditCompany/model/index.ts
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业
|
||||||
|
*/
|
||||||
|
export interface CreditCompany {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 原文件导入名称
|
||||||
|
name?: string;
|
||||||
|
// 系统匹配企业名称
|
||||||
|
matchName?: string;
|
||||||
|
// 统一社会信用代码
|
||||||
|
code?: string;
|
||||||
|
// 类型
|
||||||
|
type?: number;
|
||||||
|
// 上级id, 0是顶级
|
||||||
|
parentId?: number;
|
||||||
|
// 登记状态
|
||||||
|
registrationStatus?: string;
|
||||||
|
// 法定代表人
|
||||||
|
legalPerson?: string;
|
||||||
|
// 注册资本
|
||||||
|
registeredCapital?: string;
|
||||||
|
// 实缴资本
|
||||||
|
paidinCapital?: string;
|
||||||
|
// 成立日期
|
||||||
|
establishDate?: string;
|
||||||
|
// 企业地址
|
||||||
|
address?: string;
|
||||||
|
// 电话
|
||||||
|
tel?: string;
|
||||||
|
// 更多电话
|
||||||
|
moreTel?: string;
|
||||||
|
// 邮箱
|
||||||
|
email?: string;
|
||||||
|
// 更多邮箱
|
||||||
|
moreEmail?: string;
|
||||||
|
// 所在国家
|
||||||
|
country?: string;
|
||||||
|
// 所属省份
|
||||||
|
province?: string;
|
||||||
|
// 所属城市
|
||||||
|
city?: string;
|
||||||
|
// 所属区县
|
||||||
|
region?: string;
|
||||||
|
// 企业(机构)类型
|
||||||
|
institutionType?: string;
|
||||||
|
// 纳税人识别号
|
||||||
|
taxpayerCode?: string;
|
||||||
|
// 注册号
|
||||||
|
registrationNumber?: string;
|
||||||
|
// 组织机构代码
|
||||||
|
organizationalCode?: string;
|
||||||
|
// 参保人数
|
||||||
|
numberOfInsuredPersons?: string;
|
||||||
|
// 参保人数所属年报
|
||||||
|
annualReport?: string;
|
||||||
|
// 营业期限
|
||||||
|
businessTerm?: string;
|
||||||
|
// 国标行业门类
|
||||||
|
nationalStandardIndustryCategories?: string;
|
||||||
|
// 国标行业大类
|
||||||
|
nationalStandardIndustryCategories2?: string;
|
||||||
|
// 国标行业中类
|
||||||
|
nationalStandardIndustryCategories3?: string;
|
||||||
|
// 国标行业小类
|
||||||
|
nationalStandardIndustryCategories4?: string;
|
||||||
|
// 企查查行业门类
|
||||||
|
nationalStandardIndustryCategories5?: string;
|
||||||
|
// 企查查行业大类
|
||||||
|
nationalStandardIndustryCategories6?: string;
|
||||||
|
// 企查查行业中类
|
||||||
|
nationalStandardIndustryCategories7?: string;
|
||||||
|
// 企查查行业小类
|
||||||
|
nationalStandardIndustryCategories8?: string;
|
||||||
|
// 企业规模
|
||||||
|
companySize?: string;
|
||||||
|
// 曾用名
|
||||||
|
formerName?: string;
|
||||||
|
// 英文名
|
||||||
|
englishName?: string;
|
||||||
|
// 官网
|
||||||
|
domain?: string;
|
||||||
|
// 通信地址
|
||||||
|
mailingAddress?: string;
|
||||||
|
// 企业简介
|
||||||
|
companyProfile?: string;
|
||||||
|
// 经营范围
|
||||||
|
natureOfBusiness?: string;
|
||||||
|
// 登记机关
|
||||||
|
registrationAuthority?: string;
|
||||||
|
// 纳税人资质
|
||||||
|
taxpayerQualification?: string;
|
||||||
|
// 最新年报年份
|
||||||
|
latestAnnualReportYear?: string;
|
||||||
|
// 最新年报营业收入
|
||||||
|
latestAnnualReportOnOperatingRevenue?: string;
|
||||||
|
// 企查分
|
||||||
|
enterpriseScoreCheck?: string;
|
||||||
|
// 信用等级
|
||||||
|
creditRating?: string;
|
||||||
|
// 科创分
|
||||||
|
cechnologyScore?: string;
|
||||||
|
// 科创等级
|
||||||
|
cechnologyLevel?: string;
|
||||||
|
// 是否小微企业
|
||||||
|
smallEnterprise?: string;
|
||||||
|
// 备注
|
||||||
|
comments?: string;
|
||||||
|
// 是否推荐
|
||||||
|
recommend?: number;
|
||||||
|
// 排序(数字越小越靠前)
|
||||||
|
sortNumber?: number;
|
||||||
|
// 状态, 0正常, 1冻结
|
||||||
|
status?: number;
|
||||||
|
// 是否删除, 0否, 1是
|
||||||
|
deleted?: number;
|
||||||
|
// 用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业搜索条件
|
||||||
|
*/
|
||||||
|
export interface CreditCompanyParam extends PageParam {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
126
src/api/credit/creditCompetitor/index.ts
Normal file
126
src/api/credit/creditCompetitor/index.ts
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
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));
|
||||||
|
}
|
||||||
49
src/api/credit/creditCompetitor/model/index.ts
Normal file
49
src/api/credit/creditCompetitor/model/index.ts
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 竞争对手
|
||||||
|
*/
|
||||||
|
export interface CreditCompetitor {
|
||||||
|
// 序号
|
||||||
|
id?: number;
|
||||||
|
// 企业名称
|
||||||
|
companyName?: string;
|
||||||
|
// 法定代表人
|
||||||
|
legalRepresentative?: string;
|
||||||
|
// 注册资本
|
||||||
|
registeredCapital?: string;
|
||||||
|
// 成立日期
|
||||||
|
establishmentDate?: string;
|
||||||
|
// 登记状态
|
||||||
|
registrationStatus?: string;
|
||||||
|
// 所属行业
|
||||||
|
industry?: string;
|
||||||
|
// 所属省份
|
||||||
|
province?: 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 {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
126
src/api/credit/creditCourtAnnouncement/index.ts
Normal file
126
src/api/credit/creditCourtAnnouncement/index.ts
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
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));
|
||||||
|
}
|
||||||
56
src/api/credit/creditCourtAnnouncement/model/index.ts
Normal file
56
src/api/credit/creditCourtAnnouncement/model/index.ts
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 法院公告司法大数据
|
||||||
|
*/
|
||||||
|
export interface CreditCourtAnnouncement {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 数据类型
|
||||||
|
dataType?: string;
|
||||||
|
// 原告/上诉人
|
||||||
|
plaintiffAppellant?: string;
|
||||||
|
@TableField("defendant Appellee")
|
||||||
|
// 被告/被上诉人
|
||||||
|
defendant appellee?: 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 {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
126
src/api/credit/creditCourtSession/index.ts
Normal file
126
src/api/credit/creditCourtSession/index.ts
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
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));
|
||||||
|
}
|
||||||
55
src/api/credit/creditCourtSession/model/index.ts
Normal file
55
src/api/credit/creditCourtSession/model/index.ts
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开庭公告司法大数据
|
||||||
|
*/
|
||||||
|
export interface CreditCourtSession {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 数据类型
|
||||||
|
dataType?: string;
|
||||||
|
// 原告/上诉人
|
||||||
|
plaintiffAppellant?: string;
|
||||||
|
// 被告/被上诉人
|
||||||
|
appellee?: 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 CreditCourtSessionParam extends PageParam {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
126
src/api/credit/creditCustomer/index.ts
Normal file
126
src/api/credit/creditCustomer/index.ts
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
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));
|
||||||
|
}
|
||||||
45
src/api/credit/creditCustomer/model/index.ts
Normal file
45
src/api/credit/creditCustomer/model/index.ts
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户
|
||||||
|
*/
|
||||||
|
export interface CreditCustomer {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 客户
|
||||||
|
name?: string;
|
||||||
|
// 状态
|
||||||
|
statusTxt?: string;
|
||||||
|
// 销售金额(万元)
|
||||||
|
price?: string;
|
||||||
|
// 公开日期
|
||||||
|
publicDate?: string;
|
||||||
|
// 数据来源
|
||||||
|
dataSource?: 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 {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
126
src/api/credit/creditDeliveryNotice/index.ts
Normal file
126
src/api/credit/creditDeliveryNotice/index.ts
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
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));
|
||||||
|
}
|
||||||
55
src/api/credit/creditDeliveryNotice/model/index.ts
Normal file
55
src/api/credit/creditDeliveryNotice/model/index.ts
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
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;
|
||||||
|
// 备注
|
||||||
|
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 {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
126
src/api/credit/creditExternal/index.ts
Normal file
126
src/api/credit/creditExternal/index.ts
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
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));
|
||||||
|
}
|
||||||
63
src/api/credit/creditExternal/model/index.ts
Normal file
63
src/api/credit/creditExternal/model/index.ts
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
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;
|
||||||
|
// 备注
|
||||||
|
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 {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
126
src/api/credit/creditFinalVersion/index.ts
Normal file
126
src/api/credit/creditFinalVersion/index.ts
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
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));
|
||||||
|
}
|
||||||
55
src/api/credit/creditFinalVersion/model/index.ts
Normal file
55
src/api/credit/creditFinalVersion/model/index.ts
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终本案件
|
||||||
|
*/
|
||||||
|
export interface CreditFinalVersion {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 数据类型
|
||||||
|
dataType?: string;
|
||||||
|
// 原告/上诉人
|
||||||
|
plaintiffAppellant?: string;
|
||||||
|
// 被告/被上诉人
|
||||||
|
appellee?: 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 CreditFinalVersionParam extends PageParam {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
126
src/api/credit/creditGqdj/index.ts
Normal file
126
src/api/credit/creditGqdj/index.ts
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
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));
|
||||||
|
}
|
||||||
55
src/api/credit/creditGqdj/model/index.ts
Normal file
55
src/api/credit/creditGqdj/model/index.ts
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 股权冻结
|
||||||
|
*/
|
||||||
|
export interface CreditGqdj {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 数据类型
|
||||||
|
dataType?: string;
|
||||||
|
// 原告/上诉人
|
||||||
|
plaintiffAppellant?: string;
|
||||||
|
// 被告/被上诉人
|
||||||
|
appellee?: 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 CreditGqdjParam extends PageParam {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
126
src/api/credit/creditJudgmentDebtor/index.ts
Normal file
126
src/api/credit/creditJudgmentDebtor/index.ts
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
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));
|
||||||
|
}
|
||||||
49
src/api/credit/creditJudgmentDebtor/model/index.ts
Normal file
49
src/api/credit/creditJudgmentDebtor/model/index.ts
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 被执行人
|
||||||
|
*/
|
||||||
|
export interface CreditJudgmentDebtor {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 案号
|
||||||
|
caseNumber?: string;
|
||||||
|
// 被执行人名称
|
||||||
|
name?: string;
|
||||||
|
// 证件号/组织机构代码
|
||||||
|
code?: 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;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 被执行人搜索条件
|
||||||
|
*/
|
||||||
|
export interface CreditJudgmentDebtorParam extends PageParam {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
126
src/api/credit/creditJudicialDocument/index.ts
Normal file
126
src/api/credit/creditJudicialDocument/index.ts
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
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));
|
||||||
|
}
|
||||||
55
src/api/credit/creditJudicialDocument/model/index.ts
Normal file
55
src/api/credit/creditJudicialDocument/model/index.ts
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 裁判文书司法大数据
|
||||||
|
*/
|
||||||
|
export interface CreditJudicialDocument {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 数据类型
|
||||||
|
dataType?: string;
|
||||||
|
// 原告/上诉人
|
||||||
|
plaintiffAppellant?: string;
|
||||||
|
// 被告/被上诉人
|
||||||
|
appellee?: 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 CreditJudicialDocumentParam extends PageParam {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
126
src/api/credit/creditJudiciary/index.ts
Normal file
126
src/api/credit/creditJudiciary/index.ts
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
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));
|
||||||
|
}
|
||||||
69
src/api/credit/creditJudiciary/model/index.ts
Normal file
69
src/api/credit/creditJudiciary/model/index.ts
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司法案件
|
||||||
|
*/
|
||||||
|
export interface CreditJudiciary {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 案件名称
|
||||||
|
name?: string;
|
||||||
|
// 案号
|
||||||
|
code?: 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 {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
126
src/api/credit/creditMediation/index.ts
Normal file
126
src/api/credit/creditMediation/index.ts
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
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));
|
||||||
|
}
|
||||||
55
src/api/credit/creditMediation/model/index.ts
Normal file
55
src/api/credit/creditMediation/model/index.ts
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 诉前调解司法大数据
|
||||||
|
*/
|
||||||
|
export interface CreditMediation {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 数据类型
|
||||||
|
dataType?: string;
|
||||||
|
// 原告/上诉人
|
||||||
|
plaintiffAppellant?: string;
|
||||||
|
// 被告/被上诉人
|
||||||
|
appellee?: 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 {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
126
src/api/credit/creditProject/index.ts
Normal file
126
src/api/credit/creditProject/index.ts
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
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));
|
||||||
|
}
|
||||||
67
src/api/credit/creditProject/model/index.ts
Normal file
67
src/api/credit/creditProject/model/index.ts
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 招投标
|
||||||
|
*/
|
||||||
|
export interface CreditProject {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 项目名称
|
||||||
|
name?: string;
|
||||||
|
// 唯一标识
|
||||||
|
code?: 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 {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
126
src/api/credit/creditRiskRelation/index.ts
Normal file
126
src/api/credit/creditRiskRelation/index.ts
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
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));
|
||||||
|
}
|
||||||
47
src/api/credit/creditRiskRelation/model/index.ts
Normal file
47
src/api/credit/creditRiskRelation/model/index.ts
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 风险关系表
|
||||||
|
*/
|
||||||
|
export interface CreditRiskRelation {
|
||||||
|
// 序号
|
||||||
|
id?: number;
|
||||||
|
// 主体名称
|
||||||
|
mainBodyName?: string;
|
||||||
|
// 登记状态
|
||||||
|
registrationStatus?: string;
|
||||||
|
// 注册资本
|
||||||
|
registeredCapital?: string;
|
||||||
|
// 省份地区
|
||||||
|
provinceRegion?: string;
|
||||||
|
// 关联关系
|
||||||
|
associatedRelation?: string;
|
||||||
|
// 风险关系
|
||||||
|
riskRelation?: 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 {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
126
src/api/credit/creditSupplier/index.ts
Normal file
126
src/api/credit/creditSupplier/index.ts
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
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));
|
||||||
|
}
|
||||||
45
src/api/credit/creditSupplier/model/index.ts
Normal file
45
src/api/credit/creditSupplier/model/index.ts
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 供应商
|
||||||
|
*/
|
||||||
|
export interface CreditSupplier {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 供应商
|
||||||
|
supplier?: string;
|
||||||
|
// 状态
|
||||||
|
statusTxt?: string;
|
||||||
|
// 采购金额(万元)
|
||||||
|
purchaseAmount?: string;
|
||||||
|
// 公开日期
|
||||||
|
publicDate?: string;
|
||||||
|
// 数据来源
|
||||||
|
dataSource?: 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 {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
126
src/api/credit/creditUser/index.ts
Normal file
126
src/api/credit/creditUser/index.ts
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
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));
|
||||||
|
}
|
||||||
67
src/api/credit/creditUser/model/index.ts
Normal file
67
src/api/credit/creditUser/model/index.ts
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 招投标信息表
|
||||||
|
*/
|
||||||
|
export interface CreditUser {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 客户名称
|
||||||
|
name?: string;
|
||||||
|
// 唯一标识
|
||||||
|
code?: 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 {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
126
src/api/credit/creditXgxf/index.ts
Normal file
126
src/api/credit/creditXgxf/index.ts
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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
|
||||||
|
}
|
||||||
|
);
|
||||||
|
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) {
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append('file', file);
|
||||||
|
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));
|
||||||
|
}
|
||||||
55
src/api/credit/creditXgxf/model/index.ts
Normal file
55
src/api/credit/creditXgxf/model/index.ts
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 限制高消费
|
||||||
|
*/
|
||||||
|
export interface CreditXgxf {
|
||||||
|
// ID
|
||||||
|
id?: number;
|
||||||
|
// 数据类型
|
||||||
|
dataType?: string;
|
||||||
|
// 原告/上诉人
|
||||||
|
plaintiffAppellant?: string;
|
||||||
|
// 被告/被上诉人
|
||||||
|
appellee?: 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 {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
27
src/api/led/index.ts
Normal file
27
src/api/led/index.ts
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
import type { ApiResult } from '@/api';
|
||||||
|
import { MODULES_API_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
export async function stopReplace(data: any) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/led/bme/stop-replace',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
const data = res.data.data;
|
||||||
|
return data || [];
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function numberReplace(data: any) {
|
||||||
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
|
MODULES_API_URL + '/led/bme/number-sources',
|
||||||
|
data
|
||||||
|
);
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
const data = res.data.data;
|
||||||
|
return data || [];
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
45
src/api/led/model/index.ts
Normal file
45
src/api/led/model/index.ts
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
import type { PageParam } from '@/api';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 黄家明_报险记录
|
||||||
|
*/
|
||||||
|
export interface HjmBxLog {
|
||||||
|
// 自增ID
|
||||||
|
id?: number;
|
||||||
|
// 用户ID
|
||||||
|
userId?: number;
|
||||||
|
// 车辆ID
|
||||||
|
carId?: number;
|
||||||
|
// 车牌号
|
||||||
|
carNo?: string;
|
||||||
|
// 操作员
|
||||||
|
realName?: string;
|
||||||
|
// 事故类型
|
||||||
|
accidentType?: string;
|
||||||
|
// 部门
|
||||||
|
parentOrganization?: string;
|
||||||
|
// 保险图片
|
||||||
|
image?: string;
|
||||||
|
// 排序(数字越小越靠前)
|
||||||
|
sortNumber?: number;
|
||||||
|
// 备注
|
||||||
|
comments?: string;
|
||||||
|
// 状态, 0正常, 1冻结
|
||||||
|
status?: number;
|
||||||
|
// 是否删除, 0否, 1是
|
||||||
|
deleted?: number;
|
||||||
|
// 租户id
|
||||||
|
tenantId?: number;
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string;
|
||||||
|
// 修改时间
|
||||||
|
updateTime?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 黄家明_报险记录搜索条件
|
||||||
|
*/
|
||||||
|
export interface HjmBxLogParam extends PageParam {
|
||||||
|
id?: number;
|
||||||
|
keywords?: string;
|
||||||
|
}
|
||||||
@@ -55,6 +55,11 @@ export const routes = [
|
|||||||
component: () => import('@/views/passport/merchant/success.vue'),
|
component: () => import('@/views/passport/merchant/success.vue'),
|
||||||
meta: { title: '申请提交成功' }
|
meta: { title: '申请提交成功' }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/led',
|
||||||
|
component: () => import('@/views/led/index.vue'),
|
||||||
|
meta: { title: '医生出诊信息表' }
|
||||||
|
},
|
||||||
// {
|
// {
|
||||||
// path: '/forget',
|
// path: '/forget',
|
||||||
// component: () => import('@/views/passport/forget/index.vue'),
|
// component: () => import('@/views/passport/forget/index.vue'),
|
||||||
|
|||||||
103
src/views/credit/components/CreditImportModal.vue
Normal file
103
src/views/credit/components/CreditImportModal.vue
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
<!-- 通用导入弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="520"
|
||||||
|
:footer="null"
|
||||||
|
:title="title"
|
||||||
|
:visible="visible"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
>
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<a-upload-dragger
|
||||||
|
accept=".xls,.xlsx"
|
||||||
|
:show-upload-list="false"
|
||||||
|
:customRequest="doUpload"
|
||||||
|
style="padding: 24px 0; margin-bottom: 16px"
|
||||||
|
>
|
||||||
|
<p class="ant-upload-drag-icon">
|
||||||
|
<cloud-upload-outlined />
|
||||||
|
</p>
|
||||||
|
<p class="ant-upload-hint">将文件拖到此处,或点击上传</p>
|
||||||
|
</a-upload-dragger>
|
||||||
|
</a-spin>
|
||||||
|
<div class="ele-text-center">
|
||||||
|
<span>只能上传xls、xlsx文件,</span>
|
||||||
|
<a :href="templateUrl" :download="templateName"> 下载导入模板 </a>
|
||||||
|
</div>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { message } from 'ant-design-vue/es';
|
||||||
|
import { CloudUploadOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { API_BASE_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
visible: boolean;
|
||||||
|
title: string;
|
||||||
|
templatePath: string;
|
||||||
|
templateName?: string;
|
||||||
|
importRequest: (file: File) => Promise<string>;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 导入请求状态
|
||||||
|
const loading = ref(false);
|
||||||
|
|
||||||
|
// 模板下载地址,保持与当前接口域名一致
|
||||||
|
const templateUrl = computed(() => {
|
||||||
|
const base = (localStorage.getItem('ApiUrl') || API_BASE_URL || '').replace(
|
||||||
|
/\/$/,
|
||||||
|
''
|
||||||
|
);
|
||||||
|
const path = props.templatePath.startsWith('/')
|
||||||
|
? props.templatePath
|
||||||
|
: `/${props.templatePath}`;
|
||||||
|
return `${base}${path}`;
|
||||||
|
});
|
||||||
|
|
||||||
|
const templateName = computed(
|
||||||
|
() => props.templateName || '导入模板.xlsx'
|
||||||
|
);
|
||||||
|
|
||||||
|
/* 上传 */
|
||||||
|
const doUpload = ({ file }) => {
|
||||||
|
if (
|
||||||
|
![
|
||||||
|
'application/vnd.ms-excel',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
].includes(file.type)
|
||||||
|
) {
|
||||||
|
message.error('只能选择 excel 文件');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (file.size / 1024 / 1024 > 10) {
|
||||||
|
message.error('大小不能超过 10MB');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
loading.value = true;
|
||||||
|
props
|
||||||
|
.importRequest(file)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 更新 visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
98
src/views/credit/components/CreditSearchToolbar.vue
Normal file
98
src/views/credit/components/CreditSearchToolbar.vue
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
<!-- 信用模块通用工具栏 -->
|
||||||
|
<template>
|
||||||
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
|
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||||
|
<template #icon>
|
||||||
|
<PlusOutlined />
|
||||||
|
</template>
|
||||||
|
<span>添加</span>
|
||||||
|
</a-button>
|
||||||
|
<a-button class="ele-btn-icon" @click="openImport">
|
||||||
|
<template #icon>
|
||||||
|
<CloudUploadOutlined />
|
||||||
|
</template>
|
||||||
|
<span>导入</span>
|
||||||
|
</a-button>
|
||||||
|
<a-button class="ele-btn-icon" @click="exportData">
|
||||||
|
<template #icon>
|
||||||
|
<CloudDownloadOutlined />
|
||||||
|
</template>
|
||||||
|
<span>导出</span>
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
danger
|
||||||
|
class="ele-btn-icon"
|
||||||
|
:disabled="!selection?.length"
|
||||||
|
@click="remove"
|
||||||
|
>
|
||||||
|
<template #icon>
|
||||||
|
<DeleteOutlined />
|
||||||
|
</template>
|
||||||
|
<span>批量删除</span>
|
||||||
|
</a-button>
|
||||||
|
<a-input-search
|
||||||
|
allow-clear
|
||||||
|
v-model:value="keywords"
|
||||||
|
placeholder="请输入关键词"
|
||||||
|
style="width: 220px"
|
||||||
|
@search="handleSearch"
|
||||||
|
@pressEnter="handleSearch"
|
||||||
|
/>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import {
|
||||||
|
PlusOutlined,
|
||||||
|
CloudUploadOutlined,
|
||||||
|
CloudDownloadOutlined,
|
||||||
|
DeleteOutlined
|
||||||
|
} from '@ant-design/icons-vue';
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
selection?: any[];
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
|
selection: () => []
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'search', where?: { keywords?: string }): void;
|
||||||
|
(e: 'add'): void;
|
||||||
|
(e: 'remove'): void;
|
||||||
|
(e: 'batchMove'): void;
|
||||||
|
(e: 'importData'): void;
|
||||||
|
(e: 'exportData'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const keywords = ref('');
|
||||||
|
const selection = computed(() => props.selection || []);
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
const add = () => {
|
||||||
|
emit('add');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 搜索
|
||||||
|
const handleSearch = () => {
|
||||||
|
emit('search', { keywords: keywords.value });
|
||||||
|
};
|
||||||
|
|
||||||
|
// 导入
|
||||||
|
const openImport = () => {
|
||||||
|
emit('importData');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 导出
|
||||||
|
const exportData = () => {
|
||||||
|
emit('exportData');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 批量删除
|
||||||
|
const remove = () => {
|
||||||
|
emit('remove');
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
<!-- 失信被执行人导入弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="520"
|
||||||
|
:footer="null"
|
||||||
|
title="失信被执行人批量导入"
|
||||||
|
:visible="visible"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
>
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<a-upload-dragger
|
||||||
|
accept=".xls,.xlsx"
|
||||||
|
:show-upload-list="false"
|
||||||
|
:customRequest="doUpload"
|
||||||
|
style="padding: 24px 0; margin-bottom: 16px"
|
||||||
|
>
|
||||||
|
<p class="ant-upload-drag-icon">
|
||||||
|
<cloud-upload-outlined />
|
||||||
|
</p>
|
||||||
|
<p class="ant-upload-hint">将文件拖到此处,或点击上传</p>
|
||||||
|
</a-upload-dragger>
|
||||||
|
</a-spin>
|
||||||
|
<div class="ele-text-center">
|
||||||
|
<span>只能上传xls、xlsx文件,</span>
|
||||||
|
<a :href="templateUrl" download="失信被执行人导入模板.xlsx">
|
||||||
|
下载导入模板
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { message } from 'ant-design-vue/es';
|
||||||
|
import { CloudUploadOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { importCreditBreachOfTrust } from '@/api/credit/creditBreachOfTrust';
|
||||||
|
import { API_BASE_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
// 是否打开弹窗
|
||||||
|
visible: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 导入请求状态
|
||||||
|
const loading = ref(false);
|
||||||
|
|
||||||
|
// 模板下载地址,保持与当前接口域名一致
|
||||||
|
const templateUrl = computed(() => {
|
||||||
|
const base = (localStorage.getItem('ApiUrl') || API_BASE_URL || '').replace(
|
||||||
|
/\/$/,
|
||||||
|
''
|
||||||
|
);
|
||||||
|
return `${base}/credit/credit-breach-of-trust/import/template`;
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 上传 */
|
||||||
|
const doUpload = ({ file }) => {
|
||||||
|
if (
|
||||||
|
![
|
||||||
|
'application/vnd.ms-excel',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
].includes(file.type)
|
||||||
|
) {
|
||||||
|
message.error('只能选择 excel 文件');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (file.size / 1024 / 1024 > 10) {
|
||||||
|
message.error('大小不能超过 10MB');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
loading.value = true;
|
||||||
|
importCreditBreachOfTrust(file)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 更新 visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -0,0 +1,300 @@
|
|||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="800"
|
||||||
|
:visible="visible"
|
||||||
|
:maskClosable="false"
|
||||||
|
:maxable="maxable"
|
||||||
|
:title="isUpdate ? '编辑失信被执行人' : '添加失信被执行人'"
|
||||||
|
:body-style="{ paddingBottom: '28px' }"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
@ok="save"
|
||||||
|
>
|
||||||
|
<a-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||||
|
:wrapper-col="
|
||||||
|
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<a-form-item label="数据类型" name="dataType">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入数据类型"
|
||||||
|
v-model:value="form.dataType"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="原告/上诉人" name="plaintiffAppellant">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入原告/上诉人"
|
||||||
|
v-model:value="form.plaintiffAppellant"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="被告/被上诉人" name="defendant appellee">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入被告/被上诉人"
|
||||||
|
v-model:value="form.appellee"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="其他当事人/第三人" name="otherPartiesThirdParty">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入其他当事人/第三人"
|
||||||
|
v-model:value="form.otherPartiesThirdParty"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="发生时间" name="occurrenceTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入发生时间"
|
||||||
|
v-model:value="form.occurrenceTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="案号" name="caseNumber">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入案号"
|
||||||
|
v-model:value="form.caseNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="案由" name="causeOfAction">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入案由"
|
||||||
|
v-model:value="form.causeOfAction"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="涉案金额" name="involvedAmount">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入涉案金额"
|
||||||
|
v-model:value="form.involvedAmount"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="法院" name="courtName">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入法院"
|
||||||
|
v-model:value="form.courtName"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="数据状态" name="dataStatus">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入数据状态"
|
||||||
|
v-model:value="form.dataStatus"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="备注" name="comments">
|
||||||
|
<a-textarea
|
||||||
|
:rows="4"
|
||||||
|
:maxlength="200"
|
||||||
|
placeholder="请输入描述"
|
||||||
|
v-model:value="form.comments"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否推荐" name="recommend">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否推荐"
|
||||||
|
v-model:value="form.recommend"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
|
||||||
|
<a-input-number
|
||||||
|
:min="0"
|
||||||
|
:max="9999"
|
||||||
|
class="ele-fluid"
|
||||||
|
placeholder="请输入排序号"
|
||||||
|
v-model:value="form.sortNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="状态, 0正常, 1冻结" name="status">
|
||||||
|
<a-radio-group v-model:value="form.status">
|
||||||
|
<a-radio :value="0">显示</a-radio>
|
||||||
|
<a-radio :value="1">隐藏</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否删除, 0否, 1是" name="deleted">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否删除, 0否, 1是"
|
||||||
|
v-model:value="form.deleted"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="用户ID" name="userId">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入用户ID"
|
||||||
|
v-model:value="form.userId"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="修改时间" name="updateTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入修改时间"
|
||||||
|
v-model:value="form.updateTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, watch } from 'vue';
|
||||||
|
import { Form, message } from 'ant-design-vue';
|
||||||
|
import { assignObject, uuid } from 'ele-admin-pro';
|
||||||
|
import { addCreditBreachOfTrust, updateCreditBreachOfTrust } from '@/api/credit/creditBreachOfTrust';
|
||||||
|
import { CreditBreachOfTrust } from '@/api/credit/creditBreachOfTrust/model';
|
||||||
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
|
|
||||||
|
// 是否是修改
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
// 是否开启响应式布局
|
||||||
|
const themeStore = useThemeStore();
|
||||||
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
// 弹窗是否打开
|
||||||
|
visible: boolean;
|
||||||
|
// 修改回显的数据
|
||||||
|
data?: CreditBreachOfTrust | null;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 提交状态
|
||||||
|
const loading = ref(false);
|
||||||
|
// 是否显示最大化切换按钮
|
||||||
|
const maxable = ref(true);
|
||||||
|
// 表格选中数据
|
||||||
|
const formRef = ref<FormInstance | null>(null);
|
||||||
|
const images = ref<ItemType[]>([]);
|
||||||
|
|
||||||
|
// 用户信息
|
||||||
|
const form = reactive<CreditBreachOfTrust>({
|
||||||
|
id: undefined,
|
||||||
|
dataType: undefined,
|
||||||
|
plaintiffAppellant: undefined,
|
||||||
|
appellee: undefined,
|
||||||
|
otherPartiesThirdParty: undefined,
|
||||||
|
occurrenceTime: undefined,
|
||||||
|
caseNumber: undefined,
|
||||||
|
causeOfAction: undefined,
|
||||||
|
involvedAmount: undefined,
|
||||||
|
courtName: undefined,
|
||||||
|
dataStatus: undefined,
|
||||||
|
comments: undefined,
|
||||||
|
recommend: undefined,
|
||||||
|
sortNumber: undefined,
|
||||||
|
status: undefined,
|
||||||
|
deleted: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
creditBreachOfTrustId: undefined,
|
||||||
|
creditBreachOfTrustName: '',
|
||||||
|
status: 0,
|
||||||
|
comments: '',
|
||||||
|
sortNumber: 100
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 更新visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表单验证规则
|
||||||
|
const rules = reactive({
|
||||||
|
creditBreachOfTrustName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写失信被执行人名称',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
const chooseImage = (data: FileRecord) => {
|
||||||
|
images.value.push({
|
||||||
|
uid: data.id,
|
||||||
|
url: data.path,
|
||||||
|
status: 'done'
|
||||||
|
});
|
||||||
|
form.image = data.path;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDeleteItem = (index: number) => {
|
||||||
|
images.value.splice(index, 1);
|
||||||
|
form.image = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
const { resetFields } = useForm(form, rules);
|
||||||
|
|
||||||
|
/* 保存编辑 */
|
||||||
|
const save = () => {
|
||||||
|
if (!formRef.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
formRef.value
|
||||||
|
.validate()
|
||||||
|
.then(() => {
|
||||||
|
loading.value = true;
|
||||||
|
const formData = {
|
||||||
|
...form
|
||||||
|
};
|
||||||
|
const saveOrUpdate = isUpdate.value ? updateCreditBreachOfTrust : addCreditBreachOfTrust;
|
||||||
|
saveOrUpdate(formData)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(visible) => {
|
||||||
|
if (visible) {
|
||||||
|
images.value = [];
|
||||||
|
if (props.data) {
|
||||||
|
assignObject(form, props.data);
|
||||||
|
if(props.data.image){
|
||||||
|
images.value.push({
|
||||||
|
uid: uuid(),
|
||||||
|
url: props.data.image,
|
||||||
|
status: 'done'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
isUpdate.value = true;
|
||||||
|
} else {
|
||||||
|
isUpdate.value = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
42
src/views/credit/creditBreachOfTrust/components/search.vue
Normal file
42
src/views/credit/creditBreachOfTrust/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<!-- 搜索表单 -->
|
||||||
|
<template>
|
||||||
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
|
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||||
|
<template #icon>
|
||||||
|
<PlusOutlined />
|
||||||
|
</template>
|
||||||
|
<span>添加</span>
|
||||||
|
</a-button>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { GradeParam } from '@/api/user/grade/model';
|
||||||
|
import { watch } from 'vue';
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
// 选中的角色
|
||||||
|
selection?: [];
|
||||||
|
}>(),
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'search', where?: GradeParam): void;
|
||||||
|
(e: 'add'): void;
|
||||||
|
(e: 'remove'): void;
|
||||||
|
(e: 'batchMove'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
const add = () => {
|
||||||
|
emit('add');
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.selection,
|
||||||
|
() => {}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
326
src/views/credit/creditBreachOfTrust/index.vue
Normal file
326
src/views/credit/creditBreachOfTrust/index.vue
Normal file
@@ -0,0 +1,326 @@
|
|||||||
|
<template>
|
||||||
|
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||||
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
|
<ele-pro-table
|
||||||
|
ref="tableRef"
|
||||||
|
row-key="id"
|
||||||
|
:columns="columns"
|
||||||
|
:datasource="datasource"
|
||||||
|
:customRow="customRow"
|
||||||
|
tool-class="ele-toolbar-form"
|
||||||
|
class="sys-org-table"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<search
|
||||||
|
@search="reload"
|
||||||
|
:selection="selection"
|
||||||
|
@add="openEdit"
|
||||||
|
@remove="removeBatch"
|
||||||
|
@batchMove="openMove"
|
||||||
|
@importData="openImport"
|
||||||
|
@exportData="exportData"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'image'">
|
||||||
|
<a-image :src="record.image" :width="50" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'status'">
|
||||||
|
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||||
|
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'action'">
|
||||||
|
<a-space>
|
||||||
|
<a @click="openEdit(record)">修改</a>
|
||||||
|
<a-divider type="vertical" />
|
||||||
|
<a-popconfirm
|
||||||
|
title="确定要删除此记录吗?"
|
||||||
|
@confirm="remove(record)"
|
||||||
|
>
|
||||||
|
<a class="ele-text-danger">删除</a>
|
||||||
|
</a-popconfirm>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</ele-pro-table>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<CreditBreachOfTrustEdit
|
||||||
|
v-model:visible="showEdit"
|
||||||
|
:data="current"
|
||||||
|
@done="reload"
|
||||||
|
/>
|
||||||
|
<!-- 导入弹窗 -->
|
||||||
|
<CreditBreachOfTrustImport v-model:visible="showImport" @done="reload" />
|
||||||
|
</a-page-header>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { createVNode, ref } from 'vue';
|
||||||
|
import { message, Modal } from 'ant-design-vue';
|
||||||
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
|
import { toDateString } from 'ele-admin-pro';
|
||||||
|
import type {
|
||||||
|
DatasourceFunction,
|
||||||
|
ColumnItem
|
||||||
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
|
import Search from '@/views/credit/components/CreditSearchToolbar.vue';
|
||||||
|
import { exportCreditData } from '../utils/export';
|
||||||
|
import { getPageTitle } from '@/utils/common';
|
||||||
|
import CreditBreachOfTrustEdit from './components/creditBreachOfTrustEdit.vue';
|
||||||
|
import CreditBreachOfTrustImport from './components/credit-breach-of-trust-import.vue';
|
||||||
|
import {
|
||||||
|
pageCreditBreachOfTrust,
|
||||||
|
listCreditBreachOfTrust,
|
||||||
|
removeCreditBreachOfTrust,
|
||||||
|
removeBatchCreditBreachOfTrust
|
||||||
|
} from '@/api/credit/creditBreachOfTrust';
|
||||||
|
import type {
|
||||||
|
CreditBreachOfTrust,
|
||||||
|
CreditBreachOfTrustParam
|
||||||
|
} from '@/api/credit/creditBreachOfTrust/model';
|
||||||
|
|
||||||
|
// 表格实例
|
||||||
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
|
|
||||||
|
// 表格选中数据
|
||||||
|
const selection = ref<CreditBreachOfTrust[]>([]);
|
||||||
|
// 当前编辑数据
|
||||||
|
const current = ref<CreditBreachOfTrust | null>(null);
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
const showEdit = ref(false);
|
||||||
|
// 是否显示导入弹窗
|
||||||
|
const showImport = ref(false);
|
||||||
|
// 是否显示批量移动弹窗
|
||||||
|
const showMove = ref(false);
|
||||||
|
// 加载状态
|
||||||
|
const loading = ref(true);
|
||||||
|
// 搜索关键词
|
||||||
|
const searchText = ref('');
|
||||||
|
|
||||||
|
// 表格数据源
|
||||||
|
const datasource: DatasourceFunction = ({
|
||||||
|
page,
|
||||||
|
limit,
|
||||||
|
where = {},
|
||||||
|
orders,
|
||||||
|
filters
|
||||||
|
}) => {
|
||||||
|
const params: CreditBreachOfTrustParam = { ...where };
|
||||||
|
if (filters) {
|
||||||
|
(params as any).status = filters.status;
|
||||||
|
}
|
||||||
|
if (!params.keywords && searchText.value) {
|
||||||
|
params.keywords = searchText.value;
|
||||||
|
}
|
||||||
|
return pageCreditBreachOfTrust({
|
||||||
|
...params,
|
||||||
|
...orders,
|
||||||
|
page,
|
||||||
|
limit
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关键信息列
|
||||||
|
const columns = ref<ColumnItem[]>([
|
||||||
|
{
|
||||||
|
title: 'ID',
|
||||||
|
dataIndex: 'id',
|
||||||
|
key: 'id',
|
||||||
|
width: 80
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数据类型',
|
||||||
|
dataIndex: 'dataType',
|
||||||
|
key: 'dataType',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '原告/上诉人',
|
||||||
|
dataIndex: 'plaintiffAppellant',
|
||||||
|
key: 'plaintiffAppellant',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '发生时间',
|
||||||
|
dataIndex: 'occurrenceTime',
|
||||||
|
key: 'occurrenceTime',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '案号',
|
||||||
|
dataIndex: 'caseNumber',
|
||||||
|
key: 'caseNumber',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '案由',
|
||||||
|
dataIndex: 'causeOfAction',
|
||||||
|
key: 'causeOfAction',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '涉案金额',
|
||||||
|
dataIndex: 'involvedAmount',
|
||||||
|
key: 'involvedAmount',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '法院',
|
||||||
|
dataIndex: 'courtName',
|
||||||
|
key: 'courtName',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数据状态',
|
||||||
|
dataIndex: 'dataStatus',
|
||||||
|
key: 'dataStatus',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
key: 'createTime',
|
||||||
|
width: 180,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
width: 160,
|
||||||
|
fixed: 'right',
|
||||||
|
align: 'center',
|
||||||
|
hideInSetting: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const reload = (where?: CreditBreachOfTrustParam) => {
|
||||||
|
if (where && Object.prototype.hasOwnProperty.call(where, 'keywords')) {
|
||||||
|
searchText.value = where.keywords ?? '';
|
||||||
|
}
|
||||||
|
const targetWhere = where ?? { keywords: searchText.value || undefined };
|
||||||
|
selection.value = [];
|
||||||
|
tableRef?.value?.reload({ where: targetWhere });
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开编辑弹窗 */
|
||||||
|
const openEdit = (row?: CreditBreachOfTrust) => {
|
||||||
|
current.value = row ?? null;
|
||||||
|
showEdit.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开批量移动弹窗 */
|
||||||
|
const openMove = () => {
|
||||||
|
showMove.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开导入弹窗 */
|
||||||
|
const openImport = () => {
|
||||||
|
showImport.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 导出 */
|
||||||
|
const exportData = () => {
|
||||||
|
exportCreditData<CreditBreachOfTrust>({
|
||||||
|
filename: '失信被执行人',
|
||||||
|
columns: [
|
||||||
|
{ title: 'ID', dataIndex: 'id' },
|
||||||
|
{ title: '数据类型', dataIndex: 'dataType' },
|
||||||
|
{ title: '原告/上诉人', dataIndex: 'plaintiffAppellant' },
|
||||||
|
{ title: '发生时间', dataIndex: 'occurrenceTime' },
|
||||||
|
{ title: '案号', dataIndex: 'caseNumber' },
|
||||||
|
{ title: '案由', dataIndex: 'causeOfAction' },
|
||||||
|
{ title: '涉案金额', dataIndex: 'involvedAmount' },
|
||||||
|
{ title: '法院', dataIndex: 'courtName' },
|
||||||
|
{ title: '数据状态', dataIndex: 'dataStatus' },
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
formatter: (record: CreditBreachOfTrust) =>
|
||||||
|
record.createTime
|
||||||
|
? toDateString(record.createTime, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
],
|
||||||
|
fetchData: () =>
|
||||||
|
listCreditBreachOfTrust({
|
||||||
|
keywords: searchText.value || undefined
|
||||||
|
})
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 删除单个 */
|
||||||
|
const remove = (row: CreditBreachOfTrust) => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeCreditBreachOfTrust(row.id)
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 批量删除 */
|
||||||
|
const removeBatch = () => {
|
||||||
|
if (!selection.value.length) {
|
||||||
|
message.error('请至少选择一条数据');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要删除选中的记录吗?',
|
||||||
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
|
maskClosable: true,
|
||||||
|
onOk: () => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeBatchCreditBreachOfTrust(selection.value.map((d) => d.id))
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 查询 */
|
||||||
|
const query = () => {
|
||||||
|
loading.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 自定义行属性 */
|
||||||
|
const customRow = (record: CreditBreachOfTrust) => {
|
||||||
|
return {
|
||||||
|
// 行点击事件
|
||||||
|
onClick: () => {
|
||||||
|
// console.log(record);
|
||||||
|
},
|
||||||
|
// 行双击事件
|
||||||
|
onDblclick: () => {
|
||||||
|
openEdit(record);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
query();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default {
|
||||||
|
name: 'CreditBreachOfTrust'
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
<!-- 司法大数据导入弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="520"
|
||||||
|
:footer="null"
|
||||||
|
title="司法大数据批量导入"
|
||||||
|
:visible="visible"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
>
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<a-upload-dragger
|
||||||
|
accept=".xls,.xlsx"
|
||||||
|
:show-upload-list="false"
|
||||||
|
:customRequest="doUpload"
|
||||||
|
style="padding: 24px 0; margin-bottom: 16px"
|
||||||
|
>
|
||||||
|
<p class="ant-upload-drag-icon">
|
||||||
|
<cloud-upload-outlined />
|
||||||
|
</p>
|
||||||
|
<p class="ant-upload-hint">将文件拖到此处,或点击上传</p>
|
||||||
|
</a-upload-dragger>
|
||||||
|
</a-spin>
|
||||||
|
<div class="ele-text-center">
|
||||||
|
<span>只能上传xls、xlsx文件,</span>
|
||||||
|
<a :href="templateUrl" download="司法大数据导入模板.xlsx">
|
||||||
|
下载导入模板
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { message } from 'ant-design-vue/es';
|
||||||
|
import { CloudUploadOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { importCreditCaseFiling } from '@/api/credit/creditCaseFiling';
|
||||||
|
import { API_BASE_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
// 是否打开弹窗
|
||||||
|
visible: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 导入请求状态
|
||||||
|
const loading = ref(false);
|
||||||
|
|
||||||
|
// 模板下载地址,保持与当前接口域名一致
|
||||||
|
const templateUrl = computed(() => {
|
||||||
|
const base = (localStorage.getItem('ApiUrl') || API_BASE_URL || '').replace(
|
||||||
|
/\/$/,
|
||||||
|
''
|
||||||
|
);
|
||||||
|
return `${base}/credit/credit-case-filing/import/template`;
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 上传 */
|
||||||
|
const doUpload = ({ file }) => {
|
||||||
|
if (
|
||||||
|
![
|
||||||
|
'application/vnd.ms-excel',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
].includes(file.type)
|
||||||
|
) {
|
||||||
|
message.error('只能选择 excel 文件');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (file.size / 1024 / 1024 > 10) {
|
||||||
|
message.error('大小不能超过 10MB');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
loading.value = true;
|
||||||
|
importCreditCaseFiling(file)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 更新 visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -0,0 +1,300 @@
|
|||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="800"
|
||||||
|
:visible="visible"
|
||||||
|
:maskClosable="false"
|
||||||
|
:maxable="maxable"
|
||||||
|
:title="isUpdate ? '编辑司法大数据' : '添加司法大数据'"
|
||||||
|
:body-style="{ paddingBottom: '28px' }"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
@ok="save"
|
||||||
|
>
|
||||||
|
<a-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||||
|
:wrapper-col="
|
||||||
|
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<a-form-item label="数据类型" name="dataType">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入数据类型"
|
||||||
|
v-model:value="form.dataType"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="原告/上诉人" name="plaintiffAppellant">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入原告/上诉人"
|
||||||
|
v-model:value="form.plaintiffAppellant"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="被告/被上诉人" name="defendant appellee">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入被告/被上诉人"
|
||||||
|
v-model:value="form.appellee"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="其他当事人/第三人" name="otherPartiesThirdParty">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入其他当事人/第三人"
|
||||||
|
v-model:value="form.otherPartiesThirdParty"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="发生时间" name="occurrenceTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入发生时间"
|
||||||
|
v-model:value="form.occurrenceTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="案号" name="caseNumber">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入案号"
|
||||||
|
v-model:value="form.caseNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="案由" name="causeOfAction">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入案由"
|
||||||
|
v-model:value="form.causeOfAction"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="涉案金额" name="involvedAmount">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入涉案金额"
|
||||||
|
v-model:value="form.involvedAmount"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="法院" name="courtName">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入法院"
|
||||||
|
v-model:value="form.courtName"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="数据状态" name="dataStatus">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入数据状态"
|
||||||
|
v-model:value="form.dataStatus"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="备注" name="comments">
|
||||||
|
<a-textarea
|
||||||
|
:rows="4"
|
||||||
|
:maxlength="200"
|
||||||
|
placeholder="请输入描述"
|
||||||
|
v-model:value="form.comments"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否推荐" name="recommend">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否推荐"
|
||||||
|
v-model:value="form.recommend"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
|
||||||
|
<a-input-number
|
||||||
|
:min="0"
|
||||||
|
:max="9999"
|
||||||
|
class="ele-fluid"
|
||||||
|
placeholder="请输入排序号"
|
||||||
|
v-model:value="form.sortNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="状态, 0正常, 1冻结" name="status">
|
||||||
|
<a-radio-group v-model:value="form.status">
|
||||||
|
<a-radio :value="0">显示</a-radio>
|
||||||
|
<a-radio :value="1">隐藏</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否删除, 0否, 1是" name="deleted">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否删除, 0否, 1是"
|
||||||
|
v-model:value="form.deleted"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="用户ID" name="userId">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入用户ID"
|
||||||
|
v-model:value="form.userId"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="修改时间" name="updateTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入修改时间"
|
||||||
|
v-model:value="form.updateTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, watch } from 'vue';
|
||||||
|
import { Form, message } from 'ant-design-vue';
|
||||||
|
import { assignObject, uuid } from 'ele-admin-pro';
|
||||||
|
import { addCreditCaseFiling, updateCreditCaseFiling } from '@/api/credit/creditCaseFiling';
|
||||||
|
import { CreditCaseFiling } from '@/api/credit/creditCaseFiling/model';
|
||||||
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
|
|
||||||
|
// 是否是修改
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
// 是否开启响应式布局
|
||||||
|
const themeStore = useThemeStore();
|
||||||
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
// 弹窗是否打开
|
||||||
|
visible: boolean;
|
||||||
|
// 修改回显的数据
|
||||||
|
data?: CreditCaseFiling | null;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 提交状态
|
||||||
|
const loading = ref(false);
|
||||||
|
// 是否显示最大化切换按钮
|
||||||
|
const maxable = ref(true);
|
||||||
|
// 表格选中数据
|
||||||
|
const formRef = ref<FormInstance | null>(null);
|
||||||
|
const images = ref<ItemType[]>([]);
|
||||||
|
|
||||||
|
// 用户信息
|
||||||
|
const form = reactive<CreditCaseFiling>({
|
||||||
|
id: undefined,
|
||||||
|
dataType: undefined,
|
||||||
|
plaintiffAppellant: undefined,
|
||||||
|
appellee: undefined,
|
||||||
|
otherPartiesThirdParty: undefined,
|
||||||
|
occurrenceTime: undefined,
|
||||||
|
caseNumber: undefined,
|
||||||
|
causeOfAction: undefined,
|
||||||
|
involvedAmount: undefined,
|
||||||
|
courtName: undefined,
|
||||||
|
dataStatus: undefined,
|
||||||
|
comments: undefined,
|
||||||
|
recommend: undefined,
|
||||||
|
sortNumber: undefined,
|
||||||
|
status: undefined,
|
||||||
|
deleted: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
creditCaseFilingId: undefined,
|
||||||
|
creditCaseFilingName: '',
|
||||||
|
status: 0,
|
||||||
|
comments: '',
|
||||||
|
sortNumber: 100
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 更新visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表单验证规则
|
||||||
|
const rules = reactive({
|
||||||
|
creditCaseFilingName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写司法大数据名称',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
const chooseImage = (data: FileRecord) => {
|
||||||
|
images.value.push({
|
||||||
|
uid: data.id,
|
||||||
|
url: data.path,
|
||||||
|
status: 'done'
|
||||||
|
});
|
||||||
|
form.image = data.path;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDeleteItem = (index: number) => {
|
||||||
|
images.value.splice(index, 1);
|
||||||
|
form.image = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
const { resetFields } = useForm(form, rules);
|
||||||
|
|
||||||
|
/* 保存编辑 */
|
||||||
|
const save = () => {
|
||||||
|
if (!formRef.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
formRef.value
|
||||||
|
.validate()
|
||||||
|
.then(() => {
|
||||||
|
loading.value = true;
|
||||||
|
const formData = {
|
||||||
|
...form
|
||||||
|
};
|
||||||
|
const saveOrUpdate = isUpdate.value ? updateCreditCaseFiling : addCreditCaseFiling;
|
||||||
|
saveOrUpdate(formData)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(visible) => {
|
||||||
|
if (visible) {
|
||||||
|
images.value = [];
|
||||||
|
if (props.data) {
|
||||||
|
assignObject(form, props.data);
|
||||||
|
if(props.data.image){
|
||||||
|
images.value.push({
|
||||||
|
uid: uuid(),
|
||||||
|
url: props.data.image,
|
||||||
|
status: 'done'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
isUpdate.value = true;
|
||||||
|
} else {
|
||||||
|
isUpdate.value = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
42
src/views/credit/creditCaseFiling/components/search.vue
Normal file
42
src/views/credit/creditCaseFiling/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<!-- 搜索表单 -->
|
||||||
|
<template>
|
||||||
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
|
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||||
|
<template #icon>
|
||||||
|
<PlusOutlined />
|
||||||
|
</template>
|
||||||
|
<span>添加</span>
|
||||||
|
</a-button>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { GradeParam } from '@/api/user/grade/model';
|
||||||
|
import { watch } from 'vue';
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
// 选中的角色
|
||||||
|
selection?: [];
|
||||||
|
}>(),
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'search', where?: GradeParam): void;
|
||||||
|
(e: 'add'): void;
|
||||||
|
(e: 'remove'): void;
|
||||||
|
(e: 'batchMove'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
const add = () => {
|
||||||
|
emit('add');
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.selection,
|
||||||
|
() => {}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
323
src/views/credit/creditCaseFiling/index.vue
Normal file
323
src/views/credit/creditCaseFiling/index.vue
Normal file
@@ -0,0 +1,323 @@
|
|||||||
|
<template>
|
||||||
|
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||||
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
|
<ele-pro-table
|
||||||
|
ref="tableRef"
|
||||||
|
row-key="id"
|
||||||
|
:columns="columns"
|
||||||
|
:datasource="datasource"
|
||||||
|
:customRow="customRow"
|
||||||
|
tool-class="ele-toolbar-form"
|
||||||
|
class="sys-org-table"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<search
|
||||||
|
@search="reload"
|
||||||
|
:selection="selection"
|
||||||
|
@add="openEdit"
|
||||||
|
@remove="removeBatch"
|
||||||
|
@batchMove="openMove"
|
||||||
|
@importData="openImport"
|
||||||
|
@exportData="exportData"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'image'">
|
||||||
|
<a-image :src="record.image" :width="50" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'status'">
|
||||||
|
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||||
|
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'action'">
|
||||||
|
<a-space>
|
||||||
|
<a @click="openEdit(record)">修改</a>
|
||||||
|
<a-divider type="vertical" />
|
||||||
|
<a-popconfirm
|
||||||
|
title="确定要删除此记录吗?"
|
||||||
|
@confirm="remove(record)"
|
||||||
|
>
|
||||||
|
<a class="ele-text-danger">删除</a>
|
||||||
|
</a-popconfirm>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</ele-pro-table>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<CreditCaseFilingEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||||
|
<!-- 导入弹窗 -->
|
||||||
|
<CreditCaseFilingImport v-model:visible="showImport" @done="reload" />
|
||||||
|
</a-page-header>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { createVNode, ref } from 'vue';
|
||||||
|
import { message, Modal } from 'ant-design-vue';
|
||||||
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
|
import { toDateString } from 'ele-admin-pro';
|
||||||
|
import type {
|
||||||
|
DatasourceFunction,
|
||||||
|
ColumnItem
|
||||||
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
|
import Search from '@/views/credit/components/CreditSearchToolbar.vue';
|
||||||
|
import { exportCreditData } from '../utils/export';
|
||||||
|
import { getPageTitle } from '@/utils/common';
|
||||||
|
import CreditCaseFilingEdit from './components/creditCaseFilingEdit.vue';
|
||||||
|
import CreditCaseFilingImport from './components/credit-case-filing-import.vue';
|
||||||
|
import {
|
||||||
|
pageCreditCaseFiling,
|
||||||
|
listCreditCaseFiling,
|
||||||
|
removeCreditCaseFiling,
|
||||||
|
removeBatchCreditCaseFiling
|
||||||
|
} from '@/api/credit/creditCaseFiling';
|
||||||
|
import type {
|
||||||
|
CreditCaseFiling,
|
||||||
|
CreditCaseFilingParam
|
||||||
|
} from '@/api/credit/creditCaseFiling/model';
|
||||||
|
|
||||||
|
// 表格实例
|
||||||
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
|
|
||||||
|
// 表格选中数据
|
||||||
|
const selection = ref<CreditCaseFiling[]>([]);
|
||||||
|
// 当前编辑数据
|
||||||
|
const current = ref<CreditCaseFiling | null>(null);
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
const showEdit = ref(false);
|
||||||
|
// 是否显示导入弹窗
|
||||||
|
const showImport = ref(false);
|
||||||
|
// 是否显示批量移动弹窗
|
||||||
|
const showMove = ref(false);
|
||||||
|
// 加载状态
|
||||||
|
const loading = ref(true);
|
||||||
|
// 搜索关键词
|
||||||
|
const searchText = ref('');
|
||||||
|
|
||||||
|
// 表格数据源
|
||||||
|
const datasource: DatasourceFunction = ({
|
||||||
|
page,
|
||||||
|
limit,
|
||||||
|
where = {},
|
||||||
|
orders,
|
||||||
|
filters
|
||||||
|
}) => {
|
||||||
|
const params: CreditCaseFilingParam = { ...where };
|
||||||
|
if (filters) {
|
||||||
|
(params as any).status = filters.status;
|
||||||
|
}
|
||||||
|
if (!params.keywords && searchText.value) {
|
||||||
|
params.keywords = searchText.value;
|
||||||
|
}
|
||||||
|
return pageCreditCaseFiling({
|
||||||
|
...params,
|
||||||
|
...orders,
|
||||||
|
page,
|
||||||
|
limit
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关键信息列
|
||||||
|
const columns = ref<ColumnItem[]>([
|
||||||
|
{
|
||||||
|
title: 'ID',
|
||||||
|
dataIndex: 'id',
|
||||||
|
key: 'id',
|
||||||
|
width: 80
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数据类型',
|
||||||
|
dataIndex: 'dataType',
|
||||||
|
key: 'dataType',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '原告/上诉人',
|
||||||
|
dataIndex: 'plaintiffAppellant',
|
||||||
|
key: 'plaintiffAppellant',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '发生时间',
|
||||||
|
dataIndex: 'occurrenceTime',
|
||||||
|
key: 'occurrenceTime',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '案号',
|
||||||
|
dataIndex: 'caseNumber',
|
||||||
|
key: 'caseNumber',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '案由',
|
||||||
|
dataIndex: 'causeOfAction',
|
||||||
|
key: 'causeOfAction',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '涉案金额',
|
||||||
|
dataIndex: 'involvedAmount',
|
||||||
|
key: 'involvedAmount',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '法院',
|
||||||
|
dataIndex: 'courtName',
|
||||||
|
key: 'courtName',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数据状态',
|
||||||
|
dataIndex: 'dataStatus',
|
||||||
|
key: 'dataStatus',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
key: 'createTime',
|
||||||
|
width: 180,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
customRender: ({ text }) =>
|
||||||
|
toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
width: 160,
|
||||||
|
fixed: 'right',
|
||||||
|
align: 'center',
|
||||||
|
hideInSetting: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const reload = (where?: CreditCaseFilingParam) => {
|
||||||
|
if (where && Object.prototype.hasOwnProperty.call(where, 'keywords')) {
|
||||||
|
searchText.value = where.keywords ?? '';
|
||||||
|
}
|
||||||
|
const targetWhere = where ?? { keywords: searchText.value || undefined };
|
||||||
|
selection.value = [];
|
||||||
|
tableRef?.value?.reload({ where: targetWhere });
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开编辑弹窗 */
|
||||||
|
const openEdit = (row?: CreditCaseFiling) => {
|
||||||
|
current.value = row ?? null;
|
||||||
|
showEdit.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开批量移动弹窗 */
|
||||||
|
const openMove = () => {
|
||||||
|
showMove.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开导入弹窗 */
|
||||||
|
const openImport = () => {
|
||||||
|
showImport.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 导出 */
|
||||||
|
const exportData = () => {
|
||||||
|
exportCreditData<CreditCaseFiling>({
|
||||||
|
filename: '司法大数据',
|
||||||
|
columns: [
|
||||||
|
{ title: 'ID', dataIndex: 'id' },
|
||||||
|
{ title: '数据类型', dataIndex: 'dataType' },
|
||||||
|
{ title: '原告/上诉人', dataIndex: 'plaintiffAppellant' },
|
||||||
|
{ title: '发生时间', dataIndex: 'occurrenceTime' },
|
||||||
|
{ title: '案号', dataIndex: 'caseNumber' },
|
||||||
|
{ title: '案由', dataIndex: 'causeOfAction' },
|
||||||
|
{ title: '涉案金额', dataIndex: 'involvedAmount' },
|
||||||
|
{ title: '法院', dataIndex: 'courtName' },
|
||||||
|
{ title: '数据状态', dataIndex: 'dataStatus' },
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
formatter: (record: CreditCaseFiling) =>
|
||||||
|
record.createTime
|
||||||
|
? toDateString(record.createTime, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
],
|
||||||
|
fetchData: () =>
|
||||||
|
listCreditCaseFiling({
|
||||||
|
keywords: searchText.value || undefined
|
||||||
|
})
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 删除单个 */
|
||||||
|
const remove = (row: CreditCaseFiling) => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeCreditCaseFiling(row.id)
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 批量删除 */
|
||||||
|
const removeBatch = () => {
|
||||||
|
if (!selection.value.length) {
|
||||||
|
message.error('请至少选择一条数据');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要删除选中的记录吗?',
|
||||||
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
|
maskClosable: true,
|
||||||
|
onOk: () => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeBatchCreditCaseFiling(selection.value.map((d) => d.id))
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 查询 */
|
||||||
|
const query = () => {
|
||||||
|
loading.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 自定义行属性 */
|
||||||
|
const customRow = (record: CreditCaseFiling) => {
|
||||||
|
return {
|
||||||
|
// 行点击事件
|
||||||
|
onClick: () => {
|
||||||
|
// console.log(record);
|
||||||
|
},
|
||||||
|
// 行双击事件
|
||||||
|
onDblclick: () => {
|
||||||
|
openEdit(record);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
query();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default {
|
||||||
|
name: 'CreditCaseFiling'
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
<!-- 企业导入弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="520"
|
||||||
|
:footer="null"
|
||||||
|
title="企业批量导入"
|
||||||
|
:visible="visible"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
>
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<a-upload-dragger
|
||||||
|
accept=".xls,.xlsx"
|
||||||
|
:show-upload-list="false"
|
||||||
|
:customRequest="doUpload"
|
||||||
|
style="padding: 24px 0; margin-bottom: 16px"
|
||||||
|
>
|
||||||
|
<p class="ant-upload-drag-icon">
|
||||||
|
<cloud-upload-outlined />
|
||||||
|
</p>
|
||||||
|
<p class="ant-upload-hint">将文件拖到此处,或点击上传</p>
|
||||||
|
</a-upload-dragger>
|
||||||
|
</a-spin>
|
||||||
|
<div class="ele-text-center">
|
||||||
|
<span>只能上传xls、xlsx文件,</span>
|
||||||
|
<a :href="templateUrl" download="企业导入模板.xlsx"> 下载导入模板 </a>
|
||||||
|
</div>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { message } from 'ant-design-vue/es';
|
||||||
|
import { CloudUploadOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { importCreditCompany } from '@/api/credit/creditCompany';
|
||||||
|
import { API_BASE_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
// 是否打开弹窗
|
||||||
|
visible: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 导入请求状态
|
||||||
|
const loading = ref(false);
|
||||||
|
|
||||||
|
// 模板下载地址,保持与当前接口域名一致
|
||||||
|
const templateUrl = computed(() => {
|
||||||
|
const base = (localStorage.getItem('ApiUrl') || API_BASE_URL || '').replace(
|
||||||
|
/\/$/,
|
||||||
|
''
|
||||||
|
);
|
||||||
|
return `${base}/credit/credit-company/import/template`;
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 上传 */
|
||||||
|
const doUpload = ({ file }) => {
|
||||||
|
if (
|
||||||
|
![
|
||||||
|
'application/vnd.ms-excel',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
].includes(file.type)
|
||||||
|
) {
|
||||||
|
message.error('只能选择 excel 文件');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (file.size / 1024 / 1024 > 10) {
|
||||||
|
message.error('大小不能超过 10MB');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
loading.value = true;
|
||||||
|
importCreditCompany(file)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 更新 visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
612
src/views/credit/creditCompany/components/creditCompanyEdit.vue
Normal file
612
src/views/credit/creditCompany/components/creditCompanyEdit.vue
Normal file
@@ -0,0 +1,612 @@
|
|||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="800"
|
||||||
|
:visible="visible"
|
||||||
|
:maskClosable="false"
|
||||||
|
:maxable="maxable"
|
||||||
|
:title="isUpdate ? '编辑企业' : '添加企业'"
|
||||||
|
:body-style="{ paddingBottom: '28px' }"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
@ok="save"
|
||||||
|
>
|
||||||
|
<a-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||||
|
:wrapper-col="
|
||||||
|
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<a-form-item label="原文件导入名称" name="name">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入原文件导入名称"
|
||||||
|
v-model:value="form.name"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="系统匹配企业名称" name="matchName">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入系统匹配企业名称"
|
||||||
|
v-model:value="form.matchName"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="统一社会信用代码" name="code">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入统一社会信用代码"
|
||||||
|
v-model:value="form.code"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<!-- <a-form-item label="类型" name="type">-->
|
||||||
|
<!-- <a-input-->
|
||||||
|
<!-- allow-clear-->
|
||||||
|
<!-- placeholder="请输入类型"-->
|
||||||
|
<!-- v-model:value="form.type"-->
|
||||||
|
<!-- />-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<!-- <a-form-item label="上级id, 0是顶级" name="parentId">-->
|
||||||
|
<!-- <a-input-->
|
||||||
|
<!-- allow-clear-->
|
||||||
|
<!-- placeholder="请输入上级id, 0是顶级"-->
|
||||||
|
<!-- v-model:value="form.parentId"-->
|
||||||
|
<!-- />-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
<a-form-item label="登记状态" name="registrationStatus">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入登记状态"
|
||||||
|
v-model:value="form.registrationStatus"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="法定代表人" name="legalPerson">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入法定代表人"
|
||||||
|
v-model:value="form.legalPerson"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="注册资本" name="registeredCapital">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入注册资本"
|
||||||
|
v-model:value="form.registeredCapital"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="实缴资本" name="paidinCapital">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入实缴资本"
|
||||||
|
v-model:value="form.paidinCapital"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="成立日期" name="establishDate">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入成立日期"
|
||||||
|
v-model:value="form.establishDate"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="企业地址" name="address">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入企业地址"
|
||||||
|
v-model:value="form.address"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="电话" name="tel">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入电话"
|
||||||
|
v-model:value="form.tel"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="更多电话" name="moreTel">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入更多电话"
|
||||||
|
v-model:value="form.moreTel"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="邮箱" name="email">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入邮箱"
|
||||||
|
v-model:value="form.email"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="更多邮箱" name="moreEmail">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入更多邮箱"
|
||||||
|
v-model:value="form.moreEmail"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="所在国家" name="country">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入所在国家"
|
||||||
|
v-model:value="form.country"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="所属省份" name="province">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入所属省份"
|
||||||
|
v-model:value="form.province"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="所属城市" name="city">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入所属城市"
|
||||||
|
v-model:value="form.city"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="所属区县" name="region">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入所属区县"
|
||||||
|
v-model:value="form.region"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="企业(机构)类型" name="institutionType">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入企业(机构)类型"
|
||||||
|
v-model:value="form.institutionType"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="纳税人识别号" name="taxpayerCode">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入纳税人识别号"
|
||||||
|
v-model:value="form.taxpayerCode"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="注册号" name="registrationNumber">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入注册号"
|
||||||
|
v-model:value="form.registrationNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="组织机构代码" name="organizationalCode">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入组织机构代码"
|
||||||
|
v-model:value="form.organizationalCode"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="参保人数" name="numberOfInsuredPersons">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入参保人数"
|
||||||
|
v-model:value="form.numberOfInsuredPersons"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="参保人数所属年报" name="annualReport">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入参保人数所属年报"
|
||||||
|
v-model:value="form.annualReport"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="营业期限" name="businessTerm">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入营业期限"
|
||||||
|
v-model:value="form.businessTerm"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item
|
||||||
|
label="国标行业门类"
|
||||||
|
name="nationalStandardIndustryCategories"
|
||||||
|
>
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入国标行业门类"
|
||||||
|
v-model:value="form.nationalStandardIndustryCategories"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item
|
||||||
|
label="国标行业大类"
|
||||||
|
name="nationalStandardIndustryCategories2"
|
||||||
|
>
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入国标行业大类"
|
||||||
|
v-model:value="form.nationalStandardIndustryCategories2"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item
|
||||||
|
label="国标行业中类"
|
||||||
|
name="nationalStandardIndustryCategories3"
|
||||||
|
>
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入国标行业中类"
|
||||||
|
v-model:value="form.nationalStandardIndustryCategories3"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item
|
||||||
|
label="国标行业小类"
|
||||||
|
name="nationalStandardIndustryCategories4"
|
||||||
|
>
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入国标行业小类"
|
||||||
|
v-model:value="form.nationalStandardIndustryCategories4"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item
|
||||||
|
label="企查查行业门类"
|
||||||
|
name="nationalStandardIndustryCategories5"
|
||||||
|
>
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入企查查行业门类"
|
||||||
|
v-model:value="form.nationalStandardIndustryCategories5"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item
|
||||||
|
label="企查查行业大类"
|
||||||
|
name="nationalStandardIndustryCategories6"
|
||||||
|
>
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入企查查行业大类"
|
||||||
|
v-model:value="form.nationalStandardIndustryCategories6"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item
|
||||||
|
label="企查查行业中类"
|
||||||
|
name="nationalStandardIndustryCategories7"
|
||||||
|
>
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入企查查行业中类"
|
||||||
|
v-model:value="form.nationalStandardIndustryCategories7"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item
|
||||||
|
label="企查查行业小类"
|
||||||
|
name="nationalStandardIndustryCategories8"
|
||||||
|
>
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入企查查行业小类"
|
||||||
|
v-model:value="form.nationalStandardIndustryCategories8"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="企业规模" name="companySize">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入企业规模"
|
||||||
|
v-model:value="form.companySize"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="曾用名" name="formerName">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入曾用名"
|
||||||
|
v-model:value="form.formerName"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="英文名" name="englishName">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入英文名"
|
||||||
|
v-model:value="form.englishName"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="官网" name="domain">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入官网"
|
||||||
|
v-model:value="form.domain"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="通信地址" name="mailingAddress">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入通信地址"
|
||||||
|
v-model:value="form.mailingAddress"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="企业简介" name="companyProfile">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入企业简介"
|
||||||
|
v-model:value="form.companyProfile"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="经营范围" name="natureOfBusiness">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入经营范围"
|
||||||
|
v-model:value="form.natureOfBusiness"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="登记机关" name="registrationAuthority">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入登记机关"
|
||||||
|
v-model:value="form.registrationAuthority"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="纳税人资质" name="taxpayerQualification">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入纳税人资质"
|
||||||
|
v-model:value="form.taxpayerQualification"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="最新年报年份" name="latestAnnualReportYear">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入最新年报年份"
|
||||||
|
v-model:value="form.latestAnnualReportYear"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item
|
||||||
|
label="最新年报营业收入"
|
||||||
|
name="latestAnnualReportOnOperatingRevenue"
|
||||||
|
>
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入最新年报营业收入"
|
||||||
|
v-model:value="form.latestAnnualReportOnOperatingRevenue"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="企查分" name="enterpriseScoreCheck">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入企查分"
|
||||||
|
v-model:value="form.enterpriseScoreCheck"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="信用等级" name="creditRating">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入信用等级"
|
||||||
|
v-model:value="form.creditRating"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="科创分" name="cechnologyScore">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入科创分"
|
||||||
|
v-model:value="form.cechnologyScore"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="科创等级" name="cechnologyLevel">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入科创等级"
|
||||||
|
v-model:value="form.cechnologyLevel"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否小微企业" name="smallEnterprise">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否小微企业"
|
||||||
|
v-model:value="form.smallEnterprise"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="备注" name="comments">
|
||||||
|
<a-textarea
|
||||||
|
:rows="4"
|
||||||
|
:maxlength="200"
|
||||||
|
placeholder="请输入描述"
|
||||||
|
v-model:value="form.comments"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="排序" name="sortNumber">
|
||||||
|
<a-input-number
|
||||||
|
:min="0"
|
||||||
|
:max="9999"
|
||||||
|
class="ele-fluid"
|
||||||
|
placeholder="请输入排序号"
|
||||||
|
v-model:value="form.sortNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="状态" name="status">
|
||||||
|
<a-radio-group v-model:value="form.status">
|
||||||
|
<a-radio :value="0">显示</a-radio>
|
||||||
|
<a-radio :value="1">隐藏</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, watch } from 'vue';
|
||||||
|
import { Form, message } from 'ant-design-vue';
|
||||||
|
import { assignObject, uuid } from 'ele-admin-pro';
|
||||||
|
import {
|
||||||
|
addCreditCompany,
|
||||||
|
updateCreditCompany
|
||||||
|
} from '@/api/credit/creditCompany';
|
||||||
|
import { CreditCompany } from '@/api/credit/creditCompany/model';
|
||||||
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
|
|
||||||
|
// 是否是修改
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
// 是否开启响应式布局
|
||||||
|
const themeStore = useThemeStore();
|
||||||
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
// 弹窗是否打开
|
||||||
|
visible: boolean;
|
||||||
|
// 修改回显的数据
|
||||||
|
data?: CreditCompany | null;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 提交状态
|
||||||
|
const loading = ref(false);
|
||||||
|
// 是否显示最大化切换按钮
|
||||||
|
const maxable = ref(true);
|
||||||
|
// 表格选中数据
|
||||||
|
const formRef = ref<FormInstance | null>(null);
|
||||||
|
const images = ref<ItemType[]>([]);
|
||||||
|
|
||||||
|
// 用户信息
|
||||||
|
const form = reactive<CreditCompany>({
|
||||||
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
|
matchName: undefined,
|
||||||
|
code: undefined,
|
||||||
|
type: undefined,
|
||||||
|
parentId: undefined,
|
||||||
|
registrationStatus: undefined,
|
||||||
|
legalPerson: undefined,
|
||||||
|
registeredCapital: undefined,
|
||||||
|
paidinCapital: undefined,
|
||||||
|
establishDate: undefined,
|
||||||
|
address: undefined,
|
||||||
|
tel: undefined,
|
||||||
|
moreTel: undefined,
|
||||||
|
email: undefined,
|
||||||
|
moreEmail: undefined,
|
||||||
|
country: undefined,
|
||||||
|
province: undefined,
|
||||||
|
city: undefined,
|
||||||
|
region: undefined,
|
||||||
|
institutionType: undefined,
|
||||||
|
taxpayerCode: undefined,
|
||||||
|
registrationNumber: undefined,
|
||||||
|
organizationalCode: undefined,
|
||||||
|
numberOfInsuredPersons: undefined,
|
||||||
|
annualReport: undefined,
|
||||||
|
businessTerm: undefined,
|
||||||
|
nationalStandardIndustryCategories: undefined,
|
||||||
|
nationalStandardIndustryCategories2: undefined,
|
||||||
|
nationalStandardIndustryCategories3: undefined,
|
||||||
|
nationalStandardIndustryCategories4: undefined,
|
||||||
|
nationalStandardIndustryCategories5: undefined,
|
||||||
|
nationalStandardIndustryCategories6: undefined,
|
||||||
|
nationalStandardIndustryCategories7: undefined,
|
||||||
|
nationalStandardIndustryCategories8: undefined,
|
||||||
|
companySize: undefined,
|
||||||
|
formerName: undefined,
|
||||||
|
englishName: undefined,
|
||||||
|
domain: undefined,
|
||||||
|
mailingAddress: undefined,
|
||||||
|
companyProfile: undefined,
|
||||||
|
natureOfBusiness: undefined,
|
||||||
|
registrationAuthority: undefined,
|
||||||
|
taxpayerQualification: undefined,
|
||||||
|
latestAnnualReportYear: undefined,
|
||||||
|
latestAnnualReportOnOperatingRevenue: undefined,
|
||||||
|
enterpriseScoreCheck: undefined,
|
||||||
|
creditRating: undefined,
|
||||||
|
cechnologyScore: undefined,
|
||||||
|
cechnologyLevel: undefined,
|
||||||
|
smallEnterprise: undefined,
|
||||||
|
recommend: undefined,
|
||||||
|
sortNumber: undefined,
|
||||||
|
deleted: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
status: 0,
|
||||||
|
comments: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 更新visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表单验证规则
|
||||||
|
const rules = reactive({
|
||||||
|
creditCompanyName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写企业名称',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
const chooseImage = (data: FileRecord) => {
|
||||||
|
images.value.push({
|
||||||
|
uid: data.id,
|
||||||
|
url: data.path,
|
||||||
|
status: 'done'
|
||||||
|
});
|
||||||
|
form.image = data.path;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDeleteItem = (index: number) => {
|
||||||
|
images.value.splice(index, 1);
|
||||||
|
form.image = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
const { resetFields } = useForm(form, rules);
|
||||||
|
|
||||||
|
/* 保存编辑 */
|
||||||
|
const save = () => {
|
||||||
|
if (!formRef.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
formRef.value
|
||||||
|
.validate()
|
||||||
|
.then(() => {
|
||||||
|
loading.value = true;
|
||||||
|
const formData = {
|
||||||
|
...form
|
||||||
|
};
|
||||||
|
const saveOrUpdate = isUpdate.value
|
||||||
|
? updateCreditCompany
|
||||||
|
: addCreditCompany;
|
||||||
|
saveOrUpdate(formData)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(visible) => {
|
||||||
|
if (visible) {
|
||||||
|
images.value = [];
|
||||||
|
if (props.data) {
|
||||||
|
assignObject(form, props.data);
|
||||||
|
isUpdate.value = true;
|
||||||
|
} else {
|
||||||
|
isUpdate.value = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
451
src/views/credit/creditCompany/components/creditCompanyInfo.vue
Normal file
451
src/views/credit/creditCompany/components/creditCompanyInfo.vue
Normal file
@@ -0,0 +1,451 @@
|
|||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<template>
|
||||||
|
<a-drawer
|
||||||
|
width="80%"
|
||||||
|
:visible="visible"
|
||||||
|
:maskClosable="false"
|
||||||
|
:maxable="maxable"
|
||||||
|
:title="data?.name"
|
||||||
|
:body-style="{ paddingBottom: '28px' }"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
>
|
||||||
|
<a-descriptions
|
||||||
|
:column="descriptionColumns"
|
||||||
|
size="small"
|
||||||
|
bordered
|
||||||
|
class="credit-company-descriptions"
|
||||||
|
>
|
||||||
|
<a-descriptions-item label="企业名称">
|
||||||
|
{{ formatValue(form.matchName) }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item label="法定代表人">
|
||||||
|
{{ formatValue(form.legalPerson) }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item label="统一社会信用代码">
|
||||||
|
{{ formatValue(form.code) }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item label="企业地址">
|
||||||
|
{{ formatValue(form.address) }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item label="电话">
|
||||||
|
{{ formatValue(form.tel) }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
<a-descriptions-item label="更多电话">
|
||||||
|
{{ formatValue(form.moreTel) }}
|
||||||
|
</a-descriptions-item>
|
||||||
|
|
||||||
|
<!-- <a-descriptions-item label="登记状态">-->
|
||||||
|
<!-- {{ formatValue(form.registrationStatus) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="法定代表人">-->
|
||||||
|
<!-- {{ formatValue(form.legalPerson) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="注册资本">-->
|
||||||
|
<!-- {{ formatValue(form.registeredCapital) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="实缴资本">-->
|
||||||
|
<!-- {{ formatValue(form.paidinCapital) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="成立日期">-->
|
||||||
|
<!-- {{ formatValue(form.establishDate) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="更多电话">-->
|
||||||
|
<!-- {{ formatValue(form.moreTel) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="邮箱">-->
|
||||||
|
<!-- {{ formatValue(form.email) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="更多邮箱">-->
|
||||||
|
<!-- {{ formatValue(form.moreEmail) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="所在国家">-->
|
||||||
|
<!-- {{ formatValue(form.country) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="所属省份">-->
|
||||||
|
<!-- {{ formatValue(form.province) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="所属城市">-->
|
||||||
|
<!-- {{ formatValue(form.city) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="所属区县">-->
|
||||||
|
<!-- {{ formatValue(form.region) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="企业(机构)类型">-->
|
||||||
|
<!-- {{ formatValue(form.institutionType) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="纳税人识别号">-->
|
||||||
|
<!-- {{ formatValue(form.taxpayerCode) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="注册号">-->
|
||||||
|
<!-- {{ formatValue(form.registrationNumber) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="组织机构代码">-->
|
||||||
|
<!-- {{ formatValue(form.organizationalCode) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="参保人数">-->
|
||||||
|
<!-- {{ formatValue(form.numberOfInsuredPersons) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="参保人数所属年报">-->
|
||||||
|
<!-- {{ formatValue(form.annualReport) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="营业期限">-->
|
||||||
|
<!-- {{ formatValue(form.businessTerm) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="国标行业门类">-->
|
||||||
|
<!-- {{ formatValue(form.nationalStandardIndustryCategories) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="国标行业大类">-->
|
||||||
|
<!-- {{ formatValue(form.nationalStandardIndustryCategories2) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="国标行业中类">-->
|
||||||
|
<!-- {{ formatValue(form.nationalStandardIndustryCategories3) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="国标行业小类">-->
|
||||||
|
<!-- {{ formatValue(form.nationalStandardIndustryCategories4) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="企查查行业门类">-->
|
||||||
|
<!-- {{ formatValue(form.nationalStandardIndustryCategories5) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="企查查行业大类">-->
|
||||||
|
<!-- {{ formatValue(form.nationalStandardIndustryCategories6) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="企查查行业中类">-->
|
||||||
|
<!-- {{ formatValue(form.nationalStandardIndustryCategories7) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="企查查行业小类">-->
|
||||||
|
<!-- {{ formatValue(form.nationalStandardIndustryCategories8) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="企业规模">-->
|
||||||
|
<!-- {{ formatValue(form.companySize) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="曾用名">-->
|
||||||
|
<!-- {{ formatValue(form.formerName) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="英文名">-->
|
||||||
|
<!-- {{ formatValue(form.englishName) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="官网">-->
|
||||||
|
<!-- {{ formatValue(form.domain) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="通信地址">-->
|
||||||
|
<!-- {{ formatValue(form.mailingAddress) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="企业简介">-->
|
||||||
|
<!-- {{ formatValue(form.companyProfile) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="经营范围">-->
|
||||||
|
<!-- {{ formatValue(form.natureOfBusiness) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="登记机关">-->
|
||||||
|
<!-- {{ formatValue(form.registrationAuthority) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="纳税人资质">-->
|
||||||
|
<!-- {{ formatValue(form.taxpayerQualification) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="最新年报年份">-->
|
||||||
|
<!-- {{ formatValue(form.latestAnnualReportYear) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="最新年报营业收入">-->
|
||||||
|
<!-- {{ formatValue(form.latestAnnualReportOnOperatingRevenue) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="企查分">-->
|
||||||
|
<!-- {{ formatValue(form.enterpriseScoreCheck) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="信用等级">-->
|
||||||
|
<!-- {{ formatValue(form.creditRating) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="科创分">-->
|
||||||
|
<!-- {{ formatValue(form.cechnologyScore) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="科创等级">-->
|
||||||
|
<!-- {{ formatValue(form.cechnologyLevel) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="是否小微企业">-->
|
||||||
|
<!-- {{ formatValue(form.smallEnterprise) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="备注">-->
|
||||||
|
<!-- {{ formatValue(form.comments) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="排序">-->
|
||||||
|
<!-- {{ formatValue(form.sortNumber) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
<!-- <a-descriptions-item label="状态">-->
|
||||||
|
<!-- {{ formatStatus(form.status) }}-->
|
||||||
|
<!-- </a-descriptions-item>-->
|
||||||
|
</a-descriptions>
|
||||||
|
<a-divider style="margin: 16px 0" />
|
||||||
|
<a-tabs
|
||||||
|
v-model:activeKey="activeTab"
|
||||||
|
type="card"
|
||||||
|
class="credit-company-tabs"
|
||||||
|
>
|
||||||
|
<a-tab-pane v-for="tab in tabList" :key="tab.key" :tab="tab.label">
|
||||||
|
<a-table
|
||||||
|
v-if="tabState[tab.key].columns.length"
|
||||||
|
size="small"
|
||||||
|
:columns="tabState[tab.key].columns"
|
||||||
|
:data-source="tabState[tab.key].data"
|
||||||
|
:loading="tabState[tab.key].loading"
|
||||||
|
:row-key="getRowKey"
|
||||||
|
:scroll="{ x: 'max-content' }"
|
||||||
|
:pagination="false"
|
||||||
|
/>
|
||||||
|
<a-empty
|
||||||
|
v-else-if="!tabState[tab.key].loading"
|
||||||
|
description="暂无数据"
|
||||||
|
/>
|
||||||
|
</a-tab-pane>
|
||||||
|
</a-tabs>
|
||||||
|
</a-drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, reactive, ref, watch } from 'vue';
|
||||||
|
import { message } from 'ant-design-vue';
|
||||||
|
import { assignObject } from 'ele-admin-pro';
|
||||||
|
import { CreditCompany } from '@/api/credit/creditCompany/model';
|
||||||
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { pageCreditUser } from '@/api/credit/creditUser';
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
// 弹窗是否打开
|
||||||
|
visible: boolean;
|
||||||
|
// 修改回显的数据
|
||||||
|
data?: CreditCompany | null;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 是否显示最大化切换按钮
|
||||||
|
const maxable = ref(true);
|
||||||
|
|
||||||
|
// 是否开启响应式布局
|
||||||
|
const themeStore = useThemeStore();
|
||||||
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
|
const descriptionColumns = computed(() => (styleResponsive.value ? 3 : 2));
|
||||||
|
|
||||||
|
const tabList = [
|
||||||
|
{ key: '招投标', label: '招投标' },
|
||||||
|
{ key: '对外投资', label: '对外投资' },
|
||||||
|
{ key: '风险关系', label: '风险关系' },
|
||||||
|
{ key: '竞争对手', label: '竞争对手' },
|
||||||
|
{ key: '供应商', label: '供应商' },
|
||||||
|
{ key: '客户', label: '客户' },
|
||||||
|
{ key: '立案信息', label: '立案信息' },
|
||||||
|
{ key: '诉前调解', label: '诉前调解' },
|
||||||
|
{ key: '开庭公告', label: '开庭公告' },
|
||||||
|
{ key: '法院公告', label: '法院公告' },
|
||||||
|
{ key: '送达公告', label: '送达公告' },
|
||||||
|
{ key: '裁判文书', label: '裁判文书' },
|
||||||
|
{ key: '被执行人', label: '被执行人' },
|
||||||
|
{ key: '失信被执行人', label: '失信被执行人' },
|
||||||
|
{ key: '终本案件', label: '终本案件' },
|
||||||
|
{ key: '限制高消费', label: '限制高消费' },
|
||||||
|
{ key: '股权冻结', label: '股权冻结' },
|
||||||
|
{ key: '司法案件', label: '司法案件' }
|
||||||
|
];
|
||||||
|
|
||||||
|
type TableColumn = {
|
||||||
|
title: string;
|
||||||
|
dataIndex: string;
|
||||||
|
key: string;
|
||||||
|
ellipsis?: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
type TabState = {
|
||||||
|
loading: boolean;
|
||||||
|
data: Record<string, any>[];
|
||||||
|
columns: TableColumn[];
|
||||||
|
};
|
||||||
|
|
||||||
|
const tabState = reactive<Record<string, TabState>>({});
|
||||||
|
tabList.forEach((tab) => {
|
||||||
|
tabState[tab.key] = {
|
||||||
|
loading: false,
|
||||||
|
data: [],
|
||||||
|
columns: []
|
||||||
|
};
|
||||||
|
});
|
||||||
|
const activeTab = ref(tabList[0].key);
|
||||||
|
|
||||||
|
const defaultForm: CreditCompany = {
|
||||||
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
|
matchName: undefined,
|
||||||
|
code: undefined,
|
||||||
|
type: undefined,
|
||||||
|
parentId: undefined,
|
||||||
|
registrationStatus: undefined,
|
||||||
|
legalPerson: undefined,
|
||||||
|
registeredCapital: undefined,
|
||||||
|
paidinCapital: undefined,
|
||||||
|
establishDate: undefined,
|
||||||
|
address: undefined,
|
||||||
|
tel: undefined,
|
||||||
|
moreTel: undefined,
|
||||||
|
email: undefined,
|
||||||
|
moreEmail: undefined,
|
||||||
|
country: undefined,
|
||||||
|
province: undefined,
|
||||||
|
city: undefined,
|
||||||
|
region: undefined,
|
||||||
|
institutionType: undefined,
|
||||||
|
taxpayerCode: undefined,
|
||||||
|
registrationNumber: undefined,
|
||||||
|
organizationalCode: undefined,
|
||||||
|
numberOfInsuredPersons: undefined,
|
||||||
|
annualReport: undefined,
|
||||||
|
businessTerm: undefined,
|
||||||
|
nationalStandardIndustryCategories: undefined,
|
||||||
|
nationalStandardIndustryCategories2: undefined,
|
||||||
|
nationalStandardIndustryCategories3: undefined,
|
||||||
|
nationalStandardIndustryCategories4: undefined,
|
||||||
|
nationalStandardIndustryCategories5: undefined,
|
||||||
|
nationalStandardIndustryCategories6: undefined,
|
||||||
|
nationalStandardIndustryCategories7: undefined,
|
||||||
|
nationalStandardIndustryCategories8: undefined,
|
||||||
|
companySize: undefined,
|
||||||
|
formerName: undefined,
|
||||||
|
englishName: undefined,
|
||||||
|
domain: undefined,
|
||||||
|
mailingAddress: undefined,
|
||||||
|
companyProfile: undefined,
|
||||||
|
natureOfBusiness: undefined,
|
||||||
|
registrationAuthority: undefined,
|
||||||
|
taxpayerQualification: undefined,
|
||||||
|
latestAnnualReportYear: undefined,
|
||||||
|
latestAnnualReportOnOperatingRevenue: undefined,
|
||||||
|
enterpriseScoreCheck: undefined,
|
||||||
|
creditRating: undefined,
|
||||||
|
cechnologyScore: undefined,
|
||||||
|
cechnologyLevel: undefined,
|
||||||
|
smallEnterprise: undefined,
|
||||||
|
recommend: undefined,
|
||||||
|
sortNumber: undefined,
|
||||||
|
deleted: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
status: 0,
|
||||||
|
comments: ''
|
||||||
|
};
|
||||||
|
|
||||||
|
// 用户信息
|
||||||
|
const form = reactive<CreditCompany>({ ...defaultForm });
|
||||||
|
|
||||||
|
/* 更新visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const formatValue = (value: unknown) => {
|
||||||
|
if (value === undefined || value === null || value === '') {
|
||||||
|
return '-';
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
};
|
||||||
|
|
||||||
|
// const formatStatus = (status?: number) => {
|
||||||
|
// if (status === 0) {
|
||||||
|
// return '显示';
|
||||||
|
// }
|
||||||
|
// if (status === 1) {
|
||||||
|
// return '隐藏';
|
||||||
|
// }
|
||||||
|
// return '-';
|
||||||
|
// };
|
||||||
|
|
||||||
|
const getRowKey = (record: Record<string, any>, index: number) => {
|
||||||
|
return record.id ?? record.code ?? record.key ?? index;
|
||||||
|
};
|
||||||
|
|
||||||
|
const buildColumns = (rows: Record<string, any>[]): TableColumn[] => {
|
||||||
|
if (!rows.length) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
return Object.keys(rows[0]).map((key) => ({
|
||||||
|
title: key,
|
||||||
|
dataIndex: key,
|
||||||
|
key,
|
||||||
|
ellipsis: true
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
|
||||||
|
const resetForm = () => {
|
||||||
|
Object.assign(form, defaultForm);
|
||||||
|
};
|
||||||
|
|
||||||
|
const clearTabData = () => {
|
||||||
|
tabList.forEach((tab) => {
|
||||||
|
tabState[tab.key].data = [];
|
||||||
|
tabState[tab.key].columns = [];
|
||||||
|
tabState[tab.key].loading = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const loadTabData = async (key: string) => {
|
||||||
|
const keywords = form.matchName ?? props.data?.matchName;
|
||||||
|
const state = tabState[key];
|
||||||
|
if (!keywords) {
|
||||||
|
state.data = [];
|
||||||
|
state.columns = [];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
state.loading = true;
|
||||||
|
try {
|
||||||
|
const res = await pageCreditUser({ keywords });
|
||||||
|
state.data = res?.list || [];
|
||||||
|
state.columns = buildColumns(state.data);
|
||||||
|
} catch (e: any) {
|
||||||
|
state.data = [];
|
||||||
|
state.columns = [];
|
||||||
|
message.error(e?.message ?? '查询失败');
|
||||||
|
} finally {
|
||||||
|
state.loading = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => activeTab.value,
|
||||||
|
(key) => {
|
||||||
|
loadTabData(key);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(visible) => {
|
||||||
|
if (visible) {
|
||||||
|
resetForm();
|
||||||
|
clearTabData();
|
||||||
|
if (props.data) {
|
||||||
|
assignObject(form, props.data);
|
||||||
|
}
|
||||||
|
activeTab.value = tabList[0].key;
|
||||||
|
loadTabData(activeTab.value);
|
||||||
|
} else {
|
||||||
|
resetForm();
|
||||||
|
clearTabData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.data,
|
||||||
|
(data) => {
|
||||||
|
if (!props.visible || !data) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
resetForm();
|
||||||
|
clearTabData();
|
||||||
|
assignObject(form, data);
|
||||||
|
loadTabData(activeTab.value);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
103
src/views/credit/creditCompany/components/search.vue
Normal file
103
src/views/credit/creditCompany/components/search.vue
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
<!-- 搜索表单 -->
|
||||||
|
<template>
|
||||||
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
|
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||||
|
<template #icon>
|
||||||
|
<PlusOutlined />
|
||||||
|
</template>
|
||||||
|
<span>添加</span>
|
||||||
|
</a-button>
|
||||||
|
<a-button class="ele-btn-icon" @click="openImport">
|
||||||
|
<template #icon>
|
||||||
|
<CloudUploadOutlined />
|
||||||
|
</template>
|
||||||
|
<span>导入</span>
|
||||||
|
</a-button>
|
||||||
|
<a-button class="ele-btn-icon" @click="exportData">
|
||||||
|
<template #icon>
|
||||||
|
<CloudDownloadOutlined />
|
||||||
|
</template>
|
||||||
|
<span>导出</span>
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
danger
|
||||||
|
class="ele-btn-icon"
|
||||||
|
:disabled="!selection?.length"
|
||||||
|
@click="remove"
|
||||||
|
>
|
||||||
|
<template #icon>
|
||||||
|
<DeleteOutlined />
|
||||||
|
</template>
|
||||||
|
<span>批量删除</span>
|
||||||
|
</a-button>
|
||||||
|
<a-input-search
|
||||||
|
allow-clear
|
||||||
|
v-model:value="keywords"
|
||||||
|
placeholder="请输入关键词"
|
||||||
|
style="width: 220px"
|
||||||
|
@search="handleSearch"
|
||||||
|
@pressEnter="handleSearch"
|
||||||
|
/>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import {
|
||||||
|
PlusOutlined,
|
||||||
|
CloudUploadOutlined,
|
||||||
|
CloudDownloadOutlined,
|
||||||
|
DeleteOutlined
|
||||||
|
} from '@ant-design/icons-vue';
|
||||||
|
import type {
|
||||||
|
CreditJudiciary,
|
||||||
|
CreditJudiciaryParam
|
||||||
|
} from '@/api/credit/creditJudiciary/model';
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
// 选中的角色
|
||||||
|
selection?: CreditJudiciary[];
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
|
selection: () => []
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'search', where?: CreditJudiciaryParam): void;
|
||||||
|
(e: 'add'): void;
|
||||||
|
(e: 'remove'): void;
|
||||||
|
(e: 'batchMove'): void;
|
||||||
|
(e: 'importData'): void;
|
||||||
|
(e: 'exportData'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const keywords = ref('');
|
||||||
|
const selection = computed(() => props.selection || []);
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
const add = () => {
|
||||||
|
emit('add');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 搜索
|
||||||
|
const handleSearch = () => {
|
||||||
|
emit('search', { keywords: keywords.value });
|
||||||
|
};
|
||||||
|
|
||||||
|
// 导入
|
||||||
|
const openImport = () => {
|
||||||
|
emit('importData');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 导出
|
||||||
|
const exportData = () => {
|
||||||
|
emit('exportData');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 批量删除
|
||||||
|
const remove = () => {
|
||||||
|
emit('remove');
|
||||||
|
};
|
||||||
|
</script>
|
||||||
438
src/views/credit/creditCompany/index.vue
Normal file
438
src/views/credit/creditCompany/index.vue
Normal file
@@ -0,0 +1,438 @@
|
|||||||
|
<template>
|
||||||
|
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||||
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
|
<ele-pro-table
|
||||||
|
ref="tableRef"
|
||||||
|
row-key="id"
|
||||||
|
:columns="columns"
|
||||||
|
:datasource="datasource"
|
||||||
|
:customRow="customRow"
|
||||||
|
tool-class="ele-toolbar-form"
|
||||||
|
:scroll="{ x: 2000 }"
|
||||||
|
class="sys-org-table"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<search
|
||||||
|
@search="reload"
|
||||||
|
:selection="selection"
|
||||||
|
@add="openEdit"
|
||||||
|
@remove="removeBatch"
|
||||||
|
@batchMove="openMove"
|
||||||
|
@importData="openImport"
|
||||||
|
@exportData="exportData"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'image'">
|
||||||
|
<a-image :src="record.image" :width="50" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'status'">
|
||||||
|
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||||
|
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'action'">
|
||||||
|
<a-button type="primary" @click="openInfo(record)">详情</a-button>
|
||||||
|
<!-- <a-dropdown-button @click="handleButtonClick">-->
|
||||||
|
<!-- 操作-->
|
||||||
|
<!-- <template #overlay>-->
|
||||||
|
<!-- <a-menu @click="handleMenuClick">-->
|
||||||
|
<!-- <a-menu-item key="1">招投标</a-menu-item>-->
|
||||||
|
<!-- <a-menu-item key="2">对外投资</a-menu-item>-->
|
||||||
|
<!-- <a-menu-item key="3">风险关系</a-menu-item>-->
|
||||||
|
<!-- <a-menu-item key="4">竞争对手</a-menu-item>-->
|
||||||
|
<!-- <a-menu-item key="5">供应商</a-menu-item>-->
|
||||||
|
<!-- <a-menu-item key="6">客户</a-menu-item>-->
|
||||||
|
<!-- <a-menu-item key="7">立案信息</a-menu-item>-->
|
||||||
|
<!-- <a-menu-item key="8">诉前调解</a-menu-item>-->
|
||||||
|
<!-- <a-menu-item key="9">开庭公告</a-menu-item>-->
|
||||||
|
<!-- <a-menu-item key="10">法院公告</a-menu-item>-->
|
||||||
|
<!-- <a-menu-item key="11">送达公告</a-menu-item>-->
|
||||||
|
<!-- <a-menu-item key="12">裁判文书</a-menu-item>-->
|
||||||
|
<!-- <a-menu-item key="13">被执行人</a-menu-item>-->
|
||||||
|
<!-- <a-menu-item key="14">失信被执行人</a-menu-item>-->
|
||||||
|
<!-- <a-menu-item key="15">终本案件</a-menu-item>-->
|
||||||
|
<!-- <a-menu-item key="16">限制高消费</a-menu-item>-->
|
||||||
|
<!-- <a-menu-item key="17">股权冻结</a-menu-item>-->
|
||||||
|
<!-- <a-menu-item key="18">司法案件</a-menu-item>-->
|
||||||
|
<!-- </a-menu>-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </a-dropdown-button>-->
|
||||||
|
|
||||||
|
<!-- <a @click="openEdit(record)">修改</a>-->
|
||||||
|
<!-- <a-divider type="vertical" />-->
|
||||||
|
<!-- <a-popconfirm-->
|
||||||
|
<!-- title="确定要删除此记录吗?"-->
|
||||||
|
<!-- @confirm="remove(record)"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <a class="ele-text-danger">删除</a>-->
|
||||||
|
<!-- </a-popconfirm>-->
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</ele-pro-table>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<CreditCompanyEdit
|
||||||
|
v-model:visible="showEdit"
|
||||||
|
:data="current"
|
||||||
|
@done="reload"
|
||||||
|
/>
|
||||||
|
<!-- 导入弹窗 -->
|
||||||
|
<CreditCompanyImport v-model:visible="showImport" @done="reload" />
|
||||||
|
<!-- 企业详情 -->
|
||||||
|
<CreditCompanyInfo
|
||||||
|
v-model:visible="showInfo"
|
||||||
|
:data="current"
|
||||||
|
@done="reload"
|
||||||
|
/>
|
||||||
|
</a-page-header>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { createVNode, ref } from 'vue';
|
||||||
|
import { message, Modal } from 'ant-design-vue';
|
||||||
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
|
import { toDateString } from 'ele-admin-pro';
|
||||||
|
import type {
|
||||||
|
DatasourceFunction,
|
||||||
|
ColumnItem
|
||||||
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
|
import Search from './components/search.vue';
|
||||||
|
import { getPageTitle } from '@/utils/common';
|
||||||
|
import CreditCompanyEdit from './components/creditCompanyEdit.vue';
|
||||||
|
import {
|
||||||
|
pageCreditCompany,
|
||||||
|
listCreditCompany,
|
||||||
|
removeCreditCompany,
|
||||||
|
removeBatchCreditCompany
|
||||||
|
} from '@/api/credit/creditCompany';
|
||||||
|
import type {
|
||||||
|
CreditCompany,
|
||||||
|
CreditCompanyParam
|
||||||
|
} from '@/api/credit/creditCompany/model';
|
||||||
|
import CreditCompanyImport from './components/credit-company-import.vue';
|
||||||
|
import CreditCompanyInfo from './components/creditCompanyInfo.vue';
|
||||||
|
import { exportCreditData } from '../utils/export';
|
||||||
|
|
||||||
|
// 表格实例
|
||||||
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
|
|
||||||
|
// 表格选中数据
|
||||||
|
const selection = ref<CreditCompany[]>([]);
|
||||||
|
// 当前编辑数据
|
||||||
|
const current = ref<CreditCompany | null>(null);
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
const showEdit = ref(false);
|
||||||
|
// 是否显示批量移动弹窗
|
||||||
|
const showMove = ref(false);
|
||||||
|
// 是否显示导入弹窗
|
||||||
|
const showImport = ref(false);
|
||||||
|
// 是否显示详情弹窗
|
||||||
|
const showInfo = ref(false);
|
||||||
|
// 加载状态
|
||||||
|
const loading = ref(true);
|
||||||
|
// 搜索关键词
|
||||||
|
const searchText = ref('');
|
||||||
|
|
||||||
|
// 表格数据源
|
||||||
|
const datasource: DatasourceFunction = ({
|
||||||
|
page,
|
||||||
|
limit,
|
||||||
|
where = {},
|
||||||
|
orders,
|
||||||
|
filters
|
||||||
|
}) => {
|
||||||
|
const params: CreditCompanyParam = { ...where };
|
||||||
|
if (filters) {
|
||||||
|
(params as any).status = filters.status;
|
||||||
|
}
|
||||||
|
if (!params.keywords && searchText.value) {
|
||||||
|
params.keywords = searchText.value;
|
||||||
|
}
|
||||||
|
return pageCreditCompany({
|
||||||
|
...params,
|
||||||
|
...orders,
|
||||||
|
page,
|
||||||
|
limit
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关键信息列
|
||||||
|
const columns = ref<ColumnItem[]>([
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
width: 120,
|
||||||
|
fixed: 'left',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '原文件导入名称',
|
||||||
|
dataIndex: 'name',
|
||||||
|
key: 'name',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 240
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '系统匹配企业名称',
|
||||||
|
dataIndex: 'matchName',
|
||||||
|
key: 'matchName',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 240
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '统一社会信用代码',
|
||||||
|
dataIndex: 'code',
|
||||||
|
key: 'code',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '登记状态',
|
||||||
|
dataIndex: 'registrationStatus',
|
||||||
|
key: 'registrationStatus',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '法定代表人',
|
||||||
|
dataIndex: 'legalPerson',
|
||||||
|
key: 'legalPerson',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '注册资本',
|
||||||
|
dataIndex: 'registeredCapital',
|
||||||
|
key: 'registeredCapital',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '成立日期',
|
||||||
|
dataIndex: 'establishDate',
|
||||||
|
key: 'establishDate',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '电话',
|
||||||
|
dataIndex: 'tel',
|
||||||
|
key: 'tel',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '所属省份',
|
||||||
|
dataIndex: 'province',
|
||||||
|
key: 'province',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '所属城市',
|
||||||
|
dataIndex: 'city',
|
||||||
|
key: 'city',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '企查分',
|
||||||
|
dataIndex: 'enterpriseScoreCheck',
|
||||||
|
key: 'enterpriseScoreCheck',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '信用等级',
|
||||||
|
dataIndex: 'creditRating',
|
||||||
|
key: 'creditRating',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '是否小微企业',
|
||||||
|
dataIndex: 'smallEnterprise',
|
||||||
|
key: 'smallEnterprise',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
key: 'createTime',
|
||||||
|
width: 180,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
}
|
||||||
|
// {
|
||||||
|
// title: '备注',
|
||||||
|
// dataIndex: 'comments',
|
||||||
|
// key: 'comments',
|
||||||
|
// ellipsis: true
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '是否推荐',
|
||||||
|
// dataIndex: 'recommend',
|
||||||
|
// key: 'recommend',
|
||||||
|
// width: 120
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '排序',
|
||||||
|
// dataIndex: 'sortNumber',
|
||||||
|
// key: 'sortNumber',
|
||||||
|
// width: 120
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '状态',
|
||||||
|
// dataIndex: 'status',
|
||||||
|
// key: 'status',
|
||||||
|
// width: 120
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '创建时间',
|
||||||
|
// dataIndex: 'createTime',
|
||||||
|
// key: 'createTime',
|
||||||
|
// width: 200,
|
||||||
|
// align: 'center',
|
||||||
|
// sorter: true,
|
||||||
|
// ellipsis: true,
|
||||||
|
// customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
// }
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const reload = (where?: CreditCompanyParam) => {
|
||||||
|
if (where && Object.prototype.hasOwnProperty.call(where, 'keywords')) {
|
||||||
|
searchText.value = where.keywords ?? '';
|
||||||
|
}
|
||||||
|
const targetWhere = where ?? { keywords: searchText.value || undefined };
|
||||||
|
selection.value = [];
|
||||||
|
tableRef?.value?.reload({ where: targetWhere });
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开编辑弹窗 */
|
||||||
|
const openEdit = (row?: CreditCompany) => {
|
||||||
|
current.value = row ?? null;
|
||||||
|
showEdit.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开批量移动弹窗 */
|
||||||
|
const openMove = () => {
|
||||||
|
showMove.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开导入弹窗 */
|
||||||
|
const openImport = () => {
|
||||||
|
showImport.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 导出 */
|
||||||
|
const exportData = () => {
|
||||||
|
exportCreditData<CreditCompany>({
|
||||||
|
filename: '企业',
|
||||||
|
columns: [
|
||||||
|
{ title: '原文件导入名称', dataIndex: 'name' },
|
||||||
|
{ title: '系统匹配企业名称', dataIndex: 'matchName' },
|
||||||
|
{ title: '统一社会信用代码', dataIndex: 'code' },
|
||||||
|
{ title: '登记状态', dataIndex: 'registrationStatus' },
|
||||||
|
{ title: '法定代表人', dataIndex: 'legalPerson' },
|
||||||
|
{ title: '注册资本', dataIndex: 'registeredCapital' },
|
||||||
|
{ title: '成立日期', dataIndex: 'establishDate' },
|
||||||
|
{ title: '所属省份', dataIndex: 'province' },
|
||||||
|
{ title: '所属城市', dataIndex: 'city' },
|
||||||
|
{ title: '企查分', dataIndex: 'enterpriseScoreCheck' },
|
||||||
|
{ title: '信用等级', dataIndex: 'creditRating' },
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
formatter: (record: CreditCompany) =>
|
||||||
|
record.createTime
|
||||||
|
? toDateString(record.createTime, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
],
|
||||||
|
fetchData: () =>
|
||||||
|
listCreditCompany({
|
||||||
|
keywords: searchText.value || undefined
|
||||||
|
})
|
||||||
|
});
|
||||||
|
};
|
||||||
|
/* 打开企业详情 */
|
||||||
|
const openInfo = (row?: CreditCompany) => {
|
||||||
|
current.value = row ?? null;
|
||||||
|
showInfo.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 删除单个 */
|
||||||
|
const remove = (row: CreditCompany) => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeCreditCompany(row.id)
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 批量删除 */
|
||||||
|
const removeBatch = () => {
|
||||||
|
if (!selection.value.length) {
|
||||||
|
message.error('请至少选择一条数据');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要删除选中的记录吗?',
|
||||||
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
|
maskClosable: true,
|
||||||
|
onOk: () => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeBatchCreditCompany(selection.value.map((d) => d.id))
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 查询 */
|
||||||
|
const query = () => {
|
||||||
|
loading.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 自定义行属性 */
|
||||||
|
const customRow = (record: CreditCompany) => {
|
||||||
|
return {
|
||||||
|
// 行点击事件
|
||||||
|
onClick: () => {
|
||||||
|
// console.log(record);
|
||||||
|
},
|
||||||
|
// 行双击事件
|
||||||
|
onDblclick: () => {
|
||||||
|
openEdit(record);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
query();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default {
|
||||||
|
name: 'CreditCompany'
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
<!-- 竞争对手导入弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="520"
|
||||||
|
:footer="null"
|
||||||
|
title="竞争对手批量导入"
|
||||||
|
:visible="visible"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
>
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<a-upload-dragger
|
||||||
|
accept=".xls,.xlsx"
|
||||||
|
:show-upload-list="false"
|
||||||
|
:customRequest="doUpload"
|
||||||
|
style="padding: 24px 0; margin-bottom: 16px"
|
||||||
|
>
|
||||||
|
<p class="ant-upload-drag-icon">
|
||||||
|
<cloud-upload-outlined />
|
||||||
|
</p>
|
||||||
|
<p class="ant-upload-hint">将文件拖到此处,或点击上传</p>
|
||||||
|
</a-upload-dragger>
|
||||||
|
</a-spin>
|
||||||
|
<div class="ele-text-center">
|
||||||
|
<span>只能上传xls、xlsx文件,</span>
|
||||||
|
<a :href="templateUrl" download="竞争对手导入模板.xlsx"> 下载导入模板 </a>
|
||||||
|
</div>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { message } from 'ant-design-vue/es';
|
||||||
|
import { CloudUploadOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { importCreditCompetitor } from '@/api/credit/creditCompetitor';
|
||||||
|
import { API_BASE_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
// 是否打开弹窗
|
||||||
|
visible: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 导入请求状态
|
||||||
|
const loading = ref(false);
|
||||||
|
|
||||||
|
// 模板下载地址,保持与当前接口域名一致
|
||||||
|
const templateUrl = computed(() => {
|
||||||
|
const base = (localStorage.getItem('ApiUrl') || API_BASE_URL || '').replace(
|
||||||
|
/\/$/,
|
||||||
|
''
|
||||||
|
);
|
||||||
|
return `${base}/credit/credit-competitor/import/template`;
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 上传 */
|
||||||
|
const doUpload = ({ file }) => {
|
||||||
|
if (
|
||||||
|
![
|
||||||
|
'application/vnd.ms-excel',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
].includes(file.type)
|
||||||
|
) {
|
||||||
|
message.error('只能选择 excel 文件');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (file.size / 1024 / 1024 > 10) {
|
||||||
|
message.error('大小不能超过 10MB');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
loading.value = true;
|
||||||
|
importCreditCompetitor(file)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 更新 visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -0,0 +1,276 @@
|
|||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="800"
|
||||||
|
:visible="visible"
|
||||||
|
:maskClosable="false"
|
||||||
|
:maxable="maxable"
|
||||||
|
:title="isUpdate ? '编辑竞争对手' : '添加竞争对手'"
|
||||||
|
:body-style="{ paddingBottom: '28px' }"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
@ok="save"
|
||||||
|
>
|
||||||
|
<a-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||||
|
:wrapper-col="
|
||||||
|
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<a-form-item label="企业名称" name="companyName">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入企业名称"
|
||||||
|
v-model:value="form.companyName"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="法定代表人" name="legalRepresentative">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入法定代表人"
|
||||||
|
v-model:value="form.legalRepresentative"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="注册资本" name="registeredCapital">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入注册资本"
|
||||||
|
v-model:value="form.registeredCapital"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="成立日期" name="establishmentDate">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入成立日期"
|
||||||
|
v-model:value="form.establishmentDate"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="登记状态" name="registrationStatus">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入登记状态"
|
||||||
|
v-model:value="form.registrationStatus"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="所属行业" name="industry">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入所属行业"
|
||||||
|
v-model:value="form.industry"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="所属省份" name="province">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入所属省份"
|
||||||
|
v-model:value="form.province"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="备注" name="comments">
|
||||||
|
<a-textarea
|
||||||
|
:rows="4"
|
||||||
|
:maxlength="200"
|
||||||
|
placeholder="请输入描述"
|
||||||
|
v-model:value="form.comments"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否推荐" name="recommend">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否推荐"
|
||||||
|
v-model:value="form.recommend"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
|
||||||
|
<a-input-number
|
||||||
|
:min="0"
|
||||||
|
:max="9999"
|
||||||
|
class="ele-fluid"
|
||||||
|
placeholder="请输入排序号"
|
||||||
|
v-model:value="form.sortNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="状态, 0正常, 1冻结" name="status">
|
||||||
|
<a-radio-group v-model:value="form.status">
|
||||||
|
<a-radio :value="0">显示</a-radio>
|
||||||
|
<a-radio :value="1">隐藏</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否删除, 0否, 1是" name="deleted">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否删除, 0否, 1是"
|
||||||
|
v-model:value="form.deleted"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="用户ID" name="userId">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入用户ID"
|
||||||
|
v-model:value="form.userId"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="修改时间" name="updateTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入修改时间"
|
||||||
|
v-model:value="form.updateTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, watch } from 'vue';
|
||||||
|
import { Form, message } from 'ant-design-vue';
|
||||||
|
import { assignObject, uuid } from 'ele-admin-pro';
|
||||||
|
import { addCreditCompetitor, updateCreditCompetitor } from '@/api/credit/creditCompetitor';
|
||||||
|
import { CreditCompetitor } from '@/api/credit/creditCompetitor/model';
|
||||||
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
|
|
||||||
|
// 是否是修改
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
// 是否开启响应式布局
|
||||||
|
const themeStore = useThemeStore();
|
||||||
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
// 弹窗是否打开
|
||||||
|
visible: boolean;
|
||||||
|
// 修改回显的数据
|
||||||
|
data?: CreditCompetitor | null;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 提交状态
|
||||||
|
const loading = ref(false);
|
||||||
|
// 是否显示最大化切换按钮
|
||||||
|
const maxable = ref(true);
|
||||||
|
// 表格选中数据
|
||||||
|
const formRef = ref<FormInstance | null>(null);
|
||||||
|
const images = ref<ItemType[]>([]);
|
||||||
|
|
||||||
|
// 用户信息
|
||||||
|
const form = reactive<CreditCompetitor>({
|
||||||
|
id: undefined,
|
||||||
|
companyName: undefined,
|
||||||
|
legalRepresentative: undefined,
|
||||||
|
registeredCapital: undefined,
|
||||||
|
establishmentDate: undefined,
|
||||||
|
registrationStatus: undefined,
|
||||||
|
industry: undefined,
|
||||||
|
province: undefined,
|
||||||
|
comments: undefined,
|
||||||
|
recommend: undefined,
|
||||||
|
sortNumber: undefined,
|
||||||
|
status: undefined,
|
||||||
|
deleted: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
creditCompetitorId: undefined,
|
||||||
|
creditCompetitorName: '',
|
||||||
|
status: 0,
|
||||||
|
comments: '',
|
||||||
|
sortNumber: 100
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 更新visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表单验证规则
|
||||||
|
const rules = reactive({
|
||||||
|
creditCompetitorName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写竞争对手名称',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
const chooseImage = (data: FileRecord) => {
|
||||||
|
images.value.push({
|
||||||
|
uid: data.id,
|
||||||
|
url: data.path,
|
||||||
|
status: 'done'
|
||||||
|
});
|
||||||
|
form.image = data.path;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDeleteItem = (index: number) => {
|
||||||
|
images.value.splice(index, 1);
|
||||||
|
form.image = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
const { resetFields } = useForm(form, rules);
|
||||||
|
|
||||||
|
/* 保存编辑 */
|
||||||
|
const save = () => {
|
||||||
|
if (!formRef.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
formRef.value
|
||||||
|
.validate()
|
||||||
|
.then(() => {
|
||||||
|
loading.value = true;
|
||||||
|
const formData = {
|
||||||
|
...form
|
||||||
|
};
|
||||||
|
const saveOrUpdate = isUpdate.value ? updateCreditCompetitor : addCreditCompetitor;
|
||||||
|
saveOrUpdate(formData)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(visible) => {
|
||||||
|
if (visible) {
|
||||||
|
images.value = [];
|
||||||
|
if (props.data) {
|
||||||
|
assignObject(form, props.data);
|
||||||
|
if(props.data.image){
|
||||||
|
images.value.push({
|
||||||
|
uid: uuid(),
|
||||||
|
url: props.data.image,
|
||||||
|
status: 'done'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
isUpdate.value = true;
|
||||||
|
} else {
|
||||||
|
isUpdate.value = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
42
src/views/credit/creditCompetitor/components/search.vue
Normal file
42
src/views/credit/creditCompetitor/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<!-- 搜索表单 -->
|
||||||
|
<template>
|
||||||
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
|
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||||
|
<template #icon>
|
||||||
|
<PlusOutlined />
|
||||||
|
</template>
|
||||||
|
<span>添加</span>
|
||||||
|
</a-button>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { GradeParam } from '@/api/user/grade/model';
|
||||||
|
import { watch } from 'vue';
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
// 选中的角色
|
||||||
|
selection?: [];
|
||||||
|
}>(),
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'search', where?: GradeParam): void;
|
||||||
|
(e: 'add'): void;
|
||||||
|
(e: 'remove'): void;
|
||||||
|
(e: 'batchMove'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
const add = () => {
|
||||||
|
emit('add');
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.selection,
|
||||||
|
() => {}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
310
src/views/credit/creditCompetitor/index.vue
Normal file
310
src/views/credit/creditCompetitor/index.vue
Normal file
@@ -0,0 +1,310 @@
|
|||||||
|
<template>
|
||||||
|
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||||
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
|
<ele-pro-table
|
||||||
|
ref="tableRef"
|
||||||
|
row-key="id"
|
||||||
|
:columns="columns"
|
||||||
|
:datasource="datasource"
|
||||||
|
:customRow="customRow"
|
||||||
|
tool-class="ele-toolbar-form"
|
||||||
|
class="sys-org-table"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<search
|
||||||
|
@search="reload"
|
||||||
|
:selection="selection"
|
||||||
|
@add="openEdit"
|
||||||
|
@remove="removeBatch"
|
||||||
|
@batchMove="openMove"
|
||||||
|
@importData="openImport"
|
||||||
|
@exportData="exportData"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'image'">
|
||||||
|
<a-image :src="record.image" :width="50" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'status'">
|
||||||
|
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||||
|
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'action'">
|
||||||
|
<a-space>
|
||||||
|
<a @click="openEdit(record)">修改</a>
|
||||||
|
<a-divider type="vertical" />
|
||||||
|
<a-popconfirm
|
||||||
|
title="确定要删除此记录吗?"
|
||||||
|
@confirm="remove(record)"
|
||||||
|
>
|
||||||
|
<a class="ele-text-danger">删除</a>
|
||||||
|
</a-popconfirm>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</ele-pro-table>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<CreditCompetitorEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||||
|
<!-- 导入弹窗 -->
|
||||||
|
<CreditCompetitorImport v-model:visible="showImport" @done="reload" />
|
||||||
|
</a-page-header>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { createVNode, ref } from 'vue';
|
||||||
|
import { message, Modal } from 'ant-design-vue';
|
||||||
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
|
import { toDateString } from 'ele-admin-pro';
|
||||||
|
import type {
|
||||||
|
DatasourceFunction,
|
||||||
|
ColumnItem
|
||||||
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
|
import Search from '@/views/credit/components/CreditSearchToolbar.vue';
|
||||||
|
import { exportCreditData } from '../utils/export';
|
||||||
|
import { getPageTitle } from '@/utils/common';
|
||||||
|
import CreditCompetitorEdit from './components/creditCompetitorEdit.vue';
|
||||||
|
import CreditCompetitorImport from './components/credit-competitor-import.vue';
|
||||||
|
import {
|
||||||
|
pageCreditCompetitor,
|
||||||
|
listCreditCompetitor,
|
||||||
|
removeCreditCompetitor,
|
||||||
|
removeBatchCreditCompetitor
|
||||||
|
} from '@/api/credit/creditCompetitor';
|
||||||
|
import type {
|
||||||
|
CreditCompetitor,
|
||||||
|
CreditCompetitorParam
|
||||||
|
} from '@/api/credit/creditCompetitor/model';
|
||||||
|
|
||||||
|
// 表格实例
|
||||||
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
|
|
||||||
|
// 表格选中数据
|
||||||
|
const selection = ref<CreditCompetitor[]>([]);
|
||||||
|
// 当前编辑数据
|
||||||
|
const current = ref<CreditCompetitor | null>(null);
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
const showEdit = ref(false);
|
||||||
|
// 是否显示导入弹窗
|
||||||
|
const showImport = ref(false);
|
||||||
|
// 是否显示批量移动弹窗
|
||||||
|
const showMove = ref(false);
|
||||||
|
// 加载状态
|
||||||
|
const loading = ref(true);
|
||||||
|
// 搜索关键词
|
||||||
|
const searchText = ref('');
|
||||||
|
|
||||||
|
// 表格数据源
|
||||||
|
const datasource: DatasourceFunction = ({
|
||||||
|
page,
|
||||||
|
limit,
|
||||||
|
where = {},
|
||||||
|
orders,
|
||||||
|
filters
|
||||||
|
}) => {
|
||||||
|
const params: CreditCompetitorParam = { ...where };
|
||||||
|
if (filters) {
|
||||||
|
(params as any).status = filters.status;
|
||||||
|
}
|
||||||
|
if (!params.keywords && searchText.value) {
|
||||||
|
params.keywords = searchText.value;
|
||||||
|
}
|
||||||
|
return pageCreditCompetitor({
|
||||||
|
...params,
|
||||||
|
...orders,
|
||||||
|
page,
|
||||||
|
limit
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关键信息列
|
||||||
|
const columns = ref<ColumnItem[]>([
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
dataIndex: 'id',
|
||||||
|
key: 'id',
|
||||||
|
width: 80
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '企业名称',
|
||||||
|
dataIndex: 'companyName',
|
||||||
|
key: 'companyName',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '法定代表人',
|
||||||
|
dataIndex: 'legalRepresentative',
|
||||||
|
key: 'legalRepresentative',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '注册资本',
|
||||||
|
dataIndex: 'registeredCapital',
|
||||||
|
key: 'registeredCapital',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '成立日期',
|
||||||
|
dataIndex: 'establishmentDate',
|
||||||
|
key: 'establishmentDate',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '所属行业',
|
||||||
|
dataIndex: 'industry',
|
||||||
|
key: 'industry',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '所属省份',
|
||||||
|
dataIndex: 'province',
|
||||||
|
key: 'province',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
key: 'createTime',
|
||||||
|
width: 180,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
customRender: ({ text }) =>
|
||||||
|
toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
width: 160,
|
||||||
|
fixed: 'right',
|
||||||
|
align: 'center',
|
||||||
|
hideInSetting: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const reload = (where?: CreditCompetitorParam) => {
|
||||||
|
if (where && Object.prototype.hasOwnProperty.call(where, 'keywords')) {
|
||||||
|
searchText.value = where.keywords ?? '';
|
||||||
|
}
|
||||||
|
const targetWhere = where ?? { keywords: searchText.value || undefined };
|
||||||
|
selection.value = [];
|
||||||
|
tableRef?.value?.reload({ where: targetWhere });
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开编辑弹窗 */
|
||||||
|
const openEdit = (row?: CreditCompetitor) => {
|
||||||
|
current.value = row ?? null;
|
||||||
|
showEdit.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开批量移动弹窗 */
|
||||||
|
const openMove = () => {
|
||||||
|
showMove.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开导入弹窗 */
|
||||||
|
const openImport = () => {
|
||||||
|
showImport.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 导出 */
|
||||||
|
const exportData = () => {
|
||||||
|
exportCreditData<CreditCompetitor>({
|
||||||
|
filename: '竞争对手',
|
||||||
|
columns: [
|
||||||
|
{ title: '序号', dataIndex: 'id' },
|
||||||
|
{ title: '企业名称', dataIndex: 'companyName' },
|
||||||
|
{ title: '法定代表人', dataIndex: 'legalRepresentative' },
|
||||||
|
{ title: '注册资本', dataIndex: 'registeredCapital' },
|
||||||
|
{ title: '成立日期', dataIndex: 'establishmentDate' },
|
||||||
|
{ title: '所属行业', dataIndex: 'industry' },
|
||||||
|
{ title: '所属省份', dataIndex: 'province' },
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
formatter: (record: CreditCompetitor) =>
|
||||||
|
record.createTime
|
||||||
|
? toDateString(record.createTime, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
],
|
||||||
|
fetchData: () =>
|
||||||
|
listCreditCompetitor({
|
||||||
|
keywords: searchText.value || undefined
|
||||||
|
})
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 删除单个 */
|
||||||
|
const remove = (row: CreditCompetitor) => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeCreditCompetitor(row.id)
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 批量删除 */
|
||||||
|
const removeBatch = () => {
|
||||||
|
if (!selection.value.length) {
|
||||||
|
message.error('请至少选择一条数据');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要删除选中的记录吗?',
|
||||||
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
|
maskClosable: true,
|
||||||
|
onOk: () => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeBatchCreditCompetitor(selection.value.map((d) => d.id))
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 查询 */
|
||||||
|
const query = () => {
|
||||||
|
loading.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 自定义行属性 */
|
||||||
|
const customRow = (record: CreditCompetitor) => {
|
||||||
|
return {
|
||||||
|
// 行点击事件
|
||||||
|
onClick: () => {
|
||||||
|
// console.log(record);
|
||||||
|
},
|
||||||
|
// 行双击事件
|
||||||
|
onDblclick: () => {
|
||||||
|
openEdit(record);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
query();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default {
|
||||||
|
name: 'CreditCompetitor'
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
<!-- 法院公告导入弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="520"
|
||||||
|
:footer="null"
|
||||||
|
title="法院公告批量导入"
|
||||||
|
:visible="visible"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
>
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<a-upload-dragger
|
||||||
|
accept=".xls,.xlsx"
|
||||||
|
:show-upload-list="false"
|
||||||
|
:customRequest="doUpload"
|
||||||
|
style="padding: 24px 0; margin-bottom: 16px"
|
||||||
|
>
|
||||||
|
<p class="ant-upload-drag-icon">
|
||||||
|
<cloud-upload-outlined />
|
||||||
|
</p>
|
||||||
|
<p class="ant-upload-hint">将文件拖到此处,或点击上传</p>
|
||||||
|
</a-upload-dragger>
|
||||||
|
</a-spin>
|
||||||
|
<div class="ele-text-center">
|
||||||
|
<span>只能上传xls、xlsx文件,</span>
|
||||||
|
<a :href="templateUrl" download="法院公告导入模板.xlsx">
|
||||||
|
下载导入模板
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { message } from 'ant-design-vue/es';
|
||||||
|
import { CloudUploadOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { importCreditCourtAnnouncement } from '@/api/credit/creditCourtAnnouncement';
|
||||||
|
import { API_BASE_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
// 是否打开弹窗
|
||||||
|
visible: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 导入请求状态
|
||||||
|
const loading = ref(false);
|
||||||
|
|
||||||
|
// 模板下载地址,保持与当前接口域名一致
|
||||||
|
const templateUrl = computed(() => {
|
||||||
|
const base = (localStorage.getItem('ApiUrl') || API_BASE_URL || '').replace(
|
||||||
|
/\/$/,
|
||||||
|
''
|
||||||
|
);
|
||||||
|
return `${base}/credit/credit-court-announcement/import/template`;
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 上传 */
|
||||||
|
const doUpload = ({ file }) => {
|
||||||
|
if (
|
||||||
|
![
|
||||||
|
'application/vnd.ms-excel',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
].includes(file.type)
|
||||||
|
) {
|
||||||
|
message.error('只能选择 excel 文件');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (file.size / 1024 / 1024 > 10) {
|
||||||
|
message.error('大小不能超过 10MB');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
loading.value = true;
|
||||||
|
importCreditCourtAnnouncement(file)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 更新 visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -0,0 +1,300 @@
|
|||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="800"
|
||||||
|
:visible="visible"
|
||||||
|
:maskClosable="false"
|
||||||
|
:maxable="maxable"
|
||||||
|
:title="isUpdate ? '编辑法院公告司法大数据' : '添加法院公告司法大数据'"
|
||||||
|
:body-style="{ paddingBottom: '28px' }"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
@ok="save"
|
||||||
|
>
|
||||||
|
<a-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||||
|
:wrapper-col="
|
||||||
|
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<a-form-item label="数据类型" name="dataType">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入数据类型"
|
||||||
|
v-model:value="form.dataType"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="原告/上诉人" name="plaintiffAppellant">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入原告/上诉人"
|
||||||
|
v-model:value="form.plaintiffAppellant"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="被告/被上诉人" name="defendant appellee">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入被告/被上诉人"
|
||||||
|
v-model:value="form.appellee"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="其他当事人/第三人" name="otherPartiesThirdParty">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入其他当事人/第三人"
|
||||||
|
v-model:value="form.otherPartiesThirdParty"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="发生时间" name="occurrenceTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入发生时间"
|
||||||
|
v-model:value="form.occurrenceTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="案号" name="caseNumber">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入案号"
|
||||||
|
v-model:value="form.caseNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="案由" name="causeOfAction">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入案由"
|
||||||
|
v-model:value="form.causeOfAction"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="涉案金额" name="involvedAmount">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入涉案金额"
|
||||||
|
v-model:value="form.involvedAmount"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="法院" name="courtName">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入法院"
|
||||||
|
v-model:value="form.courtName"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="数据状态" name="dataStatus">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入数据状态"
|
||||||
|
v-model:value="form.dataStatus"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="备注" name="comments">
|
||||||
|
<a-textarea
|
||||||
|
:rows="4"
|
||||||
|
:maxlength="200"
|
||||||
|
placeholder="请输入描述"
|
||||||
|
v-model:value="form.comments"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否推荐" name="recommend">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否推荐"
|
||||||
|
v-model:value="form.recommend"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
|
||||||
|
<a-input-number
|
||||||
|
:min="0"
|
||||||
|
:max="9999"
|
||||||
|
class="ele-fluid"
|
||||||
|
placeholder="请输入排序号"
|
||||||
|
v-model:value="form.sortNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="状态, 0正常, 1冻结" name="status">
|
||||||
|
<a-radio-group v-model:value="form.status">
|
||||||
|
<a-radio :value="0">显示</a-radio>
|
||||||
|
<a-radio :value="1">隐藏</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否删除, 0否, 1是" name="deleted">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否删除, 0否, 1是"
|
||||||
|
v-model:value="form.deleted"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="用户ID" name="userId">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入用户ID"
|
||||||
|
v-model:value="form.userId"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="修改时间" name="updateTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入修改时间"
|
||||||
|
v-model:value="form.updateTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, watch } from 'vue';
|
||||||
|
import { Form, message } from 'ant-design-vue';
|
||||||
|
import { assignObject, uuid } from 'ele-admin-pro';
|
||||||
|
import { addCreditCourtAnnouncement, updateCreditCourtAnnouncement } from '@/api/credit/creditCourtAnnouncement';
|
||||||
|
import { CreditCourtAnnouncement } from '@/api/credit/creditCourtAnnouncement/model';
|
||||||
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
|
|
||||||
|
// 是否是修改
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
// 是否开启响应式布局
|
||||||
|
const themeStore = useThemeStore();
|
||||||
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
// 弹窗是否打开
|
||||||
|
visible: boolean;
|
||||||
|
// 修改回显的数据
|
||||||
|
data?: CreditCourtAnnouncement | null;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 提交状态
|
||||||
|
const loading = ref(false);
|
||||||
|
// 是否显示最大化切换按钮
|
||||||
|
const maxable = ref(true);
|
||||||
|
// 表格选中数据
|
||||||
|
const formRef = ref<FormInstance | null>(null);
|
||||||
|
const images = ref<ItemType[]>([]);
|
||||||
|
|
||||||
|
// 用户信息
|
||||||
|
const form = reactive<CreditCourtAnnouncement>({
|
||||||
|
id: undefined,
|
||||||
|
dataType: undefined,
|
||||||
|
plaintiffAppellant: undefined,
|
||||||
|
appellee: undefined,
|
||||||
|
otherPartiesThirdParty: undefined,
|
||||||
|
occurrenceTime: undefined,
|
||||||
|
caseNumber: undefined,
|
||||||
|
causeOfAction: undefined,
|
||||||
|
involvedAmount: undefined,
|
||||||
|
courtName: undefined,
|
||||||
|
dataStatus: undefined,
|
||||||
|
comments: undefined,
|
||||||
|
recommend: undefined,
|
||||||
|
sortNumber: undefined,
|
||||||
|
status: undefined,
|
||||||
|
deleted: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
creditCourtAnnouncementId: undefined,
|
||||||
|
creditCourtAnnouncementName: '',
|
||||||
|
status: 0,
|
||||||
|
comments: '',
|
||||||
|
sortNumber: 100
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 更新visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表单验证规则
|
||||||
|
const rules = reactive({
|
||||||
|
creditCourtAnnouncementName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写法院公告司法大数据名称',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
const chooseImage = (data: FileRecord) => {
|
||||||
|
images.value.push({
|
||||||
|
uid: data.id,
|
||||||
|
url: data.path,
|
||||||
|
status: 'done'
|
||||||
|
});
|
||||||
|
form.image = data.path;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDeleteItem = (index: number) => {
|
||||||
|
images.value.splice(index, 1);
|
||||||
|
form.image = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
const { resetFields } = useForm(form, rules);
|
||||||
|
|
||||||
|
/* 保存编辑 */
|
||||||
|
const save = () => {
|
||||||
|
if (!formRef.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
formRef.value
|
||||||
|
.validate()
|
||||||
|
.then(() => {
|
||||||
|
loading.value = true;
|
||||||
|
const formData = {
|
||||||
|
...form
|
||||||
|
};
|
||||||
|
const saveOrUpdate = isUpdate.value ? updateCreditCourtAnnouncement : addCreditCourtAnnouncement;
|
||||||
|
saveOrUpdate(formData)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(visible) => {
|
||||||
|
if (visible) {
|
||||||
|
images.value = [];
|
||||||
|
if (props.data) {
|
||||||
|
assignObject(form, props.data);
|
||||||
|
if(props.data.image){
|
||||||
|
images.value.push({
|
||||||
|
uid: uuid(),
|
||||||
|
url: props.data.image,
|
||||||
|
status: 'done'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
isUpdate.value = true;
|
||||||
|
} else {
|
||||||
|
isUpdate.value = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
<!-- 搜索表单 -->
|
||||||
|
<template>
|
||||||
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
|
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||||
|
<template #icon>
|
||||||
|
<PlusOutlined />
|
||||||
|
</template>
|
||||||
|
<span>添加</span>
|
||||||
|
</a-button>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { GradeParam } from '@/api/user/grade/model';
|
||||||
|
import { watch } from 'vue';
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
// 选中的角色
|
||||||
|
selection?: [];
|
||||||
|
}>(),
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'search', where?: GradeParam): void;
|
||||||
|
(e: 'add'): void;
|
||||||
|
(e: 'remove'): void;
|
||||||
|
(e: 'batchMove'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
const add = () => {
|
||||||
|
emit('add');
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.selection,
|
||||||
|
() => {}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
326
src/views/credit/creditCourtAnnouncement/index.vue
Normal file
326
src/views/credit/creditCourtAnnouncement/index.vue
Normal file
@@ -0,0 +1,326 @@
|
|||||||
|
<template>
|
||||||
|
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||||
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
|
<ele-pro-table
|
||||||
|
ref="tableRef"
|
||||||
|
row-key="id"
|
||||||
|
:columns="columns"
|
||||||
|
:datasource="datasource"
|
||||||
|
:customRow="customRow"
|
||||||
|
tool-class="ele-toolbar-form"
|
||||||
|
class="sys-org-table"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<search
|
||||||
|
@search="reload"
|
||||||
|
:selection="selection"
|
||||||
|
@add="openEdit"
|
||||||
|
@remove="removeBatch"
|
||||||
|
@batchMove="openMove"
|
||||||
|
@importData="openImport"
|
||||||
|
@exportData="exportData"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'image'">
|
||||||
|
<a-image :src="record.image" :width="50" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'status'">
|
||||||
|
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||||
|
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'action'">
|
||||||
|
<a-space>
|
||||||
|
<a @click="openEdit(record)">修改</a>
|
||||||
|
<a-divider type="vertical" />
|
||||||
|
<a-popconfirm
|
||||||
|
title="确定要删除此记录吗?"
|
||||||
|
@confirm="remove(record)"
|
||||||
|
>
|
||||||
|
<a class="ele-text-danger">删除</a>
|
||||||
|
</a-popconfirm>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</ele-pro-table>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<CreditCourtAnnouncementEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||||
|
<!-- 导入弹窗 -->
|
||||||
|
<CreditCourtAnnouncementImport
|
||||||
|
v-model:visible="showImport"
|
||||||
|
@done="reload"
|
||||||
|
/>
|
||||||
|
</a-page-header>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { createVNode, ref } from 'vue';
|
||||||
|
import { message, Modal } from 'ant-design-vue';
|
||||||
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
|
import { toDateString } from 'ele-admin-pro';
|
||||||
|
import type {
|
||||||
|
DatasourceFunction,
|
||||||
|
ColumnItem
|
||||||
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
|
import Search from '@/views/credit/components/CreditSearchToolbar.vue';
|
||||||
|
import { exportCreditData } from '../utils/export';
|
||||||
|
import { getPageTitle } from '@/utils/common';
|
||||||
|
import CreditCourtAnnouncementEdit from './components/creditCourtAnnouncementEdit.vue';
|
||||||
|
import CreditCourtAnnouncementImport from './components/credit-court-announcement-import.vue';
|
||||||
|
import {
|
||||||
|
pageCreditCourtAnnouncement,
|
||||||
|
listCreditCourtAnnouncement,
|
||||||
|
removeCreditCourtAnnouncement,
|
||||||
|
removeBatchCreditCourtAnnouncement
|
||||||
|
} from '@/api/credit/creditCourtAnnouncement';
|
||||||
|
import type {
|
||||||
|
CreditCourtAnnouncement,
|
||||||
|
CreditCourtAnnouncementParam
|
||||||
|
} from '@/api/credit/creditCourtAnnouncement/model';
|
||||||
|
|
||||||
|
// 表格实例
|
||||||
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
|
|
||||||
|
// 表格选中数据
|
||||||
|
const selection = ref<CreditCourtAnnouncement[]>([]);
|
||||||
|
// 当前编辑数据
|
||||||
|
const current = ref<CreditCourtAnnouncement | null>(null);
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
const showEdit = ref(false);
|
||||||
|
// 是否显示导入弹窗
|
||||||
|
const showImport = ref(false);
|
||||||
|
// 是否显示批量移动弹窗
|
||||||
|
const showMove = ref(false);
|
||||||
|
// 加载状态
|
||||||
|
const loading = ref(true);
|
||||||
|
// 搜索关键词
|
||||||
|
const searchText = ref('');
|
||||||
|
|
||||||
|
// 表格数据源
|
||||||
|
const datasource: DatasourceFunction = ({
|
||||||
|
page,
|
||||||
|
limit,
|
||||||
|
where = {},
|
||||||
|
orders,
|
||||||
|
filters
|
||||||
|
}) => {
|
||||||
|
const params: CreditCourtAnnouncementParam = { ...where };
|
||||||
|
if (filters) {
|
||||||
|
(params as any).status = filters.status;
|
||||||
|
}
|
||||||
|
if (!params.keywords && searchText.value) {
|
||||||
|
params.keywords = searchText.value;
|
||||||
|
}
|
||||||
|
return pageCreditCourtAnnouncement({
|
||||||
|
...params,
|
||||||
|
...orders,
|
||||||
|
page,
|
||||||
|
limit
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关键信息列
|
||||||
|
const columns = ref<ColumnItem[]>([
|
||||||
|
{
|
||||||
|
title: 'ID',
|
||||||
|
dataIndex: 'id',
|
||||||
|
key: 'id',
|
||||||
|
width: 80
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数据类型',
|
||||||
|
dataIndex: 'dataType',
|
||||||
|
key: 'dataType',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '原告/上诉人',
|
||||||
|
dataIndex: 'plaintiffAppellant',
|
||||||
|
key: 'plaintiffAppellant',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '发生时间',
|
||||||
|
dataIndex: 'occurrenceTime',
|
||||||
|
key: 'occurrenceTime',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '案号',
|
||||||
|
dataIndex: 'caseNumber',
|
||||||
|
key: 'caseNumber',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '案由',
|
||||||
|
dataIndex: 'causeOfAction',
|
||||||
|
key: 'causeOfAction',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '涉案金额',
|
||||||
|
dataIndex: 'involvedAmount',
|
||||||
|
key: 'involvedAmount',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '法院',
|
||||||
|
dataIndex: 'courtName',
|
||||||
|
key: 'courtName',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数据状态',
|
||||||
|
dataIndex: 'dataStatus',
|
||||||
|
key: 'dataStatus',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
key: 'createTime',
|
||||||
|
width: 180,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
customRender: ({ text }) =>
|
||||||
|
toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
width: 160,
|
||||||
|
fixed: 'right',
|
||||||
|
align: 'center',
|
||||||
|
hideInSetting: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const reload = (where?: CreditCourtAnnouncementParam) => {
|
||||||
|
if (where && Object.prototype.hasOwnProperty.call(where, 'keywords')) {
|
||||||
|
searchText.value = where.keywords ?? '';
|
||||||
|
}
|
||||||
|
const targetWhere = where ?? { keywords: searchText.value || undefined };
|
||||||
|
selection.value = [];
|
||||||
|
tableRef?.value?.reload({ where: targetWhere });
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开编辑弹窗 */
|
||||||
|
const openEdit = (row?: CreditCourtAnnouncement) => {
|
||||||
|
current.value = row ?? null;
|
||||||
|
showEdit.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开批量移动弹窗 */
|
||||||
|
const openMove = () => {
|
||||||
|
showMove.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开导入弹窗 */
|
||||||
|
const openImport = () => {
|
||||||
|
showImport.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 导出 */
|
||||||
|
const exportData = () => {
|
||||||
|
exportCreditData<CreditCourtAnnouncement>({
|
||||||
|
filename: '法院公告',
|
||||||
|
columns: [
|
||||||
|
{ title: 'ID', dataIndex: 'id' },
|
||||||
|
{ title: '数据类型', dataIndex: 'dataType' },
|
||||||
|
{ title: '原告/上诉人', dataIndex: 'plaintiffAppellant' },
|
||||||
|
{ title: '发生时间', dataIndex: 'occurrenceTime' },
|
||||||
|
{ title: '案号', dataIndex: 'caseNumber' },
|
||||||
|
{ title: '案由', dataIndex: 'causeOfAction' },
|
||||||
|
{ title: '涉案金额', dataIndex: 'involvedAmount' },
|
||||||
|
{ title: '法院', dataIndex: 'courtName' },
|
||||||
|
{ title: '数据状态', dataIndex: 'dataStatus' },
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
formatter: (record: CreditCourtAnnouncement) =>
|
||||||
|
record.createTime
|
||||||
|
? toDateString(record.createTime, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
],
|
||||||
|
fetchData: () =>
|
||||||
|
listCreditCourtAnnouncement({
|
||||||
|
keywords: searchText.value || undefined
|
||||||
|
})
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 删除单个 */
|
||||||
|
const remove = (row: CreditCourtAnnouncement) => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeCreditCourtAnnouncement(row.id)
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 批量删除 */
|
||||||
|
const removeBatch = () => {
|
||||||
|
if (!selection.value.length) {
|
||||||
|
message.error('请至少选择一条数据');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要删除选中的记录吗?',
|
||||||
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
|
maskClosable: true,
|
||||||
|
onOk: () => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeBatchCreditCourtAnnouncement(selection.value.map((d) => d.id))
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 查询 */
|
||||||
|
const query = () => {
|
||||||
|
loading.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 自定义行属性 */
|
||||||
|
const customRow = (record: CreditCourtAnnouncement) => {
|
||||||
|
return {
|
||||||
|
// 行点击事件
|
||||||
|
onClick: () => {
|
||||||
|
// console.log(record);
|
||||||
|
},
|
||||||
|
// 行双击事件
|
||||||
|
onDblclick: () => {
|
||||||
|
openEdit(record);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
query();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default {
|
||||||
|
name: 'CreditCourtAnnouncement'
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
<!-- 开庭公告导入弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="520"
|
||||||
|
:footer="null"
|
||||||
|
title="开庭公告批量导入"
|
||||||
|
:visible="visible"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
>
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<a-upload-dragger
|
||||||
|
accept=".xls,.xlsx"
|
||||||
|
:show-upload-list="false"
|
||||||
|
:customRequest="doUpload"
|
||||||
|
style="padding: 24px 0; margin-bottom: 16px"
|
||||||
|
>
|
||||||
|
<p class="ant-upload-drag-icon">
|
||||||
|
<cloud-upload-outlined />
|
||||||
|
</p>
|
||||||
|
<p class="ant-upload-hint">将文件拖到此处,或点击上传</p>
|
||||||
|
</a-upload-dragger>
|
||||||
|
</a-spin>
|
||||||
|
<div class="ele-text-center">
|
||||||
|
<span>只能上传xls、xlsx文件,</span>
|
||||||
|
<a :href="templateUrl" download="开庭公告导入模板.xlsx">
|
||||||
|
下载导入模板
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { message } from 'ant-design-vue/es';
|
||||||
|
import { CloudUploadOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { importCreditCourtSession } from '@/api/credit/creditCourtSession';
|
||||||
|
import { API_BASE_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
// 是否打开弹窗
|
||||||
|
visible: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 导入请求状态
|
||||||
|
const loading = ref(false);
|
||||||
|
|
||||||
|
// 模板下载地址,保持与当前接口域名一致
|
||||||
|
const templateUrl = computed(() => {
|
||||||
|
const base = (localStorage.getItem('ApiUrl') || API_BASE_URL || '').replace(
|
||||||
|
/\/$/,
|
||||||
|
''
|
||||||
|
);
|
||||||
|
return `${base}/credit/credit-court-session/import/template`;
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 上传 */
|
||||||
|
const doUpload = ({ file }) => {
|
||||||
|
if (
|
||||||
|
![
|
||||||
|
'application/vnd.ms-excel',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
].includes(file.type)
|
||||||
|
) {
|
||||||
|
message.error('只能选择 excel 文件');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (file.size / 1024 / 1024 > 10) {
|
||||||
|
message.error('大小不能超过 10MB');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
loading.value = true;
|
||||||
|
importCreditCourtSession(file)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 更新 visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -0,0 +1,300 @@
|
|||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="800"
|
||||||
|
:visible="visible"
|
||||||
|
:maskClosable="false"
|
||||||
|
:maxable="maxable"
|
||||||
|
:title="isUpdate ? '编辑开庭公告司法大数据' : '添加开庭公告司法大数据'"
|
||||||
|
:body-style="{ paddingBottom: '28px' }"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
@ok="save"
|
||||||
|
>
|
||||||
|
<a-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||||
|
:wrapper-col="
|
||||||
|
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<a-form-item label="数据类型" name="dataType">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入数据类型"
|
||||||
|
v-model:value="form.dataType"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="原告/上诉人" name="plaintiffAppellant">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入原告/上诉人"
|
||||||
|
v-model:value="form.plaintiffAppellant"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="被告/被上诉人" name="defendant appellee">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入被告/被上诉人"
|
||||||
|
v-model:value="form.appellee"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="其他当事人/第三人" name="otherPartiesThirdParty">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入其他当事人/第三人"
|
||||||
|
v-model:value="form.otherPartiesThirdParty"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="发生时间" name="occurrenceTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入发生时间"
|
||||||
|
v-model:value="form.occurrenceTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="案号" name="caseNumber">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入案号"
|
||||||
|
v-model:value="form.caseNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="案由" name="causeOfAction">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入案由"
|
||||||
|
v-model:value="form.causeOfAction"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="涉案金额" name="involvedAmount">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入涉案金额"
|
||||||
|
v-model:value="form.involvedAmount"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="法院" name="courtName">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入法院"
|
||||||
|
v-model:value="form.courtName"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="数据状态" name="dataStatus">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入数据状态"
|
||||||
|
v-model:value="form.dataStatus"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="备注" name="comments">
|
||||||
|
<a-textarea
|
||||||
|
:rows="4"
|
||||||
|
:maxlength="200"
|
||||||
|
placeholder="请输入描述"
|
||||||
|
v-model:value="form.comments"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否推荐" name="recommend">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否推荐"
|
||||||
|
v-model:value="form.recommend"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
|
||||||
|
<a-input-number
|
||||||
|
:min="0"
|
||||||
|
:max="9999"
|
||||||
|
class="ele-fluid"
|
||||||
|
placeholder="请输入排序号"
|
||||||
|
v-model:value="form.sortNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="状态, 0正常, 1冻结" name="status">
|
||||||
|
<a-radio-group v-model:value="form.status">
|
||||||
|
<a-radio :value="0">显示</a-radio>
|
||||||
|
<a-radio :value="1">隐藏</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否删除, 0否, 1是" name="deleted">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否删除, 0否, 1是"
|
||||||
|
v-model:value="form.deleted"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="用户ID" name="userId">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入用户ID"
|
||||||
|
v-model:value="form.userId"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="修改时间" name="updateTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入修改时间"
|
||||||
|
v-model:value="form.updateTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, watch } from 'vue';
|
||||||
|
import { Form, message } from 'ant-design-vue';
|
||||||
|
import { assignObject, uuid } from 'ele-admin-pro';
|
||||||
|
import {
|
||||||
|
addCreditCourtSession,
|
||||||
|
updateCreditCourtSession
|
||||||
|
} from '@/api/credit/creditCourtSession';
|
||||||
|
import { CreditCourtSession } from '@/api/credit/creditCourtSession/model';
|
||||||
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
|
|
||||||
|
// 是否是修改
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
// 是否开启响应式布局
|
||||||
|
const themeStore = useThemeStore();
|
||||||
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
// 弹窗是否打开
|
||||||
|
visible: boolean;
|
||||||
|
// 修改回显的数据
|
||||||
|
data?: CreditCourtSession | null;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 提交状态
|
||||||
|
const loading = ref(false);
|
||||||
|
// 是否显示最大化切换按钮
|
||||||
|
const maxable = ref(true);
|
||||||
|
// 表格选中数据
|
||||||
|
const formRef = ref<FormInstance | null>(null);
|
||||||
|
const images = ref<ItemType[]>([]);
|
||||||
|
|
||||||
|
// 用户信息
|
||||||
|
const form = reactive<CreditCourtSession>({
|
||||||
|
id: undefined,
|
||||||
|
dataType: undefined,
|
||||||
|
plaintiffAppellant: undefined,
|
||||||
|
appellee: undefined,
|
||||||
|
otherPartiesThirdParty: undefined,
|
||||||
|
occurrenceTime: undefined,
|
||||||
|
caseNumber: undefined,
|
||||||
|
causeOfAction: undefined,
|
||||||
|
involvedAmount: undefined,
|
||||||
|
courtName: undefined,
|
||||||
|
dataStatus: undefined,
|
||||||
|
recommend: undefined,
|
||||||
|
sortNumber: undefined,
|
||||||
|
deleted: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
status: 0,
|
||||||
|
comments: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 更新visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表单验证规则
|
||||||
|
const rules = reactive({
|
||||||
|
creditCourtSessionName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写开庭公告司法大数据名称',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
const chooseImage = (data: FileRecord) => {
|
||||||
|
images.value.push({
|
||||||
|
uid: data.id,
|
||||||
|
url: data.path,
|
||||||
|
status: 'done'
|
||||||
|
});
|
||||||
|
form.image = data.path;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDeleteItem = (index: number) => {
|
||||||
|
images.value.splice(index, 1);
|
||||||
|
form.image = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
const { resetFields } = useForm(form, rules);
|
||||||
|
|
||||||
|
/* 保存编辑 */
|
||||||
|
const save = () => {
|
||||||
|
if (!formRef.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
formRef.value
|
||||||
|
.validate()
|
||||||
|
.then(() => {
|
||||||
|
loading.value = true;
|
||||||
|
const formData = {
|
||||||
|
...form
|
||||||
|
};
|
||||||
|
const saveOrUpdate = isUpdate.value
|
||||||
|
? updateCreditCourtSession
|
||||||
|
: addCreditCourtSession;
|
||||||
|
saveOrUpdate(formData)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(visible) => {
|
||||||
|
if (visible) {
|
||||||
|
images.value = [];
|
||||||
|
if (props.data) {
|
||||||
|
assignObject(form, props.data);
|
||||||
|
if (props.data.image) {
|
||||||
|
images.value.push({
|
||||||
|
uid: uuid(),
|
||||||
|
url: props.data.image,
|
||||||
|
status: 'done'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
isUpdate.value = true;
|
||||||
|
} else {
|
||||||
|
isUpdate.value = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
42
src/views/credit/creditCourtSession/components/search.vue
Normal file
42
src/views/credit/creditCourtSession/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<!-- 搜索表单 -->
|
||||||
|
<template>
|
||||||
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
|
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||||
|
<template #icon>
|
||||||
|
<PlusOutlined />
|
||||||
|
</template>
|
||||||
|
<span>添加</span>
|
||||||
|
</a-button>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { GradeParam } from '@/api/user/grade/model';
|
||||||
|
import { watch } from 'vue';
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
// 选中的角色
|
||||||
|
selection?: [];
|
||||||
|
}>(),
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'search', where?: GradeParam): void;
|
||||||
|
(e: 'add'): void;
|
||||||
|
(e: 'remove'): void;
|
||||||
|
(e: 'batchMove'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
const add = () => {
|
||||||
|
emit('add');
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.selection,
|
||||||
|
() => {}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
326
src/views/credit/creditCourtSession/index.vue
Normal file
326
src/views/credit/creditCourtSession/index.vue
Normal file
@@ -0,0 +1,326 @@
|
|||||||
|
<template>
|
||||||
|
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||||
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
|
<ele-pro-table
|
||||||
|
ref="tableRef"
|
||||||
|
row-key="id"
|
||||||
|
:columns="columns"
|
||||||
|
:datasource="datasource"
|
||||||
|
:customRow="customRow"
|
||||||
|
tool-class="ele-toolbar-form"
|
||||||
|
class="sys-org-table"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<search
|
||||||
|
@search="reload"
|
||||||
|
:selection="selection"
|
||||||
|
@add="openEdit"
|
||||||
|
@remove="removeBatch"
|
||||||
|
@batchMove="openMove"
|
||||||
|
@importData="openImport"
|
||||||
|
@exportData="exportData"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'image'">
|
||||||
|
<a-image :src="record.image" :width="50" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'status'">
|
||||||
|
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||||
|
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'action'">
|
||||||
|
<a-space>
|
||||||
|
<a @click="openEdit(record)">修改</a>
|
||||||
|
<a-divider type="vertical" />
|
||||||
|
<a-popconfirm
|
||||||
|
title="确定要删除此记录吗?"
|
||||||
|
@confirm="remove(record)"
|
||||||
|
>
|
||||||
|
<a class="ele-text-danger">删除</a>
|
||||||
|
</a-popconfirm>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</ele-pro-table>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<CreditCourtSessionEdit
|
||||||
|
v-model:visible="showEdit"
|
||||||
|
:data="current"
|
||||||
|
@done="reload"
|
||||||
|
/>
|
||||||
|
<!-- 导入弹窗 -->
|
||||||
|
<CreditCourtSessionImport v-model:visible="showImport" @done="reload" />
|
||||||
|
</a-page-header>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { createVNode, ref } from 'vue';
|
||||||
|
import { message, Modal } from 'ant-design-vue';
|
||||||
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
|
import { toDateString } from 'ele-admin-pro';
|
||||||
|
import type {
|
||||||
|
DatasourceFunction,
|
||||||
|
ColumnItem
|
||||||
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
|
import Search from '@/views/credit/components/CreditSearchToolbar.vue';
|
||||||
|
import { exportCreditData } from '../utils/export';
|
||||||
|
import { getPageTitle } from '@/utils/common';
|
||||||
|
import CreditCourtSessionEdit from './components/creditCourtSessionEdit.vue';
|
||||||
|
import CreditCourtSessionImport from './components/credit-court-session-import.vue';
|
||||||
|
import {
|
||||||
|
pageCreditCourtSession,
|
||||||
|
listCreditCourtSession,
|
||||||
|
removeCreditCourtSession,
|
||||||
|
removeBatchCreditCourtSession
|
||||||
|
} from '@/api/credit/creditCourtSession';
|
||||||
|
import type {
|
||||||
|
CreditCourtSession,
|
||||||
|
CreditCourtSessionParam
|
||||||
|
} from '@/api/credit/creditCourtSession/model';
|
||||||
|
|
||||||
|
// 表格实例
|
||||||
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
|
|
||||||
|
// 表格选中数据
|
||||||
|
const selection = ref<CreditCourtSession[]>([]);
|
||||||
|
// 当前编辑数据
|
||||||
|
const current = ref<CreditCourtSession | null>(null);
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
const showEdit = ref(false);
|
||||||
|
// 是否显示导入弹窗
|
||||||
|
const showImport = ref(false);
|
||||||
|
// 是否显示批量移动弹窗
|
||||||
|
const showMove = ref(false);
|
||||||
|
// 加载状态
|
||||||
|
const loading = ref(true);
|
||||||
|
// 搜索关键词
|
||||||
|
const searchText = ref('');
|
||||||
|
|
||||||
|
// 表格数据源
|
||||||
|
const datasource: DatasourceFunction = ({
|
||||||
|
page,
|
||||||
|
limit,
|
||||||
|
where = {},
|
||||||
|
orders,
|
||||||
|
filters
|
||||||
|
}) => {
|
||||||
|
const params: CreditCourtSessionParam = { ...where };
|
||||||
|
if (filters) {
|
||||||
|
(params as any).status = filters.status;
|
||||||
|
}
|
||||||
|
if (!params.keywords && searchText.value) {
|
||||||
|
params.keywords = searchText.value;
|
||||||
|
}
|
||||||
|
return pageCreditCourtSession({
|
||||||
|
...params,
|
||||||
|
...orders,
|
||||||
|
page,
|
||||||
|
limit
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关键信息列
|
||||||
|
const columns = ref<ColumnItem[]>([
|
||||||
|
{
|
||||||
|
title: 'ID',
|
||||||
|
dataIndex: 'id',
|
||||||
|
key: 'id',
|
||||||
|
width: 80
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数据类型',
|
||||||
|
dataIndex: 'dataType',
|
||||||
|
key: 'dataType',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '原告/上诉人',
|
||||||
|
dataIndex: 'plaintiffAppellant',
|
||||||
|
key: 'plaintiffAppellant',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '发生时间',
|
||||||
|
dataIndex: 'occurrenceTime',
|
||||||
|
key: 'occurrenceTime',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '案号',
|
||||||
|
dataIndex: 'caseNumber',
|
||||||
|
key: 'caseNumber',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '案由',
|
||||||
|
dataIndex: 'causeOfAction',
|
||||||
|
key: 'causeOfAction',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '涉案金额',
|
||||||
|
dataIndex: 'involvedAmount',
|
||||||
|
key: 'involvedAmount',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '法院',
|
||||||
|
dataIndex: 'courtName',
|
||||||
|
key: 'courtName',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数据状态',
|
||||||
|
dataIndex: 'dataStatus',
|
||||||
|
key: 'dataStatus',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
key: 'createTime',
|
||||||
|
width: 180,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
width: 160,
|
||||||
|
fixed: 'right',
|
||||||
|
align: 'center',
|
||||||
|
hideInSetting: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const reload = (where?: CreditCourtSessionParam) => {
|
||||||
|
if (where && Object.prototype.hasOwnProperty.call(where, 'keywords')) {
|
||||||
|
searchText.value = where.keywords ?? '';
|
||||||
|
}
|
||||||
|
const targetWhere = where ?? { keywords: searchText.value || undefined };
|
||||||
|
selection.value = [];
|
||||||
|
tableRef?.value?.reload({ where: targetWhere });
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开编辑弹窗 */
|
||||||
|
const openEdit = (row?: CreditCourtSession) => {
|
||||||
|
current.value = row ?? null;
|
||||||
|
showEdit.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开批量移动弹窗 */
|
||||||
|
const openMove = () => {
|
||||||
|
showMove.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开导入弹窗 */
|
||||||
|
const openImport = () => {
|
||||||
|
showImport.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 导出 */
|
||||||
|
const exportData = () => {
|
||||||
|
exportCreditData<CreditCourtSession>({
|
||||||
|
filename: '开庭公告',
|
||||||
|
columns: [
|
||||||
|
{ title: 'ID', dataIndex: 'id' },
|
||||||
|
{ title: '数据类型', dataIndex: 'dataType' },
|
||||||
|
{ title: '原告/上诉人', dataIndex: 'plaintiffAppellant' },
|
||||||
|
{ title: '发生时间', dataIndex: 'occurrenceTime' },
|
||||||
|
{ title: '案号', dataIndex: 'caseNumber' },
|
||||||
|
{ title: '案由', dataIndex: 'causeOfAction' },
|
||||||
|
{ title: '涉案金额', dataIndex: 'involvedAmount' },
|
||||||
|
{ title: '法院', dataIndex: 'courtName' },
|
||||||
|
{ title: '数据状态', dataIndex: 'dataStatus' },
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
formatter: (record: CreditCourtSession) =>
|
||||||
|
record.createTime
|
||||||
|
? toDateString(record.createTime, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
],
|
||||||
|
fetchData: () =>
|
||||||
|
listCreditCourtSession({
|
||||||
|
keywords: searchText.value || undefined
|
||||||
|
})
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 删除单个 */
|
||||||
|
const remove = (row: CreditCourtSession) => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeCreditCourtSession(row.id)
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 批量删除 */
|
||||||
|
const removeBatch = () => {
|
||||||
|
if (!selection.value.length) {
|
||||||
|
message.error('请至少选择一条数据');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要删除选中的记录吗?',
|
||||||
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
|
maskClosable: true,
|
||||||
|
onOk: () => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeBatchCreditCourtSession(selection.value.map((d) => d.id))
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 查询 */
|
||||||
|
const query = () => {
|
||||||
|
loading.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 自定义行属性 */
|
||||||
|
const customRow = (record: CreditCourtSession) => {
|
||||||
|
return {
|
||||||
|
// 行点击事件
|
||||||
|
onClick: () => {
|
||||||
|
// console.log(record);
|
||||||
|
},
|
||||||
|
// 行双击事件
|
||||||
|
onDblclick: () => {
|
||||||
|
openEdit(record);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
query();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default {
|
||||||
|
name: 'CreditCourtSession'
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
<!-- 客户导入弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="520"
|
||||||
|
:footer="null"
|
||||||
|
title="客户批量导入"
|
||||||
|
:visible="visible"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
>
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<a-upload-dragger
|
||||||
|
accept=".xls,.xlsx"
|
||||||
|
:show-upload-list="false"
|
||||||
|
:customRequest="doUpload"
|
||||||
|
style="padding: 24px 0; margin-bottom: 16px"
|
||||||
|
>
|
||||||
|
<p class="ant-upload-drag-icon">
|
||||||
|
<cloud-upload-outlined />
|
||||||
|
</p>
|
||||||
|
<p class="ant-upload-hint">将文件拖到此处,或点击上传</p>
|
||||||
|
</a-upload-dragger>
|
||||||
|
</a-spin>
|
||||||
|
<div class="ele-text-center">
|
||||||
|
<span>只能上传xls、xlsx文件,</span>
|
||||||
|
<a :href="templateUrl" download="客户导入模板.xlsx"> 下载导入模板 </a>
|
||||||
|
</div>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { message } from 'ant-design-vue/es';
|
||||||
|
import { CloudUploadOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { importCreditCustomer } from '@/api/credit/creditCustomer';
|
||||||
|
import { API_BASE_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
// 是否打开弹窗
|
||||||
|
visible: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 导入请求状态
|
||||||
|
const loading = ref(false);
|
||||||
|
|
||||||
|
// 模板下载地址,保持与当前接口域名一致
|
||||||
|
const templateUrl = computed(() => {
|
||||||
|
const base = (localStorage.getItem('ApiUrl') || API_BASE_URL || '').replace(
|
||||||
|
/\/$/,
|
||||||
|
''
|
||||||
|
);
|
||||||
|
return `${base}/credit/credit-customer/import/template`;
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 上传 */
|
||||||
|
const doUpload = ({ file }) => {
|
||||||
|
if (
|
||||||
|
![
|
||||||
|
'application/vnd.ms-excel',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
].includes(file.type)
|
||||||
|
) {
|
||||||
|
message.error('只能选择 excel 文件');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (file.size / 1024 / 1024 > 10) {
|
||||||
|
message.error('大小不能超过 10MB');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
loading.value = true;
|
||||||
|
importCreditCustomer(file)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 更新 visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -0,0 +1,255 @@
|
|||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="800"
|
||||||
|
:visible="visible"
|
||||||
|
:maskClosable="false"
|
||||||
|
:maxable="maxable"
|
||||||
|
:title="isUpdate ? '编辑客户' : '添加客户'"
|
||||||
|
:body-style="{ paddingBottom: '28px' }"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
@ok="save"
|
||||||
|
>
|
||||||
|
<a-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||||
|
:wrapper-col="
|
||||||
|
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<a-form-item label="客户" name="name">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入客户"
|
||||||
|
v-model:value="form.name"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="状态" name="statusTxt">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入状态"
|
||||||
|
v-model:value="form.statusTxt"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="销售金额(万元)" name="price">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入销售金额(万元)"
|
||||||
|
v-model:value="form.price"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="公开日期" name="publicDate">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入公开日期"
|
||||||
|
v-model:value="form.publicDate"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="数据来源" name="dataSource">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入数据来源"
|
||||||
|
v-model:value="form.dataSource"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="备注" name="comments">
|
||||||
|
<a-textarea
|
||||||
|
:rows="4"
|
||||||
|
:maxlength="200"
|
||||||
|
placeholder="请输入描述"
|
||||||
|
v-model:value="form.comments"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否推荐" name="recommend">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否推荐"
|
||||||
|
v-model:value="form.recommend"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
|
||||||
|
<a-input-number
|
||||||
|
:min="0"
|
||||||
|
:max="9999"
|
||||||
|
class="ele-fluid"
|
||||||
|
placeholder="请输入排序号"
|
||||||
|
v-model:value="form.sortNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="状态, 0正常, 1冻结" name="status">
|
||||||
|
<a-radio-group v-model:value="form.status">
|
||||||
|
<a-radio :value="0">显示</a-radio>
|
||||||
|
<a-radio :value="1">隐藏</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否删除, 0否, 1是" name="deleted">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否删除, 0否, 1是"
|
||||||
|
v-model:value="form.deleted"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="用户ID" name="userId">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入用户ID"
|
||||||
|
v-model:value="form.userId"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="修改时间" name="updateTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入修改时间"
|
||||||
|
v-model:value="form.updateTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, watch } from 'vue';
|
||||||
|
import { Form, message } from 'ant-design-vue';
|
||||||
|
import { assignObject, uuid } from 'ele-admin-pro';
|
||||||
|
import { addCreditCustomer, updateCreditCustomer } from '@/api/credit/creditCustomer';
|
||||||
|
import { CreditCustomer } from '@/api/credit/creditCustomer/model';
|
||||||
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
|
|
||||||
|
// 是否是修改
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
// 是否开启响应式布局
|
||||||
|
const themeStore = useThemeStore();
|
||||||
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
// 弹窗是否打开
|
||||||
|
visible: boolean;
|
||||||
|
// 修改回显的数据
|
||||||
|
data?: CreditCustomer | null;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 提交状态
|
||||||
|
const loading = ref(false);
|
||||||
|
// 是否显示最大化切换按钮
|
||||||
|
const maxable = ref(true);
|
||||||
|
// 表格选中数据
|
||||||
|
const formRef = ref<FormInstance | null>(null);
|
||||||
|
const images = ref<ItemType[]>([]);
|
||||||
|
|
||||||
|
// 用户信息
|
||||||
|
const form = reactive<CreditCustomer>({
|
||||||
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
|
statusTxt: undefined,
|
||||||
|
price: undefined,
|
||||||
|
publicDate: undefined,
|
||||||
|
dataSource: undefined,
|
||||||
|
recommend: undefined,
|
||||||
|
sortNumber: undefined,
|
||||||
|
deleted: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
status: 0,
|
||||||
|
comments: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 更新visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表单验证规则
|
||||||
|
const rules = reactive({
|
||||||
|
creditCustomerName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写客户名称',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
const chooseImage = (data: FileRecord) => {
|
||||||
|
images.value.push({
|
||||||
|
uid: data.id,
|
||||||
|
url: data.path,
|
||||||
|
status: 'done'
|
||||||
|
});
|
||||||
|
form.image = data.path;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDeleteItem = (index: number) => {
|
||||||
|
images.value.splice(index, 1);
|
||||||
|
form.image = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
const { resetFields } = useForm(form, rules);
|
||||||
|
|
||||||
|
/* 保存编辑 */
|
||||||
|
const save = () => {
|
||||||
|
if (!formRef.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
formRef.value
|
||||||
|
.validate()
|
||||||
|
.then(() => {
|
||||||
|
loading.value = true;
|
||||||
|
const formData = {
|
||||||
|
...form
|
||||||
|
};
|
||||||
|
const saveOrUpdate = isUpdate.value ? updateCreditCustomer : addCreditCustomer;
|
||||||
|
saveOrUpdate(formData)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(visible) => {
|
||||||
|
if (visible) {
|
||||||
|
images.value = [];
|
||||||
|
if (props.data) {
|
||||||
|
assignObject(form, props.data);
|
||||||
|
if(props.data.image){
|
||||||
|
images.value.push({
|
||||||
|
uid: uuid(),
|
||||||
|
url: props.data.image,
|
||||||
|
status: 'done'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
isUpdate.value = true;
|
||||||
|
} else {
|
||||||
|
isUpdate.value = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
108
src/views/credit/creditCustomer/components/search.vue
Normal file
108
src/views/credit/creditCustomer/components/search.vue
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
<!-- 搜索表单 -->
|
||||||
|
<template>
|
||||||
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
|
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||||
|
<template #icon>
|
||||||
|
<PlusOutlined />
|
||||||
|
</template>
|
||||||
|
<span>添加</span>
|
||||||
|
</a-button>
|
||||||
|
<a-button class="ele-btn-icon" @click="openImport">
|
||||||
|
<template #icon>
|
||||||
|
<CloudUploadOutlined />
|
||||||
|
</template>
|
||||||
|
<span>导入</span>
|
||||||
|
</a-button>
|
||||||
|
<a-button class="ele-btn-icon" @click="exportData">
|
||||||
|
<template #icon>
|
||||||
|
<CloudDownloadOutlined />
|
||||||
|
</template>
|
||||||
|
<span>导出</span>
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
danger
|
||||||
|
class="ele-btn-icon"
|
||||||
|
:disabled="!selection?.length"
|
||||||
|
@click="remove"
|
||||||
|
>
|
||||||
|
<template #icon>
|
||||||
|
<DeleteOutlined />
|
||||||
|
</template>
|
||||||
|
<span>批量删除</span>
|
||||||
|
</a-button>
|
||||||
|
<a-input-search
|
||||||
|
allow-clear
|
||||||
|
v-model:value="keywords"
|
||||||
|
placeholder="请输入关键词"
|
||||||
|
style="width: 220px"
|
||||||
|
@search="handleSearch"
|
||||||
|
@pressEnter="handleSearch"
|
||||||
|
/>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, ref, watch } from 'vue';
|
||||||
|
import {
|
||||||
|
PlusOutlined,
|
||||||
|
CloudUploadOutlined,
|
||||||
|
CloudDownloadOutlined,
|
||||||
|
DeleteOutlined
|
||||||
|
} from '@ant-design/icons-vue';
|
||||||
|
import type {
|
||||||
|
CreditCustomer,
|
||||||
|
CreditCustomerParam
|
||||||
|
} from '@/api/credit/creditCustomer/model';
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
// 选中的角色
|
||||||
|
selection?: CreditCustomer[];
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
|
selection: () => []
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'search', where?: CreditCustomerParam): void;
|
||||||
|
(e: 'add'): void;
|
||||||
|
(e: 'remove'): void;
|
||||||
|
(e: 'batchMove'): void;
|
||||||
|
(e: 'importData'): void;
|
||||||
|
(e: 'exportData'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const keywords = ref('');
|
||||||
|
const selection = computed(() => props.selection || []);
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
const add = () => {
|
||||||
|
emit('add');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 搜索
|
||||||
|
const handleSearch = () => {
|
||||||
|
emit('search', { keywords: keywords.value });
|
||||||
|
};
|
||||||
|
|
||||||
|
// 导入
|
||||||
|
const openImport = () => {
|
||||||
|
emit('importData');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 导出
|
||||||
|
const exportData = () => {
|
||||||
|
emit('exportData');
|
||||||
|
};
|
||||||
|
|
||||||
|
// 批量删除
|
||||||
|
const remove = () => {
|
||||||
|
emit('remove');
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.selection,
|
||||||
|
() => {}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
304
src/views/credit/creditCustomer/index.vue
Normal file
304
src/views/credit/creditCustomer/index.vue
Normal file
@@ -0,0 +1,304 @@
|
|||||||
|
<template>
|
||||||
|
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||||
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
|
<ele-pro-table
|
||||||
|
ref="tableRef"
|
||||||
|
row-key="id"
|
||||||
|
:columns="columns"
|
||||||
|
:datasource="datasource"
|
||||||
|
:customRow="customRow"
|
||||||
|
v-model:selection="selection"
|
||||||
|
tool-class="ele-toolbar-form"
|
||||||
|
class="sys-org-table"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<search
|
||||||
|
@search="reload"
|
||||||
|
:selection="selection"
|
||||||
|
@add="openEdit"
|
||||||
|
@remove="removeBatch"
|
||||||
|
@batchMove="openMove"
|
||||||
|
@importData="openImport"
|
||||||
|
@exportData="exportData"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'image'">
|
||||||
|
<a-image :src="record.image" :width="50" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'status'">
|
||||||
|
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||||
|
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'action'">
|
||||||
|
<a-space>
|
||||||
|
<a @click="openEdit(record)">修改</a>
|
||||||
|
<a-divider type="vertical" />
|
||||||
|
<a-popconfirm
|
||||||
|
title="确定要删除此记录吗?"
|
||||||
|
@confirm="remove(record)"
|
||||||
|
>
|
||||||
|
<a class="ele-text-danger">删除</a>
|
||||||
|
</a-popconfirm>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</ele-pro-table>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<CreditCustomerEdit
|
||||||
|
v-model:visible="showEdit"
|
||||||
|
:data="current"
|
||||||
|
@done="reload"
|
||||||
|
/>
|
||||||
|
<!-- 导入弹窗 -->
|
||||||
|
<CreditCustomerImport v-model:visible="showImport" @done="reload" />
|
||||||
|
</a-page-header>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { createVNode, ref, computed } from 'vue';
|
||||||
|
import { message, Modal } from 'ant-design-vue';
|
||||||
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
|
import { toDateString } from 'ele-admin-pro';
|
||||||
|
import type {
|
||||||
|
DatasourceFunction,
|
||||||
|
ColumnItem
|
||||||
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
|
import Search from './components/search.vue';
|
||||||
|
import { getPageTitle } from '@/utils/common';
|
||||||
|
import CreditCustomerEdit from './components/creditCustomerEdit.vue';
|
||||||
|
import {
|
||||||
|
pageCreditCustomer,
|
||||||
|
listCreditCustomer,
|
||||||
|
removeCreditCustomer,
|
||||||
|
removeBatchCreditCustomer
|
||||||
|
} from '@/api/credit/creditCustomer';
|
||||||
|
import type {
|
||||||
|
CreditCustomer,
|
||||||
|
CreditCustomerParam
|
||||||
|
} from '@/api/credit/creditCustomer/model';
|
||||||
|
import { exportCreditData } from '../utils/export';
|
||||||
|
import CreditCustomerImport from './components/credit-customer-import.vue';
|
||||||
|
|
||||||
|
// 表格实例
|
||||||
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
|
|
||||||
|
// 表格选中数据
|
||||||
|
const selection = ref<CreditCustomer[]>([]);
|
||||||
|
// 当前编辑数据
|
||||||
|
const current = ref<CreditCustomer | null>(null);
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
const showEdit = ref(false);
|
||||||
|
// 是否显示导入弹窗
|
||||||
|
const showImport = ref(false);
|
||||||
|
// 是否显示批量移动弹窗
|
||||||
|
const showMove = ref(false);
|
||||||
|
// 加载状态
|
||||||
|
const loading = ref(true);
|
||||||
|
// 搜索关键词
|
||||||
|
const searchText = ref('');
|
||||||
|
|
||||||
|
// 表格数据源
|
||||||
|
const datasource: DatasourceFunction = ({
|
||||||
|
page,
|
||||||
|
limit,
|
||||||
|
where = {},
|
||||||
|
orders,
|
||||||
|
filters
|
||||||
|
}) => {
|
||||||
|
const params: CreditCustomerParam = { ...(where as CreditCustomerParam) };
|
||||||
|
if (filters) {
|
||||||
|
(params as any).status = filters.status;
|
||||||
|
}
|
||||||
|
return pageCreditCustomer({
|
||||||
|
...params,
|
||||||
|
...orders,
|
||||||
|
page,
|
||||||
|
limit
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 完整的列配置(包含所有字段)
|
||||||
|
const columns = ref<ColumnItem[]>([
|
||||||
|
{
|
||||||
|
title: 'ID',
|
||||||
|
dataIndex: 'id',
|
||||||
|
key: 'id',
|
||||||
|
width: 90
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '客户',
|
||||||
|
dataIndex: 'name',
|
||||||
|
key: 'name',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '状态',
|
||||||
|
dataIndex: 'statusTxt',
|
||||||
|
key: 'statusTxt',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '销售金额(万元)',
|
||||||
|
dataIndex: 'price',
|
||||||
|
key: 'price',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '公开日期',
|
||||||
|
dataIndex: 'publicDate',
|
||||||
|
key: 'publicDate',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数据来源',
|
||||||
|
dataIndex: 'dataSource',
|
||||||
|
key: 'dataSource',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
key: 'createTime',
|
||||||
|
width: 200,
|
||||||
|
align: 'center',
|
||||||
|
sorter: true,
|
||||||
|
ellipsis: true,
|
||||||
|
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
width: 180,
|
||||||
|
fixed: 'right',
|
||||||
|
align: 'center',
|
||||||
|
hideInSetting: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const reload = (where?: CreditCustomerParam) => {
|
||||||
|
if (where && Object.prototype.hasOwnProperty.call(where, 'keywords')) {
|
||||||
|
searchText.value = where.keywords ?? '';
|
||||||
|
}
|
||||||
|
const targetWhere = where ?? { keywords: searchText.value || undefined };
|
||||||
|
selection.value = [];
|
||||||
|
tableRef?.value?.reload({ where: targetWhere });
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开编辑弹窗 */
|
||||||
|
const openEdit = (row?: CreditCustomer) => {
|
||||||
|
current.value = row ?? null;
|
||||||
|
showEdit.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开导入弹窗 */
|
||||||
|
const openImport = () => {
|
||||||
|
showImport.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开批量移动弹窗 */
|
||||||
|
const openMove = () => {
|
||||||
|
showMove.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 导出 */
|
||||||
|
const exportData = () => {
|
||||||
|
exportCreditData<CreditCustomer>({
|
||||||
|
filename: '客户列表',
|
||||||
|
columns: [
|
||||||
|
{ title: 'ID', dataIndex: 'id' },
|
||||||
|
{ title: '客户', dataIndex: 'name' },
|
||||||
|
{ title: '状态', dataIndex: 'statusTxt' },
|
||||||
|
{ title: '销售金额(万元)', dataIndex: 'price' },
|
||||||
|
{ title: '公开日期', dataIndex: 'publicDate' },
|
||||||
|
{ title: '数据来源', dataIndex: 'dataSource' },
|
||||||
|
{ title: '备注', dataIndex: 'comments' },
|
||||||
|
{ title: '是否推荐', dataIndex: 'recommend' },
|
||||||
|
{ title: '排序(数字越小越靠前)', dataIndex: 'sortNumber' },
|
||||||
|
{ title: '状态, 0正常, 1冻结', dataIndex: 'status' },
|
||||||
|
{ title: '是否删除, 0否, 1是', dataIndex: 'deleted' },
|
||||||
|
{ title: '用户ID', dataIndex: 'userId' },
|
||||||
|
{ title: '创建时间', dataIndex: 'createTime' },
|
||||||
|
{ title: '修改时间', dataIndex: 'updateTime' }
|
||||||
|
],
|
||||||
|
fetchData: () =>
|
||||||
|
listCreditCustomer({
|
||||||
|
keywords: searchText.value || undefined
|
||||||
|
})
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 删除单个 */
|
||||||
|
const remove = (row: CreditCustomer) => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeCreditCustomer(row.id)
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 批量删除 */
|
||||||
|
const removeBatch = () => {
|
||||||
|
if (!selection.value.length) {
|
||||||
|
message.error('请至少选择一条数据');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要删除选中的记录吗?',
|
||||||
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
|
maskClosable: true,
|
||||||
|
onOk: () => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeBatchCreditCustomer(selection.value.map((d) => d.id))
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 查询 */
|
||||||
|
const query = () => {
|
||||||
|
loading.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 自定义行属性 */
|
||||||
|
const customRow = (record: CreditCustomer) => {
|
||||||
|
return {
|
||||||
|
// 行点击事件
|
||||||
|
onClick: () => {
|
||||||
|
// console.log(record);
|
||||||
|
},
|
||||||
|
// 行双击事件
|
||||||
|
onDblclick: () => {
|
||||||
|
openEdit(record);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
query();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default {
|
||||||
|
name: 'CreditCustomer'
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
<!-- 送达公告导入弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="520"
|
||||||
|
:footer="null"
|
||||||
|
title="送达公告批量导入"
|
||||||
|
:visible="visible"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
>
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<a-upload-dragger
|
||||||
|
accept=".xls,.xlsx"
|
||||||
|
:show-upload-list="false"
|
||||||
|
:customRequest="doUpload"
|
||||||
|
style="padding: 24px 0; margin-bottom: 16px"
|
||||||
|
>
|
||||||
|
<p class="ant-upload-drag-icon">
|
||||||
|
<cloud-upload-outlined />
|
||||||
|
</p>
|
||||||
|
<p class="ant-upload-hint">将文件拖到此处,或点击上传</p>
|
||||||
|
</a-upload-dragger>
|
||||||
|
</a-spin>
|
||||||
|
<div class="ele-text-center">
|
||||||
|
<span>只能上传xls、xlsx文件,</span>
|
||||||
|
<a :href="templateUrl" download="送达公告导入模板.xlsx">
|
||||||
|
下载导入模板
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { message } from 'ant-design-vue/es';
|
||||||
|
import { CloudUploadOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { importCreditDeliveryNotice } from '@/api/credit/creditDeliveryNotice';
|
||||||
|
import { API_BASE_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
// 是否打开弹窗
|
||||||
|
visible: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 导入请求状态
|
||||||
|
const loading = ref(false);
|
||||||
|
|
||||||
|
// 模板下载地址,保持与当前接口域名一致
|
||||||
|
const templateUrl = computed(() => {
|
||||||
|
const base = (localStorage.getItem('ApiUrl') || API_BASE_URL || '').replace(
|
||||||
|
/\/$/,
|
||||||
|
''
|
||||||
|
);
|
||||||
|
return `${base}/credit/credit-delivery-notice/import/template`;
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 上传 */
|
||||||
|
const doUpload = ({ file }) => {
|
||||||
|
if (
|
||||||
|
![
|
||||||
|
'application/vnd.ms-excel',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
].includes(file.type)
|
||||||
|
) {
|
||||||
|
message.error('只能选择 excel 文件');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (file.size / 1024 / 1024 > 10) {
|
||||||
|
message.error('大小不能超过 10MB');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
loading.value = true;
|
||||||
|
importCreditDeliveryNotice(file)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 更新 visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -0,0 +1,300 @@
|
|||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="800"
|
||||||
|
:visible="visible"
|
||||||
|
:maskClosable="false"
|
||||||
|
:maxable="maxable"
|
||||||
|
:title="isUpdate ? '编辑送达公告司法大数据' : '添加送达公告司法大数据'"
|
||||||
|
:body-style="{ paddingBottom: '28px' }"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
@ok="save"
|
||||||
|
>
|
||||||
|
<a-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||||
|
:wrapper-col="
|
||||||
|
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<a-form-item label="数据类型" name="dataType">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入数据类型"
|
||||||
|
v-model:value="form.dataType"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="原告/上诉人" name="plaintiffAppellant">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入原告/上诉人"
|
||||||
|
v-model:value="form.plaintiffAppellant"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="被告/被上诉人" name="defendant appellee">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入被告/被上诉人"
|
||||||
|
v-model:value="form.appellee"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="其他当事人/第三人" name="otherPartiesThirdParty">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入其他当事人/第三人"
|
||||||
|
v-model:value="form.otherPartiesThirdParty"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="发生时间" name="occurrenceTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入发生时间"
|
||||||
|
v-model:value="form.occurrenceTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="案号" name="caseNumber">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入案号"
|
||||||
|
v-model:value="form.caseNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="案由" name="causeOfAction">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入案由"
|
||||||
|
v-model:value="form.causeOfAction"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="涉案金额" name="involvedAmount">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入涉案金额"
|
||||||
|
v-model:value="form.involvedAmount"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="法院" name="courtName">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入法院"
|
||||||
|
v-model:value="form.courtName"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="数据状态" name="dataStatus">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入数据状态"
|
||||||
|
v-model:value="form.dataStatus"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="备注" name="comments">
|
||||||
|
<a-textarea
|
||||||
|
:rows="4"
|
||||||
|
:maxlength="200"
|
||||||
|
placeholder="请输入描述"
|
||||||
|
v-model:value="form.comments"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否推荐" name="recommend">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否推荐"
|
||||||
|
v-model:value="form.recommend"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
|
||||||
|
<a-input-number
|
||||||
|
:min="0"
|
||||||
|
:max="9999"
|
||||||
|
class="ele-fluid"
|
||||||
|
placeholder="请输入排序号"
|
||||||
|
v-model:value="form.sortNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="状态, 0正常, 1冻结" name="status">
|
||||||
|
<a-radio-group v-model:value="form.status">
|
||||||
|
<a-radio :value="0">显示</a-radio>
|
||||||
|
<a-radio :value="1">隐藏</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否删除, 0否, 1是" name="deleted">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否删除, 0否, 1是"
|
||||||
|
v-model:value="form.deleted"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="用户ID" name="userId">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入用户ID"
|
||||||
|
v-model:value="form.userId"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="修改时间" name="updateTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入修改时间"
|
||||||
|
v-model:value="form.updateTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, watch } from 'vue';
|
||||||
|
import { Form, message } from 'ant-design-vue';
|
||||||
|
import { assignObject, uuid } from 'ele-admin-pro';
|
||||||
|
import { addCreditDeliveryNotice, updateCreditDeliveryNotice } from '@/api/credit/creditDeliveryNotice';
|
||||||
|
import { CreditDeliveryNotice } from '@/api/credit/creditDeliveryNotice/model';
|
||||||
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
|
|
||||||
|
// 是否是修改
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
// 是否开启响应式布局
|
||||||
|
const themeStore = useThemeStore();
|
||||||
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
// 弹窗是否打开
|
||||||
|
visible: boolean;
|
||||||
|
// 修改回显的数据
|
||||||
|
data?: CreditDeliveryNotice | null;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 提交状态
|
||||||
|
const loading = ref(false);
|
||||||
|
// 是否显示最大化切换按钮
|
||||||
|
const maxable = ref(true);
|
||||||
|
// 表格选中数据
|
||||||
|
const formRef = ref<FormInstance | null>(null);
|
||||||
|
const images = ref<ItemType[]>([]);
|
||||||
|
|
||||||
|
// 用户信息
|
||||||
|
const form = reactive<CreditDeliveryNotice>({
|
||||||
|
id: undefined,
|
||||||
|
dataType: undefined,
|
||||||
|
plaintiffAppellant: undefined,
|
||||||
|
appellee: undefined,
|
||||||
|
otherPartiesThirdParty: undefined,
|
||||||
|
occurrenceTime: undefined,
|
||||||
|
caseNumber: undefined,
|
||||||
|
causeOfAction: undefined,
|
||||||
|
involvedAmount: undefined,
|
||||||
|
courtName: undefined,
|
||||||
|
dataStatus: undefined,
|
||||||
|
comments: undefined,
|
||||||
|
recommend: undefined,
|
||||||
|
sortNumber: undefined,
|
||||||
|
status: undefined,
|
||||||
|
deleted: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
creditDeliveryNoticeId: undefined,
|
||||||
|
creditDeliveryNoticeName: '',
|
||||||
|
status: 0,
|
||||||
|
comments: '',
|
||||||
|
sortNumber: 100
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 更新visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表单验证规则
|
||||||
|
const rules = reactive({
|
||||||
|
creditDeliveryNoticeName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写送达公告司法大数据名称',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
const chooseImage = (data: FileRecord) => {
|
||||||
|
images.value.push({
|
||||||
|
uid: data.id,
|
||||||
|
url: data.path,
|
||||||
|
status: 'done'
|
||||||
|
});
|
||||||
|
form.image = data.path;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDeleteItem = (index: number) => {
|
||||||
|
images.value.splice(index, 1);
|
||||||
|
form.image = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
const { resetFields } = useForm(form, rules);
|
||||||
|
|
||||||
|
/* 保存编辑 */
|
||||||
|
const save = () => {
|
||||||
|
if (!formRef.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
formRef.value
|
||||||
|
.validate()
|
||||||
|
.then(() => {
|
||||||
|
loading.value = true;
|
||||||
|
const formData = {
|
||||||
|
...form
|
||||||
|
};
|
||||||
|
const saveOrUpdate = isUpdate.value ? updateCreditDeliveryNotice : addCreditDeliveryNotice;
|
||||||
|
saveOrUpdate(formData)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(visible) => {
|
||||||
|
if (visible) {
|
||||||
|
images.value = [];
|
||||||
|
if (props.data) {
|
||||||
|
assignObject(form, props.data);
|
||||||
|
if(props.data.image){
|
||||||
|
images.value.push({
|
||||||
|
uid: uuid(),
|
||||||
|
url: props.data.image,
|
||||||
|
status: 'done'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
isUpdate.value = true;
|
||||||
|
} else {
|
||||||
|
isUpdate.value = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
42
src/views/credit/creditDeliveryNotice/components/search.vue
Normal file
42
src/views/credit/creditDeliveryNotice/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<!-- 搜索表单 -->
|
||||||
|
<template>
|
||||||
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
|
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||||
|
<template #icon>
|
||||||
|
<PlusOutlined />
|
||||||
|
</template>
|
||||||
|
<span>添加</span>
|
||||||
|
</a-button>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { GradeParam } from '@/api/user/grade/model';
|
||||||
|
import { watch } from 'vue';
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
// 选中的角色
|
||||||
|
selection?: [];
|
||||||
|
}>(),
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'search', where?: GradeParam): void;
|
||||||
|
(e: 'add'): void;
|
||||||
|
(e: 'remove'): void;
|
||||||
|
(e: 'batchMove'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
const add = () => {
|
||||||
|
emit('add');
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.selection,
|
||||||
|
() => {}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
325
src/views/credit/creditDeliveryNotice/index.vue
Normal file
325
src/views/credit/creditDeliveryNotice/index.vue
Normal file
@@ -0,0 +1,325 @@
|
|||||||
|
<template>
|
||||||
|
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||||
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
|
<ele-pro-table
|
||||||
|
ref="tableRef"
|
||||||
|
row-key="id"
|
||||||
|
:columns="columns"
|
||||||
|
:datasource="datasource"
|
||||||
|
:customRow="customRow"
|
||||||
|
tool-class="ele-toolbar-form"
|
||||||
|
class="sys-org-table"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<search
|
||||||
|
@search="reload"
|
||||||
|
:selection="selection"
|
||||||
|
@add="openEdit"
|
||||||
|
@remove="removeBatch"
|
||||||
|
@batchMove="openMove"
|
||||||
|
@importData="openImport"
|
||||||
|
@exportData="exportData"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'image'">
|
||||||
|
<a-image :src="record.image" :width="50" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'status'">
|
||||||
|
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||||
|
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'action'">
|
||||||
|
<a-space>
|
||||||
|
<a @click="openEdit(record)">修改</a>
|
||||||
|
<a-divider type="vertical" />
|
||||||
|
<a-popconfirm
|
||||||
|
title="确定要删除此记录吗?"
|
||||||
|
@confirm="remove(record)"
|
||||||
|
>
|
||||||
|
<a class="ele-text-danger">删除</a>
|
||||||
|
</a-popconfirm>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</ele-pro-table>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<CreditDeliveryNoticeEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||||
|
<!-- 导入弹窗 -->
|
||||||
|
<CreditDeliveryNoticeImport
|
||||||
|
v-model:visible="showImport"
|
||||||
|
@done="reload"
|
||||||
|
/>
|
||||||
|
</a-page-header>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { createVNode, ref } from 'vue';
|
||||||
|
import { message, Modal } from 'ant-design-vue';
|
||||||
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
|
import { toDateString } from 'ele-admin-pro';
|
||||||
|
import type {
|
||||||
|
DatasourceFunction,
|
||||||
|
ColumnItem
|
||||||
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
|
import Search from '@/views/credit/components/CreditSearchToolbar.vue';
|
||||||
|
import { exportCreditData } from '../utils/export';
|
||||||
|
import { getPageTitle } from '@/utils/common';
|
||||||
|
import CreditDeliveryNoticeEdit from './components/creditDeliveryNoticeEdit.vue';
|
||||||
|
import CreditDeliveryNoticeImport from './components/credit-delivery-notice-import.vue';
|
||||||
|
import {
|
||||||
|
pageCreditDeliveryNotice,
|
||||||
|
listCreditDeliveryNotice,
|
||||||
|
removeCreditDeliveryNotice,
|
||||||
|
removeBatchCreditDeliveryNotice
|
||||||
|
} from '@/api/credit/creditDeliveryNotice';
|
||||||
|
import type {
|
||||||
|
CreditDeliveryNotice,
|
||||||
|
CreditDeliveryNoticeParam
|
||||||
|
} from '@/api/credit/creditDeliveryNotice/model';
|
||||||
|
|
||||||
|
// 表格实例
|
||||||
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
|
|
||||||
|
// 表格选中数据
|
||||||
|
const selection = ref<CreditDeliveryNotice[]>([]);
|
||||||
|
// 当前编辑数据
|
||||||
|
const current = ref<CreditDeliveryNotice | null>(null);
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
const showEdit = ref(false);
|
||||||
|
// 是否显示导入弹窗
|
||||||
|
const showImport = ref(false);
|
||||||
|
// 是否显示批量移动弹窗
|
||||||
|
const showMove = ref(false);
|
||||||
|
// 加载状态
|
||||||
|
const loading = ref(true);
|
||||||
|
// 搜索关键词
|
||||||
|
const searchText = ref('');
|
||||||
|
|
||||||
|
// 表格数据源
|
||||||
|
const datasource: DatasourceFunction = ({
|
||||||
|
page,
|
||||||
|
limit,
|
||||||
|
where = {},
|
||||||
|
orders,
|
||||||
|
filters
|
||||||
|
}) => {
|
||||||
|
const params: CreditDeliveryNoticeParam = { ...where };
|
||||||
|
if (filters) {
|
||||||
|
(params as any).status = filters.status;
|
||||||
|
}
|
||||||
|
if (!params.keywords && searchText.value) {
|
||||||
|
params.keywords = searchText.value;
|
||||||
|
}
|
||||||
|
return pageCreditDeliveryNotice({
|
||||||
|
...params,
|
||||||
|
...orders,
|
||||||
|
page,
|
||||||
|
limit
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关键信息列
|
||||||
|
const columns = ref<ColumnItem[]>([
|
||||||
|
{
|
||||||
|
title: 'ID',
|
||||||
|
dataIndex: 'id',
|
||||||
|
key: 'id',
|
||||||
|
width: 80
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数据类型',
|
||||||
|
dataIndex: 'dataType',
|
||||||
|
key: 'dataType',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '原告/上诉人',
|
||||||
|
dataIndex: 'plaintiffAppellant',
|
||||||
|
key: 'plaintiffAppellant',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '发生时间',
|
||||||
|
dataIndex: 'occurrenceTime',
|
||||||
|
key: 'occurrenceTime',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '案号',
|
||||||
|
dataIndex: 'caseNumber',
|
||||||
|
key: 'caseNumber',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '案由',
|
||||||
|
dataIndex: 'causeOfAction',
|
||||||
|
key: 'causeOfAction',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '涉案金额',
|
||||||
|
dataIndex: 'involvedAmount',
|
||||||
|
key: 'involvedAmount',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '法院',
|
||||||
|
dataIndex: 'courtName',
|
||||||
|
key: 'courtName',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数据状态',
|
||||||
|
dataIndex: 'dataStatus',
|
||||||
|
key: 'dataStatus',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
key: 'createTime',
|
||||||
|
width: 180,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
width: 160,
|
||||||
|
fixed: 'right',
|
||||||
|
align: 'center',
|
||||||
|
hideInSetting: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const reload = (where?: CreditDeliveryNoticeParam) => {
|
||||||
|
if (where && Object.prototype.hasOwnProperty.call(where, 'keywords')) {
|
||||||
|
searchText.value = where.keywords ?? '';
|
||||||
|
}
|
||||||
|
const targetWhere = where ?? { keywords: searchText.value || undefined };
|
||||||
|
selection.value = [];
|
||||||
|
tableRef?.value?.reload({ where: targetWhere });
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开编辑弹窗 */
|
||||||
|
const openEdit = (row?: CreditDeliveryNotice) => {
|
||||||
|
current.value = row ?? null;
|
||||||
|
showEdit.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开批量移动弹窗 */
|
||||||
|
const openMove = () => {
|
||||||
|
showMove.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开导入弹窗 */
|
||||||
|
const openImport = () => {
|
||||||
|
showImport.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 导出 */
|
||||||
|
const exportData = () => {
|
||||||
|
exportCreditData<CreditDeliveryNotice>({
|
||||||
|
filename: '送达公告',
|
||||||
|
columns: [
|
||||||
|
{ title: 'ID', dataIndex: 'id' },
|
||||||
|
{ title: '数据类型', dataIndex: 'dataType' },
|
||||||
|
{ title: '原告/上诉人', dataIndex: 'plaintiffAppellant' },
|
||||||
|
{ title: '发生时间', dataIndex: 'occurrenceTime' },
|
||||||
|
{ title: '案号', dataIndex: 'caseNumber' },
|
||||||
|
{ title: '案由', dataIndex: 'causeOfAction' },
|
||||||
|
{ title: '涉案金额', dataIndex: 'involvedAmount' },
|
||||||
|
{ title: '法院', dataIndex: 'courtName' },
|
||||||
|
{ title: '数据状态', dataIndex: 'dataStatus' },
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
formatter: (record: CreditDeliveryNotice) =>
|
||||||
|
record.createTime
|
||||||
|
? toDateString(record.createTime, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
],
|
||||||
|
fetchData: () =>
|
||||||
|
listCreditDeliveryNotice({
|
||||||
|
keywords: searchText.value || undefined
|
||||||
|
})
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 删除单个 */
|
||||||
|
const remove = (row: CreditDeliveryNotice) => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeCreditDeliveryNotice(row.id)
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 批量删除 */
|
||||||
|
const removeBatch = () => {
|
||||||
|
if (!selection.value.length) {
|
||||||
|
message.error('请至少选择一条数据');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要删除选中的记录吗?',
|
||||||
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
|
maskClosable: true,
|
||||||
|
onOk: () => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeBatchCreditDeliveryNotice(selection.value.map((d) => d.id))
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 查询 */
|
||||||
|
const query = () => {
|
||||||
|
loading.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 自定义行属性 */
|
||||||
|
const customRow = (record: CreditDeliveryNotice) => {
|
||||||
|
return {
|
||||||
|
// 行点击事件
|
||||||
|
onClick: () => {
|
||||||
|
// console.log(record);
|
||||||
|
},
|
||||||
|
// 行双击事件
|
||||||
|
onDblclick: () => {
|
||||||
|
openEdit(record);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
query();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default {
|
||||||
|
name: 'CreditDeliveryNotice'
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
<!-- 对外投资导入弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="520"
|
||||||
|
:footer="null"
|
||||||
|
title="对外投资批量导入"
|
||||||
|
:visible="visible"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
>
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<a-upload-dragger
|
||||||
|
accept=".xls,.xlsx"
|
||||||
|
:show-upload-list="false"
|
||||||
|
:customRequest="doUpload"
|
||||||
|
style="padding: 24px 0; margin-bottom: 16px"
|
||||||
|
>
|
||||||
|
<p class="ant-upload-drag-icon">
|
||||||
|
<cloud-upload-outlined />
|
||||||
|
</p>
|
||||||
|
<p class="ant-upload-hint">将文件拖到此处,或点击上传</p>
|
||||||
|
</a-upload-dragger>
|
||||||
|
</a-spin>
|
||||||
|
<div class="ele-text-center">
|
||||||
|
<span>只能上传xls、xlsx文件,</span>
|
||||||
|
<a :href="templateUrl" download="对外投资导入模板.xlsx">
|
||||||
|
下载导入模板
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { message } from 'ant-design-vue/es';
|
||||||
|
import { CloudUploadOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { importCreditExternal } from '@/api/credit/creditExternal';
|
||||||
|
import { API_BASE_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
// 是否打开弹窗
|
||||||
|
visible: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 导入请求状态
|
||||||
|
const loading = ref(false);
|
||||||
|
|
||||||
|
// 模板下载地址,保持与当前接口域名一致
|
||||||
|
const templateUrl = computed(() => {
|
||||||
|
const base = (localStorage.getItem('ApiUrl') || API_BASE_URL || '').replace(
|
||||||
|
/\/$/,
|
||||||
|
''
|
||||||
|
);
|
||||||
|
return `${base}/credit/credit-external/import/template`;
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 上传 */
|
||||||
|
const doUpload = ({ file }) => {
|
||||||
|
if (
|
||||||
|
![
|
||||||
|
'application/vnd.ms-excel',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
].includes(file.type)
|
||||||
|
) {
|
||||||
|
message.error('只能选择 excel 文件');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (file.size / 1024 / 1024 > 10) {
|
||||||
|
message.error('大小不能超过 10MB');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
loading.value = true;
|
||||||
|
importCreditExternal(file)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 更新 visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -0,0 +1,300 @@
|
|||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="800"
|
||||||
|
:visible="visible"
|
||||||
|
:maskClosable="false"
|
||||||
|
:maxable="maxable"
|
||||||
|
:title="isUpdate ? '编辑对外投资' : '添加对外投资'"
|
||||||
|
:body-style="{ paddingBottom: '28px' }"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
@ok="save"
|
||||||
|
>
|
||||||
|
<a-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||||
|
:wrapper-col="
|
||||||
|
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<a-form-item label="被投资企业名称" name="name">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入被投资企业名称"
|
||||||
|
v-model:value="form.name"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="状态" name="statusTxt">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入企业状态(如存续、注销等)"
|
||||||
|
v-model:value="form.statusTxt"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="法定代表人" name="legalRepresentative">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入法定代表人姓名"
|
||||||
|
v-model:value="form.legalRepresentative"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="注册资本" name="registeredCapital">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入注册资本(金额)"
|
||||||
|
v-model:value="form.registeredCapital"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="成立日期" name="establishmentDate">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入成立日期"
|
||||||
|
v-model:value="form.establishmentDate"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="持股比例" name="shareholdingRatio">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入持股比例"
|
||||||
|
v-model:value="form.shareholdingRatio"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="认缴出资额" name="subscribedInvestmentAmount">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入认缴出资额"
|
||||||
|
v-model:value="form.subscribedInvestmentAmount"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="认缴出资日期" name="subscribedInvestmentDate">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入认缴出资日期"
|
||||||
|
v-model:value="form.subscribedInvestmentDate"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="间接持股比例" name="indirectShareholdingRatio">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入间接持股比例"
|
||||||
|
v-model:value="form.indirectShareholdingRatio"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="投资日期" name="investmentDate">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入投资日期"
|
||||||
|
v-model:value="form.investmentDate"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="所属地区" name="region">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入所属地区"
|
||||||
|
v-model:value="form.region"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="所属行业" name="industry">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入所属行业"
|
||||||
|
v-model:value="form.industry"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="投资数量" name="investmentCount">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入投资数量"
|
||||||
|
v-model:value="form.investmentCount"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="关联产品/机构" name="relatedProductsInstitutions">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入关联产品/机构"
|
||||||
|
v-model:value="form.relatedProductsInstitutions"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="备注" name="comments">
|
||||||
|
<a-textarea
|
||||||
|
:rows="4"
|
||||||
|
:maxlength="200"
|
||||||
|
placeholder="请输入描述"
|
||||||
|
v-model:value="form.comments"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<!-- <a-form-item label="状态, 0正常, 1冻结" name="status">-->
|
||||||
|
<!-- <a-radio-group v-model:value="form.status">-->
|
||||||
|
<!-- <a-radio :value="0">显示</a-radio>-->
|
||||||
|
<!-- <a-radio :value="1">隐藏</a-radio>-->
|
||||||
|
<!-- </a-radio-group>-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
</a-form>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, watch } from 'vue';
|
||||||
|
import { Form, message } from 'ant-design-vue';
|
||||||
|
import { assignObject, uuid } from 'ele-admin-pro';
|
||||||
|
import {
|
||||||
|
addCreditExternal,
|
||||||
|
updateCreditExternal
|
||||||
|
} from '@/api/credit/creditExternal';
|
||||||
|
import { CreditExternal } from '@/api/credit/creditExternal/model';
|
||||||
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
|
|
||||||
|
// 是否是修改
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
// 是否开启响应式布局
|
||||||
|
const themeStore = useThemeStore();
|
||||||
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
// 弹窗是否打开
|
||||||
|
visible: boolean;
|
||||||
|
// 修改回显的数据
|
||||||
|
data?: CreditExternal | null;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 提交状态
|
||||||
|
const loading = ref(false);
|
||||||
|
// 是否显示最大化切换按钮
|
||||||
|
const maxable = ref(true);
|
||||||
|
// 表格选中数据
|
||||||
|
const formRef = ref<FormInstance | null>(null);
|
||||||
|
const images = ref<ItemType[]>([]);
|
||||||
|
|
||||||
|
// 用户信息
|
||||||
|
const form = reactive<CreditExternal>({
|
||||||
|
id: undefined,
|
||||||
|
name: undefined,
|
||||||
|
statusTxt: undefined,
|
||||||
|
legalRepresentative: undefined,
|
||||||
|
registeredCapital: undefined,
|
||||||
|
establishmentDate: undefined,
|
||||||
|
shareholdingRatio: undefined,
|
||||||
|
subscribedInvestmentAmount: undefined,
|
||||||
|
subscribedInvestmentDate: undefined,
|
||||||
|
indirectShareholdingRatio: undefined,
|
||||||
|
investmentDate: undefined,
|
||||||
|
region: undefined,
|
||||||
|
industry: undefined,
|
||||||
|
investmentCount: undefined,
|
||||||
|
relatedProductsInstitutions: undefined,
|
||||||
|
comments: undefined,
|
||||||
|
recommend: undefined,
|
||||||
|
sortNumber: undefined,
|
||||||
|
status: undefined,
|
||||||
|
deleted: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
creditExternalId: undefined,
|
||||||
|
creditExternalName: '',
|
||||||
|
status: 0,
|
||||||
|
comments: '',
|
||||||
|
sortNumber: 100
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 更新visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表单验证规则
|
||||||
|
const rules = reactive({
|
||||||
|
creditExternalName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写对外投资名称',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
const chooseImage = (data: FileRecord) => {
|
||||||
|
images.value.push({
|
||||||
|
uid: data.id,
|
||||||
|
url: data.path,
|
||||||
|
status: 'done'
|
||||||
|
});
|
||||||
|
form.image = data.path;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDeleteItem = (index: number) => {
|
||||||
|
images.value.splice(index, 1);
|
||||||
|
form.image = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
const { resetFields } = useForm(form, rules);
|
||||||
|
|
||||||
|
/* 保存编辑 */
|
||||||
|
const save = () => {
|
||||||
|
if (!formRef.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
formRef.value
|
||||||
|
.validate()
|
||||||
|
.then(() => {
|
||||||
|
loading.value = true;
|
||||||
|
const formData = {
|
||||||
|
...form
|
||||||
|
};
|
||||||
|
const saveOrUpdate = isUpdate.value
|
||||||
|
? updateCreditExternal
|
||||||
|
: addCreditExternal;
|
||||||
|
saveOrUpdate(formData)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(visible) => {
|
||||||
|
if (visible) {
|
||||||
|
images.value = [];
|
||||||
|
if (props.data) {
|
||||||
|
assignObject(form, props.data);
|
||||||
|
if (props.data.image) {
|
||||||
|
images.value.push({
|
||||||
|
uid: uuid(),
|
||||||
|
url: props.data.image,
|
||||||
|
status: 'done'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
isUpdate.value = true;
|
||||||
|
} else {
|
||||||
|
isUpdate.value = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
42
src/views/credit/creditExternal/components/search.vue
Normal file
42
src/views/credit/creditExternal/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<!-- 搜索表单 -->
|
||||||
|
<template>
|
||||||
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
|
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||||
|
<template #icon>
|
||||||
|
<PlusOutlined />
|
||||||
|
</template>
|
||||||
|
<span>添加</span>
|
||||||
|
</a-button>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { GradeParam } from '@/api/user/grade/model';
|
||||||
|
import { watch } from 'vue';
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
// 选中的角色
|
||||||
|
selection?: [];
|
||||||
|
}>(),
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'search', where?: GradeParam): void;
|
||||||
|
(e: 'add'): void;
|
||||||
|
(e: 'remove'): void;
|
||||||
|
(e: 'batchMove'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
const add = () => {
|
||||||
|
emit('add');
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.selection,
|
||||||
|
() => {}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
341
src/views/credit/creditExternal/index.vue
Normal file
341
src/views/credit/creditExternal/index.vue
Normal file
@@ -0,0 +1,341 @@
|
|||||||
|
<template>
|
||||||
|
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||||
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
|
<ele-pro-table
|
||||||
|
ref="tableRef"
|
||||||
|
row-key="id"
|
||||||
|
:columns="columns"
|
||||||
|
:datasource="datasource"
|
||||||
|
:customRow="customRow"
|
||||||
|
tool-class="ele-toolbar-form"
|
||||||
|
class="sys-org-table"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<search
|
||||||
|
@search="reload"
|
||||||
|
:selection="selection"
|
||||||
|
@add="openEdit"
|
||||||
|
@remove="removeBatch"
|
||||||
|
@batchMove="openMove"
|
||||||
|
@importData="openImport"
|
||||||
|
@exportData="exportData"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'image'">
|
||||||
|
<a-image :src="record.image" :width="50" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'status'">
|
||||||
|
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||||
|
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'action'">
|
||||||
|
<a-space>
|
||||||
|
<a @click="openEdit(record)">修改</a>
|
||||||
|
<a-divider type="vertical" />
|
||||||
|
<a-popconfirm
|
||||||
|
title="确定要删除此记录吗?"
|
||||||
|
@confirm="remove(record)"
|
||||||
|
>
|
||||||
|
<a class="ele-text-danger">删除</a>
|
||||||
|
</a-popconfirm>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</ele-pro-table>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<CreditExternalEdit
|
||||||
|
v-model:visible="showEdit"
|
||||||
|
:data="current"
|
||||||
|
@done="reload"
|
||||||
|
/>
|
||||||
|
<!-- 导入弹窗 -->
|
||||||
|
<CreditExternalImport v-model:visible="showImport" @done="reload" />
|
||||||
|
</a-page-header>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { createVNode, ref } from 'vue';
|
||||||
|
import { message, Modal } from 'ant-design-vue';
|
||||||
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
|
import { toDateString } from 'ele-admin-pro';
|
||||||
|
import type {
|
||||||
|
DatasourceFunction,
|
||||||
|
ColumnItem
|
||||||
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
|
import Search from '@/views/credit/components/CreditSearchToolbar.vue';
|
||||||
|
import { exportCreditData } from '../utils/export';
|
||||||
|
import { getPageTitle } from '@/utils/common';
|
||||||
|
import CreditExternalEdit from './components/creditExternalEdit.vue';
|
||||||
|
import CreditExternalImport from './components/credit-external-import.vue';
|
||||||
|
import {
|
||||||
|
pageCreditExternal,
|
||||||
|
listCreditExternal,
|
||||||
|
removeCreditExternal,
|
||||||
|
removeBatchCreditExternal
|
||||||
|
} from '@/api/credit/creditExternal';
|
||||||
|
import type {
|
||||||
|
CreditExternal,
|
||||||
|
CreditExternalParam
|
||||||
|
} from '@/api/credit/creditExternal/model';
|
||||||
|
|
||||||
|
// 表格实例
|
||||||
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
|
|
||||||
|
// 表格选中数据
|
||||||
|
const selection = ref<CreditExternal[]>([]);
|
||||||
|
// 当前编辑数据
|
||||||
|
const current = ref<CreditExternal | null>(null);
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
const showEdit = ref(false);
|
||||||
|
// 是否显示导入弹窗
|
||||||
|
const showImport = ref(false);
|
||||||
|
// 是否显示批量移动弹窗
|
||||||
|
const showMove = ref(false);
|
||||||
|
// 加载状态
|
||||||
|
const loading = ref(true);
|
||||||
|
// 搜索关键词
|
||||||
|
const searchText = ref('');
|
||||||
|
|
||||||
|
// 表格数据源
|
||||||
|
const datasource: DatasourceFunction = ({
|
||||||
|
page,
|
||||||
|
limit,
|
||||||
|
where = {},
|
||||||
|
orders,
|
||||||
|
filters
|
||||||
|
}) => {
|
||||||
|
const params: CreditExternalParam = { ...where };
|
||||||
|
if (filters) {
|
||||||
|
(params as any).status = filters.status;
|
||||||
|
}
|
||||||
|
if (!params.keywords && searchText.value) {
|
||||||
|
params.keywords = searchText.value;
|
||||||
|
}
|
||||||
|
return pageCreditExternal({
|
||||||
|
...params,
|
||||||
|
...orders,
|
||||||
|
page,
|
||||||
|
limit
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关键信息列
|
||||||
|
const columns = ref<ColumnItem[]>([
|
||||||
|
{
|
||||||
|
title: 'ID',
|
||||||
|
dataIndex: 'id',
|
||||||
|
key: 'id',
|
||||||
|
width: 80
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '被投资企业名称',
|
||||||
|
dataIndex: 'name',
|
||||||
|
key: 'name',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '状态',
|
||||||
|
dataIndex: 'statusTxt',
|
||||||
|
key: 'statusTxt',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '法定代表人',
|
||||||
|
dataIndex: 'legalRepresentative',
|
||||||
|
key: 'legalRepresentative',
|
||||||
|
ellipsis: true,
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '注册资本',
|
||||||
|
dataIndex: 'registeredCapital',
|
||||||
|
key: 'registeredCapital',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '成立日期',
|
||||||
|
dataIndex: 'establishmentDate',
|
||||||
|
key: 'establishmentDate',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '持股比例',
|
||||||
|
dataIndex: 'shareholdingRatio',
|
||||||
|
key: 'shareholdingRatio',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '认缴出资额',
|
||||||
|
dataIndex: 'subscribedInvestmentAmount',
|
||||||
|
key: 'subscribedInvestmentAmount',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '投资日期',
|
||||||
|
dataIndex: 'investmentDate',
|
||||||
|
key: 'investmentDate',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '所属地区',
|
||||||
|
dataIndex: 'region',
|
||||||
|
key: 'region',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '所属行业',
|
||||||
|
dataIndex: 'industry',
|
||||||
|
key: 'industry',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
key: 'createTime',
|
||||||
|
width: 180,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
width: 160,
|
||||||
|
fixed: 'right',
|
||||||
|
align: 'center',
|
||||||
|
hideInSetting: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const reload = (where?: CreditExternalParam) => {
|
||||||
|
if (where && Object.prototype.hasOwnProperty.call(where, 'keywords')) {
|
||||||
|
searchText.value = where.keywords ?? '';
|
||||||
|
}
|
||||||
|
const targetWhere = where ?? { keywords: searchText.value || undefined };
|
||||||
|
selection.value = [];
|
||||||
|
tableRef?.value?.reload({ where: targetWhere });
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开编辑弹窗 */
|
||||||
|
const openEdit = (row?: CreditExternal) => {
|
||||||
|
current.value = row ?? null;
|
||||||
|
showEdit.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开批量移动弹窗 */
|
||||||
|
const openMove = () => {
|
||||||
|
showMove.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开导入弹窗 */
|
||||||
|
const openImport = () => {
|
||||||
|
showImport.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 导出 */
|
||||||
|
const exportData = () => {
|
||||||
|
exportCreditData<CreditExternal>({
|
||||||
|
filename: '对外投资',
|
||||||
|
columns: [
|
||||||
|
{ title: 'ID', dataIndex: 'id' },
|
||||||
|
{ title: '被投资企业名称', dataIndex: 'name' },
|
||||||
|
{ title: '企业状态', dataIndex: 'statusTxt' },
|
||||||
|
{ title: '法定代表人姓名', dataIndex: 'legalRepresentative' },
|
||||||
|
{ title: '注册资本(金额)', dataIndex: 'registeredCapital' },
|
||||||
|
{ title: '成立日期', dataIndex: 'establishmentDate' },
|
||||||
|
{ title: '持股比例', dataIndex: 'shareholdingRatio' },
|
||||||
|
{ title: '认缴出资额', dataIndex: 'subscribedInvestmentAmount' },
|
||||||
|
{ title: '投资日期', dataIndex: 'investmentDate' },
|
||||||
|
{ title: '所属地区', dataIndex: 'region' },
|
||||||
|
{ title: '所属行业', dataIndex: 'industry' },
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
formatter: (record: CreditExternal) =>
|
||||||
|
record.createTime
|
||||||
|
? toDateString(record.createTime, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
],
|
||||||
|
fetchData: () =>
|
||||||
|
listCreditExternal({
|
||||||
|
keywords: searchText.value || undefined
|
||||||
|
})
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 删除单个 */
|
||||||
|
const remove = (row: CreditExternal) => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeCreditExternal(row.id)
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 批量删除 */
|
||||||
|
const removeBatch = () => {
|
||||||
|
if (!selection.value.length) {
|
||||||
|
message.error('请至少选择一条数据');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要删除选中的记录吗?',
|
||||||
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
|
maskClosable: true,
|
||||||
|
onOk: () => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeBatchCreditExternal(selection.value.map((d) => d.id))
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 查询 */
|
||||||
|
const query = () => {
|
||||||
|
loading.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 自定义行属性 */
|
||||||
|
const customRow = (record: CreditExternal) => {
|
||||||
|
return {
|
||||||
|
// 行点击事件
|
||||||
|
onClick: () => {
|
||||||
|
// console.log(record);
|
||||||
|
},
|
||||||
|
// 行双击事件
|
||||||
|
onDblclick: () => {
|
||||||
|
openEdit(record);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
query();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default {
|
||||||
|
name: 'CreditExternal'
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
<!-- 终本案件导入弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="520"
|
||||||
|
:footer="null"
|
||||||
|
title="终本案件批量导入"
|
||||||
|
:visible="visible"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
>
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<a-upload-dragger
|
||||||
|
accept=".xls,.xlsx"
|
||||||
|
:show-upload-list="false"
|
||||||
|
:customRequest="doUpload"
|
||||||
|
style="padding: 24px 0; margin-bottom: 16px"
|
||||||
|
>
|
||||||
|
<p class="ant-upload-drag-icon">
|
||||||
|
<cloud-upload-outlined />
|
||||||
|
</p>
|
||||||
|
<p class="ant-upload-hint">将文件拖到此处,或点击上传</p>
|
||||||
|
</a-upload-dragger>
|
||||||
|
</a-spin>
|
||||||
|
<div class="ele-text-center">
|
||||||
|
<span>只能上传xls、xlsx文件,</span>
|
||||||
|
<a :href="templateUrl" download="终本案件导入模板.xlsx">
|
||||||
|
下载导入模板
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { message } from 'ant-design-vue/es';
|
||||||
|
import { CloudUploadOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { importCreditFinalVersion } from '@/api/credit/creditFinalVersion';
|
||||||
|
import { API_BASE_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
// 是否打开弹窗
|
||||||
|
visible: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 导入请求状态
|
||||||
|
const loading = ref(false);
|
||||||
|
|
||||||
|
// 模板下载地址,保持与当前接口域名一致
|
||||||
|
const templateUrl = computed(() => {
|
||||||
|
const base = (localStorage.getItem('ApiUrl') || API_BASE_URL || '').replace(
|
||||||
|
/\/$/,
|
||||||
|
''
|
||||||
|
);
|
||||||
|
return `${base}/credit/credit-final-version/import/template`;
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 上传 */
|
||||||
|
const doUpload = ({ file }) => {
|
||||||
|
if (
|
||||||
|
![
|
||||||
|
'application/vnd.ms-excel',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
].includes(file.type)
|
||||||
|
) {
|
||||||
|
message.error('只能选择 excel 文件');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (file.size / 1024 / 1024 > 10) {
|
||||||
|
message.error('大小不能超过 10MB');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
loading.value = true;
|
||||||
|
importCreditFinalVersion(file)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 更新 visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -0,0 +1,300 @@
|
|||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="800"
|
||||||
|
:visible="visible"
|
||||||
|
:maskClosable="false"
|
||||||
|
:maxable="maxable"
|
||||||
|
:title="isUpdate ? '编辑终本案件' : '添加终本案件'"
|
||||||
|
:body-style="{ paddingBottom: '28px' }"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
@ok="save"
|
||||||
|
>
|
||||||
|
<a-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||||
|
:wrapper-col="
|
||||||
|
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<a-form-item label="数据类型" name="dataType">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入数据类型"
|
||||||
|
v-model:value="form.dataType"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="原告/上诉人" name="plaintiffAppellant">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入原告/上诉人"
|
||||||
|
v-model:value="form.plaintiffAppellant"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="被告/被上诉人" name="defendant appellee">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入被告/被上诉人"
|
||||||
|
v-model:value="form.appellee"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="其他当事人/第三人" name="otherPartiesThirdParty">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入其他当事人/第三人"
|
||||||
|
v-model:value="form.otherPartiesThirdParty"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="发生时间" name="occurrenceTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入发生时间"
|
||||||
|
v-model:value="form.occurrenceTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="案号" name="caseNumber">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入案号"
|
||||||
|
v-model:value="form.caseNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="案由" name="causeOfAction">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入案由"
|
||||||
|
v-model:value="form.causeOfAction"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="涉案金额" name="involvedAmount">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入涉案金额"
|
||||||
|
v-model:value="form.involvedAmount"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="法院" name="courtName">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入法院"
|
||||||
|
v-model:value="form.courtName"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="数据状态" name="dataStatus">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入数据状态"
|
||||||
|
v-model:value="form.dataStatus"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="备注" name="comments">
|
||||||
|
<a-textarea
|
||||||
|
:rows="4"
|
||||||
|
:maxlength="200"
|
||||||
|
placeholder="请输入描述"
|
||||||
|
v-model:value="form.comments"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否推荐" name="recommend">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否推荐"
|
||||||
|
v-model:value="form.recommend"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
|
||||||
|
<a-input-number
|
||||||
|
:min="0"
|
||||||
|
:max="9999"
|
||||||
|
class="ele-fluid"
|
||||||
|
placeholder="请输入排序号"
|
||||||
|
v-model:value="form.sortNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="状态, 0正常, 1冻结" name="status">
|
||||||
|
<a-radio-group v-model:value="form.status">
|
||||||
|
<a-radio :value="0">显示</a-radio>
|
||||||
|
<a-radio :value="1">隐藏</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否删除, 0否, 1是" name="deleted">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否删除, 0否, 1是"
|
||||||
|
v-model:value="form.deleted"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="用户ID" name="userId">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入用户ID"
|
||||||
|
v-model:value="form.userId"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="修改时间" name="updateTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入修改时间"
|
||||||
|
v-model:value="form.updateTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, watch } from 'vue';
|
||||||
|
import { Form, message } from 'ant-design-vue';
|
||||||
|
import { assignObject, uuid } from 'ele-admin-pro';
|
||||||
|
import { addCreditFinalVersion, updateCreditFinalVersion } from '@/api/credit/creditFinalVersion';
|
||||||
|
import { CreditFinalVersion } from '@/api/credit/creditFinalVersion/model';
|
||||||
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
|
|
||||||
|
// 是否是修改
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
// 是否开启响应式布局
|
||||||
|
const themeStore = useThemeStore();
|
||||||
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
// 弹窗是否打开
|
||||||
|
visible: boolean;
|
||||||
|
// 修改回显的数据
|
||||||
|
data?: CreditFinalVersion | null;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 提交状态
|
||||||
|
const loading = ref(false);
|
||||||
|
// 是否显示最大化切换按钮
|
||||||
|
const maxable = ref(true);
|
||||||
|
// 表格选中数据
|
||||||
|
const formRef = ref<FormInstance | null>(null);
|
||||||
|
const images = ref<ItemType[]>([]);
|
||||||
|
|
||||||
|
// 用户信息
|
||||||
|
const form = reactive<CreditFinalVersion>({
|
||||||
|
id: undefined,
|
||||||
|
dataType: undefined,
|
||||||
|
plaintiffAppellant: undefined,
|
||||||
|
appellee: undefined,
|
||||||
|
otherPartiesThirdParty: undefined,
|
||||||
|
occurrenceTime: undefined,
|
||||||
|
caseNumber: undefined,
|
||||||
|
causeOfAction: undefined,
|
||||||
|
involvedAmount: undefined,
|
||||||
|
courtName: undefined,
|
||||||
|
dataStatus: undefined,
|
||||||
|
comments: undefined,
|
||||||
|
recommend: undefined,
|
||||||
|
sortNumber: undefined,
|
||||||
|
status: undefined,
|
||||||
|
deleted: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
creditFinalVersionId: undefined,
|
||||||
|
creditFinalVersionName: '',
|
||||||
|
status: 0,
|
||||||
|
comments: '',
|
||||||
|
sortNumber: 100
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 更新visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表单验证规则
|
||||||
|
const rules = reactive({
|
||||||
|
creditFinalVersionName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写终本案件名称',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
const chooseImage = (data: FileRecord) => {
|
||||||
|
images.value.push({
|
||||||
|
uid: data.id,
|
||||||
|
url: data.path,
|
||||||
|
status: 'done'
|
||||||
|
});
|
||||||
|
form.image = data.path;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDeleteItem = (index: number) => {
|
||||||
|
images.value.splice(index, 1);
|
||||||
|
form.image = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
const { resetFields } = useForm(form, rules);
|
||||||
|
|
||||||
|
/* 保存编辑 */
|
||||||
|
const save = () => {
|
||||||
|
if (!formRef.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
formRef.value
|
||||||
|
.validate()
|
||||||
|
.then(() => {
|
||||||
|
loading.value = true;
|
||||||
|
const formData = {
|
||||||
|
...form
|
||||||
|
};
|
||||||
|
const saveOrUpdate = isUpdate.value ? updateCreditFinalVersion : addCreditFinalVersion;
|
||||||
|
saveOrUpdate(formData)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(visible) => {
|
||||||
|
if (visible) {
|
||||||
|
images.value = [];
|
||||||
|
if (props.data) {
|
||||||
|
assignObject(form, props.data);
|
||||||
|
if(props.data.image){
|
||||||
|
images.value.push({
|
||||||
|
uid: uuid(),
|
||||||
|
url: props.data.image,
|
||||||
|
status: 'done'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
isUpdate.value = true;
|
||||||
|
} else {
|
||||||
|
isUpdate.value = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
42
src/views/credit/creditFinalVersion/components/search.vue
Normal file
42
src/views/credit/creditFinalVersion/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<!-- 搜索表单 -->
|
||||||
|
<template>
|
||||||
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
|
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||||
|
<template #icon>
|
||||||
|
<PlusOutlined />
|
||||||
|
</template>
|
||||||
|
<span>添加</span>
|
||||||
|
</a-button>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { GradeParam } from '@/api/user/grade/model';
|
||||||
|
import { watch } from 'vue';
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
// 选中的角色
|
||||||
|
selection?: [];
|
||||||
|
}>(),
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'search', where?: GradeParam): void;
|
||||||
|
(e: 'add'): void;
|
||||||
|
(e: 'remove'): void;
|
||||||
|
(e: 'batchMove'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
const add = () => {
|
||||||
|
emit('add');
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.selection,
|
||||||
|
() => {}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
325
src/views/credit/creditFinalVersion/index.vue
Normal file
325
src/views/credit/creditFinalVersion/index.vue
Normal file
@@ -0,0 +1,325 @@
|
|||||||
|
<template>
|
||||||
|
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||||
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
|
<ele-pro-table
|
||||||
|
ref="tableRef"
|
||||||
|
row-key="id"
|
||||||
|
:columns="columns"
|
||||||
|
:datasource="datasource"
|
||||||
|
:customRow="customRow"
|
||||||
|
tool-class="ele-toolbar-form"
|
||||||
|
class="sys-org-table"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<search
|
||||||
|
@search="reload"
|
||||||
|
:selection="selection"
|
||||||
|
@add="openEdit"
|
||||||
|
@remove="removeBatch"
|
||||||
|
@batchMove="openMove"
|
||||||
|
@importData="openImport"
|
||||||
|
@exportData="exportData"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'image'">
|
||||||
|
<a-image :src="record.image" :width="50" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'status'">
|
||||||
|
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||||
|
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'action'">
|
||||||
|
<a-space>
|
||||||
|
<a @click="openEdit(record)">修改</a>
|
||||||
|
<a-divider type="vertical" />
|
||||||
|
<a-popconfirm
|
||||||
|
title="确定要删除此记录吗?"
|
||||||
|
@confirm="remove(record)"
|
||||||
|
>
|
||||||
|
<a class="ele-text-danger">删除</a>
|
||||||
|
</a-popconfirm>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</ele-pro-table>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<CreditFinalVersionEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||||
|
<!-- 导入弹窗 -->
|
||||||
|
<CreditFinalVersionImport
|
||||||
|
v-model:visible="showImport"
|
||||||
|
@done="reload"
|
||||||
|
/>
|
||||||
|
</a-page-header>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { createVNode, ref } from 'vue';
|
||||||
|
import { message, Modal } from 'ant-design-vue';
|
||||||
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
|
import { toDateString } from 'ele-admin-pro';
|
||||||
|
import type {
|
||||||
|
DatasourceFunction,
|
||||||
|
ColumnItem
|
||||||
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
|
import Search from '@/views/credit/components/CreditSearchToolbar.vue';
|
||||||
|
import { exportCreditData } from '../utils/export';
|
||||||
|
import { getPageTitle } from '@/utils/common';
|
||||||
|
import CreditFinalVersionEdit from './components/creditFinalVersionEdit.vue';
|
||||||
|
import CreditFinalVersionImport from './components/credit-final-version-import.vue';
|
||||||
|
import {
|
||||||
|
pageCreditFinalVersion,
|
||||||
|
listCreditFinalVersion,
|
||||||
|
removeCreditFinalVersion,
|
||||||
|
removeBatchCreditFinalVersion
|
||||||
|
} from '@/api/credit/creditFinalVersion';
|
||||||
|
import type {
|
||||||
|
CreditFinalVersion,
|
||||||
|
CreditFinalVersionParam
|
||||||
|
} from '@/api/credit/creditFinalVersion/model';
|
||||||
|
|
||||||
|
// 表格实例
|
||||||
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
|
|
||||||
|
// 表格选中数据
|
||||||
|
const selection = ref<CreditFinalVersion[]>([]);
|
||||||
|
// 当前编辑数据
|
||||||
|
const current = ref<CreditFinalVersion | null>(null);
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
const showEdit = ref(false);
|
||||||
|
// 是否显示导入弹窗
|
||||||
|
const showImport = ref(false);
|
||||||
|
// 是否显示批量移动弹窗
|
||||||
|
const showMove = ref(false);
|
||||||
|
// 加载状态
|
||||||
|
const loading = ref(true);
|
||||||
|
// 搜索关键词
|
||||||
|
const searchText = ref('');
|
||||||
|
|
||||||
|
// 表格数据源
|
||||||
|
const datasource: DatasourceFunction = ({
|
||||||
|
page,
|
||||||
|
limit,
|
||||||
|
where = {},
|
||||||
|
orders,
|
||||||
|
filters
|
||||||
|
}) => {
|
||||||
|
const params: CreditFinalVersionParam = { ...where };
|
||||||
|
if (filters) {
|
||||||
|
(params as any).status = filters.status;
|
||||||
|
}
|
||||||
|
if (!params.keywords && searchText.value) {
|
||||||
|
params.keywords = searchText.value;
|
||||||
|
}
|
||||||
|
return pageCreditFinalVersion({
|
||||||
|
...params,
|
||||||
|
...orders,
|
||||||
|
page,
|
||||||
|
limit
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关键信息列
|
||||||
|
const columns = ref<ColumnItem[]>([
|
||||||
|
{
|
||||||
|
title: 'ID',
|
||||||
|
dataIndex: 'id',
|
||||||
|
key: 'id',
|
||||||
|
width: 90,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数据类型',
|
||||||
|
dataIndex: 'dataType',
|
||||||
|
key: 'dataType',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '原告/上诉人',
|
||||||
|
dataIndex: 'plaintiffAppellant',
|
||||||
|
key: 'plaintiffAppellant',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '发生时间',
|
||||||
|
dataIndex: 'occurrenceTime',
|
||||||
|
key: 'occurrenceTime',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '案号',
|
||||||
|
dataIndex: 'caseNumber',
|
||||||
|
key: 'caseNumber',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '案由',
|
||||||
|
dataIndex: 'causeOfAction',
|
||||||
|
key: 'causeOfAction',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '涉案金额',
|
||||||
|
dataIndex: 'involvedAmount',
|
||||||
|
key: 'involvedAmount',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '法院',
|
||||||
|
dataIndex: 'courtName',
|
||||||
|
key: 'courtName',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数据状态',
|
||||||
|
dataIndex: 'dataStatus',
|
||||||
|
key: 'dataStatus',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
key: 'createTime',
|
||||||
|
width: 180,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
width: 160,
|
||||||
|
fixed: 'right',
|
||||||
|
align: 'center',
|
||||||
|
hideInSetting: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const reload = (where?: CreditFinalVersionParam) => {
|
||||||
|
if (where && Object.prototype.hasOwnProperty.call(where, 'keywords')) {
|
||||||
|
searchText.value = where.keywords ?? '';
|
||||||
|
}
|
||||||
|
const targetWhere = where ?? { keywords: searchText.value || undefined };
|
||||||
|
selection.value = [];
|
||||||
|
tableRef?.value?.reload({ where: targetWhere });
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开编辑弹窗 */
|
||||||
|
const openEdit = (row?: CreditFinalVersion) => {
|
||||||
|
current.value = row ?? null;
|
||||||
|
showEdit.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开批量移动弹窗 */
|
||||||
|
const openMove = () => {
|
||||||
|
showMove.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开导入弹窗 */
|
||||||
|
const openImport = () => {
|
||||||
|
showImport.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 导出 */
|
||||||
|
const exportData = () => {
|
||||||
|
exportCreditData<CreditFinalVersion>({
|
||||||
|
filename: '终本案件',
|
||||||
|
columns: [
|
||||||
|
{ title: 'ID', dataIndex: 'id' },
|
||||||
|
{ title: '数据类型', dataIndex: 'dataType' },
|
||||||
|
{ title: '原告/上诉人', dataIndex: 'plaintiffAppellant' },
|
||||||
|
{ title: '发生时间', dataIndex: 'occurrenceTime' },
|
||||||
|
{ title: '案号', dataIndex: 'caseNumber' },
|
||||||
|
{ title: '案由', dataIndex: 'causeOfAction' },
|
||||||
|
{ title: '涉案金额', dataIndex: 'involvedAmount' },
|
||||||
|
{ title: '法院', dataIndex: 'courtName' },
|
||||||
|
{ title: '数据状态', dataIndex: 'dataStatus' },
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
formatter: (record: CreditFinalVersion) =>
|
||||||
|
record.createTime
|
||||||
|
? toDateString(record.createTime, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
],
|
||||||
|
fetchData: () =>
|
||||||
|
listCreditFinalVersion({
|
||||||
|
keywords: searchText.value || undefined
|
||||||
|
})
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 删除单个 */
|
||||||
|
const remove = (row: CreditFinalVersion) => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeCreditFinalVersion(row.id)
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 批量删除 */
|
||||||
|
const removeBatch = () => {
|
||||||
|
if (!selection.value.length) {
|
||||||
|
message.error('请至少选择一条数据');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要删除选中的记录吗?',
|
||||||
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
|
maskClosable: true,
|
||||||
|
onOk: () => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeBatchCreditFinalVersion(selection.value.map((d) => d.id))
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 查询 */
|
||||||
|
const query = () => {
|
||||||
|
loading.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 自定义行属性 */
|
||||||
|
const customRow = (record: CreditFinalVersion) => {
|
||||||
|
return {
|
||||||
|
// 行点击事件
|
||||||
|
onClick: () => {
|
||||||
|
// console.log(record);
|
||||||
|
},
|
||||||
|
// 行双击事件
|
||||||
|
onDblclick: () => {
|
||||||
|
openEdit(record);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
query();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default {
|
||||||
|
name: 'CreditFinalVersion'
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
<!-- 股权冻结导入弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="520"
|
||||||
|
:footer="null"
|
||||||
|
title="股权冻结批量导入"
|
||||||
|
:visible="visible"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
>
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<a-upload-dragger
|
||||||
|
accept=".xls,.xlsx"
|
||||||
|
:show-upload-list="false"
|
||||||
|
:customRequest="doUpload"
|
||||||
|
style="padding: 24px 0; margin-bottom: 16px"
|
||||||
|
>
|
||||||
|
<p class="ant-upload-drag-icon">
|
||||||
|
<cloud-upload-outlined />
|
||||||
|
</p>
|
||||||
|
<p class="ant-upload-hint">将文件拖到此处,或点击上传</p>
|
||||||
|
</a-upload-dragger>
|
||||||
|
</a-spin>
|
||||||
|
<div class="ele-text-center">
|
||||||
|
<span>只能上传xls、xlsx文件,</span>
|
||||||
|
<a :href="templateUrl" download="股权冻结导入模板.xlsx">
|
||||||
|
下载导入模板
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { message } from 'ant-design-vue/es';
|
||||||
|
import { CloudUploadOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { importCreditGqdj } from '@/api/credit/creditGqdj';
|
||||||
|
import { API_BASE_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
// 是否打开弹窗
|
||||||
|
visible: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 导入请求状态
|
||||||
|
const loading = ref(false);
|
||||||
|
|
||||||
|
// 模板下载地址,保持与当前接口域名一致
|
||||||
|
const templateUrl = computed(() => {
|
||||||
|
const base = (localStorage.getItem('ApiUrl') || API_BASE_URL || '').replace(
|
||||||
|
/\/$/,
|
||||||
|
''
|
||||||
|
);
|
||||||
|
return `${base}/credit/credit-gqdj/import/template`;
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 上传 */
|
||||||
|
const doUpload = ({ file }) => {
|
||||||
|
if (
|
||||||
|
![
|
||||||
|
'application/vnd.ms-excel',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
].includes(file.type)
|
||||||
|
) {
|
||||||
|
message.error('只能选择 excel 文件');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (file.size / 1024 / 1024 > 10) {
|
||||||
|
message.error('大小不能超过 10MB');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
loading.value = true;
|
||||||
|
importCreditGqdj(file)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 更新 visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
300
src/views/credit/creditGqdj/components/creditGqdjEdit.vue
Normal file
300
src/views/credit/creditGqdj/components/creditGqdjEdit.vue
Normal file
@@ -0,0 +1,300 @@
|
|||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="800"
|
||||||
|
:visible="visible"
|
||||||
|
:maskClosable="false"
|
||||||
|
:maxable="maxable"
|
||||||
|
:title="isUpdate ? '编辑股权冻结' : '添加股权冻结'"
|
||||||
|
:body-style="{ paddingBottom: '28px' }"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
@ok="save"
|
||||||
|
>
|
||||||
|
<a-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||||
|
:wrapper-col="
|
||||||
|
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<a-form-item label="数据类型" name="dataType">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入数据类型"
|
||||||
|
v-model:value="form.dataType"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="原告/上诉人" name="plaintiffAppellant">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入原告/上诉人"
|
||||||
|
v-model:value="form.plaintiffAppellant"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="被告/被上诉人" name="defendant appellee">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入被告/被上诉人"
|
||||||
|
v-model:value="form.appellee"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="其他当事人/第三人" name="otherPartiesThirdParty">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入其他当事人/第三人"
|
||||||
|
v-model:value="form.otherPartiesThirdParty"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="发生时间" name="occurrenceTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入发生时间"
|
||||||
|
v-model:value="form.occurrenceTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="案号" name="caseNumber">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入案号"
|
||||||
|
v-model:value="form.caseNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="案由" name="causeOfAction">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入案由"
|
||||||
|
v-model:value="form.causeOfAction"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="涉案金额" name="involvedAmount">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入涉案金额"
|
||||||
|
v-model:value="form.involvedAmount"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="法院" name="courtName">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入法院"
|
||||||
|
v-model:value="form.courtName"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="数据状态" name="dataStatus">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入数据状态"
|
||||||
|
v-model:value="form.dataStatus"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="备注" name="comments">
|
||||||
|
<a-textarea
|
||||||
|
:rows="4"
|
||||||
|
:maxlength="200"
|
||||||
|
placeholder="请输入描述"
|
||||||
|
v-model:value="form.comments"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否推荐" name="recommend">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否推荐"
|
||||||
|
v-model:value="form.recommend"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
|
||||||
|
<a-input-number
|
||||||
|
:min="0"
|
||||||
|
:max="9999"
|
||||||
|
class="ele-fluid"
|
||||||
|
placeholder="请输入排序号"
|
||||||
|
v-model:value="form.sortNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="状态, 0正常, 1冻结" name="status">
|
||||||
|
<a-radio-group v-model:value="form.status">
|
||||||
|
<a-radio :value="0">显示</a-radio>
|
||||||
|
<a-radio :value="1">隐藏</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否删除, 0否, 1是" name="deleted">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否删除, 0否, 1是"
|
||||||
|
v-model:value="form.deleted"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="用户ID" name="userId">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入用户ID"
|
||||||
|
v-model:value="form.userId"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="修改时间" name="updateTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入修改时间"
|
||||||
|
v-model:value="form.updateTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, watch } from 'vue';
|
||||||
|
import { Form, message } from 'ant-design-vue';
|
||||||
|
import { assignObject, uuid } from 'ele-admin-pro';
|
||||||
|
import { addCreditGqdj, updateCreditGqdj } from '@/api/credit/creditGqdj';
|
||||||
|
import { CreditGqdj } from '@/api/credit/creditGqdj/model';
|
||||||
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
|
|
||||||
|
// 是否是修改
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
// 是否开启响应式布局
|
||||||
|
const themeStore = useThemeStore();
|
||||||
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
// 弹窗是否打开
|
||||||
|
visible: boolean;
|
||||||
|
// 修改回显的数据
|
||||||
|
data?: CreditGqdj | null;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 提交状态
|
||||||
|
const loading = ref(false);
|
||||||
|
// 是否显示最大化切换按钮
|
||||||
|
const maxable = ref(true);
|
||||||
|
// 表格选中数据
|
||||||
|
const formRef = ref<FormInstance | null>(null);
|
||||||
|
const images = ref<ItemType[]>([]);
|
||||||
|
|
||||||
|
// 用户信息
|
||||||
|
const form = reactive<CreditGqdj>({
|
||||||
|
id: undefined,
|
||||||
|
dataType: undefined,
|
||||||
|
plaintiffAppellant: undefined,
|
||||||
|
appellee: undefined,
|
||||||
|
otherPartiesThirdParty: undefined,
|
||||||
|
occurrenceTime: undefined,
|
||||||
|
caseNumber: undefined,
|
||||||
|
causeOfAction: undefined,
|
||||||
|
involvedAmount: undefined,
|
||||||
|
courtName: undefined,
|
||||||
|
dataStatus: undefined,
|
||||||
|
comments: undefined,
|
||||||
|
recommend: undefined,
|
||||||
|
sortNumber: undefined,
|
||||||
|
status: undefined,
|
||||||
|
deleted: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
creditGqdjId: undefined,
|
||||||
|
creditGqdjName: '',
|
||||||
|
status: 0,
|
||||||
|
comments: '',
|
||||||
|
sortNumber: 100
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 更新visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表单验证规则
|
||||||
|
const rules = reactive({
|
||||||
|
creditGqdjName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写股权冻结名称',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
const chooseImage = (data: FileRecord) => {
|
||||||
|
images.value.push({
|
||||||
|
uid: data.id,
|
||||||
|
url: data.path,
|
||||||
|
status: 'done'
|
||||||
|
});
|
||||||
|
form.image = data.path;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDeleteItem = (index: number) => {
|
||||||
|
images.value.splice(index, 1);
|
||||||
|
form.image = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
const { resetFields } = useForm(form, rules);
|
||||||
|
|
||||||
|
/* 保存编辑 */
|
||||||
|
const save = () => {
|
||||||
|
if (!formRef.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
formRef.value
|
||||||
|
.validate()
|
||||||
|
.then(() => {
|
||||||
|
loading.value = true;
|
||||||
|
const formData = {
|
||||||
|
...form
|
||||||
|
};
|
||||||
|
const saveOrUpdate = isUpdate.value ? updateCreditGqdj : addCreditGqdj;
|
||||||
|
saveOrUpdate(formData)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(visible) => {
|
||||||
|
if (visible) {
|
||||||
|
images.value = [];
|
||||||
|
if (props.data) {
|
||||||
|
assignObject(form, props.data);
|
||||||
|
if(props.data.image){
|
||||||
|
images.value.push({
|
||||||
|
uid: uuid(),
|
||||||
|
url: props.data.image,
|
||||||
|
status: 'done'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
isUpdate.value = true;
|
||||||
|
} else {
|
||||||
|
isUpdate.value = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
42
src/views/credit/creditGqdj/components/search.vue
Normal file
42
src/views/credit/creditGqdj/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<!-- 搜索表单 -->
|
||||||
|
<template>
|
||||||
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
|
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||||
|
<template #icon>
|
||||||
|
<PlusOutlined />
|
||||||
|
</template>
|
||||||
|
<span>添加</span>
|
||||||
|
</a-button>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { GradeParam } from '@/api/user/grade/model';
|
||||||
|
import { watch } from 'vue';
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
// 选中的角色
|
||||||
|
selection?: [];
|
||||||
|
}>(),
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'search', where?: GradeParam): void;
|
||||||
|
(e: 'add'): void;
|
||||||
|
(e: 'remove'): void;
|
||||||
|
(e: 'batchMove'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
const add = () => {
|
||||||
|
emit('add');
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.selection,
|
||||||
|
() => {}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
322
src/views/credit/creditGqdj/index.vue
Normal file
322
src/views/credit/creditGqdj/index.vue
Normal file
@@ -0,0 +1,322 @@
|
|||||||
|
<template>
|
||||||
|
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||||
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
|
<ele-pro-table
|
||||||
|
ref="tableRef"
|
||||||
|
row-key="id"
|
||||||
|
:columns="columns"
|
||||||
|
:datasource="datasource"
|
||||||
|
:customRow="customRow"
|
||||||
|
tool-class="ele-toolbar-form"
|
||||||
|
class="sys-org-table"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<search
|
||||||
|
@search="reload"
|
||||||
|
:selection="selection"
|
||||||
|
@add="openEdit"
|
||||||
|
@remove="removeBatch"
|
||||||
|
@batchMove="openMove"
|
||||||
|
@importData="openImport"
|
||||||
|
@exportData="exportData"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'image'">
|
||||||
|
<a-image :src="record.image" :width="50" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'status'">
|
||||||
|
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||||
|
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'action'">
|
||||||
|
<a-space>
|
||||||
|
<a @click="openEdit(record)">修改</a>
|
||||||
|
<a-divider type="vertical" />
|
||||||
|
<a-popconfirm
|
||||||
|
title="确定要删除此记录吗?"
|
||||||
|
@confirm="remove(record)"
|
||||||
|
>
|
||||||
|
<a class="ele-text-danger">删除</a>
|
||||||
|
</a-popconfirm>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</ele-pro-table>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<CreditGqdjEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||||
|
<!-- 导入弹窗 -->
|
||||||
|
<CreditGqdjImport v-model:visible="showImport" @done="reload" />
|
||||||
|
</a-page-header>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { createVNode, ref } from 'vue';
|
||||||
|
import { message, Modal } from 'ant-design-vue';
|
||||||
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
|
import { toDateString } from 'ele-admin-pro';
|
||||||
|
import type {
|
||||||
|
DatasourceFunction,
|
||||||
|
ColumnItem
|
||||||
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
|
import Search from '@/views/credit/components/CreditSearchToolbar.vue';
|
||||||
|
import { exportCreditData } from '../utils/export';
|
||||||
|
import { getPageTitle } from '@/utils/common';
|
||||||
|
import CreditGqdjEdit from './components/creditGqdjEdit.vue';
|
||||||
|
import CreditGqdjImport from './components/credit-gqdj-import.vue';
|
||||||
|
import {
|
||||||
|
pageCreditGqdj,
|
||||||
|
listCreditGqdj,
|
||||||
|
removeCreditGqdj,
|
||||||
|
removeBatchCreditGqdj
|
||||||
|
} from '@/api/credit/creditGqdj';
|
||||||
|
import type {
|
||||||
|
CreditGqdj,
|
||||||
|
CreditGqdjParam
|
||||||
|
} from '@/api/credit/creditGqdj/model';
|
||||||
|
|
||||||
|
// 表格实例
|
||||||
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
|
|
||||||
|
// 表格选中数据
|
||||||
|
const selection = ref<CreditGqdj[]>([]);
|
||||||
|
// 当前编辑数据
|
||||||
|
const current = ref<CreditGqdj | null>(null);
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
const showEdit = ref(false);
|
||||||
|
// 是否显示导入弹窗
|
||||||
|
const showImport = ref(false);
|
||||||
|
// 是否显示批量移动弹窗
|
||||||
|
const showMove = ref(false);
|
||||||
|
// 加载状态
|
||||||
|
const loading = ref(true);
|
||||||
|
// 搜索关键词
|
||||||
|
const searchText = ref('');
|
||||||
|
|
||||||
|
// 表格数据源
|
||||||
|
const datasource: DatasourceFunction = ({
|
||||||
|
page,
|
||||||
|
limit,
|
||||||
|
where = {},
|
||||||
|
orders,
|
||||||
|
filters
|
||||||
|
}) => {
|
||||||
|
const params: CreditGqdjParam = { ...where };
|
||||||
|
if (filters) {
|
||||||
|
(params as any).status = filters.status;
|
||||||
|
}
|
||||||
|
if (!params.keywords && searchText.value) {
|
||||||
|
params.keywords = searchText.value;
|
||||||
|
}
|
||||||
|
return pageCreditGqdj({
|
||||||
|
...params,
|
||||||
|
...orders,
|
||||||
|
page,
|
||||||
|
limit
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关键信息列
|
||||||
|
const columns = ref<ColumnItem[]>([
|
||||||
|
{
|
||||||
|
title: 'ID',
|
||||||
|
dataIndex: 'id',
|
||||||
|
key: 'id',
|
||||||
|
width: 80
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数据类型',
|
||||||
|
dataIndex: 'dataType',
|
||||||
|
key: 'dataType',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '原告/上诉人',
|
||||||
|
dataIndex: 'plaintiffAppellant',
|
||||||
|
key: 'plaintiffAppellant',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '发生时间',
|
||||||
|
dataIndex: 'occurrenceTime',
|
||||||
|
key: 'occurrenceTime',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '案号',
|
||||||
|
dataIndex: 'caseNumber',
|
||||||
|
key: 'caseNumber',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '案由',
|
||||||
|
dataIndex: 'causeOfAction',
|
||||||
|
key: 'causeOfAction',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '涉案金额',
|
||||||
|
dataIndex: 'involvedAmount',
|
||||||
|
key: 'involvedAmount',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '法院',
|
||||||
|
dataIndex: 'courtName',
|
||||||
|
key: 'courtName',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数据状态',
|
||||||
|
dataIndex: 'dataStatus',
|
||||||
|
key: 'dataStatus',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
key: 'createTime',
|
||||||
|
width: 180,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
width: 160,
|
||||||
|
fixed: 'right',
|
||||||
|
align: 'center',
|
||||||
|
hideInSetting: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const reload = (where?: CreditGqdjParam) => {
|
||||||
|
if (where && Object.prototype.hasOwnProperty.call(where, 'keywords')) {
|
||||||
|
searchText.value = where.keywords ?? '';
|
||||||
|
}
|
||||||
|
const targetWhere = where ?? { keywords: searchText.value || undefined };
|
||||||
|
selection.value = [];
|
||||||
|
tableRef?.value?.reload({ where: targetWhere });
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开编辑弹窗 */
|
||||||
|
const openEdit = (row?: CreditGqdj) => {
|
||||||
|
current.value = row ?? null;
|
||||||
|
showEdit.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开批量移动弹窗 */
|
||||||
|
const openMove = () => {
|
||||||
|
showMove.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开导入弹窗 */
|
||||||
|
const openImport = () => {
|
||||||
|
showImport.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 导出 */
|
||||||
|
const exportData = () => {
|
||||||
|
exportCreditData<CreditGqdj>({
|
||||||
|
filename: '股权冻结',
|
||||||
|
columns: [
|
||||||
|
{ title: 'ID', dataIndex: 'id' },
|
||||||
|
{ title: '数据类型', dataIndex: 'dataType' },
|
||||||
|
{ title: '原告/上诉人', dataIndex: 'plaintiffAppellant' },
|
||||||
|
{ title: '发生时间', dataIndex: 'occurrenceTime' },
|
||||||
|
{ title: '案号', dataIndex: 'caseNumber' },
|
||||||
|
{ title: '案由', dataIndex: 'causeOfAction' },
|
||||||
|
{ title: '涉案金额', dataIndex: 'involvedAmount' },
|
||||||
|
{ title: '法院', dataIndex: 'courtName' },
|
||||||
|
{ title: '数据状态', dataIndex: 'dataStatus' },
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
formatter: (record: CreditGqdj) =>
|
||||||
|
record.createTime
|
||||||
|
? toDateString(record.createTime, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
],
|
||||||
|
fetchData: () =>
|
||||||
|
listCreditGqdj({
|
||||||
|
keywords: searchText.value || undefined
|
||||||
|
})
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 删除单个 */
|
||||||
|
const remove = (row: CreditGqdj) => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeCreditGqdj(row.id)
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 批量删除 */
|
||||||
|
const removeBatch = () => {
|
||||||
|
if (!selection.value.length) {
|
||||||
|
message.error('请至少选择一条数据');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要删除选中的记录吗?',
|
||||||
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
|
maskClosable: true,
|
||||||
|
onOk: () => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeBatchCreditGqdj(selection.value.map((d) => d.id))
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 查询 */
|
||||||
|
const query = () => {
|
||||||
|
loading.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 自定义行属性 */
|
||||||
|
const customRow = (record: CreditGqdj) => {
|
||||||
|
return {
|
||||||
|
// 行点击事件
|
||||||
|
onClick: () => {
|
||||||
|
// console.log(record);
|
||||||
|
},
|
||||||
|
// 行双击事件
|
||||||
|
onDblclick: () => {
|
||||||
|
openEdit(record);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
query();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default {
|
||||||
|
name: 'CreditGqdj'
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
<!-- 被执行人导入弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="520"
|
||||||
|
:footer="null"
|
||||||
|
title="被执行人批量导入"
|
||||||
|
:visible="visible"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
>
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<a-upload-dragger
|
||||||
|
accept=".xls,.xlsx"
|
||||||
|
:show-upload-list="false"
|
||||||
|
:customRequest="doUpload"
|
||||||
|
style="padding: 24px 0; margin-bottom: 16px"
|
||||||
|
>
|
||||||
|
<p class="ant-upload-drag-icon">
|
||||||
|
<cloud-upload-outlined />
|
||||||
|
</p>
|
||||||
|
<p class="ant-upload-hint">将文件拖到此处,或点击上传</p>
|
||||||
|
</a-upload-dragger>
|
||||||
|
</a-spin>
|
||||||
|
<div class="ele-text-center">
|
||||||
|
<span>只能上传xls、xlsx文件,</span>
|
||||||
|
<a :href="templateUrl" download="被执行人导入模板.xlsx">
|
||||||
|
下载导入模板
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { message } from 'ant-design-vue/es';
|
||||||
|
import { CloudUploadOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { importCreditJudgmentDebtor } from '@/api/credit/creditJudgmentDebtor';
|
||||||
|
import { API_BASE_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
// 是否打开弹窗
|
||||||
|
visible: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 导入请求状态
|
||||||
|
const loading = ref(false);
|
||||||
|
|
||||||
|
// 模板下载地址,保持与当前接口域名一致
|
||||||
|
const templateUrl = computed(() => {
|
||||||
|
const base = (localStorage.getItem('ApiUrl') || API_BASE_URL || '').replace(
|
||||||
|
/\/$/,
|
||||||
|
''
|
||||||
|
);
|
||||||
|
return `${base}/credit/credit-judgment-debtor/import/template`;
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 上传 */
|
||||||
|
const doUpload = ({ file }) => {
|
||||||
|
if (
|
||||||
|
![
|
||||||
|
'application/vnd.ms-excel',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
].includes(file.type)
|
||||||
|
) {
|
||||||
|
message.error('只能选择 excel 文件');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (file.size / 1024 / 1024 > 10) {
|
||||||
|
message.error('大小不能超过 10MB');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
loading.value = true;
|
||||||
|
importCreditJudgmentDebtor(file)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 更新 visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -0,0 +1,276 @@
|
|||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="800"
|
||||||
|
:visible="visible"
|
||||||
|
:maskClosable="false"
|
||||||
|
:maxable="maxable"
|
||||||
|
:title="isUpdate ? '编辑被执行人' : '添加被执行人'"
|
||||||
|
:body-style="{ paddingBottom: '28px' }"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
@ok="save"
|
||||||
|
>
|
||||||
|
<a-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||||
|
:wrapper-col="
|
||||||
|
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<a-form-item label="案号" name="caseNumber">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入案号"
|
||||||
|
v-model:value="form.caseNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="被执行人名称" name="name">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入被执行人名称"
|
||||||
|
v-model:value="form.name"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="证件号/组织机构代码" name="code">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入证件号/组织机构代码"
|
||||||
|
v-model:value="form.code"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="立案日期" name="occurrenceTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入立案日期"
|
||||||
|
v-model:value="form.occurrenceTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="执行标的(元)" name="amount">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入执行标的(元)"
|
||||||
|
v-model:value="form.amount"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="法院" name="courtName">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入法院"
|
||||||
|
v-model:value="form.courtName"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="数据状态" name="dataStatus">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入数据状态"
|
||||||
|
v-model:value="form.dataStatus"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="备注" name="comments">
|
||||||
|
<a-textarea
|
||||||
|
:rows="4"
|
||||||
|
:maxlength="200"
|
||||||
|
placeholder="请输入描述"
|
||||||
|
v-model:value="form.comments"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否推荐" name="recommend">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否推荐"
|
||||||
|
v-model:value="form.recommend"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
|
||||||
|
<a-input-number
|
||||||
|
:min="0"
|
||||||
|
:max="9999"
|
||||||
|
class="ele-fluid"
|
||||||
|
placeholder="请输入排序号"
|
||||||
|
v-model:value="form.sortNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="状态, 0正常, 1冻结" name="status">
|
||||||
|
<a-radio-group v-model:value="form.status">
|
||||||
|
<a-radio :value="0">显示</a-radio>
|
||||||
|
<a-radio :value="1">隐藏</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否删除, 0否, 1是" name="deleted">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否删除, 0否, 1是"
|
||||||
|
v-model:value="form.deleted"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="用户ID" name="userId">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入用户ID"
|
||||||
|
v-model:value="form.userId"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="修改时间" name="updateTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入修改时间"
|
||||||
|
v-model:value="form.updateTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, watch } from 'vue';
|
||||||
|
import { Form, message } from 'ant-design-vue';
|
||||||
|
import { assignObject, uuid } from 'ele-admin-pro';
|
||||||
|
import { addCreditJudgmentDebtor, updateCreditJudgmentDebtor } from '@/api/credit/creditJudgmentDebtor';
|
||||||
|
import { CreditJudgmentDebtor } from '@/api/credit/creditJudgmentDebtor/model';
|
||||||
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
|
|
||||||
|
// 是否是修改
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
// 是否开启响应式布局
|
||||||
|
const themeStore = useThemeStore();
|
||||||
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
// 弹窗是否打开
|
||||||
|
visible: boolean;
|
||||||
|
// 修改回显的数据
|
||||||
|
data?: CreditJudgmentDebtor | null;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 提交状态
|
||||||
|
const loading = ref(false);
|
||||||
|
// 是否显示最大化切换按钮
|
||||||
|
const maxable = ref(true);
|
||||||
|
// 表格选中数据
|
||||||
|
const formRef = ref<FormInstance | null>(null);
|
||||||
|
const images = ref<ItemType[]>([]);
|
||||||
|
|
||||||
|
// 用户信息
|
||||||
|
const form = reactive<CreditJudgmentDebtor>({
|
||||||
|
id: undefined,
|
||||||
|
caseNumber: undefined,
|
||||||
|
name: undefined,
|
||||||
|
code: undefined,
|
||||||
|
occurrenceTime: undefined,
|
||||||
|
amount: undefined,
|
||||||
|
courtName: undefined,
|
||||||
|
dataStatus: undefined,
|
||||||
|
comments: undefined,
|
||||||
|
recommend: undefined,
|
||||||
|
sortNumber: undefined,
|
||||||
|
status: undefined,
|
||||||
|
deleted: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
creditJudgmentDebtorId: undefined,
|
||||||
|
creditJudgmentDebtorName: '',
|
||||||
|
status: 0,
|
||||||
|
comments: '',
|
||||||
|
sortNumber: 100
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 更新visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表单验证规则
|
||||||
|
const rules = reactive({
|
||||||
|
creditJudgmentDebtorName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写被执行人名称',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
const chooseImage = (data: FileRecord) => {
|
||||||
|
images.value.push({
|
||||||
|
uid: data.id,
|
||||||
|
url: data.path,
|
||||||
|
status: 'done'
|
||||||
|
});
|
||||||
|
form.image = data.path;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDeleteItem = (index: number) => {
|
||||||
|
images.value.splice(index, 1);
|
||||||
|
form.image = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
const { resetFields } = useForm(form, rules);
|
||||||
|
|
||||||
|
/* 保存编辑 */
|
||||||
|
const save = () => {
|
||||||
|
if (!formRef.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
formRef.value
|
||||||
|
.validate()
|
||||||
|
.then(() => {
|
||||||
|
loading.value = true;
|
||||||
|
const formData = {
|
||||||
|
...form
|
||||||
|
};
|
||||||
|
const saveOrUpdate = isUpdate.value ? updateCreditJudgmentDebtor : addCreditJudgmentDebtor;
|
||||||
|
saveOrUpdate(formData)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(visible) => {
|
||||||
|
if (visible) {
|
||||||
|
images.value = [];
|
||||||
|
if (props.data) {
|
||||||
|
assignObject(form, props.data);
|
||||||
|
if(props.data.image){
|
||||||
|
images.value.push({
|
||||||
|
uid: uuid(),
|
||||||
|
url: props.data.image,
|
||||||
|
status: 'done'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
isUpdate.value = true;
|
||||||
|
} else {
|
||||||
|
isUpdate.value = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
42
src/views/credit/creditJudgmentDebtor/components/search.vue
Normal file
42
src/views/credit/creditJudgmentDebtor/components/search.vue
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
<!-- 搜索表单 -->
|
||||||
|
<template>
|
||||||
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
|
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||||
|
<template #icon>
|
||||||
|
<PlusOutlined />
|
||||||
|
</template>
|
||||||
|
<span>添加</span>
|
||||||
|
</a-button>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { GradeParam } from '@/api/user/grade/model';
|
||||||
|
import { watch } from 'vue';
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
// 选中的角色
|
||||||
|
selection?: [];
|
||||||
|
}>(),
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'search', where?: GradeParam): void;
|
||||||
|
(e: 'add'): void;
|
||||||
|
(e: 'remove'): void;
|
||||||
|
(e: 'batchMove'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
const add = () => {
|
||||||
|
emit('add');
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.selection,
|
||||||
|
() => {}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
318
src/views/credit/creditJudgmentDebtor/index.vue
Normal file
318
src/views/credit/creditJudgmentDebtor/index.vue
Normal file
@@ -0,0 +1,318 @@
|
|||||||
|
<template>
|
||||||
|
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||||
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
|
<ele-pro-table
|
||||||
|
ref="tableRef"
|
||||||
|
row-key="id"
|
||||||
|
:columns="columns"
|
||||||
|
:datasource="datasource"
|
||||||
|
:customRow="customRow"
|
||||||
|
tool-class="ele-toolbar-form"
|
||||||
|
class="sys-org-table"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<search
|
||||||
|
@search="reload"
|
||||||
|
:selection="selection"
|
||||||
|
@add="openEdit"
|
||||||
|
@remove="removeBatch"
|
||||||
|
@batchMove="openMove"
|
||||||
|
@importData="openImport"
|
||||||
|
@exportData="exportData"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'image'">
|
||||||
|
<a-image :src="record.image" :width="50" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'status'">
|
||||||
|
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||||
|
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'action'">
|
||||||
|
<a-space>
|
||||||
|
<a @click="openEdit(record)">修改</a>
|
||||||
|
<a-divider type="vertical" />
|
||||||
|
<a-popconfirm
|
||||||
|
title="确定要删除此记录吗?"
|
||||||
|
@confirm="remove(record)"
|
||||||
|
>
|
||||||
|
<a class="ele-text-danger">删除</a>
|
||||||
|
</a-popconfirm>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</ele-pro-table>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<CreditJudgmentDebtorEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||||
|
<!-- 导入弹窗 -->
|
||||||
|
<CreditJudgmentDebtorImport
|
||||||
|
v-model:visible="showImport"
|
||||||
|
@done="reload"
|
||||||
|
/>
|
||||||
|
</a-page-header>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { createVNode, ref } from 'vue';
|
||||||
|
import { message, Modal } from 'ant-design-vue';
|
||||||
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
|
import { toDateString } from 'ele-admin-pro';
|
||||||
|
import type {
|
||||||
|
DatasourceFunction,
|
||||||
|
ColumnItem
|
||||||
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
|
import Search from '@/views/credit/components/CreditSearchToolbar.vue';
|
||||||
|
import { exportCreditData } from '../utils/export';
|
||||||
|
import { getPageTitle } from '@/utils/common';
|
||||||
|
import CreditJudgmentDebtorEdit from './components/creditJudgmentDebtorEdit.vue';
|
||||||
|
import CreditJudgmentDebtorImport from './components/credit-judgment-debtor-import.vue';
|
||||||
|
import {
|
||||||
|
pageCreditJudgmentDebtor,
|
||||||
|
listCreditJudgmentDebtor,
|
||||||
|
removeCreditJudgmentDebtor,
|
||||||
|
removeBatchCreditJudgmentDebtor
|
||||||
|
} from '@/api/credit/creditJudgmentDebtor';
|
||||||
|
import type {
|
||||||
|
CreditJudgmentDebtor,
|
||||||
|
CreditJudgmentDebtorParam
|
||||||
|
} from '@/api/credit/creditJudgmentDebtor/model';
|
||||||
|
|
||||||
|
// 表格实例
|
||||||
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
|
|
||||||
|
// 表格选中数据
|
||||||
|
const selection = ref<CreditJudgmentDebtor[]>([]);
|
||||||
|
// 当前编辑数据
|
||||||
|
const current = ref<CreditJudgmentDebtor | null>(null);
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
const showEdit = ref(false);
|
||||||
|
// 是否显示导入弹窗
|
||||||
|
const showImport = ref(false);
|
||||||
|
// 是否显示批量移动弹窗
|
||||||
|
const showMove = ref(false);
|
||||||
|
// 加载状态
|
||||||
|
const loading = ref(true);
|
||||||
|
// 搜索关键词
|
||||||
|
const searchText = ref('');
|
||||||
|
|
||||||
|
// 表格数据源
|
||||||
|
const datasource: DatasourceFunction = ({
|
||||||
|
page,
|
||||||
|
limit,
|
||||||
|
where = {},
|
||||||
|
orders,
|
||||||
|
filters
|
||||||
|
}) => {
|
||||||
|
const params: CreditJudgmentDebtorParam = { ...where };
|
||||||
|
if (filters) {
|
||||||
|
(params as any).status = filters.status;
|
||||||
|
}
|
||||||
|
if (!params.keywords && searchText.value) {
|
||||||
|
params.keywords = searchText.value;
|
||||||
|
}
|
||||||
|
return pageCreditJudgmentDebtor({
|
||||||
|
...params,
|
||||||
|
...orders,
|
||||||
|
page,
|
||||||
|
limit
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关键信息列
|
||||||
|
const columns = ref<ColumnItem[]>([
|
||||||
|
{
|
||||||
|
title: 'ID',
|
||||||
|
dataIndex: 'id',
|
||||||
|
key: 'id',
|
||||||
|
width: 80
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '案号',
|
||||||
|
dataIndex: 'caseNumber',
|
||||||
|
key: 'caseNumber',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '被执行人名称',
|
||||||
|
dataIndex: 'name',
|
||||||
|
key: 'name',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '证件号/组织机构代码',
|
||||||
|
dataIndex: 'code',
|
||||||
|
key: 'code',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '立案日期',
|
||||||
|
dataIndex: 'occurrenceTime',
|
||||||
|
key: 'occurrenceTime',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '执行标的(元)',
|
||||||
|
dataIndex: 'amount',
|
||||||
|
key: 'amount',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '法院',
|
||||||
|
dataIndex: 'courtName',
|
||||||
|
key: 'courtName',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数据状态',
|
||||||
|
dataIndex: 'dataStatus',
|
||||||
|
key: 'dataStatus',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
key: 'createTime',
|
||||||
|
width: 180,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
width: 160,
|
||||||
|
fixed: 'right',
|
||||||
|
align: 'center',
|
||||||
|
hideInSetting: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const reload = (where?: CreditJudgmentDebtorParam) => {
|
||||||
|
if (where && Object.prototype.hasOwnProperty.call(where, 'keywords')) {
|
||||||
|
searchText.value = where.keywords ?? '';
|
||||||
|
}
|
||||||
|
const targetWhere = where ?? { keywords: searchText.value || undefined };
|
||||||
|
selection.value = [];
|
||||||
|
tableRef?.value?.reload({ where: targetWhere });
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开编辑弹窗 */
|
||||||
|
const openEdit = (row?: CreditJudgmentDebtor) => {
|
||||||
|
current.value = row ?? null;
|
||||||
|
showEdit.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开批量移动弹窗 */
|
||||||
|
const openMove = () => {
|
||||||
|
showMove.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开导入弹窗 */
|
||||||
|
const openImport = () => {
|
||||||
|
showImport.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 导出 */
|
||||||
|
const exportData = () => {
|
||||||
|
exportCreditData<CreditJudgmentDebtor>({
|
||||||
|
filename: '被执行人',
|
||||||
|
columns: [
|
||||||
|
{ title: 'ID', dataIndex: 'id' },
|
||||||
|
{ title: '案号', dataIndex: 'caseNumber' },
|
||||||
|
{ title: '被执行人名称', dataIndex: 'name' },
|
||||||
|
{ title: '证件号/组织机构代码', dataIndex: 'code' },
|
||||||
|
{ title: '立案日期', dataIndex: 'occurrenceTime' },
|
||||||
|
{ title: '执行标的(元)', dataIndex: 'amount' },
|
||||||
|
{ title: '法院', dataIndex: 'courtName' },
|
||||||
|
{ title: '数据状态', dataIndex: 'dataStatus' },
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
formatter: (record: CreditJudgmentDebtor) =>
|
||||||
|
record.createTime
|
||||||
|
? toDateString(record.createTime, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
],
|
||||||
|
fetchData: () =>
|
||||||
|
listCreditJudgmentDebtor({
|
||||||
|
keywords: searchText.value || undefined
|
||||||
|
})
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 删除单个 */
|
||||||
|
const remove = (row: CreditJudgmentDebtor) => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeCreditJudgmentDebtor(row.id)
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 批量删除 */
|
||||||
|
const removeBatch = () => {
|
||||||
|
if (!selection.value.length) {
|
||||||
|
message.error('请至少选择一条数据');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要删除选中的记录吗?',
|
||||||
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
|
maskClosable: true,
|
||||||
|
onOk: () => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeBatchCreditJudgmentDebtor(selection.value.map((d) => d.id))
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 查询 */
|
||||||
|
const query = () => {
|
||||||
|
loading.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 自定义行属性 */
|
||||||
|
const customRow = (record: CreditJudgmentDebtor) => {
|
||||||
|
return {
|
||||||
|
// 行点击事件
|
||||||
|
onClick: () => {
|
||||||
|
// console.log(record);
|
||||||
|
},
|
||||||
|
// 行双击事件
|
||||||
|
onDblclick: () => {
|
||||||
|
openEdit(record);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
query();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default {
|
||||||
|
name: 'CreditJudgmentDebtor'
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
<!-- 裁判文书导入弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="520"
|
||||||
|
:footer="null"
|
||||||
|
title="裁判文书批量导入"
|
||||||
|
:visible="visible"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
>
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<a-upload-dragger
|
||||||
|
accept=".xls,.xlsx"
|
||||||
|
:show-upload-list="false"
|
||||||
|
:customRequest="doUpload"
|
||||||
|
style="padding: 24px 0; margin-bottom: 16px"
|
||||||
|
>
|
||||||
|
<p class="ant-upload-drag-icon">
|
||||||
|
<cloud-upload-outlined />
|
||||||
|
</p>
|
||||||
|
<p class="ant-upload-hint">将文件拖到此处,或点击上传</p>
|
||||||
|
</a-upload-dragger>
|
||||||
|
</a-spin>
|
||||||
|
<div class="ele-text-center">
|
||||||
|
<span>只能上传xls、xlsx文件,</span>
|
||||||
|
<a :href="templateUrl" download="裁判文书导入模板.xlsx">
|
||||||
|
下载导入模板
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { message } from 'ant-design-vue/es';
|
||||||
|
import { CloudUploadOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { importCreditJudicialDocument } from '@/api/credit/creditJudicialDocument';
|
||||||
|
import { API_BASE_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
// 是否打开弹窗
|
||||||
|
visible: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 导入请求状态
|
||||||
|
const loading = ref(false);
|
||||||
|
|
||||||
|
// 模板下载地址,保持与当前接口域名一致
|
||||||
|
const templateUrl = computed(() => {
|
||||||
|
const base = (localStorage.getItem('ApiUrl') || API_BASE_URL || '').replace(
|
||||||
|
/\/$/,
|
||||||
|
''
|
||||||
|
);
|
||||||
|
return `${base}/credit/credit-judicial-document/import/template`;
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 上传 */
|
||||||
|
const doUpload = ({ file }) => {
|
||||||
|
if (
|
||||||
|
![
|
||||||
|
'application/vnd.ms-excel',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
].includes(file.type)
|
||||||
|
) {
|
||||||
|
message.error('只能选择 excel 文件');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (file.size / 1024 / 1024 > 10) {
|
||||||
|
message.error('大小不能超过 10MB');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
loading.value = true;
|
||||||
|
importCreditJudicialDocument(file)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 更新 visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -0,0 +1,300 @@
|
|||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="800"
|
||||||
|
:visible="visible"
|
||||||
|
:maskClosable="false"
|
||||||
|
:maxable="maxable"
|
||||||
|
:title="isUpdate ? '编辑裁判文书司法大数据' : '添加裁判文书司法大数据'"
|
||||||
|
:body-style="{ paddingBottom: '28px' }"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
@ok="save"
|
||||||
|
>
|
||||||
|
<a-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||||
|
:wrapper-col="
|
||||||
|
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<a-form-item label="数据类型" name="dataType">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入数据类型"
|
||||||
|
v-model:value="form.dataType"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="原告/上诉人" name="plaintiffAppellant">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入原告/上诉人"
|
||||||
|
v-model:value="form.plaintiffAppellant"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="被告/被上诉人" name="defendant appellee">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入被告/被上诉人"
|
||||||
|
v-model:value="form.appellee"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="其他当事人/第三人" name="otherPartiesThirdParty">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入其他当事人/第三人"
|
||||||
|
v-model:value="form.otherPartiesThirdParty"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="发生时间" name="occurrenceTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入发生时间"
|
||||||
|
v-model:value="form.occurrenceTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="案号" name="caseNumber">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入案号"
|
||||||
|
v-model:value="form.caseNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="案由" name="causeOfAction">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入案由"
|
||||||
|
v-model:value="form.causeOfAction"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="涉案金额" name="involvedAmount">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入涉案金额"
|
||||||
|
v-model:value="form.involvedAmount"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="法院" name="courtName">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入法院"
|
||||||
|
v-model:value="form.courtName"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="数据状态" name="dataStatus">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入数据状态"
|
||||||
|
v-model:value="form.dataStatus"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="备注" name="comments">
|
||||||
|
<a-textarea
|
||||||
|
:rows="4"
|
||||||
|
:maxlength="200"
|
||||||
|
placeholder="请输入描述"
|
||||||
|
v-model:value="form.comments"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否推荐" name="recommend">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否推荐"
|
||||||
|
v-model:value="form.recommend"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="排序(数字越小越靠前)" name="sortNumber">
|
||||||
|
<a-input-number
|
||||||
|
:min="0"
|
||||||
|
:max="9999"
|
||||||
|
class="ele-fluid"
|
||||||
|
placeholder="请输入排序号"
|
||||||
|
v-model:value="form.sortNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="状态, 0正常, 1冻结" name="status">
|
||||||
|
<a-radio-group v-model:value="form.status">
|
||||||
|
<a-radio :value="0">显示</a-radio>
|
||||||
|
<a-radio :value="1">隐藏</a-radio>
|
||||||
|
</a-radio-group>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="是否删除, 0否, 1是" name="deleted">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入是否删除, 0否, 1是"
|
||||||
|
v-model:value="form.deleted"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="用户ID" name="userId">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入用户ID"
|
||||||
|
v-model:value="form.userId"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="修改时间" name="updateTime">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入修改时间"
|
||||||
|
v-model:value="form.updateTime"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, watch } from 'vue';
|
||||||
|
import { Form, message } from 'ant-design-vue';
|
||||||
|
import { assignObject, uuid } from 'ele-admin-pro';
|
||||||
|
import { addCreditJudicialDocument, updateCreditJudicialDocument } from '@/api/credit/creditJudicialDocument';
|
||||||
|
import { CreditJudicialDocument } from '@/api/credit/creditJudicialDocument/model';
|
||||||
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
|
|
||||||
|
// 是否是修改
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
// 是否开启响应式布局
|
||||||
|
const themeStore = useThemeStore();
|
||||||
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
// 弹窗是否打开
|
||||||
|
visible: boolean;
|
||||||
|
// 修改回显的数据
|
||||||
|
data?: CreditJudicialDocument | null;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 提交状态
|
||||||
|
const loading = ref(false);
|
||||||
|
// 是否显示最大化切换按钮
|
||||||
|
const maxable = ref(true);
|
||||||
|
// 表格选中数据
|
||||||
|
const formRef = ref<FormInstance | null>(null);
|
||||||
|
const images = ref<ItemType[]>([]);
|
||||||
|
|
||||||
|
// 用户信息
|
||||||
|
const form = reactive<CreditJudicialDocument>({
|
||||||
|
id: undefined,
|
||||||
|
dataType: undefined,
|
||||||
|
plaintiffAppellant: undefined,
|
||||||
|
appellee: undefined,
|
||||||
|
otherPartiesThirdParty: undefined,
|
||||||
|
occurrenceTime: undefined,
|
||||||
|
caseNumber: undefined,
|
||||||
|
causeOfAction: undefined,
|
||||||
|
involvedAmount: undefined,
|
||||||
|
courtName: undefined,
|
||||||
|
dataStatus: undefined,
|
||||||
|
comments: undefined,
|
||||||
|
recommend: undefined,
|
||||||
|
sortNumber: undefined,
|
||||||
|
status: undefined,
|
||||||
|
deleted: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
tenantId: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
creditJudicialDocumentId: undefined,
|
||||||
|
creditJudicialDocumentName: '',
|
||||||
|
status: 0,
|
||||||
|
comments: '',
|
||||||
|
sortNumber: 100
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 更新visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表单验证规则
|
||||||
|
const rules = reactive({
|
||||||
|
creditJudicialDocumentName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写裁判文书司法大数据名称',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
const chooseImage = (data: FileRecord) => {
|
||||||
|
images.value.push({
|
||||||
|
uid: data.id,
|
||||||
|
url: data.path,
|
||||||
|
status: 'done'
|
||||||
|
});
|
||||||
|
form.image = data.path;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDeleteItem = (index: number) => {
|
||||||
|
images.value.splice(index, 1);
|
||||||
|
form.image = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
const { resetFields } = useForm(form, rules);
|
||||||
|
|
||||||
|
/* 保存编辑 */
|
||||||
|
const save = () => {
|
||||||
|
if (!formRef.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
formRef.value
|
||||||
|
.validate()
|
||||||
|
.then(() => {
|
||||||
|
loading.value = true;
|
||||||
|
const formData = {
|
||||||
|
...form
|
||||||
|
};
|
||||||
|
const saveOrUpdate = isUpdate.value ? updateCreditJudicialDocument : addCreditJudicialDocument;
|
||||||
|
saveOrUpdate(formData)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(visible) => {
|
||||||
|
if (visible) {
|
||||||
|
images.value = [];
|
||||||
|
if (props.data) {
|
||||||
|
assignObject(form, props.data);
|
||||||
|
if(props.data.image){
|
||||||
|
images.value.push({
|
||||||
|
uid: uuid(),
|
||||||
|
url: props.data.image,
|
||||||
|
status: 'done'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
isUpdate.value = true;
|
||||||
|
} else {
|
||||||
|
isUpdate.value = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
<!-- 搜索表单 -->
|
||||||
|
<template>
|
||||||
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
|
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||||
|
<template #icon>
|
||||||
|
<PlusOutlined />
|
||||||
|
</template>
|
||||||
|
<span>添加</span>
|
||||||
|
</a-button>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { GradeParam } from '@/api/user/grade/model';
|
||||||
|
import { watch } from 'vue';
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
// 选中的角色
|
||||||
|
selection?: [];
|
||||||
|
}>(),
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'search', where?: GradeParam): void;
|
||||||
|
(e: 'add'): void;
|
||||||
|
(e: 'remove'): void;
|
||||||
|
(e: 'batchMove'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
const add = () => {
|
||||||
|
emit('add');
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.selection,
|
||||||
|
() => {}
|
||||||
|
);
|
||||||
|
</script>
|
||||||
325
src/views/credit/creditJudicialDocument/index.vue
Normal file
325
src/views/credit/creditJudicialDocument/index.vue
Normal file
@@ -0,0 +1,325 @@
|
|||||||
|
<template>
|
||||||
|
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||||
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
|
<ele-pro-table
|
||||||
|
ref="tableRef"
|
||||||
|
row-key="id"
|
||||||
|
:columns="columns"
|
||||||
|
:datasource="datasource"
|
||||||
|
:customRow="customRow"
|
||||||
|
tool-class="ele-toolbar-form"
|
||||||
|
class="sys-org-table"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<search
|
||||||
|
@search="reload"
|
||||||
|
:selection="selection"
|
||||||
|
@add="openEdit"
|
||||||
|
@remove="removeBatch"
|
||||||
|
@batchMove="openMove"
|
||||||
|
@importData="openImport"
|
||||||
|
@exportData="exportData"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'image'">
|
||||||
|
<a-image :src="record.image" :width="50" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'status'">
|
||||||
|
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||||
|
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'action'">
|
||||||
|
<a-space>
|
||||||
|
<a @click="openEdit(record)">修改</a>
|
||||||
|
<a-divider type="vertical" />
|
||||||
|
<a-popconfirm
|
||||||
|
title="确定要删除此记录吗?"
|
||||||
|
@confirm="remove(record)"
|
||||||
|
>
|
||||||
|
<a class="ele-text-danger">删除</a>
|
||||||
|
</a-popconfirm>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</ele-pro-table>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<CreditJudicialDocumentEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||||
|
<!-- 导入弹窗 -->
|
||||||
|
<CreditJudicialDocumentImport
|
||||||
|
v-model:visible="showImport"
|
||||||
|
@done="reload"
|
||||||
|
/>
|
||||||
|
</a-page-header>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { createVNode, ref } from 'vue';
|
||||||
|
import { message, Modal } from 'ant-design-vue';
|
||||||
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
|
import { toDateString } from 'ele-admin-pro';
|
||||||
|
import type {
|
||||||
|
DatasourceFunction,
|
||||||
|
ColumnItem
|
||||||
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
|
import Search from '@/views/credit/components/CreditSearchToolbar.vue';
|
||||||
|
import { exportCreditData } from '../utils/export';
|
||||||
|
import { getPageTitle } from '@/utils/common';
|
||||||
|
import CreditJudicialDocumentEdit from './components/creditJudicialDocumentEdit.vue';
|
||||||
|
import CreditJudicialDocumentImport from './components/credit-judicial-document-import.vue';
|
||||||
|
import {
|
||||||
|
pageCreditJudicialDocument,
|
||||||
|
listCreditJudicialDocument,
|
||||||
|
removeCreditJudicialDocument,
|
||||||
|
removeBatchCreditJudicialDocument
|
||||||
|
} from '@/api/credit/creditJudicialDocument';
|
||||||
|
import type {
|
||||||
|
CreditJudicialDocument,
|
||||||
|
CreditJudicialDocumentParam
|
||||||
|
} from '@/api/credit/creditJudicialDocument/model';
|
||||||
|
|
||||||
|
// 表格实例
|
||||||
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
|
|
||||||
|
// 表格选中数据
|
||||||
|
const selection = ref<CreditJudicialDocument[]>([]);
|
||||||
|
// 当前编辑数据
|
||||||
|
const current = ref<CreditJudicialDocument | null>(null);
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
const showEdit = ref(false);
|
||||||
|
// 是否显示导入弹窗
|
||||||
|
const showImport = ref(false);
|
||||||
|
// 是否显示批量移动弹窗
|
||||||
|
const showMove = ref(false);
|
||||||
|
// 加载状态
|
||||||
|
const loading = ref(true);
|
||||||
|
// 搜索关键词
|
||||||
|
const searchText = ref('');
|
||||||
|
|
||||||
|
// 表格数据源
|
||||||
|
const datasource: DatasourceFunction = ({
|
||||||
|
page,
|
||||||
|
limit,
|
||||||
|
where = {},
|
||||||
|
orders,
|
||||||
|
filters
|
||||||
|
}) => {
|
||||||
|
const params: CreditJudicialDocumentParam = { ...where };
|
||||||
|
if (filters) {
|
||||||
|
(params as any).status = filters.status;
|
||||||
|
}
|
||||||
|
if (!params.keywords && searchText.value) {
|
||||||
|
params.keywords = searchText.value;
|
||||||
|
}
|
||||||
|
return pageCreditJudicialDocument({
|
||||||
|
...params,
|
||||||
|
...orders,
|
||||||
|
page,
|
||||||
|
limit
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 关键信息列
|
||||||
|
const columns = ref<ColumnItem[]>([
|
||||||
|
{
|
||||||
|
title: 'ID',
|
||||||
|
dataIndex: 'id',
|
||||||
|
key: 'id',
|
||||||
|
width: 80
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数据类型',
|
||||||
|
dataIndex: 'dataType',
|
||||||
|
key: 'dataType',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '原告/上诉人',
|
||||||
|
dataIndex: 'plaintiffAppellant',
|
||||||
|
key: 'plaintiffAppellant',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '发生时间',
|
||||||
|
dataIndex: 'occurrenceTime',
|
||||||
|
key: 'occurrenceTime',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '案号',
|
||||||
|
dataIndex: 'caseNumber',
|
||||||
|
key: 'caseNumber',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '案由',
|
||||||
|
dataIndex: 'causeOfAction',
|
||||||
|
key: 'causeOfAction',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '涉案金额',
|
||||||
|
dataIndex: 'involvedAmount',
|
||||||
|
key: 'involvedAmount',
|
||||||
|
width: 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '法院',
|
||||||
|
dataIndex: 'courtName',
|
||||||
|
key: 'courtName',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '数据状态',
|
||||||
|
dataIndex: 'dataStatus',
|
||||||
|
key: 'dataStatus',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
key: 'createTime',
|
||||||
|
width: 180,
|
||||||
|
align: 'center',
|
||||||
|
ellipsis: true,
|
||||||
|
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
width: 160,
|
||||||
|
fixed: 'right',
|
||||||
|
align: 'center',
|
||||||
|
hideInSetting: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const reload = (where?: CreditJudicialDocumentParam) => {
|
||||||
|
if (where && Object.prototype.hasOwnProperty.call(where, 'keywords')) {
|
||||||
|
searchText.value = where.keywords ?? '';
|
||||||
|
}
|
||||||
|
const targetWhere = where ?? { keywords: searchText.value || undefined };
|
||||||
|
selection.value = [];
|
||||||
|
tableRef?.value?.reload({ where: targetWhere });
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开编辑弹窗 */
|
||||||
|
const openEdit = (row?: CreditJudicialDocument) => {
|
||||||
|
current.value = row ?? null;
|
||||||
|
showEdit.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开批量移动弹窗 */
|
||||||
|
const openMove = () => {
|
||||||
|
showMove.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开导入弹窗 */
|
||||||
|
const openImport = () => {
|
||||||
|
showImport.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 导出 */
|
||||||
|
const exportData = () => {
|
||||||
|
exportCreditData<CreditJudicialDocument>({
|
||||||
|
filename: '裁判文书',
|
||||||
|
columns: [
|
||||||
|
{ title: 'ID', dataIndex: 'id' },
|
||||||
|
{ title: '数据类型', dataIndex: 'dataType' },
|
||||||
|
{ title: '原告/上诉人', dataIndex: 'plaintiffAppellant' },
|
||||||
|
{ title: '发生时间', dataIndex: 'occurrenceTime' },
|
||||||
|
{ title: '案号', dataIndex: 'caseNumber' },
|
||||||
|
{ title: '案由', dataIndex: 'causeOfAction' },
|
||||||
|
{ title: '涉案金额', dataIndex: 'involvedAmount' },
|
||||||
|
{ title: '法院', dataIndex: 'courtName' },
|
||||||
|
{ title: '数据状态', dataIndex: 'dataStatus' },
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
formatter: (record: CreditJudicialDocument) =>
|
||||||
|
record.createTime
|
||||||
|
? toDateString(record.createTime, 'yyyy-MM-dd HH:mm:ss')
|
||||||
|
: ''
|
||||||
|
}
|
||||||
|
],
|
||||||
|
fetchData: () =>
|
||||||
|
listCreditJudicialDocument({
|
||||||
|
keywords: searchText.value || undefined
|
||||||
|
})
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 删除单个 */
|
||||||
|
const remove = (row: CreditJudicialDocument) => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeCreditJudicialDocument(row.id)
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 批量删除 */
|
||||||
|
const removeBatch = () => {
|
||||||
|
if (!selection.value.length) {
|
||||||
|
message.error('请至少选择一条数据');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
content: '确定要删除选中的记录吗?',
|
||||||
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
|
maskClosable: true,
|
||||||
|
onOk: () => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeBatchCreditJudicialDocument(selection.value.map((d) => d.id))
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 查询 */
|
||||||
|
const query = () => {
|
||||||
|
loading.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 自定义行属性 */
|
||||||
|
const customRow = (record: CreditJudicialDocument) => {
|
||||||
|
return {
|
||||||
|
// 行点击事件
|
||||||
|
onClick: () => {
|
||||||
|
// console.log(record);
|
||||||
|
},
|
||||||
|
// 行双击事件
|
||||||
|
onDblclick: () => {
|
||||||
|
openEdit(record);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
query();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default {
|
||||||
|
name: 'CreditJudicialDocument'
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
<!-- 司法案件导入弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="520"
|
||||||
|
:footer="null"
|
||||||
|
title="司法案件批量导入"
|
||||||
|
:visible="visible"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
>
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<a-upload-dragger
|
||||||
|
accept=".xls,.xlsx"
|
||||||
|
:show-upload-list="false"
|
||||||
|
:customRequest="doUpload"
|
||||||
|
style="padding: 24px 0; margin-bottom: 16px"
|
||||||
|
>
|
||||||
|
<p class="ant-upload-drag-icon">
|
||||||
|
<cloud-upload-outlined />
|
||||||
|
</p>
|
||||||
|
<p class="ant-upload-hint">将文件拖到此处,或点击上传</p>
|
||||||
|
</a-upload-dragger>
|
||||||
|
</a-spin>
|
||||||
|
<div class="ele-text-center">
|
||||||
|
<span>只能上传xls、xlsx文件,</span>
|
||||||
|
<a :href="templateUrl" download="司法案件导入模板.xlsx"> 下载导入模板 </a>
|
||||||
|
</div>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { computed, ref } from 'vue';
|
||||||
|
import { message } from 'ant-design-vue/es';
|
||||||
|
import { CloudUploadOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { importCreditJudiciaries } from '@/api/credit/creditJudiciary';
|
||||||
|
import { API_BASE_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
// 是否打开弹窗
|
||||||
|
visible: boolean;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 导入请求状态
|
||||||
|
const loading = ref(false);
|
||||||
|
|
||||||
|
// 模板下载地址,保持与当前接口域名一致
|
||||||
|
const templateUrl = computed(() => {
|
||||||
|
const base = (localStorage.getItem('ApiUrl') || API_BASE_URL || '').replace(
|
||||||
|
/\/$/,
|
||||||
|
''
|
||||||
|
);
|
||||||
|
return `${base}/credit/credit-judiciary/import/template`;
|
||||||
|
});
|
||||||
|
|
||||||
|
/* 上传 */
|
||||||
|
const doUpload = ({ file }) => {
|
||||||
|
if (
|
||||||
|
![
|
||||||
|
'application/vnd.ms-excel',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||||
|
].includes(file.type)
|
||||||
|
) {
|
||||||
|
message.error('只能选择 excel 文件');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (file.size / 1024 / 1024 > 10) {
|
||||||
|
message.error('大小不能超过 10MB');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
loading.value = true;
|
||||||
|
importCreditJudiciaries(file)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 更新 visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user