diff --git a/src/api/14_KPI/api.KPI.ts b/src/api/14_KPI/api.KPI.ts index c3bab1be3..4121a0153 100644 --- a/src/api/14_KPI/api.KPI.ts +++ b/src/api/14_KPI/api.KPI.ts @@ -92,4 +92,7 @@ export default { achievementDev: `${KpiUser}/achievement/development/admin`, achievementDevByid: (id: string) => `${KpiUser}/achievement/development/admin/detail/${id}`, + + indicatorSummary:`${kpiPlan}/summary/indicator` + }; diff --git a/src/modules/01_masterdata/views/Assignment.vue b/src/modules/01_masterdata/views/Assignment.vue index 6db294258..abd2ab0c7 100644 --- a/src/modules/01_masterdata/views/Assignment.vue +++ b/src/modules/01_masterdata/views/Assignment.vue @@ -64,6 +64,29 @@ const formFilter = reactive({ const totalList = ref(0); //จำนวนข้อมูลรายการ const maxPage = ref(1); +const indicatorTotal = ref([ + { + value: "kpiPlan", + label: "ตัวชี้วัดตามแผน", + color: "edit", + }, + { + value: "kpiRole", + label: "ตัวชี้วัดตามตำแหน่ง", + color: "primary", + }, + { + value: "kpiSpecial", + label: "ตัวชี้วัดงานอื่นๆ ที่ได้รับมอบหมาย", + color: "blue", + }, + { + value: "total", + label: "ทั้งหมด", + color: "red", + }, +]); + function fetchList() { showLoader(); formFilter.year = formFilter.year ? formFilter.year.toString() : null; @@ -122,7 +145,26 @@ watch( } ); +function getTotal() { + http + .post(config.API.indicatorSummary) + .then((res) => { + const data = res.data.result; + indicatorTotal.value = indicatorTotal.value.map((indicator) => { + return { + ...indicator, + total: data[indicator.value], + }; + }); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => {}); +} + onMounted(() => { + getTotal(); fetchList(); }); @@ -132,6 +174,33 @@ onMounted(() => { รายการงานอื่นๆ ที่ได้รับมอบหมาย +
+
+ +
+
+
+
+ {{ i.label }} + + +
+
+
+
+
+
+
diff --git a/src/modules/01_masterdata/views/indicatorByPlan.vue b/src/modules/01_masterdata/views/indicatorByPlan.vue index 15f11904e..d4d8d8c20 100644 --- a/src/modules/01_masterdata/views/indicatorByPlan.vue +++ b/src/modules/01_masterdata/views/indicatorByPlan.vue @@ -49,6 +49,28 @@ const expanded = ref([]); const filterMain = ref(""); const visibleColumns = ref(["including", "includingName"]); +const indicatorTotal = ref([ + { + value: "kpiPlan", + label: "ตัวชี้วัดตามแผน", + color: "edit", + }, + { + value: "kpiRole", + label: "ตัวชี้วัดตามตำแหน่ง", + color: "primary", + }, + { + value: "kpiSpecial", + label: "ตัวชี้วัดงานอื่นๆ ที่ได้รับมอบหมาย", + color: "blue", + }, + { + value: "total", + label: "ทั้งหมด", + color: "red", + }, +]); const roundOp = ref([ { id: "", name: "ทั้งหมด" }, { id: "APR", name: "รอบเมษายน" }, @@ -195,7 +217,26 @@ function onClickHistory(id: string) { }); } +function getTotal() { + http + .post(config.API.indicatorSummary) + .then((res) => { + const data = res.data.result; + indicatorTotal.value = indicatorTotal.value.map((indicator) => { + return { + ...indicator, + total: data[indicator.value], + }; + }); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => {}); +} + onMounted(() => { + getTotal(); fetchActive(); }); @@ -267,6 +308,29 @@ onMounted(() => {
+ +
+
+
+
+ {{ i.label }} + + +
+
+
+
+
([ + { + value: "kpiPlan", + label: "ตัวชี้วัดตามแผน", + color: "edit", + }, + { + value: "kpiRole", + label: "ตัวชี้วัดตามตำแหน่ง", + color: "primary", + }, + { + value: "kpiSpecial", + label: "ตัวชี้วัดงานอื่นๆ ที่ได้รับมอบหมาย", + color: "blue", + }, + { + value: "total", + label: "ทั้งหมด", + color: "red", + }, +]); + /** Option รอบการประเมิน*/ const roundOp = ref([ { id: "", name: "ทั้งหมด" }, @@ -220,7 +243,26 @@ function onClickHistory(id: string) { }); } +function getTotal() { + http + .post(config.API.indicatorSummary) + .then((res) => { + const data = res.data.result; + indicatorTotal.value = indicatorTotal.value.map((indicator) => { + return { + ...indicator, + total: data[indicator.value], + }; + }); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => {}); +} + onMounted(async () => { + await getTotal(); await getOptions(); await fetchList(); }); @@ -231,7 +273,35 @@ onMounted(async () => { รายการตัวชี้วัดตามตำแหน่ง
+
+
+ +
+
+
+
+ {{ i.label }} + + +
+
+
+
+
+
+
+