更新登录代码
保存坐席的信息,用于获取业绩数据。
This commit is contained in:
		@@ -8,6 +8,6 @@
 | 
			
		||||
 * Copyright (c) ${2022} by Kane, All Rights Reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
import { loginTestCaller } from "./requestTest.js";
 | 
			
		||||
// import { loginTestCaller } from "./requestTest.js";
 | 
			
		||||
 | 
			
		||||
loginTestCaller();
 | 
			
		||||
// loginTestCaller();
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										17
									
								
								code/web/task_schedule/src/types/cpicxim/Department.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								code/web/task_schedule/src/types/cpicxim/Department.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Kane
 | 
			
		||||
 * @Date: 2023-05-09 22:03:26
 | 
			
		||||
 * @LastEditors: Kane
 | 
			
		||||
 * @FilePath: /task_schedule/src/data/cpicxim/Department.ts
 | 
			
		||||
 * @Description: 部门数据结构
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) ${2022} by Kane, All Rights Reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
interface Department
 | 
			
		||||
{
 | 
			
		||||
    departmentName: string;
 | 
			
		||||
    departmentCode: string;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export { type Department };
 | 
			
		||||
							
								
								
									
										21
									
								
								code/web/task_schedule/src/types/cpicxim/TelSaler.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								code/web/task_schedule/src/types/cpicxim/TelSaler.ts
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,21 @@
 | 
			
		||||
/*
 | 
			
		||||
 * @Author: Kane
 | 
			
		||||
 * @Date: 2023-05-09 22:18:04
 | 
			
		||||
 * @LastEditors: Kane
 | 
			
		||||
 * @FilePath: /task_schedule/src/types/cpicxim/TelSaler.ts
 | 
			
		||||
 * @Description: 坐席类型
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) ${2022} by Kane, All Rights Reserved.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
interface TelSaler
 | 
			
		||||
{
 | 
			
		||||
    telSalerCode: string;
 | 
			
		||||
    telSalerName: string;
 | 
			
		||||
    teamCode: string;
 | 
			
		||||
    teamName: string;
 | 
			
		||||
    departmentCode: string;
 | 
			
		||||
    departmentName: string;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export { type TelSaler };
 | 
			
		||||
@@ -36,8 +36,8 @@ interface RequestResult
 | 
			
		||||
 | 
			
		||||
interface LoginCallerResult extends RequestResult
 | 
			
		||||
{
 | 
			
		||||
    tele_saler_code: string;
 | 
			
		||||
    tele_saler_name: string;
 | 
			
		||||
    tel_saler_code: string;
 | 
			
		||||
    tel_saler_name: string;
 | 
			
		||||
    team_code: string;
 | 
			
		||||
    team_name: string;
 | 
			
		||||
    department_code: string;
 | 
			
		||||
 
 | 
			
		||||
@@ -10,8 +10,8 @@
 | 
			
		||||
export const API_URL = {
 | 
			
		||||
    // URL_LOGIN: import.meta.env.VITE_URL_LOGIN,
 | 
			
		||||
    URL_LOGIN: "http://222.76.244.118:11101/admin-system/account/p13_account_check",
 | 
			
		||||
    URL_LOGIN_CALLER: "http://localhost:8080/desktop_archievement_backend/account/query_telsaler_info.do",
 | 
			
		||||
 | 
			
		||||
    // URL_LOGIN_CALLER: "http://localhost:8080/desktop_archievement_backend/account/query_telsaler_info.do",
 | 
			
		||||
    URL_LOGIN_CALLER: "http://222.76.244.118:11101/desktop_archievement_backend/account/query_telsaler_info.do",
 | 
			
		||||
    // URL_DEPARTMENT_ARCHIEVEMENT: import.meta.env.VITE_URL_DEPARTMENT_ARCHIEVEMENT,
 | 
			
		||||
    URL_DEPARTMENT_ARCHIEVEMENT: "http://222.76.244.118:11101/desktop_archievement_backend/archievement/query_department_archievement.do",
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@
 | 
			
		||||
 *
 | 
			
		||||
 * Copyright (c) ${2022} by Kane, All Rights Reserved.
 | 
			
		||||
 */
 | 
			
		||||
import { StaffInfo } from "../../data/cpicxim/StaffInfo.js";
 | 
			
		||||
import { StaffInfo } from "../../types/cpicxim/StaffInfo.js";
 | 
			
		||||
 | 
			
		||||
const STUFF_ITEM = "stuff_info";
 | 
			
		||||
const CALLER_ITEM = "call_info";
 | 
			
		||||
 
 | 
			
		||||
@@ -13,7 +13,7 @@ import axios, { type AxiosInstance } from "axios";
 | 
			
		||||
const service: AxiosInstance = axios.create(
 | 
			
		||||
    {
 | 
			
		||||
        baseURL: "",
 | 
			
		||||
        timeout: 10000,
 | 
			
		||||
        timeout: 5000,
 | 
			
		||||
    }
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -9,6 +9,7 @@
 | 
			
		||||
 */
 | 
			
		||||
import { service as instance } from "./api/request.js";
 | 
			
		||||
import { API_URL } from "./api/config.js";
 | 
			
		||||
import { type Department } from "@/types/cpicxim/Department.js";
 | 
			
		||||
// import { type AxiosResponse } from "axios";
 | 
			
		||||
 | 
			
		||||
interface Archievement
 | 
			
		||||
@@ -28,7 +29,7 @@ interface Archievement
 | 
			
		||||
 * 获取部门业绩数据,并调用回调函数进行渲染。
 | 
			
		||||
 * @param render 用于给组件更新数据的回调函数
 | 
			
		||||
 */
 | 
			
		||||
function queryDepartmentArchievement( render: any ): void
 | 
			
		||||
function queryDepartmentArchievement( departmentInfo: Department, render: any ): void
 | 
			
		||||
{
 | 
			
		||||
    instance.request({
 | 
			
		||||
        method: "post",
 | 
			
		||||
 
 | 
			
		||||
@@ -61,6 +61,7 @@ import { useRouter } from "vue-router";
 | 
			
		||||
import { getCallerInfo } from "@/utils/api/localStorage.js";
 | 
			
		||||
import { ElMessage } from "element-plus";
 | 
			
		||||
import { type Archievement, queryDepartmentArchievement } from "@/utils/archievement.js";
 | 
			
		||||
import { type Department } from "@/types/cpicxim/Department";
 | 
			
		||||
import ArchievementChart from "@/components/ArchievementChartComponent.vue";
 | 
			
		||||
import ArchievementCompleteRateComponent from "@/components/ArchievementCompleteRateComponent.vue";
 | 
			
		||||
import HonorListComponent from "@/components/HonorListComponent.vue";
 | 
			
		||||
@@ -146,7 +147,13 @@ export default {
 | 
			
		||||
 | 
			
		||||
        onBeforeMount(() =>
 | 
			
		||||
        {
 | 
			
		||||
            queryDepartmentArchievement( renderData );
 | 
			
		||||
            const deparmentInfo:Department =
 | 
			
		||||
            {
 | 
			
		||||
                departmentCode: "QDI",
 | 
			
		||||
                departmentName: "续保业务部",
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            queryDepartmentArchievement( deparmentInfo, renderData );
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        return { ui, getTotalArchievement, renderData, logoutDesktopArchievement, };
 | 
			
		||||
 
 | 
			
		||||
@@ -70,7 +70,7 @@ import { useRouter } from "vue-router";
 | 
			
		||||
import { saveStaffInfo, getUserType, saveUserType, getCallerInfo, saveCallerInfo } from "@/utils/api/localStorage";
 | 
			
		||||
import { login, loginCaller, type LoginCallerInfo, type LoginCallerResult } from "@/utils/account";
 | 
			
		||||
import { ElMessage } from "element-plus";
 | 
			
		||||
import { StaffInfo } from "@/data/cpicxim/StaffInfo";
 | 
			
		||||
import { StaffInfo } from "@/types/cpicxim/StaffInfo";
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
    name: "LoginPage",
 | 
			
		||||
@@ -168,6 +168,7 @@ export default {
 | 
			
		||||
                    telsaler_code: ui.account,
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
                // debugger;
 | 
			
		||||
                // 登录
 | 
			
		||||
                loginCaller( loginInfo )
 | 
			
		||||
                    // 调用接口成功
 | 
			
		||||
@@ -200,7 +201,14 @@ export default {
 | 
			
		||||
                    // 调用接口失败
 | 
			
		||||
                    .catch(( error ) =>
 | 
			
		||||
                    {
 | 
			
		||||
                        console.log( `登录失败,返回信息:${error}` );
 | 
			
		||||
                        const message = `登录失败,返回信息:${error}`;
 | 
			
		||||
 | 
			
		||||
                        console.log( message );
 | 
			
		||||
 | 
			
		||||
                        ElMessage({
 | 
			
		||||
                            message,
 | 
			
		||||
                            type: "error",
 | 
			
		||||
                        });
 | 
			
		||||
                    });
 | 
			
		||||
            }
 | 
			
		||||
        };
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user