From 9f5147b92339e3e1b65e11662613a1ba1baafcbc Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 28 Nov 2024 15:25:03 +0700 Subject: [PATCH] kpi --- src/modules/08_KPI/store.ts | 95 ++++++- src/modules/08_KPI/views/main.vue | 416 +++++++++++++++++++----------- src/style/quasar-variables.sass | 17 ++ 3 files changed, 371 insertions(+), 157 deletions(-) diff --git a/src/modules/08_KPI/store.ts b/src/modules/08_KPI/store.ts index 5074234..2765555 100644 --- a/src/modules/08_KPI/store.ts +++ b/src/modules/08_KPI/store.ts @@ -111,6 +111,57 @@ export const useKpiDataStore = defineStore("KPIDate", () => { return competency?.name; } + const statusOptions = ref([ + { + id: "", + name: "ทั้งหมด", + }, + { + id: "NEW", + name: "จัดทำข้อตกลง", + }, + { + id: "NEW_EVALUATOR", + name: "รอผู้ประเมินตรวจสอบข้อตกลง", + }, + { + id: "NEW_COMMANDER", + name: "รอผู้บังคับบัญชาเหนือขึ้นไปตรวจสอบข้อตกลง", + }, + { + id: "NEW_COMMANDER_HIGH", + name: "รอผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่งตรวจสอบข้อตกลง", + }, + { + id: "APPROVE", + name: "รายงานความก้าวหน้า", + }, + { + id: "EVALUATING", + name: "รายงานผลสำเร็จของงาน", + }, + { + id: "EVALUATING_EVALUATOR", + name: "รอผู้ประเมินตรวจสอบผล", + }, + { + id: "EVALUATING_COMMANDER", + name: "รอผู้บังคับบัญชาเหนือขึ้นไปตรวจสอบผล", + }, + { + id: "EVALUATING_COMMANDER_HIGH", + name: "รอผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่งตรวจสอบผล", + }, + { + id: "COMPLETE", + name: "รอประกาศผลการประเมิน", + }, + { + id: "KP7", + name: "ประกาศและลงทะเบียนประวัติแล้ว", + }, + ]); + function convertStatus(val: string) { switch (val) { case "NEW": @@ -142,6 +193,45 @@ export const useKpiDataStore = defineStore("KPIDate", () => { } } + const resultsOptions = ref([ + { + id: "", + name: "ทั้งหมด", + }, + { + id: "PENDING", + name: "รอดำเนินการ", + }, + { + id: "PASSED", + name: "ผ่านการประเมิน", + }, + { + id: "NOTPASSED", + name: "ไม่ผ่านการประเมิน", + }, + { + id: "EXCELLENT", + name: "ดีเด่น", + }, + { + id: "VERY_GOOD", + name: "ดีมาก", + }, + { + id: "GOOD", + name: "ดี", + }, + { + id: "FAIR", + name: "พอใช้", + }, + { + id: "IMPROVEMENT", + name: "ต้องปรับปรุง", + }, + ]); + function convertResults(val: string) { switch (val) { case "EXCELLENT": @@ -159,7 +249,7 @@ export const useKpiDataStore = defineStore("KPIDate", () => { } } - const defaultCompetencyCoreLevel = ref(null); + const defaultCompetencyCoreLevel = ref(null); const defaultCompetencyGroupLevel = ref(null); function checkCompetencyDefaultCompetencyLevel() { const posTypeName = dataEvaluation.value.posTypeName; @@ -422,5 +512,8 @@ export const useKpiDataStore = defineStore("KPIDate", () => { selected, work, isUpdate, + + resultsOptions, + statusOptions, }; }); diff --git a/src/modules/08_KPI/views/main.vue b/src/modules/08_KPI/views/main.vue index ff56a5e..272ef00 100644 --- a/src/modules/08_KPI/views/main.vue +++ b/src/modules/08_KPI/views/main.vue @@ -115,6 +115,9 @@ const evaluatorIdMainOp = ref([]); const commanderIdMainOp = ref([]); const commanderHighMainOp = ref([]); +const statusOp = ref(store.statusOptions); +const resultOp = ref(store.resultsOptions); + /** Dialog*/ const modalDialog = ref(false); const yearDialog = ref(null); @@ -137,6 +140,8 @@ const formRound = reactive({ const formQuery = reactive({ page: 1, pageSize: 10, + status: "", + results: "", }); const total = ref(0); const totalList = ref(1); @@ -151,7 +156,7 @@ const pagination = ref({ /** * ดึงข้อมูลรอบการประเมิน - * @param type + * @param type */ async function fetchRoundOption(type: string) { const y = type === "main" ? year.value : yearDialog.value; @@ -194,11 +199,17 @@ async function fetchRoundOption(type: string) { */ async function fetchList() { showLoader(); + let queryParams = { + page: formQuery.page, + pageSize: formQuery.pageSize, + kpiPeriodId: round.value, + status: formQuery.status === "" ? undefined : formQuery.status, + results: formQuery.results === "" ? undefined : formQuery.results, + }; await http - .get( - config.API.kpiEvaluation + - `?page=${formQuery.page}&pageSize=${formQuery.pageSize}&kpiPeriodId=${round.value}` - ) + .get(config.API.kpiEvaluation, { + params: queryParams, + }) .then(async (res) => { const data = await res.data.result; total.value = data.total; @@ -369,6 +380,21 @@ function filterOption(val: string, update: Function, refData: string) { ); }); break; + + case "status": + update(() => { + statusOp.value = store.statusOptions.filter( + (v: DataOptions) => v.name.indexOf(val) > -1 + ); + }); + break; + case "result": + update(() => { + resultOp.value = store.resultsOptions.filter( + (v: DataOptions) => v.name.indexOf(val) > -1 + ); + }); + break; default: break; } @@ -405,161 +431,239 @@ onMounted(async () => {
-
-
- - - - - +
+
+
+ + + + + +
+ +
+ + เพิ่มข้อมูล + +
+ + +
+ +
-
- -
+
+ +
+
+ +
-
- - เพิ่มข้อมูล - -
- - -
- -
-
- -
- - - - - - + +
+ +
+ + + + + + +
diff --git a/src/style/quasar-variables.sass b/src/style/quasar-variables.sass index 1930ed5..d628cea 100644 --- a/src/style/quasar-variables.sass +++ b/src/style/quasar-variables.sass @@ -114,3 +114,20 @@ input.input-alert overflow: visible white-space: normal transition: width 2s + +.select_ellipsis3 .q-field__native > span + white-space: nowrap + overflow: hidden + text-overflow: ellipsis + width: auto + max-width: 60ch + +.select_ellipsis2 .q-field__native > span + white-space: nowrap + overflow: hidden + text-overflow: ellipsis + width: auto + max-width: 30ch + +.filter-card + background-color: #f1f1f1b0