เพิ่ม select สถานภาพ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-09-01 09:14:38 +07:00
parent 287ef3c598
commit cf8bdb7ce0
6 changed files with 90 additions and 16 deletions

View file

@ -15,6 +15,8 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
const insigniaType = ref<any>()
const invoiceType = ref<string>('all')
const invoiceTypeop = ref<any>([{ name: "ทั้งหมด", id: "all" }, { name: "ใบกำกับที่ค้างจ่าย", id: "noDate" }, { name: "ใบกำกับที่จ่ายแล้ว", id: "haveDate" }])
const employeeClass = ref<string>("all");
const employeeClassOps = ref<any>([{ name: "ทั้งหมด", id: "all" }, { name: "ข้าราชการ กทม.สามัญ", id: "officer" }, { name: "ลูกจ้างประจำ", id: "perm" }])
const rows = ref<any>([])
const listInsignia = ref<any>([])
@ -67,6 +69,15 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
rows.value = list
} else rows.value = listInsignia.value
}
const selectEmployeeClass = (employeeClass: string) => {
if (employeeClass == "officer") {
let list = listInsignia.value.filter((e: any) => e.employeeType === "ข้าราชการ กทม.สามัญ")
rows.value = list
} else if (employeeClass === "perm") {
let list = listInsignia.value.filter((e: any) => e.employeeType === "ลูกจ้างประจำ")
rows.value = list
} else rows.value = listInsignia.value
}
const status = (val: string) => {
switch (val) {
case "PENDING":
@ -95,11 +106,14 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
insigniaType,
invoiceType,
invoiceTypeop,
employeeClass,
employeeClassOps,
fetchDatainsignia,
fetchDatainsigniaType,
status,
profileType,
fetchlistinsignia,
selectInvoice,
selectEmployeeClass,
};
});