From bf53fbc7d245f8691cb5d0eccaf19302104efa95 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 10 Oct 2024 17:27:06 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=AD=E0=B8=AD=E0=B8=81=E0=B8=84=E0=B8=B3?= =?UTF-8?q?=E0=B8=AA=E0=B8=B1=E0=B9=88=E0=B8=87=2021?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../04_registryPerson/views/detailView.vue | 1 + .../components/DialogSendOrder.vue | 53 +++++++------------ 2 files changed, 21 insertions(+), 33 deletions(-) diff --git a/src/modules/04_registryPerson/views/detailView.vue b/src/modules/04_registryPerson/views/detailView.vue index 0ff124053..802fb1f6e 100644 --- a/src/modules/04_registryPerson/views/detailView.vue +++ b/src/modules/04_registryPerson/views/detailView.vue @@ -812,6 +812,7 @@ onMounted(async () => { : formDetail.prefix ?? "" }${formDetail.firstName} ${formDetail.lastName}` }} + {{ leaveReason }} diff --git a/src/modules/08_registryEmployee/components/DialogSendOrder.vue b/src/modules/08_registryEmployee/components/DialogSendOrder.vue index 3d48bd16a..7357fd9fd 100644 --- a/src/modules/08_registryEmployee/components/DialogSendOrder.vue +++ b/src/modules/08_registryEmployee/components/DialogSendOrder.vue @@ -13,6 +13,7 @@ import type { DataEmployee } from "@/modules/08_registryEmployee/interface/respo /** importComponents*/ import DialogHeader from "@/components/DialogHeader.vue"; +import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue"; const $q = useQuasar(); const { @@ -164,9 +165,9 @@ const visibleColumns = ref([ "statustext", ]); -/** - * ฟังก์ชันยืนยันการส่งออกคำสั่ง - */ +const modalCommand = ref(false); //สร้างคำสั่ง + +/** ฟังก์ชันยืนยันการส่งออกคำสั่ง*/ function onClickSendOrder() { if (selected.value.length == 0) { dialogMessageNotify($q, "กรุณาเลือกคนออกคำสั่ง"); @@ -174,27 +175,8 @@ function onClickSendOrder() { dialogConfirm( $q, () => { - showLoader(); - let pId: string[] = []; - selected.value.forEach((e: any) => { - pId.push(e.id); - }); - let data = { - id: pId, - }; - http - .post(config.API.orgProfileReport, data) - .then(async () => { - await props?.fetchData?.(); - await success($q, "บันทึกสำเร็จ"); - closeDialog(); - }) - .catch((err) => { - messageError($q, err); - }) - .finally(async () => { - hideLoader(); - }); + modalCommand.value = true; + closeDialog(); }, "ยื่นยันการส่งรายชื่อไปออกคำสั่ง", "ต้องการยืนยันการส่งรายชื่อไปออกคำสั่งนี้หรือไม่ ?" @@ -202,15 +184,17 @@ function onClickSendOrder() { } } -/** - * ฟังก์ชันดึงข้อมูลราชชื่อส่งออกคำสั่ง - */ +/** ฟังก์ชันดึงข้อมูลราชชื่อส่งออกคำสั่ง*/ function fetchList() { + selected.value = []; showLoader(); http .get(config.API.registryNew("-employee") + `/temp`) .then((res) => { - rows.value = res.data.result.data; + rows.value = res.data.result.data.map((e: DataEmployee) => ({ + ...e, + profileId: e.id, + })); }) .catch((err) => { messageError($q, err); @@ -220,17 +204,13 @@ function fetchList() { }); } -/** - * ฟังก์ชันปิด Popup - */ +/** ฟังก์ชันปิด Popup*/ function closeDialog() { modal.value = false; - selected.value = []; } /** * ทำเมื่อ modal เป็น true - * * ทำการเรียก fetchList เพื่อข้อมูลราชชื่อส่งออกคำสั่ง */ watch( @@ -336,6 +316,13 @@ watch( + + +