Merge branch 'Nice' into develop
This commit is contained in:
commit
38b0a2e548
2 changed files with 57 additions and 31 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue