From f592008bbe53c243a7e7b60f654500a378669ed6 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 19 Sep 2023 16:45:07 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A8=E0=B9=80=E0=B8=81=E0=B8=A9=E0=B8=B5=E0=B8=A2=E0=B8=93?= =?UTF-8?q?=E0=B8=AD=E0=B8=B2=E0=B8=A2=E0=B8=B8=E0=B8=A3=E0=B8=B2=E0=B8=8A?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ListRetirement/AddList.vue | 88 +-- .../components/ListRetirement/TableList.vue | 85 +-- .../components/ListRetirement/popupAdd.vue | 200 ++++++ src/modules/06_retirement/storeRetirement.ts | 5 +- src/modules/06_retirement/views/Main.vue | 634 +++++------------- .../components/3_result/DialogForm.vue | 6 +- 6 files changed, 438 insertions(+), 580 deletions(-) create mode 100644 src/modules/06_retirement/components/ListRetirement/popupAdd.vue diff --git a/src/modules/06_retirement/components/ListRetirement/AddList.vue b/src/modules/06_retirement/components/ListRetirement/AddList.vue index 6a08a6169..aa0e0f08e 100644 --- a/src/modules/06_retirement/components/ListRetirement/AddList.vue +++ b/src/modules/06_retirement/components/ListRetirement/AddList.vue @@ -8,10 +8,9 @@ import { useRoute } from "vue-router"; const $q = useQuasar(); //ใช้ noti quasar const mixin = useCounterMixin(); -const { messageError, success, showLoader, hideLoader } = mixin; +const { messageError, success, showLoader, hideLoader, dialogConfirm } = mixin; const route = useRoute(); -const type_params = route.params.type; const retireld_params = route.params.id; const props = defineProps({ retireld: String, @@ -65,57 +64,16 @@ const columns = ref([ align: "left", }, ]); -const rows = ref([ - // { - // fullname: "นายใจดี ยอดใจ", - // position: "นักวิชาการพัสดุ", - // level: "ปฎิบัติการ", - // affiliation: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒", - // }, - // { - // fullname: "นายจักกริน บัณฑิต", - // position: "นักวิชาการพัสดุ", - // level: "ปฎิบัติการ", - // affiliation: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒", - // }, - // { - // fullname: "นายจักกริน บัณฑิต", - // position: "นักวิชาการพัสดุ", - // level: "ปฎิบัติการ", - // affiliation: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒", - // }, - // { - // fullname: "นายจักกริน บัณฑิต", - // position: "นักวิชาการพัสดุ", - // level: "ปฎิบัติการ", - // affiliation: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒", - // }, - // { - // fullname: "นายจักกริน บัณฑิต", - // position: "นักวิชาการพัสดุ", - // level: "ปฎิบัติการ", - // affiliation: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒", - // }, - // { - // fullname: "นายจักกริน บัณฑิต", - // position: "นักวิชาการพัสดุ", - // level: "ปฎิบัติการ", - // affiliation: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒", - // }, - // { - // fullname: "นายจักกริน บัณฑิต", - // position: "นักวิชาการพัสดุ", - // level: "ปฎิบัติการ", - // affiliation: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒", - // }, -]); +const rows = ref([]); watch(modal, () => { if (modal.value === true) { retireld.value = props.retireld; - if (props.dataProfile.type === "OFFICER") { - type.value = "officer"; - } else type.value = "all"; + if (props.dataProfile) { + if (props.dataProfile.type === "OFFICER") { + type.value = "officer"; + } else type.value = "all"; + } fecthlistRetire(); } @@ -146,14 +104,11 @@ const findlist = async (id: string) => { { criteriaType: "employee_class", criteriaValue: "perm" }, ]; } - // console.log(data); - await http .post(config.API.profileSearchNewOcIdType(id, type.value), { criterias: data, }) .then((res) => { - // console.log(res.data.result); rows.value = res.data.result.map((e: any) => ({ id: e.id, fullname: e.fullname, @@ -172,25 +127,13 @@ const findlist = async (id: string) => { // putlist const clickAdd = (props: any) => { - // console.log("props===>",props.row.id) if (retireld.value == undefined) { retireld.value = retireld_params; } - let data: any = props.row.id; - // console.log("retireld & profileId", retireld.value, data); - - $q.dialog({ - title: "ยืนยันการเพิ่มข้อมูล", - message: "ต้องการเพิ่มข้อมูลนี้ใช่หรือไม่?", - cancel: { - flat: true, - color: "negative", - }, - persistent: true, - }) - .onOk(async () => { - // console.log("เพิ่มข้อมูล"); + dialogConfirm( + $q, + async () => { await http .put(config.API.profileRetire(retireld.value), { profileId: data }) .then(() => { @@ -201,12 +144,12 @@ const clickAdd = (props: any) => { messageError($q, e); }) .finally(() => { - // fecthlistRetire(); modal.value = false; }); - }) - .onCancel(() => {}) - .onDismiss(() => {}); + }, + "ยืนยันการเพิ่มข้อมูล", + "ต้องการเพิ่มข้อมูลนี้ใช่หรือไม่ ?" + ); }; // update retireld const updateListData = (retireld: string, pId: string) => { @@ -294,9 +237,6 @@ const paginationLabel = (start: number, end: number, total: number) => {