diff --git a/src/components/SkeletonTable.vue b/src/components/SkeletonTable.vue index fbcf1c949..ea9da21ee 100644 --- a/src/components/SkeletonTable.vue +++ b/src/components/SkeletonTable.vue @@ -1,5 +1,5 @@ - - - - - - - - + + + + + + + + + + - - - - - - - - + + + + + + + {{ + col.label + }} + + + + + + + + + + + + diff --git a/src/modules/07_insignia/storeResult.ts b/src/modules/07_insignia/storeResult.ts index c2bca8176..539ec6aa1 100644 --- a/src/modules/07_insignia/storeResult.ts +++ b/src/modules/07_insignia/storeResult.ts @@ -109,7 +109,7 @@ export const useResultDataStore = defineStore("insigniaResult", () => { page: e.page, number: e.no, vatnumber: e.number, - datepay: date2Thai(e.datePayment), + datepay: date2Thai(e.datePayment) || null, typepay: e.typePayment, address: e.address, dateReceiveInsignia: e.dateReceiveInsignia, @@ -136,13 +136,13 @@ export const useResultDataStore = defineStore("insigniaResult", () => { if (invoice !== "all" && employeeClass !== "all") { let list = listInsignia.value.filter( (e: any) => - convertDatepay(e.datepay) === invoice && + convertDatepay(e.datepay, e.statusMain) === invoice && e.employeeType === profileType(employeeClass) ); rows.value = list; } else if (invoice !== "all" && employeeClass === "all") { let list = listInsignia.value.filter( - (e: any) => convertDatepay(e.datepay) === invoice + (e: any) => convertDatepay(e.datepay, e.statusMain) === invoice ); rows.value = list; } else if (invoice === "all" && employeeClass !== "all") { @@ -187,16 +187,13 @@ export const useResultDataStore = defineStore("insigniaResult", () => { } /** - * function convert สถานะ การจ่าย - * @param val สถานะ การจ่าย + * function convert สถานะ การจ่าย + * @param val วันที่จ่าย (string | null) + * @param status สถานะ (string) + * @returns "haveDate" | "noDate" */ - function convertDatepay(val: string | null) { - switch (val) { - case null: - return "noDate"; - default: - return "haveDate"; - } + function convertDatepay(val: string | null, status: string) { + return val !== null && status === "DONE" ? "haveDate" : "noDate"; } return {