diff --git a/src/modules/05_placement/components/PersonalList/OrgTree.vue b/src/modules/05_placement/components/PersonalList/OrgTree.vue index 58c139186..046ca478a 100644 --- a/src/modules/05_placement/components/PersonalList/OrgTree.vue +++ b/src/modules/05_placement/components/PersonalList/OrgTree.vue @@ -26,6 +26,8 @@ const myFormPosition = ref(); const selected = ref(""); const selectedFile = ref(""); const dataRespone = ref(); +const search = ref(""); +const filterRef = ref(null); // Set form field let dataForm = reactive({ @@ -105,14 +107,6 @@ const fetchplacementPosition = async () => { }); }; -const search = ref(""); -//reset Tree Filter -const filterRef = ref(null); -// const resetFilter = () => { -// search.value = ""; -// filterRef.value.focus(); -// }; - const props = defineProps({ personalId: String, modal: Boolean, @@ -122,10 +116,9 @@ const props = defineProps({ }, personal: Object, }); - +// filter หน่วยงาน const myFilterMethod = (node: any, filter: string) => { const filt = filter; - return ( // ((node.name && node.name == null) || !node.name) && (node.name && node.name.indexOf(filt) > -1) || @@ -156,7 +149,7 @@ const validateData = async () => { } }); }; - +// ยืนยันการเลือกหน่วยงาน const saveAppoint = async () => { myFormPosition.value.validate().then(async (result: boolean) => { if (result) { @@ -170,31 +163,29 @@ const saveAppoint = async () => { positionPathSideId: dataForm.positionPathSideId, positionTypeId: dataForm.positionTypeId, }; - - showLoader(); - await http - .post(config.API.placementPass(), dataAppoint) - .then(() => { - success($q, "บันทึกสำเร็จ"); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(async () => { - await closeAndClear(); - await fetchPublishFile(); - await loadTreeData(); - await fetchplacementPosition(); - hideLoader(); - }); + dialogConfirm($q, async () => { + showLoader(); + await http + .post(config.API.placementPass(), dataAppoint) + .then(() => { + success($q, "บันทึกสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(async () => { + await closeAndClear(); + await fetchPublishFile(); + await loadTreeData(); + await fetchplacementPosition(); + hideLoader(); + }); + }); } }); }; const editDataStatus = ref(false); -const clickEditRow = () => { - editDataStatus.value = true; -}; const closeModal = () => { if (editDataStatus.value == true) { @@ -221,7 +212,6 @@ const closeAndClear = async () => { dataForm.positionLineId = ""; dataForm.positionPathSideId = ""; dataForm.positionTypeId = ""; - editDataStatus.value = false; }; // ตำแหน่งเลขที่ const posNoOptions = ref([ @@ -265,7 +255,7 @@ const positionLevelOptions = ref([ value: "", }, ]); - +// เลือกหน่วยงาน const selectedPosition = async (data: any) => { if (data.name == null && selected.value != data.keyId) { editDataStatus.value = true; @@ -366,7 +356,6 @@ watch(props, () => { personal.value = data; }); } - if ( personal.value && personal.value.draft === false && @@ -385,7 +374,7 @@ watch(props, () => { }); } }); - +// หาตำหน่วยงานที่เลือก function findByPerson(element: any): any { if ( element.positionNumId && @@ -406,6 +395,7 @@ function findByPerson(element: any): any { } return null; } +// ยืนยันการคืนตำแหน่ง const clearPosition = () => { dialogConfirm( $q, @@ -414,6 +404,7 @@ const clearPosition = () => { "ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?" ); }; +// คืนตำแหน่ง const postClearPosition = async () => { showLoader(); await http @@ -421,7 +412,6 @@ const postClearPosition = async () => { .then(() => { success($q, "คืนตำแหน่งสำเร็จ"); }) - .catch((e: Object) => { messageError($q, e); }) diff --git a/src/modules/05_placement/components/PersonalList/Table.vue b/src/modules/05_placement/components/PersonalList/Table.vue index 5266a9f61..67d653169 100644 --- a/src/modules/05_placement/components/PersonalList/Table.vue +++ b/src/modules/05_placement/components/PersonalList/Table.vue @@ -172,7 +172,7 @@ const columns = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, ]); - +// แปลงสถานะพนักงาน const convertBmaOfficer = (val: string) => { switch (val) { case "OFFICER": @@ -185,6 +185,7 @@ const convertBmaOfficer = (val: string) => { return "บุคคลภายนอก"; } }; +// แปลงสถานะบรรจุ const convertContainStatus = (val: string) => { switch (val) { case "UN-CONTAIN": @@ -199,6 +200,7 @@ const convertContainStatus = (val: string) => { return "-"; } }; +// แปลงสถานะการส่งรายชื่อ const convertDraft = (val: boolean) => { switch (val) { case false: @@ -209,7 +211,7 @@ const convertDraft = (val: boolean) => { return "-"; } }; - +// เรียกข้อมูลรายชื่อผู้สอบผ่าย const getTable = async () => { showLoader(); await http @@ -253,10 +255,11 @@ const getTable = async () => { rowsAll.value.push(rowData); }); + // ราชชื่อทั้งหมด rows.value = roleAdmin ? rowsAll.value : rowsAll.value.filter((x: any) => x.statusId != "CONTAIN"); - + // รายชื่อไปยังหน่วยงาน rowsFilter.value = rows.value.filter( (e: any) => e.draft == "รอส่งตัว" && @@ -273,6 +276,7 @@ const getTable = async () => { }; const appointModal = ref(false); +// ยืนยันการผ่อนผัน const saveDeferment = async () => { myForm.value.validate().then(async (result: boolean) => { if (result) { @@ -285,6 +289,7 @@ const saveDeferment = async () => { } }); }; +// post ผ่อนผัน const postDeferment = async () => { const formData = new FormData(); formData.append("personalId", personalId.value); @@ -307,7 +312,7 @@ const postDeferment = async () => { hideLoader(); }); }; - +// ยืนยันการสละสิทธิ์ const saveDisclaim = async () => { myForm.value.validate().then(async (result: boolean) => { if (result) { @@ -320,6 +325,7 @@ const saveDisclaim = async () => { } }); }; +// post การสละสิทธิ์ const postDisclaimf = async () => { const dataPost = { note: userNote.value, @@ -446,7 +452,6 @@ const clickCloseSendModal = () => { const clickClose = async () => { userNote.value = ""; - if (editRow.value == true) { dialogConfirm( $q, @@ -501,6 +506,7 @@ const selected = ref([]); const personal_selected = ref([]); const filterlistAdd = ref(""); const paging = ref(true); +// ยืนยันส่งราชชื่อไปหน่วยงาน const savelist = () => { selected.value.map((e: any) => { personal_selected.value.push(e.personalId); @@ -528,16 +534,17 @@ const savelist = () => { ); } }; +// เปิด popup ส่งรายชื่อไปยังหน่วยงาน const handleModalAddListUpdate = (val: boolean) => { modaladdlist.value = val; (selected.value = []), (personal_selected.value = []); }; +// เช็ตสถานะการเลือกคนไปยังหน่วยงาน const checkSelected = computed(() => { if (selected.value.length === 0) { return true; } }); - const paginationLabel = (start: number, end: number, total: number) => { if (paging.value == true) return " " + start + "-" + end + " ใน " + total; else return start + "-" + end + " ใน " + total; @@ -821,7 +828,7 @@ const pagination = ref({ :validate="validateData" /> - + diff --git a/src/modules/05_placement/components/PersonalList/TableDetail.vue b/src/modules/05_placement/components/PersonalList/TableDetail.vue index 55057aa91..4b162ff79 100644 --- a/src/modules/05_placement/components/PersonalList/TableDetail.vue +++ b/src/modules/05_placement/components/PersonalList/TableDetail.vue @@ -2,7 +2,6 @@ import { ref, watch } from "vue"; import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogHeader.vue"; import { useQuasar } from "quasar"; -import DialogFooter from "@/modules/05_placement/components/PersonalList/DialogFooter.vue"; import type { QTableProps } from "quasar"; import { useCounterMixin } from "@/stores/mixin"; import http from "@/plugins/http"; diff --git a/src/modules/05_placement/components/PersonalList/TableView.vue b/src/modules/05_placement/components/PersonalList/TableView.vue index 005cbcbc9..8eef688fe 100644 --- a/src/modules/05_placement/components/PersonalList/TableView.vue +++ b/src/modules/05_placement/components/PersonalList/TableView.vue @@ -1,6 +1,6 @@