Merge branch 'Nice' into develop

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-07-31 16:31:11 +07:00
commit 38b0a2e548
2 changed files with 57 additions and 31 deletions

View file

@ -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 {