From bf8fb777cf9dc40a7dea8b18216f3b87f39e08f4 Mon Sep 17 00:00:00 2001 From: AnandaTon Date: Fri, 6 Oct 2023 11:13:07 +0700 Subject: [PATCH 1/7] =?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=87=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=99?= =?UTF-8?q?=E0=B9=84=E0=B8=82=20=E0=B9=80=E0=B8=8A=E0=B9=87=E0=B8=84?= =?UTF-8?q?=E0=B8=AB=E0=B8=99=E0=B9=88=E0=B8=A7=E0=B8=A2=E0=B8=87=E0=B8=B2?= =?UTF-8?q?=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/02_organizational/views/MainTreeEmployee.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/modules/02_organizational/views/MainTreeEmployee.vue b/src/modules/02_organizational/views/MainTreeEmployee.vue index 477442124..4f508331a 100644 --- a/src/modules/02_organizational/views/MainTreeEmployee.vue +++ b/src/modules/02_organizational/views/MainTreeEmployee.vue @@ -1394,7 +1394,12 @@ const clickSave = async () => { myForm.value!.validate().then(async (result: boolean) => { if (result) { if (modalEdit.value) { - await editData(); + if (selected.value == null) { + fails($q, "กรุณาเลือกหน่วยงาน"); + } else { + // console.log("save"); + await editData(); + } } else { if (selected.value == "") { fails($q, "กรุณาเลือกหน่วยงาน"); @@ -1402,7 +1407,6 @@ const clickSave = async () => { // console.log("save"); await saveData(); } - // await saveData(); } } }); @@ -1500,6 +1504,7 @@ const editData = async () => { isActive: isActive.value, isCondition: isCondition.value, conditionNote: conditionNote.value, + organizationId: organizationId.value, }) .then((res) => { success($q, "บันทึกข้อมูลร่างสำเร็จ"); From 90a47d43ad6c6647f3c68ff55919d1fecaac5788 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 6 Oct 2023 13:32:54 +0700 Subject: [PATCH 2/7] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84?= =?UTF-8?q?=E0=B8=82=E0=B8=95=E0=B8=B2=E0=B8=A1=20task?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/interface/request/main/main.ts.rej | 134 +++++ .../components/PersonalDetail/ExamResult.vue | 29 +- .../PersonalDetail/Information/Document.vue | 276 ++++++++++ .../FormEvaluation/FormEvaluateAdd.vue | 20 +- .../FormEvaluation/FormEvaluateScoreAdd.vue | 20 +- .../FormEvaluation/FormSaveResultAdd.vue | 20 +- .../FormSaveResultAddCommander.vue | 20 +- .../components/ListRetirement/TableList.vue | 471 ++++++++++++++---- .../components/ListRetirement/popupAdd.vue | 7 +- .../components/resign/ResignByid.vue | 25 +- src/modules/06_retirement/views/Main.vue | 16 +- .../components/1_Work/DialogDetail.vue | 192 +++++++ .../09_leave/components/1_Work/TableList.vue | 320 ++++++++++++ .../components/2_Leave/DetailLeave.vue | 194 ++++++++ .../09_leave/components/2_Leave/TableList.vue | 235 +++++++++ src/modules/09_leave/interface/index/Main.ts | 7 + src/modules/09_leave/router.ts | 49 ++ src/modules/09_leave/stores/LeaveStore.ts | 180 +++++++ src/modules/09_leave/stores/ReportStore.ts | 0 src/modules/09_leave/stores/WorkStore.ts | 64 +++ src/modules/09_leave/views/LeaveListMain.vue | 120 +++++ src/modules/09_leave/views/ReportMain.vue | 9 + src/modules/09_leave/views/WorkingMain.vue | 84 ++++ .../10_order/components/step/step02.vue | 7 +- src/router/index.ts | 2 + src/views/MainLayout.vue | 379 +++++++++++--- 26 files changed, 2652 insertions(+), 228 deletions(-) create mode 100644 src/interface/request/main/main.ts.rej create mode 100644 src/modules/05_placement/components/PersonalDetail/Information/Document.vue create mode 100644 src/modules/09_leave/components/1_Work/DialogDetail.vue create mode 100644 src/modules/09_leave/components/1_Work/TableList.vue create mode 100644 src/modules/09_leave/components/2_Leave/DetailLeave.vue create mode 100644 src/modules/09_leave/components/2_Leave/TableList.vue create mode 100644 src/modules/09_leave/interface/index/Main.ts create mode 100644 src/modules/09_leave/router.ts create mode 100644 src/modules/09_leave/stores/LeaveStore.ts create mode 100644 src/modules/09_leave/stores/ReportStore.ts create mode 100644 src/modules/09_leave/stores/WorkStore.ts create mode 100644 src/modules/09_leave/views/LeaveListMain.vue create mode 100644 src/modules/09_leave/views/ReportMain.vue create mode 100644 src/modules/09_leave/views/WorkingMain.vue diff --git a/src/interface/request/main/main.ts.rej b/src/interface/request/main/main.ts.rej new file mode 100644 index 000000000..a4c8b102d --- /dev/null +++ b/src/interface/request/main/main.ts.rej @@ -0,0 +1,134 @@ +diff a/src/interface/request/main/main.ts b/src/interface/request/main/main.ts (rejected hunks) +@@ -374,104 +374,34 @@ + }, + ], + }, +- // { +- // key: 8, +- // icon: "mdi-medal-outline", +- // activeIcon: "mdi-medal", +- // label: "เครื่องราชฯ", +- // path: "insignia", +- // role: "insignia", +- // children: [ +- // { +- // key: 8.1, +- // label: "เครื่องราชฯ", +- // path: "", +- // role: "insignia", +- // children: [ +- // { +- // label: "รอบการเสนอขอ", +- // path: "insigniaProposals", +- // role: "insignia", +- // }, +- // { +- // label: "จัดการคำขอ", +- // path: "insigniaManage", +- // role: "insignia", +- // }, +- // { +- // label: "บันทึกผลการได้รับพระราช...", +- // path: "insigniaRecord", +- // role: "insignia", +- // }, +- // { +- // label: "บันทึกผลการจ่ายใบกำกับ", +- // path: "VatInsignia", +- // role: "insignia", +- // }, +- +- // { +- // label: "จัดสรรเครื่องราชฯ", +- // path: "insigniaAllocate", +- // role: "insignia", +- // }, +- // { +- // label: "รายงาน", +- // path: "insigniaReport", +- // role: "insignia", +- // }, +- // ], +- // }, +- // { +- // key: 8.2, +- // label: "เหรียญจักรพรรดิมาลา", +- // path: "", +- // role: "coin", +- // children: [ +- // { +- // label: "รอบการเสนอขอ", +- // path: "coinProposals", +- // role: "coin", +- // }, +- // { +- // label: "จัดการคำขอ", +- // path: "coinManage", +- // role: "coin", +- // }, +- // { +- // label: "บันทึกผลการได้รับพระราชทานเหรียญจักรพรรดิมาลา", +- // path: "coinReceive", +- // role: "coin", +- // }, +- // { +- // label: "บันทึกผลการจ่ายใบกำกับ", +- // path: "coinPayment", +- // role: "coin", +- // }, +- // { +- // label: +- // "รายชื่อที่ยื่นคำร้องขอแก้ไขข้อมูลการขอพระราชทานเหรียญจักรพรรดิมาลา", +- // path: "coinRequest", +- // role: "coin", +- // }, +- // // { +- // // label: "ประวัติการยื่นขอ", +- // // path: "coinHistory", +- // // role: "coin", +- // // }, +- // { +- // label: "จัดสรรเหรียญตรา", +- // path: "coinAllocate", +- // role: "coin", +- // }, +- // { +- // label: "รายงาน", +- // path: "coinReport", +- // role: "coin", +- // }, +- // ], +- // }, +- // ], +- // }, ++ { ++ key: 9, ++ icon: "mdi-calendar", ++ activeIcon: "mdi-calendar", ++ label: "การลา", ++ path: "leave", ++ role: "coin", ++ children: [ ++ { ++ key: 9.1, ++ label: "รายการลงเวลาปฏิบัติงาน", ++ path: "/work-list", ++ role: "coin", ++ }, ++ { ++ key: 9.2, ++ label: "รายการลา", ++ path: "/leave-list", ++ role: "coin", ++ }, ++ { ++ key: 9.3, ++ label: "รายงานสถิติ", ++ path: "/statistics-report", ++ role: "coin", ++ }, ++ ], ++ }, + ]); + + const tabList = readonly([ diff --git a/src/modules/05_placement/components/PersonalDetail/ExamResult.vue b/src/modules/05_placement/components/PersonalDetail/ExamResult.vue index ccc34ce31..6ab45326f 100644 --- a/src/modules/05_placement/components/PersonalDetail/ExamResult.vue +++ b/src/modules/05_placement/components/PersonalDetail/ExamResult.vue @@ -67,15 +67,26 @@ const props = defineProps({ -->
-
ผลการสอบ
-
{{ props.data.pass }}
-
ลำดับที่สอบได้
-
- {{ props.data.examNumber }} -
-
จำนวนครั้งที่สมัครสอบ
-
- {{ props.data.examRound }} +
+
+
ผลการสอบ
+
+ {{ props.data.pass ? props.data.pass : "-" }} +
+
+
+
ลำดับที่สอบได้
+
+ {{ props.data.examNumber ? props.data.examNumber : "-" }} +
+
+ +
+
จำนวนครั้งที่สมัครสอบ
+
+ {{ props.data.examRound ? props.data.examRound : "-" }} +
+
diff --git a/src/modules/05_placement/components/PersonalDetail/Information/Document.vue b/src/modules/05_placement/components/PersonalDetail/Information/Document.vue new file mode 100644 index 000000000..45ffeeeb7 --- /dev/null +++ b/src/modules/05_placement/components/PersonalDetail/Information/Document.vue @@ -0,0 +1,276 @@ + + diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateAdd.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateAdd.vue index d4417f4d2..973477ef9 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateAdd.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateAdd.vue @@ -342,8 +342,9 @@ onMounted(async () => { {{ "ครั้งที่ " + round }} - ระหว่างวันที่ - +
+
+
{ :model-value=" start_date != null ? date2Thai(start_date) : null " - :label="`${'ลงวันที่'}`" - :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]" + :label="`${'ระหว่างวันที่'}`" + :rules="[(val) => !!val || `${'กรุณาเลือกวันที่'}`]" > - - ถึงวันที่ - +
+
{ :model-value=" date_finish != null ? date2Thai(date_finish) : null " - :label="`${'ลงวันที่'}`" - :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]" + :label="`${'ถึงวันที่'}`" + :rules="[(val) => !!val || `${'กรุณาเลือกวันที่'}`]" > - +
diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScoreAdd.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScoreAdd.vue index 065c7bfff..07ea731db 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScoreAdd.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormEvaluateScoreAdd.vue @@ -453,8 +453,9 @@ watch(lengthdiscipline_level, (newLength) => { {{ `ครั้งที่ ${evaluate_no}` }} - ระหว่างวันที่ - +
+
+
{ :model-value=" start_date != null ? date2Thai(start_date) : null " - :label="`${'ลงวันที่'}`" - :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]" + :label="`${'ระหว่างวันที่'}`" + :rules="[(val) => !!val || `${'กรุณาเลือกวันที่'}`]" > - - ถึงวันที่ - +
+
{ :model-value=" date_finish != null ? date2Thai(date_finish) : null " - :label="`${'ลงวันที่'}`" - :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]" + :label="`${'ถึงวันที่'}`" + :rules="[(val) => !!val || `${'กรุณาเลือกวันที่'}`]" > - +
diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResultAdd.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResultAdd.vue index 43463ec1d..9e3591197 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResultAdd.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResultAdd.vue @@ -398,8 +398,9 @@ const getBordered = (i: boolean) => { บันทึกผล{{ "ครั้งที่ " + round }} - ระหว่างวันที่ - +
+
+
{ :model-value=" start_date != null ? date2Thai(start_date) : null " - :label="`${'ลงวันที่'}`" - :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]" + :label="`${'ระหว่างวันที่'}`" + :rules="[(val) => !!val || `${'กรุณาเลือกวันที่'}`]" > - - ถึงวันที่ - +
+
{ :model-value=" date_finish != null ? date2Thai(date_finish) : null " - :label="`${'ลงวันที่'}`" - :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]" + :label="`${'ถึงวันที่'}`" + :rules="[(val) => !!val || `${'กรุณาเลือกวันที่'}`]" > - +
diff --git a/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResultAddCommander.vue b/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResultAddCommander.vue index 2b4316d5f..757de2345 100644 --- a/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResultAddCommander.vue +++ b/src/modules/05_placement/components/probation/FormEvaluation/FormSaveResultAddCommander.vue @@ -406,8 +406,9 @@ onMounted(async () => { บันทึกผล{{ "ครั้งที่ " + round }} - ระหว่างวันที่ - +
+
+
{ :model-value=" start_date != null ? date2Thai(start_date) : null " - :label="`${'ลงวันที่'}`" - :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]" + :label="`${'ระหว่างวันที่'}`" + :rules="[(val) => !!val || `${'กรุณาเลือกวันที่'}`]" > - - ถึงวันที่ - +
+
{ :model-value=" date_finish != null ? date2Thai(date_finish) : null " - :label="`${'ลงวันที่'}`" - :rules="[(val) => !!val || `${'กรุณาเลือกลงวันที่'}`]" + :label="`${'ถึงวันที่'}`" + :rules="[(val) => !!val || `${'กรุณาเลือกวันที่'}`]" > - +
diff --git a/src/modules/06_retirement/components/ListRetirement/TableList.vue b/src/modules/06_retirement/components/ListRetirement/TableList.vue index 1f8d1b26b..6964c4136 100644 --- a/src/modules/06_retirement/components/ListRetirement/TableList.vue +++ b/src/modules/06_retirement/components/ListRetirement/TableList.vue @@ -2,7 +2,7 @@ import { ref, onMounted, computed, watch } from "vue"; import AddList from "../ListRetirement/AddList.vue"; import { useCounterMixin } from "@/stores/mixin"; -import { useQuasar } from "quasar"; +import { useQuasar, QForm } from "quasar"; import { useRoute } from "vue-router"; import { useRouter } from "vue-router"; import http from "@/plugins/http"; @@ -21,7 +21,9 @@ const { success, dialogConfirm, dialogRemove, + date2Thai, } = mixin; +const myForm = ref(null); const retireld_params = route.params.retirementId; const modalNote = ref(false); @@ -33,9 +35,9 @@ const filter = ref(""); const statusUpload = ref(); const modalEdit = ref(false); const textReport = ref(""); -const employeeType = ref("OFFICER") +const employeeType = ref("OFFICER"); -const columns = ref([]) +const columns = ref([]); const rows = ref([]); const visibleColumns = ref([ "order", @@ -62,6 +64,7 @@ onMounted(() => { const closeDialog = () => { modalNote.value = false; + modalUpload.value = false; }; const round = ref(); const typeReport = ref(""); @@ -87,10 +90,22 @@ const fecthlistprofile = async (id: string) => { order: e.order, name: e.fullName, organizationOrganization: e.organizationOrganization, - positionEmployeePosition: res.data.result.type == 'OFFICER' ? e.positionType : e.positionEmployeePosition, - positionEmployeeLevel: res.data.result.type == 'OFFICER' ? (e.positionExecutive != null ? e.positionExecutive : "-") : e.positionEmployeeLevel, - positionNumber: res.data.result.type == 'OFFICER' ? e.posNo : e.posNoEmployee, - positionEmployeeGroup: res.data.result.type == 'OFFICER' ? e.position : e.positionEmployeeGroup, + positionEmployeePosition: + res.data.result.type == "OFFICER" + ? e.positionType + : e.positionEmployeePosition, + positionEmployeeLevel: + res.data.result.type == "OFFICER" + ? e.positionExecutive != null + ? e.positionExecutive + : "-" + : e.positionEmployeeLevel, + positionNumber: + res.data.result.type == "OFFICER" ? e.posNo : e.posNoEmployee, + positionEmployeeGroup: + res.data.result.type == "OFFICER" + ? e.position + : e.positionEmployeeGroup, organizationAgency: e.organizationAgency, organizationGovernmentAgency: e.organizationGovernmentAgency, bureau: e.oc, @@ -136,7 +151,10 @@ const fecthlistprofile = async (id: string) => { { name: "positionEmployeeGroup", align: "left", - label: employeeType.value == "OFFICER" ? "ตำแหน่ง (ในสายงาน/ระดับ)" : "กลุ่มงาน", + label: + employeeType.value == "OFFICER" + ? "ตำแหน่ง (ในสายงาน/ระดับ)" + : "กลุ่มงาน", title: employeeType.value == "OFFICER" ? "ตำแหน่ง" : "กลุ่มงาน", subtitle: employeeType.value == "OFFICER" ? "ในสายงาน/ระดับ" : "", field: "positionEmployeeGroup", @@ -146,7 +164,8 @@ const fecthlistprofile = async (id: string) => { { name: "positionEmployeePosition", align: "left", - label: employeeType.value == "OFFICER" ? "ตำแหน่ง (ประเภท)" : "ตำแหน่ง", + label: + employeeType.value == "OFFICER" ? "ตำแหน่ง (ประเภท)" : "ตำแหน่ง", title: employeeType.value == "OFFICER" ? "ตำแหน่ง" : "ตำแหน่ง", subtitle: employeeType.value == "OFFICER" ? "ประเภท" : "", field: "positionEmployeePosition", @@ -156,7 +175,10 @@ const fecthlistprofile = async (id: string) => { { name: "positionEmployeeLevel", align: "left", - label: employeeType.value == "OFFICER" ? "ตำแหน่ง (ทางการบริหาร)" : "ระดับชั้น", + label: + employeeType.value == "OFFICER" + ? "ตำแหน่ง (ทางการบริหาร)" + : "ระดับชั้น", title: employeeType.value == "OFFICER" ? "ตำแหน่ง" : "ระดับชั้น", subtitle: employeeType.value == "OFFICER" ? "ทางการบริหาร" : "", field: "positionEmployeeLevel", @@ -287,25 +309,46 @@ const visibleNote = computed(() => { } }); // อัปโหลดไฟล์ -const uploadFile = async (event: any) => { - showLoader(); - const selectedFile = event; - const formdata = new FormData(); - formdata.append("file", selectedFile); - await http - .put(config.API.fileRetirement(retireld.value.toString()), formdata) - .then(() => { - success($q, "เพิ่มไฟล์สำเร็จ"); - }) - .catch((err) => { - messageError($q, err); - }) - .finally(() => { - fileUpload.value = null; - fecthlistprofile(retireld.value); - fecthCheck(retireld.value); - hideLoader(); +const modalUpload = ref(false); +const signDate = ref(null); +const uploadFile = async (event: any, signDate: any) => { + if (myForm.value !== null) { + myForm.value.validate().then((successmyForm) => { + if (successmyForm) { + dialogConfirm( + $q, + async () => { + showLoader(); + const selectedFile = event; + const formdata = new FormData(); + formdata.append("file", selectedFile); + formdata.append("signDate", signDate); + await http + .put( + config.API.fileRetirement(retireld.value.toString()), + formdata + ) + .then(() => { + success($q, "เพิ่มไฟล์สำเร็จ"); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + fileUpload.value = null; + signDate.value = null; + modalUpload.value = false; + fecthlistprofile(retireld.value); + fecthCheck(retireld.value); + hideLoader(); + }); + }, + "ยืนยันการอัปโหลดเอกสาร", + "ต้องการยืนยันการอัปโหลดเอกสารนี้หรือไม่ ?" + ); + } }); + } }; // downloadAttachment const downloadAttachment = async (type: string, id: string) => { @@ -382,69 +425,159 @@ const paginationLabel = (start: number, end: number, total: number) => { diff --git a/src/modules/09_leave/components/1_Work/TableList.vue b/src/modules/09_leave/components/1_Work/TableList.vue new file mode 100644 index 000000000..7a23e9d18 --- /dev/null +++ b/src/modules/09_leave/components/1_Work/TableList.vue @@ -0,0 +1,320 @@ + + + + + + diff --git a/src/modules/09_leave/components/2_Leave/DetailLeave.vue b/src/modules/09_leave/components/2_Leave/DetailLeave.vue new file mode 100644 index 000000000..d47aaca20 --- /dev/null +++ b/src/modules/09_leave/components/2_Leave/DetailLeave.vue @@ -0,0 +1,194 @@ + + + + diff --git a/src/modules/09_leave/components/2_Leave/TableList.vue b/src/modules/09_leave/components/2_Leave/TableList.vue new file mode 100644 index 000000000..2213b09ba --- /dev/null +++ b/src/modules/09_leave/components/2_Leave/TableList.vue @@ -0,0 +1,235 @@ +q + + + + + diff --git a/src/modules/09_leave/interface/index/Main.ts b/src/modules/09_leave/interface/index/Main.ts new file mode 100644 index 000000000..1a6136942 --- /dev/null +++ b/src/modules/09_leave/interface/index/Main.ts @@ -0,0 +1,7 @@ +interface DataOption { + id: string; + name: string; +} +export type { + DataOption +}; diff --git a/src/modules/09_leave/router.ts b/src/modules/09_leave/router.ts new file mode 100644 index 000000000..936a99a6a --- /dev/null +++ b/src/modules/09_leave/router.ts @@ -0,0 +1,49 @@ + +const workMain = () => import("@/modules/09_leave/views/WorkingMain.vue") +const leaveMain = () => import("@/modules/09_leave/views/LeaveListMain.vue"); +const reportMain = () => import("@/modules/09_leave/views/ReportMain.vue") +const leaveDetail = () => import("@/modules//09_leave/components/2_Leave/DetailLeave.vue") + +export default [ + { + path: "/work-list", + name: "/work-list", + component: workMain, + meta: { + Auth: true, + Key: [9], + Role: "coin", + }, + }, + { + path: "/leave-list", + name: "/leave-list", + component: leaveMain, + meta: { + Auth: true, + Key: [9], + Role: "coin", + }, + }, + { + path: "/leave/detail/:id", + name: "/leave/detail", + component: leaveDetail, + meta: { + Auth: true, + Key: [9], + Role: "coin", + }, + }, + { + path: "/statistics-report", + name: "/statistics-report", + component: reportMain, + meta: { + Auth: true, + Key: [9], + Role: "coin", + }, + }, + +] \ No newline at end of file diff --git a/src/modules/09_leave/stores/LeaveStore.ts b/src/modules/09_leave/stores/LeaveStore.ts new file mode 100644 index 000000000..870b88074 --- /dev/null +++ b/src/modules/09_leave/stores/LeaveStore.ts @@ -0,0 +1,180 @@ +import { defineStore } from "pinia"; +import { ref } from "vue"; +import { useCounterMixin } from "@/stores/mixin"; + +import type { DataOption } from "@/modules/09_leave/interface/index/Main" + + +const mixin = useCounterMixin(); +const { date2Thai, showLoader, hideLoader } = mixin; +export const useLeavelistDataStore = defineStore("leave", () => { + //TABMENU + const tab = ref("1"); + const amounttab1 = ref("") + const amounttab2 = ref("") + //ข้อมูลในตาราง + const mainData = ref([]) + const rows = ref([]) + const loadTable = ref(false) + async function fecthList(data: any) { + let datalist = data.map((e: any) => ({ + leaveType: e.leaveType, + name: e.name, + Date: e.Date, + status: convertSatatus(e.status) + })) + tab.value !== "1" ? mainData.value = datalist : mainData.value = datalist.filter((e: any) => e.status === "อยู่ระหว่างกำเนินการ") + const filteramounttab1 = datalist.filter((e: any) => e.status === "อยู่ระหว่างกำเนินการ") + amounttab1.value = filteramounttab1.length + amounttab2.value = datalist.length + await fetchOption() + await searchDataFn(selectType.value, selectStatus.value) + + + } + //filter table + const selectYear = ref('all') + const selectType = ref('all') + const selectStatus = ref('all') + const optionYear = ref([{ id: "all", name: 'ทั้งหมด' }]) + const optionType = ref([]) + const optionStatus = ref([]) + const optionTypeMain = ref([]) + const optionStatusMain = ref([]) + const filterTable = ref('') + function searchDataFn(type: string, status: string) { + // selectYear.value = selectYear.value || "all" + type = type || "all" + status = status || "all" + // showLoader() + loadTable.value = true + if (selectYear.value == "all" && type == "all" && status == "all") { + rows.value = mainData.value + } else if (selectYear.value !== "all" && type == "all" && status == "all") { + console.log("ค้นหาจากปี"); + } else if (selectYear.value == "all" && type !== "all" && status == "all") { + console.log("ค้นหาจากประเภท"); + rows.value = mainData.value.filter((e: any) => e.leaveType === type) + } else if (selectYear.value == "all" && type == "all" && status !== "all") { + console.log("ค้นหาจากสถานะ"); + rows.value = mainData.value.filter((e: any) => e.status === status) + } else if (selectYear.value !== "all" && type !== "all" && status == "all") { + console.log("ค้นหาจากปีและประเภท"); + } else if (selectYear.value !== "all" && type == "all" && status !== "all") { + console.log("ค้นหาจากปีและสถานะ"); + } else if (selectYear.value == "all" && type !== "all" && status !== "all") { + console.log("ค้นหาจากประเภทและสถานะ"); + rows.value = mainData.value.filter((e: any) => e.leaveType === type && e.status === status) + } else (console.log("ค้นหาจากทั้งหมด")) + setTimeout(function () { + loadTable.value = false + }, 500); + + } + function clearFilter() { + selectYear.value = "all" + selectType.value = "all" + selectStatus.value = "all" + filterTable.value = '' + } + + function fetchOption() { + let data = [] + data = mainData.value + const double_leaveType = [ + ...new Set(data.map((item: any) => item.leaveType)), + ]; + // หา optionType + optionTypeMain.value = [{ id: "all", name: "ทั้งหมด" }]; + for (let i = 1; i <= double_leaveType.length; i++) { + const type = double_leaveType[i - 1]; + if (typeof type === 'string') { + const listtype: DataOption = { + id: type, + name: type, + }; + optionTypeMain.value.push(listtype) + optionType.value = optionTypeMain.value + } + } + // หา optionStatus + const double_status = [ + ...new Set(data.map((item: any) => item.status)), + ]; + optionStatusMain.value = [{ id: "all", name: "ทั้งหมด" }]; + for (let i = 1; i <= double_status.length; i++) { + const status = double_status[i - 1]; + if (typeof status === 'string') { + const liststatus: DataOption = { + id: status, + name: status, + }; + optionStatusMain.value.push(liststatus); + optionStatus.value = optionStatusMain.value + } + } + } + // filter option + function filterOption(val: string, update: any, type: string) { + let data: DataOption[] = [] + let filter: DataOption[] = [] + if (type == "type") { + data = optionTypeMain.value + } else if (type == "status") { + data = optionStatusMain.value + } + if (val == "") { + update(() => { + filter = data; + }); + } else { + update(() => { + filter = data.filter( + (e) => e.name.search(val) !== -1 + ); + }); + } + if (filter) { + if (type == "type") { + optionType.value = filter + } else if (type == "status") { + optionStatus.value = filter + } + } + } + + + // convertSatatus + function convertSatatus(val: string) { + switch (val) { + case "1": + return "ใหม่" + case "2": + return "อยู่ระหว่างกำเนินการ" + case "3": + return "อนุมัติ" + } + } + return { + tab, + amounttab1, + amounttab2, + //ข้อมูลในตาราง + rows, + fecthList, + loadTable, + //filter table + filterTable, + selectYear, + selectType, + selectStatus, + optionYear, + optionType, + optionStatus, + clearFilter, + searchDataFn, + filterOption, + + + }; +}) diff --git a/src/modules/09_leave/stores/ReportStore.ts b/src/modules/09_leave/stores/ReportStore.ts new file mode 100644 index 000000000..e69de29bb diff --git a/src/modules/09_leave/stores/WorkStore.ts b/src/modules/09_leave/stores/WorkStore.ts new file mode 100644 index 000000000..4afc1d769 --- /dev/null +++ b/src/modules/09_leave/stores/WorkStore.ts @@ -0,0 +1,64 @@ +import { defineStore } from "pinia"; +import { ref } from "vue"; +import { useCounterMixin } from "@/stores/mixin"; +const mixin = useCounterMixin(); +const { date2Thai } = mixin; +export const useWorklistDataStore = defineStore("work", () => { + // ข้อมูลในตาราง + const rows = ref([]) + const dataMain = ref([]) + function fecthList(data: any) { + let datalist = data.map((e: any) => ({ + fullName: e.fullName, + timeIn: e.timeIn, + coordinatesIn: e.coordinatesIn, + latIn: e.latIn, + longIn: e.longIn, + timeOut: e.timeOut, + coordinatesOut: e.coordinatesOut, + latOut: e.latOut, + longOut: e.longOut, + status: convertSatatus(e.status) + })) + dataMain.value = datalist + searchDataFn(selectDate.value, selectStatus.value) + } + + //ค้นหาข้อมูล + const filterTable = ref('') + const selectDate = ref(null); + const selectStatus = ref('all') + const optionStatus = ref([{ id: "all", name: 'ทั้งหมด' }, { id: "1", name: 'ลงเวลาเรียบร้อย' }, { id: "2", name: 'สายทำงานครบ' }]) + function searchDataFn(searchDate: any, srarchStatus: any) { + srarchStatus = srarchStatus || "all"; + if (searchDate == null && srarchStatus == "all") { + rows.value = dataMain.value + } else if (searchDate == null && srarchStatus !== "all") { + rows.value = dataMain.value.filter((e: any) => e.status === convertSatatus(srarchStatus)) + } + } + // convertSatatus + function convertSatatus(val: string) { + switch (val) { + case "1": + return "ลงเวลาเรียบร้อย" + case "2": + return "สายทำงานครบ" + default: + return "ยังไม่ได้ลงเวลา" + } + } + return { + //ข้อมูลในตาราง + rows, + fecthList, + //ค้นหาข้อมูล + filterTable, + selectDate, + selectStatus, + optionStatus, + searchDataFn, + convertSatatus + + }; +}) diff --git a/src/modules/09_leave/views/LeaveListMain.vue b/src/modules/09_leave/views/LeaveListMain.vue new file mode 100644 index 000000000..2b5ad6226 --- /dev/null +++ b/src/modules/09_leave/views/LeaveListMain.vue @@ -0,0 +1,120 @@ + + + + diff --git a/src/modules/09_leave/views/ReportMain.vue b/src/modules/09_leave/views/ReportMain.vue new file mode 100644 index 000000000..d57fa0695 --- /dev/null +++ b/src/modules/09_leave/views/ReportMain.vue @@ -0,0 +1,9 @@ + + + + diff --git a/src/modules/09_leave/views/WorkingMain.vue b/src/modules/09_leave/views/WorkingMain.vue new file mode 100644 index 000000000..41bb2331e --- /dev/null +++ b/src/modules/09_leave/views/WorkingMain.vue @@ -0,0 +1,84 @@ + + + + diff --git a/src/modules/10_order/components/step/step02.vue b/src/modules/10_order/components/step/step02.vue index fd1ee484e..3a9c67efd 100644 --- a/src/modules/10_order/components/step/step02.vue +++ b/src/modules/10_order/components/step/step02.vue @@ -665,17 +665,22 @@ const pagination = ref({
-
+
diff --git a/src/router/index.ts b/src/router/index.ts index 908fe50a6..8676b6de3 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -13,6 +13,7 @@ import ModuleRetirement from "@/modules/06_retirement/router"; import ModuleInsignia from "@/modules/07_insignia/router"; import ModuleRegistryEmployee from "@/modules/08_registryEmployee/router"; import ModuleOrder from "@/modules/10_order/router"; +import ModuleLeave from "@/modules/09_leave/router" // TODO: ใช้หรือไม่? import keycloak from "@/plugins/keycloak"; @@ -44,6 +45,7 @@ const router = createRouter({ ...ModuleInsignia, ...ModuleRegistryEmployee, ...ModuleOrder, + ...ModuleLeave ], }, /** diff --git a/src/views/MainLayout.vue b/src/views/MainLayout.vue index a67c7985e..0d72b90a3 100644 --- a/src/views/MainLayout.vue +++ b/src/views/MainLayout.vue @@ -217,7 +217,7 @@ onMounted(async () => { if (keycloak.tokenParsed) { await fetchroleUser(keycloak.tokenParsed.role); } - + await getDataNotification(); myEventHandler(null, false); window.addEventListener("resize", (e: any) => { @@ -440,8 +440,20 @@ const clickDelete = (id: string) => { - - + + @@ -457,11 +469,24 @@ const clickDelete = (id: string) => { --> - + - {{ notiList.length - }} + {{ notiList.length }}
การแจ้งเตือน
@@ -484,8 +509,14 @@ const clickDelete = (id: string) => { date2Thai(n.timereceive) }} - + @@ -509,7 +540,10 @@ const clickDelete = (id: string) => { -
+
@@ -518,7 +552,14 @@ const clickDelete = (id: string) => {
{{ fullname }}
- +
@@ -531,7 +572,13 @@ const clickDelete = (id: string) => { - + {{ op.label @@ -543,8 +590,16 @@ const clickDelete = (id: string) => {
- + @@ -552,47 +607,99 @@ const clickDelete = (id: string) => { - +