From 9dc56a34e8e507e358f555ccb98d933c57eaa51e Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 29 Aug 2023 17:09:25 +0700 Subject: [PATCH] no message --- .../components/probation/MainProbation.vue | 77 ++++++------------- 1 file changed, 25 insertions(+), 52 deletions(-) diff --git a/src/modules/05_placement/components/probation/MainProbation.vue b/src/modules/05_placement/components/probation/MainProbation.vue index 951ce7300..88d7c3a87 100644 --- a/src/modules/05_placement/components/probation/MainProbation.vue +++ b/src/modules/05_placement/components/probation/MainProbation.vue @@ -14,7 +14,7 @@ import { useQuasar } from "quasar"; const $q = useQuasar(); //ใช้ noti quasar const mixin = useCounterMixin(); -const { messageError, success, showLoader, hideLoader } = mixin; +const { messageError, success, showLoader, hideLoader, dialogConfirm } = mixin; const modal = ref(false); const pagination = ref({ @@ -164,43 +164,7 @@ const columns2 = ref([ ]); // ข้อมูลตาราง (จำลอง) -const rows2 = ref([ - // { - // no: "1", - // name: "นายใจดี ยอดใจ ", - // position: "นักวิชาการพัสดุ", - // level: "ปฏิบัติการ", - // institution: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒", - // }, - // { - // no: "2", - // name: "นายจักกริน บัณฑิต", - // position: "นักวิชาการพัสดุ", - // level: "ปฏิบัติการ", - // institution: "กลุ่มงานโครงสร้างและอัตรากำลัง ๒", - // }, - // { - // no: "3", - // name: "นางสาวกัณฐิมา กาฬสินธุ์", - // position: "นักจัดการงานทั่วไป", - // level: "ปฏิบัติการ", - // institution: "กลุ่มงานช่วยนักบริหาร", - // }, - // { - // no: "4", - // name: "นางสาวเมขลา กระจ่างมนตรี", - // position: "นักจัดการงานทั่วไป", - // level: "ปฏิบัติการ", - // institution: "กลุ่มงานช่วยนักบริหาร", - // }, - // { - // no: "5", - // name: "นางสาวฐิติรัตน์ พงษ์ศิริ", - // position: "นักจัดการงานทั่วไป", - // level: "ปฏิบัติการ", - // institution: "กลุ่มงานช่วยนักบริหาร", - // }, -]); +const rows2 = ref([]); onMounted(async () => { getpersonalList(); @@ -291,24 +255,18 @@ const clickDelete = (id: string) => { }; const clickAdd = (id: string) => { - $q.dialog({ - title: "ยืนยันการเพิ่มข้อมูล", - message: "ต้องการเพิ่มข้อมูลนี้ใช่หรือไม่?", - cancel: { - flat: true, - color: "negative", - }, - persistent: true, - }) - .onOk(async () => { + dialogConfirm( + $q, + async () => { showLoader(); const postData = { personal_id: id, }; await http .post(config.API.personalAdd(), postData) - .then((res) => { + .then(() => { getpersonalList(); + success($q, "เพิ่มข้อมูลสำเร็จ"); }) .catch((e) => { messageError($q, e); @@ -317,9 +275,24 @@ const clickAdd = (id: string) => { clickClose(); hideLoader(); }); - }) - .onCancel(() => {}) - .onDismiss(() => {}); + }, + "ยันยันการเพิ่มข้อมูล", + "ต้องการเพิ่มข้อมูลนี้หรือไม่ ?" + ); + // $q.dialog({ + // title: "ยืนยันการเพิ่มข้อมูล", + // message: "ต้องการเพิ่มข้อมูลนี้ใช่หรือไม่?", + // cancel: { + // flat: true, + // color: "negative", + // }, + // persistent: true, + // }) + // .onOk(async () => { + + // }) + // .onCancel(() => {}) + // .onDismiss(() => {}); }; const clickClose = async () => {