From 5a0bf37501a12e6913aa687c3c1f4f326d143d56 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Tue, 26 Sep 2023 23:54:26 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=9F=E0=B8=B4?= =?UTF-8?q?=E0=B8=A7=E0=B8=95=E0=B8=B3=E0=B9=81=E0=B8=AB=E0=B8=99=E0=B9=88?= =?UTF-8?q?=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../05_placement/components/Other/Main.vue | 130 +++++++----- .../interface/response/OhterMain.ts | 185 +++++++++--------- 2 files changed, 170 insertions(+), 145 deletions(-) diff --git a/src/modules/05_placement/components/Other/Main.vue b/src/modules/05_placement/components/Other/Main.vue index 6d911817d..f20fe73c5 100644 --- a/src/modules/05_placement/components/Other/Main.vue +++ b/src/modules/05_placement/components/Other/Main.vue @@ -3,20 +3,30 @@ import { ref, onMounted } from "vue"; import { useQuasar } from "quasar"; import { useRouter } from "vue-router"; import { useCounterMixin } from "@/stores/mixin"; -import { useTransferDataStore } from "@/modules/05_placement/store" +import { useTransferDataStore } from "@/modules/05_placement/store"; import type { QTableProps } from "quasar"; -import type { listMain,listMainAPI } from "@/modules/05_placement/interface/response/OhterMain" -import type { OpType } from "@/modules/05_placement/interface/response/Main" +import type { + listMain, + listMainAPI, +} from "@/modules/05_placement/interface/response/OhterMain"; +import type { OpType } from "@/modules/05_placement/interface/response/Main"; import http from "@/plugins/http"; import config from "@/app.config"; -import Dialogbody from "@/modules/05_placement/components/Other/Dialogbody.vue" +import Dialogbody from "@/modules/05_placement/components/Other/Dialogbody.vue"; const storeFn = useTransferDataStore(); const mixin = useCounterMixin(); -const { statusText } = storeFn -const { showLoader, hideLoader, success, messageError, date2Thai, dialogRemove } = mixin; +const { statusText } = storeFn; +const { + showLoader, + hideLoader, + success, + messageError, + date2Thai, + dialogRemove, +} = mixin; const $q = useQuasar(); const router = useRouter(); @@ -36,7 +46,15 @@ const pagination = ref({ page: 1, rowsPerPage: 10, }); -const visibleColumns = ref([ "no", "fullname", "position", "positionLevel", "organizationPositionOld", "createdAt", "statustext"]); +const visibleColumns = ref([ + "no", + "fullname", + "positionPath", + "positionLevel", + "organizationPositionOld", + "createdAt", + "statustext", +]); const columns = ref([ { name: "no", @@ -57,11 +75,11 @@ const columns = ref([ style: "font-size: 14px", }, { - name: "position", + name: "positionPath", align: "left", label: "ตำแหน่งในสายงาน", sortable: true, - field: "position", + field: "positionPath", headerStyle: "font-size: 14px", style: "font-size: 14px", }, @@ -121,6 +139,7 @@ const fecthlistOthet = async () => { organizationPositionOld: r.organizationPositionOld ?? "-", posNo: r.posNo ?? "-", position: r.position ?? "-", + positionPath: r.positionPath ?? "-", positionLevel: r.positionLevel ?? "-", positionLevelOld: r.positionLevelOld ?? "-", positionNumberOld: r.positionNumberOld ?? "-", @@ -133,8 +152,7 @@ const fecthlistOthet = async () => { fullname: `${r.prefix ?? ""}${r.firstname ?? ""} ${r.lastname ?? ""}`, })); rows2.value = rows.value.filter( - (e: listMain) => - e.status !== "REPORT" && e.status !== "DONE" + (e: listMain) => e.status !== "REPORT" && e.status !== "DONE" ); }) .catch((e) => { @@ -152,7 +170,8 @@ const fecthTypeOption = async () => { .get(config.API.typeOrder()) .then((res) => { optionsType.value = res.data.result.filter( - (e: OpType) => e.commandCode === "C-PM-08" || e.commandCode === "C-PM-09" + (e: OpType) => + e.commandCode === "C-PM-08" || e.commandCode === "C-PM-09" ); }) .catch((e) => { @@ -179,7 +198,6 @@ const deleteOther = async (id: string) => { }); }; - //----(รีเซ็ตข้อมูลในช่อง input)------// const resetFilter = () => { filterKeyword.value = ""; @@ -187,7 +205,6 @@ const resetFilter = () => { filterRef.value.focus(); }; - //----(เปิด Dialog)------// const popup = () => { modal.value = true; @@ -222,39 +239,52 @@ onMounted(() => {
- + ส่งไปออกคำสั่งรายการอื่นๆ - + - + />
@@ -286,8 +316,8 @@ onMounted(() => { {{ props.row.fullname }} - - {{ props.row.position }} + + {{ props.row.positionPath }} {{ props.row.positionLevel }} @@ -331,14 +361,14 @@ onMounted(() => {
- + diff --git a/src/modules/05_placement/interface/response/OhterMain.ts b/src/modules/05_placement/interface/response/OhterMain.ts index 9e5edd47e..b67887d09 100644 --- a/src/modules/05_placement/interface/response/OhterMain.ts +++ b/src/modules/05_placement/interface/response/OhterMain.ts @@ -1,104 +1,99 @@ // ข้อมูลที่เก็บ interface listMain { - personalId:string - fullname:string - prefix:string - firstName:string - lastName:string - date:Date - isActive:boolean - organization:string - organizationPositionOld:string - posNo:string - position:string - positionLevel:string - positionLevelOld:string - positionNumberOld:string - positionTypeOld:string - reason:string - salary:number - status:string - statustext:string - createdAt:Date + personalId: string; + fullname: string; + prefix: string; + firstName: string; + lastName: string; + date: Date; + isActive: boolean; + organization: string; + organizationPositionOld: string; + posNo: string; + position: string; + positionLevel: string; + positionLevelOld: string; + positionNumberOld: string; + positionTypeOld: string; + reason: string; + salary: number; + status: string; + statustext: string; + createdAt: Date; } //ข้อมูลจาก api interface listMainAPI { - id:string - firstname:string - prefix:string - firstName:string - lastname:string - date:Date - isActive:boolean - organization:string - organizationPositionOld:string - posNo:string - position:string - positionLevel:string - positionLevelOld:string - positionNumberOld:string - positionTypeOld:string - reason:string - salary:number - status:string - statustext:string - createdAt:Date + id: string; + firstname: string; + prefix: string; + firstName: string; + lastname: string; + date: Date; + isActive: boolean; + organization: string; + organizationPositionOld: string; + positionPath: string; + posNo: string; + position: string; + positionLevel: string; + positionLevelOld: string; + positionNumberOld: string; + positionTypeOld: string; + reason: string; + salary: number; + status: string; + statustext: string; + createdAt: Date; } interface OtherdataInterface { - citizenId: string; - prefixId: string; - firstname: string; - lastname: string; - } + citizenId: string; + prefixId: string; + firstname: string; + lastname: string; +} - interface resApiData { - data:{ - result:{ - id: string - profileId: string - citizenId: string - prefix: string - prefixId: string - firstname: string - lastname: string - dateOfBirth: Date - gender: string - nationality: string - race: string - religion: string - bloodGroup: string - relationship: string - telephoneNumber: string - status: string - amount: number - recruitDate: Date - posNoId: string - positionId: string - positionPathSideId: string - positionTypeId: string - positionLineId: string - positionLevelId: string - organizationPositionId: string - createdAt: Date - reason: string - educationOld: string - amountOld: number - positionTypeOld: string - positionLevelOld: string - positionNumberOld: string - organizationPositionOld: string - positionDate: Date - avatar: string - commandType: string - } - } - } - -export type { - listMain, - listMainAPI, - OtherdataInterface, - resApiData - -} \ No newline at end of file +interface resApiData { + data: { + result: { + id: string; + profileId: string; + citizenId: string; + prefix: string; + prefixId: string; + firstname: string; + lastname: string; + dateOfBirth: Date; + gender: string; + nationality: string; + race: string; + religion: string; + bloodGroup: string; + relationship: string; + telephoneNumber: string; + status: string; + amount: number; + recruitDate: Date; + posNoId: string; + positionId: string; + positionPathSideId: string; + positionTypeId: string; + positionLineId: string; + positionLevelId: string; + organizationPositionId: string; + createdAt: Date; + reason: string; + educationOld: string; + amountOld: number; + positionTypeOld: string; + positionLevelOld: string; + positionNumberOld: string; + organizationPositionOld: string; + positionDate: Date; + avatar: string; + commandType: string; + }; + }; +} + +export type { listMain, listMainAPI, OtherdataInterface, resApiData };