From 8c0892dfd42426823ad85918995a9f2ab2e309c0 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 31 Jul 2025 16:30:46 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=A3=E0=B8=B0=E0=B8=9A=E0=B8=9A=E0=B9=80?= =?UTF-8?q?=E0=B8=84=E0=B8=A3=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=87=E0=B8=A3?= =?UTF-8?q?=E0=B8=B2=E0=B8=8A=E0=B8=AF=20>>=20=E0=B8=9A=E0=B8=B1=E0=B8=99?= =?UTF-8?q?=E0=B8=97=E0=B8=B6=E0=B8=81=E0=B8=9C=E0=B8=A5=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3=E0=B9=80=E0=B8=AA=E0=B8=99=E0=B8=AD=E0=B8=82=E0=B8=AD?= =?UTF-8?q?=20(=E0=B8=81=E0=B8=A3=E0=B8=AD=E0=B8=87=E0=B8=82=E0=B9=89?= =?UTF-8?q?=E0=B8=AD=E0=B8=A1=E0=B8=B9=E0=B8=A5=E0=B9=83=E0=B8=9A=E0=B8=81?= =?UTF-8?q?=E0=B8=B3=E0=B8=81=E0=B8=B1=E0=B8=9A=E0=B8=97=E0=B8=B5=E0=B9=88?= =?UTF-8?q?=E0=B8=84=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B8=88=E0=B9=88=E0=B8=B2?= =?UTF-8?q?=E0=B8=A2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SkeletonTable.vue | 67 ++++++++++++++++++-------- src/modules/07_insignia/storeResult.ts | 21 ++++---- 2 files changed, 57 insertions(+), 31 deletions(-) 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 @@ 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 {