From c700cf0abd629dd1ff68a2e496c97a81ae025fa5 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 16 Apr 2026 13:40:48 +0700 Subject: [PATCH 1/5] feat(placement): add UpdateDraftStatus menu option --- src/api/05_placement/api.placement.ts | 1 + .../components/PersonalList/Table.vue | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/src/api/05_placement/api.placement.ts b/src/api/05_placement/api.placement.ts index a810db909..b6459a850 100644 --- a/src/api/05_placement/api.placement.ts +++ b/src/api/05_placement/api.placement.ts @@ -27,6 +27,7 @@ export default { placementDefermentInfo: (id: string) => `${placement}/pass/deferment/${id}`, placementDisclaimInfo: (id: string) => `${placement}/pass/disclaim/${id}`, placementUpdatePass: `${placement}/pass/update-status`, + placementUpdateDraftStatus: `${placement}/update/draft-status`, //personal placementPersonalId: (personalId: string) => diff --git a/src/modules/05_placement/components/PersonalList/Table.vue b/src/modules/05_placement/components/PersonalList/Table.vue index a88cb44a3..bdf4ae494 100644 --- a/src/modules/05_placement/components/PersonalList/Table.vue +++ b/src/modules/05_placement/components/PersonalList/Table.vue @@ -967,6 +967,28 @@ function onUpdateStatus(id: string) { ); } +function onUpdateDraftStatus(id: string) { + dialogConfirm( + $q, + async () => { + showLoader(); + try { + await http.post(config.API.placementUpdateDraftStatus, { + personalId: id, + }); + await success($q, "บันทึกสำเร็จ"); + await getTable(); + } catch (error) { + messageError($q, error); + } finally { + hideLoader(); + } + }, + "ยืนยันการยกเลิกการส่งตัว", + "ต้องการยกเลิกการส่งตัวรายชื่อนี้ใช่หรือไม่ ?" + ); +} + onMounted(async () => { await getWorkFlow(); await getTable(); @@ -1029,6 +1051,30 @@ onMounted(async () => { รายละเอียด + + + + + ยกเลิกการส่งตัว + Date: Thu, 16 Apr 2026 16:14:33 +0700 Subject: [PATCH 2/5] refactor(retire-old): standardize API response by renaming data to result --- src/modules/06_retirement/views/09_retirementOld.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/06_retirement/views/09_retirementOld.vue b/src/modules/06_retirement/views/09_retirementOld.vue index 0520a3c35..64c05c218 100644 --- a/src/modules/06_retirement/views/09_retirementOld.vue +++ b/src/modules/06_retirement/views/09_retirementOld.vue @@ -151,7 +151,7 @@ async function fetchDataRetirement() { firstNameTH: filter.value.firstNameTH.trim(), lastNameTH: filter.value.lastNameTH.trim(), }); - const data: RetirementOld = response.data.data; + const data: RetirementOld = response.data.result; pagination.value.rowsNumber = data.totalRecords; rows.value = data.dataRecords; } catch (error) { From 73335d7dd50dffc69d289e468c96ff926231b384 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Thu, 16 Apr 2026 20:55:51 +0700 Subject: [PATCH 3/5] add permission owner --- src/modules/05_placement/components/PersonalList/Table.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/05_placement/components/PersonalList/Table.vue b/src/modules/05_placement/components/PersonalList/Table.vue index bdf4ae494..557139d8b 100644 --- a/src/modules/05_placement/components/PersonalList/Table.vue +++ b/src/modules/05_placement/components/PersonalList/Table.vue @@ -1056,7 +1056,7 @@ onMounted(async () => { checkPermission($route)?.attrIsUpdate && props.row.isDraft && props.row.statusId === 'PREPARE-CONTAIN' && - DataStore.isOfficer + (DataStore.isOfficer || checkPermission($route)?.attrOwnership == 'OWNER') " clickable v-close-popup From 8a0a6ea873b56f01f50d0945c47547fd29d5456b Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 17 Apr 2026 14:59:22 +0700 Subject: [PATCH 4/5] fix(command): validate if isIdofficer isBangkok fields to show warnings --- .../18_command/components/Step/1_Detail.vue | 20 ++++--------------- .../18_command/components/Step/View0_Live.vue | 13 +++++++----- src/modules/18_command/store/DetailStore.ts | 6 ++++-- src/modules/18_command/views/detail.vue | 13 ++++++++++++ 4 files changed, 29 insertions(+), 23 deletions(-) diff --git a/src/modules/18_command/components/Step/1_Detail.vue b/src/modules/18_command/components/Step/1_Detail.vue index ff3f564a6..2a3f3b60f 100644 --- a/src/modules/18_command/components/Step/1_Detail.vue +++ b/src/modules/18_command/components/Step/1_Detail.vue @@ -61,7 +61,6 @@ let formData = reactive({ }); const commandVolume = ref(""); //เล่มที่ const commandChapter = ref(""); //ตอนที่ -const isIdofficer = ref(false); //เช็ค สกจ. const rows = ref>([]); const columns = ref([ @@ -114,17 +113,7 @@ const visibleColumns = ref>([ const modalAddOperator = ref(false); // แสดงเพิ่มรายชื่อลงนามในแนบท้ายคำสั่ง -/** ฟังก์ชันเช็ค สกจ.*/ -async function fetchCheckIdofficer() { - await http - .get(config.API.checkIdofficer) - .then((res) => { - isIdofficer.value = res.data.result; - }) - .catch((err) => { - messageError($q, err); - }); -} + /** * ฟังก์ชันบันทึกข้อมูลรายละเอียดคำสั่ง @@ -133,7 +122,7 @@ async function fetchCheckIdofficer() { async function onSubmit() { //ถ้าเป็น สกจ. ต้องเลือกประเภทคำสั่งด้วย if ( - isIdofficer.value && + store.isIdofficer && formData.isBangkok !== "BANGKOK" && formData.isBangkok !== "OFFICE" ) { @@ -225,7 +214,6 @@ function onDeleteData(id: string) { onMounted(async () => { try { showLoader(); - await fetchCheckIdofficer(); await fetchDataOperatorList(); formData.commandNo = props.formCommandList.commandNo; formData.commandYear = props.formCommandList.commandYear; @@ -235,7 +223,7 @@ onMounted(async () => { formData.issue = props.formCommandList.issue; formData.commandAffectDate = props.formCommandList.commandAffectDate; formData.commandExcecuteDate = props.formCommandList.commandExcecuteDate; - formData.isBangkok = !isIdofficer.value + formData.isBangkok = !store.isIdofficer ? null : props.formCommandList.isBangkok; commandCode.value = props.formCommandList.commandCode; @@ -500,7 +488,7 @@ onMounted(async () => {
{ const readonly = ref(false); const dataCommand = ref(); const status = ref(""); - const isSalary = ref(false) + const isSalary = ref(false); + const isIdofficer = ref(false); function checkStep(val: string) { status.value = val; switch (val) { @@ -39,6 +40,7 @@ export const useCommandDetail = defineStore("commandDetailStore", () => { readonly, status, dataCommand, - isSalary + isSalary, + isIdofficer, }; }); diff --git a/src/modules/18_command/views/detail.vue b/src/modules/18_command/views/detail.vue index 37ab3326f..5e41124dc 100644 --- a/src/modules/18_command/views/detail.vue +++ b/src/modules/18_command/views/detail.vue @@ -92,12 +92,25 @@ async function fetchDataCommandList() { }); } +/** ฟังก์ชันเช็ค สกจ.*/ +async function fetchCheckIdofficer() { + await http + .get(config.API.checkIdofficer) + .then((res) => { + store.isIdofficer = res.data.result; + }) + .catch((err) => { + messageError($q, err); + }); +} + /** * ทำงานเมื่อ Components ถูกเรียกใช้งาน * กำหนดค่า `store.readonly` เมื่อ route.name เป็น "commandViewDetailPage" จะอ่านข้อมูลได้อย่างเดียว */ onMounted(async () => { await fetchDataCommandList(); + await fetchCheckIdofficer(); store.readonly = route.name === "commandViewDetailPage" || formCommandList.status === "REPORTED" || From d6e75d6966a4d376d4978256d70a7004c16b81a0 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 17 Apr 2026 15:29:11 +0700 Subject: [PATCH 5/5] refactor(command): dialogMessageNotify messageWarning --- src/modules/18_command/components/Step/View0_Live.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/18_command/components/Step/View0_Live.vue b/src/modules/18_command/components/Step/View0_Live.vue index a66025639..263445a25 100644 --- a/src/modules/18_command/components/Step/View0_Live.vue +++ b/src/modules/18_command/components/Step/View0_Live.vue @@ -321,7 +321,7 @@ function onConfirmOrder() { } else { const messageWarning = !store.isIdofficer ? "ไม่สามารถดำเนินการต่อได้ กรุณากรอกเลขที่คำสั่ง วันที่ลงนาม และวันที่คำสั่งมีผลให้ครบ" - : "ไม่สามารถดำเนินการต่อได้ กรุณากรอกเลขที่คำสั่ง วันที่ลงนาม วันที่คำสั่งมีผล และเลือกประเภทคำสั่งให้ครบ"; + : "ไม่สามารถดำเนินการต่อได้ กรุณากรอกเลขที่คำสั่ง วันที่ลงนาม วันที่คำสั่งมีผล และเลือกคำสั่งให้ครบ"; dialogMessageNotify($q, messageWarning); } }