整理代码!

This commit is contained in:
Kane Wang 2023-03-24 15:11:47 +08:00
parent bee1061e20
commit 7dbd48152f
14 changed files with 119 additions and 80 deletions

View File

@ -32,10 +32,10 @@ CREATE OR REPLACE PACKAGE BODY telsale_archievement_pkg IS
a_end_date); a_end_date);
FOR caller_record IN (SELECT * FOR caller_record IN (SELECT *
FROM 车非每日保费_t) FROM desktop_archievement_admin.车非每日保费_t)
LOOP LOOP
BEGIN BEGIN
DELETE 车非每日保费 cf DELETE desktop_archievement_admin.车非每日保费 cf
WHERE cf.签单日期 = caller_record.签单日期 WHERE cf.签单日期 = caller_record.签单日期
AND cf.部门 = caller_record.部门 AND cf.部门 = caller_record.部门
AND cf.经办人n = caller_record.经办人n AND cf.经办人n = caller_record.经办人n
@ -45,7 +45,7 @@ CREATE OR REPLACE PACKAGE BODY telsale_archievement_pkg IS
NULL; NULL;
END; END;
INSERT INTO 车非每日保费 INSERT INTO desktop_archievement_admin.车非每日保费
VALUES caller_record; VALUES caller_record;
END LOOP; END LOOP;
@ -62,9 +62,9 @@ CREATE OR REPLACE PACKAGE BODY telsale_archievement_pkg IS
a_end_date IN DATE a_end_date IN DATE
) IS ) IS
BEGIN BEGIN
EXECUTE IMMEDIATE 'truncate table 车非每日保费_t'; EXECUTE IMMEDIATE 'truncate table desktop_archievement_admin.车非每日保费_t';
INSERT INTO 车非每日保费_t INSERT INTO desktop_archievement_admin.车非每日保费_t
WITH aa AS WITH aa AS
(SELECT to_char(t.signature_date, (SELECT to_char(t.signature_date,
'yyyy-mm-dd') 签单日期, 'yyyy-mm-dd') 签单日期,

View File

@ -22,6 +22,7 @@ module.exports = {
extends:["eslint:recommended",], extends:["eslint:recommended",],
rules:{ rules:{
indent: ["warn", 4,], indent: ["warn", 4,],
"space-in-parens": ["error", "always", { exceptions: ["{}", "[]", "()", "empty",], },],
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off", "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-unused-vars": "warn", "no-unused-vars": "warn",
@ -73,7 +74,7 @@ module.exports = {
], ],
rules: { rules: {
indent: ["warn", 4,], indent: ["warn", 4,],
// "space-in-parens": ["error", "always", { exceptions: ["empty",], },], "space-in-parens": ["error", "always", { exceptions: ["{}", "[]", "()", "empty",], },],
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off", "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-unused-vars": "warn", "no-unused-vars": "warn",
@ -136,7 +137,7 @@ module.exports = {
"plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended",
], ],
rules: { rules: {
"space-in-parens": ["error", "always", { exceptions: ["empty",], },], "space-in-parens": ["error", "always", { exceptions: ["{}", "[]", "()", "empty",], },],
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off", "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"@typescript-eslint/indent": ["error", 4,], "@typescript-eslint/indent": ["error", 4,],

View File

@ -12,7 +12,13 @@
<span class="company-name">CPIC</span> <span class="company-name">CPIC</span>
<div class="version-wrapper"> <div class="version-wrapper">
<span>测试版</span> <span>测试版</span>
<span>3.6.7 x64 Build 202208301257</span> <span>Build-202303251257</span>
</div>
<div class="button-wrapper">
<component
:is="'user'"
class="icons"
/>
</div> </div>
</div> </div>
</template> </template>

View File

@ -2,7 +2,7 @@
* @Author: Kane * @Author: Kane
* @Date: 2023-02-15 09:25:52 * @Date: 2023-02-15 09:25:52
* @LastEditors: Kane * @LastEditors: Kane
* @LastEditTime: 2023-03-23 16:32:01 * @LastEditTime: 2023-03-24 14:34:52
* @FilePath: /task_schedule/src/main.js * @FilePath: /task_schedule/src/main.js
* @Description: * @Description:
* *

View File

@ -11,7 +11,7 @@
import { type AxiosResponse } from "axios"; import { type AxiosResponse } from "axios";
import { service as instance } 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 { cleanStaffInfo } from "./api/localStorage.js"; import { cleanStaffInfo, clearCallerInfo } from "./api/localStorage.js";
// @ts-expect-error 之后再补充类型文件 // @ts-expect-error 之后再补充类型文件
import { router } from "../router/index.js"; import { router } from "../router/index.js";
@ -38,6 +38,7 @@ async function login( data: LoginInfo ): Promise<AxiosResponse<any, any>>
function logout(): void function logout(): void
{ {
cleanStaffInfo(); cleanStaffInfo();
clearCallerInfo();
void router.push( "/login" ); void router.push( "/login" );
} }

View File

@ -10,6 +10,7 @@
import { StaffInfo } from "@/data/cpicxim/StaffInfo.js"; import { StaffInfo } from "@/data/cpicxim/StaffInfo.js";
const STUFF_ITEM = "stuff_info"; const STUFF_ITEM = "stuff_info";
const CALLER_ITEM = "call_info";
const USER_TYPE_ITEM = "user_type"; const USER_TYPE_ITEM = "user_type";
function loadStaffInfo(): StaffInfo function loadStaffInfo(): StaffInfo
@ -61,10 +62,28 @@ function getUserType(): string
return userType; return userType;
} }
function saveCallerInfo( callerCode: string ): void
{
window.localStorage.setItem( CALLER_ITEM, callerCode );
}
function getCallerInfo(): string
{
return window.localStorage.getItem( CALLER_ITEM ) ?? "";
}
function clearCallerInfo(): void
{
window.localStorage.removeItem( CALLER_ITEM );
}
export { export {
loadStaffInfo, loadStaffInfo,
saveStaffInfo, saveStaffInfo,
cleanStaffInfo, cleanStaffInfo,
saveUserType, saveUserType,
getUserType getUserType,
saveCallerInfo,
getCallerInfo,
clearCallerInfo
}; };

View File

@ -58,7 +58,7 @@
<script lang="ts"> <script lang="ts">
import { computed, reactive, onBeforeMount } from "vue"; import { computed, reactive, onBeforeMount } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { loadStaffInfo } from "@/utils/api/localStorage.js"; import { getCallerInfo } from "@/utils/api/localStorage.js";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { type Archievement, queryDepartmentArchievement } from "@/utils/archievement.js"; import { type Archievement, queryDepartmentArchievement } from "@/utils/archievement.js";
import ArchievementChart from "@/components/ArchievementChartComponent.vue"; import ArchievementChart from "@/components/ArchievementChartComponent.vue";
@ -78,7 +78,7 @@ export default {
setup() setup()
{ {
const router = useRouter(); const router = useRouter();
const staffInfo = loadStaffInfo(); const callerInfo = getCallerInfo();
const ui = reactive({ const ui = reactive({
chartData: [0,], // chartData: [0,], //
totalArchievement: 0, // totalArchievement: 0, //
@ -129,7 +129,7 @@ export default {
}; };
// //
if (staffInfo.P13UID === "") if ( callerInfo === "" )
{ {
ElMessage({ ElMessage({
message: "登录信息失效,请重新登录!", message: "登录信息失效,请重新登录!",

View File

@ -67,7 +67,7 @@
<script lang="ts"> <script lang="ts">
import { reactive, onBeforeMount } from "vue"; import { reactive, onBeforeMount } from "vue";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { loadStaffInfo, saveStaffInfo, getUserType, saveUserType } from "@/utils/api/localStorage"; import { loadStaffInfo, saveStaffInfo, getUserType, saveUserType, getCallerInfo, saveCallerInfo } from "@/utils/api/localStorage";
import { login } from "@/utils/account"; import { login } from "@/utils/account";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import { StaffInfo } from "@/data/cpicxim/StaffInfo"; import { StaffInfo } from "@/data/cpicxim/StaffInfo";
@ -96,6 +96,9 @@ export default {
window.localStorage.setItem( "stuff_account", ui.account ); window.localStorage.setItem( "stuff_account", ui.account );
}; };
/**
*
*/
const onLogin = () => const onLogin = () =>
{ {
// //
@ -159,25 +162,34 @@ export default {
else if ( ui.currentMenu === "tele_saler" ) else if ( ui.currentMenu === "tele_saler" )
{ {
// //
saveCallerInfo( ui.account );
//
router.push( "/desktop_archievement" );
} }
}; };
onBeforeMount(() => onBeforeMount(() =>
{ {
const staffInfo = loadStaffInfo(); const staffType = getUserType();
//
if ( staffType === "tele_saler" )
{
const callInfo = getCallerInfo();
// P13 // P13
if (staffInfo.P13UID !== "") if ( callInfo !== "" )
{ {
ElMessage({ ElMessage({
message: `已登录账号:${staffInfo.stuffName}`, message: `已登录账号:${callInfo}`,
type: "success", type: "success",
center: true, center: true,
}); });
// //
// router.push("/desktop_archievement"); router.push( "/desktop_archievement" );
}
} }
}); });