Merge branch 'nice_dev' into develop
This commit is contained in:
commit
9d0ec773cf
5 changed files with 42 additions and 75 deletions
|
|
@ -607,7 +607,12 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
|
|||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="DataStore.searchFilterTable"
|
||||
@update:model-value="
|
||||
DataStore.searchDataTable(
|
||||
DataStore.typeinsignia,
|
||||
DataStore.employeeClass
|
||||
)
|
||||
"
|
||||
/>
|
||||
<div>
|
||||
<q-select
|
||||
|
|
@ -626,7 +631,10 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
|
|||
:borderless="false"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="
|
||||
DataStore.selectEmployeeClass(DataStore.employeeClass)
|
||||
DataStore.searchDataTable(
|
||||
DataStore.typeinsignia,
|
||||
DataStore.employeeClass
|
||||
)
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -246,7 +246,12 @@ const closeReson = () => {
|
|||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="DataStore.searchFilterTable"
|
||||
@update:model-value="
|
||||
DataStore.searchDataTable(
|
||||
DataStore.typeinsignia,
|
||||
DataStore.employeeClass
|
||||
)
|
||||
"
|
||||
/>
|
||||
<div>
|
||||
<q-select
|
||||
|
|
@ -265,7 +270,10 @@ const closeReson = () => {
|
|||
:borderless="false"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="
|
||||
DataStore.selectEmployeeClass(DataStore.employeeClass)
|
||||
DataStore.searchDataTable(
|
||||
DataStore.typeinsignia,
|
||||
DataStore.employeeClass
|
||||
)
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -243,7 +243,12 @@ const closeReson = () => {
|
|||
:outlined="true"
|
||||
:hide-dropdown-icon="false"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="DataStore.searchFilterTable"
|
||||
@update:model-value="
|
||||
DataStore.searchDataTable(
|
||||
DataStore.typeinsignia,
|
||||
DataStore.employeeClass
|
||||
)
|
||||
"
|
||||
/>
|
||||
<div>
|
||||
<q-select
|
||||
|
|
@ -262,7 +267,10 @@ const closeReson = () => {
|
|||
:borderless="false"
|
||||
style="min-width: 150px"
|
||||
@update:model-value="
|
||||
DataStore.selectEmployeeClass(DataStore.employeeClass)
|
||||
DataStore.searchDataTable(
|
||||
DataStore.typeinsignia,
|
||||
DataStore.employeeClass
|
||||
)
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
const agency = ref<string>("");
|
||||
let rows = ref<any>([]);
|
||||
const listinsignia = ref<any>([]);
|
||||
const typeinsignia = ref<number | string>("all");
|
||||
const typeinsignia = ref<string>("all");
|
||||
let typeinsigniaOptions = ref<any>([{ id: "all", name: "ทั้งหมด" }]);
|
||||
const employeeClass = ref<string>("all");
|
||||
const employeeClassOps = ref<any>([{ name: "ทั้งหมด", id: "all" }, { name: "ข้าราชการ กทม.สามัญ", id: "officer" }, { name: "ลูกจ้างประจำ", id: "perm" }])
|
||||
|
|
@ -48,6 +48,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
}));
|
||||
rows.value = await datalist
|
||||
listinsignia.value = await datalist;
|
||||
searchDataTable(typeinsignia.value, employeeClass.value)
|
||||
filtertypeInsignia();
|
||||
} else rows.value = [];
|
||||
};
|
||||
|
|
@ -77,53 +78,20 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
id: type,
|
||||
name: type,
|
||||
};
|
||||
// typeinsigniaOptions.value = [{ id: "all", name: "ทั้งหมด" }]
|
||||
typeinsigniaOptions.value.push(listtype);
|
||||
}
|
||||
} else typeinsigniaOptions.value = [{ id: "all", name: "ทั้งหมด" }];
|
||||
};
|
||||
const searchDataTable = async (type: string, employeeClass: string) => {
|
||||
if (type !== 'all' && employeeClass !== 'all') {
|
||||
rows.value = listinsignia.value.filter((e: any) => e.insigniaType === type && e.employeeType === profileType(employeeClass))
|
||||
} else if (type !== 'all' && employeeClass === 'all') {
|
||||
rows.value = listinsignia.value.filter((e: any) => e.insigniaType === type)
|
||||
} else if (type === 'all' && employeeClass !== 'all') {
|
||||
rows.value = listinsignia.value.filter((e: any) => e.employeeType === profileType(employeeClass))
|
||||
}
|
||||
|
||||
|
||||
const searchFilterTable = async () => {
|
||||
console.log(employeeClass.value);
|
||||
if (employeeClass.value === "all") {
|
||||
if (typeinsignia.value !== undefined && typeinsignia.value !== null) {
|
||||
if (typeinsignia.value === "all") {
|
||||
rows.value = listinsignia.value;
|
||||
} else {
|
||||
rows.value = listinsignia.value.filter(
|
||||
(e: any) => e.insigniaSend === typeinsignia.value
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (typeinsignia.value !== undefined && typeinsignia.value !== null) {
|
||||
if (typeinsignia.value === "all") {
|
||||
rows.value = listinsignia.value.filter((e: any) => e.employeeType === profileType(employeeClass.value))
|
||||
} else {
|
||||
rows.value = listinsignia.value.filter(
|
||||
(e: any) => e.insigniaSend === typeinsignia.value && e.employeeType === profileType(employeeClass.value)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const selectEmployeeClass = (employeeClass: string) => {
|
||||
if (typeinsignia.value !== "all") {
|
||||
if (employeeClass !== "all") {
|
||||
let list = listinsignia.value.filter((e: any) => e.employeeType === profileType(employeeClass) && e.insigniaSend === typeinsignia.value)
|
||||
rows.value = list
|
||||
} else {
|
||||
let list = listinsignia.value.filter((e: any) => e.insigniaSend === typeinsignia.value)
|
||||
rows.value = list
|
||||
}
|
||||
} else if (typeinsignia.value == "all") {
|
||||
if (employeeClass !== "all") {
|
||||
let list = listinsignia.value.filter((e: any) => e.employeeType === profileType(employeeClass))
|
||||
rows.value = list
|
||||
} else {
|
||||
rows.value = listinsignia.value
|
||||
}
|
||||
}
|
||||
}
|
||||
const convertOcid = (oc: string) => {
|
||||
let ocdata = optionsTypeOc.value.find((e: any) => e.name === oc)
|
||||
|
|
@ -149,12 +117,11 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
agency,
|
||||
fetchData,
|
||||
fetchOption,
|
||||
searchFilterTable,
|
||||
searchDataTable,
|
||||
setTypeandTitle,
|
||||
convertOcid,
|
||||
typeReport,
|
||||
titleReport,
|
||||
selectEmployeeClass,
|
||||
employeeClass,
|
||||
employeeClassOps,
|
||||
fetchDataInsignia,
|
||||
|
|
|
|||
|
|
@ -56,8 +56,6 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
|
|||
}));
|
||||
rows.value = alllist
|
||||
listInsignia.value = alllist
|
||||
// selectInvoice(invoiceType.value)
|
||||
// console.log(invoiceType.value, employeeClass.value);
|
||||
searchData(invoiceType.value, employeeClass.value);
|
||||
|
||||
}
|
||||
|
|
@ -73,28 +71,6 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
|
|||
rows.value = list
|
||||
}
|
||||
}
|
||||
// const selectInvoice = (invoice: string) => {
|
||||
// if (employeeClass.value !== 'all') {
|
||||
// if (invoice !== "all") {
|
||||
// let list = listInsignia.value.filter((e: any) => convertDatepay(e.datepay) === invoice && e.employeeType === profileType(employeeClass.value))
|
||||
// rows.value = list
|
||||
// } else rows.value = listInsignia.value.filter((e: any) => e.employeeType === profileType(employeeClass.value))
|
||||
// }
|
||||
// else {
|
||||
// if (invoice !== 'all') {
|
||||
// rows.value = listInsignia.value.filter((e: any) => convertDatepay(e.datepay) === invoice)
|
||||
// } 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":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue