From 27813a78a6c12260689e25d14db489f22baf4ba8 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 25 Aug 2023 09:56:03 +0700 Subject: [PATCH 1/3] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88?= =?UTF-8?q?=E0=B8=A1=E0=B9=80=E0=B8=AB=E0=B8=95=E0=B8=B8=E0=B8=9C=E0=B8=A5?= =?UTF-8?q?=20=E0=B8=88=E0=B8=B1=E0=B8=94=E0=B8=81=E0=B8=B2=E0=B8=A3?= =?UTF-8?q?=E0=B8=84=E0=B8=B3=E0=B8=82=E0=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../07_insignia/components/2_Manage/Tab1.vue | 330 +++++++++++++++--- 1 file changed, 273 insertions(+), 57 deletions(-) diff --git a/src/modules/07_insignia/components/2_Manage/Tab1.vue b/src/modules/07_insignia/components/2_Manage/Tab1.vue index 13b719acf..88b911d67 100644 --- a/src/modules/07_insignia/components/2_Manage/Tab1.vue +++ b/src/modules/07_insignia/components/2_Manage/Tab1.vue @@ -8,8 +8,9 @@ import http from "@/plugins/http"; import config from "@/app.config"; import { useRouter } from "vue-router"; -const router = useRouter(); +import DialogPopupReason from "@/components/Dialogs/PopupReason.vue"; +const router = useRouter(); const mixin = useCounterMixin(); const { dialogRemove, @@ -23,8 +24,11 @@ const $q = useQuasar(); const DataStore = useInsigniaDataStore(); const modalNote = ref(false); +const modelPopupReject = ref(false); +const modelPopupDelete = ref(false); const modalAdd = ref(false); const modalEdit = ref(false); +const rowid = ref(""); const organization = ref(""); const organizationOptions = ref([{ id: "1", name: "ทั้งหมด" }]); const visibleColumns = ref([ @@ -197,7 +201,9 @@ onMounted(async () => { // // organization.value = DataStore.optionsTypeOc[2].id; // DataStore.typeOc = organization.value; // } else organization.value = DataStore.typeOc; - organization.value = await (DataStore.agency != null ? DataStore.agency : DataStore.typeOc); + organization.value = await (DataStore.agency != null + ? DataStore.agency + : DataStore.typeOc); organizationOptions.value = await DataStore.optionsTypeOc; if (organization.value !== "" || organization.value !== undefined) { if (props.fecthInsigniaByOc) { @@ -372,20 +378,27 @@ const listEdit = async (profileId: string) => { }); }; -const clickReject = (profileId: string) => { +const clickReject = (id: string) => { + modelPopupReject.value = true; + rowid.value = id; +}; +const savaReasonReject = (reason: string) => { dialogConfirm( $q, async () => { - await listreject(profileId); + await listreject(rowid.value, reason); }, "ยืนยันการย้ายข้อมูล", "ต้องการยืนยันการย้ายข้อมูลนี้หรือไม่ ?" ); }; +const closemodelPopupReject = () => { + modelPopupReject.value = false; +}; -const listreject = async (profileId: string) => { +const listreject = async (profileId: string, reason: string) => { await http - .get(config.API.insigniaReject(profileId)) + .put(config.API.insigniaReject(profileId), { reason: reason }) .then(() => { success($q, "ย้ายข้อมูลสำเร็จ"); }) @@ -401,23 +414,31 @@ const listreject = async (profileId: string) => { props.tab ); } + await closemodelPopupReject(); }); }; -const clickDelete = (profileId: string) => { - dialogRemove( +const clickDelete = (id: string) => { + modelPopupDelete.value = true; + rowid.value = id; +}; +const closemodelPopupDelete = () => { + modelPopupDelete.value = false; +}; +const savaReasonDelete = (reason: string) => { + dialogConfirm( $q, async () => { - await listdelete(profileId); + await listdelete(rowid.value, reason); }, "ยืนยันการลบออกข้ออมูล", "ต้องการยืนยันการลบข้อมูลนี้หรือไม่ ?" ); }; -const listdelete = async (profileId: string) => { +const listdelete = async (id: string, reason: string) => { await http - .get(config.API.insigniaDelete(profileId)) + .put(config.API.insigniaDelete(id), { reason: reason }) .then(() => { success($q, "ลบข้อมูลสำเร็จ"); }) @@ -433,6 +454,7 @@ const listdelete = async (profileId: string) => { props.tab ); } + await closemodelPopupDelete(); }); }; @@ -500,40 +522,113 @@ const paginationLabel2 = (start: number, end: number, total: number) => {
- - + +
ดาวน์โหลด - + เพิ่ม
- + - +
- + -
@@ -620,21 +764,44 @@ const paginationLabel2 = (start: number, end: number, total: number) => { เพิ่มรายชื่อ - +
- + - +
@@ -678,18 +858,39 @@ const paginationLabel2 = (start: number, end: number, total: number) => { - แก้ไขเครื่องราชฯ ที่ยื่นขอ + แก้ไขเครื่องราชฯ ที่ยื่นขอ - +
- +
+
+ + อัพโหลดไฟล์บันทึกผลการได้รับพระราชทานเครื่องราชย์อิสริยสภรณ์ + +
{ v-model="fileinvoice" label="บันทึกผลการจ่ายใบกำกับ" style="min-width: auto" - accept=".pdf" + accept=".xlsx" >