เครื่องราชฯ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-09-19 14:58:16 +07:00
parent 8ebbef05d9
commit 1530da36cf
22 changed files with 159 additions and 777 deletions

View file

@ -30,7 +30,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
typeReport.value = type;
titleReport.value = title;
};
// เรียกราชชื่อการเสนอขอ
const fetchData = async (data: any) => {
if (data !== null) {
let datalist = await data.map((e: any) => ({
@ -55,11 +55,13 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
filtertypeInsignia();
} else rows.value = [];
};
// เรียกข้อมูลรอบการเสนอขอ
const fetchDataInsignia = async (data: any) => {
isLock.value = data.isLock;
isLock.value = data.isLock; // สถานะล็อกข้อมูล
requestId.value = data.requestId;
requestStatus.value = data.requestStatus;
requestStatus.value = data.requestStatus; // สถานะของรอบการเสนอขอ
}
// เรียก Option หน่วยงานทั้งหมด
const fetchOption = (op: any) => {
if (agency.value !== null) {
typeOc.value = agency.value;
@ -68,9 +70,11 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
(optionsTypeOc.value = op), (typeOc.value = op[2].id);
}
};
// หาประเภทเครื่องราชทั้งหมดที่อยู่ในรายชื่อข้าราชการสามัญฯ
const filtertypeInsignia = async () => {
typeinsignia.value = "all";
if (listinsignia.value.length !== 0) {
// หาประเภทเครื่องราชที่ขอที่ชื่อซ้ำกัน
const double_name = [
...new Set(listinsignia.value.map((item: any) => item.insigniaSend)),
];
@ -85,6 +89,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
}
} else typeinsigniaOptions.value = [{ id: "all", name: "ทั้งหมด" }];
};
// ค้นหาข้อมมูลราชชื่อ ตาม ประเท๓และสถานภาพ
const searchDataTable = async (type: string, employeeClasstype: string) => {
typeinsignia.value = type
employeeClass.value = employeeClasstype
@ -97,15 +102,9 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
} else if (type === 'all' && employeeClasstype === 'all') {
rows.value = listinsignia.value
}
}
const convertOcid = (oc: string) => {
let ocdata = optionsTypeOc.value.find((e: any) => e.name === oc)
if (ocdata) {
return ocdata.id
} else return ""
}
// ประเภทลูกจ้าง
const profileType = (val: string) => {
switch (val) {
case "officer":
@ -129,7 +128,6 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
fetchOption,
searchDataTable,
setTypeandTitle,
convertOcid,
typeReport,
titleReport,
employeeClass,