保存进度!

This commit is contained in:
Kane Wang 2023-11-08 09:56:40 +08:00
parent 484b8a78e9
commit e07039b517
1 changed files with 51 additions and 2 deletions

View File

@ -7,7 +7,7 @@
* *
* Copyright (c) ${2023} by Kane, All Rights Reserved. * Copyright (c) ${2023} by Kane, All Rights Reserved.
*/ */
import { service as instance, service } from "./api/request.js"; import { service as instance } from "./api/request.js";
import { API_URL } from "./api/config.js"; import { API_URL } from "./api/config.js";
import { type AxiosResponse } from "axios"; import { type AxiosResponse } from "axios";
interface BIReportType interface BIReportType
@ -78,8 +78,17 @@ interface BITelsalerRenewalRateRecord
环比: number; 环比: number;
} }
interface QueryBITelsalerRenewalRateReportResponse
{
success: boolean;
message: string;
records: BITelsalerRenewalRateRecord[];
}
type ImportBIReportResponseHandler = ( response: ImportBIReportResponse, error: any ) => void; type ImportBIReportResponseHandler = ( response: ImportBIReportResponse, error: any ) => void;
type QueryBITelsalerAttachingRateDataHandler = ( response: QueryBITelsalerAttachingRateReportResponse, error: any ) => void; type QueryBITelsalerAttachingRateDataHandler = ( response: QueryBITelsalerAttachingRateReportResponse, error: any ) => void;
type QueryBITelsalerRenewalRateDataHandler = ( response: QueryBITelsalerRenewalRateReportResponse, error: any ) => void;
/** /**
* *
* @param request * @param request
@ -151,6 +160,43 @@ function queryBITelsalerAttachingRateData( handler: QueryBITelsalerAttachingRate
}); });
} }
/**
* BI坐席续保率数据
* @param handler
*/
function queryBITelsalerRenewalData( handler: QueryBITelsalerRenewalRateDataHandler ): void
{
const queryResponse: QueryBITelsalerRenewalRateReportResponse = {
success: false,
message: "",
records: [],
};
instance.request({
url: API_URL.URL_BI_TELSALER_RENEWALRATE,
method: "post",
})
.then(( response: AxiosResponse<any, any> ): void =>
{
const data = response.data ?? {};
queryResponse.success = data.success ?? false;
queryResponse.message = data.message ?? "";
queryResponse.records = data.records ?? [];
handler( queryResponse, null );
})
.catch(( error: any ): void =>
{
queryResponse.success = false;
queryResponse.message = "查询BI坐席续保率数据失败请查看控制台";
console.log( error );
handler( queryResponse, error );
});
}
export { export {
type BIReportType, type BIReportType,
type ImportBIReportRequest, type ImportBIReportRequest,
@ -159,7 +205,10 @@ export {
type BITelsalerAttachingRateRecord, type BITelsalerAttachingRateRecord,
type QueryBITelsalerAttachingRateReportResponse, type QueryBITelsalerAttachingRateReportResponse,
type QueryBITelsalerAttachingRateDataHandler, type QueryBITelsalerAttachingRateDataHandler,
type QueryBITelsalerRenewalRateDataHandler,
type BITelsalerRenewalRateRecord, type BITelsalerRenewalRateRecord,
type QueryBITelsalerRenewalRateReportResponse,
importBIReport, importBIReport,
queryBITelsalerAttachingRateData queryBITelsalerAttachingRateData,
queryBITelsalerRenewalData
}; };