เลื่อนเงินเดือน

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-03-28 10:05:13 +07:00
parent 4c3d5c8fb8
commit c675a1eb29
3 changed files with 83 additions and 12 deletions

View file

@ -40,6 +40,7 @@ const snapOptions = ref<DataOption[]>();
const periodLatest = ref<DataPeriodLatest>();
const isLoad = ref<boolean>(false);
const isDisable = ref<boolean>(false);
/** ตัวแปร select*/
const page = ref<number>(1);
@ -51,6 +52,7 @@ const nextPage = ref<number>(1);
/**function เรียกข้อมูลรอบการขึ้นเงินเดือน*/
function getRound() {
roundOptions.value = [];
isDisable.value = false;
showLoader();
http
.get(
@ -60,6 +62,7 @@ function getRound() {
.then(async (res) => {
const data = res.data.result.data;
if (data.length !== 0) {
isDisable.value = true;
lastPage.value = Math.ceil(res.data.result.total / pageSize.value);
const optionMain = await data.map((x: DataRound) => ({
id: x.id,
@ -372,7 +375,7 @@ onMounted(() => {
@update:model-value="onChangeRound"
:loading="loading"
@virtual-scroll="onScroll"
:disable="!isLoad"
:disable="!isDisable"
>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
@ -398,7 +401,7 @@ onMounted(() => {
hide-bottom-space
bg-color="white"
@update:model-value="onChangeSnap"
:disable="!isLoad"
:disable="!isDisable"
/>
<q-select
class="q-ml-xs"
@ -415,7 +418,7 @@ onMounted(() => {
hide-bottom-space
bg-color="white"
@update:model-value="onChangeAgency"
:disable="!isLoad"
:disable="!isDisable"
/>
</div>

View file

@ -39,6 +39,7 @@ const snapOptions = ref<DataOption[]>();
const periodLatest = ref<DataPeriodLatest>();
const isLoad = ref<boolean>(false);
const isDisable = ref<boolean>(false);
/** ตัวแปร select*/
const page = ref<number>(1);
@ -51,6 +52,7 @@ const nextPage = ref<number>(1);
function getRound() {
roundOptions.value = [];
showLoader();
isDisable.value = false;
http
.get(
config.API.salaryPeriodActive(year.value.toString()) +
@ -59,6 +61,7 @@ function getRound() {
.then(async (res) => {
const data = res.data.result.data;
if (data.length !== 0) {
isDisable.value = true;
lastPage.value = Math.ceil(res.data.result.total / pageSize.value);
const optionMain = await data.map((x: DataRound) => ({
id: x.id,
@ -220,8 +223,6 @@ function fetchSalalyPeriod(rootId: string, periodId: string, snap: string) {
.then(async (res) => {
const data = res.data.result;
console.log(roundFilter.value.shortCode);
if (roundFilter.value.shortCode !== "SPECIAL") {
if (Object.values(data).includes(null)) {
isLoad.value = false;
@ -238,6 +239,7 @@ function fetchSalalyPeriod(rootId: string, periodId: string, snap: string) {
})
.catch((err) => {
messageError($q, err);
// isLoad.value = true;
})
.finally(() => {
setTimeout(() => {
@ -396,7 +398,7 @@ onMounted(async () => {
@update:model-value="onChangeRound"
:loading="loading"
@virtual-scroll="onScroll"
:disable="!isLoad"
:disable="!isDisable"
>
<template v-slot:option="scope">
<q-item v-bind="scope.itemProps">
@ -422,7 +424,7 @@ onMounted(async () => {
hide-bottom-space
bg-color="white"
@update:model-value="onChangeSnap"
:disable="!isLoad"
:disable="!isDisable"
/>
<q-select
class="q-ml-xs"
@ -439,7 +441,7 @@ onMounted(async () => {
hide-bottom-space
bg-color="white"
@update:model-value="onChangeAgency"
:disable="!isLoad"
:disable="!isDisable"
/>
</div>
@ -480,7 +482,11 @@ onMounted(async () => {
</q-card>
</div>
<div v-else>
<PageDashBoard />
<PageDashBoard
:year="year"
:snapShot="snapFilter"
:roundFilter="roundFilter"
/>
</div>
</q-card>