no message

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-03-04 16:40:57 +07:00
parent ba5a80e95b
commit 0a3ec33161

View file

@ -46,7 +46,7 @@ const loading = ref(false);
const nextPage = ref<number>(1); const nextPage = ref<number>(1);
/**function เรียกข้อมูลรอบการขึ้นเงินเดือน*/ /**function เรียกข้อมูลรอบการขึ้นเงินเดือน*/
function getRound() { async function getRound() {
showLoader(); showLoader();
http http
.get( .get(
@ -81,13 +81,13 @@ function getRound() {
await getAgency(roundFilter.value.revisionId); await getAgency(roundFilter.value.revisionId);
await getAgencyPosition(roundFilter.value.revisionId); await getAgencyPosition(roundFilter.value.revisionId);
if (agencyFilter.value && roundFilter.value.id && snapFilter.value) { // if (agencyFilter.value && roundFilter.value.id && snapFilter.value) {
await fetchSalalyPeriod( // await fetchSalalyPeriod(
agencyFilter.value, // agencyFilter.value,
roundFilter.value.id, // roundFilter.value.id,
snapFilter.value // snapFilter.value
); // );
} // }
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -164,13 +164,21 @@ function getAgencyPosition(id: string) {
if (id) { if (id) {
http http
.get(config.API.keycloakPositionByid(id)) .get(config.API.keycloakPositionByid(id))
.then(async (res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
const position = agencyOptions.value?.find( const position = agencyOptions.value?.find(
(e: DataOption) => e.id === data.rootId (e: DataOption) => e.id === data.rootId
); );
agencyFilter.value = position ? position.id : ""; agencyFilter.value = position ? position.id : "";
if (agencyFilter.value && roundFilter.value.id && snapFilter.value) {
fetchSalalyPeriod(
agencyFilter.value,
roundFilter.value.id,
snapFilter.value
);
}
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -184,7 +192,11 @@ function getAgencyPosition(id: string) {
* @param periodId id รอบการขนเงนเดอน * @param periodId id รอบการขนเงนเดอน
* @param snap id รอบ * @param snap id รอบ
*/ */
function fetchSalalyPeriod(rootId: string, periodId: string, snap: string) { async function fetchSalalyPeriod(
rootId: string,
periodId: string,
snap: string
) {
showLoader(); showLoader();
isLoad.value = false; isLoad.value = false;
const body = { const body = {
@ -193,7 +205,7 @@ function fetchSalalyPeriod(rootId: string, periodId: string, snap: string) {
snapshot: snap, snapshot: snap,
}; };
http await http
.post(config.API.salaryListPeriodLatest, body) .post(config.API.salaryListPeriodLatest, body)
.then(async (res) => { .then(async (res) => {
const data = res.data.result; const data = res.data.result;
@ -219,11 +231,11 @@ async function onChangeRound() {
await getAgency(roundFilter.value.revisionId); await getAgency(roundFilter.value.revisionId);
await getAgencyPosition(roundFilter.value.revisionId); await getAgencyPosition(roundFilter.value.revisionId);
if (agencyFilter.value && roundFilter.value.id && snapFilter.value) { if (agencyFilter.value && roundFilter.value.id && snapFilter.value) {
await fetchSalalyPeriod( // await fetchSalalyPeriod(
agencyFilter.value, // agencyFilter.value,
roundFilter.value.id, // roundFilter.value.id,
snapFilter.value // snapFilter.value
); // );
store.tabType = "PENDING"; store.tabType = "PENDING";
store.roundMainCode = roundFilter.value.shortCode; store.roundMainCode = roundFilter.value.shortCode;
} else { } else {