Merge branch 'nice_dev' into develop
This commit is contained in:
commit
a1f3261bba
2 changed files with 25 additions and 28 deletions
|
|
@ -288,34 +288,11 @@ watch(tab, async () => {
|
||||||
fecthlistInsignia();
|
fecthlistInsignia();
|
||||||
});
|
});
|
||||||
|
|
||||||
const selectorInsignia = async () => {
|
|
||||||
const dataCopy = await DataStore.listInsignia;
|
|
||||||
rows.value =
|
|
||||||
DataStore.insignia != ""
|
|
||||||
? dataCopy.filter((x: any) => x.requestInsigniaId == DataStore.insignia)
|
|
||||||
: dataCopy;
|
|
||||||
};
|
|
||||||
const selectEmployeeClass = async (employeeClass: string) => {
|
|
||||||
if (employeeClass == "officer") {
|
|
||||||
let list = DataStore.listInsignia.filter(
|
|
||||||
(e: any) => e.employeeType === "ข้าราชการ กทม.สามัญ"
|
|
||||||
);
|
|
||||||
rows.value = list;
|
|
||||||
} else if (employeeClass === "perm") {
|
|
||||||
let list = DataStore.listInsignia.filter(
|
|
||||||
(e: any) => e.employeeType === "ลูกจ้างประจำ"
|
|
||||||
);
|
|
||||||
rows.value = list;
|
|
||||||
} else rows.value = DataStore.listInsignia;
|
|
||||||
};
|
|
||||||
|
|
||||||
const yearRound = ref<number>();
|
const yearRound = ref<number>();
|
||||||
const selectorRound = async (round: number) => {
|
const selectorRound = async (round: number) => {
|
||||||
roundYear.value = round;
|
roundYear.value = round;
|
||||||
await fecthlistInsignia();
|
await fecthlistInsignia();
|
||||||
};
|
};
|
||||||
|
|
||||||
const rows = ref<any[]>([]);
|
|
||||||
const fecthlistInsignia = async () => {
|
const fecthlistInsignia = async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
@ -324,7 +301,6 @@ const fecthlistInsignia = async () => {
|
||||||
)
|
)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
await DataStore.fetchlistinsignia(res.data.result);
|
await DataStore.fetchlistinsignia(res.data.result);
|
||||||
rows.value = DataStore.rows;
|
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -441,7 +417,12 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
:readonly="false"
|
:readonly="false"
|
||||||
:borderless="false"
|
:borderless="false"
|
||||||
style="min-width: 150px"
|
style="min-width: 150px"
|
||||||
@update:model-value="selectorInsignia"
|
@update:model-value="
|
||||||
|
DataStore.searchDatatable(
|
||||||
|
DataStore.insignia,
|
||||||
|
DataStore.employeeClass
|
||||||
|
)
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -461,7 +442,10 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
:borderless="false"
|
:borderless="false"
|
||||||
style="min-width: 150px"
|
style="min-width: 150px"
|
||||||
@update:model-value="
|
@update:model-value="
|
||||||
selectEmployeeClass(DataStore.employeeClass)
|
DataStore.searchDatatable(
|
||||||
|
DataStore.insignia,
|
||||||
|
DataStore.employeeClass
|
||||||
|
)
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -521,7 +505,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<d-table
|
<d-table
|
||||||
:rows="rows"
|
:rows="DataStore.rows"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:visible-columns="visibleColumns"
|
:visible-columns="visibleColumns"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,19 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
|
||||||
}));
|
}));
|
||||||
rows.value = list
|
rows.value = list
|
||||||
listInsignia.value = list
|
listInsignia.value = list
|
||||||
// selectInvoice(invoiceType.value)
|
searchDatatable(insignia.value, employeeClass.value)
|
||||||
|
}
|
||||||
|
const searchDatatable = (type: string, employeeClass: string) => {
|
||||||
|
if (type !== '' && employeeClass !== "all") {
|
||||||
|
rows.value = listInsignia.value.filter((e: any) => e.requestInsigniaId == type && e.profileType == employeeClass
|
||||||
|
)
|
||||||
|
} else if (type !== '' && employeeClass == "all") {
|
||||||
|
rows.value = listInsignia.value.filter((e: any) => e.requestInsigniaId == type
|
||||||
|
)
|
||||||
|
} else if (type == '' && employeeClass !== "all") {
|
||||||
|
rows.value = listInsignia.value.filter((e: any) => e.profileType == employeeClass
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const status = (val: string) => {
|
const status = (val: string) => {
|
||||||
|
|
@ -89,5 +101,6 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
|
||||||
fetchDataInsignia,
|
fetchDataInsignia,
|
||||||
profileType,
|
profileType,
|
||||||
fetchlistinsignia,
|
fetchlistinsignia,
|
||||||
|
searchDatatable,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue