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 1/3] 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 () => { From d2bf35a01b5c170b27da9cb1db55ba29039f0d7b Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 30 Aug 2023 09:50:52 +0700 Subject: [PATCH 2/3] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=95?= =?UTF-8?q?=E0=B8=B1=E0=B8=A7=E0=B9=81=E0=B8=9B=E0=B8=A3=20formAssign?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/probation/FormAssign.vue | 163 ++++++++---------- 1 file changed, 69 insertions(+), 94 deletions(-) diff --git a/src/modules/05_placement/components/probation/FormAssign.vue b/src/modules/05_placement/components/probation/FormAssign.vue index de45c7617..29e577f06 100644 --- a/src/modules/05_placement/components/probation/FormAssign.vue +++ b/src/modules/05_placement/components/probation/FormAssign.vue @@ -4,25 +4,74 @@ import { ref, computed, watch, onMounted } from "vue"; import { useCounterMixin } from "@/stores/mixin"; import { useQuasar } from "quasar"; import http from "@/plugins/http"; - import config from "@/app.config"; + const $q = useQuasar(); -const val1 = ref([ - { - id: 1, - text: "1.รัฐธรรมนูญ", - checked: false, - }, -]); const status = ref(true); +const router = useRouter(); +const route = useRoute(); +const mixin = useCounterMixin(); +const { + date2Thai, + dateToISO, + success, + messageError, + showLoader, + hideLoader, + dialogConfirm, + dialogMessageNotify, +} = mixin; +const personalId = route.params.personalId as string; +const assignId = ref(route.params.form as string); +const routeName = router.currentRoute.value.name; + +const myForm = ref(null); +const fullname = ref(); +const date_start = ref(); +const date_finish = ref(); +const other_desc = ref({}); +const other4_desc = ref(); +const Other5 = ref(); +const other5_no1_desc = ref({}); +const group = ref(null); +const group2 = ref(null); +const group3 = ref(null); +const main = ref(); +const main2 = ref(); +const main3 = ref(); +const main4 = ref(); +const main5 = ref(); +const Other = ref(""); +const commander = ref(""); +const chairman = ref(""); +const date1 = ref(); +const date2 = ref(); +const date3 = ref(); +const date4 = ref(); +const OPmain = ref< + Array<{ + id: number; + title: string; + description: string; + level: number; + }> +>([]); +const OPgroup = ref< + Array<{ + id: number; + title: string; + description: string; + level: number; + }> +>([]); const dataEdit = async (id: string) => { showLoader(); const data = putDataEdit(id); await http .put(config.API.saveEditAssign(id), data) - .then((res) => {}) - .catch((e) => {}) + .then(() => {}) + .catch(() => {}) .finally(async () => { status.value = false; getAssign(); @@ -38,20 +87,7 @@ const edit = () => { const cancel = () => { status.value = false; }; -const router = useRouter(); -const mixin = useCounterMixin(); -const { - date2Thai, - notifyError, - dateToISO, - success, - messageError, - showLoader, - hideLoader, - dialogConfirm, - dialogMessageNotify, - modalWarning, -} = mixin; + const filterData = (options: any[], excludedGroups: any[]) => { return options.filter( (item) => !excludedGroups.some((group) => group && group.id === item.id) @@ -67,64 +103,7 @@ const filterMain = (options: any[], excludedGroups: any[]) => { (item) => !excludedGroups.some((group) => group && group.id === item.id) ); }; -const route = useRoute(); -const checkValidate = ref(false); -const myForm = ref(null); -const fullnameFoot = ref(""); -const positionFoot = ref(""); -const caretakerFoot = ref(""); -const caretakerFoot2 = ref(""); -const id = ref(); -const personalId = route.params.personalId as string; -const fullname = ref(); -const knowledge_skill_map_no = ref([]); -const round_no = ref(); -const date_start = ref(); -const date_finish = ref(); -const behavior_desc = ref(); -const other_desc = ref({}); -const other4_desc = ref(); -const Other5 = ref(); -const other5_no1_desc = ref({}); -const other5_no2_desc = ref({}); -const experimenter_dated = ref(); -const createdAt = ref(); -const updatedAt = ref(); -const group = ref(null); -const group2 = ref(null); -const group3 = ref(null); -const main = ref(); -const main2 = ref(); -const main3 = ref(); -const main4 = ref(); -const main5 = ref(); -const assignId = ref(route.params.form as string); -const Other = ref(""); -const commander = ref(""); -const chairman = ref(""); -const date1 = ref(); -const date2 = ref(); -const date3 = ref(); -const date4 = ref(); - -const OPmain = ref< - Array<{ - id: number; - title: string; - description: string; - level: number; - }> ->([]); - -const OPgroup = ref< - Array<{ - id: number; - title: string; - description: string; - level: number; - }> ->([]); const clearDateExam = () => { date_start.value = undefined; }; @@ -134,8 +113,7 @@ const clearDateExam2 = () => { const isDatePicker2Readonly = computed(() => { return date_start.value === undefined; }); -const routeName = router.currentRoute.value.name; -const name = ref(""); + const position = ref(""); const monthSelect = ref(); @@ -226,9 +204,6 @@ const addKnowledge = () => { const knowledgeArray = computed(() => { return Array(knowledgeCount.value).fill(""); }); -const getOpknowledge = (index: number) => { - return OPknowledge; -}; const deleteknowledge = (item: number) => { knowledge.value.splice(item, 1); @@ -236,7 +211,6 @@ const deleteknowledge = (item: number) => { knowledgeCount.value--; } }; -const checked = ref(false); const productivityCount = ref(1); const output_desc = ref(Array(productivityCount.value).fill("")); const indicator_desc = ref(Array(productivityCount.value).fill("")); @@ -350,7 +324,6 @@ const getLaw = async (id: string) => { checkRule.value = res.data.data; }); }; - const postDateTime = async () => { await http .post(config.API.calculateDate(), { @@ -621,10 +594,13 @@ const DataSave = async (id: string) => { const data = putData(id); http .post(config.API.saveFinish(id), data) - .then((res) => { + .then(() => { router.push(`/probation/detail/${id}`); + success($q, "บันทึกข้อมูลสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); }) - .catch((e) => {}) .finally(() => { hideLoader(); }); @@ -634,7 +610,6 @@ const DataSave = async (id: string) => { }); }; const OtherLaw = ref(""); - const skill = ref(); const skill2 = ref(); const skill3 = ref(); @@ -671,8 +646,6 @@ const OPresourse = ref< level_description: string; }> >([]); -const skillIds = [1, 2, 3, 4]; - const getAssign = async () => { await http.get(config.API.probationsGetAssign(assignId.value)).then((res) => { status.value = false; @@ -766,7 +739,9 @@ onMounted(async () => { await getSkill(personalId); await getKnowledge(personalId); await getAssignNew(personalId); - await getAssign(); + if (assignId.value !== undefined) { + await getAssign(); + } }); watch( () => [monthSelect.value, date_start.value], From 45a47f1de45671d74c438cd55bf0be6ad6a53279 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Wed, 30 Aug 2023 09:56:16 +0700 Subject: [PATCH 3/3] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88?= =?UTF-8?q?=E0=B8=A1=20emit=20value=20=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B8=AD?= =?UTF-8?q?=E0=B8=81=E0=B8=AB=E0=B8=99=E0=B9=88=E0=B8=A7=E0=B8=A2=E0=B8=87?= =?UTF-8?q?=E0=B8=B2=E0=B8=99=E0=B8=97=E0=B8=B5=E0=B9=88=E0=B9=81=E0=B8=95?= =?UTF-8?q?=E0=B9=88=E0=B8=87=E0=B8=95=E0=B8=B1=E0=B9=89=E0=B8=87=20-=20?= =?UTF-8?q?=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=99=20select?= =?UTF-8?q?(=E0=B8=94=E0=B9=89=E0=B8=B2=E0=B8=99/=E0=B8=AA=E0=B8=B2?= =?UTF-8?q?=E0=B8=82=E0=B8=B2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../05_placement/components/AppointMent/AppointmentModal.vue | 1 + src/modules/05_placement/components/AppointMent/Main.vue | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/05_placement/components/AppointMent/AppointmentModal.vue b/src/modules/05_placement/components/AppointMent/AppointmentModal.vue index 64d377c5f..834e8bba6 100644 --- a/src/modules/05_placement/components/AppointMent/AppointmentModal.vue +++ b/src/modules/05_placement/components/AppointMent/AppointmentModal.vue @@ -661,6 +661,7 @@ function findByPerson(element: any): any { dense hide-bottom-space lazy-rules + emit-value :options="positionPathSideOptions" v-model="dataForm.positionPathSideId" :label="`${'ด้าน/สาขา'}`" diff --git a/src/modules/05_placement/components/AppointMent/Main.vue b/src/modules/05_placement/components/AppointMent/Main.vue index 3a4c8fca7..9cd80f61a 100644 --- a/src/modules/05_placement/components/AppointMent/Main.vue +++ b/src/modules/05_placement/components/AppointMent/Main.vue @@ -257,7 +257,6 @@ const columns2 = ref([ const openModalTree = (id: string) => { personalId.value = id; - console.log(personalId.value); personal.value = listRecevice.value.filter((e: any) => e.id === id); modalTree.value = true; };