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