开发个人业绩组件
This commit is contained in:
@@ -93,7 +93,7 @@ import
|
||||
queryDepartmentArchievement,
|
||||
queryCallerArchievement
|
||||
} from "@/utils/archievement.js";
|
||||
import { RankingListItem } from "@/types/cpicxim/RankingListItem.js";
|
||||
import { type RankingListItem } from "@/types/cpicxim/RankingListItem.js";
|
||||
import
|
||||
{
|
||||
type RankingListRequest,
|
||||
@@ -139,7 +139,7 @@ export default {
|
||||
{
|
||||
const monthIndex = new Date();
|
||||
const thisMonth: number = monthIndex.getMonth() + 1; // getMonth返回值从0开始。
|
||||
const thisMonthString = thisMonth > 10 ? String( thisMonth ): "0" + String( thisMonth );
|
||||
const thisMonthString = thisMonth > 10 ? String( thisMonth ) : "0" + String( thisMonth );
|
||||
const thisYear: number = monthIndex.getFullYear();
|
||||
const thisYearString: string = String( thisYear );
|
||||
const numInChinese = [
|
||||
@@ -173,7 +173,7 @@ export default {
|
||||
});
|
||||
let timerHandler = 0;
|
||||
|
||||
const getTotalArchievement = computed(():string =>
|
||||
const getTotalArchievement = computed((): string =>
|
||||
{
|
||||
const cnyFormat = new Intl.NumberFormat( "zh-cn", {
|
||||
style: "currency",
|
||||
@@ -194,7 +194,7 @@ export default {
|
||||
// console.log( "部门业绩数据", data );
|
||||
|
||||
// 检查请求是否成功
|
||||
if ( data.success !== true )
|
||||
if ( !data.success )
|
||||
{
|
||||
// 失败就提示消息,然后退出
|
||||
ElMessage({
|
||||
@@ -226,7 +226,7 @@ export default {
|
||||
const applyCallerArchievementData = ( data: CallerArchievement ): void =>
|
||||
{
|
||||
// 检查请求是否成功
|
||||
if ( data.success !== true )
|
||||
if ( !data.success )
|
||||
{
|
||||
// 失败就提示消息,然后退出
|
||||
ElMessage({
|
||||
@@ -268,7 +268,7 @@ export default {
|
||||
};
|
||||
|
||||
// 退出桌面霸屏
|
||||
const logoutDesktopArchievement = () =>
|
||||
const logoutDesktopArchievement = (): void =>
|
||||
{
|
||||
console.log( "111" );
|
||||
logout();
|
||||
@@ -285,13 +285,13 @@ export default {
|
||||
center: true,
|
||||
});
|
||||
|
||||
router.push( "/login" );
|
||||
router.push( "/login" ).then(() => {}).catch(() => {});
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于定时对页面进行刷新,其中会请求最新的业绩数据。
|
||||
*/
|
||||
const refresh = () =>
|
||||
const refresh = (): void =>
|
||||
{
|
||||
const deparmentInfo: Department = {
|
||||
departmentCode: callerInfo.departmentCode,
|
||||
@@ -304,6 +304,8 @@ export default {
|
||||
month: thisMonthString,
|
||||
};
|
||||
|
||||
console.log( "refresh", rankinglistRequest );
|
||||
|
||||
queryDepartmentArchievement( deparmentInfo, applyDepartmentArchievementData );
|
||||
queryCallerArchievement( callerInfo, applyCallerArchievementData );
|
||||
requestRankingList( rankinglistRequest, applyRankingListData );
|
||||
|
Reference in New Issue
Block a user