保存进度!
This commit is contained in:
parent
484b8a78e9
commit
e07039b517
|
@ -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
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue