开发对接供应商评价管理
This commit is contained in:
45
src/servers/api/dicts.ts
Normal file
45
src/servers/api/dicts.ts
Normal file
@ -0,0 +1,45 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 定义接口返回数据类型
|
||||
export type DictResponse = {
|
||||
code: number;
|
||||
data: DictItem[];
|
||||
message: string;
|
||||
success: boolean;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export type DictItem = {
|
||||
basePageRequest: null;
|
||||
code: string;
|
||||
createBy: null;
|
||||
createDate: null;
|
||||
defaultFlag: null;
|
||||
deleteFlag: null;
|
||||
description: string;
|
||||
dicName: string;
|
||||
dictTypeCode: null | string;
|
||||
dictTypeName: null | string;
|
||||
id: string;
|
||||
lastUpdateTime: null;
|
||||
orderFlag: string;
|
||||
parentCode: string;
|
||||
parentType: string;
|
||||
tenantId: null;
|
||||
tenantName: null;
|
||||
updateBy: null;
|
||||
updateDate: null;
|
||||
useFlag: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典列表
|
||||
* @param code 字典编码
|
||||
* @returns 字典列表
|
||||
*/
|
||||
export async function getDictList(code: string): Promise<DictResponse> {
|
||||
return request(`/cosco/dictProject/getAllList/${code}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
89
src/servers/api/supplierEvaluate.ts
Normal file
89
src/servers/api/supplierEvaluate.ts
Normal file
@ -0,0 +1,89 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/**
|
||||
* 获取所有模板列表
|
||||
* @returns 所有模板列表
|
||||
*/
|
||||
export async function getAllTemplates() {
|
||||
return request('/coscoEvaluate/template/getAllList', {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
// 模板管理接口
|
||||
// 获取模板列表
|
||||
export async function getTemplateList(params: SupplierEvaluate.TemplateRequest) {
|
||||
return request<SupplierEvaluate.TemplateResponse>('/coscoEvaluate/template/getPage', {
|
||||
method: 'POST',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取模板详情
|
||||
export async function getTemplateDetail(id: string) {
|
||||
return request<SupplierEvaluate.TemplateDetailResponse>(`/coscoEvaluate/template/${id}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
// 新增模板
|
||||
export async function addTemplate(params: SupplierEvaluate.TemplateAddRequest) {
|
||||
return request<API.APIResponse<any>>('/coscoEvaluate/template', {
|
||||
method: 'POST',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
// 更新模板
|
||||
export async function updateTemplate(params: SupplierEvaluate.TemplateUpdateRequest) {
|
||||
return request<API.APIResponse<any>>('/coscoEvaluate/template', {
|
||||
method: 'PUT',
|
||||
data: params,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除模板
|
||||
export async function deleteTemplate(id: string) {
|
||||
return request<API.APIResponse<any>>('/coscoEvaluate/template/delete', {
|
||||
method: 'POST',
|
||||
data: { id },
|
||||
});
|
||||
}
|
||||
|
||||
// 启用模板
|
||||
export async function enableTemplate(id: string) {
|
||||
return request<API.APIResponse<any>>('/coscoEvaluate/template/enable', {
|
||||
method: 'POST',
|
||||
data: { id },
|
||||
});
|
||||
}
|
||||
|
||||
// 禁用模板
|
||||
export async function disableTemplate(id: string) {
|
||||
return request<API.APIResponse<any>>('/coscoEvaluate/template/disable', {
|
||||
method: 'POST',
|
||||
data: { id },
|
||||
});
|
||||
}
|
||||
|
||||
// 获取品类列表
|
||||
export async function getCategoryList() {
|
||||
return request<API.APIResponse<any>>('/coscoEvaluate/category/list', {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
// 获取品类树
|
||||
export async function getCategoryTree() {
|
||||
return request<SupplierEvaluate.CategoryTreeResponse>('/cosco/category/categoryTree', {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
// 获取部门列表
|
||||
export async function getDepartmentList() {
|
||||
return request<API.APIResponse<any>>('/coscoEvaluate/dept/list', {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
439
src/servers/api/typings.d.ts
vendored
439
src/servers/api/typings.d.ts
vendored
@ -559,3 +559,442 @@ declare namespace API {
|
||||
endTime: string;
|
||||
}
|
||||
}
|
||||
|
||||
// 供应商评价模块类型定义
|
||||
declare namespace SupplierEvaluate {
|
||||
// 模板管理类型定义
|
||||
export type TemplateBasePageRequest = {
|
||||
pageNo: number;
|
||||
pageSize: number;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export type TemplateRequest = {
|
||||
basePageRequest: TemplateBasePageRequest;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export type TemplateResponse = {
|
||||
code: number;
|
||||
data: TemplateData;
|
||||
message: string;
|
||||
success: boolean;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export type TemplateData = {
|
||||
countId: null;
|
||||
current: number;
|
||||
hitCount: boolean;
|
||||
maxLimit: null;
|
||||
optimizeCountSql: boolean;
|
||||
orders: string[];
|
||||
pages: number;
|
||||
records: TemplateRecord[];
|
||||
searchCount: boolean;
|
||||
size: number;
|
||||
total: number;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export type TemplateRecord = {
|
||||
basePageRequest?: null;
|
||||
/**
|
||||
* 品类id
|
||||
*/
|
||||
categoryId?: string;
|
||||
/**
|
||||
* 品类名称
|
||||
*/
|
||||
categoryName?: string;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
createTime?: string;
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
deptName?: string;
|
||||
/**
|
||||
* 模板id
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
status?: string;
|
||||
/**
|
||||
* 状态类型
|
||||
*/
|
||||
statusName?: string;
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
templateName?: string;
|
||||
/**
|
||||
* 模板编号
|
||||
*/
|
||||
templateCode?: string;
|
||||
/**
|
||||
* 模板类型
|
||||
*/
|
||||
templateType?: string;
|
||||
/**
|
||||
* 创建单位
|
||||
*/
|
||||
tenantName?: string;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
createBy?: string;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
updateBy?: string;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
updateTime?: string;
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
deptId?: string;
|
||||
/**
|
||||
* 用于前端显示用 - 部门
|
||||
*/
|
||||
department?: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 模板搜索参数
|
||||
export type TemplateSearchParams = {
|
||||
templateName?: string;
|
||||
categoryId?: string;
|
||||
status?: string;
|
||||
tenantName?: string;
|
||||
dateRange?: [string, string];
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 模板详情响应
|
||||
export type TemplateDetailResponse = {
|
||||
code: number;
|
||||
data: TemplateDetail;
|
||||
message: string;
|
||||
success: boolean;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 模板详情数据
|
||||
export type TemplateDetail = {
|
||||
categoryId: string;
|
||||
categoryLimitation: string;
|
||||
copyTemplateId: null;
|
||||
createBy: null | string;
|
||||
createDate: null | string;
|
||||
createTime: string;
|
||||
deleteFlag: null | string;
|
||||
delFlag: string;
|
||||
id: string;
|
||||
indicatorStList: IndicatorStItem[];
|
||||
lastUpdateTime: null | string;
|
||||
status: string;
|
||||
templateName: string;
|
||||
templateType: string;
|
||||
tenantId: null | string;
|
||||
tenantName: null | string;
|
||||
updateBy: null | string;
|
||||
updateDate: null | string;
|
||||
updateTime: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 一级指标项
|
||||
export type IndicatorStItem = {
|
||||
baseIndicator: string;
|
||||
createBy: string;
|
||||
createDate: null | string;
|
||||
createTime: string;
|
||||
deleteFlag: null | string;
|
||||
delFlag: string;
|
||||
descIndicator: string;
|
||||
id: string;
|
||||
indicatorNdList: IndicatorNdItem[];
|
||||
lastUpdateTime: null | string;
|
||||
orderBy: string;
|
||||
score: string;
|
||||
templateId: string;
|
||||
tenantId: null | string;
|
||||
tenantName: null | string;
|
||||
updateBy: string;
|
||||
updateDate: null | string;
|
||||
updateTime: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 二级指标项
|
||||
export type IndicatorNdItem = {
|
||||
createBy: string;
|
||||
createDate: null | string;
|
||||
createTime: string;
|
||||
deleteFlag: null | string;
|
||||
delFlag: string;
|
||||
id: string;
|
||||
indicatorStId: string;
|
||||
isStar: string;
|
||||
lastUpdateTime: null | string;
|
||||
orderBy: string;
|
||||
score: string;
|
||||
subIndicator: string;
|
||||
templateId: string;
|
||||
tenantId: null | string;
|
||||
tenantName: null | string;
|
||||
updateBy: string;
|
||||
updateDate: null | string;
|
||||
updateTime: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 模板添加/更新参数
|
||||
export type TemplateSaveRequest = {
|
||||
id?: string;
|
||||
templateName: string;
|
||||
templateCode?: string;
|
||||
templateType: string;
|
||||
categoryId: string;
|
||||
deptId: string;
|
||||
status: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 模板启用/禁用/删除参数
|
||||
export type TemplateStatusRequest = {
|
||||
id: string;
|
||||
}
|
||||
|
||||
// 模板修改请求参数
|
||||
export type TemplateUpdateRequest = {
|
||||
categoryId: string;
|
||||
categoryLimitation: string;
|
||||
id: string;
|
||||
indicatorStList: TemplateUpdateIndicatorStItem[];
|
||||
status: number;
|
||||
templateName: string;
|
||||
templateType: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 修改请求一级指标项
|
||||
export type TemplateUpdateIndicatorStItem = {
|
||||
baseIndicator: string;
|
||||
descIndicator: string;
|
||||
indicatorNdList: TemplateUpdateIndicatorNdItem[];
|
||||
orderBy: number;
|
||||
score: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 修改请求二级指标项
|
||||
export type TemplateUpdateIndicatorNdItem = {
|
||||
isStar: string;
|
||||
orderBy: number;
|
||||
score: string;
|
||||
subIndicator: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 模板新增请求参数
|
||||
export type TemplateAddRequest = {
|
||||
/**
|
||||
* 品类id(cosco_category表主键)
|
||||
*/
|
||||
categoryId: string;
|
||||
/**
|
||||
* 品类限制类型(0.通用不限品类、1.限制品类)
|
||||
*/
|
||||
categoryLimitation: string;
|
||||
/**
|
||||
* 二级指标是否可增加
|
||||
*/
|
||||
indicatorNdMore: string;
|
||||
indicatorStList: TemplateAddIndicatorStItem[];
|
||||
/**
|
||||
* 一级指标是否可增加
|
||||
*/
|
||||
indicatorStMore: string;
|
||||
/**
|
||||
* 是否可增加对应指标类型(数据字典 通用指标、技术指标)
|
||||
*/
|
||||
indicatorTypeMore: string;
|
||||
/**
|
||||
* 是否启用(0.草稿、1.启用、2.禁用)
|
||||
*/
|
||||
status: number;
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
templateName: string;
|
||||
/**
|
||||
* 评价模板类型(数据字典code)
|
||||
*/
|
||||
templateType: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 新增请求一级指标项
|
||||
export type TemplateAddIndicatorStItem = {
|
||||
/**
|
||||
* 基本指标
|
||||
*/
|
||||
baseIndicator: string;
|
||||
/**
|
||||
* 基本指标是否可编辑(0.是、1.否)
|
||||
*/
|
||||
baseIndicatorEdit: string;
|
||||
/**
|
||||
* 指标说明
|
||||
*/
|
||||
descIndicator: string;
|
||||
/**
|
||||
* 指标说明是否可编辑(0.是、1.否)
|
||||
*/
|
||||
descIndicatorEdit: string;
|
||||
indicatorNdList: TemplateAddIndicatorNdItem[];
|
||||
/**
|
||||
* 该一级指标是否可编辑(0.是、1.否)
|
||||
*/
|
||||
indicatorStEdit: string;
|
||||
/**
|
||||
* 指标类型(数据字典 通用指标、技术指标)
|
||||
*/
|
||||
indicatorType: string;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
orderBy: number;
|
||||
/**
|
||||
* 分值
|
||||
*/
|
||||
score: string;
|
||||
/**
|
||||
* 分值是否可编辑(0.是、1.否)
|
||||
*/
|
||||
scoreEdit: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 新增请求二级指标项
|
||||
export type TemplateAddIndicatorNdItem = {
|
||||
/**
|
||||
* 细分指标是否可编辑(0.是、1.否)
|
||||
*/
|
||||
baseIndicatorEdit: string;
|
||||
/**
|
||||
* 该一级指标是否可编辑(0.是、1.否)
|
||||
*/
|
||||
indicatorNdEdit: string;
|
||||
/**
|
||||
* 是否设置星号项(0.否、1.是)
|
||||
*/
|
||||
isStar: string;
|
||||
/**
|
||||
* 星号项是否可编辑(0.是、1.否)
|
||||
*/
|
||||
isStarEdit: string;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
orderBy: number;
|
||||
/**
|
||||
* 分值
|
||||
*/
|
||||
score: string;
|
||||
/**
|
||||
* 分值是否可编辑(0.是、1.否)
|
||||
*/
|
||||
scoreEdit: string;
|
||||
/**
|
||||
* 细分指标
|
||||
*/
|
||||
subIndicator: string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
// 品类树接口返回类型
|
||||
export type CategoryTreeResponse = {
|
||||
code: number;
|
||||
data: CategoryTreeItem[];
|
||||
message: string;
|
||||
success: boolean;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export type CategoryTreeItem = {
|
||||
ancestors?: string;
|
||||
basePageRequest?: null;
|
||||
/**
|
||||
* 品类名称
|
||||
*/
|
||||
categoryName?: string;
|
||||
children?: CategoryTreeChild[];
|
||||
createBy?: string;
|
||||
createTime?: string;
|
||||
delFlag?: string;
|
||||
id?: string;
|
||||
lastUpdateTime?: null;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
orderBy?: string;
|
||||
/**
|
||||
* 父级id
|
||||
*/
|
||||
parentId?: string;
|
||||
remark?: null;
|
||||
/**
|
||||
* 类型,0分类 1品类
|
||||
*/
|
||||
type?: string;
|
||||
updateBy?: null;
|
||||
updateTime?: null;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export type CategoryTreeChild = {
|
||||
ancestors: string;
|
||||
basePageRequest: null;
|
||||
categoryName: string;
|
||||
children: CategoryTreeGrandChild[] | null;
|
||||
createBy: string;
|
||||
createTime: string;
|
||||
delFlag: string;
|
||||
id: string;
|
||||
lastUpdateTime: null;
|
||||
orderBy: string;
|
||||
parentId: string;
|
||||
remark: null;
|
||||
type: string;
|
||||
updateBy: null | string;
|
||||
updateTime: null | string;
|
||||
[property: string]: any;
|
||||
}
|
||||
|
||||
export type CategoryTreeGrandChild = {
|
||||
ancestors?: string;
|
||||
basePageRequest?: null;
|
||||
categoryName?: string;
|
||||
children?: null;
|
||||
createBy?: string;
|
||||
createTime?: string;
|
||||
delFlag?: string;
|
||||
id?: string;
|
||||
lastUpdateTime?: null;
|
||||
orderBy?: string;
|
||||
parentId?: string;
|
||||
remark?: null;
|
||||
type?: string;
|
||||
updateBy?: null;
|
||||
updateTime?: null;
|
||||
[property: string]: any;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user