รายการตัวชี้วัดตามตำแหน่ง api

This commit is contained in:
STW_TTTY\stwtt 2024-04-19 16:42:52 +07:00
parent 25932352a6
commit 3a7f46a9a2
3 changed files with 156 additions and 31 deletions

View file

@ -8,12 +8,13 @@ import { useRouter } from "vue-router";
import Header from "@/components/DialogHeader.vue";
import type { DataOption } from "@/modules/14_KPI/interface/index/Main";
import type { ListGroup } from "@/modules/14_KPI/interface/request/Main";
import http from "@/plugins/http";
import config from "@/app.config";
const modal = ref<boolean>(false);
const router = useRouter();
const rows = ref<any>();
const rows = ref<any>([]);
const editStatus = ref<boolean>(false);
const groupName = ref<string>("");
const position = ref<any>(null);
@ -207,9 +208,51 @@ async function deleteData(id: string) {
// });
}
/** ดึงข้อมูล */
async function getListGroup() {
showLoader();
await http
.get(config.API.kpiGroup)
.then(async (res) => {
const data = res.data.result.data;
groupNameOp.value = data.map((item: ListGroup) => ({
id: item.id,
name: item.nameGroupKPI,
}));
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
/** ดึงข้อมูล */
async function getCompetency() {
showLoader();
await http
.get(config.API.kpiCapacity + `?type=GROUP`)
.then(async (res) => {
const data = res.data.result.data;
competencyOp.value = data.map((item: any) => ({
id: item.id,
name: item.name,
}));
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
/** เปลี่ยนเป็นหน้าเพิ่มข้อมูล */
function onAdd() {
getOptions();
getListGroup();
getCompetency();
modal.value = true;
}
@ -416,6 +459,7 @@ onMounted(async () => {
label="กลุ่มงาน"
outlined
emit-value
class="inputgreen"
map-options
option-label="name"
option-value="id"