(statusOptionMain.value);
+/**
+ * function บันทึกรายการคำร้อง
+ */
function onSubmit() {
dialogConfirm($q, () => {
showLoader();
@@ -64,6 +67,9 @@ function onSubmit() {
});
}
+/**
+ * function ปิด popup
+ */
function closeDialog() {
modal.value = false;
formData.status = "";
@@ -77,6 +83,11 @@ function classInput(val: boolean) {
};
}
+/**
+ * function ค้นหาคำใน select สถานะคำร้อง
+ * @param val คำค้น
+ * @param update Function
+ */
function filterOption(val: string, update: Function) {
update(() => {
statusOption.value = statusOptionMain.value.filter(
@@ -85,6 +96,9 @@ function filterOption(val: string, update: Function) {
});
}
+/**
+ * function fetch ข้อมูลคำร้องแก้ไข
+ */
function fetchDataRequest() {
showLoader();
http
diff --git a/src/modules/04_registryPerson/views/detailView.vue b/src/modules/04_registryPerson/views/detailView.vue
index 8d54d559a..f50385435 100644
--- a/src/modules/04_registryPerson/views/detailView.vue
+++ b/src/modules/04_registryPerson/views/detailView.vue
@@ -588,9 +588,9 @@ function selectAvatarHistory() {
http
.get(config.API.orgProfileAvatar + `/select/${profileId.value}/${data.id}`)
.then(async () => {
- closeImage();
await fetchDataPersonal();
await fetchProfile(profileId.value);
+ closeImage();
})
.catch((e) => {
messageError($q, e);
@@ -984,19 +984,6 @@ onMounted(async () => {
:src="n.downloadUrl"
:class="imageClass(n)"
>
-
(store.optionStatus);
const modalStatus = ref(false);
const requestId = ref("");
+/**
+ * function fetch รายการคำร้องขอแก้ไขทะเบียนประวัติ
+ */
function fetchListRequset() {
showLoader();
http
@@ -157,16 +160,28 @@ function fetchListRequset() {
});
}
+/**
+ * function เลือกสถานะคำร้อง
+ */
function updateStatusValue() {
page.value = 1;
+ // fetch รายการคำร้องขอแก้ไขทะเบียนประวัติ
fetchListRequset();
}
+/**
+ * function เคลียร์ สถานะคำร้อง
+ */
function clearStatus() {
status.value = "";
statusOption.value = store.optionStatus;
}
+/**
+ * function ค้นหาคำใน select สถานะคำร้อง
+ * @param val คำค้น
+ * @param update Function
+ */
function filterOption(val: string, update: Function) {
update(() => {
status.value = val ? "" : status.value;
@@ -176,11 +191,19 @@ function filterOption(val: string, update: Function) {
});
}
+/**
+ * funciton แก่ไขคำร้อง
+ * @param id รายการคำร้อง
+ */
function onclickEdit(id: string) {
modalStatus.value = true;
requestId.value = id;
}
+/**
+ * function เลือกแถวต่อหน้า
+ * @param newPagination
+ */
function updatePageSizePagination(newPagination: Pagination) {
page.value = 1;
pageSize.value = newPagination.rowsPerPage;
@@ -200,9 +223,9 @@ function onDownloadFile(id: string) {
id
)
)
- .then((res) => {
+ .then(async (res) => {
if (res.data.length !== 0) {
- downloadUrl(id, res.data[0].fileName);
+ await downloadUrl(id, res.data[0].fileName);
} else {
hideLoader();
}
diff --git a/src/modules/16_positionEmployee/components/DialogFormPosition.vue b/src/modules/16_positionEmployee/components/DialogFormPosition.vue
index 0112925f4..9f61a93c8 100644
--- a/src/modules/16_positionEmployee/components/DialogFormPosition.vue
+++ b/src/modules/16_positionEmployee/components/DialogFormPosition.vue
@@ -223,9 +223,13 @@ function onSubmit() {
? config.API.orgPosMasterEmp
: config.API.orgPosMasterByIdEmp(props.rowId);
await http[props.actionType === "ADD" ? "post" : "put"](url, body);
- success($q, "บันทีกข้อมูลสำเร็จ");
- props.getSummary?.();
- props.fetchDataTable?.(reqMaster.value.id, reqMaster.value.type, false);
+ await props.getSummary?.();
+ await props.fetchDataTable?.(
+ reqMaster.value.id,
+ reqMaster.value.type,
+ false
+ );
+ await success($q, "บันทีกข้อมูลสำเร็จ");
close();
} catch (err) {
messageError($q, err);
@@ -296,9 +300,9 @@ function deletePos(id: string) {
showLoader();
http
.delete(config.API.orgEmployeePosById(id))
- .then(() => {
- success($q, "ลบข้อมูลสำเร็จ");
- searchInput();
+ .then(async () => {
+ await searchInput();
+ await success($q, "ลบข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
@@ -629,11 +633,14 @@ watch(
-
+
-
+
{{
diff --git a/src/modules/16_positionEmployee/components/DialogMovePos.vue b/src/modules/16_positionEmployee/components/DialogMovePos.vue
index f66c63d11..12b58e8fd 100644
--- a/src/modules/16_positionEmployee/components/DialogMovePos.vue
+++ b/src/modules/16_positionEmployee/components/DialogMovePos.vue
@@ -123,10 +123,10 @@ function onClickMovePos() {
showLoader();
await http
.post(config.API.orgPosMoveEmp, body)
- .then(() => {
- props.fetchDataTree?.(store.activeId);
+ .then(async () => {
+ await props.fetchDataTree?.(store.activeId);
+ await success($q, "ย้ายตำแหน่งสำเร็จ");
modal.value = false;
- success($q, "ย้ายตำแหน่งสำเร็จ");
})
.catch((err) => {
messageError($q, err);
diff --git a/src/modules/16_positionEmployee/components/DialogSelectPerson.vue b/src/modules/16_positionEmployee/components/DialogSelectPerson.vue
index cf254922b..76e9525bd 100644
--- a/src/modules/16_positionEmployee/components/DialogSelectPerson.vue
+++ b/src/modules/16_positionEmployee/components/DialogSelectPerson.vue
@@ -4,7 +4,7 @@ import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
-/**
+/**
* importType
*/
import type { QTableProps } from "quasar";
@@ -279,10 +279,10 @@ function onSubmit() {
showLoader();
http
.post(config.API.orgProfileEmp, body)
- .then(() => {
- props.fetchDataTable?.(store.treeId, store.level, false);
- props.getSummary();
- success($q, "บันทึกข้อมูลสำเร็จ");
+ .then(async () => {
+ await props.fetchDataTable?.(store.treeId, store.level, false);
+ await props.getSummary();
+ await success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
diff --git a/src/modules/16_positionEmployee/components/TreeTable.vue b/src/modules/16_positionEmployee/components/TreeTable.vue
index 403a6581d..0820911df 100644
--- a/src/modules/16_positionEmployee/components/TreeTable.vue
+++ b/src/modules/16_positionEmployee/components/TreeTable.vue
@@ -193,10 +193,14 @@ function onClickDelete(id: string) {
showLoader();
await http
.delete(config.API.orgPosMasterByIdEmp(id))
- .then(() => {
+ .then(async () => {
+ await props.fetchDataTable?.(
+ reqMaster.value.id,
+ reqMaster.value.type,
+ false
+ );
+ await getSummary();
success($q, "ลบข้อมูลสำเร็จ");
- props.fetchDataTable?.(reqMaster.value.id, reqMaster.value.type, false);
- getSummary();
})
.catch((err) => {
messageError($q, err);
@@ -262,14 +266,14 @@ function removePerson(id: string) {
showLoader();
await http
.post(config.API.orgDeleteProfileEmp(id))
- .then(() => {
- success($q, "ลบข้อมูลสำเร็จ");
- props.fetchDataTable?.(
+ .then(async () => {
+ await props.fetchDataTable?.(
reqMaster.value.id,
reqMaster.value.type,
false
);
- getSummary();
+ await getSummary();
+ await success($q, "ลบข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
diff --git a/src/modules/17_acting/views/main.vue b/src/modules/17_acting/views/main.vue
index 8e0a822ab..e62bcbfbe 100644
--- a/src/modules/17_acting/views/main.vue
+++ b/src/modules/17_acting/views/main.vue
@@ -67,8 +67,13 @@ function fetchOrganization(id: string) {
});
}
+/**
+ * function เลือกตำแหน่งที่จะให่รักษาการ
+ * @param data ข้อมูลตำแหน่ง
+ */
async function updateSelected(data: PosMaster) {
posmasterId.value = data.posmasterId;
+ // เรียกใช้ function fetch รายชื่อ ,fetch รายชื่อรักษาการ
await Promise.all([fetchPosMaster(), fetchListAct()]);
}
@@ -165,6 +170,10 @@ function fetchPosMaster() {
});
}
+/**
+ * function แสดงตำแหน่งทั้งหมด
+ * @param val แสดงตำแหน่งทั้งหมด
+ */
function updateIsAll(val: boolean) {
isAll.value = val;
fetchPosMaster();
@@ -241,6 +250,7 @@ function onDelete(id: string) {
http
.delete(config.API.orgPosAct + `/${id}`)
.then(async () => {
+ // เรียกใช้ function fetch รายชื่อ ,fetch รายชื่อรักษาการ
await Promise.all([fetchPosMaster(), fetchListAct()]);
})
.catch((err) => {