เงินเดิอด=> fix bug

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-07-17 13:28:43 +07:00
parent 1f679bd6b4
commit 1065ea1816
2 changed files with 7 additions and 10 deletions

View file

@ -53,7 +53,6 @@ const nextPage = ref<number>(1);
/**function เรียกข้อมูลรอบการขึ้นค่าจ้าง*/ /**function เรียกข้อมูลรอบการขึ้นค่าจ้าง*/
function getRound() { function getRound() {
roundOptions.value = [];
isDisable.value = false; isDisable.value = false;
showLoader(); showLoader();
http http
@ -62,11 +61,13 @@ function getRound() {
`?page=${page.value}&pageSize=${pageSize.value}&keyword=&year=0` `?page=${page.value}&pageSize=${pageSize.value}&keyword=&year=0`
) )
.then(async (res) => { .then(async (res) => {
roundOptions.value = [];
roundFilter.value = [];
const data = res.data.result.data; const data = res.data.result.data;
if (data.length !== 0) { if (data.length !== 0) {
isDisable.value = true; isDisable.value = true;
lastPage.value = Math.ceil(res.data.result.total / pageSize.value); lastPage.value = Math.ceil(res.data.result.total / pageSize.value);
const optionMain = await data.map((x: DataRound) => ({ roundOptions.value = await data.map((x: DataRound) => ({
id: x.id, id: x.id,
revisionId: x.revisionId, revisionId: x.revisionId,
shortCode: x.period, shortCode: x.period,
@ -79,9 +80,7 @@ function getRound() {
? "รอบพิเศษ " ? "รอบพิเศษ "
: "รอบเมษายน ", : "รอบเมษายน ",
})); }));
roundOptions.value.push(...optionMain);
roundFilter.value = await [];
roundFilter.value = await (roundOptions.value roundFilter.value = await (roundOptions.value
? roundOptions.value[0] ? roundOptions.value[0]
: ""); : "");

View file

@ -52,7 +52,6 @@ const nextPage = ref<number>(1);
/**function เรียกข้อมูลรอบการขึ้นเงินเดือน*/ /**function เรียกข้อมูลรอบการขึ้นเงินเดือน*/
function getRound() { function getRound() {
roundOptions.value = [];
showLoader(); showLoader();
isDisable.value = false; isDisable.value = false;
http http
@ -61,11 +60,13 @@ function getRound() {
`?page=${page.value}&pageSize=${pageSize.value}&keyword=&year=0` `?page=${page.value}&pageSize=${pageSize.value}&keyword=&year=0`
) )
.then(async (res) => { .then(async (res) => {
roundOptions.value = [];
roundFilter.value = [];
const data = res.data.result.data; const data = res.data.result.data;
if (data.length !== 0) { if (data.length !== 0) {
isDisable.value = true; isDisable.value = true;
lastPage.value = Math.ceil(res.data.result.total / pageSize.value); lastPage.value = Math.ceil(res.data.result.total / pageSize.value);
const optionMain = await data.map((x: DataRound) => ({ roundOptions.value = await data.map((x: DataRound) => ({
id: x.id, id: x.id,
revisionId: x.revisionId, revisionId: x.revisionId,
shortCode: x.period, shortCode: x.period,
@ -78,9 +79,7 @@ function getRound() {
? "รอบพิเศษ " ? "รอบพิเศษ "
: "รอบเมษายน ", : "รอบเมษายน ",
})); }));
roundOptions.value.push(...optionMain);
roundFilter.value = await [];
roundFilter.value = await (roundOptions.value roundFilter.value = await (roundOptions.value
? roundOptions.value[0] ? roundOptions.value[0]
: ""); : "");
@ -348,14 +347,13 @@ onMounted(() => {
</div> </div>
<q-space /> <q-space />
<datepicker <datepicker
menu-class-name="modalfix"
v-model="year" v-model="year"
:locale="'th'" :locale="'th'"
autoApply autoApply
year-picker year-picker
:enableTimePicker="false" :enableTimePicker="false"
style="width: 150px" style="width: 150px"
@update:model-value="getRound" @update:model-value="getRound()"
> >
<template #year="{ year }">{{ year + 543 }}</template> <template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{ <template #year-overlay-value="{ value }">{{