chore: initial commit
This commit is contained in:
207
frontend/packages/lib-shared/api/http/Axios.ts
Normal file
207
frontend/packages/lib-shared/api/http/Axios.ts
Normal file
@@ -0,0 +1,207 @@
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import axios from 'axios';
|
||||
|
||||
import { ContentTypeEnum } from '../../enums/httpEnum';
|
||||
import { isFunction } from '../../method/is';
|
||||
import type { RequestOptions, Result, UploadFileParams } from '../../types/axios';
|
||||
import { AxiosCanceler } from './axiosCancel';
|
||||
import type { CreateAxiosOptions } from './axiosTransform';
|
||||
import type { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from 'axios';
|
||||
|
||||
export * from './axiosTransform';
|
||||
|
||||
/**
|
||||
* @description: 封装axios请求,返回重新封装的数据格式
|
||||
*/
|
||||
export class CordysAxios {
|
||||
public axiosInstance: AxiosInstance;
|
||||
|
||||
private readonly options: CreateAxiosOptions;
|
||||
|
||||
constructor(options: CreateAxiosOptions) {
|
||||
this.options = options;
|
||||
this.axiosInstance = axios.create(options);
|
||||
this.setupInterceptors();
|
||||
}
|
||||
|
||||
private getTransform() {
|
||||
const { transform } = this.options;
|
||||
return transform;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 拦截器配置
|
||||
*/
|
||||
private setupInterceptors() {
|
||||
const transform = this.getTransform();
|
||||
if (!transform) {
|
||||
return;
|
||||
}
|
||||
const { requestInterceptors, responseInterceptors, responseInterceptorsCatch } = transform;
|
||||
|
||||
const axiosCanceler = new AxiosCanceler();
|
||||
|
||||
// TODO: 拦截配置升级了 请求拦截器
|
||||
this.axiosInstance.interceptors.request.use((config: CreateAxiosOptions) => {
|
||||
// 如果ignoreCancelToken为true,则不添加到pending中
|
||||
const ignoreCancelToken = config.requestOptions?.ignoreCancelToken;
|
||||
const ignoreCancel =
|
||||
ignoreCancelToken !== undefined ? ignoreCancelToken : this.options.requestOptions?.ignoreCancelToken;
|
||||
|
||||
if (!ignoreCancel) {
|
||||
axiosCanceler.addPending(config);
|
||||
}
|
||||
if (requestInterceptors && isFunction(requestInterceptors)) {
|
||||
config = requestInterceptors(config, this.options);
|
||||
}
|
||||
// TODO: 拦截配置升级了,暂时 as 处理
|
||||
return config as InternalAxiosRequestConfig;
|
||||
}, undefined);
|
||||
|
||||
// 响应拦截器
|
||||
this.axiosInstance.interceptors.response.use((res: AxiosResponse<any>) => {
|
||||
if (res) {
|
||||
axiosCanceler.removePending(res.config);
|
||||
}
|
||||
if (responseInterceptors && isFunction(responseInterceptors)) {
|
||||
res = responseInterceptors(res);
|
||||
}
|
||||
return res;
|
||||
}, undefined);
|
||||
|
||||
// 响应错误处理
|
||||
if (responseInterceptorsCatch && isFunction(responseInterceptorsCatch)) {
|
||||
this.axiosInstance.interceptors.response.use(undefined, responseInterceptorsCatch);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 文件上传
|
||||
*/
|
||||
uploadFile<T = any>(
|
||||
config: AxiosRequestConfig & RequestOptions,
|
||||
params: UploadFileParams,
|
||||
customFileKey = '',
|
||||
isMultiple = false
|
||||
): Promise<T> {
|
||||
const formData = new window.FormData();
|
||||
const fileName = isMultiple ? 'files' : 'file';
|
||||
if (customFileKey !== '') {
|
||||
params.fileList.forEach((file: File) => {
|
||||
formData.append(customFileKey, file);
|
||||
});
|
||||
} else if (!isMultiple && !customFileKey) {
|
||||
params.fileList.forEach((file: File) => {
|
||||
formData.append(fileName, file);
|
||||
});
|
||||
} else {
|
||||
params.fileList.forEach((item: any) => {
|
||||
formData.append(fileName, item.file, item.file.name);
|
||||
});
|
||||
}
|
||||
if (params.request) {
|
||||
const requestData = JSON.stringify(params.request);
|
||||
formData.append('request', new Blob([requestData], { type: ContentTypeEnum.JSON }));
|
||||
}
|
||||
const transform = this.getTransform();
|
||||
|
||||
const { requestOptions } = this.options;
|
||||
|
||||
const opt = { ...requestOptions, isTransformResponse: false };
|
||||
const { transformRequestHook } = transform || {};
|
||||
return new Promise((resolve, reject) => {
|
||||
this.axiosInstance
|
||||
.request<any, AxiosResponse<Result>>({
|
||||
...config,
|
||||
method: 'POST',
|
||||
data: formData,
|
||||
headers: {
|
||||
'Content-type': ContentTypeEnum.FORM_DATA,
|
||||
},
|
||||
// @ts-ignore
|
||||
requestOptions: {
|
||||
ignoreCancelToken: true, // 文件上传请求不需要添加到pending中,以免路由切换导致文件上传请求被取消
|
||||
},
|
||||
})
|
||||
.then((res: AxiosResponse<Result>) => {
|
||||
// 请求成功后的处理
|
||||
if (transformRequestHook && isFunction(transformRequestHook)) {
|
||||
try {
|
||||
const ret = transformRequestHook(res, opt);
|
||||
resolve(ret);
|
||||
} catch (err) {
|
||||
reject(err || new Error('request error!'));
|
||||
}
|
||||
return;
|
||||
}
|
||||
resolve(res as unknown as Promise<T>);
|
||||
})
|
||||
.catch((e: Error | AxiosError) => {
|
||||
if (axios.isAxiosError(e)) {
|
||||
// 在这可重写axios错误消息
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(e);
|
||||
}
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
get<T = any>(config: AxiosRequestConfig, options?: RequestOptions): Promise<T> {
|
||||
return this.request({ ...config, method: 'GET' }, options);
|
||||
}
|
||||
|
||||
post<T = any>(config: AxiosRequestConfig, options?: RequestOptions): Promise<T> {
|
||||
return this.request({ ...config, method: 'POST' }, options);
|
||||
}
|
||||
|
||||
put<T = any>(config: AxiosRequestConfig, options?: RequestOptions): Promise<T> {
|
||||
return this.request({ ...config, method: 'PUT' }, options);
|
||||
}
|
||||
|
||||
delete<T = any>(config: AxiosRequestConfig, options?: RequestOptions): Promise<T> {
|
||||
return this.request({ ...config, method: 'DELETE' }, options);
|
||||
}
|
||||
|
||||
request<T = any>(config: AxiosRequestConfig, options?: RequestOptions): Promise<T> {
|
||||
let conf: CreateAxiosOptions = cloneDeep(config);
|
||||
const transform = this.getTransform();
|
||||
|
||||
const { requestOptions } = this.options;
|
||||
|
||||
const opt = { ...requestOptions, ...options };
|
||||
|
||||
const { beforeRequestHook, transformRequestHook } = transform || {};
|
||||
// 请求之前处理config
|
||||
if (beforeRequestHook && isFunction(beforeRequestHook)) {
|
||||
conf = beforeRequestHook(conf, opt);
|
||||
}
|
||||
conf.requestOptions = opt;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
this.axiosInstance
|
||||
.request<any, AxiosResponse<Result>>(conf)
|
||||
.then((res: AxiosResponse<Result>) => {
|
||||
// 请求成功后的处理
|
||||
if (transformRequestHook && isFunction(transformRequestHook)) {
|
||||
try {
|
||||
const ret = transformRequestHook(res, opt);
|
||||
resolve(ret);
|
||||
} catch (err) {
|
||||
reject(err || new Error('request error!'));
|
||||
}
|
||||
return;
|
||||
}
|
||||
resolve(res as unknown as Promise<T>);
|
||||
})
|
||||
.catch((e: Error | AxiosError) => {
|
||||
if (axios.isAxiosError(e)) {
|
||||
// 在这可重写axios错误消息
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(e);
|
||||
}
|
||||
reject(e);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
63
frontend/packages/lib-shared/api/http/axiosCancel.ts
Normal file
63
frontend/packages/lib-shared/api/http/axiosCancel.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import axios from 'axios';
|
||||
|
||||
import { isFunction } from '../../method/is';
|
||||
import type { AxiosRequestConfig, Canceler } from 'axios';
|
||||
|
||||
let pendingMap = new Map<string, Canceler>();
|
||||
|
||||
export const getPendingUrl = (config: AxiosRequestConfig) => [config.method, config.url].join('&');
|
||||
|
||||
export class AxiosCanceler {
|
||||
/**
|
||||
* 添加请求
|
||||
* @param {Object} config
|
||||
*/
|
||||
addPending(config: AxiosRequestConfig) {
|
||||
this.removePending(config);
|
||||
const url = getPendingUrl(config);
|
||||
config.cancelToken =
|
||||
config.cancelToken ||
|
||||
new axios.CancelToken((cancel) => {
|
||||
if (!pendingMap.has(url)) {
|
||||
// 非重复请求,存入pending中
|
||||
pendingMap.set(url, cancel);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 清理全部pending中的请求
|
||||
*/
|
||||
removeAllPending() {
|
||||
pendingMap.forEach((cancel) => {
|
||||
if (cancel && isFunction(cancel)) {
|
||||
cancel();
|
||||
}
|
||||
});
|
||||
pendingMap.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消并移除指定请求
|
||||
* @param {Object} config
|
||||
*/
|
||||
removePending(config: AxiosRequestConfig) {
|
||||
const url = getPendingUrl(config);
|
||||
|
||||
if (pendingMap.has(url)) {
|
||||
// 根据标识找到pending中对应的请求并取消
|
||||
const cancel = pendingMap.get(url);
|
||||
if (cancel && isFunction(cancel)) {
|
||||
cancel(url);
|
||||
}
|
||||
pendingMap.delete(url);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 重置pending列表
|
||||
*/
|
||||
static reset(): void {
|
||||
pendingMap = new Map<string, Canceler>();
|
||||
}
|
||||
}
|
||||
48
frontend/packages/lib-shared/api/http/axiosTransform.ts
Normal file
48
frontend/packages/lib-shared/api/http/axiosTransform.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Data processing class, can be configured according to the project
|
||||
*/
|
||||
import type { RequestOptions, Result } from '../../types/axios';
|
||||
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
|
||||
|
||||
export abstract class AxiosTransform {
|
||||
/**
|
||||
* @description: 请求之前处理配置
|
||||
*/
|
||||
beforeRequestHook?: (config: AxiosRequestConfig, options: RequestOptions) => AxiosRequestConfig;
|
||||
|
||||
/**
|
||||
* @description: 处理请求数据。如果数据不是预期格式,可直接抛出错
|
||||
*/
|
||||
transformRequestHook?: (res: AxiosResponse<Result>, options: RequestOptions) => any;
|
||||
|
||||
/**
|
||||
* @description: 请求之前的拦截器
|
||||
*/
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
requestInterceptors?: (config: AxiosRequestConfig, options: CreateAxiosOptions) => AxiosRequestConfig;
|
||||
|
||||
/**
|
||||
* @description: 请求之后的拦截器
|
||||
*/
|
||||
responseInterceptors?: (res: AxiosResponse<any>) => AxiosResponse<any>;
|
||||
|
||||
/**
|
||||
* @description: 请求之后的拦截器错误处理
|
||||
*/
|
||||
responseInterceptorsCatch?: (error: Error) => void;
|
||||
}
|
||||
|
||||
export interface CreateAxiosOptions extends AxiosRequestConfig {
|
||||
authenticationScheme?: string;
|
||||
transform?: AxiosTransform;
|
||||
requestOptions?: RequestOptions;
|
||||
useAppStore?: any;
|
||||
showErrorMsg?: (options: any) => void;
|
||||
checkStatus?: (
|
||||
status: number,
|
||||
msg: string,
|
||||
msgDetail: string | Record<string, any>,
|
||||
code?: number,
|
||||
noErrorTip?: boolean
|
||||
) => void;
|
||||
}
|
||||
12
frontend/packages/lib-shared/api/http/helper.ts
Normal file
12
frontend/packages/lib-shared/api/http/helper.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export function joinTimestamp<T extends boolean>(join: boolean, restful: T): T extends true ? string : object;
|
||||
|
||||
export function joinTimestamp(join: boolean, restful = false): string | object {
|
||||
if (!join) {
|
||||
return restful ? '' : {};
|
||||
}
|
||||
const now = new Date().getTime();
|
||||
if (restful) {
|
||||
return `?_t=${now}`;
|
||||
}
|
||||
return { _t: now };
|
||||
}
|
||||
191
frontend/packages/lib-shared/api/http/index.ts
Normal file
191
frontend/packages/lib-shared/api/http/index.ts
Normal file
@@ -0,0 +1,191 @@
|
||||
import { getLocalStorage } from '../../method/local-storage';
|
||||
import { CordysAxios } from './Axios';
|
||||
import type { AxiosTransform, CreateAxiosOptions } from './axiosTransform';
|
||||
import { joinTimestamp } from './helper';
|
||||
import { ContentTypeEnum, RequestEnum } from '@lib/shared/enums/httpEnum';
|
||||
import { useI18n } from '@lib/shared/hooks/useI18n';
|
||||
import { deepMerge, setObjToUrlParams } from '@lib/shared/method';
|
||||
import { getToken } from '@lib/shared/method/auth';
|
||||
import { isString } from '@lib/shared/method/is';
|
||||
import type CommonResponse from '@lib/shared/models/common';
|
||||
import type { RequestOptions, Result } from '@lib/shared/types/axios';
|
||||
import type { Recordable } from '@lib/shared/types/global';
|
||||
import type { AxiosResponse } from 'axios';
|
||||
|
||||
export default function createAxios(opt: Partial<CreateAxiosOptions>) {
|
||||
/**
|
||||
* @description: 数据处理,方便区分多种处理方式
|
||||
*/
|
||||
const transform: AxiosTransform = {
|
||||
/**
|
||||
* @description 请求之前处理config
|
||||
*/
|
||||
beforeRequestHook: (config, options) => {
|
||||
const { joinParamsToUrl, joinTime = true } = options;
|
||||
|
||||
const params = config.params || {};
|
||||
const data = config.data || false;
|
||||
if (config.method?.toUpperCase() === RequestEnum.GET) {
|
||||
if (!isString(params)) {
|
||||
// 给 get 请求加上时间戳参数,避免从缓存中拿数据。
|
||||
config.params = Object.assign(params || {}, joinTimestamp(joinTime, false));
|
||||
} else {
|
||||
// 兼容restful风格
|
||||
config.url = `${config.url}/${params}${joinTimestamp(joinTime, true)}`;
|
||||
config.params = undefined;
|
||||
}
|
||||
} else if (isString(params)) {
|
||||
// 兼容restful风格
|
||||
config.url += params;
|
||||
config.params = undefined;
|
||||
} else {
|
||||
if (
|
||||
Reflect.has(config, 'data') &&
|
||||
config.data &&
|
||||
(Object.keys(config.data).length > 0 || Array.isArray(config.data))
|
||||
) {
|
||||
config.data = data;
|
||||
config.params = params;
|
||||
} else {
|
||||
// 非GET请求如果没有提供data,则将params视为data
|
||||
config.data = { ...params };
|
||||
config.params = undefined;
|
||||
}
|
||||
if (joinParamsToUrl) {
|
||||
config.url = setObjToUrlParams(config.url as string, { ...config.params, ...config.data });
|
||||
}
|
||||
}
|
||||
return config;
|
||||
},
|
||||
|
||||
/**
|
||||
* @description: 处理请求数据。如果数据不是预期格式,可直接抛出错误
|
||||
*/
|
||||
transformRequestHook: (res: AxiosResponse<Result>, options: RequestOptions) => {
|
||||
const { t } = useI18n();
|
||||
const { isTransformResponse, isReturnNativeResponse } = options;
|
||||
// 是否返回原生响应头 比如:需要获取响应头时使用该属性
|
||||
if (isReturnNativeResponse) {
|
||||
return res;
|
||||
}
|
||||
// 不进行任何处理,直接返回
|
||||
// 用于页面代码可能需要直接获取code,data,message这些信息时开启
|
||||
if (!isTransformResponse) {
|
||||
return res.data;
|
||||
}
|
||||
// 错误的时候返回
|
||||
|
||||
const { data } = res;
|
||||
if (!data) {
|
||||
throw new Error(t('api.apiRequestFailed'));
|
||||
}
|
||||
// 这里 code,result,message为 后台统一的字段
|
||||
const { data: dataResult } = data;
|
||||
|
||||
// 这里直接返回正常结果,因为拦截器已经拦截了非 200 的请求
|
||||
return dataResult;
|
||||
},
|
||||
|
||||
/**
|
||||
* @description: 请求拦截器处理
|
||||
*/
|
||||
requestInterceptors: (config) => {
|
||||
// 请求之前处理config
|
||||
const currentLocale = localStorage.getItem('CRM-locale') || 'zh-CN';
|
||||
const app = getLocalStorage<Record<string, any>>('app', true);
|
||||
|
||||
const token = getToken();
|
||||
if (token && (config as Recordable)?.requestOptions?.withToken !== false) {
|
||||
const { sessionId, csrfToken } = token;
|
||||
|
||||
(config as Recordable).headers = {
|
||||
...config.headers,
|
||||
'X-AUTH-TOKEN': sessionId,
|
||||
'CSRF-TOKEN': csrfToken,
|
||||
'Accept-Language': currentLocale,
|
||||
'Organization-Id': app?.orgId,
|
||||
};
|
||||
}
|
||||
return config;
|
||||
},
|
||||
|
||||
/**
|
||||
* @description: 响应拦截器处理
|
||||
*/
|
||||
responseInterceptors: (res: AxiosResponse<CommonResponse<any>>) => {
|
||||
return res;
|
||||
},
|
||||
|
||||
/**
|
||||
* @description: 响应错误处理
|
||||
*/
|
||||
responseInterceptorsCatch: (error: any) => {
|
||||
const { t } = useI18n();
|
||||
const { response, code, message, config } = error || {};
|
||||
const msg: string = response?.data?.message ?? '';
|
||||
const msgDetail: string = response?.data?.messageDetail ?? '';
|
||||
const err: string = error?.toString?.() ?? '';
|
||||
let errMessage = '';
|
||||
|
||||
try {
|
||||
if (code === 'ECONNABORTED' && message.indexOf('timeout') !== -1) {
|
||||
errMessage = t('api.apiTimeoutMessage');
|
||||
}
|
||||
if (err?.includes('Network Error')) {
|
||||
errMessage = t('api.networkExceptionMsg');
|
||||
}
|
||||
|
||||
if (errMessage) {
|
||||
opt.showErrorMsg?.({ message: errMessage, duration: 5000 });
|
||||
return Promise.reject(error);
|
||||
}
|
||||
} catch (e) {
|
||||
throw new Error(e as unknown as string);
|
||||
}
|
||||
opt.checkStatus?.(response?.status, msg, msgDetail, response?.data?.code, config?.requestOptions?.noErrorTip);
|
||||
return Promise.reject(
|
||||
response?.config?.requestOptions?.isReturnNativeResponse ? response?.data : response?.data?.message || error
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
return new CordysAxios(
|
||||
deepMerge(
|
||||
{
|
||||
// See https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication#authentication_schemes
|
||||
// authentication schemes,e.g: Bearer
|
||||
// authenticationScheme: 'Bearer',
|
||||
authenticationScheme: '',
|
||||
baseURL: `${window.location.origin}/${import.meta.env.VITE_API_BASE_URL as string}`,
|
||||
timeout: 300 * 1000,
|
||||
headers: { 'Content-Type': ContentTypeEnum.JSON },
|
||||
// 如果是form-data格式
|
||||
// headers: { 'Content-Type': ContentTypeEnum.FORM_URLENCODED },
|
||||
// 数据处理方式
|
||||
transform,
|
||||
// 配置项,下面的选项都可以在独立的接口请求中覆盖
|
||||
requestOptions: {
|
||||
// 默认将prefix 添加到url
|
||||
joinPrefix: true,
|
||||
// 是否返回原生响应头 比如:需要获取响应头时使用该属性
|
||||
isReturnNativeResponse: false,
|
||||
// 需要对返回数据进行处理
|
||||
isTransformResponse: true,
|
||||
// post请求的时候添加参数到url
|
||||
joinParamsToUrl: false,
|
||||
// 格式化提交参数时间
|
||||
formatDate: true,
|
||||
// 消息提示类型
|
||||
errorMessageMode: 'message',
|
||||
// 是否加入时间戳
|
||||
joinTime: true,
|
||||
// 忽略取消请求的token
|
||||
ignoreCancelToken: false,
|
||||
// 是否携带token
|
||||
withToken: true,
|
||||
},
|
||||
},
|
||||
opt || {}
|
||||
)
|
||||
);
|
||||
}
|
||||
177
frontend/packages/lib-shared/api/modules/agent.ts
Normal file
177
frontend/packages/lib-shared/api/modules/agent.ts
Normal file
@@ -0,0 +1,177 @@
|
||||
import { ThirdPartyResourceConfig } from '@lib/shared/models/system/business';
|
||||
import type {
|
||||
AddAgentModuleParams,
|
||||
AddAgentParams,
|
||||
AgentApplicationScript,
|
||||
AgentModuleRenameParams,
|
||||
AgentModuleTreeNode,
|
||||
AgentPosParams,
|
||||
AgentRenameParams,
|
||||
AgentTableQueryParams,
|
||||
ApplicationScriptParams,
|
||||
UpdateAgentParams,
|
||||
} from '../../models/agent';
|
||||
import type { ModuleDragParams, TableQueryParams } from '../../models/common';
|
||||
import {
|
||||
addAgentUrl,
|
||||
agentApplicationUrl,
|
||||
agentCollectPageUrl,
|
||||
agentCollectUrl,
|
||||
agentDeleteUrl,
|
||||
agentDetailUrl,
|
||||
agentModuleAddUrl,
|
||||
agentModuleCountUrl,
|
||||
agentModuleDeleteUrl,
|
||||
agentModuleMoveUrl,
|
||||
agentModuleRenameUrl,
|
||||
agentModuleTreeUrl,
|
||||
agentOptionUrl,
|
||||
agentPageUrl,
|
||||
agentPosUrl,
|
||||
agentScriptUrl,
|
||||
agentWorkspaceUrl,
|
||||
getMkAgentVersionUrl,
|
||||
getMkApplicationUrl,
|
||||
renameAgentUrl,
|
||||
unCollectAgentUrl,
|
||||
updateAgentUrl,
|
||||
} from '../requrls/agent';
|
||||
import type { CrmTreeNodeData } from '@cordys/web/src/components/pure/crm-tree/type';
|
||||
import type { CordysAxios } from '@lib/shared/api/http/Axios';
|
||||
|
||||
export default function useAgentApi(CDR: CordysAxios) {
|
||||
// 智能体模块重命名
|
||||
function agentModuleRename(data: AgentModuleRenameParams) {
|
||||
return CDR.post({ url: agentModuleRenameUrl, data });
|
||||
}
|
||||
|
||||
// 智能体模块移动
|
||||
function agentModuleMove(data: ModuleDragParams) {
|
||||
return CDR.post({ url: agentModuleMoveUrl, data });
|
||||
}
|
||||
|
||||
// 智能体模块删除
|
||||
function agentModuleDelete(ids: string[]) {
|
||||
return CDR.post({ url: agentModuleDeleteUrl, data: ids });
|
||||
}
|
||||
|
||||
// 添加智能体模块
|
||||
function agentModuleAdd(data: AddAgentModuleParams) {
|
||||
return CDR.post({ url: agentModuleAddUrl, data });
|
||||
}
|
||||
|
||||
// 获取智能体模块树
|
||||
function getAgentModuleTree() {
|
||||
return CDR.get<CrmTreeNodeData<AgentModuleTreeNode>[]>({ url: agentModuleTreeUrl });
|
||||
}
|
||||
|
||||
// 获取智能体模块树数量
|
||||
function getAgentModuleTreeCount() {
|
||||
return CDR.get<Record<string, number>>({ url: agentModuleCountUrl });
|
||||
}
|
||||
|
||||
// 更新智能体
|
||||
function updateAgent(data: UpdateAgentParams) {
|
||||
return CDR.post({ url: updateAgentUrl, data });
|
||||
}
|
||||
|
||||
// 智能体重命名
|
||||
function agentRename(data: AgentRenameParams) {
|
||||
return CDR.post({ url: renameAgentUrl, data });
|
||||
}
|
||||
|
||||
// 获取智能体列表
|
||||
function getAgentPage(data: AgentTableQueryParams) {
|
||||
return CDR.post({ url: agentPageUrl, data });
|
||||
}
|
||||
|
||||
// 获取智能体收藏列表
|
||||
function getAgentCollectPage(data: TableQueryParams) {
|
||||
return CDR.post({ url: agentCollectPageUrl, data });
|
||||
}
|
||||
|
||||
// 添加智能体
|
||||
function addAgent(data: AddAgentParams) {
|
||||
return CDR.post({ url: addAgentUrl, data });
|
||||
}
|
||||
|
||||
// 取消收藏智能体
|
||||
function unCollectAgent(id: string) {
|
||||
return CDR.get({ url: `${unCollectAgentUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取智能体详情
|
||||
function getAgentDetail(id: string) {
|
||||
return CDR.get({ url: `${agentDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 删除智能体
|
||||
function agentDelete(id: string) {
|
||||
return CDR.get({ url: `${agentDeleteUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 收藏智能体
|
||||
function agentCollect(id: string) {
|
||||
return CDR.get({ url: `${agentCollectUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取智能体选项
|
||||
function getAgentOptions() {
|
||||
return CDR.get({ url: agentOptionUrl });
|
||||
}
|
||||
|
||||
// 获取智能体应用
|
||||
function agentApplicationOptions(workspaceId: string) {
|
||||
return CDR.get<AgentModuleRenameParams[]>({ url: `${agentApplicationUrl}/${workspaceId}` });
|
||||
}
|
||||
|
||||
// 获取工作空间
|
||||
function agentWorkspaceOptions() {
|
||||
return CDR.get<AgentModuleRenameParams[]>({ url: agentWorkspaceUrl });
|
||||
}
|
||||
|
||||
// 获取工作空间应用脚本
|
||||
function getApplicationScript(data: ApplicationScriptParams) {
|
||||
return CDR.post<AgentApplicationScript>({ url: agentScriptUrl, data });
|
||||
}
|
||||
|
||||
// 获取智能体mk版本
|
||||
function getMkAgentVersion() {
|
||||
return CDR.get<'PE' | 'EE'>({ url: getMkAgentVersionUrl }, { noErrorTip: true });
|
||||
}
|
||||
|
||||
// 智能体排序
|
||||
function agentPos(data: AgentPosParams) {
|
||||
return CDR.post({ url: agentPosUrl, data });
|
||||
}
|
||||
|
||||
// 获取智能体mk应用配置
|
||||
function getMkApplication() {
|
||||
return CDR.get<ThirdPartyResourceConfig>({ url: getMkApplicationUrl });
|
||||
}
|
||||
|
||||
return {
|
||||
agentModuleRename,
|
||||
agentModuleMove,
|
||||
agentModuleDelete,
|
||||
agentModuleAdd,
|
||||
getAgentModuleTree,
|
||||
getAgentModuleTreeCount,
|
||||
updateAgent,
|
||||
agentRename,
|
||||
getAgentPage,
|
||||
getAgentCollectPage,
|
||||
addAgent,
|
||||
unCollectAgent,
|
||||
getAgentDetail,
|
||||
agentDelete,
|
||||
agentCollect,
|
||||
getAgentOptions,
|
||||
agentApplicationOptions,
|
||||
agentWorkspaceOptions,
|
||||
getApplicationScript,
|
||||
getMkAgentVersion,
|
||||
agentPos,
|
||||
getMkApplication,
|
||||
};
|
||||
}
|
||||
535
frontend/packages/lib-shared/api/modules/clue.ts
Normal file
535
frontend/packages/lib-shared/api/modules/clue.ts
Normal file
@@ -0,0 +1,535 @@
|
||||
import type { CordysAxios } from '@lib/shared/api/http/Axios';
|
||||
import {
|
||||
AddClueFollowPlanUrl,
|
||||
AddClueFollowRecordUrl,
|
||||
AddClueUrl,
|
||||
AddClueViewUrl,
|
||||
AddPoolLeadViewUrl,
|
||||
AssignClueUrl,
|
||||
BatchAssignClueUrl,
|
||||
BatchDeleteCluePoolUrl,
|
||||
BatchDeleteClueUrl,
|
||||
BatchPickClueUrl,
|
||||
BatchToPoolClueUrl,
|
||||
BatchTransferClueUrl,
|
||||
BatchUpdateCluePoolUrl,
|
||||
BatchUpdateLeadUrl,
|
||||
CancelClueFollowPlanUrl,
|
||||
ClueTransitionCustomerUrl,
|
||||
DeleteClueFollowPlanUrl,
|
||||
DeleteClueFollowRecordUrl,
|
||||
DeleteCluePoolUrl,
|
||||
DeleteClueUrl,
|
||||
DeleteClueViewUrl,
|
||||
DeletePoolLeadViewUrl,
|
||||
DownloadTemplateUrl,
|
||||
DragClueViewUrl,
|
||||
DragPoolLeadViewUrl,
|
||||
EnableClueViewUrl,
|
||||
EnablePoolLeadViewUrl,
|
||||
ExportClueAllUrl,
|
||||
ExportCluePoolAllUrl,
|
||||
ExportCluePoolSelectedUrl,
|
||||
ExportClueSelectedUrl,
|
||||
FixedClueViewUrl,
|
||||
FixedPoolLeadViewUrl,
|
||||
GenerateLeadChartUrl,
|
||||
GenerateLeadPoolChartUrl,
|
||||
GetAdvancedCluePoolListUrl,
|
||||
GetAdvancedSearchClueDetailUrl,
|
||||
GetAdvancedSearchClueListUrl,
|
||||
GetClueFollowPlanListUrl,
|
||||
GetClueFollowPlanUrl,
|
||||
GetClueFollowRecordListUrl,
|
||||
GetClueFollowRecordUrl,
|
||||
GetClueFormConfigUrl,
|
||||
GetClueHeaderListUrl,
|
||||
GetClueListUrl,
|
||||
GetCluePoolFollowRecordListUrl,
|
||||
GetCluePoolListUrl,
|
||||
GetClueTabUrl,
|
||||
GetClueTransitionCustomerListUrl,
|
||||
GetClueUrl,
|
||||
GetClueViewDetailUrl,
|
||||
GetClueViewListUrl,
|
||||
GetGlobalCluePoolListUrl,
|
||||
GetGlobalSearchClueListUrl,
|
||||
GetPoolClueUrl,
|
||||
GetPoolLeadViewDetailUrl,
|
||||
GetPoolLeadViewListUrl,
|
||||
GetPoolOptionsUrl,
|
||||
ImportLeadUrl,
|
||||
MoveToPoolLeadUrl,
|
||||
PickClueUrl,
|
||||
PreCheckImportUrl,
|
||||
ReTransitionCustomerUrl,
|
||||
TransformClueUrl,
|
||||
UpdateClueFollowPlanStatusUrl,
|
||||
UpdateClueFollowPlanUrl,
|
||||
UpdateClueFollowRecordUrl,
|
||||
UpdateClueStatusUrl,
|
||||
UpdateClueUrl,
|
||||
UpdateClueViewUrl,
|
||||
UpdatePoolLeadViewUrl,
|
||||
} from '@lib/shared/api/requrls/clue';
|
||||
import type {
|
||||
AssignClueParams,
|
||||
BatchAssignClueParams,
|
||||
BatchPickClueParams,
|
||||
ClueDetail,
|
||||
ClueListItem,
|
||||
CluePoolListItem,
|
||||
CluePoolTableParams,
|
||||
ClueTransitionCustomerParams,
|
||||
ConvertClueParams,
|
||||
PickClueParams,
|
||||
SaveClueParams,
|
||||
UpdateClueParams,
|
||||
} from '@lib/shared/models/clue';
|
||||
import type {
|
||||
ChartResponseDataItem,
|
||||
CommonList,
|
||||
GenerateChartParams,
|
||||
TableDraggedParams,
|
||||
TableExportParams,
|
||||
TableExportSelectedParams,
|
||||
} from '@lib/shared/models/common';
|
||||
import type {
|
||||
BatchMoveToPublicPoolParams,
|
||||
BatchUpdatePoolAccountParams,
|
||||
CustomerContractTableParams,
|
||||
CustomerFollowPlanTableParams,
|
||||
CustomerFollowRecordTableParams,
|
||||
CustomerTabHidden,
|
||||
CustomerTableParams,
|
||||
FollowDetailItem,
|
||||
MoveToPublicPoolParams,
|
||||
PoolTableExportParams,
|
||||
SaveCustomerFollowPlanParams,
|
||||
SaveCustomerFollowRecordParams,
|
||||
TransferParams,
|
||||
UpdateCustomerFollowPlanParams,
|
||||
UpdateCustomerFollowRecordParams,
|
||||
UpdateFollowPlanStatusParams,
|
||||
} from '@lib/shared/models/customer';
|
||||
import type { CluePoolItem, FormDesignConfigDetailParams } from '@lib/shared/models/system/module';
|
||||
import { ValidateInfo } from '@lib/shared/models/system/org';
|
||||
import type { ViewItem, ViewParams } from '@lib/shared/models/view';
|
||||
|
||||
export default function useProductApi(CDR: CordysAxios) {
|
||||
// 添加线索
|
||||
function addClue(data: SaveClueParams) {
|
||||
return CDR.post({ url: AddClueUrl, data });
|
||||
}
|
||||
|
||||
// 更新线索
|
||||
function updateClue(data: UpdateClueParams) {
|
||||
return CDR.post({ url: UpdateClueUrl, data });
|
||||
}
|
||||
|
||||
// 更新线索状态
|
||||
function updateClueStatus(data: { id: string; stage: string }) {
|
||||
return CDR.post({ url: UpdateClueStatusUrl, data });
|
||||
}
|
||||
|
||||
// 获取线索列表
|
||||
function getClueList(data: CustomerTableParams) {
|
||||
return CDR.post<CommonList<ClueListItem>>({ url: GetClueListUrl, data });
|
||||
}
|
||||
|
||||
// 获取线索转为客户列表
|
||||
function getClueTransitionCustomerList(data: CustomerTableParams) {
|
||||
return CDR.post<CommonList<ClueListItem>>({ url: GetClueTransitionCustomerListUrl, data });
|
||||
}
|
||||
|
||||
// 批量转移线索
|
||||
function batchTransferClue(data: TransferParams) {
|
||||
return CDR.post({ url: BatchTransferClueUrl, data });
|
||||
}
|
||||
|
||||
// 线索合并客户
|
||||
function reTransitionCustomer(data: { clueIds: (string | number)[]; customerId: string }) {
|
||||
return CDR.post({ url: ReTransitionCustomerUrl, data });
|
||||
}
|
||||
|
||||
// 批量移入线索池
|
||||
function batchToCluePool(data: BatchMoveToPublicPoolParams) {
|
||||
return CDR.post({ url: BatchToPoolClueUrl, data });
|
||||
}
|
||||
|
||||
// 移入线索池
|
||||
function moveToLeadPool(data: MoveToPublicPoolParams) {
|
||||
return CDR.post({ url: MoveToPoolLeadUrl, data });
|
||||
}
|
||||
|
||||
// 导出全量线索池列表
|
||||
function exportCluePoolAll(data: PoolTableExportParams) {
|
||||
return CDR.post({ url: ExportCluePoolAllUrl, data });
|
||||
}
|
||||
|
||||
// 导出选中线索池列表
|
||||
function exportCluePoolSelected(data: TableExportSelectedParams) {
|
||||
return CDR.post({ url: ExportCluePoolSelectedUrl, data });
|
||||
}
|
||||
|
||||
// 批量删除线索
|
||||
function batchDeleteClue(data: string[]) {
|
||||
return CDR.post({ url: BatchDeleteClueUrl, data });
|
||||
}
|
||||
|
||||
// 获取线索表单配置
|
||||
function getClueFormConfig() {
|
||||
return CDR.get<FormDesignConfigDetailParams>({ url: GetClueFormConfigUrl });
|
||||
}
|
||||
|
||||
// 获取线索详情
|
||||
function getClue(id: string) {
|
||||
return CDR.get<ClueDetail>({ url: `${GetClueUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 删除线索
|
||||
function deleteClue(id: string) {
|
||||
return CDR.get({ url: `${DeleteClueUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 转为客户
|
||||
function ClueTransitionCustomer(data: ClueTransitionCustomerParams) {
|
||||
return CDR.post({ url: ClueTransitionCustomerUrl, data });
|
||||
}
|
||||
|
||||
// 添加线索跟进记录
|
||||
function addClueFollowRecord(data: SaveCustomerFollowRecordParams) {
|
||||
return CDR.post({ url: AddClueFollowRecordUrl, data });
|
||||
}
|
||||
|
||||
// 更新线索跟进记录
|
||||
function updateClueFollowRecord(data: UpdateCustomerFollowRecordParams) {
|
||||
return CDR.post({ url: UpdateClueFollowRecordUrl, data });
|
||||
}
|
||||
|
||||
// 获取线索跟进记录列表
|
||||
function getClueFollowRecordList(data: CustomerFollowRecordTableParams) {
|
||||
return CDR.post<CommonList<FollowDetailItem>>({ url: GetClueFollowRecordListUrl, data });
|
||||
}
|
||||
|
||||
// 删除线索跟进记录
|
||||
function deleteClueFollowRecord(id: string) {
|
||||
return CDR.get({ url: `${DeleteClueFollowRecordUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取线索跟进记录详情
|
||||
function getClueFollowRecord(id: string) {
|
||||
return CDR.get<FollowDetailItem>({ url: `${GetClueFollowRecordUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 添加线索跟进计划
|
||||
function addClueFollowPlan(data: SaveCustomerFollowPlanParams) {
|
||||
return CDR.post({ url: AddClueFollowPlanUrl, data });
|
||||
}
|
||||
|
||||
// 更新线索跟进计划
|
||||
function updateClueFollowPlan(data: UpdateCustomerFollowPlanParams) {
|
||||
return CDR.post({ url: UpdateClueFollowPlanUrl, data });
|
||||
}
|
||||
|
||||
// 删除线索跟进计划
|
||||
function deleteClueFollowPlan(id: string) {
|
||||
return CDR.get({ url: `${DeleteClueFollowPlanUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取线索跟进计划列表
|
||||
function getClueFollowPlanList(data: CustomerFollowPlanTableParams) {
|
||||
return CDR.post<CommonList<FollowDetailItem>>({ url: GetClueFollowPlanListUrl, data });
|
||||
}
|
||||
|
||||
// 获取线索跟进计划详情
|
||||
function getClueFollowPlan(id: string) {
|
||||
return CDR.get<FollowDetailItem>({ url: `${GetClueFollowPlanUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 取消跟进计划
|
||||
function cancelClueFollowPlan(id: string) {
|
||||
return CDR.get({ url: `${CancelClueFollowPlanUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取线索负责人列表
|
||||
function getClueHeaderList(data: CustomerContractTableParams) {
|
||||
return CDR.get({ url: `${GetClueHeaderListUrl}/${data.sourceId}` });
|
||||
}
|
||||
|
||||
// 线索池领取线索
|
||||
function pickClue(data: PickClueParams) {
|
||||
return CDR.post({ url: PickClueUrl, data });
|
||||
}
|
||||
|
||||
// 获取线索池线索列表
|
||||
function getCluePoolList(data: CluePoolTableParams) {
|
||||
return CDR.post<CommonList<CluePoolListItem>>({ url: GetCluePoolListUrl, data });
|
||||
}
|
||||
|
||||
// 批量领取线索池线索
|
||||
function batchPickClue(data: BatchPickClueParams) {
|
||||
return CDR.post({ url: BatchPickClueUrl, data });
|
||||
}
|
||||
|
||||
// 批量删除线索池线索
|
||||
function batchDeleteCluePool(data: string[]) {
|
||||
return CDR.post({ url: BatchDeleteCluePoolUrl, data });
|
||||
}
|
||||
|
||||
// 批量分配线索池线索
|
||||
function batchAssignClue(data: BatchAssignClueParams) {
|
||||
return CDR.post({ url: BatchAssignClueUrl, data });
|
||||
}
|
||||
|
||||
// 批量更新线索池线索
|
||||
function batchUpdateCluePool(data: BatchUpdatePoolAccountParams) {
|
||||
return CDR.post({ url: BatchUpdateCluePoolUrl, data });
|
||||
}
|
||||
|
||||
// 分配线索池线索
|
||||
function assignClue(data: AssignClueParams) {
|
||||
return CDR.post({ url: AssignClueUrl, data });
|
||||
}
|
||||
|
||||
// 获取当前用户线索池选项
|
||||
function getPoolOptions() {
|
||||
return CDR.get<CluePoolItem[]>({ url: GetPoolOptionsUrl });
|
||||
}
|
||||
|
||||
// 删除线索池线索
|
||||
function deleteCluePool(id: string) {
|
||||
return CDR.get({ url: `${DeleteCluePoolUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取线索池跟进记录列表
|
||||
function getCluePoolFollowRecordList(data: CustomerFollowRecordTableParams) {
|
||||
return CDR.post<CommonList<FollowDetailItem>>({ url: GetCluePoolFollowRecordListUrl, data });
|
||||
}
|
||||
|
||||
// 获取线索池详情
|
||||
function getPoolClue(id: string) {
|
||||
return CDR.get<ClueDetail>({ url: `${GetPoolClueUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 生成线索池图表
|
||||
function generateLeadPoolChart(data: GenerateChartParams) {
|
||||
return CDR.post<ChartResponseDataItem[]>({ url: GenerateLeadPoolChartUrl, data });
|
||||
}
|
||||
|
||||
// 获取线索tab显隐藏
|
||||
function getClueTab() {
|
||||
return CDR.get<CustomerTabHidden>({ url: GetClueTabUrl });
|
||||
}
|
||||
|
||||
// 更新线索跟进计划状态
|
||||
function updateClueFollowPlanStatus(data: UpdateFollowPlanStatusParams) {
|
||||
return CDR.post({ url: UpdateClueFollowPlanStatusUrl, data });
|
||||
}
|
||||
|
||||
// 导出全量线索列表
|
||||
function exportClueAll(data: TableExportParams) {
|
||||
return CDR.post({ url: ExportClueAllUrl, data });
|
||||
}
|
||||
|
||||
// 导出选中线索列表
|
||||
function exportClueSelected(data: TableExportSelectedParams) {
|
||||
return CDR.post({ url: ExportClueSelectedUrl, data });
|
||||
}
|
||||
|
||||
// 转换线索
|
||||
function transformClue(data: ConvertClueParams) {
|
||||
return CDR.post({ url: TransformClueUrl, data });
|
||||
}
|
||||
|
||||
// 生成线索图表
|
||||
function generateLeadChart(data: GenerateChartParams) {
|
||||
return CDR.post<ChartResponseDataItem[]>({ url: GenerateLeadChartUrl, data });
|
||||
}
|
||||
|
||||
// 视图
|
||||
function addClueView(data: ViewParams) {
|
||||
return CDR.post({ url: AddClueViewUrl, data });
|
||||
}
|
||||
|
||||
function updateClueView(data: ViewParams) {
|
||||
return CDR.post({ url: UpdateClueViewUrl, data });
|
||||
}
|
||||
|
||||
function getClueViewList() {
|
||||
return CDR.get<ViewItem[]>({ url: GetClueViewListUrl });
|
||||
}
|
||||
|
||||
function getClueViewDetail(id: string) {
|
||||
return CDR.get({ url: `${GetClueViewDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
function fixedClueView(id: string) {
|
||||
return CDR.get({ url: `${FixedClueViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function enableClueView(id: string) {
|
||||
return CDR.get({ url: `${EnableClueViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function deleteClueView(id: string) {
|
||||
return CDR.get({ url: `${DeleteClueViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function dragClueView(data: TableDraggedParams) {
|
||||
return CDR.post({ url: DragClueViewUrl, data });
|
||||
}
|
||||
|
||||
function preCheckImportLead(file: File) {
|
||||
return CDR.uploadFile<{ data: ValidateInfo }>({ url: PreCheckImportUrl }, { fileList: [file] }, 'file');
|
||||
}
|
||||
|
||||
function downloadLeadTemplate() {
|
||||
return CDR.get(
|
||||
{
|
||||
url: DownloadTemplateUrl,
|
||||
responseType: 'blob',
|
||||
},
|
||||
{ isTransformResponse: false, isReturnNativeResponse: true }
|
||||
);
|
||||
}
|
||||
|
||||
function importLead(file: File) {
|
||||
return CDR.uploadFile({ url: ImportLeadUrl }, { fileList: [file] }, 'file');
|
||||
}
|
||||
|
||||
function getAdvancedSearchClueList(data: CustomerTableParams) {
|
||||
return CDR.post<CommonList<ClueListItem>>({ url: GetAdvancedSearchClueListUrl, data }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
function getAdvancedSearchClueDetail(data: CustomerTableParams) {
|
||||
return CDR.post<CommonList<ClueListItem>>({ url: GetAdvancedSearchClueDetailUrl, data });
|
||||
}
|
||||
|
||||
function getAdvancedCluePoolList(data: CluePoolTableParams) {
|
||||
return CDR.post<CommonList<CluePoolListItem>>(
|
||||
{ url: GetAdvancedCluePoolListUrl, data },
|
||||
{ ignoreCancelToken: true }
|
||||
);
|
||||
}
|
||||
|
||||
function getGlobalSearchClueList(data: CustomerTableParams) {
|
||||
return CDR.post<CommonList<ClueListItem>>({ url: GetGlobalSearchClueListUrl, data }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
function getGlobalCluePoolList(data: CluePoolTableParams) {
|
||||
return CDR.post<CommonList<CluePoolListItem>>({ url: GetGlobalCluePoolListUrl, data }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
// 线索池视图
|
||||
function addLeadPoolView(data: ViewParams) {
|
||||
return CDR.post({ url: AddPoolLeadViewUrl, data });
|
||||
}
|
||||
|
||||
function updateLeadPoolView(data: ViewParams) {
|
||||
return CDR.post({ url: UpdatePoolLeadViewUrl, data });
|
||||
}
|
||||
|
||||
function getLeadPoolViewList() {
|
||||
return CDR.get<ViewItem[]>({ url: GetPoolLeadViewListUrl });
|
||||
}
|
||||
|
||||
function getLeadPoolViewDetail(id: string) {
|
||||
return CDR.get({ url: `${GetPoolLeadViewDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
function fixedLeadPoolView(id: string) {
|
||||
return CDR.get({ url: `${FixedPoolLeadViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function enableLeadPoolView(id: string) {
|
||||
return CDR.get({ url: `${EnablePoolLeadViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function deleteLeadPoolView(id: string) {
|
||||
return CDR.get({ url: `${DeletePoolLeadViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function dragLeadPoolView(data: TableDraggedParams) {
|
||||
return CDR.post({ url: DragPoolLeadViewUrl, data });
|
||||
}
|
||||
|
||||
// 批量更新线索
|
||||
function batchUpdateLead(data: BatchUpdatePoolAccountParams) {
|
||||
return CDR.post({ url: BatchUpdateLeadUrl, data });
|
||||
}
|
||||
|
||||
return {
|
||||
addClue,
|
||||
updateClue,
|
||||
updateClueStatus,
|
||||
getClueList,
|
||||
batchTransferClue,
|
||||
batchToCluePool,
|
||||
batchDeleteClue,
|
||||
getClueFormConfig,
|
||||
getClue,
|
||||
deleteClue,
|
||||
ClueTransitionCustomer,
|
||||
addClueFollowRecord,
|
||||
updateClueFollowRecord,
|
||||
getClueFollowRecordList,
|
||||
deleteClueFollowRecord,
|
||||
getClueFollowRecord,
|
||||
addClueFollowPlan,
|
||||
updateClueFollowPlan,
|
||||
deleteClueFollowPlan,
|
||||
getClueFollowPlanList,
|
||||
getClueFollowPlan,
|
||||
cancelClueFollowPlan,
|
||||
getClueHeaderList,
|
||||
pickClue,
|
||||
getCluePoolList,
|
||||
batchPickClue,
|
||||
batchDeleteCluePool,
|
||||
batchAssignClue,
|
||||
assignClue,
|
||||
getPoolOptions,
|
||||
deleteCluePool,
|
||||
getCluePoolFollowRecordList,
|
||||
getPoolClue,
|
||||
getClueTab,
|
||||
updateClueFollowPlanStatus,
|
||||
exportClueAll,
|
||||
exportClueSelected,
|
||||
getClueTransitionCustomerList,
|
||||
reTransitionCustomer,
|
||||
moveToLeadPool,
|
||||
addClueView,
|
||||
deleteClueView,
|
||||
fixedClueView,
|
||||
getClueViewDetail,
|
||||
getClueViewList,
|
||||
updateClueView,
|
||||
enableClueView,
|
||||
dragClueView,
|
||||
preCheckImportLead,
|
||||
downloadLeadTemplate,
|
||||
importLead,
|
||||
getAdvancedSearchClueList,
|
||||
getAdvancedCluePoolList,
|
||||
getAdvancedSearchClueDetail,
|
||||
getGlobalCluePoolList,
|
||||
getGlobalSearchClueList,
|
||||
exportCluePoolAll,
|
||||
exportCluePoolSelected,
|
||||
transformClue,
|
||||
batchUpdateCluePool,
|
||||
addLeadPoolView,
|
||||
deleteLeadPoolView,
|
||||
fixedLeadPoolView,
|
||||
getLeadPoolViewDetail,
|
||||
getLeadPoolViewList,
|
||||
updateLeadPoolView,
|
||||
enableLeadPoolView,
|
||||
dragLeadPoolView,
|
||||
batchUpdateLead,
|
||||
generateLeadChart,
|
||||
generateLeadPoolChart,
|
||||
};
|
||||
}
|
||||
901
frontend/packages/lib-shared/api/modules/contract.ts
Normal file
901
frontend/packages/lib-shared/api/modules/contract.ts
Normal file
@@ -0,0 +1,901 @@
|
||||
import type { CordysAxios } from '@lib/shared/api/http/Axios';
|
||||
import type { FormDesignConfigDetailParams } from '@lib/shared/models/system/module';
|
||||
import type { TableQueryParams } from '@lib/shared/models/common';
|
||||
import { ValidateInfo } from '@lib/shared/models/system/org';
|
||||
|
||||
import {
|
||||
ContractPageUrl,
|
||||
ContractAddUrl,
|
||||
ContractUpdateUrl,
|
||||
ContractDeleteUrl,
|
||||
GetContractDetailUrl,
|
||||
GetContractFormConfigUrl,
|
||||
GetContractTabUrl,
|
||||
ChangeContractStatusUrl,
|
||||
GetContractFormSnapshotConfigUrl,
|
||||
ExportContractAllUrl,
|
||||
ExportContractSelectedUrl,
|
||||
GenerateContractChartUrl,
|
||||
AddContractViewUrl,
|
||||
UpdateContractViewUrl,
|
||||
GetContractViewListUrl,
|
||||
GetContractViewDetailUrl,
|
||||
FixedContractViewUrl,
|
||||
EnableContractViewUrl,
|
||||
DeleteContractViewUrl,
|
||||
DragContractViewUrl,
|
||||
PaymentPlanPageUrl,
|
||||
PaymentPlanAddUrl,
|
||||
ContractPaymentPlanPageUrl,
|
||||
PaymentPlanUpdateUrl,
|
||||
PaymentPlanDeleteUrl,
|
||||
GetPaymentPlanDetailUrl,
|
||||
GetPaymentPlanFormConfigUrl,
|
||||
GetPaymentPlanTabUrl,
|
||||
ExportPaymentPlanAllUrl,
|
||||
ExportPaymentPlanSelectedUrl,
|
||||
GeneratePaymentPlanChartUrl,
|
||||
AddPaymentPlanViewUrl,
|
||||
UpdatePaymentPlanViewUrl,
|
||||
GetPaymentPlanViewListUrl,
|
||||
GetPaymentPlanViewDetailUrl,
|
||||
FixedPaymentPlanViewUrl,
|
||||
EnablePaymentPlanViewUrl,
|
||||
DeletePaymentPlanViewUrl,
|
||||
DragPaymentPlanViewUrl,
|
||||
BatchApproveContractUrl,
|
||||
BatchUpdateContractUrl,
|
||||
ApproveContractUrl,
|
||||
RevokeContractUrl,
|
||||
PaymentRecordPageUrl,
|
||||
PaymentRecordAddUrl,
|
||||
PaymentRecordUpdateUrl,
|
||||
PaymentRecordDeleteUrl,
|
||||
GetPaymentRecordDetailUrl,
|
||||
GetPaymentRecordFormConfigUrl,
|
||||
GetPaymentRecordTabUrl,
|
||||
ExportPaymentRecordAllUrl,
|
||||
ExportPaymentRecordSelectedUrl,
|
||||
AddPaymentRecordViewUrl,
|
||||
UpdatePaymentRecordViewUrl,
|
||||
GetPaymentRecordViewListUrl,
|
||||
GetPaymentRecordViewDetailUrl,
|
||||
FixedPaymentRecordViewUrl,
|
||||
EnablePaymentRecordViewUrl,
|
||||
DeletePaymentRecordViewUrl,
|
||||
DragPaymentRecordViewUrl,
|
||||
PreCheckPaymentRecordImportUrl,
|
||||
DownloadPaymentRecordTemplateUrl,
|
||||
ImportPaymentRecordUrl,
|
||||
DownloadBusinessTitleTemplateUrl,
|
||||
ImportBusinessTitleUrl,
|
||||
PreCheckBusinessTitleImportUrl,
|
||||
BusinessTitlePageUrl,
|
||||
BusinessTitleAddUrl,
|
||||
BusinessTitleUpdateUrl,
|
||||
BusinessTitleDeleteUrl,
|
||||
GetBusinessTitleDetailUrl,
|
||||
BusinessTitleRevokeUrl,
|
||||
GetBusinessTitleInvoiceCheckUrl,
|
||||
ExportBusinessTitleSelectedUrl,
|
||||
ExportBusinessTitleAllUrl,
|
||||
GetBusinessTitleThirdQueryUrl,
|
||||
GetBusinessTitleThirdQueryOptionUrl,
|
||||
BusinessTitleConfigUrl,
|
||||
BusinessTitleFormConfigSwitchUrl,
|
||||
ContractInvoicedAddUrl,
|
||||
ContractInvoicedUpdateUrl,
|
||||
ContractInvoicedApprovalUrl,
|
||||
ContractInvoicedDeleteUrl,
|
||||
ContractInvoicedBatchDeleteUrl,
|
||||
ContractInvoicedDetailUrl,
|
||||
ContractInvoicedExportAllUrl,
|
||||
ContractInvoicedExportSelectedUrl,
|
||||
ContractInvoicedFormConfigSnapshotUrl,
|
||||
ContractInvoicedFormConfigUrl,
|
||||
ContractInvoicedPageUrl,
|
||||
ContractInvoicedRevokeUrl,
|
||||
ContractInvoicedTabUrl,
|
||||
DeleteContractInvoicedViewUrl,
|
||||
DragContractInvoicedViewUrl,
|
||||
EnableContractInvoicedViewUrl,
|
||||
FixedContractInvoicedViewUrl,
|
||||
GetContractInvoicedViewDetailUrl,
|
||||
ListContractInvoicedViewUrl,
|
||||
UpdateContractInvoicedViewUrl,
|
||||
AddContractInvoicedViewUrl,
|
||||
BusinessTitleModuleFormUrl,
|
||||
ContractInvoicedInContractPageUrl,
|
||||
GetContractDetailSnapshotUrl,
|
||||
ContractInvoicedDetailSnapshotUrl,
|
||||
ContractStatisticUrl,
|
||||
SortContractUrl,
|
||||
GetPaymentRecordStatisticUrl,
|
||||
UpdateContractStatusUrl,
|
||||
UpdateContractStatusRollbackUrl,
|
||||
SortContractStatusUrl,
|
||||
AddContractStatusUrl,
|
||||
GetContractStatusConfigUrl,
|
||||
DeleteContractStatusUrl,
|
||||
UpdateContractStageUrl,
|
||||
SwitchContractCirculationTypeUrl,
|
||||
SaveContractCirculationConfigUrl,
|
||||
} from '@lib/shared/api/requrls/contract';
|
||||
import type { CustomerTabHidden } from '@lib/shared/models/customer';
|
||||
import type {
|
||||
ChartResponseDataItem,
|
||||
CommonList,
|
||||
GenerateChartParams,
|
||||
TableDraggedParams,
|
||||
TableExportParams,
|
||||
TableExportSelectedParams,
|
||||
} from '@lib/shared/models/common';
|
||||
import type { ViewItem, ViewParams } from '@lib/shared/models/view';
|
||||
import type {
|
||||
ContractDetail,
|
||||
ContractItem,
|
||||
SaveContractParams,
|
||||
UpdateContractParams,
|
||||
PaymentPlanItem,
|
||||
PaymentPlanDetail,
|
||||
SavePaymentPlanParams,
|
||||
UpdatePaymentPlanParams,
|
||||
ApprovalContractParams,
|
||||
PaymentRecordItem,
|
||||
PaymentRecordDetail,
|
||||
SavePaymentRecordParams,
|
||||
UpdatePaymentRecordParams,
|
||||
BusinessTitleItem,
|
||||
SaveBusinessTitleParams,
|
||||
BusinessTitleValidateConfig,
|
||||
ContractInvoiceTableQueryParam,
|
||||
ContractInvoiceItem,
|
||||
SaveContractInvoiceParams,
|
||||
UpdateContractInvoiceParams,
|
||||
ContractInvoiceDetail,
|
||||
} from '@lib/shared/models/contract';
|
||||
import type {
|
||||
BatchOperationResult,
|
||||
BatchUpdateQuotationStatusParams,
|
||||
SaveCirculationConfigParams,
|
||||
UpdateStageParams,
|
||||
StageBoardDraggedParams,
|
||||
StageBoardPageQueryParams,
|
||||
} from '@lib/shared/models/opportunity';
|
||||
import type { BatchUpdatePoolAccountParams } from '@lib/shared/models/customer';
|
||||
import {
|
||||
StageBaseParams,
|
||||
OpportunityStageConfig,
|
||||
UpdateOpportunityStageRollbackParams,
|
||||
UpdateStageBaseParams,
|
||||
} from '@lib/shared/models/opportunity';
|
||||
import type { CirculationTypeEnum } from '@lib/shared/enums/opportunityEnum';
|
||||
export default function useContractApi(CDR: CordysAxios) {
|
||||
// 合同列表
|
||||
function getContractList(data: StageBoardPageQueryParams) {
|
||||
return CDR.post<CommonList<ContractItem>>({ url: ContractPageUrl, data }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
// 合同看板拖拽排序
|
||||
function sortContract(data: StageBoardDraggedParams) {
|
||||
return CDR.post({ url: SortContractUrl, data });
|
||||
}
|
||||
|
||||
// 添加合同
|
||||
function addContract(data: SaveContractParams) {
|
||||
return CDR.post({ url: ContractAddUrl, data });
|
||||
}
|
||||
|
||||
// 更新合同
|
||||
function updateContract(data: UpdateContractParams, approvalTaskId?: string) {
|
||||
return CDR.post({ url: ContractUpdateUrl, data, params: { approvalTaskId } });
|
||||
}
|
||||
|
||||
// 删除合同
|
||||
function deleteContract(id: string) {
|
||||
return CDR.get({ url: `${ContractDeleteUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 合同详情
|
||||
function getContractDetail(id: string, approvalTaskId?: string) {
|
||||
return CDR.get<ContractDetail>({ url: `${GetContractDetailUrl}/${id}`, params: { approvalTaskId } });
|
||||
}
|
||||
|
||||
// 合同详情快照
|
||||
function getContractDetailSnapshot(id: string, approvalTaskId?: string) {
|
||||
return CDR.get<ContractDetail>({ url: `${GetContractDetailSnapshotUrl}/${id}`, params: { approvalTaskId } });
|
||||
}
|
||||
|
||||
// 获取合同表单配置
|
||||
function getContractFormConfig() {
|
||||
return CDR.get<FormDesignConfigDetailParams>({
|
||||
url: GetContractFormConfigUrl,
|
||||
});
|
||||
}
|
||||
|
||||
function getContractFormSnapshotConfig(id?: string, approvalTaskId?: string) {
|
||||
return CDR.get<FormDesignConfigDetailParams>({
|
||||
url: `${GetContractFormSnapshotConfigUrl}/${id}`,
|
||||
params: { approvalTaskId },
|
||||
});
|
||||
}
|
||||
|
||||
function changeContractStatus(data: UpdateStageParams) {
|
||||
return CDR.post({ url: `${ChangeContractStatusUrl}`, data });
|
||||
}
|
||||
|
||||
// 获取合同tab显隐藏
|
||||
function getContractTab() {
|
||||
return CDR.get<CustomerTabHidden>({ url: GetContractTabUrl });
|
||||
}
|
||||
|
||||
// 导出全量合同列表
|
||||
function exportContractAll(data: TableExportParams) {
|
||||
return CDR.post({ url: ExportContractAllUrl, data });
|
||||
}
|
||||
|
||||
// 导出选中合同列表
|
||||
function exportContractSelected(data: TableExportSelectedParams) {
|
||||
return CDR.post({ url: ExportContractSelectedUrl, data });
|
||||
}
|
||||
|
||||
// 生成合同图表
|
||||
function generateContractChart(data: GenerateChartParams) {
|
||||
return CDR.post<ChartResponseDataItem[]>({
|
||||
url: GenerateContractChartUrl,
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
function batchApproveContract(data: BatchUpdateQuotationStatusParams) {
|
||||
return CDR.post<BatchOperationResult>({ url: BatchApproveContractUrl, data });
|
||||
}
|
||||
|
||||
function batchUpdateContract(data: BatchUpdatePoolAccountParams) {
|
||||
return CDR.post({ url: BatchUpdateContractUrl, data });
|
||||
}
|
||||
|
||||
function approvalContract(data: ApprovalContractParams) {
|
||||
return CDR.post({ url: ApproveContractUrl, data });
|
||||
}
|
||||
|
||||
function revokeContract(id: string) {
|
||||
return CDR.get({ url: `${RevokeContractUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 视图
|
||||
function addContractView(data: ViewParams) {
|
||||
return CDR.post({ url: AddContractViewUrl, data });
|
||||
}
|
||||
|
||||
function updateContractView(data: ViewParams) {
|
||||
return CDR.post({ url: UpdateContractViewUrl, data });
|
||||
}
|
||||
|
||||
function getContractViewList() {
|
||||
return CDR.get<ViewItem[]>({ url: GetContractViewListUrl });
|
||||
}
|
||||
|
||||
function getContractViewDetail(id: string) {
|
||||
return CDR.get({ url: `${GetContractViewDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
function fixedContractView(id: string) {
|
||||
return CDR.get({ url: `${FixedContractViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function enableContractView(id: string) {
|
||||
return CDR.get({ url: `${EnableContractViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function deleteContractView(id: string) {
|
||||
return CDR.get({ url: `${DeleteContractViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function dragContractView(data: TableDraggedParams) {
|
||||
return CDR.post({ url: DragContractViewUrl, data });
|
||||
}
|
||||
|
||||
// 回款计划列表
|
||||
function getPaymentPlanList(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<PaymentPlanItem>>({ url: PaymentPlanPageUrl, data });
|
||||
}
|
||||
|
||||
function getContractPaymentPlanList(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<PaymentPlanItem>>({ url: ContractPaymentPlanPageUrl, data });
|
||||
}
|
||||
|
||||
// 添加回款计划
|
||||
function addPaymentPlan(data: SavePaymentPlanParams) {
|
||||
return CDR.post({ url: PaymentPlanAddUrl, data });
|
||||
}
|
||||
|
||||
// 更新回款计划
|
||||
function updatePaymentPlan(data: UpdatePaymentPlanParams) {
|
||||
return CDR.post({ url: PaymentPlanUpdateUrl, data });
|
||||
}
|
||||
|
||||
// 删除回款计划
|
||||
function deletePaymentPlan(id: string) {
|
||||
return CDR.get({ url: `${PaymentPlanDeleteUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 回款计划详情
|
||||
function getPaymentPlanDetail(id: string) {
|
||||
return CDR.get<PaymentPlanDetail>({ url: `${GetPaymentPlanDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取回款计划表单配置
|
||||
function getPaymentPlanFormConfig() {
|
||||
return CDR.get<FormDesignConfigDetailParams>({
|
||||
url: GetPaymentPlanFormConfigUrl,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取回款计划 tab 显隐
|
||||
function getPaymentPlanTab() {
|
||||
return CDR.get<CustomerTabHidden>({ url: GetPaymentPlanTabUrl });
|
||||
}
|
||||
|
||||
// 导出全量回款计划
|
||||
function exportPaymentPlanAll(data: TableExportParams) {
|
||||
return CDR.post({ url: ExportPaymentPlanAllUrl, data });
|
||||
}
|
||||
|
||||
// 导出选中回款计划
|
||||
function exportPaymentPlanSelected(data: TableExportSelectedParams) {
|
||||
return CDR.post({ url: ExportPaymentPlanSelectedUrl, data });
|
||||
}
|
||||
|
||||
// 生成回款计划图表
|
||||
function generatePaymentPlanChart(data: GenerateChartParams) {
|
||||
return CDR.post<ChartResponseDataItem[]>({
|
||||
url: GeneratePaymentPlanChartUrl,
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 添加视图
|
||||
function addPaymentPlanView(data: ViewParams) {
|
||||
return CDR.post({ url: AddPaymentPlanViewUrl, data });
|
||||
}
|
||||
|
||||
// 更新视图
|
||||
function updatePaymentPlanView(data: ViewParams) {
|
||||
return CDR.post({ url: UpdatePaymentPlanViewUrl, data });
|
||||
}
|
||||
|
||||
// 获取视图列表
|
||||
function getPaymentPlanViewList() {
|
||||
return CDR.get<ViewItem[]>({ url: GetPaymentPlanViewListUrl });
|
||||
}
|
||||
|
||||
// 获取视图详情
|
||||
function getPaymentPlanViewDetail(id: string) {
|
||||
return CDR.get({ url: `${GetPaymentPlanViewDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 固定视图
|
||||
function fixedPaymentPlanView(id: string) {
|
||||
return CDR.get({ url: `${FixedPaymentPlanViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 启用视图
|
||||
function enablePaymentPlanView(id: string) {
|
||||
return CDR.get({ url: `${EnablePaymentPlanViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 删除视图
|
||||
function deletePaymentPlanView(id: string) {
|
||||
return CDR.get({ url: `${DeletePaymentPlanViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 拖拽排序视图
|
||||
function dragPaymentPlanView(data: TableDraggedParams) {
|
||||
return CDR.post({ url: DragPaymentPlanViewUrl, data });
|
||||
}
|
||||
|
||||
// 回款记录列表
|
||||
function getPaymentRecordList(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<PaymentRecordItem>>({ url: PaymentRecordPageUrl, data }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
// 添加回款记录
|
||||
function addPaymentRecord(data: SavePaymentRecordParams) {
|
||||
return CDR.post({ url: PaymentRecordAddUrl, data });
|
||||
}
|
||||
|
||||
// 更新回款记录
|
||||
function updatePaymentRecord(data: UpdatePaymentRecordParams) {
|
||||
return CDR.post({ url: PaymentRecordUpdateUrl, data });
|
||||
}
|
||||
|
||||
// 删除回款记录
|
||||
function deletePaymentRecord(id: string) {
|
||||
return CDR.get({ url: `${PaymentRecordDeleteUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 回款记录详情
|
||||
function getPaymentRecordDetail(id: string) {
|
||||
return CDR.get<PaymentRecordDetail>({ url: `${GetPaymentRecordDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取回款记录表单配置
|
||||
function getPaymentRecordFormConfig() {
|
||||
return CDR.get<FormDesignConfigDetailParams>({
|
||||
url: GetPaymentRecordFormConfigUrl,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取回款记录 tab 显隐
|
||||
function getPaymentRecordTab() {
|
||||
return CDR.get<CustomerTabHidden>({ url: GetPaymentRecordTabUrl });
|
||||
}
|
||||
|
||||
// 导出全量回款记录
|
||||
function exportPaymentRecordAll(data: TableExportParams) {
|
||||
return CDR.post({ url: ExportPaymentRecordAllUrl, data });
|
||||
}
|
||||
|
||||
// 导出选中回款记录
|
||||
function exportPaymentRecordSelected(data: TableExportSelectedParams) {
|
||||
return CDR.post({ url: ExportPaymentRecordSelectedUrl, data });
|
||||
}
|
||||
|
||||
// 添加视图
|
||||
function addPaymentRecordView(data: ViewParams) {
|
||||
return CDR.post({ url: AddPaymentRecordViewUrl, data });
|
||||
}
|
||||
|
||||
// 更新视图
|
||||
function updatePaymentRecordView(data: ViewParams) {
|
||||
return CDR.post({ url: UpdatePaymentRecordViewUrl, data });
|
||||
}
|
||||
|
||||
// 获取视图列表
|
||||
function getPaymentRecordViewList() {
|
||||
return CDR.get<ViewItem[]>({ url: GetPaymentRecordViewListUrl });
|
||||
}
|
||||
|
||||
// 获取视图详情
|
||||
function getPaymentRecordViewDetail(id: string) {
|
||||
return CDR.get({ url: `${GetPaymentRecordViewDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 固定视图
|
||||
function fixedPaymentRecordView(id: string) {
|
||||
return CDR.get({ url: `${FixedPaymentRecordViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 启用视图
|
||||
function enablePaymentRecordView(id: string) {
|
||||
return CDR.get({ url: `${EnablePaymentRecordViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 删除视图
|
||||
function deletePaymentRecordView(id: string) {
|
||||
return CDR.get({ url: `${DeletePaymentRecordViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 拖拽排序视图
|
||||
function dragPaymentRecordView(data: TableDraggedParams) {
|
||||
return CDR.post({ url: DragPaymentRecordViewUrl, data });
|
||||
}
|
||||
|
||||
function preCheckImportContractPaymentRecord(file: File) {
|
||||
return CDR.uploadFile<{ data: ValidateInfo }>(
|
||||
{ url: PreCheckPaymentRecordImportUrl },
|
||||
{ fileList: [file] },
|
||||
'file'
|
||||
);
|
||||
}
|
||||
|
||||
function downloadContractPaymentRecordTemplate() {
|
||||
return CDR.get(
|
||||
{
|
||||
url: DownloadPaymentRecordTemplateUrl,
|
||||
responseType: 'blob',
|
||||
},
|
||||
{ isTransformResponse: false, isReturnNativeResponse: true }
|
||||
);
|
||||
}
|
||||
|
||||
function importContractPaymentRecord(file: File) {
|
||||
return CDR.uploadFile({ url: ImportPaymentRecordUrl }, { fileList: [file] }, 'file');
|
||||
}
|
||||
|
||||
// 合同-工商抬头导入
|
||||
function preCheckImportBusinessTitle(file: File, importType?: string) {
|
||||
return CDR.uploadFile<{ data: ValidateInfo }>(
|
||||
{ url: PreCheckBusinessTitleImportUrl },
|
||||
{ fileList: [file], request: { importType } },
|
||||
'file'
|
||||
);
|
||||
}
|
||||
|
||||
function downloadBusinessTitleTemplate() {
|
||||
return CDR.get(
|
||||
{
|
||||
url: DownloadBusinessTitleTemplateUrl,
|
||||
responseType: 'blob',
|
||||
},
|
||||
{ isTransformResponse: false, isReturnNativeResponse: true }
|
||||
);
|
||||
}
|
||||
|
||||
function importBusinessTitle(file: File, importType?: string) {
|
||||
return CDR.uploadFile({ url: ImportBusinessTitleUrl }, { fileList: [file], request: { importType } }, 'file');
|
||||
}
|
||||
|
||||
// 工商抬头列表
|
||||
function getBusinessTitleList(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<BusinessTitleItem>>({ url: BusinessTitlePageUrl, data }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
// 添加工商抬头
|
||||
function addBusinessTitle(data: SaveBusinessTitleParams) {
|
||||
return CDR.post({ url: BusinessTitleAddUrl, data });
|
||||
}
|
||||
|
||||
// 更新工商抬头
|
||||
function updateBusinessTitle(data: SaveBusinessTitleParams) {
|
||||
return CDR.post({ url: BusinessTitleUpdateUrl, data });
|
||||
}
|
||||
|
||||
// 删除工商抬头
|
||||
function deleteBusinessTitle(id: string) {
|
||||
return CDR.get({ url: `${BusinessTitleDeleteUrl}/${id}` });
|
||||
}
|
||||
|
||||
//撤销工商抬头
|
||||
function revokeBusinessTitle(id: string) {
|
||||
return CDR.get({ url: `${BusinessTitleRevokeUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 工商抬头详情
|
||||
function getBusinessTitleDetail(id: string) {
|
||||
return CDR.get<BusinessTitleItem>({ url: `${GetBusinessTitleDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 工商抬头发票核验
|
||||
function getBusinessTitleInvoiceCheck(id: string) {
|
||||
return CDR.get({ url: `${GetBusinessTitleInvoiceCheckUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 导出全量工商抬头
|
||||
function exportBusinessTitleAll(data: TableExportParams) {
|
||||
return CDR.post({ url: ExportBusinessTitleAllUrl, data });
|
||||
}
|
||||
|
||||
// 导出选中的工商抬头
|
||||
function exportBusinessTitleSelected(data: TableExportSelectedParams) {
|
||||
return CDR.post({ url: ExportBusinessTitleSelectedUrl, data });
|
||||
}
|
||||
|
||||
// 第三方接口分页模糊查询工商名称
|
||||
function getBusinessTitleThirdQueryOption(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<string[]>>({ url: GetBusinessTitleThirdQueryOptionUrl, data });
|
||||
}
|
||||
|
||||
// 第三方接口查询工商抬头信息
|
||||
function getBusinessTitleThirdQuery(keyword: string) {
|
||||
return CDR.get({ url: GetBusinessTitleThirdQueryUrl, params: { keyword } });
|
||||
}
|
||||
|
||||
// 获取工商抬头表单校验配置
|
||||
function getBusinessTitleConfig() {
|
||||
return CDR.get<BusinessTitleValidateConfig[]>({ url: BusinessTitleConfigUrl });
|
||||
}
|
||||
|
||||
// 工商抬头表单配置开关
|
||||
function switchBusinessTitleFormConfig(id: string) {
|
||||
return CDR.get({ url: `${BusinessTitleFormConfigSwitchUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取工商抬头表单字段
|
||||
function getBusinessTitleModuleForm() {
|
||||
return CDR.get<FormDesignConfigDetailParams>({ url: BusinessTitleModuleFormUrl });
|
||||
}
|
||||
|
||||
// 发票列表
|
||||
function getInvoicedList(data: ContractInvoiceTableQueryParam) {
|
||||
return CDR.post<CommonList<ContractInvoiceItem>>({ url: ContractInvoicedPageUrl, data });
|
||||
}
|
||||
|
||||
// 合同下的发票列表
|
||||
function getInvoicedInContractList(data: ContractInvoiceTableQueryParam) {
|
||||
return CDR.post<CommonList<ContractInvoiceItem>>({ url: ContractInvoicedInContractPageUrl, data });
|
||||
}
|
||||
|
||||
// 添加发票
|
||||
function addInvoiced(data: SaveContractInvoiceParams) {
|
||||
return CDR.post({ url: ContractInvoicedAddUrl, data });
|
||||
}
|
||||
|
||||
// 更新发票
|
||||
function updateInvoiced(data: UpdateContractInvoiceParams, approvalTaskId?: string) {
|
||||
return CDR.post({ url: ContractInvoicedUpdateUrl, data, params: { approvalTaskId } });
|
||||
}
|
||||
|
||||
// 发票详情
|
||||
function getInvoicedDetail(id: string, approvalTaskId?: string) {
|
||||
return CDR.get<ContractInvoiceDetail>({ url: `${ContractInvoicedDetailUrl}/${id}`, params: { approvalTaskId } });
|
||||
}
|
||||
|
||||
// 发票详情快照
|
||||
function getInvoicedDetailSnapshot(id: string, approvalTaskId?: string) {
|
||||
return CDR.get<ContractInvoiceDetail>({
|
||||
url: `${ContractInvoicedDetailSnapshotUrl}/${id}`,
|
||||
params: { approvalTaskId },
|
||||
});
|
||||
}
|
||||
|
||||
// 获取发票表单配置
|
||||
function getInvoicedFormConfig() {
|
||||
return CDR.get<FormDesignConfigDetailParams>({
|
||||
url: ContractInvoicedFormConfigUrl,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取发票表单配置快照
|
||||
function getInvoicedFormSnapshotConfig(id?: string, approvalTaskId?: string) {
|
||||
return CDR.get<FormDesignConfigDetailParams>({
|
||||
url: `${ContractInvoicedFormConfigSnapshotUrl}/${id}`,
|
||||
params: { approvalTaskId },
|
||||
});
|
||||
}
|
||||
|
||||
// 发票审批
|
||||
function approvalInvoiced(data: ApprovalContractParams) {
|
||||
return CDR.post({ url: ContractInvoicedApprovalUrl, data });
|
||||
}
|
||||
|
||||
// 发票撤回
|
||||
function revokeInvoiced(id: string) {
|
||||
return CDR.get({ url: `${ContractInvoicedRevokeUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 删除发票
|
||||
function deleteInvoiced(id: string) {
|
||||
return CDR.get({ url: `${ContractInvoicedDeleteUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 发票批量删除
|
||||
function batchDeleteInvoiced(ids: string[]) {
|
||||
return CDR.post({ url: ContractInvoicedBatchDeleteUrl, data: ids });
|
||||
}
|
||||
|
||||
// 导出全量发票
|
||||
function exportInvoicedAll(data: TableExportParams) {
|
||||
return CDR.post({ url: ContractInvoicedExportAllUrl, data });
|
||||
}
|
||||
|
||||
// 导出选中发票
|
||||
function exportInvoicedSelected(data: TableExportSelectedParams) {
|
||||
return CDR.post({ url: ContractInvoicedExportSelectedUrl, data });
|
||||
}
|
||||
|
||||
// 获取发票 tab 显隐
|
||||
function getInvoicedTab() {
|
||||
return CDR.get<CustomerTabHidden>({ url: ContractInvoicedTabUrl });
|
||||
}
|
||||
|
||||
// 添加发票视图
|
||||
function addContractInvoicedView(data: ViewParams) {
|
||||
return CDR.post({ url: AddContractInvoicedViewUrl, data });
|
||||
}
|
||||
|
||||
// 更新发票视图
|
||||
function updateContractInvoicedView(data: ViewParams) {
|
||||
return CDR.post({ url: UpdateContractInvoicedViewUrl, data });
|
||||
}
|
||||
|
||||
// 获取发票视图列表
|
||||
function getContractInvoicedViewList() {
|
||||
return CDR.get<ViewItem[]>({ url: ListContractInvoicedViewUrl });
|
||||
}
|
||||
|
||||
// 获取发票视图详情
|
||||
function getContractInvoicedViewDetail(id: string) {
|
||||
return CDR.get({ url: `${GetContractInvoicedViewDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 固定发票视图
|
||||
function fixedContractInvoicedView(id: string) {
|
||||
return CDR.get({ url: `${FixedContractInvoicedViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 启用/禁用发票视图
|
||||
function enableContractInvoicedView(id: string) {
|
||||
return CDR.get({ url: `${EnableContractInvoicedViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 删除发票视图
|
||||
function deleteContractInvoicedView(id: string) {
|
||||
return CDR.get({ url: `${DeleteContractInvoicedViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 拖拽发票视图排序
|
||||
function dragContractInvoicedView(data: TableDraggedParams) {
|
||||
return CDR.post({ url: DragContractInvoicedViewUrl, data });
|
||||
}
|
||||
|
||||
// 合同统计
|
||||
function getContractStatistic(data: TableQueryParams) {
|
||||
return CDR.post({ url: ContractStatisticUrl, data }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
// 回款记录统计
|
||||
function getPaymentRecordStatistic(data: TableQueryParams) {
|
||||
return CDR.post({ url: GetPaymentRecordStatisticUrl, data }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
// 更新合同状态配置
|
||||
function updateContractStatus(data: UpdateStageBaseParams) {
|
||||
return CDR.post({ url: UpdateContractStatusUrl, data });
|
||||
}
|
||||
|
||||
// 合同状态回退配置
|
||||
function updateContractStatusRollback(data: UpdateOpportunityStageRollbackParams) {
|
||||
return CDR.post({ url: UpdateContractStatusRollbackUrl, data });
|
||||
}
|
||||
|
||||
// 合同状态排序
|
||||
function sortContractStatus(data: string[]) {
|
||||
return CDR.post({ url: SortContractStatusUrl, data });
|
||||
}
|
||||
|
||||
// 添加合同状态
|
||||
function addContractStatus(data: StageBaseParams) {
|
||||
return CDR.post({ url: AddContractStatusUrl, data });
|
||||
}
|
||||
|
||||
// 获取合同状态配置
|
||||
function getContractStatusConfig() {
|
||||
return CDR.get<OpportunityStageConfig>({ url: GetContractStatusConfigUrl }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
// 删除合同状态
|
||||
function deleteContractStatus(id: string) {
|
||||
return CDR.get({ url: `${DeleteContractStatusUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 更新阶段
|
||||
function updateContractStage(data: { id: string; stage: string }) {
|
||||
return CDR.post({ url: UpdateContractStageUrl, data });
|
||||
}
|
||||
|
||||
// 保存高级流转配置
|
||||
function saveContractAdvanceConfig(data: SaveCirculationConfigParams) {
|
||||
return CDR.post({ url: SaveContractCirculationConfigUrl, data });
|
||||
}
|
||||
|
||||
// 切换流转配置
|
||||
function switchContractCirculationType(type: CirculationTypeEnum) {
|
||||
return CDR.get({ url: `${SwitchContractCirculationTypeUrl}/${type}` });
|
||||
}
|
||||
|
||||
return {
|
||||
exportContractAll,
|
||||
exportContractSelected,
|
||||
generateContractChart,
|
||||
getContractDetail,
|
||||
getContractDetailSnapshot,
|
||||
getContractList,
|
||||
sortContract,
|
||||
getContractTab,
|
||||
getContractViewDetail,
|
||||
getContractViewList,
|
||||
addContractView,
|
||||
updateContractView,
|
||||
fixedContractView,
|
||||
enableContractView,
|
||||
deleteContractView,
|
||||
dragContractView,
|
||||
addContract,
|
||||
updateContract,
|
||||
deleteContract,
|
||||
changeContractStatus,
|
||||
getContractFormConfig,
|
||||
getContractFormSnapshotConfig,
|
||||
batchApproveContract,
|
||||
batchUpdateContract,
|
||||
approvalContract,
|
||||
revokeContract,
|
||||
getContractStatistic,
|
||||
// 回款计划
|
||||
getPaymentPlanList,
|
||||
getContractPaymentPlanList,
|
||||
addPaymentPlan,
|
||||
updatePaymentPlan,
|
||||
deletePaymentPlan,
|
||||
getPaymentPlanDetail,
|
||||
getPaymentPlanFormConfig,
|
||||
getPaymentPlanTab,
|
||||
exportPaymentPlanAll,
|
||||
exportPaymentPlanSelected,
|
||||
generatePaymentPlanChart,
|
||||
addPaymentPlanView,
|
||||
updatePaymentPlanView,
|
||||
getPaymentPlanViewList,
|
||||
getPaymentPlanViewDetail,
|
||||
fixedPaymentPlanView,
|
||||
enablePaymentPlanView,
|
||||
deletePaymentPlanView,
|
||||
dragPaymentPlanView,
|
||||
// 回款记录
|
||||
getPaymentRecordFormConfig,
|
||||
addPaymentRecord,
|
||||
updatePaymentRecord,
|
||||
getPaymentRecordDetail,
|
||||
getPaymentRecordList,
|
||||
deletePaymentRecord,
|
||||
getPaymentRecordTab,
|
||||
exportPaymentRecordAll,
|
||||
exportPaymentRecordSelected,
|
||||
addPaymentRecordView,
|
||||
updatePaymentRecordView,
|
||||
getPaymentRecordViewList,
|
||||
getPaymentRecordViewDetail,
|
||||
fixedPaymentRecordView,
|
||||
enablePaymentRecordView,
|
||||
deletePaymentRecordView,
|
||||
dragPaymentRecordView,
|
||||
preCheckImportContractPaymentRecord,
|
||||
importContractPaymentRecord,
|
||||
downloadContractPaymentRecordTemplate,
|
||||
getPaymentRecordStatistic,
|
||||
// 合同工商抬头
|
||||
preCheckImportBusinessTitle,
|
||||
downloadBusinessTitleTemplate,
|
||||
importBusinessTitle,
|
||||
getBusinessTitleList,
|
||||
addBusinessTitle,
|
||||
updateBusinessTitle,
|
||||
deleteBusinessTitle,
|
||||
revokeBusinessTitle,
|
||||
getBusinessTitleDetail,
|
||||
getBusinessTitleInvoiceCheck,
|
||||
exportBusinessTitleAll,
|
||||
exportBusinessTitleSelected,
|
||||
getBusinessTitleThirdQuery,
|
||||
getBusinessTitleThirdQueryOption,
|
||||
getBusinessTitleConfig,
|
||||
switchBusinessTitleFormConfig,
|
||||
getBusinessTitleModuleForm,
|
||||
// 发票
|
||||
getInvoicedList,
|
||||
getInvoicedInContractList,
|
||||
addInvoiced,
|
||||
updateInvoiced,
|
||||
getInvoicedDetail,
|
||||
getInvoicedDetailSnapshot,
|
||||
getInvoicedFormConfig,
|
||||
getInvoicedFormSnapshotConfig,
|
||||
approvalInvoiced,
|
||||
revokeInvoiced,
|
||||
deleteInvoiced,
|
||||
batchDeleteInvoiced,
|
||||
exportInvoicedAll,
|
||||
exportInvoicedSelected,
|
||||
addContractInvoicedView,
|
||||
updateContractInvoicedView,
|
||||
getContractInvoicedViewList,
|
||||
getContractInvoicedViewDetail,
|
||||
fixedContractInvoicedView,
|
||||
enableContractInvoicedView,
|
||||
deleteContractInvoicedView,
|
||||
dragContractInvoicedView,
|
||||
getInvoicedTab,
|
||||
// 合同阶段
|
||||
updateContractStatus,
|
||||
updateContractStatusRollback,
|
||||
sortContractStatus,
|
||||
addContractStatus,
|
||||
getContractStatusConfig,
|
||||
deleteContractStatus,
|
||||
updateContractStage,
|
||||
saveContractAdvanceConfig,
|
||||
switchContractCirculationType,
|
||||
};
|
||||
}
|
||||
204
frontend/packages/lib-shared/api/modules/customForm.ts
Normal file
204
frontend/packages/lib-shared/api/modules/customForm.ts
Normal file
@@ -0,0 +1,204 @@
|
||||
import type { CordysAxios } from '@lib/shared/api/http/Axios';
|
||||
import {
|
||||
AddCustomFormUrl,
|
||||
GetCustomFormAdminUrl,
|
||||
GetCustomFormRoleUserDeptTreeUrl,
|
||||
GetCustomFormRoleUserRoleTreeUrl,
|
||||
GetCustomFormRoleListUrl,
|
||||
GetCustomFormRoleUsersUrl,
|
||||
GetCustomFormUrl,
|
||||
RelateCustomFormMemberUrl,
|
||||
RemoveCustomFormMemberUrl,
|
||||
SaveCustomFormAdminUrl,
|
||||
UpdateCustomFormUrl,
|
||||
GetCustomFormDataDetailUrl,
|
||||
GetCustomFormDataPageUrl,
|
||||
AddCustomFormDataUrl,
|
||||
UpdateCustomFormDataUrl,
|
||||
DeleteCustomFormDataUrl,
|
||||
BatchDeleteCustomFormDataUrl,
|
||||
BatchUpdateCustomFormDataUrl,
|
||||
GetCustomFormListUrl,
|
||||
GetCustomFormOptionsUrl,
|
||||
DeleteCustomFormUrl,
|
||||
EnableCustomFormUrl,
|
||||
DisableCustomFormUrl,
|
||||
PreCheckCustomFormImportUrl,
|
||||
DownloadCustomFormTemplateUrl,
|
||||
ImportCustomFormUrl,
|
||||
CustomFormExportAllUrl,
|
||||
CustomFormExportSelectedUrl,
|
||||
} from '@lib/shared/api/requrls/customForm';
|
||||
import type { CommonList, TableExportParams, TableExportSelectedParams } from '@lib/shared/models/common';
|
||||
import type {
|
||||
AddCustomFormDataParams,
|
||||
BatchUpdateCustomFormDataParams,
|
||||
CustomFormAdminParams,
|
||||
CustomFormDataDetail,
|
||||
CustomFormDetail,
|
||||
CustomFormItem,
|
||||
CustomFormMemberItem,
|
||||
CustomFormRoleItem,
|
||||
CustomFormRoleUserQueryParams,
|
||||
CustomFormPageItem,
|
||||
CustomFormSaveRequest,
|
||||
GetCustomFormDataPageParams,
|
||||
RelateCustomFormMemberParams,
|
||||
UpdateCustomFormDataParams,
|
||||
} from '@lib/shared/models/customForm';
|
||||
import type { SelectedUsersItem } from '@lib/shared/models/system/module';
|
||||
import type { DeptUserTreeNode } from '@lib/shared/models/system/role';
|
||||
import { ValidateInfo } from '@lib/shared/models/system/org';
|
||||
|
||||
export default function useCustomFormApi(CDR: CordysAxios) {
|
||||
function addCustomForm(data: CustomFormSaveRequest) {
|
||||
return CDR.post({ url: AddCustomFormUrl, data });
|
||||
}
|
||||
|
||||
function updateCustomForm(data: CustomFormSaveRequest) {
|
||||
return CDR.post({ url: UpdateCustomFormUrl, data });
|
||||
}
|
||||
|
||||
function getCustomFormDetail(id?: string) {
|
||||
return CDR.get<CustomFormDetail>({ url: `${GetCustomFormUrl}/${id}` });
|
||||
}
|
||||
|
||||
function getCustomFormAdmins(customFormId: string) {
|
||||
return CDR.get<SelectedUsersItem[]>({ url: `${GetCustomFormAdminUrl}/${customFormId}` });
|
||||
}
|
||||
|
||||
function saveCustomFormAdmins(data: CustomFormAdminParams) {
|
||||
return CDR.post({ url: SaveCustomFormAdminUrl, data });
|
||||
}
|
||||
|
||||
// 表单成员
|
||||
function relateCustomFormMember(data: RelateCustomFormMemberParams) {
|
||||
return CDR.post({ url: RelateCustomFormMemberUrl, data });
|
||||
}
|
||||
|
||||
function getCustomFormRoles(customFormId: string) {
|
||||
return CDR.get<CustomFormRoleItem[]>({ url: `${GetCustomFormRoleListUrl}/${customFormId}` });
|
||||
}
|
||||
|
||||
function getCustomFormRoleUsers(data: CustomFormRoleUserQueryParams) {
|
||||
return CDR.post<CommonList<CustomFormMemberItem>>({ url: GetCustomFormRoleUsersUrl, data });
|
||||
}
|
||||
|
||||
function getCustomFormRoleUserDeptTree() {
|
||||
return CDR.get<DeptUserTreeNode[]>({ url: GetCustomFormRoleUserDeptTreeUrl });
|
||||
}
|
||||
|
||||
function getCustomFormRoleUserRoleTree() {
|
||||
return CDR.get<DeptUserTreeNode[]>({ url: GetCustomFormRoleUserRoleTreeUrl });
|
||||
}
|
||||
|
||||
function removeCustomFormMember(data: RelateCustomFormMemberParams) {
|
||||
return CDR.post({ url: RemoveCustomFormMemberUrl, data });
|
||||
}
|
||||
|
||||
function deleteCustomForm(id: string) {
|
||||
return CDR.get({ url: `${DeleteCustomFormUrl}/${id}` });
|
||||
}
|
||||
|
||||
function enableCustomForm(id: string) {
|
||||
return CDR.get({ url: `${EnableCustomFormUrl}/${id}` });
|
||||
}
|
||||
|
||||
function disableCustomForm(id: string) {
|
||||
return CDR.get({ url: `${DisableCustomFormUrl}/${id}` });
|
||||
}
|
||||
|
||||
function getCustomFormList() {
|
||||
return CDR.get<CustomFormItem[]>({ url: GetCustomFormListUrl });
|
||||
}
|
||||
|
||||
function getCustomFormDataDetail(id: string) {
|
||||
return CDR.get<CustomFormDataDetail>({ url: `${GetCustomFormDataDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
function getCustomFormDataPage(data: GetCustomFormDataPageParams) {
|
||||
return CDR.post<CommonList<CustomFormPageItem>>({ url: GetCustomFormDataPageUrl, data });
|
||||
}
|
||||
|
||||
function addCustomFormData(data: AddCustomFormDataParams) {
|
||||
return CDR.post({ url: AddCustomFormDataUrl, data });
|
||||
}
|
||||
|
||||
function updateCustomFormData(data: UpdateCustomFormDataParams) {
|
||||
return CDR.post({ url: UpdateCustomFormDataUrl, data });
|
||||
}
|
||||
|
||||
function deleteCustomFormData(id: string) {
|
||||
return CDR.get({ url: `${DeleteCustomFormDataUrl}/${id}` });
|
||||
}
|
||||
|
||||
function batchDeleteCustomFormData(ids: string[]) {
|
||||
return CDR.post({ url: BatchDeleteCustomFormDataUrl, data: ids });
|
||||
}
|
||||
|
||||
function batchUpdateCustomFormData(data: BatchUpdateCustomFormDataParams) {
|
||||
return CDR.post({ url: BatchUpdateCustomFormDataUrl, data });
|
||||
}
|
||||
|
||||
function getCustomFormOptions() {
|
||||
return CDR.get<CustomFormItem[]>({ url:GetCustomFormOptionsUrl });
|
||||
}
|
||||
|
||||
function preCheckImportCustomForm(file: File, customFormId?: string) {
|
||||
return CDR.uploadFile<{ data: ValidateInfo }>({ url: PreCheckCustomFormImportUrl, params:{ customFormId } }, { fileList: [file] }, 'file');
|
||||
}
|
||||
|
||||
function downloadCustomFormTemplate(customFormId?: string) {
|
||||
return CDR.get(
|
||||
{
|
||||
url: DownloadCustomFormTemplateUrl,
|
||||
responseType: 'blob',
|
||||
params:{ customFormId },
|
||||
},
|
||||
{ isTransformResponse: false, isReturnNativeResponse: true }
|
||||
);
|
||||
}
|
||||
|
||||
function importCustomForm(file: File, customFormId?: string) {
|
||||
return CDR.uploadFile({ url: ImportCustomFormUrl, params:{ customFormId } }, { fileList: [file] }, 'file');
|
||||
}
|
||||
|
||||
function exportCustomFormAll(data: TableExportParams) {
|
||||
return CDR.post({ url: CustomFormExportAllUrl, data });
|
||||
}
|
||||
|
||||
function exportCustomFormSelected(data: TableExportSelectedParams) {
|
||||
return CDR.post({ url: CustomFormExportSelectedUrl, data });
|
||||
}
|
||||
|
||||
return {
|
||||
addCustomForm,
|
||||
updateCustomForm,
|
||||
getCustomFormDetail,
|
||||
saveCustomFormAdmins,
|
||||
getCustomFormAdmins,
|
||||
relateCustomFormMember,
|
||||
getCustomFormRoles,
|
||||
getCustomFormRoleUsers,
|
||||
getCustomFormRoleUserDeptTree,
|
||||
getCustomFormRoleUserRoleTree,
|
||||
removeCustomFormMember,
|
||||
getCustomFormList,
|
||||
getCustomFormDataDetail,
|
||||
getCustomFormDataPage,
|
||||
addCustomFormData,
|
||||
updateCustomFormData,
|
||||
deleteCustomFormData,
|
||||
batchDeleteCustomFormData,
|
||||
batchUpdateCustomFormData,
|
||||
getCustomFormOptions,
|
||||
deleteCustomForm,
|
||||
enableCustomForm,
|
||||
disableCustomForm,
|
||||
preCheckImportCustomForm,
|
||||
downloadCustomFormTemplate,
|
||||
importCustomForm,
|
||||
exportCustomFormAll,
|
||||
exportCustomFormSelected,
|
||||
};
|
||||
}
|
||||
932
frontend/packages/lib-shared/api/modules/customer.ts
Normal file
932
frontend/packages/lib-shared/api/modules/customer.ts
Normal file
@@ -0,0 +1,932 @@
|
||||
import type { CordysAxios } from '@lib/shared/api/http/Axios';
|
||||
import {
|
||||
AddAccountPoolViewUrl,
|
||||
AddContactViewUrl,
|
||||
AddCustomerCollaborationUrl,
|
||||
AddCustomerContactUrl,
|
||||
AddCustomerFollowPlanUrl,
|
||||
AddCustomerFollowRecordUrl,
|
||||
AddCustomerOpenSeaUrl,
|
||||
AddCustomerRelationItemUrl,
|
||||
AddCustomerUrl,
|
||||
AddCustomerViewUrl,
|
||||
AssignOpenSeaCustomerUrl,
|
||||
BatchAssignOpenSeaCustomerUrl,
|
||||
BatchDeleteCustomerCollaborationUrl,
|
||||
BatchDeleteCustomerUrl,
|
||||
BatchDeleteOpenSeaCustomerUrl,
|
||||
BatchMoveCustomerUrl,
|
||||
BatchPickOpenSeaCustomerUrl,
|
||||
BatchTransferCustomerUrl,
|
||||
BatchUpdateAccountUrl,
|
||||
BatchUpdateContactUrl,
|
||||
CancelCustomerFollowPlanUrl,
|
||||
CheckOpportunityContactUrl,
|
||||
ContactListUnderCustomerUrl,
|
||||
DeleteAccountPoolViewUrl,
|
||||
DeleteContactViewUrl,
|
||||
DeleteCustomerCollaborationUrl,
|
||||
DeleteCustomerContactUrl,
|
||||
DeleteCustomerFollowPlanUrl,
|
||||
DeleteCustomerFollowRecordUrl,
|
||||
DeleteCustomerOpenSeaUrl,
|
||||
DeleteCustomerRelationItemUrl,
|
||||
DeleteCustomerUrl,
|
||||
DeleteCustomerViewUrl,
|
||||
DeleteOpenSeaCustomerUrl,
|
||||
DisableCustomerContactUrl,
|
||||
DownloadAccountTemplateUrl,
|
||||
DownloadContactTemplateUrl,
|
||||
DragAccountPoolViewUrl,
|
||||
DragContactViewUrl,
|
||||
DragCustomerViewUrl,
|
||||
EnableAccountPoolViewUrl,
|
||||
EnableContactViewUrl,
|
||||
EnableCustomerContactUrl,
|
||||
EnableCustomerViewUrl,
|
||||
ExportContactAllUrl,
|
||||
ExportContactSelectedUrl,
|
||||
ExportCustomerAllUrl,
|
||||
ExportCustomerSelectedUrl,
|
||||
ExportOpenSeaCustomerAllUrl,
|
||||
ExportOpenSeaCustomerSelectedUrl,
|
||||
FixedAccountPoolViewUrl,
|
||||
FixedContactViewUrl,
|
||||
FixedCustomerViewUrl,
|
||||
GenerateCustomerChartUrl,
|
||||
generateCustomerContactChartUrl,
|
||||
generateCustomerPoolChartUrl,
|
||||
GetAccountPoolViewDetailUrl,
|
||||
GetAccountPoolViewListUrl,
|
||||
GetAdvancedCustomerContactListUrl,
|
||||
GetAdvancedCustomerListUrl,
|
||||
GetAdvancedOpenSeaCustomerListUrl,
|
||||
GetContactViewDetailUrl,
|
||||
GetContactViewListUrl,
|
||||
GetCustomerCollaborationListUrl,
|
||||
GetCustomerContactFormConfigUrl,
|
||||
GetCustomerContactListUrl,
|
||||
GetCustomerContactTabUrl,
|
||||
GetCustomerContactUrl,
|
||||
GetCustomerFollowPlanFormConfigUrl,
|
||||
GetCustomerFollowPlanListUrl,
|
||||
GetCustomerFollowPlanUrl,
|
||||
GetCustomerFollowRecordFormConfigUrl,
|
||||
GetCustomerFollowRecordListUrl,
|
||||
GetCustomerFollowRecordUrl,
|
||||
GetCustomerFormConfigUrl,
|
||||
GetCustomerHeaderListUrl,
|
||||
GetCustomerListUrl,
|
||||
GetCustomerOpenSeaFollowRecordListUrl,
|
||||
GetCustomerOpenSeaListUrl,
|
||||
GetCustomerOpportunityListUrl,
|
||||
GetCustomerOptionsUrl,
|
||||
GetCustomerRelationListUrl,
|
||||
GetCustomerTabUrl,
|
||||
GetCustomerUrl,
|
||||
GetCustomerViewDetailUrl,
|
||||
GetCustomerViewListUrl,
|
||||
GetGlobalCustomerContactListUrl,
|
||||
GetGlobalCustomerListUrl,
|
||||
GetGlobalModuleCountUrl,
|
||||
GetGlobalOpenSeaCustomerListUrl,
|
||||
GetOpenSeaCustomerListUrl,
|
||||
GetOpenSeaCustomerUrl,
|
||||
GetOpenSeaOptionsUrl,
|
||||
ImportAccountUrl,
|
||||
ImportContactUrl,
|
||||
IsCustomerOpenSeaNoPickUrl,
|
||||
MergeAccountPageUrl,
|
||||
MergeAccountUrl,
|
||||
MoveToCustomerUrl,
|
||||
PickOpenSeaCustomerUrl,
|
||||
PoolAccountBatchUpdateUrl,
|
||||
PreCheckAccountImportUrl,
|
||||
PreCheckContactImportUrl,
|
||||
SaveCustomerRelationUrl,
|
||||
SwitchCustomerOpenSeaUrl,
|
||||
UpdateAccountPoolViewUrl,
|
||||
UpdateContactViewUrl,
|
||||
UpdateCustomerCollaborationUrl,
|
||||
UpdateCustomerContactUrl,
|
||||
UpdateCustomerFollowPlanStatusUrl,
|
||||
UpdateCustomerFollowPlanUrl,
|
||||
UpdateCustomerFollowRecordUrl,
|
||||
UpdateCustomerOpenSeaUrl,
|
||||
UpdateCustomerRelationItemUrl,
|
||||
UpdateCustomerUrl,
|
||||
UpdateCustomerViewUrl,
|
||||
GetAccountContractListUrl,
|
||||
GetAccountContractStatisticUrl,
|
||||
GetAccountPaymentListUrl,
|
||||
GetAccountPaymentStatisticUrl,
|
||||
GetAccountPaymentRecordStatisticUrl,
|
||||
GetAccountPaymentRecordListUrl,
|
||||
GetAccountInvoiceListUrl,
|
||||
GetAccountInvoiceStatisticUrl,
|
||||
GetAccountOrderListUrl,
|
||||
} from '@lib/shared/api/requrls/customer';
|
||||
import type {
|
||||
ChartResponseDataItem,
|
||||
CommonList,
|
||||
GenerateChartParams,
|
||||
TableDraggedParams,
|
||||
TableExportParams,
|
||||
TableExportSelectedParams,
|
||||
TableQueryParams,
|
||||
} from '@lib/shared/models/common';
|
||||
import type {
|
||||
AddCustomerCollaborationParams,
|
||||
AddCustomerRelationItemParams,
|
||||
AssignOpenSeaCustomerParams,
|
||||
BatchAssignOpenSeaCustomerParams,
|
||||
BatchMoveToPublicPoolParams,
|
||||
BatchOperationOpenSeaCustomerParams,
|
||||
BatchUpdatePoolAccountParams,
|
||||
CollaborationItem,
|
||||
CustomerContractListItem,
|
||||
CustomerContractTableParams,
|
||||
CustomerDetail,
|
||||
CustomerFollowPlanListItem,
|
||||
CustomerFollowPlanTableParams,
|
||||
CustomerFollowRecordListItem,
|
||||
CustomerFollowRecordTableParams,
|
||||
CustomerInvoiceItem,
|
||||
CustomerInvoicePageQueryParams,
|
||||
CustomerInvoiceStatistic,
|
||||
CustomerListItem,
|
||||
CustomerOpenSeaListItem,
|
||||
CustomerOpportunityTableParams,
|
||||
CustomerOptionsItem,
|
||||
CustomerTabHidden,
|
||||
CustomerTableParams,
|
||||
FollowDetailItem,
|
||||
MergeAccountParams,
|
||||
MoveToPublicPoolParams,
|
||||
OpenSeaCustomerTableParams,
|
||||
PickOpenSeaCustomerParams,
|
||||
PoolTableExportParams,
|
||||
RelationItem,
|
||||
RelationListItem,
|
||||
SaveCustomerContractParams,
|
||||
SaveCustomerFollowPlanParams,
|
||||
SaveCustomerFollowRecordParams,
|
||||
SaveCustomerOpenSeaParams,
|
||||
SaveCustomerParams,
|
||||
TransferParams,
|
||||
UpdateCustomerCollaborationParams,
|
||||
UpdateCustomerContractParams,
|
||||
UpdateCustomerFollowPlanParams,
|
||||
UpdateCustomerFollowRecordParams,
|
||||
UpdateCustomerOpenSeaParams,
|
||||
UpdateCustomerParams,
|
||||
UpdateCustomerRelationItemParams,
|
||||
UpdateFollowPlanStatusParams,
|
||||
} from '@lib/shared/models/customer';
|
||||
import type { OrderItem } from '@lib/shared/models/order';
|
||||
import type { CluePoolItem, FormDesignConfigDetailParams, OpportunityItem } from '@lib/shared/models/system/module';
|
||||
import { ValidateInfo } from '@lib/shared/models/system/org';
|
||||
import type { ViewItem, ViewParams } from '@lib/shared/models/view';
|
||||
import type { ContractItem, PaymentPlanItem, PaymentRecordItem } from '@lib/shared/models/contract';
|
||||
export default function useProductApi(CDR: CordysAxios) {
|
||||
// 添加客户
|
||||
function addCustomer(data: SaveCustomerParams) {
|
||||
return CDR.post({ url: AddCustomerUrl, data });
|
||||
}
|
||||
|
||||
// 更新客户
|
||||
function updateCustomer(data: UpdateCustomerParams) {
|
||||
return CDR.post({ url: UpdateCustomerUrl, data });
|
||||
}
|
||||
|
||||
// 获取客户列表
|
||||
function getCustomerList(data: CustomerTableParams) {
|
||||
return CDR.post<CommonList<CustomerListItem>>({ url: GetCustomerListUrl, data });
|
||||
}
|
||||
|
||||
// 获取客户表单配置
|
||||
function getCustomerFormConfig() {
|
||||
return CDR.get<FormDesignConfigDetailParams>({ url: GetCustomerFormConfigUrl });
|
||||
}
|
||||
|
||||
// 获取客户详情
|
||||
function getCustomer(id: string, approvalTaskId?: string) {
|
||||
return CDR.get<CustomerDetail>({ url: `${GetCustomerUrl}/${id}`, params: { approvalTaskId } });
|
||||
}
|
||||
|
||||
// 删除客户
|
||||
function deleteCustomer(id: string) {
|
||||
return CDR.get({ url: `${DeleteCustomerUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 批量删除客户
|
||||
function batchDeleteCustomer(batchIds: (string | number)[]) {
|
||||
return CDR.post({ url: BatchDeleteCustomerUrl, data: batchIds });
|
||||
}
|
||||
|
||||
// 批量转移客户
|
||||
function batchTransferCustomer(data: TransferParams) {
|
||||
return CDR.post({ url: BatchTransferCustomerUrl, data });
|
||||
}
|
||||
|
||||
// 批量移入公海
|
||||
function batchMoveCustomer(data: BatchMoveToPublicPoolParams) {
|
||||
return CDR.post({ url: BatchMoveCustomerUrl, data });
|
||||
}
|
||||
|
||||
// 批量移入公海
|
||||
function moveCustomerToPool(data: MoveToPublicPoolParams) {
|
||||
return CDR.post({ url: MoveToCustomerUrl, data });
|
||||
}
|
||||
|
||||
// 批量更新公海客户
|
||||
function batchUpdateOpenSeaCustomer(data: BatchUpdatePoolAccountParams) {
|
||||
return CDR.post({ url: PoolAccountBatchUpdateUrl, data });
|
||||
}
|
||||
// 批量更新客户
|
||||
function batchUpdateAccount(data: BatchUpdatePoolAccountParams) {
|
||||
return CDR.post({ url: BatchUpdateAccountUrl, data });
|
||||
}
|
||||
|
||||
// 批量更新联系人
|
||||
function batchUpdateContact(data: BatchUpdatePoolAccountParams) {
|
||||
return CDR.post({ url: BatchUpdateContactUrl, data });
|
||||
}
|
||||
|
||||
// 生成客户图表
|
||||
function generateCustomerChart(data: GenerateChartParams) {
|
||||
return CDR.post<ChartResponseDataItem[]>({ url: GenerateCustomerChartUrl, data });
|
||||
}
|
||||
|
||||
// 添加客户跟进记录
|
||||
function addCustomerFollowRecord(data: SaveCustomerFollowRecordParams) {
|
||||
return CDR.post({ url: AddCustomerFollowRecordUrl, data });
|
||||
}
|
||||
|
||||
// 更新客户跟进记录
|
||||
function updateCustomerFollowRecord(data: UpdateCustomerFollowRecordParams) {
|
||||
return CDR.post({ url: UpdateCustomerFollowRecordUrl, data });
|
||||
}
|
||||
|
||||
// 删除客户跟进记录
|
||||
function deleteCustomerFollowRecord(id: string) {
|
||||
return CDR.get({ url: `${DeleteCustomerFollowRecordUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取客户跟进记录列表
|
||||
function getCustomerFollowRecordList(data: CustomerFollowRecordTableParams) {
|
||||
return CDR.post<CommonList<CustomerFollowRecordListItem>>({ url: GetCustomerFollowRecordListUrl, data });
|
||||
}
|
||||
|
||||
// 获取客户跟进记录表单配置
|
||||
function getCustomerFollowRecordFormConfig() {
|
||||
return CDR.get<FormDesignConfigDetailParams>({ url: GetCustomerFollowRecordFormConfigUrl });
|
||||
}
|
||||
|
||||
// 获取客户跟进记录详情
|
||||
function getCustomerFollowRecord(id: string) {
|
||||
return CDR.get<CustomerFollowRecordListItem>({ url: `${GetCustomerFollowRecordUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 添加客户跟进计划
|
||||
function addCustomerFollowPlan(data: SaveCustomerFollowPlanParams) {
|
||||
return CDR.post({ url: AddCustomerFollowPlanUrl, data });
|
||||
}
|
||||
|
||||
// 更新客户跟进计划
|
||||
function updateCustomerFollowPlan(data: UpdateCustomerFollowPlanParams) {
|
||||
return CDR.post({ url: UpdateCustomerFollowPlanUrl, data });
|
||||
}
|
||||
|
||||
// 删除客户跟进计划
|
||||
function deleteCustomerFollowPlan(id: string) {
|
||||
return CDR.get({ url: `${DeleteCustomerFollowPlanUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取客户跟进计划列表
|
||||
function getCustomerFollowPlanList(data: CustomerFollowPlanTableParams) {
|
||||
return CDR.post<CommonList<CustomerFollowPlanListItem>>({ url: GetCustomerFollowPlanListUrl, data });
|
||||
}
|
||||
|
||||
// 取消客户跟进计划
|
||||
function cancelCustomerFollowPlan(id: string) {
|
||||
return CDR.get({ url: `${CancelCustomerFollowPlanUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取客户跟进计划表单配置
|
||||
function getCustomerFollowPlanFormConfig() {
|
||||
return CDR.get<FormDesignConfigDetailParams>({ url: GetCustomerFollowPlanFormConfigUrl });
|
||||
}
|
||||
|
||||
// 获取客户跟进计划详情
|
||||
function getCustomerFollowPlan(id: string) {
|
||||
return CDR.get<FollowDetailItem>({ url: `${GetCustomerFollowPlanUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 添加客户联系人
|
||||
function addCustomerContact(data: SaveCustomerContractParams) {
|
||||
return CDR.post({ url: AddCustomerContactUrl, data });
|
||||
}
|
||||
|
||||
// 获取客户联系人列表
|
||||
function getCustomerContactList(data: CustomerContractTableParams) {
|
||||
return CDR.post<CommonList<CustomerContractListItem>>({ url: GetCustomerContactListUrl, data });
|
||||
}
|
||||
|
||||
// 更新客户联系人
|
||||
function updateCustomerContact(data: UpdateCustomerContractParams) {
|
||||
return CDR.post({ url: UpdateCustomerContactUrl, data });
|
||||
}
|
||||
|
||||
// 禁用客户联系人
|
||||
function disableCustomerContact(id: string, reason: string) {
|
||||
return CDR.post({ url: `${DisableCustomerContactUrl}/${id}`, data: { reason } });
|
||||
}
|
||||
|
||||
// 获取客户联系人表单配置
|
||||
function getCustomerContactFormConfig() {
|
||||
return CDR.get<FormDesignConfigDetailParams>({ url: GetCustomerContactFormConfigUrl });
|
||||
}
|
||||
|
||||
// 获取客户联系人详情
|
||||
function getCustomerContact(id: string) {
|
||||
return CDR.get<CustomerContractListItem>({ url: `${GetCustomerContactUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取客户的发票记录
|
||||
function getCustomerInvoiceList(data: CustomerInvoicePageQueryParams) {
|
||||
return CDR.post<CommonList<CustomerInvoiceItem>>({ url: GetAccountInvoiceListUrl, data });
|
||||
}
|
||||
|
||||
// 获取客户发票统计
|
||||
function getCustomerInvoiceStatistic(id: string) {
|
||||
return CDR.get<CustomerInvoiceStatistic[]>({ url: `${GetAccountInvoiceStatisticUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取客户的订单
|
||||
function getCustomerOrderList(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<OrderItem>>({ url: GetAccountOrderListUrl, data });
|
||||
}
|
||||
|
||||
// 启用客户联系人
|
||||
function enableCustomerContact(id: string) {
|
||||
return CDR.get({ url: `${EnableCustomerContactUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 删除客户联系人
|
||||
function deleteCustomerContact(id: string) {
|
||||
return CDR.get({ url: `${DeleteCustomerContactUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 生成客户联系人图表
|
||||
function generateCustomerContactChart(data: GenerateChartParams) {
|
||||
return CDR.post<ChartResponseDataItem[]>({ url: generateCustomerContactChartUrl, data });
|
||||
}
|
||||
|
||||
// 是否绑定商机
|
||||
function checkOpportunity(id: string) {
|
||||
return CDR.get({ url: `${CheckOpportunityContactUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 客户下的联系人列表
|
||||
function getContactListUnderCustomer(data: { id: string }) {
|
||||
return CDR.get({ url: `${ContactListUnderCustomerUrl}/${data.id}` });
|
||||
}
|
||||
|
||||
// 添加公海
|
||||
function addCustomerOpenSea(data: SaveCustomerOpenSeaParams) {
|
||||
return CDR.post({ url: AddCustomerOpenSeaUrl, data });
|
||||
}
|
||||
|
||||
// 更新公海
|
||||
function updateCustomerOpenSea(data: UpdateCustomerOpenSeaParams) {
|
||||
return CDR.post({ url: UpdateCustomerOpenSeaUrl, data });
|
||||
}
|
||||
|
||||
// 获取公海列表
|
||||
function getCustomerOpenSeaList(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<CustomerOpenSeaListItem>>({ url: GetCustomerOpenSeaListUrl, data });
|
||||
}
|
||||
|
||||
// 启用/禁用公海
|
||||
function switchCustomerOpenSea(id: string) {
|
||||
return CDR.get({ url: `${SwitchCustomerOpenSeaUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 删除公海
|
||||
function deleteCustomerOpenSea(id: string) {
|
||||
return CDR.get({ url: `${DeleteCustomerOpenSeaUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 公海是否存在未领取线索
|
||||
function isCustomerOpenSeaNoPick(id: string) {
|
||||
return CDR.get<boolean>({ url: `${IsCustomerOpenSeaNoPickUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取公海客户列表
|
||||
function getOpenSeaCustomerList(data: OpenSeaCustomerTableParams) {
|
||||
return CDR.post<CommonList<CustomerOpenSeaListItem>>({ url: GetOpenSeaCustomerListUrl, data });
|
||||
}
|
||||
|
||||
// 领取公海客户
|
||||
function pickOpenSeaCustomer(data: PickOpenSeaCustomerParams) {
|
||||
return CDR.post({ url: PickOpenSeaCustomerUrl, data });
|
||||
}
|
||||
|
||||
// 批量领取公海客户
|
||||
function batchPickOpenSeaCustomer(data: BatchOperationOpenSeaCustomerParams) {
|
||||
return CDR.post({ url: BatchPickOpenSeaCustomerUrl, data });
|
||||
}
|
||||
|
||||
// 批量删除公海客户
|
||||
function batchDeleteOpenSeaCustomer(data: BatchOperationOpenSeaCustomerParams) {
|
||||
return CDR.post({ url: BatchDeleteOpenSeaCustomerUrl, data });
|
||||
}
|
||||
|
||||
// 批量分配公海客户
|
||||
function batchAssignOpenSeaCustomer(data: BatchAssignOpenSeaCustomerParams) {
|
||||
return CDR.post({ url: BatchAssignOpenSeaCustomerUrl, data });
|
||||
}
|
||||
|
||||
// 分配公海客户
|
||||
function assignOpenSeaCustomer(data: AssignOpenSeaCustomerParams) {
|
||||
return CDR.post({ url: AssignOpenSeaCustomerUrl, data });
|
||||
}
|
||||
|
||||
// 获取公海选项
|
||||
function getOpenSeaOptions() {
|
||||
return CDR.get<CluePoolItem[]>({ url: GetOpenSeaOptionsUrl });
|
||||
}
|
||||
|
||||
// 获取公海客户详情
|
||||
function getOpenSeaCustomer(id: string) {
|
||||
return CDR.get<CustomerDetail>({ url: `${GetOpenSeaCustomerUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 删除公海客户
|
||||
function deleteOpenSeaCustomer(id: string) {
|
||||
return CDR.get({ url: `${DeleteOpenSeaCustomerUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 导出全量客户列表
|
||||
function exportCustomerOpenSeaAll(data: PoolTableExportParams) {
|
||||
return CDR.post({ url: ExportOpenSeaCustomerAllUrl, data });
|
||||
}
|
||||
|
||||
// 导出选中客户列表
|
||||
function exportCustomerOpenSeaSelected(data: TableExportSelectedParams) {
|
||||
return CDR.post({ url: ExportOpenSeaCustomerSelectedUrl, data });
|
||||
}
|
||||
|
||||
// 获取客户负责人列表
|
||||
function getCustomerHeaderList(data: CustomerContractTableParams) {
|
||||
return CDR.get({ url: `${GetCustomerHeaderListUrl}/${data.sourceId}` });
|
||||
}
|
||||
|
||||
// 保存客户关系
|
||||
function saveCustomerRelation(customerId: string, data: RelationItem[]) {
|
||||
return CDR.post({ url: `${SaveCustomerRelationUrl}/${customerId}`, data });
|
||||
}
|
||||
|
||||
// 获取客户关系列表
|
||||
function getCustomerRelationList(customerId: string) {
|
||||
return CDR.get<RelationListItem[]>({ url: `${GetCustomerRelationListUrl}/${customerId}` });
|
||||
}
|
||||
|
||||
// 获取客户协作成员列表
|
||||
function getCustomerCollaborationList({ customerId }: { customerId: string }) {
|
||||
return CDR.get<CollaborationItem[]>({ url: `${GetCustomerCollaborationListUrl}/${customerId}` });
|
||||
}
|
||||
|
||||
// 更新单条客户关系
|
||||
function updateCustomerRelationItem(customerId: string, data: UpdateCustomerRelationItemParams) {
|
||||
return CDR.post({ url: `${UpdateCustomerRelationItemUrl}/${customerId}`, data });
|
||||
}
|
||||
|
||||
// 添加单条客户关系
|
||||
function addCustomerRelationItem(customerId: string, data: AddCustomerRelationItemParams) {
|
||||
return CDR.post({ url: `${AddCustomerRelationItemUrl}/${customerId}`, data });
|
||||
}
|
||||
|
||||
// 删除单条客户关系
|
||||
function deleteCustomerRelationItem(id: string) {
|
||||
return CDR.get({ url: `${DeleteCustomerRelationItemUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 批量删除客户协作成员
|
||||
function batchDeleteCustomerCollaboration(data: string[]) {
|
||||
return CDR.post({ url: BatchDeleteCustomerCollaborationUrl, data });
|
||||
}
|
||||
|
||||
// 更新客户协作成员
|
||||
function updateCustomerCollaboration(data: UpdateCustomerCollaborationParams) {
|
||||
return CDR.post({ url: UpdateCustomerCollaborationUrl, data });
|
||||
}
|
||||
|
||||
// 添加客户协作成员
|
||||
function addCustomerCollaboration(data: AddCustomerCollaborationParams) {
|
||||
return CDR.post({ url: AddCustomerCollaborationUrl, data });
|
||||
}
|
||||
|
||||
// 删除客户协作成员
|
||||
function deleteCustomerCollaboration(id: string) {
|
||||
return CDR.get({ url: `${DeleteCustomerCollaborationUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取客户选项列表
|
||||
function getCustomerOptions(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<CustomerOptionsItem>>({ url: GetCustomerOptionsUrl, data });
|
||||
}
|
||||
|
||||
// 获取客户公海跟进记录列表
|
||||
function getCustomerOpenSeaFollowRecordList(data: CustomerFollowRecordTableParams) {
|
||||
return CDR.post<CommonList<CustomerFollowRecordListItem>>({ url: GetCustomerOpenSeaFollowRecordListUrl, data });
|
||||
}
|
||||
|
||||
// 生成客户公海图表
|
||||
function generateCustomerPoolChart(data: GenerateChartParams) {
|
||||
return CDR.post<ChartResponseDataItem[]>({ url: generateCustomerPoolChartUrl, data });
|
||||
}
|
||||
|
||||
// 获取客户tab显隐藏
|
||||
function getCustomerTab() {
|
||||
return CDR.get<CustomerTabHidden>({ url: GetCustomerTabUrl });
|
||||
}
|
||||
|
||||
// 获取客户联系人tab显隐藏
|
||||
function getCustomerContactTab() {
|
||||
return CDR.get<CustomerTabHidden>({ url: GetCustomerContactTabUrl });
|
||||
}
|
||||
|
||||
// 更新客户跟进计划状态
|
||||
function updateCustomerFollowPlanStatus(data: UpdateFollowPlanStatusParams) {
|
||||
return CDR.post({ url: UpdateCustomerFollowPlanStatusUrl, data });
|
||||
}
|
||||
|
||||
// 获取客户商机列表
|
||||
function getCustomerOpportunityPage(data: CustomerOpportunityTableParams) {
|
||||
return CDR.post<CommonList<OpportunityItem>>({ url: GetCustomerOpportunityListUrl, data });
|
||||
}
|
||||
|
||||
// 导出全量客户列表
|
||||
function exportCustomerAll(data: TableExportParams) {
|
||||
return CDR.post({ url: ExportCustomerAllUrl, data });
|
||||
}
|
||||
|
||||
// 导出选中客户列表
|
||||
function exportCustomerSelected(data: TableExportSelectedParams) {
|
||||
return CDR.post({ url: ExportCustomerSelectedUrl, data });
|
||||
}
|
||||
|
||||
// 导出全量联系人列表
|
||||
function exportContactAll(data: TableExportParams) {
|
||||
return CDR.post({ url: ExportContactAllUrl, data });
|
||||
}
|
||||
|
||||
// 导出选中联系人列表
|
||||
function exportContactSelected(data: TableExportSelectedParams) {
|
||||
return CDR.post({ url: ExportContactSelectedUrl, data });
|
||||
}
|
||||
|
||||
// 视图
|
||||
function addCustomerView(data: ViewParams) {
|
||||
return CDR.post({ url: AddCustomerViewUrl, data });
|
||||
}
|
||||
|
||||
function updateCustomerView(data: ViewParams) {
|
||||
return CDR.post({ url: UpdateCustomerViewUrl, data });
|
||||
}
|
||||
|
||||
function getCustomerViewList() {
|
||||
return CDR.get<ViewItem[]>({ url: GetCustomerViewListUrl });
|
||||
}
|
||||
|
||||
function getCustomerViewDetail(id: string) {
|
||||
return CDR.get({ url: `${GetCustomerViewDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
function fixedCustomerView(id: string) {
|
||||
return CDR.get({ url: `${FixedCustomerViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function enableCustomerView(id: string) {
|
||||
return CDR.get({ url: `${EnableCustomerViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function deleteCustomerView(id: string) {
|
||||
return CDR.get({ url: `${DeleteCustomerViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function dragCustomerView(data: TableDraggedParams) {
|
||||
return CDR.post({ url: DragCustomerViewUrl, data });
|
||||
}
|
||||
|
||||
function addContactView(data: ViewParams) {
|
||||
return CDR.post({ url: AddContactViewUrl, data });
|
||||
}
|
||||
|
||||
function updateContactView(data: ViewParams) {
|
||||
return CDR.post({ url: UpdateContactViewUrl, data });
|
||||
}
|
||||
|
||||
function getContactViewList() {
|
||||
return CDR.get<ViewItem[]>({ url: GetContactViewListUrl });
|
||||
}
|
||||
|
||||
function getContactViewDetail(id: string) {
|
||||
return CDR.get({ url: `${GetContactViewDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
function fixedContactView(id: string) {
|
||||
return CDR.get({ url: `${FixedContactViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function enableContactView(id: string) {
|
||||
return CDR.get({ url: `${EnableContactViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function deleteContactView(id: string) {
|
||||
return CDR.get({ url: `${DeleteContactViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function dragContactView(data: TableDraggedParams) {
|
||||
return CDR.post({ url: DragContactViewUrl, data });
|
||||
}
|
||||
|
||||
function geAdvancedCustomerList(data: CustomerTableParams) {
|
||||
return CDR.post<CommonList<CustomerListItem>>(
|
||||
{ url: GetAdvancedCustomerListUrl, data },
|
||||
{ ignoreCancelToken: true }
|
||||
);
|
||||
}
|
||||
|
||||
function getAdvancedOpenSeaCustomerList(data: OpenSeaCustomerTableParams) {
|
||||
return CDR.post<CommonList<CustomerOpenSeaListItem>>(
|
||||
{ url: GetAdvancedOpenSeaCustomerListUrl, data },
|
||||
{ ignoreCancelToken: true }
|
||||
);
|
||||
}
|
||||
|
||||
function getAdvancedCustomerContactList(data: CustomerContractTableParams) {
|
||||
return CDR.post<CommonList<CustomerContractListItem>>(
|
||||
{ url: GetAdvancedCustomerContactListUrl, data },
|
||||
{ ignoreCancelToken: true }
|
||||
);
|
||||
}
|
||||
|
||||
function getGlobalCustomerList(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<CustomerListItem>>({ url: GetGlobalCustomerListUrl, data }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
function getGlobalOpenSeaCustomerList(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<CustomerOpenSeaListItem>>(
|
||||
{ url: GetGlobalOpenSeaCustomerListUrl, data },
|
||||
{ ignoreCancelToken: true }
|
||||
);
|
||||
}
|
||||
|
||||
function getGlobalCustomerContactList(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<CustomerContractListItem>>(
|
||||
{ url: GetGlobalCustomerContactListUrl, data },
|
||||
{ ignoreCancelToken: true }
|
||||
);
|
||||
}
|
||||
|
||||
function getGlobalModuleCount(keyword: string) {
|
||||
return CDR.post<{ key: string; count: number }[]>(
|
||||
{ url: `${GetGlobalModuleCountUrl}?keyword=${keyword}` },
|
||||
{ ignoreCancelToken: true }
|
||||
);
|
||||
}
|
||||
|
||||
// 客户导入
|
||||
function preCheckImportAccount(file: File) {
|
||||
return CDR.uploadFile<{ data: ValidateInfo }>({ url: PreCheckAccountImportUrl }, { fileList: [file] }, 'file');
|
||||
}
|
||||
|
||||
function downloadAccountTemplate() {
|
||||
return CDR.get(
|
||||
{
|
||||
url: DownloadAccountTemplateUrl,
|
||||
responseType: 'blob',
|
||||
},
|
||||
{ isTransformResponse: false, isReturnNativeResponse: true }
|
||||
);
|
||||
}
|
||||
|
||||
function importAccount(file: File) {
|
||||
return CDR.uploadFile({ url: ImportAccountUrl }, { fileList: [file] }, 'file');
|
||||
}
|
||||
|
||||
// 联系人导入
|
||||
function preCheckImportContact(file: File) {
|
||||
return CDR.uploadFile<{ data: ValidateInfo }>({ url: PreCheckContactImportUrl }, { fileList: [file] }, 'file');
|
||||
}
|
||||
|
||||
function downloadContactTemplate() {
|
||||
return CDR.get(
|
||||
{
|
||||
url: DownloadContactTemplateUrl,
|
||||
responseType: 'blob',
|
||||
},
|
||||
{ isTransformResponse: false, isReturnNativeResponse: true }
|
||||
);
|
||||
}
|
||||
|
||||
function importContact(file: File) {
|
||||
return CDR.uploadFile({ url: ImportContactUrl }, { fileList: [file] }, 'file');
|
||||
}
|
||||
|
||||
// 公海视图
|
||||
function addAccountPoolView(data: ViewParams) {
|
||||
return CDR.post({ url: AddAccountPoolViewUrl, data });
|
||||
}
|
||||
|
||||
function updateAccountPoolView(data: ViewParams) {
|
||||
return CDR.post({ url: UpdateAccountPoolViewUrl, data });
|
||||
}
|
||||
|
||||
function getAccountPoolViewList() {
|
||||
return CDR.get<ViewItem[]>({ url: GetAccountPoolViewListUrl });
|
||||
}
|
||||
|
||||
function getAccountPoolViewDetail(id: string) {
|
||||
return CDR.get({ url: `${GetAccountPoolViewDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
function fixedAccountPoolView(id: string) {
|
||||
return CDR.get({ url: `${FixedAccountPoolViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function enableAccountPoolView(id: string) {
|
||||
return CDR.get({ url: `${EnableAccountPoolViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function deleteAccountPoolView(id: string) {
|
||||
return CDR.get({ url: `${DeleteAccountPoolViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function dragAccountPoolView(data: TableDraggedParams) {
|
||||
return CDR.post({ url: DragAccountPoolViewUrl, data });
|
||||
}
|
||||
|
||||
function mergeAccount(data: MergeAccountParams) {
|
||||
return CDR.post({ url: MergeAccountUrl, data });
|
||||
}
|
||||
|
||||
function mergeAccountPage(data: TableQueryParams) {
|
||||
return CDR.post({ url: MergeAccountPageUrl, data });
|
||||
}
|
||||
|
||||
function getAccountContract(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<ContractItem>>({ url: GetAccountContractListUrl, data });
|
||||
}
|
||||
|
||||
function getAccountContractStatistic(id: string) {
|
||||
return CDR.get({ url: `${GetAccountContractStatisticUrl}/${id}` });
|
||||
}
|
||||
|
||||
function getAccountPayment(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<PaymentPlanItem>>({ url: GetAccountPaymentListUrl, data });
|
||||
}
|
||||
|
||||
function getAccountPaymentStatistic(id: string) {
|
||||
return CDR.get({ url: `${GetAccountPaymentStatisticUrl}/${id}` });
|
||||
}
|
||||
|
||||
function getAccountPaymentRecord(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<PaymentRecordItem>>({ url: GetAccountPaymentRecordListUrl, data });
|
||||
}
|
||||
|
||||
function getAccountPaymentRecordStatistic(id: string) {
|
||||
return CDR.get({ url: `${GetAccountPaymentRecordStatisticUrl}/${id}` });
|
||||
}
|
||||
|
||||
return {
|
||||
addCustomer,
|
||||
updateCustomer,
|
||||
getCustomerList,
|
||||
getCustomerContactTab,
|
||||
getCustomerFormConfig,
|
||||
getCustomer,
|
||||
deleteCustomer,
|
||||
getGlobalCustomerList,
|
||||
getGlobalOpenSeaCustomerList,
|
||||
getGlobalCustomerContactList,
|
||||
getGlobalModuleCount,
|
||||
batchDeleteCustomer,
|
||||
batchTransferCustomer,
|
||||
batchMoveCustomer,
|
||||
addCustomerFollowRecord,
|
||||
updateCustomerFollowRecord,
|
||||
deleteCustomerFollowRecord,
|
||||
getCustomerFollowRecordList,
|
||||
getCustomerFollowRecordFormConfig,
|
||||
getCustomerFollowRecord,
|
||||
addCustomerFollowPlan,
|
||||
updateCustomerFollowPlan,
|
||||
deleteCustomerFollowPlan,
|
||||
getCustomerFollowPlanList,
|
||||
cancelCustomerFollowPlan,
|
||||
getCustomerFollowPlanFormConfig,
|
||||
getCustomerFollowPlan,
|
||||
addCustomerContact,
|
||||
getCustomerContactList,
|
||||
updateCustomerContact,
|
||||
disableCustomerContact,
|
||||
getCustomerContactFormConfig,
|
||||
getCustomerContact,
|
||||
enableCustomerContact,
|
||||
deleteCustomerContact,
|
||||
checkOpportunity,
|
||||
getContactListUnderCustomer,
|
||||
addCustomerOpenSea,
|
||||
updateCustomerOpenSea,
|
||||
getCustomerOpenSeaList,
|
||||
switchCustomerOpenSea,
|
||||
deleteCustomerOpenSea,
|
||||
isCustomerOpenSeaNoPick,
|
||||
getOpenSeaCustomerList,
|
||||
getCustomerOpportunityPage,
|
||||
pickOpenSeaCustomer,
|
||||
batchPickOpenSeaCustomer,
|
||||
batchDeleteOpenSeaCustomer,
|
||||
batchAssignOpenSeaCustomer,
|
||||
assignOpenSeaCustomer,
|
||||
getOpenSeaOptions,
|
||||
getOpenSeaCustomer,
|
||||
deleteOpenSeaCustomer,
|
||||
getCustomerHeaderList,
|
||||
saveCustomerRelation,
|
||||
getCustomerRelationList,
|
||||
getCustomerCollaborationList,
|
||||
batchDeleteCustomerCollaboration,
|
||||
updateCustomerCollaboration,
|
||||
addCustomerCollaboration,
|
||||
deleteCustomerCollaboration,
|
||||
getCustomerOptions,
|
||||
getCustomerOpenSeaFollowRecordList,
|
||||
updateCustomerRelationItem,
|
||||
addCustomerRelationItem,
|
||||
deleteCustomerRelationItem,
|
||||
getCustomerTab,
|
||||
updateCustomerFollowPlanStatus,
|
||||
exportCustomerAll,
|
||||
exportContactAll,
|
||||
exportContactSelected,
|
||||
exportCustomerSelected,
|
||||
moveCustomerToPool,
|
||||
addCustomerView,
|
||||
deleteCustomerView,
|
||||
fixedCustomerView,
|
||||
getCustomerViewDetail,
|
||||
getCustomerViewList,
|
||||
updateCustomerView,
|
||||
enableCustomerView,
|
||||
dragCustomerView,
|
||||
addContactView,
|
||||
deleteContactView,
|
||||
fixedContactView,
|
||||
getContactViewDetail,
|
||||
getContactViewList,
|
||||
updateContactView,
|
||||
enableContactView,
|
||||
dragContactView,
|
||||
geAdvancedCustomerList,
|
||||
getAdvancedOpenSeaCustomerList,
|
||||
getAdvancedCustomerContactList,
|
||||
exportCustomerOpenSeaAll,
|
||||
exportCustomerOpenSeaSelected,
|
||||
preCheckImportAccount,
|
||||
downloadAccountTemplate,
|
||||
importAccount,
|
||||
preCheckImportContact,
|
||||
downloadContactTemplate,
|
||||
importContact,
|
||||
batchUpdateOpenSeaCustomer,
|
||||
addAccountPoolView,
|
||||
deleteAccountPoolView,
|
||||
fixedAccountPoolView,
|
||||
getAccountPoolViewDetail,
|
||||
getAccountPoolViewList,
|
||||
updateAccountPoolView,
|
||||
enableAccountPoolView,
|
||||
dragAccountPoolView,
|
||||
batchUpdateAccount,
|
||||
batchUpdateContact,
|
||||
mergeAccount,
|
||||
mergeAccountPage,
|
||||
generateCustomerChart,
|
||||
generateCustomerPoolChart,
|
||||
generateCustomerContactChart,
|
||||
getAccountContract,
|
||||
getAccountContractStatistic,
|
||||
getAccountPayment,
|
||||
getAccountPaymentStatistic,
|
||||
getAccountPaymentRecord,
|
||||
getAccountPaymentRecordStatistic,
|
||||
getCustomerInvoiceList,
|
||||
getCustomerOrderList,
|
||||
getCustomerInvoiceStatistic,
|
||||
};
|
||||
}
|
||||
133
frontend/packages/lib-shared/api/modules/dashboard.ts
Normal file
133
frontend/packages/lib-shared/api/modules/dashboard.ts
Normal file
@@ -0,0 +1,133 @@
|
||||
import type { CommonList, TableQueryParams } from '../../models/common';
|
||||
import type {
|
||||
DashboardAddModuleParams,
|
||||
DashboardAddParams,
|
||||
DashboardDetail,
|
||||
DashboardDragParams,
|
||||
DashboardModuleDragParams,
|
||||
DashboardModuleRenameParams,
|
||||
DashboardRenameParams,
|
||||
DashboardTableItem,
|
||||
DashboardTableQueryParams,
|
||||
DashboardUpdateParams,
|
||||
} from '../../models/dashboard';
|
||||
import {
|
||||
dashboardAddUrl,
|
||||
dashboardCollectPageUrl,
|
||||
dashboardCollectUrl,
|
||||
dashboardDeleteUrl,
|
||||
dashboardDetailUrl,
|
||||
dashboardDragUrl,
|
||||
dashboardModuleAddUrl,
|
||||
dashboardModuleCountUrl,
|
||||
dashboardModuleDeleteUrl,
|
||||
dashboardModuleDragUrl,
|
||||
dashboardModuleRenameUrl,
|
||||
dashboardModuleTreeUrl,
|
||||
dashboardPageUrl,
|
||||
dashboardRenameUrl,
|
||||
dashboardUnCollectUrl,
|
||||
dashboardUpdateUrl,
|
||||
} from '../requrls/dashboard';
|
||||
import type { CordysAxios } from '@lib/shared/api/http/Axios';
|
||||
|
||||
export default function useDashboardApi(CDR: CordysAxios) {
|
||||
// 重命名仪表板模块
|
||||
function dashboardModuleRename(data: DashboardModuleRenameParams) {
|
||||
return CDR.post({ url: dashboardModuleRenameUrl, data });
|
||||
}
|
||||
|
||||
// 删除仪表板模块
|
||||
function dashboardModuleDelete(ids: string[]) {
|
||||
return CDR.post({ url: dashboardModuleDeleteUrl, data: ids });
|
||||
}
|
||||
|
||||
// 添加仪表板模块
|
||||
function dashboardModuleAdd(data: DashboardAddModuleParams) {
|
||||
return CDR.post({ url: dashboardModuleAddUrl, data });
|
||||
}
|
||||
|
||||
// 更新仪表板
|
||||
function dashboardUpdate(data: DashboardUpdateParams) {
|
||||
return CDR.post({ url: dashboardUpdateUrl, data });
|
||||
}
|
||||
|
||||
// 重命名仪表板
|
||||
function dashboardRename(data: DashboardRenameParams) {
|
||||
return CDR.post({ url: dashboardRenameUrl, data });
|
||||
}
|
||||
|
||||
// 添加仪表板
|
||||
function dashboardAdd(data: DashboardAddParams) {
|
||||
return CDR.post({ url: dashboardAddUrl, data });
|
||||
}
|
||||
|
||||
// 获取仪表板详情
|
||||
function dashboardDetail(id: string) {
|
||||
return CDR.get<DashboardDetail>({ url: `${dashboardDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 删除仪表板
|
||||
function dashboardDelete(id: string) {
|
||||
return CDR.get({ url: `${dashboardDeleteUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取仪表板模块树
|
||||
function dashboardModuleTree() {
|
||||
return CDR.get({ url: dashboardModuleTreeUrl });
|
||||
}
|
||||
|
||||
// 获取仪表板模块数量
|
||||
function dashboardModuleCount() {
|
||||
return CDR.get({ url: dashboardModuleCountUrl });
|
||||
}
|
||||
|
||||
// 仪表板拖拽
|
||||
function dashboardDrag(data: DashboardDragParams) {
|
||||
return CDR.post({ url: dashboardDragUrl, data });
|
||||
}
|
||||
|
||||
// 仪表板模块拖拽
|
||||
function dashboardModuleDrag(data: DashboardModuleDragParams) {
|
||||
return CDR.post({ url: dashboardModuleDragUrl, data });
|
||||
}
|
||||
|
||||
// 获取仪表板列表
|
||||
function dashboardPage(data: DashboardTableQueryParams) {
|
||||
return CDR.post<CommonList<DashboardTableItem>>({ url: dashboardPageUrl, data });
|
||||
}
|
||||
|
||||
// 获取仪表板收藏列表
|
||||
function dashboardCollectPage(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<DashboardTableItem>>({ url: dashboardCollectPageUrl, data });
|
||||
}
|
||||
|
||||
// 收藏仪表板
|
||||
function dashboardCollect(id: string) {
|
||||
return CDR.get({ url: `${dashboardCollectUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 取消收藏仪表板
|
||||
function dashboardUnCollect(id: string) {
|
||||
return CDR.get({ url: `${dashboardUnCollectUrl}/${id}` });
|
||||
}
|
||||
|
||||
return {
|
||||
dashboardModuleRename,
|
||||
dashboardModuleDelete,
|
||||
dashboardModuleAdd,
|
||||
dashboardUpdate,
|
||||
dashboardRename,
|
||||
dashboardAdd,
|
||||
dashboardDetail,
|
||||
dashboardDelete,
|
||||
dashboardModuleTree,
|
||||
dashboardPage,
|
||||
dashboardCollectPage,
|
||||
dashboardCollect,
|
||||
dashboardUnCollect,
|
||||
dashboardModuleCount,
|
||||
dashboardModuleDrag,
|
||||
dashboardDrag,
|
||||
};
|
||||
}
|
||||
199
frontend/packages/lib-shared/api/modules/follow.ts
Normal file
199
frontend/packages/lib-shared/api/modules/follow.ts
Normal file
@@ -0,0 +1,199 @@
|
||||
import type { CordysAxios } from '@lib/shared/api/http/Axios';
|
||||
import {
|
||||
AddFollowPlanViewUrl,
|
||||
AddFollowRecordViewUrl,
|
||||
DeleteFollowPlanUrl,
|
||||
DeleteFollowPlanViewUrl,
|
||||
DeleteFollowRecordUrl,
|
||||
DeleteFollowRecordViewUrl,
|
||||
DragFollowPlanViewUrl,
|
||||
DragFollowRecordViewUrl,
|
||||
EnableFollowPlanViewUrl,
|
||||
EnableFollowRecordViewUrl,
|
||||
FixedFollowPlanViewUrl,
|
||||
FixedFollowRecordViewUrl,
|
||||
GetFollowPlanPageUrl,
|
||||
GetFollowPlanTabUrl,
|
||||
GetFollowPlanUrl,
|
||||
GetFollowPlanViewDetailUrl,
|
||||
GetFollowPlanViewListUrl,
|
||||
GetFollowRecordPageUrl,
|
||||
GetFollowRecordTabUrl,
|
||||
GetFollowRecordUrl,
|
||||
GetFollowRecordViewDetailUrl,
|
||||
GetFollowRecordViewListUrl,
|
||||
UpdateFollowPlanStatusUrl,
|
||||
UpdateFollowPlanUrl,
|
||||
UpdateFollowPlanViewUrl,
|
||||
UpdateFollowRecordUrl,
|
||||
AddFollowRecordUrl,
|
||||
AddFollowPlanUrl,
|
||||
UpdateFollowRecordViewUrl,
|
||||
} from '@lib/shared/api/requrls/follow';
|
||||
import type { CommonList, TableDraggedParams } from '@lib/shared/models/common';
|
||||
import type {
|
||||
CustomerFollowRecordTableParams,
|
||||
CustomerTabHidden,
|
||||
FollowDetailItem,
|
||||
UpdateCustomerFollowRecordParams,
|
||||
UpdateFollowPlanStatusParams,
|
||||
} from '@lib/shared/models/customer';
|
||||
import type { ViewItem, ViewParams } from '@lib/shared/models/view';
|
||||
|
||||
export default function useFollowApi(CDR: CordysAxios) {
|
||||
// 跟进记录列表
|
||||
function getFollowRecordPage(data: CustomerFollowRecordTableParams) {
|
||||
return CDR.post<CommonList<FollowDetailItem>>({ url: GetFollowRecordPageUrl, data });
|
||||
}
|
||||
|
||||
// 跟进记录详情
|
||||
function getFollowRecordDetail(id: string) {
|
||||
return CDR.get<FollowDetailItem>({ url: `${GetFollowRecordUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取tab显隐藏
|
||||
function getFollowRecordTab() {
|
||||
return CDR.get<CustomerTabHidden>({ url: GetFollowRecordTabUrl });
|
||||
}
|
||||
|
||||
function deleteFollowRecord(id: string) {
|
||||
return CDR.get({ url: `${DeleteFollowRecordUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 跟进计划列表
|
||||
function getFollowPLanPage(data: CustomerFollowRecordTableParams) {
|
||||
return CDR.post<CommonList<FollowDetailItem>>({ url: GetFollowPlanPageUrl, data });
|
||||
}
|
||||
|
||||
// 跟进记录详情
|
||||
function getFollowPlanDetail(id: string) {
|
||||
return CDR.get<FollowDetailItem>({ url: `${GetFollowPlanUrl}/${id}` });
|
||||
}
|
||||
|
||||
function updateFollowRecord(data: UpdateCustomerFollowRecordParams) {
|
||||
return CDR.post({ url: UpdateFollowRecordUrl, data });
|
||||
}
|
||||
|
||||
function addFollowRecord(data: UpdateCustomerFollowRecordParams) {
|
||||
return CDR.post({ url: AddFollowRecordUrl, data });
|
||||
}
|
||||
|
||||
// 获取tab显隐藏
|
||||
function getFollowPlanTab() {
|
||||
return CDR.get<CustomerTabHidden>({ url: GetFollowPlanTabUrl });
|
||||
}
|
||||
|
||||
function deleteFollowPlan(id: string) {
|
||||
return CDR.get({ url: `${DeleteFollowPlanUrl}/${id}` });
|
||||
}
|
||||
|
||||
function updateFollowPlanStatus(data: UpdateFollowPlanStatusParams) {
|
||||
return CDR.post({ url: UpdateFollowPlanStatusUrl, data });
|
||||
}
|
||||
|
||||
function updateFollowPlan(data: UpdateCustomerFollowRecordParams) {
|
||||
return CDR.post({ url: UpdateFollowPlanUrl, data });
|
||||
}
|
||||
|
||||
function addFollowPlan(data: UpdateCustomerFollowRecordParams) {
|
||||
return CDR.post({ url: AddFollowPlanUrl, data });
|
||||
}
|
||||
|
||||
// 视图
|
||||
function addFollowRecordView(data: ViewParams) {
|
||||
return CDR.post({ url: AddFollowRecordViewUrl, data });
|
||||
}
|
||||
|
||||
function updateFollowRecordView(data: ViewParams) {
|
||||
return CDR.post({ url: UpdateFollowRecordViewUrl, data });
|
||||
}
|
||||
|
||||
function getFollowRecordViewList() {
|
||||
return CDR.get<ViewItem[]>({ url: GetFollowRecordViewListUrl });
|
||||
}
|
||||
|
||||
function getFollowRecordViewDetail(id: string) {
|
||||
return CDR.get({ url: `${GetFollowRecordViewDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
function fixedFollowRecordView(id: string) {
|
||||
return CDR.get({ url: `${FixedFollowRecordViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function enableFollowRecordView(id: string) {
|
||||
return CDR.get({ url: `${EnableFollowRecordViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function deleteFollowRecordView(id: string) {
|
||||
return CDR.get({ url: `${DeleteFollowRecordViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function dragFollowRecordView(data: TableDraggedParams) {
|
||||
return CDR.post({ url: DragFollowRecordViewUrl, data });
|
||||
}
|
||||
|
||||
// 跟进计划视图
|
||||
function addFollowPlanView(data: ViewParams) {
|
||||
return CDR.post({ url: AddFollowPlanViewUrl, data });
|
||||
}
|
||||
|
||||
function updateFollowPlanView(data: ViewParams) {
|
||||
return CDR.post({ url: UpdateFollowPlanViewUrl, data });
|
||||
}
|
||||
|
||||
function getFollowPlanViewList() {
|
||||
return CDR.get<ViewItem[]>({ url: GetFollowPlanViewListUrl });
|
||||
}
|
||||
|
||||
function getFollowPlanViewDetail(id: string) {
|
||||
return CDR.get({ url: `${GetFollowPlanViewDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
function fixedFollowPlanView(id: string) {
|
||||
return CDR.get({ url: `${FixedFollowPlanViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function enableFollowPlanView(id: string) {
|
||||
return CDR.get({ url: `${EnableFollowPlanViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function deleteFollowPlanView(id: string) {
|
||||
return CDR.get({ url: `${DeleteFollowPlanViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function dragFollowPlanView(data: TableDraggedParams) {
|
||||
return CDR.post({ url: DragFollowPlanViewUrl, data });
|
||||
}
|
||||
|
||||
return {
|
||||
getFollowPlanDetail,
|
||||
getFollowPLanPage,
|
||||
getFollowRecordDetail,
|
||||
getFollowRecordPage,
|
||||
deleteFollowRecord,
|
||||
getFollowRecordTab,
|
||||
getFollowPlanTab,
|
||||
deleteFollowPlan,
|
||||
updateFollowPlanStatus,
|
||||
updateFollowPlan,
|
||||
updateFollowRecord,
|
||||
addFollowRecord,
|
||||
addFollowPlan,
|
||||
addFollowRecordView,
|
||||
updateFollowRecordView,
|
||||
getFollowRecordViewList,
|
||||
getFollowRecordViewDetail,
|
||||
fixedFollowRecordView,
|
||||
enableFollowRecordView,
|
||||
deleteFollowRecordView,
|
||||
dragFollowRecordView,
|
||||
addFollowPlanView,
|
||||
updateFollowPlanView,
|
||||
getFollowPlanViewList,
|
||||
getFollowPlanViewDetail,
|
||||
fixedFollowPlanView,
|
||||
enableFollowPlanView,
|
||||
deleteFollowPlanView,
|
||||
dragFollowPlanView,
|
||||
};
|
||||
}
|
||||
37
frontend/packages/lib-shared/api/modules/home.ts
Normal file
37
frontend/packages/lib-shared/api/modules/home.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { FollowOptStatisticDetail, GetHomeStatisticParams, HomeLeadStatisticDetail, HomeWinOrderDetail } from '../../models/home';
|
||||
import { HomeDepartmentTree, HomeFollowOpportunity, HomeLeadStatistic, HomeSuccessOpportunity, HomeOpportunityUnderwayUrl } from '../requrls/home';
|
||||
import { CrmTreeNodeData } from '@cordys/web/src/components/pure/crm-tree/type';
|
||||
import type { CordysAxios } from '@lib/shared/api/http/Axios';
|
||||
|
||||
export default function useHomeApi(CDR: CordysAxios) {
|
||||
// 用户部门权限树
|
||||
function getHomeDepartmentTree() {
|
||||
return CDR.get<CrmTreeNodeData[]>({ url: HomeDepartmentTree });
|
||||
}
|
||||
|
||||
// 跟进商机统计
|
||||
function getHomeFollowOpportunity(data: GetHomeStatisticParams) {
|
||||
return CDR.post<FollowOptStatisticDetail>({ url: HomeFollowOpportunity, data });
|
||||
}
|
||||
|
||||
// 线索统计
|
||||
function getHomeLeadStatistic(data: GetHomeStatisticParams) {
|
||||
return CDR.post<HomeLeadStatisticDetail>({ url: HomeLeadStatistic, data });
|
||||
}
|
||||
|
||||
function getHomeSuccessOptStatistic(data: GetHomeStatisticParams) {
|
||||
return CDR.post<HomeWinOrderDetail>({ url: HomeSuccessOpportunity, data });
|
||||
}
|
||||
|
||||
function getHomeOpportunityUnderwayStatistic(data: GetHomeStatisticParams) {
|
||||
return CDR.post<HomeWinOrderDetail>({ url: HomeOpportunityUnderwayUrl, data });
|
||||
}
|
||||
|
||||
return {
|
||||
getHomeDepartmentTree,
|
||||
getHomeFollowOpportunity,
|
||||
getHomeLeadStatistic,
|
||||
getHomeSuccessOptStatistic,
|
||||
getHomeOpportunityUnderwayStatistic,
|
||||
};
|
||||
}
|
||||
551
frontend/packages/lib-shared/api/modules/opportunity.ts
Normal file
551
frontend/packages/lib-shared/api/modules/opportunity.ts
Normal file
@@ -0,0 +1,551 @@
|
||||
import type { CordysAxios } from '@lib/shared/api/http/Axios';
|
||||
import {
|
||||
AddBusinessViewUrl,
|
||||
AddOpportunityStageUrl,
|
||||
AddOptFollowPlanUrl,
|
||||
AddOptFollowRecordUrl,
|
||||
AddQuotationUrl,
|
||||
AddQuotationViewUrl,
|
||||
AdvancedSearchOptDetailUrl,
|
||||
AdvancedSearchOptPageUrl,
|
||||
ApprovalQuotationUrl,
|
||||
BatchApproveUrl,
|
||||
BatchUpdateQuotationUrl,
|
||||
BatchUpdateOpportunityUrl,
|
||||
BatchVoidedUrl,
|
||||
CancelOptFollowPlanUrl,
|
||||
DeleteBusinessViewUrl,
|
||||
DeleteOpportunityStageUrl,
|
||||
DeleteOptFollowPlanUrl,
|
||||
DeleteOptFollowRecordUrl,
|
||||
DeleteQuotationUrl,
|
||||
DeleteQuotationViewUrl,
|
||||
DownloadOptTemplateUrl,
|
||||
DownloadQuotationUrl,
|
||||
DragBusinessViewUrl,
|
||||
DragQuotationViewUrl,
|
||||
EnableBusinessViewUrl,
|
||||
EnableQuotationViewUrl,
|
||||
ExportOpportunityAllUrl,
|
||||
ExportOpportunitySelectedUrl,
|
||||
FixedBusinessViewUrl,
|
||||
FixedQuotationViewUrl,
|
||||
GenerateOpportunityChartUrl,
|
||||
GetBusinessViewDetailUrl,
|
||||
GetBusinessViewListUrl,
|
||||
GetOpportunityContactListUrl,
|
||||
GetOpportunityStageConfigUrl,
|
||||
GetOptDetailUrl,
|
||||
GetOptFollowPlanUrl,
|
||||
GetOptFollowRecordUrl,
|
||||
GetOptFormConfigUrl,
|
||||
GetOptStatisticUrl,
|
||||
GetOptTabUrl,
|
||||
GetQuotationDetailUrl,
|
||||
GetQuotationFormConfigUrl,
|
||||
GetQuotationSnapshotDetailUrl,
|
||||
GetQuotationSnapshotFormConfigUrl,
|
||||
GetQuotationTabUrl,
|
||||
GetQuotationViewDetailUrl,
|
||||
GetQuotationViewListUrl,
|
||||
GlobalSearchOptPageUrl,
|
||||
ImportOpportunityUrl,
|
||||
OptAddUrl,
|
||||
OptBatchDeleteUrl,
|
||||
OptBatchTransferUrl,
|
||||
OptDeleteUrl,
|
||||
OptFollowPlanPageUrl,
|
||||
OptFollowRecordListUrl,
|
||||
OptPageUrl,
|
||||
OptUpdateStageUrl,
|
||||
OptUpdateUrl,
|
||||
PreCheckOptImportUrl,
|
||||
QuotationPageUrl,
|
||||
RevokeQuotationUrl,
|
||||
SortOpportunityStageUrl,
|
||||
SortOpportunityUrl,
|
||||
UpdateBusinessViewUrl,
|
||||
UpdateOpportunityStageRollbackUrl,
|
||||
UpdateOpportunityStageUrl,
|
||||
UpdateOptFollowPlanStatusUrl,
|
||||
UpdateOptFollowPlanUrl,
|
||||
UpdateOptFollowRecordUrl,
|
||||
UpdateQuotationUrl,
|
||||
UpdateQuotationViewUrl,
|
||||
VoidQuotationUrl,
|
||||
} from '@lib/shared/api/requrls/opportunity';
|
||||
import type {
|
||||
ChartResponseDataItem,
|
||||
CommonList,
|
||||
GenerateChartParams,
|
||||
TableDraggedParams,
|
||||
TableExportParams,
|
||||
TableExportSelectedParams,
|
||||
TableQueryParams,
|
||||
} from '@lib/shared/models/common';
|
||||
import type {
|
||||
BatchUpdatePoolAccountParams,
|
||||
CustomerContractTableParams,
|
||||
CustomerFollowPlanTableParams,
|
||||
CustomerFollowRecordTableParams,
|
||||
CustomerTabHidden,
|
||||
FollowDetailItem,
|
||||
SaveCustomerFollowPlanParams,
|
||||
SaveCustomerFollowRecordParams,
|
||||
TransferParams,
|
||||
UpdateCustomerFollowPlanParams,
|
||||
UpdateCustomerFollowRecordParams,
|
||||
UpdateFollowPlanStatusParams,
|
||||
} from '@lib/shared/models/customer';
|
||||
import type {
|
||||
AddOpportunityStageParams,
|
||||
ApproveQuotation,
|
||||
BatchOperationResult,
|
||||
BatchUpdateQuotationStatusParams,
|
||||
BatchVoidQuotationStatusParams,
|
||||
StageBoardPageQueryParams,
|
||||
StageBoardDraggedParams,
|
||||
OpportunityDetail,
|
||||
OpportunityItem,
|
||||
OpportunityStageConfig,
|
||||
QuotationItem,
|
||||
QuotationQueryParams,
|
||||
SaveOpportunityParams,
|
||||
SaveQuotationParams,
|
||||
UpdateOpportunityParams,
|
||||
UpdateOpportunityStageParams,
|
||||
UpdateOpportunityStageRollbackParams,
|
||||
UpdateQuotationParams,
|
||||
} from '@lib/shared/models/opportunity';
|
||||
import type { FormDesignConfigDetailParams } from '@lib/shared/models/system/module';
|
||||
import { ValidateInfo } from '@lib/shared/models/system/org';
|
||||
import type { ViewItem, ViewParams } from '@lib/shared/models/view';
|
||||
|
||||
export default function useProductApi(CDR: CordysAxios) {
|
||||
// 商机列表
|
||||
function getOpportunityList(data: StageBoardPageQueryParams) {
|
||||
return CDR.post<CommonList<OpportunityItem>>({ url: OptPageUrl, data }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
// 添加商机
|
||||
function addOpportunity(data: SaveOpportunityParams) {
|
||||
return CDR.post({ url: OptAddUrl, data });
|
||||
}
|
||||
|
||||
// 更新商机
|
||||
function updateOpportunity(data: UpdateOpportunityParams) {
|
||||
return CDR.post({ url: OptUpdateUrl, data });
|
||||
}
|
||||
|
||||
// 商机详情
|
||||
function getOpportunityDetail(id: string) {
|
||||
return CDR.get<OpportunityDetail>({ url: `${GetOptDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 商机看板拖拽排序
|
||||
function sortOpportunity(data: StageBoardDraggedParams) {
|
||||
return CDR.post({ url: SortOpportunityUrl, data });
|
||||
}
|
||||
|
||||
// 获取商机表单配置
|
||||
function getOptFormConfig() {
|
||||
return CDR.get<FormDesignConfigDetailParams>({ url: GetOptFormConfigUrl });
|
||||
}
|
||||
|
||||
// 商机跟进记录列表
|
||||
function getOptFollowRecordList(data: CustomerFollowRecordTableParams) {
|
||||
return CDR.post<CommonList<FollowDetailItem>>({ url: OptFollowRecordListUrl, data });
|
||||
}
|
||||
|
||||
// 删除商机跟进记录
|
||||
function deleteOptFollowRecord(id: string) {
|
||||
return CDR.get({ url: `${DeleteOptFollowRecordUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 添加商机跟进记录
|
||||
function addOptFollowRecord(data: SaveCustomerFollowRecordParams) {
|
||||
return CDR.post({ url: AddOptFollowRecordUrl, data });
|
||||
}
|
||||
|
||||
// 更新商机跟进记录
|
||||
function updateOptFollowRecord(data: UpdateCustomerFollowRecordParams) {
|
||||
return CDR.post({ url: UpdateOptFollowRecordUrl, data });
|
||||
}
|
||||
|
||||
// 获取商机跟进记录详情
|
||||
function getOptFollowRecord(id: string) {
|
||||
return CDR.get<FollowDetailItem>({ url: `${GetOptFollowRecordUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 跟进计划列表
|
||||
function getOptFollowPlanList(data: CustomerFollowPlanTableParams) {
|
||||
return CDR.post<CommonList<FollowDetailItem>>({ url: OptFollowPlanPageUrl, data });
|
||||
}
|
||||
|
||||
// 添加商机跟进计划
|
||||
function addOptFollowPlan(data: SaveCustomerFollowPlanParams) {
|
||||
return CDR.post({ url: AddOptFollowPlanUrl, data });
|
||||
}
|
||||
|
||||
// 更新商机跟进计划
|
||||
function updateOptFollowPlan(data: UpdateCustomerFollowPlanParams) {
|
||||
return CDR.post({ url: UpdateOptFollowPlanUrl, data });
|
||||
}
|
||||
|
||||
// 删除商机跟进计划
|
||||
function deleteOptFollowPlan(id: string) {
|
||||
return CDR.get({ url: `${DeleteOptFollowPlanUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取商机跟进计划详情
|
||||
function getOptFollowPlan(id: string) {
|
||||
return CDR.get<FollowDetailItem>({ url: `${GetOptFollowPlanUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 取消商机跟进计划
|
||||
function cancelOptFollowPlan(id: string) {
|
||||
return CDR.get({ url: `${CancelOptFollowPlanUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 批量转移商机
|
||||
function transferOpt(data: TransferParams) {
|
||||
return CDR.post({ url: OptBatchTransferUrl, data });
|
||||
}
|
||||
|
||||
// 批量删除商机
|
||||
function batchDeleteOpt(data: (string | number)[]) {
|
||||
return CDR.post({ url: OptBatchDeleteUrl, data });
|
||||
}
|
||||
|
||||
// 删除商机
|
||||
function deleteOpt(id: string) {
|
||||
return CDR.get({ url: `${OptDeleteUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 更新商机阶段
|
||||
function updateOptStage(data: { id: string; stage: string; failureReason?: string | null }) {
|
||||
return CDR.post({ url: OptUpdateStageUrl, data });
|
||||
}
|
||||
|
||||
// 获取商机tab显隐藏
|
||||
function getOptTab() {
|
||||
return CDR.get<CustomerTabHidden>({ url: GetOptTabUrl });
|
||||
}
|
||||
|
||||
// 获取商机联系人列表
|
||||
function getOpportunityContactList(data: CustomerContractTableParams) {
|
||||
return CDR.get({ url: `${GetOpportunityContactListUrl}/${data.id}` });
|
||||
}
|
||||
|
||||
// 更新商机跟进计划状态
|
||||
function updateOptFollowPlanStatus(data: UpdateFollowPlanStatusParams) {
|
||||
return CDR.post({ url: UpdateOptFollowPlanStatusUrl, data });
|
||||
}
|
||||
|
||||
// 导出全量商机列表
|
||||
function exportOpportunityAll(data: TableExportParams) {
|
||||
return CDR.post({ url: ExportOpportunityAllUrl, data });
|
||||
}
|
||||
|
||||
// 导出选中商机列表
|
||||
function exportOpportunitySelected(data: TableExportSelectedParams) {
|
||||
return CDR.post({ url: ExportOpportunitySelectedUrl, data });
|
||||
}
|
||||
|
||||
// 商机列表的金额数据
|
||||
function getOptStatistic(data: TableQueryParams) {
|
||||
return CDR.post({ url: GetOptStatisticUrl, data }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
// 更新商机阶段配置
|
||||
function updateOpportunityStage(data: UpdateOpportunityStageParams) {
|
||||
return CDR.post({ url: UpdateOpportunityStageUrl, data });
|
||||
}
|
||||
|
||||
// 商机阶段回退配置
|
||||
function updateOpportunityStageRollback(data: UpdateOpportunityStageRollbackParams) {
|
||||
return CDR.post({ url: UpdateOpportunityStageRollbackUrl, data });
|
||||
}
|
||||
|
||||
// 商机阶段排序
|
||||
function sortOpportunityStage(data: string[]) {
|
||||
return CDR.post({ url: SortOpportunityStageUrl, data });
|
||||
}
|
||||
|
||||
// 添加商机阶段
|
||||
function addOpportunityStage(data: AddOpportunityStageParams) {
|
||||
return CDR.post({ url: AddOpportunityStageUrl, data });
|
||||
}
|
||||
|
||||
// 获取商机阶段配置
|
||||
function getOpportunityStageConfig() {
|
||||
return CDR.get<OpportunityStageConfig>({ url: GetOpportunityStageConfigUrl }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
// 删除商机阶段
|
||||
function deleteOpportunityStage(id: string) {
|
||||
return CDR.get({ url: `${DeleteOpportunityStageUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 生成商机图表
|
||||
function generateOpportunityChart(data: GenerateChartParams) {
|
||||
return CDR.post<ChartResponseDataItem[]>({ url: GenerateOpportunityChartUrl, data });
|
||||
}
|
||||
|
||||
// 商机视图
|
||||
function addBusinessView(data: ViewParams) {
|
||||
return CDR.post({ url: AddBusinessViewUrl, data });
|
||||
}
|
||||
|
||||
function updateBusinessView(data: ViewParams) {
|
||||
return CDR.post({ url: UpdateBusinessViewUrl, data });
|
||||
}
|
||||
|
||||
function getBusinessViewList() {
|
||||
return CDR.get<ViewItem[]>({ url: GetBusinessViewListUrl });
|
||||
}
|
||||
|
||||
function getBusinessViewDetail(id: string) {
|
||||
return CDR.get({ url: `${GetBusinessViewDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
function fixedBusinessView(id: string) {
|
||||
return CDR.get({ url: `${FixedBusinessViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function enableBusinessView(id: string) {
|
||||
return CDR.get({ url: `${EnableBusinessViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function deleteBusinessView(id: string) {
|
||||
return CDR.get({ url: `${DeleteBusinessViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function dragBusinessView(data: TableDraggedParams) {
|
||||
return CDR.post({ url: DragBusinessViewUrl, data });
|
||||
}
|
||||
|
||||
function globalSearchOptPage(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<OpportunityItem>>({ url: GlobalSearchOptPageUrl, data }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
function advancedSearchOptPage(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<OpportunityItem>>({ url: AdvancedSearchOptPageUrl, data }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
function advancedSearchOptDetail(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<OpportunityItem>>({ url: AdvancedSearchOptDetailUrl, data });
|
||||
}
|
||||
|
||||
function preCheckImportOpt(file: File) {
|
||||
return CDR.uploadFile<{ data: ValidateInfo }>({ url: PreCheckOptImportUrl }, { fileList: [file] }, 'file');
|
||||
}
|
||||
|
||||
function downloadOptTemplate() {
|
||||
return CDR.get(
|
||||
{
|
||||
url: DownloadOptTemplateUrl,
|
||||
responseType: 'blob',
|
||||
},
|
||||
{ isTransformResponse: false, isReturnNativeResponse: true }
|
||||
);
|
||||
}
|
||||
|
||||
function importOpportunity(file: File) {
|
||||
return CDR.uploadFile({ url: ImportOpportunityUrl }, { fileList: [file] }, 'file');
|
||||
}
|
||||
|
||||
// 批量更新商机
|
||||
function batchUpdateOpportunity(data: BatchUpdatePoolAccountParams) {
|
||||
return CDR.post({ url: BatchUpdateOpportunityUrl, data });
|
||||
}
|
||||
|
||||
// 获取商机报价单tab显隐藏
|
||||
function getQuotationTab() {
|
||||
return CDR.get<CustomerTabHidden>({ url: GetQuotationTabUrl });
|
||||
}
|
||||
|
||||
// 报价单视图
|
||||
function addQuotationView(data: ViewParams) {
|
||||
return CDR.post({ url: AddQuotationViewUrl, data });
|
||||
}
|
||||
|
||||
function updateQuotationView(data: ViewParams) {
|
||||
return CDR.post({ url: UpdateQuotationViewUrl, data });
|
||||
}
|
||||
|
||||
function getQuotationViewList() {
|
||||
return CDR.get<ViewItem[]>({ url: GetQuotationViewListUrl });
|
||||
}
|
||||
|
||||
function getQuotationViewDetail(id: string) {
|
||||
return CDR.get({ url: `${GetQuotationViewDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
function fixedQuotationView(id: string) {
|
||||
return CDR.get({ url: `${FixedQuotationViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function enableQuotationView(id: string) {
|
||||
return CDR.get({ url: `${EnableQuotationViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function deleteQuotationView(id: string) {
|
||||
return CDR.get({ url: `${DeleteQuotationViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function dragQuotationView(data: TableDraggedParams) {
|
||||
return CDR.post({ url: DragQuotationViewUrl, data });
|
||||
}
|
||||
|
||||
// 报价单
|
||||
// 报价列表
|
||||
function getQuotationList(data: QuotationQueryParams) {
|
||||
return CDR.post<CommonList<QuotationItem>>({ url: QuotationPageUrl, data });
|
||||
}
|
||||
|
||||
// 添加报价
|
||||
function addQuotation(data: SaveQuotationParams) {
|
||||
return CDR.post({ url: AddQuotationUrl, data });
|
||||
}
|
||||
|
||||
// 更新报价
|
||||
function updateQuotation(data: UpdateQuotationParams, approvalTaskId?: string) {
|
||||
return CDR.post({ url: UpdateQuotationUrl, data, params: { approvalTaskId } });
|
||||
}
|
||||
|
||||
// 报价详情
|
||||
function getQuotationDetail(id: string, approvalTaskId?: string) {
|
||||
return CDR.get<QuotationItem>({ url: `${GetQuotationDetailUrl}/${id}`, params: { approvalTaskId } });
|
||||
}
|
||||
|
||||
// 报价单快照详情
|
||||
function getQuotationSnapshotDetail(id: string, approvalTaskId?: string) {
|
||||
return CDR.get<QuotationItem>({ url: `${GetQuotationSnapshotDetailUrl}/${id}`, params: { approvalTaskId } });
|
||||
}
|
||||
|
||||
// 获取报价表单配置
|
||||
function getQuotationFormConfig() {
|
||||
return CDR.get<FormDesignConfigDetailParams>({ url: GetQuotationFormConfigUrl });
|
||||
}
|
||||
|
||||
// 获取报价表单快照配置
|
||||
function getQuotationSnapshotFormConfig(id?: string, approvalTaskId?: string) {
|
||||
return CDR.get<FormDesignConfigDetailParams>({
|
||||
url: `${GetQuotationSnapshotFormConfigUrl}/${id}`,
|
||||
params: { approvalTaskId },
|
||||
});
|
||||
}
|
||||
|
||||
// 删除报价
|
||||
function deleteQuotation(id: string) {
|
||||
return CDR.get({ url: `${DeleteQuotationUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 作废报价
|
||||
function voidQuotation(id: string) {
|
||||
return CDR.get({ url: `${VoidQuotationUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 审批报价
|
||||
function approvalQuotation(data: ApproveQuotation) {
|
||||
return CDR.post({ url: ApprovalQuotationUrl, data });
|
||||
}
|
||||
|
||||
// 撤销报价
|
||||
function revokeQuotation(id: string) {
|
||||
return CDR.get({ url: `${RevokeQuotationUrl}/${id}` });
|
||||
}
|
||||
|
||||
function batchApprove(data: BatchUpdateQuotationStatusParams) {
|
||||
return CDR.post<BatchOperationResult>({ url: BatchApproveUrl, data });
|
||||
}
|
||||
|
||||
function batchVoided(data: BatchVoidQuotationStatusParams) {
|
||||
return CDR.post<BatchOperationResult>({ url: BatchVoidedUrl, data });
|
||||
}
|
||||
|
||||
function batchUpdateQuotation(data: BatchUpdatePoolAccountParams) {
|
||||
return CDR.post({ url: BatchUpdateQuotationUrl, data });
|
||||
}
|
||||
|
||||
function downloadQuotation(id: string) {
|
||||
return CDR.get({ url: `${DownloadQuotationUrl}/${id}` });
|
||||
}
|
||||
|
||||
return {
|
||||
getOpportunityList,
|
||||
addOpportunity,
|
||||
updateOpportunity,
|
||||
getOpportunityDetail,
|
||||
getOptFormConfig,
|
||||
getOptFollowRecordList,
|
||||
deleteOptFollowRecord,
|
||||
addOptFollowRecord,
|
||||
updateOptFollowRecord,
|
||||
getOptFollowRecord,
|
||||
getOptFollowPlanList,
|
||||
addOptFollowPlan,
|
||||
updateOptFollowPlan,
|
||||
deleteOptFollowPlan,
|
||||
getOptFollowPlan,
|
||||
cancelOptFollowPlan,
|
||||
transferOpt,
|
||||
batchDeleteOpt,
|
||||
deleteOpt,
|
||||
updateOptStage,
|
||||
getOptTab,
|
||||
getOpportunityContactList,
|
||||
updateOptFollowPlanStatus,
|
||||
exportOpportunityAll,
|
||||
exportOpportunitySelected,
|
||||
addBusinessView,
|
||||
deleteBusinessView,
|
||||
fixedBusinessView,
|
||||
getBusinessViewDetail,
|
||||
getBusinessViewList,
|
||||
updateBusinessView,
|
||||
enableBusinessView,
|
||||
dragBusinessView,
|
||||
advancedSearchOptPage,
|
||||
globalSearchOptPage,
|
||||
advancedSearchOptDetail,
|
||||
preCheckImportOpt,
|
||||
downloadOptTemplate,
|
||||
importOpportunity,
|
||||
getOptStatistic,
|
||||
batchUpdateOpportunity,
|
||||
sortOpportunity,
|
||||
updateOpportunityStage,
|
||||
updateOpportunityStageRollback,
|
||||
sortOpportunityStage,
|
||||
addOpportunityStage,
|
||||
getOpportunityStageConfig,
|
||||
deleteOpportunityStage,
|
||||
generateOpportunityChart,
|
||||
getQuotationTab,
|
||||
addQuotationView,
|
||||
deleteQuotationView,
|
||||
fixedQuotationView,
|
||||
getQuotationViewDetail,
|
||||
getQuotationViewList,
|
||||
updateQuotationView,
|
||||
enableQuotationView,
|
||||
dragQuotationView,
|
||||
getQuotationList,
|
||||
addQuotation,
|
||||
updateQuotation,
|
||||
getQuotationDetail,
|
||||
getQuotationSnapshotDetail,
|
||||
getQuotationFormConfig,
|
||||
getQuotationSnapshotFormConfig,
|
||||
deleteQuotation,
|
||||
approvalQuotation,
|
||||
voidQuotation,
|
||||
revokeQuotation,
|
||||
batchApprove,
|
||||
batchVoided,
|
||||
batchUpdateQuotation,
|
||||
downloadQuotation,
|
||||
};
|
||||
}
|
||||
240
frontend/packages/lib-shared/api/modules/order.ts
Normal file
240
frontend/packages/lib-shared/api/modules/order.ts
Normal file
@@ -0,0 +1,240 @@
|
||||
import type { CordysAxios } from '@lib/shared/api/http/Axios';
|
||||
import {
|
||||
AddOrderUrl,
|
||||
AddOrderViewUrl,
|
||||
BatchUpdateOrderUrl,
|
||||
DeleteOrderUrl,
|
||||
UpdateOrderStageUrl,
|
||||
DeleteOrderViewUrl,
|
||||
DragOrderViewUrl,
|
||||
EnableOrderViewUrl,
|
||||
FixedOrderViewUrl,
|
||||
GetOrderDetailUrl,
|
||||
OrderPageUrl,
|
||||
SortOrderUrl,
|
||||
OrderDetailSnapshotUrl,
|
||||
OrderFormConfigUrl,
|
||||
OrderFormConfigSnapshotUrl,
|
||||
OrderInContractPageUrl,
|
||||
GetOrderTabUrl,
|
||||
GetOrderViewDetailUrl,
|
||||
GetOrderViewListUrl,
|
||||
UpdateOrderUrl,
|
||||
UpdateOrderViewUrl,
|
||||
UpdateOrderStatusUrl,
|
||||
UpdateOrderStatusRollbackUrl,
|
||||
SortOrderStatusUrl,
|
||||
AddOrderStatusUrl,
|
||||
GetOrderStatusConfigUrl,
|
||||
DeleteOrderStatusUrl,
|
||||
DownloadOrderUrl,
|
||||
OrderStatisticUrl,
|
||||
SaveAdvanceConfigUrl,
|
||||
SwitchOrderCirculationTypeUrl,
|
||||
} from '@lib/shared/api/requrls/order';
|
||||
import type { FormDesignConfigDetailParams } from '@lib/shared/models/system/module';
|
||||
import type { CommonList, TableDraggedParams } from '@lib/shared/models/common';
|
||||
import type { BatchUpdatePoolAccountParams, CustomerTabHidden } from '@lib/shared/models/customer';
|
||||
import type { OrderItem, UpdateOrderParams } from '@lib/shared/models/order';
|
||||
import type { TableQueryParams } from '@lib/shared/models/common';
|
||||
|
||||
import type { ViewItem, ViewParams } from '@lib/shared/models/view';
|
||||
import {
|
||||
StageBoardPageQueryParams,
|
||||
StageBoardDraggedParams,
|
||||
StageBaseParams,
|
||||
OpportunityStageConfig,
|
||||
UpdateOpportunityStageRollbackParams,
|
||||
UpdateStageBaseParams,
|
||||
type SaveCirculationConfigParams,
|
||||
type UpdateStageParams,
|
||||
} from '@lib/shared/models/opportunity';
|
||||
import type { CirculationTypeEnum } from '@lib/shared/enums/opportunityEnum';
|
||||
|
||||
export default function useOrderApi(CDR: CordysAxios) {
|
||||
// 列表
|
||||
function getOrderList(data: StageBoardPageQueryParams) {
|
||||
return CDR.post<CommonList<OrderItem>>({ url: OrderPageUrl, data }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
// 合同下的列表
|
||||
function getOrderInContractList(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<OrderItem>>({ url: OrderInContractPageUrl, data });
|
||||
}
|
||||
|
||||
// 订单详情
|
||||
function getOrderDetail(id: string, approvalTaskId?: string) {
|
||||
return CDR.get<OrderItem>({ url: `${GetOrderDetailUrl}/${id}`, params: { approvalTaskId } });
|
||||
}
|
||||
|
||||
// 详情快照
|
||||
function getOrderDetailSnapshot(id: string, approvalTaskId?: string) {
|
||||
return CDR.get<OrderItem>({ url: `${OrderDetailSnapshotUrl}/${id}`, params: { approvalTaskId } });
|
||||
}
|
||||
|
||||
// 新增订单
|
||||
function addOrder(data: UpdateOrderParams) {
|
||||
return CDR.post({ url: AddOrderUrl, data });
|
||||
}
|
||||
|
||||
// 更新订单
|
||||
function updateOrder(data: UpdateOrderParams, approvalTaskId?: string) {
|
||||
return CDR.post({ url: UpdateOrderUrl, data, params: { approvalTaskId } });
|
||||
}
|
||||
|
||||
// 批量更新订单
|
||||
function batchUpdateOrder(data: BatchUpdatePoolAccountParams) {
|
||||
return CDR.post({ url: BatchUpdateOrderUrl, data });
|
||||
}
|
||||
|
||||
// 删除订单
|
||||
function deleteOrder(id: string) {
|
||||
return CDR.get({ url: `${DeleteOrderUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取表单配置
|
||||
function getOrderFormConfig() {
|
||||
return CDR.get<FormDesignConfigDetailParams>({
|
||||
url: OrderFormConfigUrl,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取表单配置快照
|
||||
function getOrderFormSnapshotConfig(id?: string, approvalTaskId?: string) {
|
||||
return CDR.get<FormDesignConfigDetailParams>({
|
||||
url: `${OrderFormConfigSnapshotUrl}/${id}`,
|
||||
params: { approvalTaskId },
|
||||
});
|
||||
}
|
||||
|
||||
function downloadOrder(id: string) {
|
||||
return CDR.get({ url: `${DownloadOrderUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取订单tab显隐配置
|
||||
function getOrderTab() {
|
||||
return CDR.get<CustomerTabHidden>({ url: GetOrderTabUrl });
|
||||
}
|
||||
|
||||
// 视图管理
|
||||
function addOrderView(data: ViewParams) {
|
||||
return CDR.post({ url: AddOrderViewUrl, data });
|
||||
}
|
||||
|
||||
function updateOrderView(data: ViewParams) {
|
||||
return CDR.post({ url: UpdateOrderViewUrl, data });
|
||||
}
|
||||
|
||||
function getOrderViewList() {
|
||||
return CDR.get<ViewItem[]>({ url: GetOrderViewListUrl });
|
||||
}
|
||||
|
||||
function getOrderViewDetail(id: string) {
|
||||
return CDR.get({ url: `${GetOrderViewDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
function fixedOrderView(id: string) {
|
||||
return CDR.get({ url: `${FixedOrderViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function enableOrderView(id: string) {
|
||||
return CDR.get({ url: `${EnableOrderViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function deleteOrderView(id: string) {
|
||||
return CDR.get({ url: `${DeleteOrderViewUrl}/${id}` });
|
||||
}
|
||||
|
||||
function dragOrderView(data: TableDraggedParams) {
|
||||
return CDR.post({ url: DragOrderViewUrl, data });
|
||||
}
|
||||
|
||||
// 更新订单状态配置
|
||||
function updateOrderStatus(data: UpdateStageBaseParams) {
|
||||
return CDR.post({ url: UpdateOrderStatusUrl, data });
|
||||
}
|
||||
|
||||
// 订单状态回退配置
|
||||
function updateOrderStatusRollback(data: UpdateOpportunityStageRollbackParams) {
|
||||
return CDR.post({ url: UpdateOrderStatusRollbackUrl, data });
|
||||
}
|
||||
|
||||
// 订单状态排序
|
||||
function sortOrderStatus(data: string[]) {
|
||||
return CDR.post({ url: SortOrderStatusUrl, data });
|
||||
}
|
||||
|
||||
// 添加订单状态
|
||||
function addOrderStatus(data: StageBaseParams) {
|
||||
return CDR.post({ url: AddOrderStatusUrl, data });
|
||||
}
|
||||
|
||||
// 获取订单状态配置
|
||||
function getOrderStatusConfig() {
|
||||
return CDR.get<OpportunityStageConfig>({ url: GetOrderStatusConfigUrl }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
// 删除订单状态
|
||||
function deleteOrderStatus(id: string) {
|
||||
return CDR.get({ url: `${DeleteOrderStatusUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 更新阶段
|
||||
function updateOrderStage(data: UpdateStageParams) {
|
||||
return CDR.post({ url: UpdateOrderStageUrl, data });
|
||||
}
|
||||
|
||||
// 订单看板拖拽排序
|
||||
function sortOrder(data: StageBoardDraggedParams) {
|
||||
return CDR.post({ url: SortOrderUrl, data });
|
||||
}
|
||||
|
||||
// 订单统计
|
||||
function getOrderStatistic(data: TableQueryParams) {
|
||||
return CDR.post({ url: OrderStatisticUrl, data }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
// 保存高级流转配置
|
||||
function saveAdvanceConfig(data: SaveCirculationConfigParams) {
|
||||
return CDR.post({ url: SaveAdvanceConfigUrl, data });
|
||||
}
|
||||
|
||||
// 切换流转配置
|
||||
function switchOrderCirculationType(type: CirculationTypeEnum) {
|
||||
return CDR.get({ url: `${SwitchOrderCirculationTypeUrl}/${type}` });
|
||||
}
|
||||
|
||||
return {
|
||||
getOrderFormConfig,
|
||||
getOrderFormSnapshotConfig,
|
||||
addOrder,
|
||||
getOrderDetail,
|
||||
getOrderDetailSnapshot,
|
||||
updateOrder,
|
||||
batchUpdateOrder,
|
||||
deleteOrder,
|
||||
getOrderList,
|
||||
getOrderInContractList,
|
||||
getOrderTab,
|
||||
addOrderView,
|
||||
updateOrderView,
|
||||
getOrderViewList,
|
||||
getOrderViewDetail,
|
||||
fixedOrderView,
|
||||
enableOrderView,
|
||||
deleteOrderView,
|
||||
dragOrderView,
|
||||
updateOrderStatus,
|
||||
updateOrderStatusRollback,
|
||||
sortOrderStatus,
|
||||
addOrderStatus,
|
||||
getOrderStatusConfig,
|
||||
deleteOrderStatus,
|
||||
updateOrderStage,
|
||||
sortOrder,
|
||||
downloadOrder,
|
||||
getOrderStatistic,
|
||||
switchOrderCirculationType,
|
||||
saveAdvanceConfig,
|
||||
};
|
||||
}
|
||||
222
frontend/packages/lib-shared/api/modules/product.ts
Normal file
222
frontend/packages/lib-shared/api/modules/product.ts
Normal file
@@ -0,0 +1,222 @@
|
||||
import type { CordysAxios } from '@lib/shared/api/http/Axios';
|
||||
import {
|
||||
AddProductPriceUrl,
|
||||
AddProductUrl,
|
||||
BatchDeleteProductUrl,
|
||||
BatchUpdateProductPriceUrl,
|
||||
BatchUpdateProductUrl,
|
||||
DeleteProductPriceUrl,
|
||||
DeleteProductUrl,
|
||||
DownloadProductPriceTemplateUrl,
|
||||
DownloadProductTemplateUrl,
|
||||
DragSortProductPriceUrl,
|
||||
DragSortProductUrl,
|
||||
ExportAllProductPriceUrl,
|
||||
ExportProductPriceUrl,
|
||||
GetProductFormConfigUrl,
|
||||
GetProductListUrl,
|
||||
GetProductOptionsUrl,
|
||||
GetProductPriceFormConfigUrl,
|
||||
GetProductPriceListUrl,
|
||||
GetProductPriceUrl,
|
||||
GetProductUrl,
|
||||
ImportProductPriceUrl,
|
||||
ImportProductUrl,
|
||||
PreCheckImportProductPriceUrl,
|
||||
PreCheckProductImportUrl,
|
||||
UpdateProductPriceUrl,
|
||||
UpdateProductUrl,
|
||||
CopyProductPriceUrl,
|
||||
} from '@lib/shared/api/requrls/product';
|
||||
import type {
|
||||
CommonList,
|
||||
TableDraggedParams,
|
||||
TableExportParams,
|
||||
TableExportSelectedParams,
|
||||
TableQueryParams,
|
||||
} from '@lib/shared/models/common';
|
||||
import { BatchUpdatePoolAccountParams } from '@lib/shared/models/customer';
|
||||
import type {
|
||||
AddPriceParams,
|
||||
ProductListItem,
|
||||
SaveProductParams,
|
||||
UpdatePriceParams,
|
||||
UpdateProductParams,
|
||||
} from '@lib/shared/models/product';
|
||||
import type { FormDesignConfigDetailParams } from '@lib/shared/models/system/module';
|
||||
import { ValidateInfo } from '@lib/shared/models/system/org';
|
||||
|
||||
export default function useProductApi(CDR: CordysAxios) {
|
||||
// 添加产品
|
||||
function addProduct(data: SaveProductParams) {
|
||||
return CDR.post({ url: AddProductUrl, data });
|
||||
}
|
||||
|
||||
// 更新产品
|
||||
function updateProduct(data: UpdateProductParams) {
|
||||
return CDR.post({ url: UpdateProductUrl, data });
|
||||
}
|
||||
|
||||
// 获取产品列表
|
||||
function getProductList(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<ProductListItem>>({ url: GetProductListUrl, data });
|
||||
}
|
||||
|
||||
// 获取产品表单配置
|
||||
function getProductFormConfig() {
|
||||
return CDR.get<FormDesignConfigDetailParams>({ url: GetProductFormConfigUrl });
|
||||
}
|
||||
|
||||
// 获取产品详情
|
||||
function getProduct(id: string) {
|
||||
return CDR.get<ProductListItem>({ url: `${GetProductUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 删除产品
|
||||
function deleteProduct(id: string) {
|
||||
return CDR.get({ url: `${DeleteProductUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 批量删除产品
|
||||
function batchDeleteProduct(data: (string | number)[]) {
|
||||
return CDR.post({ url: BatchDeleteProductUrl, data });
|
||||
}
|
||||
|
||||
// 批量更新产品
|
||||
function batchUpdateProduct(data: BatchUpdatePoolAccountParams) {
|
||||
return CDR.post({ url: BatchUpdateProductUrl, data });
|
||||
}
|
||||
// 拖拽排序产品
|
||||
function dragSortProduct(data: TableDraggedParams) {
|
||||
return CDR.post({ url: DragSortProductUrl, data });
|
||||
}
|
||||
|
||||
function preCheckImportProduct(file: File) {
|
||||
return CDR.uploadFile<{ data: ValidateInfo }>({ url: PreCheckProductImportUrl }, { fileList: [file] }, 'file');
|
||||
}
|
||||
|
||||
function downloadProductTemplate() {
|
||||
return CDR.get(
|
||||
{
|
||||
url: DownloadProductTemplateUrl,
|
||||
responseType: 'blob',
|
||||
},
|
||||
{ isTransformResponse: false, isReturnNativeResponse: true }
|
||||
);
|
||||
}
|
||||
|
||||
function importProduct(file: File) {
|
||||
return CDR.uploadFile({ url: ImportProductUrl }, { fileList: [file] }, 'file');
|
||||
}
|
||||
|
||||
// 获取意向产品选项
|
||||
function getProductOptions() {
|
||||
return CDR.get<{ id: string; name: string }[]>({ url: GetProductOptionsUrl });
|
||||
}
|
||||
|
||||
// 更新价格表
|
||||
function updateProductPrice(data: UpdatePriceParams) {
|
||||
return CDR.post({ url: UpdateProductPriceUrl, data });
|
||||
}
|
||||
|
||||
// 批量更新价格表
|
||||
function batchUpdateProductPrice(data: BatchUpdatePoolAccountParams) {
|
||||
return CDR.post({ url: BatchUpdateProductPriceUrl, data });
|
||||
}
|
||||
|
||||
// 获取价格表列表
|
||||
function getProductPriceList(data: TableQueryParams) {
|
||||
return CDR.post({ url: GetProductPriceListUrl, data });
|
||||
}
|
||||
|
||||
// 添加价格表
|
||||
function addProductPrice(data: AddPriceParams) {
|
||||
return CDR.post({ url: AddProductPriceUrl, data });
|
||||
}
|
||||
|
||||
// 获取价格表详情
|
||||
function getProductPrice(id: string) {
|
||||
return CDR.get<ProductListItem>({ url: `${GetProductPriceUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 删除价格表
|
||||
function deleteProductPrice(id: string) {
|
||||
return CDR.get({ url: `${DeleteProductPriceUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取价格表单配置
|
||||
function getProductPriceFormConfig() {
|
||||
return CDR.get<FormDesignConfigDetailParams>({ url: GetProductPriceFormConfigUrl });
|
||||
}
|
||||
|
||||
// 拖拽排序价格表
|
||||
function dragSortProductPrice(data: TableDraggedParams) {
|
||||
return CDR.post({ url: DragSortProductPriceUrl, data });
|
||||
}
|
||||
|
||||
// 下载价格表模板
|
||||
function downloadProductPriceTemplate() {
|
||||
return CDR.get(
|
||||
{
|
||||
url: DownloadProductPriceTemplateUrl,
|
||||
responseType: 'blob',
|
||||
},
|
||||
{ isTransformResponse: false, isReturnNativeResponse: true }
|
||||
);
|
||||
}
|
||||
|
||||
// 预检查导入价格表
|
||||
function preCheckImportProductPrice(file: File) {
|
||||
return CDR.uploadFile<{ data: ValidateInfo }>({ url: PreCheckImportProductPriceUrl }, { fileList: [file] }, 'file');
|
||||
}
|
||||
|
||||
// 导入价格表
|
||||
function importProductPrice(file: File) {
|
||||
return CDR.uploadFile({ url: ImportProductPriceUrl }, { fileList: [file] }, 'file');
|
||||
}
|
||||
|
||||
// 导出所有的价格表
|
||||
function exportProductPriceAll(data: TableExportParams) {
|
||||
return CDR.post({ url: ExportAllProductPriceUrl, data });
|
||||
}
|
||||
|
||||
// 导出选择的价格表
|
||||
function exportProductPriceSelected(data: TableExportSelectedParams) {
|
||||
return CDR.post({ url: ExportProductPriceUrl, data });
|
||||
}
|
||||
|
||||
// 复制价格表
|
||||
function copyProductPrice(id: string) {
|
||||
return CDR.get({ url: `${CopyProductPriceUrl}/${id}` });
|
||||
}
|
||||
|
||||
return {
|
||||
addProduct,
|
||||
updateProduct,
|
||||
getProductList,
|
||||
getProductFormConfig,
|
||||
getProduct,
|
||||
deleteProduct,
|
||||
batchDeleteProduct,
|
||||
batchUpdateProduct,
|
||||
dragSortProduct,
|
||||
preCheckImportProduct,
|
||||
downloadProductTemplate,
|
||||
importProduct,
|
||||
getProductOptions,
|
||||
updateProductPrice,
|
||||
getProductPriceList,
|
||||
addProductPrice,
|
||||
getProductPrice,
|
||||
deleteProductPrice,
|
||||
getProductPriceFormConfig,
|
||||
dragSortProductPrice,
|
||||
batchUpdateProductPrice,
|
||||
downloadProductPriceTemplate,
|
||||
exportProductPriceAll,
|
||||
exportProductPriceSelected,
|
||||
preCheckImportProductPrice,
|
||||
importProductPrice,
|
||||
copyProductPrice,
|
||||
};
|
||||
}
|
||||
19
frontend/packages/lib-shared/api/modules/sys.ts
Normal file
19
frontend/packages/lib-shared/api/modules/sys.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import type { CordysAxios } from '@lib/shared/api/http/Axios';
|
||||
import { LocaleChangeUrl, VersionUrl } from '@lib/shared/api/requrls/sys';
|
||||
import type { SystemVersion } from '@lib/shared/models/common';
|
||||
|
||||
export default function useSysApi(CDR: CordysAxios) {
|
||||
// 获取系统版本信息
|
||||
function getSystemVersion() {
|
||||
return CDR.get<SystemVersion>({ url: VersionUrl });
|
||||
}
|
||||
|
||||
function changeLocaleBackEnd(language: string) {
|
||||
return CDR.post({ url: LocaleChangeUrl, data: { language } });
|
||||
}
|
||||
|
||||
return {
|
||||
getSystemVersion,
|
||||
changeLocaleBackEnd,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import type { CordysAxios } from '@lib/shared/api/http/Axios';
|
||||
import { AddLicenseUrl, GetLicenseUrl } from '@lib/shared/api/requrls/system/authorizedManagement';
|
||||
import type { LicenseInfo } from '@lib/shared/models/system/authorizedManagement';
|
||||
|
||||
export default function useProductApi(CDR: CordysAxios) {
|
||||
/**
|
||||
* 授权管理相关API
|
||||
*/
|
||||
// 获取License
|
||||
function getLicense() {
|
||||
return CDR.get<LicenseInfo>({ url: GetLicenseUrl }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
// 添加License
|
||||
function addLicense(data: string) {
|
||||
return CDR.post({ url: AddLicenseUrl, data });
|
||||
}
|
||||
|
||||
return {
|
||||
getLicense,
|
||||
addLicense,
|
||||
};
|
||||
}
|
||||
312
frontend/packages/lib-shared/api/modules/system/business.ts
Normal file
312
frontend/packages/lib-shared/api/modules/system/business.ts
Normal file
@@ -0,0 +1,312 @@
|
||||
import type { CordysAxios } from '@lib/shared/api/http/Axios';
|
||||
import {
|
||||
AddApiKeyUrl,
|
||||
CancelCenterExportUrl,
|
||||
CreateAuthUrl,
|
||||
DeleteApiKeyUrl,
|
||||
DeleteAuthUrl,
|
||||
DisableApiKeyUrl,
|
||||
EnableApiKeyUrl,
|
||||
ExportCenterDownloadUrl,
|
||||
GetApiKeyListUrl,
|
||||
GetAuthDetailUrl,
|
||||
GetAuthsUrl,
|
||||
GetConfigEmailUrl,
|
||||
GetConfigSynchronizationUrl,
|
||||
GetDEOrgListUrl,
|
||||
GetDETokenUrl,
|
||||
GetExportCenterListUrl,
|
||||
GetPageConfigUrl,
|
||||
GetPersonalFollowUrl,
|
||||
GetPersonalUrl,
|
||||
GetTenderConfigUrl,
|
||||
GetThirdPartyConfigUrl,
|
||||
GetThirdPartyResourceUrl,
|
||||
GetThirdTypeListUrl,
|
||||
SavePageConfigUrl,
|
||||
SendEmailCodeUrl,
|
||||
SwitchThirdPartyUrl,
|
||||
SyncDEUrl,
|
||||
TestConfigEmailUrl,
|
||||
TestConfigSynchronizationUrl,
|
||||
UpdateApiKeyUrl,
|
||||
UpdateAuthNameUrl,
|
||||
UpdateAuthStatusUrl,
|
||||
UpdateAuthUrl,
|
||||
UpdateConfigEmailUrl,
|
||||
UpdateConfigSynchronizationUrl,
|
||||
UpdatePersonalUrl,
|
||||
UpdateUserPasswordUrl,
|
||||
} from '@lib/shared/api/requrls/system/business';
|
||||
import { CompanyTypeEnum } from '@lib/shared/enums/commonEnum';
|
||||
import type { CommonList } from '@lib/shared/models/common';
|
||||
import { CustomerFollowPlanTableParams, FollowDetailItem } from '@lib/shared/models/customer';
|
||||
import type {
|
||||
ApiKey,
|
||||
Auth,
|
||||
AuthItem,
|
||||
AuthTableQueryParams,
|
||||
AuthUpdateParams,
|
||||
ConfigEmailParams,
|
||||
ThirdPartyResourceConfig,
|
||||
DEOrgItem,
|
||||
PageConfigReturns,
|
||||
SavePageConfigParams,
|
||||
ThirdPartyResource,
|
||||
UpdateApiKeyParams,
|
||||
ThirdPartyDEConfig,
|
||||
} from '@lib/shared/models/system/business';
|
||||
import {
|
||||
ExportCenterItem,
|
||||
ExportCenterListParams,
|
||||
OptionDTO,
|
||||
PersonalInfoRequest,
|
||||
PersonalPassword,
|
||||
SendEmailDTO,
|
||||
} from '@lib/shared/models/system/business';
|
||||
import { type DEToken, OrgUserInfo } from '@lib/shared/models/system/org';
|
||||
|
||||
export default function useProductApi(CDR: CordysAxios) {
|
||||
// 获取邮件设置
|
||||
function getConfigEmail() {
|
||||
return CDR.get<ConfigEmailParams>({ url: GetConfigEmailUrl });
|
||||
}
|
||||
|
||||
// 更新邮件设置
|
||||
function updateConfigEmail(data: ConfigEmailParams) {
|
||||
return CDR.post({ url: UpdateConfigEmailUrl, data });
|
||||
}
|
||||
|
||||
// 邮件设置-测试连接
|
||||
function testConfigEmail(data: ConfigEmailParams) {
|
||||
return CDR.post({ url: TestConfigEmailUrl, data });
|
||||
}
|
||||
|
||||
// 同步组织设置-测试连接
|
||||
function testConfigSynchronization(data: ThirdPartyResourceConfig) {
|
||||
return CDR.post({ url: TestConfigSynchronizationUrl, data }, { isReturnNativeResponse: true });
|
||||
}
|
||||
|
||||
// 获取同步组织设置
|
||||
function getConfigSynchronization() {
|
||||
return CDR.get<ThirdPartyResourceConfig[]>({ url: GetConfigSynchronizationUrl }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
// 更新同步组织设置
|
||||
function updateConfigSynchronization(data: ThirdPartyResourceConfig) {
|
||||
return CDR.post({ url: UpdateConfigSynchronizationUrl, data }, { isReturnNativeResponse: true });
|
||||
}
|
||||
|
||||
// 根据类型获取开启的三方扫码设置
|
||||
function getThirdConfigByType<T = ThirdPartyResourceConfig>(type: string, isReturnNativeResponse = false) {
|
||||
return CDR.get<T>(
|
||||
{ url: `${GetThirdPartyConfigUrl}/${type}` },
|
||||
{
|
||||
noErrorTip: true,
|
||||
isReturnNativeResponse,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// 获取三方应用扫码类型集合
|
||||
function getThirdTypeList() {
|
||||
return CDR.get<OptionDTO[]>({ url: GetThirdTypeListUrl });
|
||||
}
|
||||
|
||||
// 切换三方平台
|
||||
function switchThirdParty(type: CompanyTypeEnum) {
|
||||
return CDR.get({ url: SwitchThirdPartyUrl, params: { type } });
|
||||
}
|
||||
|
||||
// 获取最新的三方同步来源
|
||||
function getThirdPartyResource() {
|
||||
return CDR.get<ThirdPartyResource>(
|
||||
{ url: GetThirdPartyResourceUrl },
|
||||
{
|
||||
ignoreCancelToken: true,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// 获取认证设置列表
|
||||
function getAuthList(data: AuthTableQueryParams) {
|
||||
return CDR.post<CommonList<AuthItem>>({ url: GetAuthsUrl, data });
|
||||
}
|
||||
|
||||
// 获取认证设置详情
|
||||
function getAuthDetail(id: string) {
|
||||
return CDR.get<AuthUpdateParams>({ url: `${GetAuthDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 更新认证设置
|
||||
function updateAuth(data: AuthUpdateParams) {
|
||||
return CDR.post({ url: UpdateAuthUrl, data });
|
||||
}
|
||||
|
||||
// 新建认证设置
|
||||
function createAuth(data: Auth) {
|
||||
return CDR.post({ url: CreateAuthUrl, data });
|
||||
}
|
||||
|
||||
// 更新认证设置状态
|
||||
function updateAuthStatus(id: string, enable: boolean) {
|
||||
return CDR.get({ url: `${UpdateAuthStatusUrl}/${id}`, params: { enable } });
|
||||
}
|
||||
|
||||
// 更新认证设置名称
|
||||
function updateAuthName(id: string, name: string) {
|
||||
return CDR.get({ url: `${UpdateAuthNameUrl}/${id}`, params: { name } });
|
||||
}
|
||||
|
||||
// 删除认证设置
|
||||
function deleteAuth(id: string) {
|
||||
return CDR.get({ url: `${DeleteAuthUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取DEToken
|
||||
function getDEToken(isModule = false) {
|
||||
return CDR.get<DEToken>({ url: GetDETokenUrl, params: { isModule } });
|
||||
}
|
||||
|
||||
// 同步 DE
|
||||
function syncDE() {
|
||||
return CDR.get({ url: SyncDEUrl });
|
||||
}
|
||||
|
||||
// 获取第三方配置
|
||||
function getThirdPartyConfig(type: string) {
|
||||
return CDR.get<ThirdPartyResourceConfig>({ url: `${GetThirdPartyConfigUrl}/${type}` }, { noErrorTip: true });
|
||||
}
|
||||
|
||||
// 获取 DE 组织列表
|
||||
function getDEOrgList(data: ThirdPartyDEConfig) {
|
||||
return CDR.post<DEOrgItem[]>({ url: GetDEOrgListUrl, data });
|
||||
}
|
||||
|
||||
// 获取个人信息
|
||||
function getPersonalInfo() {
|
||||
return CDR.get<OrgUserInfo>({ url: GetPersonalUrl });
|
||||
}
|
||||
// 更新个人信息
|
||||
function updatePersonalInfo(data: PersonalInfoRequest) {
|
||||
return CDR.post({ url: UpdatePersonalUrl, data });
|
||||
}
|
||||
// 发送验证码
|
||||
function sendEmailCode(email: SendEmailDTO) {
|
||||
return CDR.post({ url: SendEmailCodeUrl, params: { email } });
|
||||
}
|
||||
// 修改密码
|
||||
function updateUserPassword(data: PersonalPassword) {
|
||||
return CDR.post({ url: UpdateUserPasswordUrl, data });
|
||||
}
|
||||
|
||||
// 获取个人跟进计划
|
||||
function getPersonalFollow(data: CustomerFollowPlanTableParams) {
|
||||
return CDR.post<CommonList<FollowDetailItem>>({ url: GetPersonalFollowUrl, data });
|
||||
}
|
||||
|
||||
// 个人中心导出列表
|
||||
function getExportCenterList(data: ExportCenterListParams) {
|
||||
return CDR.post<ExportCenterItem[]>({ url: GetExportCenterListUrl, data });
|
||||
}
|
||||
|
||||
// 个人中心导出下载
|
||||
function exportCenterDownload(taskId: string) {
|
||||
return CDR.get(
|
||||
{ url: `${ExportCenterDownloadUrl}/${taskId}`, responseType: 'blob' },
|
||||
{ isTransformResponse: false }
|
||||
);
|
||||
}
|
||||
|
||||
// 个人中心取消导出
|
||||
function cancelCenterExport(taskId: string) {
|
||||
return CDR.get({ url: `${CancelCenterExportUrl}/${taskId}` });
|
||||
}
|
||||
|
||||
// 个人中心 ApiKey
|
||||
// 更新ApiKey
|
||||
function updateApiKey(data: UpdateApiKeyParams) {
|
||||
return CDR.post({ url: UpdateApiKeyUrl, data });
|
||||
}
|
||||
|
||||
// 获取ApiKey列表
|
||||
function getApiKeyList() {
|
||||
return CDR.get<ApiKey[]>({ url: GetApiKeyListUrl });
|
||||
}
|
||||
|
||||
// 开启ApiKey
|
||||
function enableApiKey(id: string) {
|
||||
return CDR.get({ url: EnableApiKeyUrl, params: id });
|
||||
}
|
||||
|
||||
// 关闭ApiKey
|
||||
function disableApiKey(id: string) {
|
||||
return CDR.get({ url: DisableApiKeyUrl, params: id });
|
||||
}
|
||||
|
||||
// 删除ApiKey
|
||||
function deleteApiKey(id: string) {
|
||||
return CDR.get({ url: DeleteApiKeyUrl, params: id });
|
||||
}
|
||||
|
||||
// 新增ApiKey
|
||||
function addApiKey() {
|
||||
return CDR.get({ url: AddApiKeyUrl });
|
||||
}
|
||||
|
||||
// 保存界面配置
|
||||
function savePageConfig(data: SavePageConfigParams) {
|
||||
return CDR.uploadFile({ url: SavePageConfigUrl }, data, 'files');
|
||||
}
|
||||
|
||||
// 获取界面配置
|
||||
function getPageConfig() {
|
||||
return CDR.get<PageConfigReturns>({ url: GetPageConfigUrl }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
// 获取招投标配置项
|
||||
function getTenderConfig() {
|
||||
return CDR.get<ThirdPartyResourceConfig>({ url: GetTenderConfigUrl }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
return {
|
||||
getConfigEmail,
|
||||
updateConfigEmail,
|
||||
testConfigEmail,
|
||||
testConfigSynchronization,
|
||||
getConfigSynchronization,
|
||||
updateConfigSynchronization,
|
||||
getThirdConfigByType,
|
||||
getThirdTypeList,
|
||||
getAuthList,
|
||||
getAuthDetail,
|
||||
updateAuth,
|
||||
createAuth,
|
||||
updateAuthStatus,
|
||||
updateAuthName,
|
||||
deleteAuth,
|
||||
switchThirdParty,
|
||||
getThirdPartyResource,
|
||||
getPersonalInfo,
|
||||
updatePersonalInfo,
|
||||
sendEmailCode,
|
||||
updateUserPassword,
|
||||
getPersonalFollow,
|
||||
getExportCenterList,
|
||||
exportCenterDownload,
|
||||
cancelCenterExport,
|
||||
getDEToken,
|
||||
syncDE,
|
||||
getDEOrgList,
|
||||
getThirdPartyConfig,
|
||||
updateApiKey,
|
||||
getApiKeyList,
|
||||
enableApiKey,
|
||||
disableApiKey,
|
||||
deleteApiKey,
|
||||
addApiKey,
|
||||
savePageConfig,
|
||||
getPageConfig,
|
||||
getTenderConfig,
|
||||
};
|
||||
}
|
||||
57
frontend/packages/lib-shared/api/modules/system/login.ts
Normal file
57
frontend/packages/lib-shared/api/modules/system/login.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import type { CordysAxios } from '@lib/shared/api/http/Axios';
|
||||
import {
|
||||
getKeyUrl,
|
||||
isLoginUrl,
|
||||
loginUrl,
|
||||
signoutUrl,
|
||||
thirdCallbackUrl,
|
||||
thirdOauthCallbackUrl,
|
||||
} from '@lib/shared/api/requrls/system/login';
|
||||
import type { LoginParams } from '@lib/shared/models/system/login';
|
||||
import type { UserInfo } from '@lib/shared/models/user';
|
||||
import type { Result } from '@lib/shared/types/axios';
|
||||
import type { AxiosResponse } from 'axios';
|
||||
|
||||
export default function useProductApi(CDR: CordysAxios) {
|
||||
// 登录
|
||||
function login(data: LoginParams) {
|
||||
return CDR.post<UserInfo>({ url: loginUrl, data });
|
||||
}
|
||||
|
||||
// 登出
|
||||
function signout() {
|
||||
return CDR.get({ url: signoutUrl });
|
||||
}
|
||||
|
||||
// 是否登录
|
||||
function isLogin(isDisabledErrorTip = false) {
|
||||
return CDR.get<UserInfo>({ url: isLoginUrl }, { ignoreCancelToken: true, noErrorTip: isDisabledErrorTip });
|
||||
}
|
||||
|
||||
// 获取登录密钥
|
||||
function getKey() {
|
||||
return CDR.get<string>({ url: getKeyUrl });
|
||||
}
|
||||
|
||||
// 三方二维码登录
|
||||
function getThirdCallback(code: string, type: string) {
|
||||
return CDR.get<UserInfo>({ url: `${thirdCallbackUrl}/${type}`, params: { code } });
|
||||
}
|
||||
|
||||
// 三方oauth2登录
|
||||
function getThirdOauthCallback(code: string, type: string) {
|
||||
return CDR.get<AxiosResponse<Result<UserInfo>>>(
|
||||
{ url: `${thirdOauthCallbackUrl}/${type}`, params: { code } },
|
||||
{ ignoreCancelToken: true, isReturnNativeResponse: true, noErrorTip: true }
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
login,
|
||||
signout,
|
||||
isLogin,
|
||||
getKey,
|
||||
getThirdCallback,
|
||||
getThirdOauthCallback,
|
||||
};
|
||||
}
|
||||
133
frontend/packages/lib-shared/api/modules/system/message.ts
Normal file
133
frontend/packages/lib-shared/api/modules/system/message.ts
Normal file
@@ -0,0 +1,133 @@
|
||||
import type { CordysAxios } from '@lib/shared/api/http/Axios';
|
||||
import {
|
||||
AddAnnouncementUrl,
|
||||
BatchSaveMessageTaskUrl,
|
||||
CloseMessageUrl,
|
||||
DeleteAnnouncementUrl,
|
||||
GetAnnouncementDetailUrl,
|
||||
GetAnnouncementListUrl,
|
||||
GetHomeMessageUrl,
|
||||
getMessageTaskConfigDetailUrl,
|
||||
GetMessageTaskUrl,
|
||||
GetNotificationCountUrl,
|
||||
GetNotificationListUrl,
|
||||
GetUnReadAnnouncement,
|
||||
SaveMessageTaskUrl,
|
||||
SetAllNotificationReadUrl,
|
||||
SetNotificationReadUrl,
|
||||
UpdateAnnouncementUrl,
|
||||
} from '@lib/shared/api/requrls/system/message';
|
||||
import type { CommonList } from '@lib/shared/models/common';
|
||||
import type {
|
||||
AnnouncementItemDetail,
|
||||
AnnouncementSaveParams,
|
||||
AnnouncementTableQueryParams,
|
||||
MessageCenterItem,
|
||||
MessageCenterQueryParams,
|
||||
MessageConfigItem,
|
||||
MessageSettingsConfig,
|
||||
SaveMessageConfigParams,
|
||||
} from '@lib/shared/models/system/message';
|
||||
|
||||
export default function useProductApi(CDR: CordysAxios) {
|
||||
// 公告
|
||||
// 添加公告
|
||||
function addAnnouncement(data: AnnouncementSaveParams) {
|
||||
return CDR.post({ url: AddAnnouncementUrl, data });
|
||||
}
|
||||
|
||||
// 更新公告
|
||||
function updateAnnouncement(data: AnnouncementSaveParams) {
|
||||
return CDR.post({ url: UpdateAnnouncementUrl, data });
|
||||
}
|
||||
|
||||
// 获取公告列表
|
||||
function getAnnouncementList(data: AnnouncementTableQueryParams) {
|
||||
return CDR.post<CommonList<AnnouncementItemDetail>>({ url: GetAnnouncementListUrl, data });
|
||||
}
|
||||
|
||||
// 公告详情
|
||||
function getAnnouncementDetail(id: string) {
|
||||
return CDR.get<AnnouncementItemDetail>({ url: `${GetAnnouncementDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 删除公告
|
||||
function deleteAnnouncement(id: string) {
|
||||
return CDR.get({ url: `${DeleteAnnouncementUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 消息中心
|
||||
// 消息列表
|
||||
function getNotificationList(data: MessageCenterQueryParams) {
|
||||
return CDR.post<CommonList<MessageCenterItem>>({ url: GetNotificationListUrl, data });
|
||||
}
|
||||
|
||||
// 具体消息类型具体状态的数量
|
||||
function getNotificationCount(data: MessageCenterQueryParams) {
|
||||
return CDR.post<{ key: string; count: number }[]>({ url: GetNotificationCountUrl, data });
|
||||
}
|
||||
|
||||
// 设置消息已读
|
||||
function setNotificationRead(id: string) {
|
||||
return CDR.get({ url: `${SetNotificationReadUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 所有信息设置为已读消息
|
||||
function setAllNotificationRead() {
|
||||
return CDR.get({ url: SetAllNotificationReadUrl });
|
||||
}
|
||||
|
||||
// 获取消息设置
|
||||
function getMessageTask() {
|
||||
return CDR.get<MessageConfigItem[]>({ url: GetMessageTaskUrl });
|
||||
}
|
||||
|
||||
// 获取首页消息列表
|
||||
function getHomeMessageList() {
|
||||
return CDR.get<MessageCenterItem[]>({ url: GetHomeMessageUrl });
|
||||
}
|
||||
|
||||
// 保存消息设置
|
||||
function saveMessageTask(data: SaveMessageConfigParams) {
|
||||
return CDR.post({ url: SaveMessageTaskUrl, data });
|
||||
}
|
||||
|
||||
// 批量编辑消息设置
|
||||
function batchSaveMessageTask(data: Pick<SaveMessageConfigParams, 'emailEnable' | 'sysEnable' | 'weComEnable'>) {
|
||||
return CDR.post({ url: BatchSaveMessageTaskUrl, data });
|
||||
}
|
||||
|
||||
// 关闭订阅消息SSE事件流
|
||||
function closeMessageSubscribe(params: { userId: string; clientId: string }) {
|
||||
return CDR.get({ url: CloseMessageUrl, params }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
// 获取未读公告
|
||||
function getUnReadAnnouncement() {
|
||||
return CDR.get<MessageCenterItem[]>({ url: GetUnReadAnnouncement });
|
||||
}
|
||||
|
||||
// 获取消息任务配置详情
|
||||
function getMessageTaskConfigDetail(data: { module: string ,event:string}) {
|
||||
return CDR.post<MessageSettingsConfig>({ url: getMessageTaskConfigDetailUrl, data });
|
||||
}
|
||||
|
||||
return {
|
||||
addAnnouncement,
|
||||
updateAnnouncement,
|
||||
getAnnouncementList,
|
||||
getAnnouncementDetail,
|
||||
deleteAnnouncement,
|
||||
getNotificationList,
|
||||
getNotificationCount,
|
||||
setNotificationRead,
|
||||
setAllNotificationRead,
|
||||
getMessageTask,
|
||||
saveMessageTask,
|
||||
batchSaveMessageTask,
|
||||
getHomeMessageList,
|
||||
closeMessageSubscribe,
|
||||
getUnReadAnnouncement,
|
||||
getMessageTaskConfigDetail,
|
||||
};
|
||||
}
|
||||
507
frontend/packages/lib-shared/api/modules/system/module.ts
Normal file
507
frontend/packages/lib-shared/api/modules/system/module.ts
Normal file
@@ -0,0 +1,507 @@
|
||||
import type { CordysAxios } from '@lib/shared/api/http/Axios';
|
||||
import {
|
||||
AddClueCapacityUrl,
|
||||
AddCluePoolUrl,
|
||||
AddCustomerCapacityUrl,
|
||||
AddCustomerPoolUrl,
|
||||
addOpportunityRuleUrl,
|
||||
AddReasonUrl,
|
||||
CheckRepeatUrl,
|
||||
DeleteAttachmentUrl,
|
||||
DeleteClueCapacityUrl,
|
||||
DeleteCluePoolUrl,
|
||||
DeleteCustomerCapacityUrl,
|
||||
DeleteCustomerPoolUrl,
|
||||
deleteOpportunityUrl,
|
||||
DeleteReasonUrl,
|
||||
DownloadAttachmentUrl,
|
||||
DownloadPictureUrl,
|
||||
GetClueCapacityPageUrl,
|
||||
GetCluePoolPageUrl,
|
||||
GetCustomerCapacityPageUrl,
|
||||
GetCustomerPoolPageUrl,
|
||||
GetFieldClueListUrl,
|
||||
GetFieldContractListUrl,
|
||||
GetFieldInvoiceListUrl,
|
||||
GetFieldContractPaymentPlanListUrl,
|
||||
GetFieldContractPaymentRecordListUrl,
|
||||
GetFieldContactListUrl,
|
||||
GetFieldCustomerListUrl,
|
||||
GetFieldDeptTreeUrl,
|
||||
GetFieldDeptUerTreeUrl,
|
||||
GetFieldOpportunityListUrl,
|
||||
GetFieldProductListUrl,
|
||||
GetFormDesignConfigUrl,
|
||||
GetModuleMaskSearchConfigUrl,
|
||||
getModuleNavConfigListUrl,
|
||||
GetModuleTopNavListUrl,
|
||||
getOpportunityListUrl,
|
||||
GetReasonConfigUrl,
|
||||
GetReasonUrl,
|
||||
GetSearchConfigUrl,
|
||||
ModuleMaskSearchConfigUrl,
|
||||
moduleNavListSortUrl,
|
||||
ModuleRoleTreeUrl,
|
||||
ModuleUserDeptTreeUrl,
|
||||
NoPickCluePoolUrl,
|
||||
NoPickCustomerPoolUrl,
|
||||
PreviewAttachmentUrl,
|
||||
PreviewPictureUrl,
|
||||
QuickUpdateCluePoolUrl,
|
||||
QuickUpdateCustomerPoolUrl,
|
||||
ResetSearchConfigUrl,
|
||||
SaveFormDesignConfigUrl,
|
||||
SearchConfigUrl,
|
||||
SetModuleTopNavSortUrl,
|
||||
SortReasonUrl,
|
||||
SwitchCluePoolStatusUrl,
|
||||
SwitchCustomerPoolStatusUrl,
|
||||
switchOpportunityStatusUrl,
|
||||
toggleModuleNavStatusUrl,
|
||||
UpdateClueCapacityUrl,
|
||||
GetFieldDisplayListUrl,
|
||||
UpdateCluePoolUrl,
|
||||
UpdateCustomerCapacityUrl,
|
||||
UpdateCustomerPoolUrl,
|
||||
updateOpportunityRuleUrl,
|
||||
UpdateReasonEnableUrl,
|
||||
UpdateReasonUrl,
|
||||
UploadTempAttachmentUrl,
|
||||
UploadTempFileUrl,
|
||||
GetFieldPriceListUrl,
|
||||
GetFieldQuotationListUrl,
|
||||
GetFieldBusinessTitleListUrl,
|
||||
SetDisplayAdvancedUrl,
|
||||
GetAdvancedSwitchUrl,
|
||||
GetFieldRefDetailListUrl,
|
||||
GetFieldOrderListUrl,
|
||||
GetFieldCustomFormListUrl,
|
||||
GetFieldConfigUrl,
|
||||
} from '@lib/shared/api/requrls/system/module';
|
||||
import { QuotationItem } from '@lib/shared/models/opportunity';
|
||||
import { ModuleConfigEnum, ReasonTypeEnum } from '@lib/shared/enums/moduleEnum';
|
||||
import type { ClueListItem } from '@lib/shared/models/clue';
|
||||
import type { CommonList, TableQueryParams } from '@lib/shared/models/common';
|
||||
import type { CustomerContractListItem, CustomerListItem } from '@lib/shared/models/customer';
|
||||
import type { ProductListItem } from '@lib/shared/models/product';
|
||||
import type {
|
||||
CapacityItem,
|
||||
CapacityParams,
|
||||
CheckRepeatInfo,
|
||||
CheckRepeatParams,
|
||||
CluePoolItem,
|
||||
CluePoolParams,
|
||||
DefaultSearchSetFormModel,
|
||||
FormDesignConfigDetailParams,
|
||||
FormDesignDataSourceTableQueryParams,
|
||||
GetRefDataSourceFieldParams,
|
||||
ModuleNavBaseInfoItem,
|
||||
ModuleNavTopItem,
|
||||
ModuleSortParams,
|
||||
OpportunityItem,
|
||||
OpportunityParams,
|
||||
ReasonConfig,
|
||||
ReasonItem,
|
||||
ReasonParams,
|
||||
RefDataSourceFieldItem,
|
||||
SaveFormDesignConfigParams,
|
||||
SortReasonParams,
|
||||
UpdateReasonEnableParams,
|
||||
} from '@lib/shared/models/system/module';
|
||||
import type { DeptUserTreeNode } from '@lib/shared/models/system/role';
|
||||
import type { Result } from '@lib/shared/types/axios';
|
||||
import { FormDesignKeyEnum } from '@lib/shared/enums/formDesignEnum';
|
||||
import type { BusinessTitleItem, ContractItem, PaymentPlanItem, PaymentRecordItem } from '@lib/shared/models/contract';
|
||||
import type { OrderItem } from '@lib/shared/models/order';
|
||||
import { CustomFormPageItem, type CustomFormDetail } from '@lib/shared/models/customForm';
|
||||
|
||||
export default function useProductApi(CDR: CordysAxios) {
|
||||
// 模块首页-导航模块列表
|
||||
function getModuleNavConfigList(data: { organizationId: string }) {
|
||||
return CDR.post<ModuleNavBaseInfoItem[]>({ url: getModuleNavConfigListUrl, data });
|
||||
}
|
||||
|
||||
// 模块首页-导航模块排序
|
||||
function moduleNavListSort(data: ModuleSortParams) {
|
||||
return CDR.post({ url: moduleNavListSortUrl, data });
|
||||
}
|
||||
|
||||
// 模块首页-导航模块状态切换
|
||||
function toggleModuleNavStatus(id: string) {
|
||||
return CDR.get({ url: `${toggleModuleNavStatusUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 模块首页-顶导配置列表
|
||||
function getModuleTopNavList() {
|
||||
return CDR.get<ModuleNavTopItem[]>({ url: GetModuleTopNavListUrl });
|
||||
}
|
||||
|
||||
// 模块首页-导航模块排序
|
||||
function setTopNavListSort(data: ModuleSortParams) {
|
||||
return CDR.post({ url: SetModuleTopNavSortUrl, data });
|
||||
}
|
||||
|
||||
// 获取部门用户树
|
||||
function getModuleUserDeptTree() {
|
||||
return CDR.get<DeptUserTreeNode[]>({ url: ModuleUserDeptTreeUrl });
|
||||
}
|
||||
// 获取角色树
|
||||
function getModuleRoleTree() {
|
||||
return CDR.get<DeptUserTreeNode[]>({ url: ModuleRoleTreeUrl });
|
||||
}
|
||||
|
||||
// 模块-商机-商机规则列表
|
||||
function getOpportunityRuleList(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<OpportunityItem>>({ url: getOpportunityListUrl, data });
|
||||
}
|
||||
|
||||
// 模块-商机-添加商机规则
|
||||
function addOpportunityRule(data: OpportunityParams) {
|
||||
return CDR.post({ url: addOpportunityRuleUrl, data });
|
||||
}
|
||||
|
||||
// 模块-商机-更新商机规则
|
||||
function updateOpportunityRule(data: OpportunityParams) {
|
||||
return CDR.post({ url: updateOpportunityRuleUrl, data });
|
||||
}
|
||||
|
||||
// 模块-商机-更新商机规则状态
|
||||
function switchOpportunityStatus(ruleId: string) {
|
||||
return CDR.get({ url: `${switchOpportunityStatusUrl}/${ruleId}` });
|
||||
}
|
||||
|
||||
// 模块-商机-删除商机规则
|
||||
function deleteOpportunity(ruleId: string) {
|
||||
return CDR.get({ url: `${deleteOpportunityUrl}/${ruleId}` });
|
||||
}
|
||||
|
||||
// 线索池相关API
|
||||
function getCluePoolPage(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<CluePoolItem>>({ url: GetCluePoolPageUrl, data });
|
||||
}
|
||||
|
||||
function addCluePool(data: CluePoolParams) {
|
||||
return CDR.post({ url: AddCluePoolUrl, data });
|
||||
}
|
||||
|
||||
function updateCluePool(data: CluePoolParams, quick = false) {
|
||||
return CDR.post({ url: quick ? QuickUpdateCluePoolUrl : UpdateCluePoolUrl, data });
|
||||
}
|
||||
|
||||
function switchCluePoolStatus(id: string) {
|
||||
return CDR.get({ url: `${SwitchCluePoolStatusUrl}/${id}` });
|
||||
}
|
||||
|
||||
function deleteModuleCluePool(id: string) {
|
||||
return CDR.get({ url: `${DeleteCluePoolUrl}/${id}` });
|
||||
}
|
||||
|
||||
function noPickCluePool(id: string) {
|
||||
return CDR.get({ url: `${NoPickCluePoolUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 库容相关API
|
||||
function getCapacityPage(type: ModuleConfigEnum) {
|
||||
return CDR.get<CapacityItem[]>({
|
||||
url: type === ModuleConfigEnum.CLUE_MANAGEMENT ? GetClueCapacityPageUrl : GetCustomerCapacityPageUrl,
|
||||
});
|
||||
}
|
||||
|
||||
function deleteCapacity(id: string, type: ModuleConfigEnum) {
|
||||
return CDR.get({
|
||||
url: `${type === ModuleConfigEnum.CLUE_MANAGEMENT ? DeleteClueCapacityUrl : DeleteCustomerCapacityUrl}/${id}`,
|
||||
});
|
||||
}
|
||||
|
||||
function updateCapacity(data: CapacityParams, type: ModuleConfigEnum) {
|
||||
return CDR.post({
|
||||
url: type === ModuleConfigEnum.CLUE_MANAGEMENT ? UpdateClueCapacityUrl : UpdateCustomerCapacityUrl,
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
function addCapacity(data: CapacityParams, type: ModuleConfigEnum) {
|
||||
return CDR.post({
|
||||
url: type === ModuleConfigEnum.CLUE_MANAGEMENT ? AddClueCapacityUrl : AddCustomerCapacityUrl,
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
// 公海相关API
|
||||
function getCustomerPoolPage(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<CluePoolItem>>({ url: GetCustomerPoolPageUrl, data });
|
||||
}
|
||||
|
||||
function addCustomerPool(data: CluePoolParams) {
|
||||
return CDR.post({ url: AddCustomerPoolUrl, data });
|
||||
}
|
||||
|
||||
function updateCustomerPool(data: CluePoolParams, quick = false) {
|
||||
return CDR.post({ url: quick ? QuickUpdateCustomerPoolUrl : UpdateCustomerPoolUrl, data });
|
||||
}
|
||||
|
||||
function switchCustomerPoolStatus(id: string) {
|
||||
return CDR.get({ url: `${SwitchCustomerPoolStatusUrl}/${id}` });
|
||||
}
|
||||
|
||||
function deleteCustomerPool(id: string) {
|
||||
return CDR.get({ url: `${DeleteCustomerPoolUrl}/${id}` });
|
||||
}
|
||||
|
||||
function noPickCustomerPool(id: string) {
|
||||
return CDR.get({ url: `${NoPickCustomerPoolUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 表单设计
|
||||
function saveFormDesignConfig(data: SaveFormDesignConfigParams) {
|
||||
return CDR.post({ url: SaveFormDesignConfigUrl, data });
|
||||
}
|
||||
|
||||
function getFormDesignConfig(id: string) {
|
||||
return CDR.get<FormDesignConfigDetailParams>(
|
||||
{ url: `${GetFormDesignConfigUrl}/${id}` },
|
||||
{ ignoreCancelToken: true }
|
||||
);
|
||||
}
|
||||
|
||||
function getFieldDeptUerTree() {
|
||||
return CDR.get<DeptUserTreeNode[]>({ url: GetFieldDeptUerTreeUrl });
|
||||
}
|
||||
|
||||
function getFieldDeptTree() {
|
||||
return CDR.get<DeptUserTreeNode[]>({ url: GetFieldDeptTreeUrl }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
function getFieldClueList(data: FormDesignDataSourceTableQueryParams) {
|
||||
return CDR.post<CommonList<ClueListItem>>({ url: GetFieldClueListUrl, data });
|
||||
}
|
||||
|
||||
function getFieldContractList(data: FormDesignDataSourceTableQueryParams) {
|
||||
return CDR.post<CommonList<ContractItem>>({ url: GetFieldContractListUrl, data });
|
||||
}
|
||||
|
||||
function getFieldInvoiceList(data: FormDesignDataSourceTableQueryParams) {
|
||||
return CDR.post<CommonList<ContractItem>>({ url: GetFieldInvoiceListUrl, data });
|
||||
}
|
||||
|
||||
function getFieldContractPaymentPlanList(data: FormDesignDataSourceTableQueryParams) {
|
||||
return CDR.post<CommonList<PaymentPlanItem>>({ url: GetFieldContractPaymentPlanListUrl, data });
|
||||
}
|
||||
|
||||
function getFieldContractPaymentRecordList(data: FormDesignDataSourceTableQueryParams) {
|
||||
return CDR.post<CommonList<PaymentRecordItem>>({ url: GetFieldContractPaymentRecordListUrl, data });
|
||||
}
|
||||
|
||||
function getFieldContactList(data: FormDesignDataSourceTableQueryParams) {
|
||||
return CDR.post<CommonList<CustomerContractListItem>>({ url: GetFieldContactListUrl, data });
|
||||
}
|
||||
|
||||
function getFieldCustomerList(data: FormDesignDataSourceTableQueryParams) {
|
||||
return CDR.post<CommonList<CustomerListItem>>({ url: GetFieldCustomerListUrl, data });
|
||||
}
|
||||
|
||||
function getFieldOpportunityList(data: FormDesignDataSourceTableQueryParams) {
|
||||
return CDR.post<CommonList<OpportunityItem>>({ url: GetFieldOpportunityListUrl, data });
|
||||
}
|
||||
|
||||
function getFieldProductList(data: FormDesignDataSourceTableQueryParams) {
|
||||
return CDR.post<CommonList<ProductListItem>>({ url: GetFieldProductListUrl, data });
|
||||
}
|
||||
|
||||
function getFieldCustomFormList(data: FormDesignDataSourceTableQueryParams) {
|
||||
return CDR.post<CommonList<CustomFormPageItem>>({ url: GetFieldCustomFormListUrl, data });
|
||||
}
|
||||
|
||||
function checkRepeat(data: CheckRepeatParams) {
|
||||
return CDR.post<CheckRepeatInfo>({ url: CheckRepeatUrl, data }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
function uploadTempFile(file: File | null) {
|
||||
return CDR.uploadFile<Result<string[]>>({ url: UploadTempFileUrl }, { fileList: [file] }, 'files', true);
|
||||
}
|
||||
|
||||
function uploadTempAttachment(file: File | null) {
|
||||
return CDR.uploadFile<Result<string[]>>({ url: UploadTempAttachmentUrl }, { fileList: [file] }, 'files', true);
|
||||
}
|
||||
|
||||
function previewAttachment(id: string) {
|
||||
return CDR.get({ url: `${PreviewAttachmentUrl}/${id}` });
|
||||
}
|
||||
|
||||
function downloadAttachment(id: string) {
|
||||
return CDR.get({ url: `${DownloadAttachmentUrl}/${id}`, responseType: 'blob' }, { isTransformResponse: false });
|
||||
}
|
||||
|
||||
function deleteAttachment(id: string) {
|
||||
return CDR.get({ url: `${DeleteAttachmentUrl}/${id}` });
|
||||
}
|
||||
|
||||
function previewPicture(id: string) {
|
||||
return CDR.get({ url: `${PreviewPictureUrl}/${id}` });
|
||||
}
|
||||
|
||||
function downloadPicture(id: string) {
|
||||
return CDR.get({ url: `${DownloadPictureUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 模块配置-原因配置
|
||||
function getReasonList(type: ReasonTypeEnum) {
|
||||
return CDR.get<ReasonItem[]>({ url: `${GetReasonUrl}/${type}` });
|
||||
}
|
||||
|
||||
function addReason(data: ReasonParams) {
|
||||
return CDR.post({ url: AddReasonUrl, data });
|
||||
}
|
||||
|
||||
function updateReason(data: ReasonParams) {
|
||||
return CDR.post({ url: UpdateReasonUrl, data });
|
||||
}
|
||||
|
||||
function deleteReasonItem(id: string) {
|
||||
return CDR.get({ url: `${DeleteReasonUrl}/${id}` });
|
||||
}
|
||||
|
||||
function getReasonConfig(type: ReasonTypeEnum) {
|
||||
return CDR.get<ReasonConfig>({ url: `${GetReasonConfigUrl}/${type}` });
|
||||
}
|
||||
|
||||
function updateReasonEnable(data: UpdateReasonEnableParams) {
|
||||
return CDR.post<ReasonConfig>({ url: UpdateReasonEnableUrl, data });
|
||||
}
|
||||
|
||||
function sortReason(data: SortReasonParams) {
|
||||
return CDR.post({ url: SortReasonUrl, data });
|
||||
}
|
||||
|
||||
function searchConfig(data: DefaultSearchSetFormModel) {
|
||||
return CDR.post({ url: SearchConfigUrl, data });
|
||||
}
|
||||
|
||||
function getSearchConfig() {
|
||||
return CDR.get<DefaultSearchSetFormModel>({ url: GetSearchConfigUrl });
|
||||
}
|
||||
|
||||
function resetSearchConfig() {
|
||||
return CDR.get({ url: ResetSearchConfigUrl });
|
||||
}
|
||||
|
||||
function moduleSearchMaskConfig(data: Record<string, any>) {
|
||||
return CDR.post({ url: ModuleMaskSearchConfigUrl, data });
|
||||
}
|
||||
|
||||
function getModuleSearchMaskConfig() {
|
||||
return CDR.get<Pick<DefaultSearchSetFormModel, 'searchFields'>>({ url: GetModuleMaskSearchConfigUrl });
|
||||
}
|
||||
|
||||
function getFieldPriceList(data: FormDesignDataSourceTableQueryParams) {
|
||||
return CDR.post<CommonList<ClueListItem>>({ url: GetFieldPriceListUrl, data });
|
||||
}
|
||||
|
||||
function getFieldQuotationList(data: FormDesignDataSourceTableQueryParams) {
|
||||
return CDR.post<CommonList<QuotationItem>>({ url: GetFieldQuotationListUrl, data });
|
||||
}
|
||||
|
||||
function getFieldOrderList(data: FormDesignDataSourceTableQueryParams) {
|
||||
return CDR.post<CommonList<OrderItem>>({ url: GetFieldOrderListUrl, data });
|
||||
}
|
||||
|
||||
function getFieldDisplayList(formKey: FormDesignKeyEnum | string) {
|
||||
return CDR.get<FormDesignConfigDetailParams>({ url: `${GetFieldDisplayListUrl}/${formKey}` });
|
||||
}
|
||||
|
||||
function getFieldBusinessTitleList(data: FormDesignDataSourceTableQueryParams) {
|
||||
return CDR.post<CommonList<BusinessTitleItem>>({ url: GetFieldBusinessTitleListUrl, data });
|
||||
}
|
||||
|
||||
function getDatasourceRefDetailList(data: GetRefDataSourceFieldParams) {
|
||||
return CDR.post<RefDataSourceFieldItem[]>({ url: GetFieldRefDetailListUrl, data }, { ignoreCancelToken: true });
|
||||
}
|
||||
|
||||
// 设置高级筛选开关
|
||||
function setDisplayAdvanced() {
|
||||
return CDR.get({ url: SetDisplayAdvancedUrl });
|
||||
}
|
||||
|
||||
// 高级筛选开关
|
||||
function getAdvancedSwitch() {
|
||||
return CDR.get({ url: GetAdvancedSwitchUrl });
|
||||
}
|
||||
|
||||
function getDatasourceFieldConfig(type: FormDesignKeyEnum | string, approvalTaskId?: string) {
|
||||
return CDR.get<FormDesignConfigDetailParams | CustomFormDetail>({ url: `${GetFieldConfigUrl}/${type}` });
|
||||
}
|
||||
|
||||
return {
|
||||
getFieldDisplayList,
|
||||
getModuleNavConfigList,
|
||||
moduleNavListSort,
|
||||
toggleModuleNavStatus,
|
||||
getModuleUserDeptTree,
|
||||
getModuleRoleTree,
|
||||
getOpportunityRuleList,
|
||||
addOpportunityRule,
|
||||
updateOpportunityRule,
|
||||
switchOpportunityStatus,
|
||||
deleteOpportunity,
|
||||
getCluePoolPage,
|
||||
addCluePool,
|
||||
updateCluePool,
|
||||
switchCluePoolStatus,
|
||||
deleteModuleCluePool,
|
||||
noPickCluePool,
|
||||
getCapacityPage,
|
||||
updateCapacity,
|
||||
addCapacity,
|
||||
deleteCapacity,
|
||||
getCustomerPoolPage,
|
||||
addCustomerPool,
|
||||
updateCustomerPool,
|
||||
switchCustomerPoolStatus,
|
||||
deleteCustomerPool,
|
||||
noPickCustomerPool,
|
||||
saveFormDesignConfig,
|
||||
getFormDesignConfig,
|
||||
getFieldDeptUerTree,
|
||||
getFieldDeptTree,
|
||||
getFieldClueList,
|
||||
getFieldContractList,
|
||||
getFieldInvoiceList,
|
||||
getFieldContractPaymentPlanList,
|
||||
getFieldContractPaymentRecordList,
|
||||
getFieldContactList,
|
||||
getFieldCustomerList,
|
||||
getFieldOpportunityList,
|
||||
getFieldProductList,
|
||||
checkRepeat,
|
||||
uploadTempFile,
|
||||
previewPicture,
|
||||
downloadPicture,
|
||||
getReasonList,
|
||||
addReason,
|
||||
updateReason,
|
||||
deleteReasonItem,
|
||||
getReasonConfig,
|
||||
updateReasonEnable,
|
||||
sortReason,
|
||||
searchConfig,
|
||||
getSearchConfig,
|
||||
resetSearchConfig,
|
||||
moduleSearchMaskConfig,
|
||||
getModuleSearchMaskConfig,
|
||||
getModuleTopNavList,
|
||||
setTopNavListSort,
|
||||
setDisplayAdvanced,
|
||||
getAdvancedSwitch,
|
||||
uploadTempAttachment,
|
||||
previewAttachment,
|
||||
deleteAttachment,
|
||||
downloadAttachment,
|
||||
getFieldPriceList,
|
||||
getFieldQuotationList,
|
||||
getFieldOrderList,
|
||||
getFieldBusinessTitleList,
|
||||
getDatasourceRefDetailList,
|
||||
getFieldCustomFormList,
|
||||
getDatasourceFieldConfig,
|
||||
};
|
||||
}
|
||||
207
frontend/packages/lib-shared/api/modules/system/org.ts
Normal file
207
frontend/packages/lib-shared/api/modules/system/org.ts
Normal file
@@ -0,0 +1,207 @@
|
||||
import type { CrmTreeNodeData } from '@cordys/web/src/components/pure/crm-tree/type';
|
||||
import type { CordysAxios } from '@lib/shared/api/http/Axios';
|
||||
import {
|
||||
addDepartmentUrl,
|
||||
addUserUrl,
|
||||
batchEditUserUrl,
|
||||
batchEnableUserUrl,
|
||||
batchResetPasswordUrl,
|
||||
checkDeleteDepartmentUrl,
|
||||
checkSyncUserFromThirdUrl,
|
||||
deleteDepartmentUrl,
|
||||
deleteUserCheckUrl,
|
||||
deleteUserUrl,
|
||||
getDepartmentTreeUrl,
|
||||
getAdminOptionsUrl,
|
||||
getOrgDepartmentUserUrl,
|
||||
CheckSyncUrl,
|
||||
getRoleOptionsUrl,
|
||||
getUserDetailUrl,
|
||||
getUserListUrl,
|
||||
getUserOptionsUrl,
|
||||
importUserPreCheckUrl,
|
||||
importUserUrl,
|
||||
renameDepartmentUrl,
|
||||
resetUserPasswordUrl,
|
||||
setCommanderUrl,
|
||||
sortDepartmentUrl,
|
||||
syncOrgUrl,
|
||||
updateUserNameUrl,
|
||||
updateUserUrl,
|
||||
} from '@lib/shared/api/requrls/system/org';
|
||||
import type { CommonList } from '@lib/shared/models/common';
|
||||
import type {
|
||||
DepartmentItemParams,
|
||||
DragNodeParams,
|
||||
MemberItem,
|
||||
MemberParams,
|
||||
SetCommanderParams,
|
||||
UpdateDepartmentItemParams,
|
||||
UserTableQueryParams,
|
||||
ValidateInfo,
|
||||
} from '@lib/shared/models/system/org';
|
||||
import type { DeptUserTreeNode } from '@lib/shared/models/system/role';
|
||||
|
||||
export default function useProductApi(CDR: CordysAxios) {
|
||||
// 组织架构-部门树查询
|
||||
function getDepartmentTree() {
|
||||
return CDR.get<CrmTreeNodeData[]>({ url: getDepartmentTreeUrl });
|
||||
}
|
||||
|
||||
// 组织架构-添加子部门
|
||||
function addDepartment(data: DepartmentItemParams) {
|
||||
return CDR.post({ url: addDepartmentUrl, data });
|
||||
}
|
||||
|
||||
// 组织架构-重命名部门
|
||||
function renameDepartment(data: UpdateDepartmentItemParams) {
|
||||
return CDR.post({ url: renameDepartmentUrl, data });
|
||||
}
|
||||
|
||||
// 组织架构-设置部门负责人
|
||||
function setCommander(data: SetCommanderParams) {
|
||||
return CDR.post({ url: setCommanderUrl, data });
|
||||
}
|
||||
|
||||
// 组织架构-删除部门
|
||||
function deleteDepartment(data: (string | number)[]) {
|
||||
return CDR.post({ url: deleteDepartmentUrl, data });
|
||||
}
|
||||
|
||||
// 组织架构-删除部门校验
|
||||
function checkDeleteDepartment(data: (string | number)[]) {
|
||||
return CDR.post({ url: checkDeleteDepartmentUrl, data });
|
||||
}
|
||||
|
||||
// 组织架构-部门排序
|
||||
function sortDepartment(data: DragNodeParams) {
|
||||
return CDR.post({ url: sortDepartmentUrl, data });
|
||||
}
|
||||
|
||||
// 用户(员工)-添加员工
|
||||
function addUser(data: MemberParams) {
|
||||
return CDR.post({ url: addUserUrl, data });
|
||||
}
|
||||
|
||||
// 用户(员工)-更新员工
|
||||
function updateUser(data: MemberParams) {
|
||||
return CDR.post({ url: updateUserUrl, data });
|
||||
}
|
||||
|
||||
// 用户(员工)-更新员工姓名
|
||||
function updateOrgUserName(data: { userId: string; name: string }) {
|
||||
return CDR.post({ url: updateUserNameUrl, data });
|
||||
}
|
||||
|
||||
// 用户(员工)-列表查询
|
||||
function getUserList(data: UserTableQueryParams) {
|
||||
return CDR.post<CommonList<MemberItem>>({ url: getUserListUrl, data });
|
||||
}
|
||||
|
||||
// 用户(员工)-员工详情
|
||||
function getUserDetail(userId: string) {
|
||||
return CDR.get<MemberParams>({ url: `${getUserDetailUrl}/${userId}` });
|
||||
}
|
||||
|
||||
// 用户(员工)-批量启用|禁用
|
||||
function batchToggleStatusUser(data: UserTableQueryParams) {
|
||||
return CDR.post({ url: batchEnableUserUrl, data });
|
||||
}
|
||||
|
||||
// 用户(员工)-批量重置密码
|
||||
function batchResetUserPassword(data: UserTableQueryParams) {
|
||||
return CDR.post({ url: batchResetPasswordUrl, data });
|
||||
}
|
||||
|
||||
// 用户(员工)-重置密码
|
||||
function resetUserPassword(userId: string) {
|
||||
return CDR.get({ url: `${resetUserPasswordUrl}/${userId}` });
|
||||
}
|
||||
|
||||
// 用户(员工)- 同步组织架构
|
||||
function syncOrg(type: string) {
|
||||
return CDR.get({ url: `${syncOrgUrl}/${type}` });
|
||||
}
|
||||
|
||||
// 用户(员工)-批量编辑
|
||||
function batchEditUser(data: UserTableQueryParams) {
|
||||
return CDR.post({ url: batchEditUserUrl, data });
|
||||
}
|
||||
|
||||
// 用户(员工)-excel导入检查
|
||||
function importUserPreCheck(file: File) {
|
||||
return CDR.uploadFile<{ data: ValidateInfo }>({ url: importUserPreCheckUrl }, { fileList: [file] }, 'file');
|
||||
}
|
||||
|
||||
// 用户(员工)-获取用户下拉
|
||||
function getUserOptions() {
|
||||
return CDR.get({ url: getUserOptionsUrl });
|
||||
}
|
||||
|
||||
// 用户(员工)-获取审批管理员下拉
|
||||
function getAdminOptions() {
|
||||
return CDR.get<{ id: string; name: string }[]>({ url: getAdminOptionsUrl });
|
||||
}
|
||||
|
||||
// 用户(员工)-获取角色下拉
|
||||
function getRoleOptions() {
|
||||
return CDR.get({ url: getRoleOptionsUrl });
|
||||
}
|
||||
|
||||
// 用户(员工)-excel导入
|
||||
function importUsers(file: File) {
|
||||
return CDR.uploadFile({ url: importUserUrl }, { fileList: [file] }, 'file');
|
||||
}
|
||||
|
||||
// 用户(员工)-删除员工
|
||||
function deleteUser(userId: string) {
|
||||
return CDR.get({ url: `${deleteUserUrl}/${userId}` });
|
||||
}
|
||||
// 用户(员工)-删除员工校验
|
||||
function deleteUserCheck(userId: string) {
|
||||
return CDR.get({ url: `${deleteUserCheckUrl}/${userId}` });
|
||||
}
|
||||
// 用户(员工)-是否同步三方校验
|
||||
function checkSyncUserFromThird() {
|
||||
return CDR.get({ url: checkSyncUserFromThirdUrl });
|
||||
}
|
||||
|
||||
// 获取当前部门下组织架构
|
||||
function getOrgDepartmentUser(data: { id: string }) {
|
||||
return CDR.get<DeptUserTreeNode[]>({ url: `${getOrgDepartmentUserUrl}/${data.id}` });
|
||||
}
|
||||
|
||||
function checkSync() {
|
||||
return CDR.get<boolean>({ url: CheckSyncUrl });
|
||||
}
|
||||
|
||||
return {
|
||||
getDepartmentTree,
|
||||
addDepartment,
|
||||
renameDepartment,
|
||||
setCommander,
|
||||
deleteDepartment,
|
||||
addUser,
|
||||
updateUser,
|
||||
getUserList,
|
||||
getUserDetail,
|
||||
batchToggleStatusUser,
|
||||
batchResetUserPassword,
|
||||
resetUserPassword,
|
||||
syncOrg,
|
||||
batchEditUser,
|
||||
importUserPreCheck,
|
||||
getUserOptions,
|
||||
getAdminOptions,
|
||||
getRoleOptions,
|
||||
importUsers,
|
||||
deleteUser,
|
||||
deleteUserCheck,
|
||||
checkSyncUserFromThird,
|
||||
checkDeleteDepartment,
|
||||
sortDepartment,
|
||||
updateOrgUserName,
|
||||
getOrgDepartmentUser,
|
||||
checkSync,
|
||||
};
|
||||
}
|
||||
195
frontend/packages/lib-shared/api/modules/system/process.ts
Normal file
195
frontend/packages/lib-shared/api/modules/system/process.ts
Normal file
@@ -0,0 +1,195 @@
|
||||
import type { CordysAxios } from '@lib/shared/api/http/Axios';
|
||||
import {
|
||||
ApprovalPermissionsUrl,
|
||||
AddApprovalProcessUrl,
|
||||
UpdateApprovalProcessUrl,
|
||||
DeleteApprovalProcessUrl,
|
||||
ApprovalProcessDetailUrl,
|
||||
ToggleApprovalProcessUrl,
|
||||
ApprovalProcessPageUrl,
|
||||
GetApprovalConfigDetailUrl,
|
||||
GetResourceApprovingDetailUrl,
|
||||
ReviewResourceUrl,
|
||||
RevokeResourceUrl,
|
||||
GetApprovalResourceDetailUrl,
|
||||
GetProcessedApprovalTodosUrl,
|
||||
GetPendingApprovalTodosUrl,
|
||||
GetInitiatedApprovalTodosUrl,
|
||||
GetCcApprovalTodosUrl,
|
||||
RejectApprovalUrl,
|
||||
BackApprovalUrl,
|
||||
AddSignApprovalUrl,
|
||||
GetTodoStatisticUrl,
|
||||
AgreeApprovalUrl,
|
||||
RevokeApprovalUrl,
|
||||
BatchRejectApprovalUrl,
|
||||
BatchApprovalApprovalUrl,
|
||||
TestApprovalWebHookUrl,
|
||||
} from '@lib/shared/api/requrls/system/process';
|
||||
import {
|
||||
AddApprovalProcessParams,
|
||||
ApprovalPermissionsDetail,
|
||||
ApprovalProcessDetail,
|
||||
ApprovalProcessItem,
|
||||
ApprovalWebhookConfig,
|
||||
CommonApprovalActionParams,
|
||||
UpdateApprovalProcessParams,
|
||||
type ApprovalAddSignParams,
|
||||
type ApprovalBackParams,
|
||||
type ApprovalDetail,
|
||||
type ApprovalOperationParams,
|
||||
type ApprovalTodoItem,
|
||||
type ApprovalTodoTableParams,
|
||||
type BatchApprovalParams,
|
||||
type BatchRejectApprovalParams,
|
||||
type TodoStatistic,
|
||||
} from '@lib/shared/models/system/process';
|
||||
import type { CommonList } from '@lib/shared/models/common';
|
||||
import type { TableQueryParams } from '@lib/shared/models/common';
|
||||
|
||||
export default function useProcessApi(CDR: CordysAxios) {
|
||||
// 审批流数据权限
|
||||
function getApprovalPermissions(type: string) {
|
||||
return CDR.get<ApprovalPermissionsDetail>({ url: `${ApprovalPermissionsUrl}/${type}` });
|
||||
}
|
||||
// 审批流配置详情 用于列表里边查询对应状态审批流详情
|
||||
function getApprovalConfigDetail(type: string) {
|
||||
return CDR.get<ApprovalProcessDetail>({ url: `${GetApprovalConfigDetailUrl}/${type}` });
|
||||
}
|
||||
// 审批流数据权限
|
||||
function getApprovalProcessList(data: TableQueryParams) {
|
||||
return CDR.post<CommonList<ApprovalProcessItem>>({ url: ApprovalProcessPageUrl, data });
|
||||
}
|
||||
// 添加审批流
|
||||
function addApprovalProcess(data: AddApprovalProcessParams) {
|
||||
return CDR.post({ url: AddApprovalProcessUrl, data });
|
||||
}
|
||||
// 更新审批流
|
||||
function updateApprovalProcess(data: UpdateApprovalProcessParams) {
|
||||
return CDR.post({ url: UpdateApprovalProcessUrl, data });
|
||||
}
|
||||
// 审批流详情
|
||||
function approvalProcessDetail(id: string) {
|
||||
return CDR.get<ApprovalProcessDetail>({ url: `${ApprovalProcessDetailUrl}/${id}` });
|
||||
}
|
||||
// 删除审批流
|
||||
function deleteApprovalProcess(id: string) {
|
||||
return CDR.get({ url: `${DeleteApprovalProcessUrl}/${id}` });
|
||||
}
|
||||
// 切换审批流
|
||||
function toggleApprovalProcess(id: string, enable: boolean) {
|
||||
return CDR.get({ url: `${ToggleApprovalProcessUrl}/${id}`, params: { enable } });
|
||||
}
|
||||
// 获取对应资源审批状态详情用于(列表小卡片)
|
||||
function getResourceApprovingDetail(sourceId: string) {
|
||||
return CDR.get({ url: `${GetResourceApprovingDetailUrl}/${sourceId}` });
|
||||
}
|
||||
|
||||
// 获取已处理审批待办列表
|
||||
function getProcessedApprovalList(data: ApprovalTodoTableParams) {
|
||||
return CDR.post<CommonList<ApprovalTodoItem>>({ url: GetProcessedApprovalTodosUrl, data });
|
||||
}
|
||||
|
||||
// 获取待处理审批待办列表
|
||||
function getPendingApprovalList(data: ApprovalTodoTableParams) {
|
||||
return CDR.post<CommonList<ApprovalTodoItem>>({ url: GetPendingApprovalTodosUrl, data });
|
||||
}
|
||||
|
||||
// 获取我发起的审批待办列表
|
||||
function getInitiatedApprovalList(data: ApprovalTodoTableParams) {
|
||||
return CDR.post<CommonList<ApprovalTodoItem>>({ url: GetInitiatedApprovalTodosUrl, data });
|
||||
}
|
||||
|
||||
// 获取抄送我的审批待办列表
|
||||
function getCcApprovalList(data: ApprovalTodoTableParams) {
|
||||
return CDR.post<CommonList<ApprovalTodoItem>>({ url: GetCcApprovalTodosUrl, data });
|
||||
}
|
||||
|
||||
// 驳回
|
||||
function rejectApproval(data: ApprovalOperationParams) {
|
||||
return CDR.post({ url: RejectApprovalUrl, data });
|
||||
}
|
||||
|
||||
// 退回
|
||||
function backApproval(data: ApprovalBackParams) {
|
||||
return CDR.post({ url: BackApprovalUrl, data });
|
||||
}
|
||||
|
||||
// 加签
|
||||
function addSignApproval(data: ApprovalAddSignParams) {
|
||||
return CDR.post({ url: AddSignApprovalUrl, data });
|
||||
}
|
||||
|
||||
// 撤回
|
||||
function revokeApproval(data: { id: string }) {
|
||||
return CDR.post({ url: RevokeApprovalUrl, data });
|
||||
}
|
||||
|
||||
// 同意
|
||||
function agreeApproval(data: ApprovalOperationParams) {
|
||||
return CDR.post({ url: AgreeApprovalUrl, data });
|
||||
}
|
||||
|
||||
// 批量驳回
|
||||
function batchRejectApproval(data: BatchRejectApprovalParams) {
|
||||
return CDR.post({ url: BatchRejectApprovalUrl, data });
|
||||
}
|
||||
|
||||
// 批量同意
|
||||
function batchAgreeApproval(data: BatchApprovalParams) {
|
||||
return CDR.post({ url: BatchApprovalApprovalUrl, data });
|
||||
}
|
||||
|
||||
// 获取审批资源详情
|
||||
function getApprovalResourceDetail(id: string) {
|
||||
return CDR.get<ApprovalDetail>({ url: `${GetApprovalResourceDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取待办统计
|
||||
function getTodoStatistic() {
|
||||
return CDR.get<TodoStatistic>({ url: GetTodoStatisticUrl });
|
||||
}
|
||||
|
||||
// 提审
|
||||
function reviewResource(data: CommonApprovalActionParams) {
|
||||
return CDR.post({ url: ReviewResourceUrl, data });
|
||||
}
|
||||
|
||||
// 撤销
|
||||
function revokeResource(data: CommonApprovalActionParams) {
|
||||
return CDR.post({ url: RevokeResourceUrl, data });
|
||||
}
|
||||
|
||||
// WebHook连接测试
|
||||
function testApprovalWebHook(data: ApprovalWebhookConfig) {
|
||||
return CDR.post({ url: TestApprovalWebHookUrl, data });
|
||||
}
|
||||
|
||||
return {
|
||||
getApprovalProcessList,
|
||||
getApprovalPermissions,
|
||||
addApprovalProcess,
|
||||
updateApprovalProcess,
|
||||
approvalProcessDetail,
|
||||
deleteApprovalProcess,
|
||||
toggleApprovalProcess,
|
||||
getApprovalConfigDetail,
|
||||
getResourceApprovingDetail,
|
||||
reviewResource,
|
||||
revokeResource,
|
||||
getProcessedApprovalList,
|
||||
getPendingApprovalList,
|
||||
getInitiatedApprovalList,
|
||||
getCcApprovalList,
|
||||
rejectApproval,
|
||||
backApproval,
|
||||
addSignApproval,
|
||||
getApprovalResourceDetail,
|
||||
getTodoStatistic,
|
||||
revokeApproval,
|
||||
agreeApproval,
|
||||
batchRejectApproval,
|
||||
batchAgreeApproval,
|
||||
testApprovalWebHook,
|
||||
};
|
||||
}
|
||||
119
frontend/packages/lib-shared/api/modules/system/role.ts
Normal file
119
frontend/packages/lib-shared/api/modules/system/role.ts
Normal file
@@ -0,0 +1,119 @@
|
||||
import type { CordysAxios } from '@lib/shared/api/http/Axios';
|
||||
import {
|
||||
BatchRemoveRoleMemberUrl,
|
||||
CreateRoleUrl,
|
||||
DeleteRoleUrl,
|
||||
GetDeptTreeUrl,
|
||||
GetPermissionsUrl,
|
||||
GetRoleDeptTreeUrl,
|
||||
GetRoleDetailUrl,
|
||||
GetRoleMemberTreeUrl,
|
||||
GetRoleMemberUrl,
|
||||
GetRolesUrl,
|
||||
GetUserOptionUrl,
|
||||
RelateRoleUrl,
|
||||
RemoveRoleMemberUrl,
|
||||
UpdateRoleUrl,
|
||||
} from '@lib/shared/api/requrls/system/role';
|
||||
import type { CommonList } from '@lib/shared/models/common';
|
||||
import type {
|
||||
DeptTreeNode,
|
||||
DeptUserTreeNode,
|
||||
PermissionTreeNode,
|
||||
RelateRoleMemberParams,
|
||||
RoleCreateParams,
|
||||
RoleDetail,
|
||||
RoleItem,
|
||||
RoleMemberItem,
|
||||
RoleMemberTableQueryParams,
|
||||
RoleUpdateParams,
|
||||
} from '@lib/shared/models/system/role';
|
||||
|
||||
export default function useProductApi(CDR: CordysAxios) {
|
||||
// 角色关联用户
|
||||
function relateRoleMember(data: RelateRoleMemberParams) {
|
||||
return CDR.post({ url: RelateRoleUrl, data });
|
||||
}
|
||||
|
||||
// 获取角色关联用户列表
|
||||
function getRoleMember(data: RoleMemberTableQueryParams) {
|
||||
return CDR.post<CommonList<RoleMemberItem>>({ url: GetRoleMemberUrl, data });
|
||||
}
|
||||
|
||||
// 批量移除角色关联用户
|
||||
function batchRemoveRoleMember(data: (string | number)[]) {
|
||||
return CDR.post({ url: BatchRemoveRoleMemberUrl, data });
|
||||
}
|
||||
|
||||
// 更新角色
|
||||
function updateRole(data: RoleUpdateParams) {
|
||||
return CDR.post({ url: UpdateRoleUrl, data });
|
||||
}
|
||||
|
||||
// 新建角色
|
||||
function createRole(data: RoleCreateParams) {
|
||||
return CDR.post({ url: CreateRoleUrl, data });
|
||||
}
|
||||
|
||||
// 获取角色关联用户树
|
||||
function getRoleMemberTree(params: { roleId: string }) {
|
||||
return CDR.get({ url: `${GetRoleMemberTreeUrl}/${params.roleId}` });
|
||||
}
|
||||
|
||||
// 获取部门用户树
|
||||
function getRoleDeptUserTree(params: { roleId: string }) {
|
||||
return CDR.get<DeptUserTreeNode[]>({ url: `${GetRoleDeptTreeUrl}/${params.roleId}` });
|
||||
}
|
||||
|
||||
// 获取部门树
|
||||
function getRoleDeptTree() {
|
||||
return CDR.get<DeptTreeNode[]>({ url: GetDeptTreeUrl });
|
||||
}
|
||||
|
||||
// 移除角色关联用户
|
||||
function removeRoleMember(id: string) {
|
||||
return CDR.get({ url: `${RemoveRoleMemberUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取全量权限
|
||||
function getPermissions() {
|
||||
return CDR.get<PermissionTreeNode[]>({ url: GetPermissionsUrl });
|
||||
}
|
||||
|
||||
// 获取角色列表
|
||||
function getRoles() {
|
||||
return CDR.get<RoleItem[]>({ url: GetRolesUrl });
|
||||
}
|
||||
|
||||
// 获取角色详情
|
||||
function getRoleDetail(id: string) {
|
||||
return CDR.get<RoleDetail>({ url: `${GetRoleDetailUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 删除角色
|
||||
function deleteRole(id: string) {
|
||||
return CDR.get({ url: `${DeleteRoleUrl}/${id}` });
|
||||
}
|
||||
|
||||
// 获取用户列表
|
||||
function getUsers(data: { roleId: string }) {
|
||||
return CDR.get<RoleItem[]>({ url: `${GetUserOptionUrl}/${data.roleId}` });
|
||||
}
|
||||
|
||||
return {
|
||||
relateRoleMember,
|
||||
getRoleMember,
|
||||
batchRemoveRoleMember,
|
||||
updateRole,
|
||||
createRole,
|
||||
getRoleMemberTree,
|
||||
getRoleDeptUserTree,
|
||||
getRoleDeptTree,
|
||||
removeRoleMember,
|
||||
getPermissions,
|
||||
getRoles,
|
||||
getRoleDetail,
|
||||
deleteRole,
|
||||
getUsers,
|
||||
};
|
||||
}
|
||||
24
frontend/packages/lib-shared/api/requrls/agent.ts
Normal file
24
frontend/packages/lib-shared/api/requrls/agent.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
export const agentModuleRenameUrl = '/agent/module/rename'; // 重命名智能体模块
|
||||
export const agentModuleMoveUrl = '/agent/module/move'; // 移动智能体模块
|
||||
export const agentModuleDeleteUrl = '/agent/module/delete'; // 删除智能体模块
|
||||
export const agentModuleAddUrl = '/agent/module/add'; // 添加智能体模块
|
||||
export const agentModuleTreeUrl = '/agent/module/tree'; // 获取智能体模块树
|
||||
export const agentModuleCountUrl = '/agent/module/count'; // 获取智能体模块数量
|
||||
export const agentPosUrl = '/agent/edit/pos'; // 智能体排序
|
||||
|
||||
export const updateAgentUrl = '/agent/update'; // 更新智能体
|
||||
export const renameAgentUrl = '/agent/rename'; // 重命名智能体
|
||||
export const agentPageUrl = '/agent/page'; // 获取智能体列表
|
||||
export const agentCollectPageUrl = '/agent/collect/page'; // 获取收藏的智能体列表
|
||||
export const addAgentUrl = '/agent/add'; // 添加智能体
|
||||
export const unCollectAgentUrl = '/agent/un-collect'; // 取消收藏智能体
|
||||
export const agentDetailUrl = '/agent/detail'; // 获取智能体详情
|
||||
export const agentDeleteUrl = '/agent/delete'; // 删除智能体
|
||||
export const agentCollectUrl = '/agent/collect'; // 收藏智能体
|
||||
export const agentOptionUrl = '/agent/option'; // 智能体选项
|
||||
|
||||
export const agentApplicationUrl = '/agent/application'; // 智能体应用
|
||||
export const agentWorkspaceUrl = '/agent/workspace'; // 智能体工作空间
|
||||
export const agentScriptUrl = '/agent/script'; // 工作空间应用对应脚本
|
||||
export const getMkAgentVersionUrl = '/agent/edition'; // 获取智能体mk版本
|
||||
export const getMkApplicationUrl = '/agent/application/config'; // 获取智能体mk应用配置
|
||||
88
frontend/packages/lib-shared/api/requrls/clue/index.ts
Normal file
88
frontend/packages/lib-shared/api/requrls/clue/index.ts
Normal file
@@ -0,0 +1,88 @@
|
||||
// 线索
|
||||
export const GetClueFormConfigUrl = '/lead/module/form'; // 获取线索表单配置
|
||||
export const UpdateClueUrl = '/lead/update'; // 更新线索
|
||||
export const UpdateClueStatusUrl = '/lead/status/update'; // 更新线索状态
|
||||
export const GetClueListUrl = '/lead/page'; // 分页查询线索
|
||||
export const GetClueTransitionCustomerListUrl = '/lead/transition/account/page'; // 线索转为客户列表
|
||||
export const AddClueUrl = '/lead/add'; // 添加线索
|
||||
export const GetClueUrl = '/lead/get'; // 获取线索详情
|
||||
export const DeleteClueUrl = '/lead/delete'; // 删除线索
|
||||
export const BatchTransferClueUrl = '/lead/batch/transfer'; // 批量转移线索
|
||||
export const BatchToPoolClueUrl = '/lead/batch/to-pool'; // 批量移入线索池
|
||||
export const BatchDeleteClueUrl = '/lead/batch/delete'; // 批量删除线索
|
||||
export const ExportClueAllUrl = '/lead/export'; // 导出全部线索
|
||||
export const ExportClueSelectedUrl = '/lead/export-select'; // 导出选中线索
|
||||
export const ReTransitionCustomerUrl = '/lead/re-transition/account'; // 合并线索转为客户
|
||||
export const MoveToPoolLeadUrl = '/lead/to-pool'; // 移入线索池
|
||||
export const TransformClueUrl = '/lead/transform'; // 转换线索
|
||||
export const GetAdvancedSearchClueListUrl = '/advanced/search/lead'; // 全局搜索线索分页查询线索
|
||||
export const GetAdvancedSearchClueDetailUrl = '/advanced/search/lead/detail'; // 全局搜索线索详情
|
||||
export const GetGlobalSearchClueListUrl = '/global/search/lead';
|
||||
export const GetGlobalCluePoolListUrl = '/global/search/clue_pool';
|
||||
export const BatchUpdateLeadUrl = '/lead/batch/update'; // 批量更新线索
|
||||
export const GenerateLeadChartUrl = '/lead/chart'; // 生成线索图表
|
||||
|
||||
// 跟进记录
|
||||
export const UpdateClueFollowRecordUrl = '/lead/follow/record/update'; // 更新跟进记录
|
||||
export const GetClueFollowRecordListUrl = '/lead/follow/record/page'; // 获取跟进记录列表
|
||||
export const AddClueFollowRecordUrl = '/lead/follow/record/add'; // 添加跟进记录
|
||||
export const GetClueFollowRecordUrl = '/lead/follow/record/get'; // 获取跟进记录详情
|
||||
export const DeleteClueFollowRecordUrl = '/lead/follow/record/delete'; // 删除跟进记录
|
||||
|
||||
// 跟进计划
|
||||
export const UpdateClueFollowPlanUrl = '/lead/follow/plan/update'; // 更新跟进计划
|
||||
export const GetClueFollowPlanListUrl = '/lead/follow/plan/page'; // 获取跟进计划列表
|
||||
export const AddClueFollowPlanUrl = '/lead/follow/plan/add'; // 添加跟进计划
|
||||
export const GetClueFollowPlanUrl = '/lead/follow/plan/get'; // 跟进计划详情
|
||||
export const CancelClueFollowPlanUrl = '/lead/follow/plan/cancel'; // 取消跟进计划
|
||||
export const DeleteClueFollowPlanUrl = '/lead/follow/plan/delete'; // 删除跟进计划
|
||||
export const UpdateClueFollowPlanStatusUrl = '/lead/follow/plan/status/update'; // 更新线索跟进计划状态
|
||||
|
||||
export const GetClueHeaderListUrl = '/lead/owner/history/list'; // 线索负责人记录列表
|
||||
|
||||
// 线索池客户
|
||||
export const PickClueUrl = '/pool/lead/pick'; // 领取线索
|
||||
export const GetCluePoolListUrl = '/pool/lead/page'; // 分页查询线索池线索
|
||||
export const BatchPickClueUrl = '/pool/lead/batch-pick'; // 批量领取线索
|
||||
export const BatchDeleteCluePoolUrl = '/pool/lead/batch-delete'; // 批量删除线索池线索
|
||||
export const BatchAssignClueUrl = '/pool/lead/batch-assign'; // 批量分配线索
|
||||
export const AssignClueUrl = '/pool/lead/assign'; // 分配线索
|
||||
export const GetPoolOptionsUrl = '/pool/lead/options'; // 获取当前用户线索池选项
|
||||
export const DeleteCluePoolUrl = '/pool/lead/delete'; // 删除线索池线索
|
||||
export const GetPoolClueUrl = '/pool/lead/get'; // 获取线索池详情
|
||||
export const ClueTransitionCustomerUrl = '/lead/transition/account'; // 转为客户
|
||||
export const GetAdvancedCluePoolListUrl = '/advanced/search/lead-pool'; // 全局搜索分页查询线索池线索
|
||||
export const ExportCluePoolAllUrl = '/pool/lead/export-all'; // 导出全部线索池线索
|
||||
export const ExportCluePoolSelectedUrl = '/pool/lead/export-select'; // 导出选中线索池线索
|
||||
export const BatchUpdateCluePoolUrl = '/pool/lead/batch-update'; // 批量更新线索池线索
|
||||
export const GenerateLeadPoolChartUrl = '/pool/lead/chart'; // 生成线索池图表
|
||||
|
||||
// 线索池跟进记录
|
||||
export const GetCluePoolFollowRecordListUrl = '/lead/follow/record/pool/page'; // 获取跟进记录列表
|
||||
|
||||
export const GetClueTabUrl = '/lead/tab'; // 线索tab显隐
|
||||
|
||||
// 视图
|
||||
export const GetClueViewDetailUrl = '/lead/view/detail';
|
||||
export const GetClueViewListUrl = '/lead/view/list';
|
||||
export const AddClueViewUrl = '/lead/view/add';
|
||||
export const UpdateClueViewUrl = '/lead/view/update';
|
||||
export const DeleteClueViewUrl = '/lead/view/delete';
|
||||
export const FixedClueViewUrl = '/lead/view/fixed';
|
||||
export const EnableClueViewUrl = '/lead/view/enable';
|
||||
export const DragClueViewUrl = '/lead/view/edit/pos';
|
||||
|
||||
// 导入
|
||||
export const PreCheckImportUrl = '/lead/import/pre-check';
|
||||
export const DownloadTemplateUrl = '/lead/template/download';
|
||||
export const ImportLeadUrl = '/lead/import';
|
||||
|
||||
// 线索池视图
|
||||
export const GetPoolLeadViewDetailUrl = 'pool/lead/view/detail';
|
||||
export const GetPoolLeadViewListUrl = 'pool/lead/view/list';
|
||||
export const AddPoolLeadViewUrl = 'pool/lead/view/add';
|
||||
export const UpdatePoolLeadViewUrl = 'pool/lead/view/update';
|
||||
export const DeletePoolLeadViewUrl = 'pool/lead/view/delete';
|
||||
export const FixedPoolLeadViewUrl = 'pool/lead/view/fixed';
|
||||
export const EnablePoolLeadViewUrl = 'pool/lead/view/enable';
|
||||
export const DragPoolLeadViewUrl = 'pool/lead/view/edit/pos';
|
||||
150
frontend/packages/lib-shared/api/requrls/contract.ts
Normal file
150
frontend/packages/lib-shared/api/requrls/contract.ts
Normal file
@@ -0,0 +1,150 @@
|
||||
// 合同列表
|
||||
export const ContractPageUrl = '/contract/page'; // 合同列表
|
||||
export const ContractAddUrl = '/contract/add'; // 添加合同
|
||||
export const ContractUpdateUrl = '/contract/update'; // 更新合同
|
||||
export const ContractDeleteUrl = '/contract/delete'; // 删除合同
|
||||
export const GetContractDetailUrl = '/contract/get'; // 获取合同详情
|
||||
export const GetContractDetailSnapshotUrl = '/contract/get/snapshot'; // 获取合同详情快照
|
||||
export const GetContractFormConfigUrl = '/contract/module/form'; // 合同表单配置
|
||||
export const GetContractFormSnapshotConfigUrl = '/contract/module/form/snapshot'; // 合同表单配置
|
||||
export const GetContractTabUrl = '/contract/tab'; // 合同tab显隐
|
||||
export const ChangeContractStatusUrl = '/contract/update/stage';
|
||||
export const BatchApproveContractUrl = '/contract/batch/approval';
|
||||
export const BatchUpdateContractUrl = '/contract/batch/update';
|
||||
export const ApproveContractUrl = '/contract/approval';
|
||||
export const RevokeContractUrl = '/contract/revoke';
|
||||
export const ContractStatisticUrl = '/contract/statistic';
|
||||
export const SortContractUrl = '/contract/sort';
|
||||
|
||||
// 合同导出
|
||||
export const ExportContractAllUrl = '/contract/export-all'; // 合同导出全量
|
||||
export const ExportContractSelectedUrl = '/contract/export-select'; // 合同导出选中
|
||||
|
||||
// 合同图表
|
||||
export const GenerateContractChartUrl = '/contract/chart'; // 生成合同图表
|
||||
|
||||
// 合同视图
|
||||
export const AddContractViewUrl = '/contract/view/add'; // 添加合同视图
|
||||
export const UpdateContractViewUrl = '/contract/view/update'; // 更新合同视图
|
||||
export const GetContractViewListUrl = '/contract/view/list'; // 获取合同视图列表
|
||||
export const GetContractViewDetailUrl = '/contract/view/detail'; // 获取合同视图详情
|
||||
export const FixedContractViewUrl = '/contract/view/fixed'; // 固定合同视图
|
||||
export const EnableContractViewUrl = '/contract/view/enable'; // 启用合同视图
|
||||
export const DeleteContractViewUrl = '/contract/view/delete'; // 删除合同视图
|
||||
export const DragContractViewUrl = '/contract/view/edit/pos'; // 拖拽合同视图排序
|
||||
|
||||
// 回款计划列表
|
||||
export const PaymentPlanPageUrl = '/contract/payment-plan/page'; // 回款计划列表
|
||||
export const ContractPaymentPlanPageUrl = '/contract/contract-payment-plan/page'; // 回款计划列表
|
||||
export const PaymentPlanAddUrl = '/contract/payment-plan/add'; // 添加回款计划
|
||||
export const PaymentPlanUpdateUrl = '/contract/payment-plan/update'; // 更新回款计划
|
||||
export const PaymentPlanDeleteUrl = '/contract/payment-plan/delete'; // 删除回款计划
|
||||
export const GetPaymentPlanDetailUrl = '/contract/payment-plan/get'; // 获取回款计划详情
|
||||
export const GetPaymentPlanFormConfigUrl = '/contract/payment-plan/module/form'; // 回款计划表单配置
|
||||
export const GetPaymentPlanTabUrl = '/contract/payment-plan/tab'; // 回款计划tab显隐
|
||||
|
||||
// 回款计划导出
|
||||
export const ExportPaymentPlanAllUrl = '/contract/payment-plan/export-all'; // 回款计划导出全量
|
||||
export const ExportPaymentPlanSelectedUrl = '/contract/payment-plan/export-select'; // 回款计划导出选中
|
||||
|
||||
// 回款计划图表
|
||||
export const GeneratePaymentPlanChartUrl = '/contract/payment-plan/chart'; // 生成回款计划图表
|
||||
|
||||
// 回款计划视图
|
||||
export const AddPaymentPlanViewUrl = '/contract/payment-plan/view/add'; // 添加回款计划视图
|
||||
export const UpdatePaymentPlanViewUrl = '/contract/payment-plan/view/update'; // 更新回款计划视图
|
||||
export const GetPaymentPlanViewListUrl = '/contract/payment-plan/view/list'; // 获取回款计划视图列表
|
||||
export const GetPaymentPlanViewDetailUrl = '/contract/payment-plan/view/detail'; // 获取回款计划视图详情
|
||||
export const FixedPaymentPlanViewUrl = '/contract/payment-plan/view/fixed'; // 固定回款计划视图
|
||||
export const EnablePaymentPlanViewUrl = '/contract/payment-plan/view/enable'; // 启用回款计划视图
|
||||
export const DeletePaymentPlanViewUrl = '/contract/payment-plan/view/delete'; // 删除回款计划视图
|
||||
export const DragPaymentPlanViewUrl = '/contract/payment-plan/view/edit/pos'; // 拖拽回款计划视图排序
|
||||
|
||||
// 回款记录列表
|
||||
export const PaymentRecordPageUrl = '/contract/payment-record/page'; // 回款记录列表
|
||||
export const PaymentRecordAddUrl = '/contract/payment-record/add'; // 添加回款记录
|
||||
export const PaymentRecordUpdateUrl = '/contract/payment-record/update'; // 更新回款记录
|
||||
export const PaymentRecordDeleteUrl = '/contract/payment-record/delete'; // 删除回款记录
|
||||
export const GetPaymentRecordDetailUrl = '/contract/payment-record/get'; // 获取回款记录详情
|
||||
export const GetPaymentRecordFormConfigUrl = '/contract/payment-record/module/form'; // 回款记录表单配置
|
||||
export const GetPaymentRecordTabUrl = '/contract/payment-record/tab'; // 回款记录tab显隐
|
||||
export const GetPaymentRecordStatisticUrl = '/contract/payment-record/statistic'; // 回款记录统计
|
||||
|
||||
// 回款记录导出
|
||||
export const ExportPaymentRecordAllUrl = '/contract/payment-record/export-all'; // 回款记录导出全量
|
||||
export const ExportPaymentRecordSelectedUrl = '/contract/payment-record/export-select'; // 回款记录导出选中
|
||||
|
||||
// 回款记录视图
|
||||
export const AddPaymentRecordViewUrl = '/contract/payment-record/view/add'; // 添加回款记录视图
|
||||
export const UpdatePaymentRecordViewUrl = '/contract/payment-record/view/update'; // 更新回款记录视图
|
||||
export const GetPaymentRecordViewListUrl = '/contract/payment-record/view/list'; // 获取回款记录视图列表
|
||||
export const GetPaymentRecordViewDetailUrl = '/contract/payment-record/view/detail'; // 获取回款记录视图详情
|
||||
export const FixedPaymentRecordViewUrl = '/contract/payment-record/view/fixed'; // 固定回款记录视图
|
||||
export const EnablePaymentRecordViewUrl = '/contract/payment-record/view/enable'; // 启用回款记录视图
|
||||
export const DeletePaymentRecordViewUrl = '/contract/payment-record/view/delete'; // 删除回款记录视图
|
||||
export const DragPaymentRecordViewUrl = '/contract/payment-record/view/edit/pos'; // 拖拽回款记录视图排序
|
||||
|
||||
export const PreCheckPaymentRecordImportUrl = '/contract/payment-record/import/pre-check';
|
||||
export const DownloadPaymentRecordTemplateUrl = '/contract/payment-record/template/download';
|
||||
export const ImportPaymentRecordUrl = '/contract/payment-record/import';
|
||||
|
||||
// 合同-工商抬头导入
|
||||
export const PreCheckBusinessTitleImportUrl = '/contract/business-title/import/pre-check';
|
||||
export const DownloadBusinessTitleTemplateUrl = '/contract/business-title/template/download';
|
||||
export const ImportBusinessTitleUrl = '/contract/business-title/import';
|
||||
// 合同-工商抬头导出
|
||||
export const ExportBusinessTitleAllUrl = '/contract/business-title/export-all';
|
||||
export const ExportBusinessTitleSelectedUrl = '/contract/business-title/export-select';
|
||||
|
||||
// 合同-工商抬头列表
|
||||
export const BusinessTitlePageUrl = '/contract/business-title/page';
|
||||
export const BusinessTitleAddUrl = '/contract/business-title/add';
|
||||
export const BusinessTitleUpdateUrl = '/contract/business-title/update';
|
||||
export const BusinessTitleDeleteUrl = '/contract/business-title/delete';
|
||||
export const BusinessTitleRevokeUrl = '/contract/business-title/revoke';
|
||||
export const GetBusinessTitleDetailUrl = '/contract/business-title/get';
|
||||
export const GetBusinessTitleInvoiceCheckUrl = '/contract/business-title/invoice/check';
|
||||
export const GetBusinessTitleThirdQueryUrl = '/contract/business-title/third-query';
|
||||
export const GetBusinessTitleThirdQueryOptionUrl = '/contract/business-title/third-query/option';
|
||||
|
||||
// 工商抬头表单校验
|
||||
export const BusinessTitleConfigUrl = '/business-title/config/get'; // 获取表单配置校验
|
||||
export const BusinessTitleFormConfigSwitchUrl = '/business-title/config/switch'; // 表单配置切换
|
||||
export const BusinessTitleModuleFormUrl = '/contract/business-title/module/form'; // 表单字段
|
||||
// 发票
|
||||
export const ContractInvoicedUpdateUrl = '/invoice/update'; // 发票更新
|
||||
export const ContractInvoicedPageUrl = '/invoice/page'; // 发票列表
|
||||
export const ContractInvoicedInContractPageUrl = '/contract/invoice/page'; // 合同下的发票列表
|
||||
export const ContractInvoicedExportSelectedUrl = '/invoice/export-select'; // 发票导出选中
|
||||
export const ContractInvoicedExportAllUrl = '/invoice/export-all'; // 发票导出全量
|
||||
export const ContractInvoicedBatchDeleteUrl = '/invoice/batch/delete'; // 发票批量删除
|
||||
export const ContractInvoicedApprovalUrl = '/invoice/approval'; // 发票审批
|
||||
export const ContractInvoicedAddUrl = '/invoice/add'; // 发票添加
|
||||
export const ContractInvoicedFormConfigUrl = '/invoice/module/form'; // 发票表单配置
|
||||
export const ContractInvoicedFormConfigSnapshotUrl = '/invoice/module/form/snapshot'; // 发票表单配置快照
|
||||
export const ContractInvoicedDetailUrl = '/invoice/get'; // 发票详情
|
||||
export const ContractInvoicedDetailSnapshotUrl = '/invoice/get/snapshot'; // 发票详情快照
|
||||
export const ContractInvoicedDeleteUrl = '/invoice/delete'; // 发票删除
|
||||
export const ContractInvoicedRevokeUrl = '/invoice/revoke'; // 发票撤回
|
||||
export const ContractInvoicedTabUrl = '/invoice/tab'; // 发票tab显隐
|
||||
|
||||
// 发票视图
|
||||
export const UpdateContractInvoicedViewUrl = '/invoice/view/update'; // 更新发票视图
|
||||
export const DragContractInvoicedViewUrl = '/invoice/view/edit/pos'; // 拖拽发票视图排序
|
||||
export const AddContractInvoicedViewUrl = '/invoice/view/add'; // 添加发票视图
|
||||
export const ListContractInvoicedViewUrl = '/invoice/view/list'; // 发票视图列表
|
||||
export const FixedContractInvoicedViewUrl = '/invoice/view/fixed'; // 固定发票视图
|
||||
export const EnableContractInvoicedViewUrl = '/invoice/view/enable'; // 启用/禁用发票视图
|
||||
export const GetContractInvoicedViewDetailUrl = '/invoice/view/detail'; // 发票视图详情
|
||||
export const DeleteContractInvoicedViewUrl = '/invoice/view/delete'; // 发票视图删除
|
||||
|
||||
// 合同状态
|
||||
export const UpdateContractStatusUrl = '/contract/stage/update'; // 更新合同状态配置
|
||||
export const UpdateContractStatusRollbackUrl = '/contract/stage/update-rollback'; // 合同状态回退配置
|
||||
export const SortContractStatusUrl = '/contract/stage/sort'; // 合同状态排序
|
||||
export const AddContractStatusUrl = '/contract/stage/add'; // 合同状态添加
|
||||
export const GetContractStatusConfigUrl = '/contract/stage/get'; // 获取合同状态配置
|
||||
export const DeleteContractStatusUrl = '/contract/stage/delete'; // 删除合同状态
|
||||
export const UpdateContractStageUrl = '/contract/update/stage'; // 更新合同详情阶段
|
||||
export const SwitchContractCirculationTypeUrl = '/contract/stage/circulation-type'; // 切换流转类型
|
||||
export const SaveContractCirculationConfigUrl = '/contract/stage/advanced/config'; // 保存高级流转配置
|
||||
35
frontend/packages/lib-shared/api/requrls/customForm.ts
Normal file
35
frontend/packages/lib-shared/api/requrls/customForm.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
// 表单模板
|
||||
export const AddCustomFormUrl = '/custom-form/add'; // 创建自定义表单
|
||||
export const UpdateCustomFormUrl = '/custom-form/update'; // 更新自定义表单
|
||||
export const GetCustomFormUrl = '/custom-form/get'; // 自定义表单详情
|
||||
export const GetCustomFormAdminUrl = '/custom-form/admin/get'; // 获取表单管理员
|
||||
export const SaveCustomFormAdminUrl = '/custom-form/admin/set'; // 表单管理员
|
||||
export const RelateCustomFormMemberUrl = '/custom-form/role/user/add'; // 添加表单成员
|
||||
export const GetCustomFormRoleUsersUrl = '/custom-form/role/users'; // 获取角色用户列表
|
||||
export const GetCustomFormRoleListUrl = '/custom-form/role/list'; // 获取表单角色tab
|
||||
export const GetCustomFormRoleUserDeptTreeUrl = '/custom-form/role/user/dept/tree'; // 获取表单角色部门用户树
|
||||
export const GetCustomFormRoleUserRoleTreeUrl = '/custom-form/role/user/role/tree'; // 获取表单角色树
|
||||
export const RemoveCustomFormMemberUrl = '/custom-form/role/user/remove'; // 移除表单成员
|
||||
export const GetCustomFormListUrl = '/custom-form/list'; // 获取表单模板列表
|
||||
export const DeleteCustomFormUrl = '/custom-form/delete'; // 删除表单模板
|
||||
export const EnableCustomFormUrl = '/custom-form/enable'; // 开启表单模板
|
||||
export const DisableCustomFormUrl = '/custom-form/disable'; // 关闭表单模板
|
||||
export const GetCustomFormOptionsUrl = '/custom-form/option'; // 自定义表单选项列表
|
||||
|
||||
// 表单数据
|
||||
export const AddCustomFormDataUrl = '/custom-form/data/add'; // 添加自定义表单数据
|
||||
export const GetCustomFormDataPageUrl = '/custom-form/data/page'; // 自定义表单数据列表
|
||||
export const BatchUpdateCustomFormDataUrl = '/custom-form/data/batch/update'; // 批量更新自定义表单数据
|
||||
export const BatchDeleteCustomFormDataUrl = '/custom-form/data/batch/delete'; // 批量删除自定义表单数据
|
||||
export const UpdateCustomFormDataUrl = '/custom-form/data/update'; // 更新自定义表单数据
|
||||
export const GetCustomFormDataDetailUrl = '/custom-form/data/get'; // 获取自定义表单数据详情
|
||||
export const DeleteCustomFormDataUrl = '/custom-form/data/delete'; // 删除自定义表单数据
|
||||
|
||||
// 导入
|
||||
export const PreCheckCustomFormImportUrl = '/custom-form/data/import/pre-check'; // 自定义表单预检查导入
|
||||
export const DownloadCustomFormTemplateUrl = '/custom-form/data/template/download'; // 下载自定义表单模板
|
||||
export const ImportCustomFormUrl = '/custom-form/data/import'; // 导入自定义表单
|
||||
|
||||
// 导出
|
||||
export const CustomFormExportAllUrl = '/custom-form/data/export-all'; // 自定义表单导出全量
|
||||
export const CustomFormExportSelectedUrl = '/custom-form/data/export-select'; // 自定义表单导出选中
|
||||
137
frontend/packages/lib-shared/api/requrls/customer/index.ts
Normal file
137
frontend/packages/lib-shared/api/requrls/customer/index.ts
Normal file
@@ -0,0 +1,137 @@
|
||||
export const GetCustomerFormConfigUrl = '/account/module/form'; // 获取客户表单配置
|
||||
export const UpdateCustomerUrl = '/account/update'; // 更新客户
|
||||
export const GetCustomerListUrl = '/account/page'; // 分页查询客户
|
||||
export const AddCustomerUrl = '/account/add'; // 添加客户
|
||||
export const GetCustomerUrl = '/account/get'; // 获取客户详情
|
||||
export const DeleteCustomerUrl = '/account/delete'; // 删除客户
|
||||
export const BatchDeleteCustomerUrl = '/account/batch/delete'; // 批量删除客户
|
||||
export const BatchTransferCustomerUrl = '/account/batch/transfer'; // 批量转移客户
|
||||
export const BatchMoveCustomerUrl = '/account/batch/to-pool'; // 批量移入公海
|
||||
export const MoveToCustomerUrl = '/account/to-pool'; // 移入公海
|
||||
export const UpdateCustomerFollowRecordUrl = '/account/follow/record/update'; // 更新跟进记录
|
||||
export const GetCustomerFollowRecordListUrl = '/account/follow/record/page'; // 获取跟进记录列表
|
||||
export const AddCustomerFollowRecordUrl = '/account/follow/record/add'; // 添加跟进记录
|
||||
export const DeleteCustomerFollowRecordUrl = '/account/follow/record/delete'; // 删除跟进记录
|
||||
export const GetCustomerFollowRecordUrl = '/account/follow/record/get'; // 获取跟进记录详情
|
||||
export const GetCustomerFollowRecordFormConfigUrl = '/follow/record/module/form'; // 获取跟进记录表单配置
|
||||
export const UpdateCustomerFollowPlanUrl = '/account/follow/plan/update'; // 更新跟进计划
|
||||
export const GetCustomerFollowPlanListUrl = '/account/follow/plan/page'; // 获取跟进计划列表
|
||||
export const AddCustomerFollowPlanUrl = '/account/follow/plan/add'; // 添加跟进计划
|
||||
export const DeleteCustomerFollowPlanUrl = '/account/follow/plan/delete'; // 删除跟进计划
|
||||
export const GetCustomerFollowPlanFormConfigUrl = '/follow/plan/module/form'; // 获取跟进计划表单配置
|
||||
export const GetCustomerFollowPlanUrl = '/account/follow/plan/get'; // 获取跟进记录详情
|
||||
export const UpdateCustomerContactUrl = '/account/contact/update'; // 更新客户联系人
|
||||
export const GetCustomerContactListUrl = '/account/contact/page'; // 获取客户联系人列表
|
||||
export const DisableCustomerContactUrl = '/account/contact/disable'; // 禁用客户联系人
|
||||
export const AddCustomerContactUrl = '/account/contact/add'; // 添加客户联系人
|
||||
export const GetCustomerContactFormConfigUrl = '/account/contact/module/form'; // 获取客户联系人表单配置
|
||||
export const GetCustomerContactUrl = '/account/contact/get'; // 获取客户联系人详情
|
||||
export const EnableCustomerContactUrl = '/account/contact/enable'; // 启用客户联系人
|
||||
export const DeleteCustomerContactUrl = '/account/contact/delete'; // 删除客户联系人
|
||||
export const CheckOpportunityContactUrl = '/account/contact/opportunity/check'; // 是否绑定商机
|
||||
export const ContactListUnderCustomerUrl = '/account/contact/list'; // 客户下的联系人列表
|
||||
export const UpdateCustomerOpenSeaUrl = '/account-pool/update'; // 编辑公海
|
||||
export const GetCustomerOpenSeaListUrl = '/account-pool/page'; // 公海列表
|
||||
export const AddCustomerOpenSeaUrl = '/account-pool/add'; // 添加公海
|
||||
export const SwitchCustomerOpenSeaUrl = '/account-pool/switch'; // 启用/禁用公海
|
||||
export const IsCustomerOpenSeaNoPickUrl = '/account-pool/no-pick'; // 公海是否存在未领取线索
|
||||
export const DeleteCustomerOpenSeaUrl = '/account-pool/delete'; // 删除公海
|
||||
export const GetOpenSeaCustomerListUrl = '/pool/account/page'; // 公海客户列表
|
||||
export const PickOpenSeaCustomerUrl = '/pool/account/pick'; // 领取公海客户
|
||||
export const BatchPickOpenSeaCustomerUrl = '/pool/account/batch-pick'; // 批量领取公海客户
|
||||
export const BatchDeleteOpenSeaCustomerUrl = '/pool/account/batch-delete'; // 批量删除公海客户
|
||||
export const BatchAssignOpenSeaCustomerUrl = '/pool/account/batch-assign'; // 批量分配公海客户
|
||||
export const AssignOpenSeaCustomerUrl = '/pool/account/assign'; // 分配公海客户
|
||||
export const GetOpenSeaOptionsUrl = '/pool/account/options'; // 获取公海选项
|
||||
export const DeleteOpenSeaCustomerUrl = '/pool/account/delete'; // 删除公海客户
|
||||
export const GetOpenSeaCustomerUrl = '/pool/account/get'; // 获取公海客户详情
|
||||
export const ExportOpenSeaCustomerAllUrl = '/pool/account/export-all'; // 导出所有公海客户
|
||||
export const ExportOpenSeaCustomerSelectedUrl = '/pool/account/export-select'; // 导出选中公海客户
|
||||
export const PoolAccountBatchUpdateUrl = '/pool/account/batch-update'; // 批量编辑公海列表
|
||||
export const BatchUpdateAccountUrl = '/account/batch/update'; // 批量编辑客户列表
|
||||
export const BatchUpdateContactUrl = '/account/contact/batch/update'; // 批量编辑联系人
|
||||
export const MergeAccountUrl = '/account/merge'; // 合并客户
|
||||
export const MergeAccountPageUrl = '/account/merge/page'; // 获取数据范围权限客户列表
|
||||
export const GenerateCustomerChartUrl = '/account/chart'; // 生成客户图表
|
||||
export const generateCustomerContactChartUrl = '/account/contact/chart'; // 生成客户联系人图表
|
||||
|
||||
export const CancelCustomerFollowPlanUrl = '/account/follow/plan/cancel'; // 取消客户跟进计划
|
||||
export const GetCustomerHeaderListUrl = '/account/owner/history/list'; // 客户负责人记录列表
|
||||
export const SaveCustomerRelationUrl = '/account/relation/save'; // 保存客户关系
|
||||
export const GetCustomerRelationListUrl = '/account/relation/list'; // 获取客户关系列表
|
||||
export const UpdateCustomerRelationItemUrl = '/account/relation/update'; // 更新单条客户关系
|
||||
export const AddCustomerRelationItemUrl = '/account/relation/add'; // 添加单条客户关系
|
||||
export const DeleteCustomerRelationItemUrl = '/account/relation/delete'; // 删除单条客户关系
|
||||
export const UpdateCustomerCollaborationUrl = '/account/collaboration/update'; // 更新协作成员
|
||||
export const BatchDeleteCustomerCollaborationUrl = '/account/collaboration/batch/delete'; // 批量删除协作成员
|
||||
export const AddCustomerCollaborationUrl = '/account/collaboration/add'; // 添加协作成员
|
||||
export const GetCustomerCollaborationListUrl = '/account/collaboration/list'; // 获取协作成员列表
|
||||
export const DeleteCustomerCollaborationUrl = '/account/collaboration/delete'; // 删除协作成员
|
||||
export const GetCustomerOptionsUrl = '/account/option'; // 获取客户选项列表
|
||||
export const GetCustomerOpenSeaFollowRecordListUrl = '/account/follow/record/pool/page'; // 获取客户公海池跟进记录列表
|
||||
export const GetCustomerTabUrl = '/account/tab'; // 客户tab显隐
|
||||
export const GetCustomerContactTabUrl = '/account/contact/tab'; // 客户联系人tab显隐
|
||||
export const UpdateCustomerFollowPlanStatusUrl = '/account/follow/plan/status/update'; // 更新客户跟进计划状态
|
||||
export const GetCustomerOpportunityListUrl = '/account/opportunity/page'; // 客户商机列表
|
||||
export const ExportCustomerAllUrl = '/account/export-all'; // 导出所有客户
|
||||
export const ExportCustomerSelectedUrl = '/account/export-select'; // 导出选中客户
|
||||
export const GetAdvancedCustomerListUrl = '/advanced/search/account'; // 全局搜索分页查询客户
|
||||
export const GetAdvancedOpenSeaCustomerListUrl = '/advanced/search/account-pool'; // 全局搜索公海客户列表
|
||||
export const GetAdvancedCustomerContactListUrl = '/advanced/search/contact'; // 全局搜索获取客户联系人列表
|
||||
export const GetGlobalCustomerListUrl = '/global/search/account';
|
||||
export const GetGlobalOpenSeaCustomerListUrl = '/global/search/customer_pool';
|
||||
export const GetGlobalCustomerContactListUrl = '/global/search/contact';
|
||||
export const GetGlobalModuleCountUrl = '/global/search/module/count'; // 数量统计
|
||||
|
||||
export const ExportContactAllUrl = '/account/contact/export-all'; // 导出所有联系人
|
||||
export const ExportContactSelectedUrl = '/account/contact/export-select'; // 导出选中联系人
|
||||
|
||||
export const GetAccountContractListUrl = '/account/contract/page'; // 客户详情-合同列表
|
||||
export const GetAccountContractStatisticUrl = '/account/contract/statistic'; // 客户详情-合同列表统计
|
||||
export const GetAccountPaymentListUrl = '/account/contract/payment-plan/page'; // 客户详情-回款列表
|
||||
export const GetAccountPaymentStatisticUrl = '/account/contract/payment-plan/statistic'; // 客户详情-回款列表统计
|
||||
export const GetAccountPaymentRecordListUrl = '/account/contract/payment-record/page'; // 客户详情-回款列表
|
||||
export const GetAccountPaymentRecordStatisticUrl = '/account/contract/payment-record/statistic'; // 客户详情-回款列表统计
|
||||
export const GetAccountInvoiceListUrl = '/account/invoice/page'; // 客户详情-发票列表
|
||||
export const GetAccountInvoiceStatisticUrl = '/account/invoice/statistic'; // 客户详情-发票列表统计
|
||||
export const GetAccountOrderListUrl = '/account/order/page'; // 客户详情-订单列表
|
||||
|
||||
// 视图
|
||||
export const GetCustomerViewDetailUrl = '/account/view/detail';
|
||||
export const GetCustomerViewListUrl = '/account/view/list';
|
||||
export const AddCustomerViewUrl = '/account/view/add';
|
||||
export const UpdateCustomerViewUrl = '/account/view/update';
|
||||
export const DeleteCustomerViewUrl = '/account/view/delete';
|
||||
export const FixedCustomerViewUrl = '/account/view/fixed';
|
||||
export const EnableCustomerViewUrl = '/account/view/enable';
|
||||
export const DragCustomerViewUrl = '/account/view/edit/pos';
|
||||
|
||||
export const GetContactViewDetailUrl = '/account/contact/view/detail';
|
||||
export const GetContactViewListUrl = '/account/contact/view/list';
|
||||
export const AddContactViewUrl = '/account/contact/view/add';
|
||||
export const UpdateContactViewUrl = '/account/contact/view/update';
|
||||
export const DeleteContactViewUrl = '/account/contact/view/delete';
|
||||
export const FixedContactViewUrl = '/account/contact/view/fixed';
|
||||
export const EnableContactViewUrl = '/account/contact/view/enable';
|
||||
export const DragContactViewUrl = '/account/contact/view/edit/pos';
|
||||
|
||||
// 客户导入
|
||||
export const PreCheckAccountImportUrl = '/account/import/pre-check';
|
||||
export const DownloadAccountTemplateUrl = '/account/template/download';
|
||||
export const ImportAccountUrl = '/account/import';
|
||||
|
||||
// 联系人导入
|
||||
export const PreCheckContactImportUrl = '/account/contact/import/pre-check';
|
||||
export const DownloadContactTemplateUrl = '/account/contact/template/download';
|
||||
export const ImportContactUrl = '/account/contact/import';
|
||||
|
||||
// 公海视图
|
||||
export const GetAccountPoolViewDetailUrl = 'pool/account/view/detail';
|
||||
export const GetAccountPoolViewListUrl = 'pool/account/view/list';
|
||||
export const AddAccountPoolViewUrl = 'pool/account/view/add';
|
||||
export const UpdateAccountPoolViewUrl = 'pool/account/view/update';
|
||||
export const DeleteAccountPoolViewUrl = 'pool/account/view/delete';
|
||||
export const FixedAccountPoolViewUrl = 'pool/account/view/fixed';
|
||||
export const EnableAccountPoolViewUrl = 'pool/account/view/enable';
|
||||
export const DragAccountPoolViewUrl = 'pool/account/view/edit/pos';
|
||||
export const generateCustomerPoolChartUrl = '/pool/account/chart';
|
||||
16
frontend/packages/lib-shared/api/requrls/dashboard.ts
Normal file
16
frontend/packages/lib-shared/api/requrls/dashboard.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export const dashboardModuleRenameUrl = '/dashboard/module/rename'; // 模块重命名
|
||||
export const dashboardModuleDeleteUrl = '/dashboard/module/delete'; // 模块删除
|
||||
export const dashboardModuleAddUrl = '/dashboard/module/add'; // 模块添加
|
||||
export const dashboardUpdateUrl = '/dashboard/update'; // 仪表板更新
|
||||
export const dashboardRenameUrl = '/dashboard/rename'; // 仪表板重命名
|
||||
export const dashboardAddUrl = '/dashboard/add'; // 仪表板添加
|
||||
export const dashboardDetailUrl = '/dashboard/detail'; // 仪表板详情
|
||||
export const dashboardDeleteUrl = '/dashboard/delete'; // 仪表板删除
|
||||
export const dashboardPageUrl = '/dashboard/page'; // 仪表板列表
|
||||
export const dashboardCollectPageUrl = '/dashboard/collect/page'; // 仪表板收藏列表
|
||||
export const dashboardModuleTreeUrl = '/dashboard/module/tree'; // 模块树
|
||||
export const dashboardCollectUrl = '/dashboard/collect'; // 仪表板收藏
|
||||
export const dashboardUnCollectUrl = '/dashboard/un-collect'; // 仪表板取消收藏
|
||||
export const dashboardModuleCountUrl = '/dashboard/module/count'; // 仪表板模块数量
|
||||
export const dashboardDragUrl = '/dashboard/edit/pos'; // 仪表板拖拽
|
||||
export const dashboardModuleDragUrl = '/dashboard/module/move'; // 仪表板模块拖拽
|
||||
35
frontend/packages/lib-shared/api/requrls/follow.ts
Normal file
35
frontend/packages/lib-shared/api/requrls/follow.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
// 跟进记录
|
||||
export const GetFollowRecordPageUrl = '/follow/record/page'; // 跟进记录列表
|
||||
export const GetFollowRecordTabUrl = '/follow/record/tab'; // 数据权限TAB
|
||||
export const DeleteFollowRecordUrl = '/follow/record/delete'; // 删除跟进记录
|
||||
export const GetFollowRecordUrl = '/follow/record/get'; // 跟进记录详情
|
||||
export const UpdateFollowRecordUrl = '/follow/record/update';
|
||||
export const AddFollowRecordUrl = '/follow/record/add';
|
||||
|
||||
// 跟进计划
|
||||
export const UpdateFollowPlanStatusUrl = '/follow/plan/status/update'; // 更新跟进计划状态
|
||||
export const GetFollowPlanPageUrl = '/follow/plan/page'; // 跟进计划列表
|
||||
export const GetFollowPlanTabUrl = '/follow/plan/tab'; // 数据权限TAB
|
||||
export const DeleteFollowPlanUrl = '/follow/plan/delete'; // 删除跟进计划
|
||||
export const GetFollowPlanUrl = '/follow/plan/get'; // 跟进计划详情
|
||||
export const UpdateFollowPlanUrl = '/follow/plan/update';
|
||||
export const AddFollowPlanUrl = '/follow/plan/add';
|
||||
|
||||
// 视图
|
||||
export const AddFollowRecordViewUrl = '/follow/record/view/add';
|
||||
export const UpdateFollowRecordViewUrl = '/follow/record/view/update';
|
||||
export const GetFollowRecordViewListUrl = '/follow/record/view/list';
|
||||
export const GetFollowRecordViewDetailUrl = '/follow/record/view/detail';
|
||||
export const FixedFollowRecordViewUrl = '/follow/record/view/fixed';
|
||||
export const EnableFollowRecordViewUrl = '/follow/record/view/enable';
|
||||
export const DeleteFollowRecordViewUrl = '/follow/record/view/delete';
|
||||
export const DragFollowRecordViewUrl = '/follow/record/view/edit/pos';
|
||||
|
||||
export const AddFollowPlanViewUrl = '/follow/plan/view/add';
|
||||
export const UpdateFollowPlanViewUrl = '/follow/plan/view/update';
|
||||
export const GetFollowPlanViewListUrl = '/follow/plan/view/list';
|
||||
export const GetFollowPlanViewDetailUrl = '/follow/plan/view/detail';
|
||||
export const FixedFollowPlanViewUrl = '/follow/plan/view/fixed';
|
||||
export const EnableFollowPlanViewUrl = '/follow/plan/view/enable';
|
||||
export const DeleteFollowPlanViewUrl = '/follow/plan/view/delete';
|
||||
export const DragFollowPlanViewUrl = '/follow/plan/view/edit/pos';
|
||||
5
frontend/packages/lib-shared/api/requrls/home.ts
Normal file
5
frontend/packages/lib-shared/api/requrls/home.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export const HomeDepartmentTree = '/home/statistic/department/tree'; // 用户部门权限树
|
||||
export const HomeFollowOpportunity = '/home/statistic/opportunity'; // 跟进商机统计
|
||||
export const HomeSuccessOpportunity = '/home/statistic/opportunity/success'; // 商机赢单统计
|
||||
export const HomeLeadStatistic = '/home/statistic/lead'; // 线索统计
|
||||
export const HomeOpportunityUnderwayUrl = '/home/statistic/opportunity/underway'; // 商机进行中阶段统计
|
||||
82
frontend/packages/lib-shared/api/requrls/opportunity.ts
Normal file
82
frontend/packages/lib-shared/api/requrls/opportunity.ts
Normal file
@@ -0,0 +1,82 @@
|
||||
export const OptPageUrl = '/opportunity/page'; // 商机列表
|
||||
export const OptAddUrl = '/opportunity/add'; // 添加商机
|
||||
export const OptUpdateUrl = '/opportunity/update'; // 更新商机
|
||||
export const GetOptFormConfigUrl = '/opportunity/module/form'; // 商机表单配置
|
||||
export const OptFollowRecordListUrl = '/opportunity/follow/record/page'; // 商机跟进记录列表
|
||||
export const OptFollowPlanPageUrl = '/opportunity/follow/plan/page'; // 商机跟进计划列表
|
||||
export const UpdateOptFollowRecordUrl = '/opportunity/follow/record/update'; // 更新商机跟进记录
|
||||
export const AddOptFollowRecordUrl = '/opportunity/follow/record/add'; // 添加商机跟进记录
|
||||
export const UpdateOptFollowPlanUrl = '/opportunity/follow/plan/update'; // 更新商机跟进计划
|
||||
export const AddOptFollowPlanUrl = '/opportunity/follow/plan/add'; // 添加商机跟进计划
|
||||
export const GetOptFollowRecordUrl = '/opportunity/follow/record/get'; // 商机跟进记录详情
|
||||
export const GetOptFollowPlanUrl = '/opportunity/follow/plan/get'; // 商机跟进计划详情
|
||||
export const CancelOptFollowPlanUrl = '/opportunity/follow/plan/cancel'; // 取消商机跟进计划
|
||||
export const OptBatchTransferUrl = '/opportunity/batch/transfer'; // 批量转移商机
|
||||
export const OptBatchDeleteUrl = '/opportunity/batch/delete'; // 批量删除商机
|
||||
export const OptDeleteUrl = '/opportunity/delete'; // 删除商机
|
||||
export const OptUpdateStageUrl = '/opportunity/update/stage'; // 更新商机阶段
|
||||
export const GetOptDetailUrl = '/opportunity/get'; // 获取商机详情
|
||||
export const DeleteOptFollowRecordUrl = '/opportunity/follow/record/delete'; // 删除商机跟进记录
|
||||
export const DeleteOptFollowPlanUrl = '/opportunity/follow/plan/delete'; // 删除商机跟进计划
|
||||
export const GetOptTabUrl = '/opportunity/tab'; // 商机tab显隐
|
||||
export const GetOpportunityContactListUrl = 'opportunity/contact/list'; // 商机详情联系人列表
|
||||
export const UpdateOptFollowPlanStatusUrl = '/opportunity/follow/plan/status/update'; // 更新商机跟进计划状态
|
||||
export const ExportOpportunityAllUrl = '/opportunity/export-all'; // 商机导出
|
||||
export const ExportOpportunitySelectedUrl = '/opportunity/export-select'; // 商机导出选中
|
||||
export const GetOptStatisticUrl = '/opportunity/statistic'; // 商机列表的金额数据
|
||||
export const AdvancedSearchOptPageUrl = '/advanced/search/opportunity'; // 全局高级搜索商机列表
|
||||
export const AdvancedSearchOptDetailUrl = '/advanced/search/opportunity/detail'; // 全局搜索商机详情
|
||||
export const GlobalSearchOptPageUrl = '/global/search/opportunity'; // 全局搜索商机列表
|
||||
export const BatchUpdateOpportunityUrl = '/opportunity/batch/update'; // 批量更新商机
|
||||
export const SortOpportunityUrl = '/opportunity/sort'; // 商机看板拖拽排序
|
||||
export const UpdateOpportunityStageUrl = '/opportunity/stage/update'; // 更新商机阶段配置
|
||||
export const UpdateOpportunityStageRollbackUrl = '/opportunity/stage/update-rollback'; // 商机阶段回退配置
|
||||
export const SortOpportunityStageUrl = '/opportunity/stage/sort'; // 商机阶段排序
|
||||
export const AddOpportunityStageUrl = '/opportunity/stage/add'; // 商机阶段添加
|
||||
export const GetOpportunityStageConfigUrl = '/opportunity/stage/get'; // 获取商机阶段配置
|
||||
export const DeleteOpportunityStageUrl = '/opportunity/stage/delete'; // 删除商机阶段
|
||||
export const GenerateOpportunityChartUrl = '/opportunity/chart'; // 生成商机视图
|
||||
export const GetQuotationTabUrl = '/opportunity/quotation/tab'; // 报价tab显隐
|
||||
|
||||
// 商机视图
|
||||
export const GetBusinessViewDetailUrl = '/opportunity/view/detail';
|
||||
export const GetBusinessViewListUrl = '/opportunity/view/list';
|
||||
export const AddBusinessViewUrl = '/opportunity/view/add';
|
||||
export const UpdateBusinessViewUrl = '/opportunity/view/update';
|
||||
export const DeleteBusinessViewUrl = '/opportunity/view/delete';
|
||||
export const FixedBusinessViewUrl = '/opportunity/view/fixed';
|
||||
export const EnableBusinessViewUrl = '/opportunity/view/enable';
|
||||
export const DragBusinessViewUrl = '/opportunity/view/edit/pos';
|
||||
|
||||
// 报价单视图
|
||||
export const GetQuotationViewDetailUrl = '/opportunity/quotation/view/detail';
|
||||
export const GetQuotationViewListUrl = '/opportunity/quotation/view/list';
|
||||
export const AddQuotationViewUrl = '/opportunity/quotation/view/add';
|
||||
export const UpdateQuotationViewUrl = '/opportunity/quotation/view/update';
|
||||
export const DeleteQuotationViewUrl = '/opportunity/quotation/view/delete';
|
||||
export const FixedQuotationViewUrl = '/opportunity/quotation/view/fixed';
|
||||
export const EnableQuotationViewUrl = '/opportunity/quotation/view/enable';
|
||||
export const DragQuotationViewUrl = '/opportunity/quotation/view/edit/pos';
|
||||
|
||||
// 报价单
|
||||
export const QuotationPageUrl = '/opportunity/quotation/page';
|
||||
export const AddQuotationUrl = '/opportunity/quotation/add';
|
||||
export const UpdateQuotationUrl = '/opportunity/quotation/update';
|
||||
export const GetQuotationFormConfigUrl = '/opportunity/quotation/module/form';
|
||||
export const GetQuotationDetailUrl = '/opportunity/quotation/get';
|
||||
export const GetQuotationSnapshotDetailUrl = '/opportunity/quotation/get/snapshot';
|
||||
export const ApprovalQuotationUrl = '/opportunity/quotation/approve';
|
||||
export const VoidQuotationUrl = '/opportunity/quotation/voided';
|
||||
export const DeleteQuotationUrl = '/opportunity/quotation/delete';
|
||||
export const RevokeQuotationUrl = '/opportunity/quotation/revoke';
|
||||
export const BatchApproveUrl = '/opportunity/quotation/batch/approve';
|
||||
export const BatchVoidedUrl = '/opportunity/quotation/batch/voided';
|
||||
export const BatchUpdateQuotationUrl = '/opportunity/quotation/batch/update';
|
||||
export const GetQuotationSnapshotFormConfigUrl = '/opportunity/quotation/module/form/snapshot';
|
||||
export const DownloadQuotationUrl = '/opportunity/quotation/download';
|
||||
|
||||
|
||||
// 导入
|
||||
export const PreCheckOptImportUrl = '/opportunity/import/pre-check';
|
||||
export const DownloadOptTemplateUrl = '/opportunity/template/download';
|
||||
export const ImportOpportunityUrl = '/opportunity/import';
|
||||
35
frontend/packages/lib-shared/api/requrls/order.ts
Normal file
35
frontend/packages/lib-shared/api/requrls/order.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
export const AddOrderUrl = '/order/add';
|
||||
export const UpdateOrderUrl = '/order/update';
|
||||
export const BatchUpdateOrderUrl = '/order/batch/update';
|
||||
export const UpdateOrderStageUrl = '/order/update/stage';
|
||||
export const DeleteOrderUrl = '/order/delete';
|
||||
export const GetOrderDetailUrl = '/order/get';
|
||||
export const OrderPageUrl = '/order/page';
|
||||
export const OrderDetailSnapshotUrl = '/order/get/snapshot';
|
||||
export const OrderFormConfigUrl = '/order/module/form';
|
||||
export const OrderFormConfigSnapshotUrl = '/order/module/form/snapshot';
|
||||
export const GetOrderTabUrl = '/order/tab';
|
||||
export const OrderInContractPageUrl = '/contract/order/page';
|
||||
export const DownloadOrderUrl = '/order/download';
|
||||
export const OrderStatisticUrl = '/order/statistic';
|
||||
export const SortOrderUrl = '/order/sort';
|
||||
|
||||
// 订单视图
|
||||
export const AddOrderViewUrl = '/order/view/add';
|
||||
export const UpdateOrderViewUrl = '/order/view/update';
|
||||
export const DeleteOrderViewUrl = '/order/view/delete';
|
||||
export const GetOrderViewListUrl = '/order/view/list';
|
||||
export const GetOrderViewDetailUrl = '/order/view/detail';
|
||||
export const FixedOrderViewUrl = '/order/view/fixed';
|
||||
export const EnableOrderViewUrl = '/order/view/enable';
|
||||
export const DragOrderViewUrl = '/order/view/edit/pos';
|
||||
|
||||
// 订单状态
|
||||
export const UpdateOrderStatusUrl = '/order/stage/update'; // 更新订单状态配置
|
||||
export const UpdateOrderStatusRollbackUrl = '/order/stage/update-rollback'; // 订单状态回退配置
|
||||
export const SortOrderStatusUrl = '/order/stage/sort'; // 订单状态排序
|
||||
export const AddOrderStatusUrl = '/order/stage/add'; // 订单状态添加
|
||||
export const GetOrderStatusConfigUrl = '/order/stage/get'; // 获取订单状态配置
|
||||
export const DeleteOrderStatusUrl = '/order/stage/delete'; // 删除订单状态
|
||||
export const SwitchOrderCirculationTypeUrl = '/order/stage/circulation-type'; // 切换流转配置
|
||||
export const SaveAdvanceConfigUrl = '/order/stage/advanced/config'; // 保存高级流转配置
|
||||
29
frontend/packages/lib-shared/api/requrls/product.ts
Normal file
29
frontend/packages/lib-shared/api/requrls/product.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
export const GetProductFormConfigUrl = '/product/module/form'; // 获取产品表单配置
|
||||
export const UpdateProductUrl = '/product/update'; // 更新产品
|
||||
export const GetProductListUrl = '/product/page'; // 产品列表
|
||||
export const AddProductUrl = '/product/add'; // 添加产品
|
||||
export const GetProductUrl = '/product/get'; // 获取产品详情
|
||||
export const DeleteProductUrl = '/product/delete'; // 删除产品
|
||||
export const BatchDeleteProductUrl = '/product/batch/delete'; // 批量删除产品
|
||||
export const BatchUpdateProductUrl = '/product/batch/update'; // 批量更新产品
|
||||
export const DragSortProductUrl = '/product/edit/pos'; // 排序拖拽产品
|
||||
export const GetProductOptionsUrl = '/product/list/option'; // 获取当前组织下所有的产品
|
||||
// 导入
|
||||
export const PreCheckProductImportUrl = '/product/import/pre-check';
|
||||
export const DownloadProductTemplateUrl = '/product/template/download';
|
||||
export const ImportProductUrl = '/product/import';
|
||||
|
||||
export const UpdateProductPriceUrl = '/price/update'; // 更新价格表
|
||||
export const BatchUpdateProductPriceUrl = '/price/batch/update'; // 批量更新价格表
|
||||
export const GetProductPriceListUrl = '/price/page'; // 价格表列表
|
||||
export const AddProductPriceUrl = '/price/add'; // 添加价格表
|
||||
export const GetProductPriceFormConfigUrl = '/price/module/form'; // 获取价格表单配置
|
||||
export const GetProductPriceUrl = '/price/get'; // 获取价格表详情
|
||||
export const DeleteProductPriceUrl = '/price/delete'; // 删除价格表
|
||||
export const DragSortProductPriceUrl = '/price/edit/pos'; // 排序拖拽价格表
|
||||
export const DownloadProductPriceTemplateUrl = '/price/template/download'; // 下载价格表模板
|
||||
export const ExportProductPriceUrl = '/price/export-select'; // 导出选择的价格表
|
||||
export const ExportAllProductPriceUrl = '/price/export'; // 导出所有的价格表
|
||||
export const ImportProductPriceUrl = '/price/import'; // 导入价格表
|
||||
export const PreCheckImportProductPriceUrl = '/price/import/pre-check'; // 导入价格表预检查
|
||||
export const CopyProductPriceUrl = '/price/copy'; // 复制价格表
|
||||
7
frontend/packages/lib-shared/api/requrls/sys.ts
Normal file
7
frontend/packages/lib-shared/api/requrls/sys.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export const VersionUrl = '/system/version'; // 获取版本信息
|
||||
export const LocaleChangeUrl = '/locale-language/change'; // 切换语言
|
||||
|
||||
export default {
|
||||
VersionUrl,
|
||||
LocaleChangeUrl,
|
||||
};
|
||||
@@ -0,0 +1,2 @@
|
||||
export const GetLicenseUrl = '/license/validate';
|
||||
export const AddLicenseUrl = '/license/add';
|
||||
50
frontend/packages/lib-shared/api/requrls/system/business.ts
Normal file
50
frontend/packages/lib-shared/api/requrls/system/business.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
export const GetConfigEmailUrl = '/organization/settings/email'; // 获取邮件设置
|
||||
export const UpdateConfigEmailUrl = '/organization/settings/email/edit'; // 更新邮件设置
|
||||
export const TestConfigEmailUrl = '/organization/settings/email/test'; // 邮件设置-测试连接
|
||||
|
||||
export const GetConfigSynchronizationUrl = '/organization/settings/third-party'; // 获取三方设置
|
||||
export const UpdateConfigSynchronizationUrl = '/organization/settings/third-party/edit'; // 更新三方设置
|
||||
export const TestConfigSynchronizationUrl = '/organization/settings/third-party/test'; // 三方设置-测试连接
|
||||
export const GetThirdTypeListUrl = '/organization/settings/third-party/types'; // 获取三方应用扫码类型集合
|
||||
export const GetDETokenUrl = '/organization/settings/de-token'; // 获取DEToken
|
||||
export const SyncDEUrl = '/organization/settings/de/sync'; // 同步 DE 配置
|
||||
export const GetDEOrgListUrl = '/organization/settings/de/org/list'; // 获取 DE 组织列表
|
||||
export const GetThirdPartyConfigUrl = '/organization/settings/third-party/get'; // 获取第三方配置
|
||||
export const SwitchThirdPartyUrl = '/organization/settings/switch-third-party'; // 切换三方平台
|
||||
export const GetThirdPartyResourceUrl = '/organization/settings/third-party/sync/resource'; // 获取最新的三方同步来源
|
||||
export const GetAuthsUrl = '/system/auth-sources/list'; // 认证设置-列表查询
|
||||
export const GetAuthDetailUrl = '/system/auth-sources/get'; // 认证设置-详情
|
||||
export const UpdateAuthUrl = '/system/auth-sources/update'; // 认证设置-更新
|
||||
export const CreateAuthUrl = '/system/auth-sources/add'; // 认证设置-新增
|
||||
export const UpdateAuthStatusUrl = '/system/auth-sources/update/status'; // 认证设置-更新状态
|
||||
export const UpdateAuthNameUrl = '/system/auth-sources/update/name'; // 认证设置-更新名称
|
||||
export const DeleteAuthUrl = '/system/auth-sources/delete'; // 认证设置-删除
|
||||
export const GetTenderConfigUrl = '/tender/application/config'; // 招投标-获取配置项
|
||||
|
||||
// 个人中心
|
||||
export const GetPersonalUrl = '/personal/center/info';
|
||||
export const UpdatePersonalUrl = '/personal/center/update';
|
||||
export const SendEmailCodeUrl = '/personal/center/mail/code/send';
|
||||
export const UpdateUserPasswordUrl = '/personal/center/info/reset';
|
||||
export const GetPersonalFollowUrl = '/personal/center/follow/plan/list'; // 用户跟进计划列表
|
||||
|
||||
// 个人中心导出
|
||||
export const GetExportCenterListUrl = '/export/center/list'; // 查询导出任务列表
|
||||
export const ExportCenterDownloadUrl = '/export/center/download'; // 下载
|
||||
export const CancelCenterExportUrl = '/export/center/cancel'; // 取消导出
|
||||
|
||||
// 个人中心ApiKey
|
||||
export const UpdateApiKeyUrl = '/user/api/key/update'; // 更新 ApiKey
|
||||
export const GetApiKeyListUrl = '/user/api/key/list'; // 获取 ApiKey 列表
|
||||
export const EnableApiKeyUrl = '/user/api/key/enable'; // 开启 ApiKey
|
||||
export const DisableApiKeyUrl = '/user/api/key/disable'; // 关闭 ApiKey
|
||||
export const DeleteApiKeyUrl = '/user/api/key/delete'; // 删除 ApiKey
|
||||
export const AddApiKeyUrl = '/user/api/key/add'; // 新增 ApiKey
|
||||
|
||||
// 界面设置
|
||||
export const SavePageConfigUrl = '/ui/display/save'; // 保存界面配置
|
||||
export const GetPageConfigUrl = '/ui/display/info'; // 获取界面配置
|
||||
export const GetPageConfigImagePreviewUrl = '/ui/display/preview'; // 图片预览
|
||||
export const GetTitleImgUrl = `${
|
||||
import.meta.env.VITE_API_BASE_URL
|
||||
}${GetPageConfigImagePreviewUrl}?paramKey=ui.logoPlatform`;
|
||||
3
frontend/packages/lib-shared/api/requrls/system/log.ts
Normal file
3
frontend/packages/lib-shared/api/requrls/system/log.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export const LoginLogListUrl = '/login/log/list'; // 登录日志
|
||||
export const OperationLogListUrl = '/operation/log/list'; // 操作日志
|
||||
export const GetOperationLogDetailUrl = '/operation/log/detail'; // 操作日志-详情
|
||||
6
frontend/packages/lib-shared/api/requrls/system/login.ts
Normal file
6
frontend/packages/lib-shared/api/requrls/system/login.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export const loginUrl = '/login'; // 登录
|
||||
export const signoutUrl = '/logout'; // 登出
|
||||
export const isLoginUrl = '/is-login'; // 是否登录
|
||||
export const getKeyUrl = '/get-key'; // 获取登录密钥
|
||||
export const thirdCallbackUrl = '/sso/callback'; // 企业微信二维码登录
|
||||
export const thirdOauthCallbackUrl = '/sso/callback/oauth'; // 企业微信Oauth2登录
|
||||
22
frontend/packages/lib-shared/api/requrls/system/message.ts
Normal file
22
frontend/packages/lib-shared/api/requrls/system/message.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
// 公告
|
||||
export const GetAnnouncementListUrl = '/announcement/page'; // 公告列表分页查询
|
||||
export const UpdateAnnouncementUrl = '/announcement/edit'; // 编辑公告
|
||||
export const AddAnnouncementUrl = '/announcement/add'; // 新建公告
|
||||
export const GetAnnouncementDetailUrl = '/announcement/get'; // 获取公告详情
|
||||
export const DeleteAnnouncementUrl = '/announcement/delete'; // 删除公告
|
||||
|
||||
// 消息中心
|
||||
export const GetNotificationListUrl = '/notification/list/all/page'; // 消息中心列表
|
||||
export const GetNotificationCountUrl = '/notification/count'; // 具体类型具体状态的数量
|
||||
export const SetNotificationReadUrl = '/notification/read'; // 设置消息已读
|
||||
export const SetAllNotificationReadUrl = '/notification/read/all'; // 所有信息设置为已读消息
|
||||
|
||||
// 消息设置
|
||||
export const GetMessageTaskUrl = '/message/task/get'; // 获取消息设置
|
||||
export const SaveMessageTaskUrl = '/message/task/save'; // 保存消息设置
|
||||
export const BatchSaveMessageTaskUrl = '/message/task/batch/save'; // 消息设置批量编辑
|
||||
export const SubscribeMessageUrl = '/sse/subscribe'; // 客户端订阅 SSE 事件流
|
||||
export const CloseMessageUrl = '/sse/close'; // 客户端关闭 SSE 事件流
|
||||
export const GetHomeMessageUrl = '/notification/last/list'; // 获取首页消息列表
|
||||
export const GetUnReadAnnouncement = '/notification/last/announcement/list'; // 获取用户未读公告列表
|
||||
export const getMessageTaskConfigDetailUrl = '/message/task/config/query'; // 获取消息任务配置详情
|
||||
99
frontend/packages/lib-shared/api/requrls/system/module.ts
Normal file
99
frontend/packages/lib-shared/api/requrls/system/module.ts
Normal file
@@ -0,0 +1,99 @@
|
||||
// 模块首页
|
||||
export const getModuleNavConfigListUrl = '/module/list'; // 模块-首页-获取模块设置列表
|
||||
export const moduleNavListSortUrl = '/module/sort'; // 模块-首页-模块排序
|
||||
export const toggleModuleNavStatusUrl = '/module/switch'; // 模块-首页-单个模块开启或关闭
|
||||
export const ModuleUserDeptTreeUrl = '/module/user/dept/tree'; // 模块-获取部门用户树
|
||||
export const ModuleRoleTreeUrl = '/module/role/tree'; // 模块-获取角色树
|
||||
export const GetAdvancedSwitchUrl = '/module/advanced-search/settings'; // 高级筛选开关
|
||||
export const SetDisplayAdvancedUrl = '/module/advanced-search/switch'; // 设置高级筛选开关
|
||||
|
||||
// 模块--商机
|
||||
export const getOpportunityListUrl = '/opportunity-rule/page'; // 模块-商机-商机规则列表
|
||||
export const addOpportunityRuleUrl = '/opportunity-rule/add'; // 模块-商机-添加商机规则
|
||||
export const updateOpportunityRuleUrl = '/opportunity-rule/update'; // 模块-商机-更新商机规则
|
||||
export const switchOpportunityStatusUrl = '/opportunity-rule/switch'; // 模块-商机-更新商机规则状态
|
||||
export const deleteOpportunityUrl = '/opportunity-rule/delete'; // 模块-商机-删除商机规则
|
||||
|
||||
// 模块-线索池
|
||||
export const GetCluePoolPageUrl = '/lead-pool/page'; // 分页获取线索池
|
||||
export const AddCluePoolUrl = '/lead-pool/add'; // 新增线索池
|
||||
export const UpdateCluePoolUrl = '/lead-pool/update'; // 编辑线索池
|
||||
export const QuickUpdateCluePoolUrl = '/lead-pool/quick-update'; // 快捷编辑线索池
|
||||
export const SwitchCluePoolStatusUrl = '/lead-pool/switch'; // 启用/禁用线索池
|
||||
export const DeleteCluePoolUrl = '/lead-pool/delete'; // 删除线索池
|
||||
export const NoPickCluePoolUrl = '/lead-pool/no-pick'; // 未领取线索
|
||||
|
||||
// 模块-线索库容
|
||||
export const GetClueCapacityPageUrl = '/lead-capacity/get'; // 获取线索库容规则
|
||||
export const AddClueCapacityUrl = '/lead-capacity/add'; // 添加线索库容规则
|
||||
export const UpdateClueCapacityUrl = '/lead-capacity/update'; // 更新线索库容规则
|
||||
export const DeleteClueCapacityUrl = '/lead-capacity/delete'; // 删除线索库容规则
|
||||
|
||||
// 模块-客户库容
|
||||
export const GetCustomerCapacityPageUrl = '/account-capacity/get'; // 获取客户库容
|
||||
export const AddCustomerCapacityUrl = '/account-capacity/add'; // 添加客户库容规则
|
||||
export const UpdateCustomerCapacityUrl = '/account-capacity/update'; // 更新客户库容规则
|
||||
export const DeleteCustomerCapacityUrl = '/account-capacity/delete'; // 删除客户库容规则
|
||||
|
||||
// 模块-公海池
|
||||
export const GetCustomerPoolPageUrl = '/account-pool/page'; // 分页获取公海池
|
||||
export const AddCustomerPoolUrl = '/account-pool/add'; // 新增公海池
|
||||
export const UpdateCustomerPoolUrl = '/account-pool/update'; // 编辑公海池
|
||||
export const QuickUpdateCustomerPoolUrl = '/account-pool/quick-update'; // 快捷编辑公海池
|
||||
export const SwitchCustomerPoolStatusUrl = '/account-pool/switch'; // 启用/禁用公海池
|
||||
export const DeleteCustomerPoolUrl = '/account-pool/delete'; // 删除公海池
|
||||
export const NoPickCustomerPoolUrl = '/account-pool/no-pick'; // 未领取线索
|
||||
|
||||
// 模块-表单设计
|
||||
export const GetFormDesignConfigUrl = '/module/form/config'; // 获取表单设计配置
|
||||
export const SaveFormDesignConfigUrl = '/module/form/save'; // 保存表单设计配置
|
||||
export const GetFieldDeptUerTreeUrl = '/field/user/dept/tree'; // 获取部门成员树
|
||||
export const GetFieldDeptTreeUrl = '/field/dept/tree'; // 获取部门树
|
||||
export const GetFieldProductListUrl = '/field/source/product'; // 获取产品列表
|
||||
export const GetFieldOpportunityListUrl = '/field/source/opportunity'; // 获取商机列表
|
||||
export const GetFieldCustomerListUrl = '/field/source/account'; // 获取客户列表
|
||||
export const GetFieldContactListUrl = '/field/source/contact'; // 获取联系人列表
|
||||
export const GetFieldClueListUrl = '/field/source/lead'; // 获取线索列表
|
||||
export const GetFieldContractListUrl = '/field/source/contract'; // 获取合同列表
|
||||
export const GetFieldInvoiceListUrl = '/field/source/invoice'; // 获取发票列表
|
||||
export const GetFieldContractPaymentPlanListUrl = '/field/source/contract/payment-plan'; // 获取回款计划列表
|
||||
export const GetFieldContractPaymentRecordListUrl = '/field/source/contract/payment-record'; // 获取回款记录列表
|
||||
export const GetFieldCustomFormListUrl = '/field/source/custom-form-data'; // 自定义表单数据源列表
|
||||
|
||||
export const CheckRepeatUrl = '/field/check/repeat'; // 查重
|
||||
export const GetFieldPriceListUrl = '/field/source/price'; // 获取价格列表
|
||||
export const GetFieldQuotationListUrl = '/field/source/quotation'; // 获取报价单列表
|
||||
export const GetFieldOrderListUrl = '/field/source/order'; // 获取订单列表
|
||||
export const GetFieldDisplayListUrl = '/field/display';
|
||||
export const GetFieldBusinessTitleListUrl = '/field/source/business-title';
|
||||
export const GetFieldRefDetailListUrl = '/field/source/ref-detail'; // 批量获取数据源字段详情
|
||||
export const GetFieldConfigUrl = '/field/source/config'; // 获取数据源表单配置
|
||||
|
||||
export const UploadTempFileUrl = '/pic/upload/temp'; // 上传临时图片
|
||||
export const PreviewPictureUrl = '/pic/preview'; // 预览图片
|
||||
export const DownloadPictureUrl = '/pic/download'; // 下载图片
|
||||
export const UploadTempAttachmentUrl = '/attachment/upload/temp'; // 上传临时附件
|
||||
export const PreviewAttachmentUrl = '/attachment/preview'; // 预览附件
|
||||
export const DownloadAttachmentUrl = '/attachment/download'; // 下载附件
|
||||
export const DeleteAttachmentUrl = '/attachment/delete'; // 删除附件
|
||||
|
||||
// 模块配置-字典管理-原因配置
|
||||
export const GetReasonUrl = '/dict/get'; // 获取原因
|
||||
export const AddReasonUrl = '/dict/add'; // 添加原因
|
||||
export const UpdateReasonUrl = '/dict/update'; // 更新原因
|
||||
export const DeleteReasonUrl = '/dict/delete'; // 删除原因
|
||||
export const GetReasonConfigUrl = '/dict/config'; // 获取原因配置
|
||||
export const UpdateReasonEnableUrl = '/dict/switch'; // 更新原因开关
|
||||
export const SortReasonUrl = '/dict/sort'; // 原因排序
|
||||
|
||||
export const SearchConfigUrl = '/search/config/save'; // 搜索设置添加配置
|
||||
export const GetSearchConfigUrl = '/search/config/get'; // 获取搜索字段配置
|
||||
export const ResetSearchConfigUrl = '/search/config/reset'; // 重置搜索字段配置
|
||||
|
||||
// 搜索模糊设置
|
||||
export const ModuleMaskSearchConfigUrl = '/mask/config/save'; // 搜索设置脱敏设置
|
||||
export const GetModuleMaskSearchConfigUrl = '/mask/config/get'; // 获取搜索脱敏设置
|
||||
|
||||
// 系统导航栏
|
||||
export const GetModuleTopNavListUrl = '/navigation/list'; // 获取顶导配置
|
||||
export const SetModuleTopNavSortUrl = '/navigation/sort'; // 顶导排序
|
||||
29
frontend/packages/lib-shared/api/requrls/system/org.ts
Normal file
29
frontend/packages/lib-shared/api/requrls/system/org.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
// 部门
|
||||
export const setCommanderUrl = '/department/set-commander'; // 组织架构-设置部门负责人
|
||||
export const renameDepartmentUrl = '/department/rename'; // 组织架构-组织架构-重命名子部门
|
||||
export const addDepartmentUrl = '/department/add'; // 组织架构-添加子部门
|
||||
export const getDepartmentTreeUrl = '/department/tree'; // 组织架构-部门树查询
|
||||
export const deleteDepartmentUrl = '/department/delete'; // 组织架构-删除部门
|
||||
export const checkDeleteDepartmentUrl = '/department/delete/check'; // 组织架构-删除部门校验
|
||||
export const sortDepartmentUrl = '/department/sort'; // 组织架构-部门排序
|
||||
// 员工
|
||||
export const addUserUrl = '/user/add'; // 用户(员工)-添加员工
|
||||
export const updateUserUrl = '/user/update'; // 用户(员工)-更新员工
|
||||
export const getUserListUrl = '/user/list'; // 用户(员工)-列表查询
|
||||
export const batchResetPasswordUrl = '/user/batch/reset-password'; // 用户(员工)-批量重置密码
|
||||
export const batchEnableUserUrl = '/user/batch-enable'; // 用户(员工)-批量启用/禁用
|
||||
export const syncOrgUrl = '/user/sync'; // 用户(员工)-同步组织架构
|
||||
export const resetUserPasswordUrl = '/user/reset-password'; // 用户(员工)-重置密码
|
||||
export const getUserDetailUrl = '/user/detail'; // 用户(员工)-员工详情
|
||||
export const batchEditUserUrl = '/user/batch/edit'; // 用户(员工)-批量编辑
|
||||
export const importUserPreCheckUrl = '/user/import/pre-check'; // 用户(员工)-excel导入检查
|
||||
export const getUserOptionsUrl = '/user/option'; // 获取用户下拉
|
||||
export const getAdminOptionsUrl = '/user/admin/option'; // 获取审批管理员下拉
|
||||
export const getRoleOptionsUrl = '/user/role/option'; // 获取角色下拉
|
||||
export const importUserUrl = '/user/import'; // 用户(员工)-excel导入
|
||||
export const deleteUserUrl = '/user/delete'; // 用户(员工)-删除
|
||||
export const deleteUserCheckUrl = '/user/delete/check'; // 用户(员工)-删除校验
|
||||
export const checkSyncUserFromThirdUrl = '/user/sync-check'; // 用户(员工)-是否为第三方同步数据
|
||||
export const updateUserNameUrl = '/user/update/name'; // 用户(员工)-更新用户名称
|
||||
export const getOrgDepartmentUserUrl = '/user/get'; // 用户(员工)-更新用户名称
|
||||
export const CheckSyncUrl = '/user/sync/check'; // 检查异步是否完成接口
|
||||
33
frontend/packages/lib-shared/api/requrls/system/process.ts
Normal file
33
frontend/packages/lib-shared/api/requrls/system/process.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
export const ApprovalPermissionsUrl = '/approval-flow/status-permission/setting'; // 审批流数据权限
|
||||
export const GetApprovalConfigDetailUrl = '/approval-flow/get-by-form-type'; // 审批流配置详情 用于列表控制操作判断
|
||||
export const ApprovalProcessPageUrl = '/approval-flow/page'; // 审批流列表
|
||||
export const AddApprovalProcessUrl = '/approval-flow/add'; // 新增审批流
|
||||
export const UpdateApprovalProcessUrl = '/approval-flow/update'; // 修改审批流
|
||||
export const DeleteApprovalProcessUrl = '/approval-flow/delete'; // 删除审批流
|
||||
export const ApprovalProcessDetailUrl = '/approval-flow/get'; // 审批流详情
|
||||
export const ToggleApprovalProcessUrl = '/approval-flow/enable'; // 启用|禁用审批流
|
||||
export const GetResourceApprovingDetailUrl = '/approval-resource/simple-detail'; // 资源审批状态详情
|
||||
export const ReviewResourceUrl = '/approval-resource/push'; // 提审
|
||||
export const RevokeResourceUrl = '/approval-resource/revoke'; // 撤销
|
||||
|
||||
// 审批流webHook连接测试
|
||||
export const TestApprovalWebHookUrl = '/approval-flow/webhook/test ';
|
||||
|
||||
// 审批待办
|
||||
export const GetProcessedApprovalTodosUrl = '/approval-todo/processed/page'; // 已处理审批待办列表
|
||||
export const GetPendingApprovalTodosUrl = '/approval-todo/pending/page'; // 待处理审批待办列表
|
||||
export const GetInitiatedApprovalTodosUrl = '/approval-todo/initiated/page'; // 我发起审批待办列表
|
||||
export const GetCcApprovalTodosUrl = '/approval-todo/cc/page'; // 抄送我的审批待办列表
|
||||
export const GetTodoStatisticUrl = '/approval-todo/pending/count'; // 获取待办统计
|
||||
|
||||
// 审批
|
||||
export const RejectApprovalUrl = '/approval-action/reject'; // 驳回
|
||||
export const BackApprovalUrl = '/approval-action/back'; // 回退
|
||||
export const AddSignApprovalUrl = '/approval-action/sign'; // 加签
|
||||
export const RevokeApprovalUrl = '/approval-action/revoke'; // 撤回
|
||||
export const AgreeApprovalUrl = '/approval-action/approve'; // 同意
|
||||
export const BatchRejectApprovalUrl = '/approval-action/batch-reject'; // 批量驳回
|
||||
export const BatchApprovalApprovalUrl = '/approval-action/batch-approve'; // 批量同意
|
||||
|
||||
// 审批记录
|
||||
export const GetApprovalResourceDetailUrl = '/approval-resource/detail'; // 审批资源详情
|
||||
14
frontend/packages/lib-shared/api/requrls/system/role.ts
Normal file
14
frontend/packages/lib-shared/api/requrls/system/role.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export const RelateRoleUrl = '/role/user/relate'; // 角色关联用户
|
||||
export const GetRoleMemberUrl = '/role/user/page'; // 角色已关联用户列表
|
||||
export const BatchRemoveRoleMemberUrl = '/role/user/batch/delete'; // 批量移除角色关联用户
|
||||
export const UpdateRoleUrl = '/role/update'; // 更新角色
|
||||
export const CreateRoleUrl = '/role/add'; // 新增角色
|
||||
export const GetRoleMemberTreeUrl = '/role/user/role/tree'; // 获取角色用户树
|
||||
export const GetRoleDeptTreeUrl = '/role/user/dept/tree'; // 获取部门用户树
|
||||
export const RemoveRoleMemberUrl = '/role/user/delete'; // 移除角色关联用户
|
||||
export const GetPermissionsUrl = '/role/permission/setting'; // 获取全量权限
|
||||
export const GetRolesUrl = '/role/list'; // 获取角色列表
|
||||
export const GetRoleDetailUrl = '/role/get'; // 获取角色详情
|
||||
export const DeleteRoleUrl = '/role/delete'; // 删除角色
|
||||
export const GetDeptTreeUrl = '/role/dept/tree'; // 获取部门树
|
||||
export const GetUserOptionUrl = '/role/user/option'; // 获取用户列表
|
||||
Reference in New Issue
Block a user