diff --git a/src/modules/13_salary/components/InfoDiscipline.vue b/src/modules/13_salary/components/InfoDiscipline.vue index 867ee7cf3..1abf65e2e 100644 --- a/src/modules/13_salary/components/InfoDiscipline.vue +++ b/src/modules/13_salary/components/InfoDiscipline.vue @@ -178,7 +178,7 @@ onMounted(() => { + + + + + + + + (""); -const isReadonly = ref(false); // อ่านได้อย่างเดียว const isActive = ref(false); const effectiveDate = ref(null); const typeOptions = ref([ @@ -81,10 +80,10 @@ function onSubmit() { ? config.API.salaryPeriod() : config.API.salaryPeriod() + `/${props.idRound}`; await http[!props.edit ? "post" : "put"](url, body); + await props.getData?.(); + await success($q, "บันทีกข้อมูลสำเร็จ"); modal.value = false; - props.getData?.(); clearForm(); - success($q, "บันทีกข้อมูลสำเร็จ"); } catch (err) { messageError($q, err); } finally { diff --git a/src/modules/13_salary/views/salaryLists.vue b/src/modules/13_salary/views/salaryLists.vue index bafc1e27b..6f9d79e48 100644 --- a/src/modules/13_salary/views/salaryLists.vue +++ b/src/modules/13_salary/views/salaryLists.vue @@ -145,9 +145,9 @@ function getSnap(code: string) { * function เรียกข้อมูลหน่ยวงาน * @param id revisionId */ -async function getAgency(id: string) { +function getAgency(id: string) { if (id) { - await http + http .get(config.API.activeOrganizationRootById(id)) .then(async (res) => { const data = res.data.result; @@ -179,9 +179,9 @@ async function getAgency(id: string) { * function เรียกข้อมูลหน่ยวงานปจุบัน * @param id revisionId */ -async function getAgencyPosition(id: string) { +function getAgencyPosition(id: string) { if (id) { - await http + http .get(config.API.keycloakPositionByid(id)) .then(async (res) => { const data = await res.data.result; diff --git a/src/modules/13_salary/views/salaryRound.vue b/src/modules/13_salary/views/salaryRound.vue index bcba2d192..4da92db65 100644 --- a/src/modules/13_salary/views/salaryRound.vue +++ b/src/modules/13_salary/views/salaryRound.vue @@ -124,7 +124,9 @@ function clickAdd() { editCheck.value = false; } -/** ดึงข้อมูลเริ่มต้น */ +/** + * fetch รายการรอบการขึ้นเงินเดือน + */ function getData() { showLoader(); http @@ -165,9 +167,9 @@ function deleteData(id: string) { showLoader(); http .delete(config.API.salaryPeriod() + `/${id}`) - .then(() => { - getData(); - success($q, "ลบข้อมูลสำเร็จ"); + .then(async () => { + await getData(); + await success($q, "ลบข้อมูลสำเร็จ"); }) .catch((e) => { messageError($q, e); @@ -204,15 +206,19 @@ function dialogClose(id: string) { dialogConfirm( $q, () => { + showLoader(); http .get(config.API.salaryPeriod() + `/close/${id}`) - .then((res) => { + .then(() => { getData(); + success($q, "ลบข้อมูลสำเร็จ"); }) .catch((e) => { messageError($q, e); }) - .finally(() => {}); + .finally(() => { + hideLoader(); + }); }, "ยืนยันการปิดรอบ", "หากปิดรอบแล้วจะไม่สามารถแก้ไขรายการเงินเดือนของรอบนี้ได้ ต้องการยืนยันการปิดรอบนี้ใช่หรือไม่?" @@ -406,14 +412,16 @@ onMounted(async () => { color="edit" size="17px" :name=" - props.row.revisionId !== null || !checkPermission($route)?.attrIsUpdate + props.row.revisionId !== null || + !checkPermission($route)?.attrIsUpdate ? 'mdi-eye-outline' : 'edit' " />
{{ - props.row.revisionId !== null || !checkPermission($route)?.attrIsUpdate + props.row.revisionId !== null || + !checkPermission($route)?.attrIsUpdate ? "ดูข้อมูล" : "แก้ไขข้อมูล" }}