diff --git a/src/modules/07_insignia/components/1_Proposals/DialogDetail.vue b/src/modules/07_insignia/components/1_Proposals/DialogDetail.vue index 1e044415b..13ac2394c 100644 --- a/src/modules/07_insignia/components/1_Proposals/DialogDetail.vue +++ b/src/modules/07_insignia/components/1_Proposals/DialogDetail.vue @@ -144,8 +144,8 @@ function onSubmit() { httpMethod(url, formData) .then(async () => { await props.fetchList(); - onCloseDialog(); await success($q, "บันทึกข้อมูลสำเร็จ"); + onCloseDialog(); }) .catch((err) => { messageError($q, err); diff --git a/src/modules/07_insignia/components/1_Proposals/listProposals.vue b/src/modules/07_insignia/components/1_Proposals/listProposals.vue index 341215b73..f855e84de 100644 --- a/src/modules/07_insignia/components/1_Proposals/listProposals.vue +++ b/src/modules/07_insignia/components/1_Proposals/listProposals.vue @@ -130,11 +130,6 @@ async function fetchData() { }); } -/** Function redirect หน้าข้อมูลรอบการเสนอข้อ */ -function clickEdit(col: ColId) { - router.push(`/insignia/round/${col.period_id}`); -} - /** * Function ยืนยันการลบรอบการเสนอขอ * @param id รอบการเสนขอ @@ -157,38 +152,33 @@ function clickDelete(id: string) { }); } -/** Fnction เพิ่มรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์ */ -function clickAdd() { - router.push({ name: "roundAdd" }); -} - /** Fnction คำนวณรายชื่อผู้ได้รับเครื่องราช */ -async function clickListInsignia(propsId: string) { - dialogConfirm( - $q, - async () => { - await getRequest(propsId); - }, - "ยืนยันการคำนวณรายชื่อผู้ได้รับเครื่องราชฯ", - "ต้องการยืนยันการคำนวณรายชื่อผู้ได้รับเครื่องราชฯนี้หรือไม่?" - ); -} +// async function clickListInsignia(propsId: string) { +// dialogConfirm( +// $q, +// async () => { +// await getRequest(propsId); +// }, +// "ยืนยันการคำนวณรายชื่อผู้ได้รับเครื่องราชฯ", +// "ต้องการยืนยันการคำนวณรายชื่อผู้ได้รับเครื่องราชฯนี้หรือไม่?" +// ); +// } /** Fnction เรียกจาก API ข้อมูลผู้ได้รับเครื่องราชฯ */ -async function getRequest(id: string) { - showLoader(); - await http - .get(config.API.requestInsignia(id)) - .then(() => { - success($q, "ยืนยันสำเร็จ"); - }) - .catch((err) => { - messageError($q, err); - }) - .finally(async () => { - await fetchData(); - }); -} +// async function getRequest(id: string) { +// showLoader(); +// await http +// .get(config.API.requestInsignia(id)) +// .then(() => { +// success($q, "ยืนยันสำเร็จ"); +// }) +// .catch((err) => { +// messageError($q, err); +// }) +// .finally(async () => { +// await fetchData(); +// }); +// } /** ค้นหาในตาราง */ const filterKeyword = ref(""); 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 ? "ดูข้อมูล" : "แก้ไขข้อมูล" }}