From 1881aa1b2f19542d508afa6010c753bd33a75607 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 17 Aug 2023 11:40:46 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20dialog?= =?UTF-8?q?=20=E0=B8=9A=E0=B8=A3=E0=B8=A3=E0=B8=88=E0=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/PersonalDetail/Education.vue | 79 +- .../components/PersonalList/OrgTree.vue | 106 +- .../components/PersonalList/Table.vue | 198 ++-- .../components/Receive/FormAdd.vue | 18 +- .../components/Receive/receiveDetail2.vue | 11 +- .../components/Receive/receiveMain.vue | 15 +- .../components/Receive/receiveModal.vue | 28 +- .../components/Relocation/RelocationMain.vue | 45 +- .../components/Relocation/RelocationModal.vue | 29 +- .../components/Relocation/RelocationbyId.vue | 93 +- .../components/Repatriate/RepatriateMain.vue | 120 ++- .../components/Repatriate/RepatriatebyId.vue | 955 +++++++++--------- .../components/RepatriationOrder/List.vue | 17 +- .../components/Transfer/transferRegistry.vue | 21 +- .../helpgovernment/governmentDetail.vue | 18 +- .../components/helpgovernment/mainHelp.vue | 123 ++- .../probation/FormEvaluation/FormEvaluate.vue | 36 +- .../FormEvaluation/FormEvaluateAdd.vue | 61 +- .../FormEvaluation/FormEvaluateScore.vue | 66 +- .../FormEvaluation/FormEvaluateScoreAdd.vue | 39 +- .../probation/FormEvaluation/FormReport.vue | 16 +- .../FormEvaluation/FormSaveResult.vue | 17 +- .../FormEvaluation/FormSaveResultAdd.vue | 25 +- 23 files changed, 1064 insertions(+), 1072 deletions(-) diff --git a/src/modules/05_placement/components/PersonalDetail/Education.vue b/src/modules/05_placement/components/PersonalDetail/Education.vue index 63d80dd03..3da674bad 100644 --- a/src/modules/05_placement/components/PersonalDetail/Education.vue +++ b/src/modules/05_placement/components/PersonalDetail/Education.vue @@ -44,8 +44,16 @@ const $q = useQuasar(); const store = useProfileDataStore(); const { profileData, changeProfileColumns } = store; const mixin = useCounterMixin(); -const { success, dateToISO, date2Thai, messageError, showLoader, hideLoader } = - mixin; +const { + success, + dateToISO, + date2Thai, + messageError, + showLoader, + hideLoader, + dialogRemove, + dialogConfirm, +} = mixin; const route = useRoute(); const id = ref(""); const levelId = ref(); @@ -549,30 +557,20 @@ const editData = async () => { * ลบลบข้อมูล */ const clickDelete = async () => { - $q.dialog({ - title: `ลบข้อมูล`, - message: `ต้องการทำการลบข้อมูลนี้ใช่หรือไม่?`, - cancel: "ยกเลิก", - ok: "ยืนยัน", - persistent: true, - }) - .onOk(async () => { - showLoader(); - await http - .delete(config.API.placementEducationId(id.value)) - .then((res) => { - success($q, "ลบข้อมูลสำเร็จ"); - modal.value = false; - }) - .catch((e) => { - messageError($q, e); - }) - .finally(async () => { - await props.fetch(); - rows.value = props.data; - }); + dialogRemove($q, async () => await deletePlacementEducation()); +}; +const deletePlacementEducation = async () => { + showLoader(); + await http + .delete(config.API.placementEducationId(id.value)) + .then((res) => { + success($q, "ลบข้อมูลสำเร็จ"); + modal.value = false; }) - .onCancel(async () => { + .catch((e) => { + messageError($q, e); + }) + .finally(async () => { await props.fetch(); rows.value = props.data; }); @@ -666,17 +664,26 @@ const addData = () => { */ const clickCancel = async () => { if (editRow.value == true) { - $q.dialog({ - title: `ข้อมูลมีการแก้ไข`, - message: `ยืนยันยกเลิกการแก้ไขใช่หรือไม่?`, - cancel: "ยกเลิก", - ok: "ยืนยัน", - persistent: true, - }).onOk(async () => { - edit.value = false; - await checkRowPage(); - await getData(); - }); + dialogConfirm( + $q, + async () => { + await checkRowPage(); + await getData(); + }, + `ข้อมูลมีการแก้ไข`, + `ยืนยันยกเลิกการแก้ไขใช่หรือไม่?` + ); + // $q.dialog({ + // title: `ข้อมูลมีการแก้ไข`, + // message: `ยืนยันยกเลิกการแก้ไขใช่หรือไม่?`, + // cancel: "ยกเลิก", + // ok: "ยืนยัน", + // persistent: true, + // }).onOk(async () => { + // edit.value = false; + // await checkRowPage(); + // await getData(); + // }); } else { edit.value = false; await checkRowPage(); diff --git a/src/modules/05_placement/components/PersonalList/OrgTree.vue b/src/modules/05_placement/components/PersonalList/OrgTree.vue index 2197e30a8..5b7769e4e 100644 --- a/src/modules/05_placement/components/PersonalList/OrgTree.vue +++ b/src/modules/05_placement/components/PersonalList/OrgTree.vue @@ -9,7 +9,14 @@ import config from "@/app.config"; const $q = useQuasar(); const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง -const { date2Thai, hideLoader, messageError, showLoader, success } = mixin; //ฟังก์ชันกลางที่เรียกใช้ +const { + date2Thai, + hideLoader, + messageError, + showLoader, + success, + dialogConfirm, +} = mixin; //ฟังก์ชันกลางที่เรียกใช้ const notFound = ref("ไม่พบข้อมูลที่ค้นหา"); const noData = ref("ไม่พบข้อมูลผังโครงสร้าง"); @@ -204,16 +211,21 @@ const clickEditRow = () => { const closeModal = () => { if (editDataStatus.value == true) { - $q.dialog({ - title: `ข้อมูลมีการแก้ไข`, - message: `ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?`, - cancel: "ยกเลิก", - ok: "ยืนยัน", - persistent: true, - }).onOk(() => { - editDataStatus.value = false; - closeAndClear(); - }); + dialogConfirm( + $q, + () => closeAndClear(), + "ข้อมูลมีการแก้ไข", + "ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่" + ); + // $q.dialog({ + // title: `ข้อมูลมีการแก้ไข`, + // message: `ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?`, + // cancel: "ยกเลิก", + // ok: "ยืนยัน", + // persistent: true, + // }).onOk(() => { + // closeAndClear(); + // }); } else { closeAndClear(); } @@ -234,6 +246,7 @@ const closeAndClear = async () => { // dataForm.salaryAmount = null; // dataForm.mouthSalaryAmount = null; // dataForm.positionSalaryAmount = null; + editDataStatus.value = false; }; // ตำแหน่งเลขที่ const posNoOptions = ref([ @@ -431,32 +444,53 @@ function findByPerson(element: any): any { return null; } const clearPosition = () => { - console.log(personal.value); - $q.dialog({ - title: "ยืนยันการคืนตำแหน่ง", - message: "ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?", - cancel: { - flat: true, - const: "negative", - }, - persistent: true, - }) - .onOk(async () => { - showLoader(); - await http - .post(config.API.clearPosition(personal.value.personalId), {}) - .then((res: Object) => success($q, "คืนตำแหน่งสำเร็จ")) - - .catch((e: Object) => { - console.log(e); - }) - .finally(async () => { - hideLoader(); - await closeAndClear(); - }); + // console.log(personal.value); + dialogConfirm( + $q, + async () => postClearPosition(), + "ยืนยันการคืนตำแหน่ง", + "ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?" + ); + // $q.dialog({ + // title: "ยืนยันการคืนตำแหน่ง", + // message: "ต้องการยืนยันการคืนตำแหน่งนี้ใช่หรือไม่ ?", + // cancel: { + // flat: true, + // const: "negative", + // }, + // persistent: true, + // }) + // .onOk(async () => { + // showLoader(); + // await http + // .post(config.API.clearPosition(personal.value.personalId), {}) + // .then((res: Object) => success($q, "คืนตำแหน่งสำเร็จ")) + // .catch((e: Object) => { + // console.log(e); + // }) + // .finally(async () => { + // hideLoader(); + // await closeAndClear(); + // }); + // }) + // .onCancel(() => {}) + // .onDismiss(() => {}); +}; +const postClearPosition = async () => { + showLoader(); + await http + .post(config.API.clearPosition(personal.value.personalId), {}) + .then(() => { + success($q, "คืนตำแหน่งสำเร็จ"); }) - .onCancel(() => {}) - .onDismiss(() => {}); + + .catch((e: Object) => { + console.log(e); + }) + .finally(async () => { + hideLoader(); + await closeAndClear(); + }); }; diff --git a/src/modules/05_placement/components/PersonalList/Table.vue b/src/modules/05_placement/components/PersonalList/Table.vue index 8c59a0be0..3d9548830 100644 --- a/src/modules/05_placement/components/PersonalList/Table.vue +++ b/src/modules/05_placement/components/PersonalList/Table.vue @@ -43,7 +43,14 @@ const files = ref(null); const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง const $q = useQuasar(); // show dialog -const { messageError, showLoader, hideLoader, dateText, success } = mixin; +const { + messageError, + showLoader, + hideLoader, + dateText, + success, + dialogConfirm, +} = mixin; const route = useRoute(); const examId = route.params.examId; @@ -273,84 +280,85 @@ const appointModal = ref(false); const saveDeferment = async () => { myForm.value.validate().then(async (result: boolean) => { if (result) { - const formData = new FormData(); - formData.append("personalId", personalId.value); - formData.append("note", userNote.value); - formData.append("files", files.value[0]); - $q.dialog({ - title: "ยืนยันการขอผ่อนผัน", - message: "ต้องการยืนยันการขอผ่อนผันข้อมูลนี้ใช่หรือไม่ ?", - cancel: { - flat: true, - const: "negative", - }, - persistent: true, - }) - .onOk(async () => { - showLoader(); - console.log("ยืนยันการขอผ่อนผัน"); - await http - .post(config.API.deferment(), formData) - .then(() => { - success($q, "บันทึกสำเร็จ"); - }) - .catch((e) => { - console.log(e); - }) - .finally(async () => { - await getTable(); - props.statCard(); - userNote.value = ""; - modalDefermentDisclaim.value = false; - hideLoader(); - }); - }) - .onCancel(() => {}) - .onDismiss(() => {}); + dialogConfirm( + $q, + async () => await postDeferment(), + "ยืนยันการขอผ่อนผัน", + "ต้องการยืนยันการขอผ่อนผันข้อมูลนี้ใช่หรือไม่ ?" + ); + // $q.dialog({ + // title: "ยืนยันการขอผ่อนผัน", + // message: "ต้องการยืนยันการขอผ่อนผันข้อมูลนี้ใช่หรือไม่ ?", + // cancel: { + // flat: true, + // const: "negative", + // }, + // persistent: true, + // }) + // .onOk(async () => {}) + // .onCancel(() => {}) + // .onDismiss(() => {}); } }); }; +const postDeferment = async () => { + const formData = new FormData(); + formData.append("personalId", personalId.value); + formData.append("note", userNote.value); + formData.append("files", files.value[0]); + showLoader(); + await http + .post(config.API.deferment(), formData) + .then(() => { + success($q, "บันทึกสำเร็จ"); + }) + .catch((e) => { + console.log(e); + }) + .finally(async () => { + await getTable(); + props.statCard(); + userNote.value = ""; + modalDefermentDisclaim.value = false; + hideLoader(); + }); +}; const saveDisclaim = async () => { myForm.value.validate().then(async (result: boolean) => { if (result) { - // showLoader(); - const dataPost = { - note: userNote.value, - personId: personalId.value, - }; - $q.dialog({ - title: "ยืนยันการสละสิทธิ์", - message: "ต้องการยืนยันการสละสิทธิ์ข้อมูลนี้ใช่หรือไม่ ?", - cancel: { - flat: true, - const: "negative", - }, - }) - .onOk(async () => { - showLoader(); - console.log("ยืนยันการสละสิทธิ์"); - await http - .post(config.API.disclaimF(), { - note: dataPost.note, - personalId: dataPost.personId, - }) - .then(() => { - success($q, "บันทึกสำเร็จ"); - }) - .finally(async () => { - await getTable(); - props.statCard(); - userNote.value = ""; - modalDefermentDisclaim.value = false; - hideLoader(); - }); - }) - .onCancel(() => {}) - .onDismiss(() => {}); + dialogConfirm( + $q, + async () => await postDisclaimf(), + "ยืนยันการสละสิทธิ์", + "ต้องการยืนยันการสละสิทธิ์ข้อมูลนี้ใช่หรือไม่ ?" + ); } }); }; +const postDisclaimf = async () => { + const dataPost = { + note: userNote.value, + personId: personalId.value, + }; + showLoader(); + console.log("ยืนยันการสละสิทธิ์"); + await http + .post(config.API.disclaimF(), { + note: dataPost.note, + personalId: dataPost.personId, + }) + .then(() => { + success($q, "บันทึกสำเร็จ"); + }) + .finally(async () => { + await getTable(); + props.statCard(); + userNote.value = ""; + modalDefermentDisclaim.value = false; + hideLoader(); + }); +}; const clickEditRow = () => { editRow.value = true; @@ -371,7 +379,6 @@ const selectData = (pid: string) => { router.push("/placement/personal-detail/" + pid); } }; - const getNumFile = ref(0); const dataInfo = reactive({ reason: "", @@ -456,19 +463,19 @@ const clickCloseSendModal = () => { const clickClose = async () => { userNote.value = ""; + if (editRow.value == true) { - $q.dialog({ - title: `ข้อมูลมีการแก้ไข`, - message: `ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?`, - cancel: "ยกเลิก", - ok: "ยืนยัน", - persistent: true, - }).onOk(async () => { - modalDefermentDisclaim.value = false; - modalwaitInfo.value = false; - modal.value = false; - files.value = null; - }); + dialogConfirm( + $q, + () => { + modalDefermentDisclaim.value = false; + modalwaitInfo.value = false; + modal.value = false; + files.value = null; + }, + `ข้อมูลมีการแก้ไข`, + `ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?` + ); } else { modalDefermentDisclaim.value = false; modalwaitInfo.value = false; @@ -587,6 +594,7 @@ const paginationLabel = (start: number, end: number, total: number) => { :saveNoDraft="true" :role-admin="roleAdmin" :displayAdd="displayAdd" + row-key="fullname" > diff --git a/src/modules/05_placement/components/Relocation/RelocationModal.vue b/src/modules/05_placement/components/Relocation/RelocationModal.vue index b85d268b7..b470205cd 100644 --- a/src/modules/05_placement/components/Relocation/RelocationModal.vue +++ b/src/modules/05_placement/components/Relocation/RelocationModal.vue @@ -9,7 +9,14 @@ import config from "@/app.config"; const $q = useQuasar(); const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง -const { date2Thai, hideLoader, messageError, showLoader, success } = mixin; //ฟังก์ชันกลางที่เรียกใช้ +const { + date2Thai, + hideLoader, + messageError, + showLoader, + success, + dialogConfirm, +} = mixin; //ฟังก์ชันกลางที่เรียกใช้ const notFound = ref("ไม่พบข้อมูลที่ค้นหา"); const noData = ref("ไม่พบข้อมูลผังโครงสร้าง"); @@ -205,16 +212,15 @@ const clickEditRow = () => { const closeModal = () => { if (editDataStatus.value == true) { - $q.dialog({ - title: `ข้อมูลมีการแก้ไข`, - message: `ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?`, - cancel: "ยกเลิก", - ok: "ยืนยัน", - persistent: true, - }).onOk(() => { - editDataStatus.value = false; - closeAndClear(); - }); + dialogConfirm( + $q, + () => { + editDataStatus.value = false; + closeAndClear(); + }, + `ข้อมูลมีการแก้ไข`, + `ยืนยันที่จะปิดโดยไม่บันทึกใช่หรือไม่?` + ); } else { closeAndClear(); } @@ -319,7 +325,6 @@ const selectedPosition = async (data: any) => { positionPathSideArr.length > 1 || positionPathSideArr.length == 0 ? "" : positionPathSideArr[0].value; - } // positionType Options diff --git a/src/modules/05_placement/components/Relocation/RelocationbyId.vue b/src/modules/05_placement/components/Relocation/RelocationbyId.vue index 2c166912c..5010c6c3f 100644 --- a/src/modules/05_placement/components/Relocation/RelocationbyId.vue +++ b/src/modules/05_placement/components/Relocation/RelocationbyId.vue @@ -27,6 +27,7 @@ const { showLoader, hideLoader, success, + dialogConfirm, } = mixin; const roleAdmin = ref(false); @@ -39,7 +40,7 @@ const id = ref(""); const prefix = ref(""); const prefixId = ref(""); const firstname = ref(""); -const citizenId = ref("") +const citizenId = ref(""); const lastname = ref(""); const position = ref(""); const posNo = ref(""); @@ -54,14 +55,14 @@ const amount = ref(); const amountOld = ref(); const positionTypeOld = ref(""); const positionLevelOld = ref(""); -const dateOfBirth = ref() -const genderId = ref("") -const nationality = ref("") -const race = ref("") -const religionId = ref("") -const bloodGroupId = ref("") -const relationshipId = ref("") -const telephoneNumber = ref("") +const dateOfBirth = ref(); +const genderId = ref(""); +const nationality = ref(""); +const race = ref(""); +const religionId = ref(""); +const bloodGroupId = ref(""); +const relationshipId = ref(""); +const telephoneNumber = ref(""); const positionNumberOld = ref(""); const organizationPositionOld = ref(""); const isActive = ref(""); @@ -116,7 +117,7 @@ const getData = async () => { .get(config.API.relocationDetail(personId)) .then((res: any) => { const data = res.data.result; - citizenId.value = data.citizenId + citizenId.value = data.citizenId; fullname.value = `${data.prefix}${data.firstname} ${data.lastname}`; prefixId.value = data.prefixId; prefix.value = data.prefix; @@ -165,31 +166,27 @@ const conditionSave = async () => { if (myForm.value !== null) { myForm.value.validate().then((success: any) => { if (success) { - dialogMessage( + dialogConfirm( $q, - "ต้องการแก้ไขข้อมูลหรือไม่?", - "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย", - "mdi-help-circle-outline", - "ตกลง", - "public", async () => await saveData(), - undefined + "ต้องการแก้ไขข้อมูลหรือไม่?", + "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย" ); } }); } }; const cancelBtn = () => { - edit.value=!edit - getData() -} + edit.value = !edit; + getData(); +}; const saveData = async () => { const body = { educationOld: educationOld.value, - prefixId:prefixId.value, - citizenId:citizenId.value, - firstname:firstname.value, - lastname:lastname.value, + prefixId: prefixId.value, + citizenId: citizenId.value, + firstname: firstname.value, + lastname: lastname.value, reason: reason.value, organizationPositionOld: organizationPositionOld.value, positionTypeOld: positionTypeOld.value, @@ -197,14 +194,14 @@ const saveData = async () => { positionNumberOld: positionNumberOld.value, amount: amount.value, amountOld: amountOld.value, - dateOfBirth:dateOfBirth.value , - genderId:genderId.value , - nationality:nationality.value , - race:race.value , - religionId:religionId.value , - bloodGroupId:bloodGroupId.value , - relationshipId:relationshipId.value , - telephoneNumber:telephoneNumber.value , + dateOfBirth: dateOfBirth.value, + genderId: genderId.value, + nationality: nationality.value, + race: race.value, + religionId: religionId.value, + bloodGroupId: bloodGroupId.value, + relationshipId: relationshipId.value, + telephoneNumber: telephoneNumber.value, }; showLoader(); await http @@ -363,22 +360,22 @@ onMounted(async () => {
-
วุฒิการศึกษา
-
- -
-
+
วุฒิการศึกษา
+
+ +
+
diff --git a/src/modules/05_placement/components/Repatriate/RepatriateMain.vue b/src/modules/05_placement/components/Repatriate/RepatriateMain.vue index 79901761c..aecc10e5b 100644 --- a/src/modules/05_placement/components/Repatriate/RepatriateMain.vue +++ b/src/modules/05_placement/components/Repatriate/RepatriateMain.vue @@ -32,8 +32,7 @@ const { hideLoader, success, dialogMessage, - - + dialogRemove, } = mixin; const modal = ref(false); @@ -258,16 +257,18 @@ const columns2 = ref([ //--------------(ปุ่มลบ)----------------// -const openDetail = (id:string) => { - router.push(`/repatriate/detail/${id}`) -} +const openDetail = (id: string) => { + router.push(`/repatriate/detail/${id}`); +}; const openModal = () => (modal.value = true); const closeModal = () => (modal.value = false); const openModalOrder = () => { openModal(); const row = rows.value.filter( (item: officerType) => - item.status == "WAITTING" || item.status == "PENDING" || item.status == "APPROVE" + item.status == "WAITTING" || + item.status == "PENDING" || + item.status == "APPROVE" ); rows2.value = row; }; @@ -280,7 +281,7 @@ const getData = async () => { console.log("data==>", data); rows.value = data.map((item: officerType) => ({ id: item.id, - fullname:`${item.prefix}${item.firstName} ${item.lastName}`, + fullname: `${item.prefix}${item.firstName} ${item.lastName}`, position: item.position, posNo: item.posNo, positionLevel: item.positionLevel, @@ -288,7 +289,7 @@ const getData = async () => { organization: item.organization, reason: item.reason, status: item.status, - statusText:statusText(item.status), + statusText: statusText(item.status), date: item.date, salary: item.salary, positionTypeOld: item.positionTypeOld, @@ -296,9 +297,8 @@ const getData = async () => { positionNumberOld: item.positionNumberOld, organizationPositionOld: item.organizationPositionOld, isActive: item.isActive, - }) - ); - console.log(rows.value ) + })); + console.log(rows.value); }) .catch((e) => { // messageError($q, e); @@ -330,35 +330,23 @@ const saveOrder = async () => { hideLoader(); }); }; -const deleteData = async (id:string) => { +const deleteData = async (id: string) => { await http - .delete(config.API.repatriationMainDelete(id)) - .then((res)=>{ - success($q, "ลบข้อมูลสำเร็จ"); - console.log(res) - }) - .catch((e) => { - messageError($q, e); - }) - .finally(async () => { - await getData(); - }); -} + .delete(config.API.repatriationMainDelete(id)) + .then((res) => { + success($q, "ลบข้อมูลสำเร็จ"); + console.log(res); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(async () => { + await getData(); + }); +}; - -const clickDelete = async (name:string,id:string) => { - dialogMessage( - $q, - `ลบข้อมูลของ ${name}`, - `ต้องการทำการลบข้อมูลนี้ใช่หรือไม่?`, - "delete", - "ยืนยัน", - "red", - async () => await deleteData(id) - , - async () => await getData() - - ); +const clickDelete = async (name: string, id: string) => { + dialogRemove($q, async () => await deleteData(id), `ลบข้อมูลของ ${name}`); }; onMounted(async () => { await getData(); @@ -441,26 +429,50 @@ onMounted(async () => { {{ props.rowIndex + 1 }} - + {{ props.row.fullname }} - + {{ props.row.position }} - + {{ props.row.positionLevel }} - +
- {{ props.row.organizationPositionOld }} -
+ {{ props.row.organizationPositionOld }} +
- +
- {{ props.row.organization }} -
+ {{ props.row.organization }} +
- + {{ props.row.statusText }} @@ -471,9 +483,9 @@ onMounted(async () => { flat round dense - @click="clickDelete(props.row.fullname,props.row.id)" + @click="clickDelete(props.row.fullname, props.row.id)" > - ลบข้อมูล + ลบข้อมูล @@ -580,13 +592,13 @@ onMounted(async () => {
- {{ props.row.organizationPositionOld }} -
+ {{ props.row.organizationPositionOld }} +
- {{ props.row.organization }} -
+ {{ props.row.organization }} +
{{ props.row.statusText }} diff --git a/src/modules/05_placement/components/Repatriate/RepatriatebyId.vue b/src/modules/05_placement/components/Repatriate/RepatriatebyId.vue index 3bc30c5bf..fe939736d 100644 --- a/src/modules/05_placement/components/Repatriate/RepatriatebyId.vue +++ b/src/modules/05_placement/components/Repatriate/RepatriatebyId.vue @@ -1,254 +1,112 @@ - + - \ No newline at end of file +.text-top { + color: gray; + font-weight: 400; + padding-bottom: 3px; +} +.text-detail { + font-weight: 500; +} + diff --git a/src/modules/05_placement/components/RepatriationOrder/List.vue b/src/modules/05_placement/components/RepatriationOrder/List.vue index a63dda8e4..f811d267f 100644 --- a/src/modules/05_placement/components/RepatriationOrder/List.vue +++ b/src/modules/05_placement/components/RepatriationOrder/List.vue @@ -208,7 +208,7 @@ const pagination = ref({ }); const mixin = useCounterMixin(); -const { dateText } = mixin; +const { dateText, dialogRemove } = mixin; // แปลงเวลา ค.ศ ให้เป็น พ.ศ const textDate = (value: Date) => { @@ -489,20 +489,7 @@ const redirectToPage = (id?: number) => { }; const clickDelete = (id: string) => { - $q.dialog({ - title: "ยืนยันการลบข้อมูล", - message: "ต้องการลบข้อมูลนี้ใช่หรือไม่?", - cancel: { - flat: true, - color: "negative", - }, - persistent: true, - }) - .onOk(async () => { - // await deleteData(id); - }) - .onCancel(() => {}) - .onDismiss(() => {}); + dialogRemove($q); }; // const deleteData = async (id: string) => { diff --git a/src/modules/05_placement/components/Transfer/transferRegistry.vue b/src/modules/05_placement/components/Transfer/transferRegistry.vue index 26188ce8b..05a1fb05f 100644 --- a/src/modules/05_placement/components/Transfer/transferRegistry.vue +++ b/src/modules/05_placement/components/Transfer/transferRegistry.vue @@ -388,6 +388,7 @@ const { showLoader, hideLoader, success, + dialogConfirm, } = mixin; const myForm = ref(null); @@ -511,15 +512,11 @@ const getData = async () => { }; const confirmMessage = async () => { - dialogMessage( + dialogConfirm( $q, + async () => await sendConfirm(), "ต้องการยืนยันส่งคำร้องไปยัง สกจ หรือไม่?", - "ข้อมูลจะถูกนำส่งคำร้องไปยัง สกจ ทันที", - "mdi-help-circle-outline", - "ยืนยัน", - "primary", - () => sendConfirm(), - undefined + "ข้อมูลจะถูกนำส่งคำร้องไปยัง สกจ ทันที" ); }; @@ -545,15 +542,11 @@ const conditionSave = async () => { if (myForm.value !== null) { myForm.value.validate().then((success) => { if (success) { - dialogMessage( + dialogConfirm( $q, - "ต้องการแก้ไขข้อมูลหรือไม่?", - "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย", - "mdi-help-circle-outline", - "ตกลง", - "public", async () => await saveData(), - undefined + "ต้องการแก้ไขข้อมูลหรือไม่?", + "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย" ); } }); diff --git a/src/modules/05_placement/components/helpgovernment/governmentDetail.vue b/src/modules/05_placement/components/helpgovernment/governmentDetail.vue index 99c741fd9..7b5a538ae 100644 --- a/src/modules/05_placement/components/helpgovernment/governmentDetail.vue +++ b/src/modules/05_placement/components/helpgovernment/governmentDetail.vue @@ -295,7 +295,7 @@ const edit = ref(false); const personId = route.params.id as string; const { date2Thai, - dialogMessage, + dialogConfirm, messageError, showLoader, hideLoader, @@ -415,24 +415,20 @@ const conditionSave = async () => { if (myForm.value !== null) { myForm.value.validate().then((success: any) => { if (success) { - dialogMessage( + dialogConfirm( $q, - "ต้องการแก้ไขข้อมูลหรือไม่?", - "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย", - "mdi-help-circle-outline", - "ตกลง", - "public", async () => await saveData(), - undefined + "ต้องการแก้ไขข้อมูลหรือไม่?", + "แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย" ); } }); } }; const cancelBtn = () => { - edit.value=!edit - getData() -} + edit.value = !edit; + getData(); +}; const saveData = async () => { const body = { organization: organization.value, diff --git a/src/modules/05_placement/components/helpgovernment/mainHelp.vue b/src/modules/05_placement/components/helpgovernment/mainHelp.vue index c6899d25f..ee3ec9ce8 100644 --- a/src/modules/05_placement/components/helpgovernment/mainHelp.vue +++ b/src/modules/05_placement/components/helpgovernment/mainHelp.vue @@ -20,7 +20,7 @@ const checkSelected = computed(() => { return true; } }); -const firstName = ref("") +const firstName = ref(""); const $q = useQuasar(); const router = useRouter(); @@ -32,9 +32,7 @@ const { showLoader, hideLoader, success, - dialogMessage, - - + dialogRemove, } = mixin; const modal = ref(false); @@ -259,16 +257,18 @@ const columns2 = ref([ //--------------(ปุ่มลบ)----------------// -const openDetail = (id:string) => { - router.push(`/help-government/detail/${id}`) -} +const openDetail = (id: string) => { + router.push(`/help-government/detail/${id}`); +}; const openModal = () => (modal.value = true); const closeModal = () => (modal.value = false); const openModalOrder = () => { openModal(); const row = rows.value.filter( (item: officerType) => - item.status == "WAITTING" || item.status == "PENDING" || item.status == "APPROVE" + item.status == "WAITTING" || + item.status == "PENDING" || + item.status == "APPROVE" ); rows2.value = row; }; @@ -281,7 +281,7 @@ const getData = async () => { console.log("data==>", data); rows.value = data.map((item: officerType) => ({ id: item.id, - fullname:`${item.prefix}${item.firstName} ${item.lastName}`, + fullname: `${item.prefix}${item.firstName} ${item.lastName}`, position: item.position, posNo: item.posNo, positionLevel: item.positionLevel, @@ -289,7 +289,7 @@ const getData = async () => { organization: item.organization, reason: item.reason, status: item.status, - statusText:statusText(item.status), + statusText: statusText(item.status), date: item.date, salary: item.salary, positionTypeOld: item.positionTypeOld, @@ -297,9 +297,8 @@ const getData = async () => { positionNumberOld: item.positionNumberOld, organizationPositionOld: item.organizationPositionOld, isActive: item.isActive, - }) - ); - console.log(rows.value ) + })); + console.log(rows.value); }) .catch((e) => { // messageError($q, e); @@ -331,35 +330,23 @@ const saveOrder = async () => { hideLoader(); }); }; -const deleteData = async (id:string) => { +const deleteData = async (id: string) => { await http - .delete(config.API.officerMainDelete(id)) - .then((res)=>{ - success($q, "ลบข้อมูลสำเร็จ"); - console.log(res) - }) - .catch((e) => { - messageError($q, e); - }) - .finally(async () => { - await getData(); - }); -} + .delete(config.API.officerMainDelete(id)) + .then((res) => { + success($q, "ลบข้อมูลสำเร็จ"); + console.log(res); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(async () => { + await getData(); + }); +}; - -const clickDelete = async (name:string,id:string) => { - dialogMessage( - $q, - `ลบข้อมูลของ ${name}`, - `ต้องการทำการลบข้อมูลนี้ใช่หรือไม่?`, - "delete", - "ยืนยัน", - "red", - async () => await deleteData(id) - , - async () => await getData() - - ); +const clickDelete = async (name: string, id: string) => { + dialogRemove($q, async () => await deleteData(id)); }; onMounted(async () => { await getData(); @@ -442,26 +429,50 @@ onMounted(async () => { {{ props.rowIndex + 1 }} - + {{ props.row.fullname }} - + {{ props.row.position }} - + {{ props.row.positionLevel }} - +
- {{ props.row.organizationPositionOld }} -
+ {{ props.row.organizationPositionOld }} +
- +
- {{ props.row.organization }} -
+ {{ props.row.organization }} +
- + {{ props.row.statusText }} @@ -472,9 +483,9 @@ onMounted(async () => { flat round dense - @click="clickDelete(props.row.fullname,props.row.id)" + @click="clickDelete(props.row.fullname, props.row.id)" > - ลบข้อมูล + ลบข้อมูล @@ -581,13 +592,13 @@ onMounted(async () => {
- {{ props.row.organizationPositionOld }} -
+ {{ props.row.organizationPositionOld }} +
- {{ props.row.organization }} -
+ {{ props.row.organization }} +
{{ props.row.statusText }} diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue index fad5971fd..a2e381dee 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluate.vue @@ -19,6 +19,7 @@ const { hideLoader, success, dateToISO, + dialogConfirm, } = mixin; const route = useRoute(); const assignId = ref(route.params.form.toString()); @@ -292,29 +293,18 @@ const putformData = () => { other_training: Number(other_training.value), commander_dated: dateToISO(dateAutherise.value), }; - $q.dialog({ - title: "ยืนยันการบันทึกข้อมูล", - message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?", - cancel: { - flat: true, - color: "negative", - }, - persistent: true, - }) - .onOk(async () => { - console.log("บันทึกข้อมูล", data); - await http - .post(config.API.createformCommader(assignId.value), data) - .then((res: any) => { - console.log(res); - success($q, "บันทึกสำเร็จ"); - }) - .catch((e: any) => { - messageError($q, e); - }); - }) - .onCancel(() => {}) - .onDismiss(() => {}); + + dialogConfirm($q, async () => { + await http + .post(config.API.createformCommader(assignId.value), data) + .then((res: any) => { + console.log(res); + success($q, "บันทึกสำเร็จ"); + }) + .catch((e: any) => { + messageError($q, e); + }); + }); }; diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateAdd.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateAdd.vue index ec8e93ca7..e565c6aaa 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateAdd.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateAdd.vue @@ -19,6 +19,7 @@ const { hideLoader, success, dateToISO, + dialogConfirm, } = mixin; const route = useRoute(); const router = useRouter(); @@ -99,7 +100,7 @@ const fecthAssign = async (id: string) => { evaluate_no.value = res.data.data.evaluate_no; start_date.value = res.data.data.start_date; date_finish.value = res.data.data.end_date; - round.value = res.data.data.evaluate_no + round.value = res.data.data.evaluate_no; }) .catch((e) => { messageError($q, e); @@ -217,29 +218,41 @@ const putformData = () => { other_training: Number(other_training.value), commander_dated: dateToISO(dateAutherise.value), }; - $q.dialog({ - title: "ยืนยันการบันทึกข้อมูล", - message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?", - cancel: { - flat: true, - color: "negative", - }, - persistent: true, - }) - .onOk(async () => { - console.log("บันทึกข้อมูล", data); - await http - .post(config.API.createformCommader(assignId.value), data) - .then((res: any) => { - console.log(res); - success($q, "บันทึกสำเร็จ"); - }) - .catch((e: any) => { - messageError($q, e); - }); - }) - .onCancel(() => {}) - .onDismiss(() => {}); + dialogConfirm($q, async () => { + await http + .post(config.API.createformCommader(assignId.value), data) + .then((res: any) => { + console.log(res); + success($q, "บันทึกสำเร็จ"); + }) + .catch((e: any) => { + messageError($q, e); + }); + }); + + // $q.dialog({ + // title: "ยืนยันการบันทึกข้อมูล", + // message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?", + // cancel: { + // flat: true, + // color: "negative", + // }, + // persistent: true, + // }) + // .onOk(async () => { + // console.log("บันทึกข้อมูล", data); + // await http + // .post(config.API.createformCommader(assignId.value), data) + // .then((res: any) => { + // console.log(res); + // success($q, "บันทึกสำเร็จ"); + // }) + // .catch((e: any) => { + // messageError($q, e); + // }); + // }) + // .onCancel(() => {}) + // .onDismiss(() => {}); }; diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue index 5e5fe6e53..9bcc12f7c 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScore.vue @@ -19,6 +19,7 @@ const { hideLoader, dateToISO, success, + dialogConfirm, } = mixin; const route = useRoute(); const assignId = ref(route.params.form.toString()); @@ -396,33 +397,44 @@ const putformData = () => { chairman_dated: dateToISO(dateAutherise.value), develop_result: develop_result.value, }; - $q.dialog({ - title: "ยืนยันการบันทึกข้อมูล", - message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?", - cancel: { - flat: true, - color: "negative", - }, - persistent: true, - }) - .onOk(async () => { - console.log("บันทึกข้อมูล", data); - await http - .post(config.API.createformChairman(assignId.value), data) - .then((res: any) => { - console.log(res); - success($q, "บันทึกสำเร็จ"); - }) - .catch((e: any) => { - console.log(e); - messageError($q, e); - }) - .finally(() => { - fetchEvaluate(assignId.value, round.value); - }); - }) - .onCancel(() => {}) - .onDismiss(() => {}); + dialogConfirm($q, async () => { + await http + .post(config.API.createformChairman(assignId.value), data) + .then((res: any) => { + console.log(res); + success($q, "บันทึกสำเร็จ"); + }) + .catch((e: any) => { + messageError($q, e); + }); + }); + // $q.dialog({ + // title: "ยืนยันการบันทึกข้อมูล", + // message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?", + // cancel: { + // flat: true, + // color: "negative", + // }, + // persistent: true, + // }) + // .onOk(async () => { + // console.log("บันทึกข้อมูล", data); + // await http + // .post(config.API.createformChairman(assignId.value), data) + // .then((res: any) => { + // console.log(res); + // success($q, "บันทึกสำเร็จ"); + // }) + // .catch((e: any) => { + // console.log(e); + // messageError($q, e); + // }) + // .finally(() => { + // fetchEvaluate(assignId.value, round.value); + // }); + // }) + // .onCancel(() => {}) + // .onDismiss(() => {}); }; diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScoreAdd.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScoreAdd.vue index 1273a3578..ce076257b 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScoreAdd.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScoreAdd.vue @@ -19,6 +19,7 @@ const { hideLoader, dateToISO, success, + dialogConfirm, } = mixin; const route = useRoute(); const router = useRouter(); @@ -330,33 +331,17 @@ const putformData = () => { chairman_dated: dateToISO(dateAutherise.value), develop_result: develop_result.value, }; - $q.dialog({ - title: "ยืนยันการบันทึกข้อมูล", - message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?", - cancel: { - flat: true, - color: "negative", - }, - persistent: true, - }) - .onOk(async () => { - console.log("บันทึกข้อมูล", data); - await http - .post(config.API.createformChairman(assignId.value), data) - .then((res: any) => { - console.log(res); - success($q, "บันทึกสำเร็จ"); - }) - .catch((e: any) => { - console.log(e); - messageError($q, e); - }) - .finally(() => { - fetchEvaluate(assignId.value, round.value); - }); - }) - .onCancel(() => {}) - .onDismiss(() => {}); + dialogConfirm($q, async () => { + await http + .post(config.API.createformChairman(assignId.value), data) + .then((res: any) => { + console.log(res); + success($q, "บันทึกสำเร็จ"); + }) + .catch((e: any) => { + messageError($q, e); + }); + }); }; diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormReport.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormReport.vue index d8068dbeb..13621e6ba 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormReport.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormReport.vue @@ -17,6 +17,7 @@ const { success, showLoader, hideLoader, + dialogConfirm, } = mixin; const route = useRoute(); const assignId = ref(route.params.form.toString()); @@ -106,20 +107,7 @@ const optionDirector = ref([]); const savaForm = async () => { await myForm.value!.validate().then((result: boolean) => { if (result) { - $q.dialog({ - title: "ยืนยันการบันทึกข้อมูล", - message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?", - cancel: { - flat: true, - color: "negative", - }, - persistent: true, - }) - .onOk(async () => { - postData(); - }) - .onCancel(() => {}) - .onDismiss(() => {}); + dialogConfirm($q, async () => await postData()); } }); }; diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResult.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResult.vue index a3e1ed7b7..15dde4bc2 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResult.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResult.vue @@ -21,6 +21,7 @@ const { messageError, showLoader, hideLoader, + dialogConfirm, } = mixin; const { ratingColors } = probationStore; const assignId = ref(route.params.form.toString()); @@ -370,21 +371,7 @@ const putformData = () => { assessor_dated: dateToISO(dateAutherise.value), // commander_dated: dateAutherise.value, }; - $q.dialog({ - title: "ยืนยันการบันทึกข้อมูล", - message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?", - cancel: { - flat: true, - color: "negative", - }, - persistent: true, - }) - .onOk(async () => { - console.log("บันทึกข้อมูล", data); - saveformdata(data); - }) - .onCancel(() => {}) - .onDismiss(() => {}); + dialogConfirm($q, async () => await saveformdata(data)); }; const saveformdata = async (data: any) => { await http diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResultAdd.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResultAdd.vue index 5dfe426c7..31c427ea5 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResultAdd.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResultAdd.vue @@ -14,7 +14,14 @@ const route = useRoute(); const router = useRouter(); const probationStore = useProbationDataStore(); const mixin = useCounterMixin(); -const { date2Thai, success, notifyError, dateToISO, messageError } = mixin; +const { + date2Thai, + success, + notifyError, + dateToISO, + messageError, + dialogConfirm, +} = mixin; const { ratingColors } = probationStore; const assignId = ref(route.params.form.toString()); @@ -289,21 +296,7 @@ const putformData = () => { assessor_dated: dateToISO(dateAutherise.value), // commander_dated: dateAutherise.value, }; - $q.dialog({ - title: "ยืนยันการบันทึกข้อมูล", - message: "ต้องการบันทึกข้อมูลนี้ใช่หรือไม่ ?", - cancel: { - flat: true, - color: "negative", - }, - persistent: true, - }) - .onOk(async () => { - console.log("บันทึกข้อมูล", data); - saveformdata(data); - }) - .onCancel(() => {}) - .onDismiss(() => {}); + dialogConfirm($q, async () => await saveformdata(data)); }; const saveformdata = async (data: any) => { await http