ทะเบียนประวัติ ==> ข้อมูลตำแหน่ง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-02-28 10:05:39 +07:00
parent f9bdb3a523
commit d010529aaf

View file

@ -307,7 +307,6 @@ const cardData = ref<any[]>([
/** function fetch รายการ ตำแหน่งเงินเดือน*/ /** function fetch รายการ ตำแหน่งเงินเดือน*/
async function fetchListSalary() { async function fetchListSalary() {
showLoader();
await http await http
.get( .get(
config.API.profileListSalaryPositionNew(profileId.value, empType.value) config.API.profileListSalaryPositionNew(profileId.value, empType.value)
@ -318,9 +317,6 @@ async function fetchListSalary() {
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
})
.finally(() => {
hideLoader();
}); });
} }
@ -553,13 +549,13 @@ function onSubmit() {
: config.API.profileSalaryPositionNew(empType.value); : config.API.profileSalaryPositionNew(empType.value);
const method = isStatusEdit.value ? "patch" : "post"; const method = isStatusEdit.value ? "patch" : "post";
await http[method](url, formData); await http[method](url, formData);
await onClickCloseDialog();
await fetchListSalary(); await fetchListSalary();
await onClickCloseDialog();
success($q, "บันทึกข้อมูลสำเร็จ"); success($q, "บันทึกข้อมูลสำเร็จ");
} catch (e) { } catch (e) {
messageError($q, e); messageError($q, e);
hideLoader();
} finally { } finally {
hideLoader();
} }
}); });
} }
@ -753,9 +749,16 @@ async function fetchDataTenure() {
} }
/** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ /** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/
onMounted(() => { onMounted(async () => {
fetchListSalary(); try {
empType.value === "" && fetchDataTenure(); showLoader();
await Promise.all([
fetchListSalary(),
empType.value === "" ? fetchDataTenure() : Promise.resolve(),
]);
} finally {
hideLoader();
}
}); });
</script> </script>