From 1dec63fdddd6521b1150199d36e88ff58add12df Mon Sep 17 00:00:00 2001 From: Thanit Konmek Date: Fri, 11 Aug 2023 13:29:19 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82?= =?UTF-8?q?=20=E0=B8=82=E0=B8=AD=E0=B9=82=E0=B8=AD=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/05_placement/api.placement.ts | 1 + .../components/Transfer/transferMain.vue | 189 +++++----- .../components/Transfer/transferRegistry.vue | 341 ++++++++++++++++-- .../interface/response/Transfer.ts | 7 + src/modules/05_placement/store.ts | 26 ++ 5 files changed, 447 insertions(+), 117 deletions(-) diff --git a/src/api/05_placement/api.placement.ts b/src/api/05_placement/api.placement.ts index b29f33155..fb6ec2ab0 100644 --- a/src/api/05_placement/api.placement.ts +++ b/src/api/05_placement/api.placement.ts @@ -94,6 +94,7 @@ export default { //tranfer ระบบคำขอโอน transfer, transferId: (id: string) => `${transfer}/${id}`, + transferReport: `${transfer}/report`, transferUser: `${transfer}/user`, transferUserId: (id: string) => `${transfer}/user/${id}`, transferConfirmId: (id: string) => `${transfer}/confirm/${id}`, diff --git a/src/modules/05_placement/components/Transfer/transferMain.vue b/src/modules/05_placement/components/Transfer/transferMain.vue index fb15a19aa..f7e170c96 100644 --- a/src/modules/05_placement/components/Transfer/transferMain.vue +++ b/src/modules/05_placement/components/Transfer/transferMain.vue @@ -4,6 +4,7 @@ import type { QTableProps } from "quasar"; import { useQuasar } from "quasar"; import { useRouter } from "vue-router"; import { useCounterMixin } from "@/stores/mixin"; +import { useTransferDataStore } from "@/modules/05_placement/store"; import http from "@/plugins/http"; import config from "@/app.config"; @@ -13,7 +14,7 @@ import DialogHeader from "@/modules/05_placement/components/PersonalList/DialogH import type { ResponseData } from "@/modules/05_placement/interface/response/Transfer"; -const selected = ref([]); +const selected = ref([]); const checkSelected = computed(() => { if (selected.value.length === 0) { return true; @@ -23,8 +24,10 @@ const checkSelected = computed(() => { const $q = useQuasar(); const router = useRouter(); const mixin = useCounterMixin(); +const transferStore = useTransferDataStore(); const { date2Thai, messageError, showLoader, hideLoader, success } = mixin; +const { statusText } = transferStore; const modal = ref(false); const visibleColumns = ref([ @@ -32,18 +35,18 @@ const visibleColumns = ref([ "fullname", "position", "positionLevel", - "oc", - "agency", - "status", + "organizationPositionOld", + "organization", + "statustext", ]); const visibleColumns2 = ref([ "no", "fullname", "position", "positionLevel", - "oc", - "agency", - "status", + "organizationPositionOld", + "organization", + "statustext", ]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง const filterKeyword = ref(""); const filterKeyword2 = ref(""); @@ -58,53 +61,8 @@ const resetFilter = () => { // router.push("/retirement/resign/"+id); // }; const rows = ref([]); -const rows2 = ref([ - { - personalId: "0a846508-4932-40de-9a9e-5b519492217c", - fullname: "นางสาวอย พชช", - position: "นักบริหาร", - positionLevel: "ต้น", - oc: "สำนักงานคณะกรรมการข้าราชการกรุงเทพมหานคร", - agency: "กลุ่มงานกุมารเวชกรรม", - status: "รออนุมัติ", - }, - { - personalId: "08db721d-add6-47b0-8a13-5f45d106e8d1", - fullname: "นางสาววญ สพ", - position: "นักจัดการงานทั่วไป", - positionLevel: "ปฏิบัติการ", - oc: "กลุ่มงานช่วยนักบริหาร", - agency: "กลุ่มงานข้อมูลเมือง", - status: "รออนุมัติ", - }, - { - personalId: "08db721d-adf2-4842-8056-1abb1539356e", - fullname: "นางสาววญ สพ", - position: "นักจัดการงานทั่วไป", - positionLevel: "ปฏิบัติการ", - oc: "กลุ่มงานช่วยนักบริหาร", - agency: "กลุ่มงานข้อมูลเมือง", - status: "รออนุมัติ", - }, - { - personalId: "08db721d-adff-47b0-8762-41cd5c991001", - fullname: "นางสาววญ สพ", - position: "นักจัดการงานทั่วไป", - positionLevel: "ปฏิบัติการ", - oc: "กลุ่มงานช่วยนักบริหาร", - agency: "กลุ่มงานข้อมูลเมือง", - status: "รออนุมัติ", - }, - { - personalId: "08db721d-ae22-424d-8f4a-87ba30cc3ee7", - fullname: "นางสาววญ สพ", - position: "นักจัดการงานทั่วไป", - positionLevel: "ปฏิบัติการ", - oc: "กลุ่มงานช่วยนักบริหาร", - agency: "กลุ่มงานข้อมูลเมือง", - status: "รออนุมัติ", - }, -]); +const rows2 = ref([]); +const filters = ref([]); const columns = ref([ { name: "no", @@ -143,29 +101,29 @@ const columns = ref([ style: "font-size: 14px", }, { - name: "oc", + name: "organizationPositionOld", align: "left", label: "สังกัด", sortable: true, - field: "oc", + field: "organizationPositionOld", headerStyle: "font-size: 14px", style: "font-size: 14px", }, { - name: "agency", + name: "organization", align: "left", label: "หน่วยงานที่ขอโอนไป", sortable: true, - field: "agency", + field: "organization", headerStyle: "font-size: 14px", style: "font-size: 14px", }, { - name: "status", + name: "statustext", align: "left", label: "สถานะ", sortable: true, - field: "status", + field: "statustext", headerStyle: "font-size: 14px", style: "font-size: 14px", }, @@ -208,29 +166,29 @@ const columns2 = ref([ style: "font-size: 14px", }, { - name: "oc", + name: "organizationPositionOld", align: "left", label: "สังกัด", sortable: true, - field: "oc", + field: "organizationPositionOld", headerStyle: "font-size: 14px", style: "font-size: 14px", }, { - name: "agency", + name: "organization", align: "left", label: "หน่วยงานที่ขอโอนไป", sortable: true, - field: "agency", + field: "organization", headerStyle: "font-size: 14px", style: "font-size: 14px", }, { - name: "status", + name: "statustext", align: "left", label: "สถานะ", sortable: true, - field: "status", + field: "statustext", headerStyle: "font-size: 14px", style: "font-size: 14px", }, @@ -243,6 +201,15 @@ onMounted(async () => { await getData(); }); +const openModalOrder = () => { + openModal(); + const row = filters.value.filter( + (r: ResponseData) => + r.status == "WAITTING" || r.status == "PENDING" || r.status == "APPROVE" + ); + rows2.value = row; +}; + const getData = async () => { showLoader(); await http @@ -254,8 +221,10 @@ const getData = async () => { list.push({ createdAt: new Date(), date: new Date(), + firstName: r.firstName ?? "", id: r.id ?? "", isActive: r.isActive ? r.isActive : false, + lastName: r.lastName ?? "", organization: r.organization ?? "", organizationPositionOld: r.organizationPositionOld ?? "", posNo: r.posNo ?? "", @@ -264,12 +233,18 @@ const getData = async () => { positionLevelOld: r.positionLevelOld ?? "", positionNumberOld: r.positionNumberOld ?? "", positionTypeOld: r.positionTypeOld ?? "", - reason: r.id ?? "", - salary: r.salary !== null ? r.salary : 0, + prefix: r.prefix ?? "", + reason: r.reason ?? "", + salary: r.salary ? r.salary : 0, status: r.status ?? "", + statustext: statusText(r.status ?? ""), + fullname: `${r.prefix ?? ""} ${r.firstName ?? ""} ${ + r.lastName ?? "" + }`, }); }); rows.value = list; + filters.value = list; }) .catch((e) => { messageError($q, e); @@ -278,6 +253,30 @@ const getData = async () => { hideLoader(); }); }; + +const saveOrder = async () => { + const id = selected.value.map((r) => r.id); + const body = { + id, + }; + + showLoader(); + await http + .post(config.API.transferReport, body) + .then((res: any) => { + // const data = res.data.result; + // console.log(data); + success($q, "ส่งไปออกคำสั่งโอนออกสำเร็จ"); + closeModal(); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(async () => { + await getData(); + hideLoader(); + }); +}; @@ -436,8 +445,7 @@ const getData = async () => { :columns="columns2" :rows="rows2" :filter="filterKeyword2" - row-key="personalId" - class="custom-header-table" + row-key="id" :visible-columns="visibleColumns2" selection="multiple" v-model:selected="selected" @@ -450,14 +458,7 @@ const getData = async () => { v-model="scope.selected" /> - + @@ -497,7 +502,7 @@ const getData = async () => { diff --git a/src/modules/05_placement/components/Transfer/transferRegistry.vue b/src/modules/05_placement/components/Transfer/transferRegistry.vue index 2ea3c3c63..81f8d5218 100644 --- a/src/modules/05_placement/components/Transfer/transferRegistry.vue +++ b/src/modules/05_placement/components/Transfer/transferRegistry.vue @@ -10,11 +10,13 @@ class="q-mr-sm" @click="router.go(-1)" /> - รายละเอียดการขอโอนของ {{ name }} + รายละเอียดการขอโอนของ {{ responseData.fullname }}
-
{{ name }}
+
+ {{ responseData.fullname }} +
- + +
@@ -141,6 +147,217 @@
+ + +
+
+ แก้ไขข้อมูลเพื่อลงบัญชีแนบท้าย +
+ +
+ +
+
+ + +
+
+
+ +
+
+
+
+
+ ตำแหน่งและหน่วยงานเดิม +
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+ + + + + +
+
+
+ +
+
+
+
+