From 155a3b206dd1b86c00b9be3bc4fcaa866db67743 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 14 Sep 2023 10:47:09 +0700 Subject: [PATCH] =?UTF-8?q?popup=20=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84?= =?UTF-8?q?=E0=B8=82=20=E0=B8=A1=E0=B8=95=E0=B8=B4=E0=B8=AD=E0=B8=81?= =?UTF-8?q?=E0=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/06_retirement/api.retirement.ts | 8 ++- src/components/Dialogs/PopupReason.vue | 38 +++++++++--- .../components/ListRetirement/TableList.vue | 61 ++++++++++++++++++- 3 files changed, 93 insertions(+), 14 deletions(-) diff --git a/src/api/06_retirement/api.retirement.ts b/src/api/06_retirement/api.retirement.ts index 6646d70a7..7f849e1b0 100644 --- a/src/api/06_retirement/api.retirement.ts +++ b/src/api/06_retirement/api.retirement.ts @@ -32,7 +32,7 @@ export default { listExitInterview: () => `${retirement}/resign/questionnaire`, ExitInterviewByid: (id: string) => `${retirement}/resign/questionnaire/${id}`, ExitInterviewReport: `${retirement}/resign/questionnaire/report`, - AppointInterview:(id: string) =>`${retirement}/resign/questionnaire/appoint/${id}`, + AppointInterview: (id: string) => `${retirement}/resign/questionnaire/appoint/${id}`, // ปลดออก retirementDischarge, listDischarge: () => `${retirement}/discharge`, @@ -52,5 +52,9 @@ export default { outReport: `${retirement}/out/report`, fileRetirement: (id: string) => `${retirement}/upload/${id}`, - checkfileupload: (id: string) => `${retirement}/upload/check/${id}` + checkfileupload: (id: string) => `${retirement}/upload/check/${id}`, + + editDetail: (retireId: string) => `${retirement}/detail/${retireId}` + + }; diff --git a/src/components/Dialogs/PopupReason.vue b/src/components/Dialogs/PopupReason.vue index 2b97f8e21..9440ee1ea 100644 --- a/src/components/Dialogs/PopupReason.vue +++ b/src/components/Dialogs/PopupReason.vue @@ -2,7 +2,7 @@ import { ref, watch } from "vue"; import DialogHeader from "@/components/DialogHeader.vue"; -const reason = ref(""); +const reason = ref(""); const props = defineProps({ modal: { type: Boolean, @@ -18,16 +18,21 @@ const props = defineProps({ }, clickClose: { type: Function, - default: () => { }, + default: () => {}, }, savaForm: { type: Function, - default: () => { }, + default: () => {}, + }, + textReport: { + type: String, }, }); watch(props, () => { - if (props.modal === true) { + if (props.modal === true && props.textReport == "") { reason.value = ""; + } else { + reason.value = props.textReport; } }); @@ -51,18 +56,31 @@ const submit = () => {
- - - - +
- + บันทึก diff --git a/src/modules/06_retirement/components/ListRetirement/TableList.vue b/src/modules/06_retirement/components/ListRetirement/TableList.vue index 7ecc3666f..7e65d5197 100644 --- a/src/modules/06_retirement/components/ListRetirement/TableList.vue +++ b/src/modules/06_retirement/components/ListRetirement/TableList.vue @@ -8,12 +8,13 @@ import { useRouter } from "vue-router"; import http from "@/plugins/http"; import config from "@/app.config"; import DialogHeader from "@/components/DialogHeader.vue"; +import DialogPopupReason from "@/components/Dialogs/PopupReason.vue"; const route = useRoute(); const router = useRouter(); const $q = useQuasar(); const mixin = useCounterMixin(); -const { showLoader, hideLoader, messageError, success } = mixin; +const { showLoader, hideLoader, messageError, success, dialogConfirm } = mixin; // const type_params = route.params.type; // const year_params = route.params.year; const retireld_params = route.params.retirementId; @@ -26,6 +27,8 @@ const retireld = ref(retireld_params.toString()); const profileId = ref(""); const filter = ref(""); const statusUpload = ref(); +const modalEdit = ref(false); +const textReport = ref(""); const columns = ref([ { @@ -177,6 +180,7 @@ const fecthlistprofile = async (id: string) => { round.value = res.data.result.round; statusReport.value = res.data.result.json; typeReport.value = res.data.result.typeReport; + textReport.value = res.data.result.detail; rows.value = res.data.result.profile.map((e: any) => ({ id: e.id, profileId: e.profileId, @@ -312,6 +316,7 @@ const uploadFile = async (event: any) => { console.log(selectedFile); const formdata = new FormData(); formdata.append("file", selectedFile); + await http .put(config.API.fileRetirement(retireld.value.toString()), formdata) .then((res) => { @@ -381,6 +386,36 @@ const downloadFile = (response: any, filename: string) => { // return "color: #26a69a;"; // } else return ""; // }; +const saveEdiitReport = (reason: string) => { + const formdata = new FormData(); + formdata.append("Detail", reason); + dialogConfirm( + $q, + async () => { + await http + .put(config.API.editDetail(retireld.value), formdata) + .then(() => { + success($q, "แก้ไขข้อความสำเร็จ"); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + fecthlistprofile(retireld.value); + closemodalEditReport(); + }); + }, + "ยืนยันการแก้ไขข้อมูล", + "ต้องการยืนยันการแก้ไขข้อมูลนี้หรือไม่ ?" + ); +}; +const openmodalEditReport = () => { + modalEdit.value = true; +}; +const closemodalEditReport = () => { + modalEdit.value = false; +}; + const paging = ref(true); const pagination = ref({ sortBy: "order", @@ -427,9 +462,22 @@ const paginationLabel = (start: number, end: number, total: number) => { - + + + + แก้ไข มติ อ.ก.ก. + + { + +