修改了桌面霸屏页面:

1、读取已登录信息的代码;
2、根据已登录信息获取部门业绩的代码;
3、将数据结构代码移到 types 目录下。
This commit is contained in:
2023-05-09 23:45:53 +08:00
parent d0c9383bf8
commit 52667f3d9c
6 changed files with 72 additions and 32 deletions

View File

@@ -8,6 +8,7 @@
* Copyright (c) ${2022} by Kane, All Rights Reserved.
*/
import { StaffInfo } from "../../types/cpicxim/StaffInfo.js";
import { type TelSaler } from "@/types/cpicxim/TelSaler.js";
const STUFF_ITEM = "stuff_info";
const CALLER_ITEM = "call_info";
@@ -62,14 +63,38 @@ function getUserType(): string
return userType;
}
function saveCallerInfo( callerCode: string ): void
function saveCallerInfo( callerInfo: TelSaler ): void
{
window.localStorage.setItem( CALLER_ITEM, callerCode );
const json = JSON.stringify( callerInfo );
window.localStorage.setItem( CALLER_ITEM, json );
}
function getCallerInfo(): string
function getCallerInfo(): TelSaler
{
return window.localStorage.getItem( CALLER_ITEM ) ?? "";
const json = window.localStorage.getItem( CALLER_ITEM ) ?? "";
let storeCallerInfo = null;
try
{
storeCallerInfo = JSON.parse( json );
}
catch ( error )
{
storeCallerInfo = {};
}
const callInfo: TelSaler = {
telSalerCode: storeCallerInfo.telSalerCode ?? "",
telSalerName: storeCallerInfo.telSalerName ?? "",
teamCode: storeCallerInfo.teamCode ?? "",
teamName: storeCallerInfo.teamName ?? "",
departmentCode: storeCallerInfo.departmentCode ?? "",
departmentName: storeCallerInfo.departmentName ?? "",
};
return callInfo;
}
function clearCallerInfo(): void

View File

@@ -34,6 +34,7 @@ function queryDepartmentArchievement( departmentInfo: Department, render: any ):
instance.request({
method: "post",
url: API_URL.URL_DEPARTMENT_ARCHIEVEMENT,
data: departmentInfo,
})
.then(( response ) =>
{