diff --git a/src/modules/08_KPI/components/Tab/Topic/01_Indicator.vue b/src/modules/08_KPI/components/Tab/Topic/01_Indicator.vue index 318ba81..50f7993 100644 --- a/src/modules/08_KPI/components/Tab/Topic/01_Indicator.vue +++ b/src/modules/08_KPI/components/Tab/Topic/01_Indicator.vue @@ -275,7 +275,7 @@ const isEditStep3 = computed(() => { - { - + diff --git a/src/modules/08_KPI/store.ts b/src/modules/08_KPI/store.ts index f9e5b64..636dd18 100644 --- a/src/modules/08_KPI/store.ts +++ b/src/modules/08_KPI/store.ts @@ -129,11 +129,9 @@ export const useKpiDataStore = defineStore("KPIDate", () => { } } - function checkCompetency() { - const position = dataEvaluation.value.position; - const posTypeName = dataEvaluation.value.posTypeName; - const posLevelName = dataEvaluation.value.posLevelName; - const executiveName = dataEvaluation.value.posExecutiveName; + async function checkCompetency() { + const position = await dataEvaluation.value.position; + const executiveName = await dataEvaluation.value.posExecutiveName; if ( position == "ผู้ตรวจราชการกรุงเทพมหานคร" || @@ -156,33 +154,6 @@ export const useKpiDataStore = defineStore("KPIDate", () => { (x: DataOptions) => x.id == "HEAD" || x.id == "EXECUTIVE" ); } - // switch (posTypeName + " " + posLevelName) { - // // case "ทั่วไป ปฏิบัติงาน": - // // case "ทั่วไป ชำนาญงาน": - // // case "ทั่วไป อาวุโส": - // // case "วิชาการ ปฏิบัติการ": - // // case "วิชาการ ชำนาญการ": - // // case "วิชาการ ชำนาญการพิเศษ": - // // case "วิชาการ เชี่ยวชาญ": - // // case "วิชาการ ทรงคุณวุฒิ": - // // competencyType.value = competencyType.value.filter( - // // (x: DataOptions) => x.id == "HEAD" || x.id == "GROUP" - // // ); - // // break; - // case "อำนวยการ ต้น": - // case "อำนวยการ สูง": - // case "บริหาร ต้น": - // case "บริหาร สูง": - // competencyType.value = competencyType.value.filter( - // (x: DataOptions) => x.id == "HEAD" || x.id == "EXECUTIVE" - // ); - // break; - // default: - // competencyType.value = competencyType.value.filter( - // (x: DataOptions) => x.id == "HEAD" || x.id == "GROUP" - // ); - // break; - // } } } diff --git a/src/modules/08_KPI/views/form.vue b/src/modules/08_KPI/views/form.vue index 6401e12..94b90cf 100644 --- a/src/modules/08_KPI/views/form.vue +++ b/src/modules/08_KPI/views/form.vue @@ -130,7 +130,7 @@ function onSubmit() { ? commanderHighId.value.id : null, }) - .then((res) => { + .then(() => { success($q, "บันทึกสำเร็จ"); close(); }) @@ -246,13 +246,11 @@ function filterOption(val: any, update: Function, refData: string) { // getAll(); // } -async function getAll() { - await getProfile(); - await fetchEvaluation(); - - await store.checkStep(); - - await getOrgOp(); +function getAll() { + getProfile(); + fetchEvaluation(); + store.checkStep(); + getOrgOp(); } function sendToEvaluatore(status: string) { @@ -265,7 +263,7 @@ function sendToEvaluatore(status: string) { .put(config.API.kpiSendToStatus(id.value), { status: status, }) - .then((res) => { + .then(() => { success($q, "ส่งข้อตกลงให้ผู้ประเมินอนุมัติสำเร็จ"); close(); }) @@ -292,7 +290,7 @@ function requireEdit() { .put(config.API.kpiReqEdit(id.value), { status: "EVALUATOR", }) - .then((res) => { + .then(() => { success($q, "ขอแก้ไขสำเร็จ"); close(); }) @@ -309,10 +307,9 @@ function requireEdit() { ); } -onMounted(async () => { +onMounted(() => { showLoader(); - await getAll(); - console.log(store.dataEvaluation.avartar); + getAll(); }); diff --git a/src/modules/08_KPI/views/main.vue b/src/modules/08_KPI/views/main.vue index 87e2940..0968880 100644 --- a/src/modules/08_KPI/views/main.vue +++ b/src/modules/08_KPI/views/main.vue @@ -272,11 +272,11 @@ function onSubmit() { function getProfile() { http .get(config.API.profilePosition()) - .then((res) => { + .then(async (res) => { const data = res.data.result; store.dataProfile = data; - store.checkCompetency(); - store.checkCompetencyDefaultCompetencyLevel(); + await store.checkCompetency(); + await store.checkCompetencyDefaultCompetencyLevel(); formRound.profileId = data.profileId; formRound.prefix = data.prefix;