123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- import { post, get, uploadFile as requestUploadFile } from '@/utils/request';
- export type RequestProps = {
- /**
- * @description 0-本月 1-本周 2-本年
- */
- dateType?: 0 | 1 | 2;
- /**
- * @description 0-仅本人 1-本人及下属 2-仅本部门 3-本部门及下属部门
- */
- queryType?: 0 | 1 | 2 | 3;
- startDate?: string;
- endDate?: string;
- };
- export type SummaryData = {
- code: string;
- data: {
- clueDataSummary: {
- changeNum: number;
- newNum: number;
- };
- businessOpportunityDataSummary: {
- winning: number;
- allAmountOfMoney: number;
- losting: number;
- newNum: number;
- };
- customDataSummary: {
- closeDealNum: number;
- newNum: number;
- };
- };
- };
- export async function getSummaryData(
- payload?: RequestProps
- ): Promise<SummaryData> {
- return await post('/order/dataSummary', payload);
- }
- export type StageData = {
- code: string;
- data: {
- dataMap: {
- stageName: string;
- num: number;
- }[];
- };
- };
- export async function getStageData(payload?: RequestProps): Promise<StageData> {
- return await post('/order/businessOpportunityStage', payload);
- }
- export type BulletinData = {
- code: string;
- data: {
- custom: {
- customPromote: string;
- customCount: number;
- };
- businessOpportunity: {
- businessOpportunityCount: number;
- businessOpportunityPromote: string;
- };
- contacts: {
- contactsCount: number;
- contactsPromote: string;
- };
- salesOrder: {
- salesOrderCount: number;
- salesOrderPromote: string;
- };
- salesOrdersPrice: {
- salesOrderPricePromote: string;
- salesOrdersPrice: number;
- };
- clue: {
- cluePromote: string;
- clueCount: number;
- };
- businessOpportunityPrice: {
- businessOpportunityPromote: string;
- businessOpportunityPrice: number;
- };
- };
- };
- export async function getBulletinData(
- payload?: RequestProps
- ): Promise<BulletinData> {
- return await post('/order/salesKit', payload);
- }
- export type AIQuestionParams = {
- questionDataSource: number;
- sourceContent: string;
- content: string;
- startDate: string;
- endDate: string;
- url?: string;
- };
- export type AIQuestionResponse = {
- code: string;
- data: string;
- };
- export async function askAIQuestion(
- payload: AIQuestionParams
- ): Promise<AIQuestionResponse> {
- return await post('/aiQuestion/ask', payload);
- }
- export type UploadFileResponse = {
- code: string;
- data: string;
- };
- export async function uploadFileApi(file: File): Promise<UploadFileResponse> {
- const formData = new FormData();
- formData.append('multipartFile', file);
-
- return await requestUploadFile('/common/uploadFile', formData);
- }
|