This commit is contained in:
STW_TTTY\stwtt 2024-06-28 11:28:40 +07:00
parent 243f500d4a
commit 4f973738a3
15 changed files with 1896 additions and 733 deletions

View file

@ -13,7 +13,7 @@ export const useKpiDataStore = defineStore("KPIDataAdmin", () => {
keyword: "",
});
const selected = ref([]);
const isUpdate = ref<boolean>(false);
const tabMain = ref<string>("1");
const dataProfile = ref<any>({
profileId: null,
@ -280,51 +280,58 @@ export const useKpiDataStore = defineStore("KPIDataAdmin", () => {
const rolePerson = ref<string>("USER"); //"USER" | "EVALUATOR" | "COMMANDER", "COMMANDERHIGH"
const tabOpen = ref<number>(1);
function checkStep() {
const role =
dataEvaluation.value.profileId == dataProfile.value.profileId
? "USER"
: dataEvaluation.value.evaluatorId == dataProfile.value.profileId
? "EVALUATOR"
: dataEvaluation.value.commanderId == dataProfile.value.profileId
? "COMMANDER"
: dataEvaluation.value.commanderHighId == dataProfile.value.profileId
? "COMMANDERHIGH"
: "";
rolePerson.value = role;
// const role =
// dataEvaluation.value.profileId == 'USER'
rolePerson.value = "USER";
switch (dataEvaluation.value.evaluationStatus) {
case "NEW":
tabOpen.value = 1;
tabMain.value = "1";
break;
case "NEW_EVALUATOR":
tabOpen.value = 1;
tabMain.value = "1";
break;
case "NEW_COMMANDER":
tabOpen.value = 1;
tabMain.value = "1";
break;
case "NEW_COMMANDER_HIGH":
tabOpen.value = 1;
tabMain.value = "1";
break;
case "APPROVE":
tabOpen.value = 2;
tabMain.value = "2";
break;
case "EVALUATING":
tabOpen.value = 3;
tabMain.value = "3";
break;
case "EVALUATING_EVALUATOR":
tabOpen.value = 3;
tabMain.value = "3";
break;
case "EVALUATING_COMMANDER":
tabOpen.value = 3;
case "SUMMARY":
tabOpen.value = 4;
tabMain.value = "3";
break;
case "EVALUATING_COMMANDER_HIGH":
tabOpen.value = 3;
case "SUMMARY_COMMANDER":
tabOpen.value = 4;
tabMain.value = "3";
break;
case "SUMMARY_COMMANDER_HIGH":
tabOpen.value = 4;
tabMain.value = "3";
break;
case "COMPLETE":
tabOpen.value = 3;
tabOpen.value = 4;
tabMain.value = "4";
break;
default:
tabOpen.value = 1;
tabMain.value = "1";
break;
}
}
@ -398,5 +405,6 @@ export const useKpiDataStore = defineStore("KPIDataAdmin", () => {
yearRound,
selected,
statusOptions,
isUpdate,
};
});