From 932a8a930e4b72f436b821dff97695b93b024403 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 3 May 2024 13:24:48 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=9E=E0=B9=89=E0=B8=99=E0=B8=88=E0=B8=B2?= =?UTF-8?q?=E0=B8=81=E0=B8=A3=E0=B8=B2=E0=B8=8A=E0=B8=81=E0=B8=B2=E0=B8=A3?= =?UTF-8?q?=20=3D>=20=E0=B8=96=E0=B8=B6=E0=B8=87=E0=B9=81=E0=B8=81?= =?UTF-8?q?=E0=B9=88=E0=B8=81=E0=B8=A3=E0=B8=A3=E0=B8=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../05_placement/components/Other/Detail.vue | 6 +- .../DismissOrder/DialogSendToCommand.vue | 76 +++-- .../components/DismissOrder/DismissOrder.vue | 137 +++----- .../components/DismissOrder/outRegistry.vue | 310 ++++++------------ .../components/resign/Deceased.vue | 123 ++++--- .../components/resign/DetailDeceased.vue | 122 +++---- .../interface/response/Deceased.ts | 86 +++-- .../interface/response/expulsion.ts | 19 +- 8 files changed, 362 insertions(+), 517 deletions(-) diff --git a/src/modules/05_placement/components/Other/Detail.vue b/src/modules/05_placement/components/Other/Detail.vue index e6bcc14dd..3d5506a0c 100644 --- a/src/modules/05_placement/components/Other/Detail.vue +++ b/src/modules/05_placement/components/Other/Detail.vue @@ -2,7 +2,6 @@ import { onMounted, ref } from "vue"; import { useQuasar } from "quasar"; import { useRoute, useRouter } from "vue-router"; -import { useCounterMixin } from "@/stores/mixin"; import http from "@/plugins/http"; import config from "@/app.config"; import keycloak from "@/plugins/keycloak"; @@ -16,9 +15,14 @@ import type { QForm } from "quasar"; import type { DataProfile } from "@/modules/05_placement/interface/index/Main"; /** importComponents*/ + + import CardProfile from "@/components/CardProfile.vue"; import CurruncyInput from "@/components/CurruncyInput.vue"; +/** importStore*/ +import { useCounterMixin } from "@/stores/mixin"; + /** use*/ const $q = useQuasar(); const route = useRoute(); diff --git a/src/modules/06_retirement/components/DismissOrder/DialogSendToCommand.vue b/src/modules/06_retirement/components/DismissOrder/DialogSendToCommand.vue index dd495caa8..44cc2c50f 100644 --- a/src/modules/06_retirement/components/DismissOrder/DialogSendToCommand.vue +++ b/src/modules/06_retirement/components/DismissOrder/DialogSendToCommand.vue @@ -7,12 +7,21 @@ import type { ResponseItems } from "@/modules/06_retirement/interface/response/M import DialogHeader from "@/modules/06_retirement/components/DialogHeader.vue"; import http from "@/plugins/http"; import config from "@/app.config"; +import { useTransferDataStore } from "@/modules/05_placement/store"; /** use */ const $q = useQuasar(); +const { statusText } = useTransferDataStore(); const selected = ref([]); const mixin = useCounterMixin(); -const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin; +const { + showLoader, + success, + messageError, + dialogConfirm, + hideLoader, + findOrgName, +} = mixin; /** คอลัมน์ */ const columns2 = ref([ @@ -33,6 +42,9 @@ const columns2 = ref([ field: "fullname", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return `${row.prefix}${row.firstName} ${row.lastName}`; + }, }, { name: "position", @@ -46,29 +58,44 @@ const columns2 = ref([ { name: "positionLevel", align: "left", - label: "ระดับ", + label: "ประเภทตำแหน่ง", sortable: true, field: "positionLevel", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + let name = ""; + if (row.posTypeName && row.posLevelName) { + name = `${row.posTypeName} (${row.posLevelName})`; + } else if (row.posTypeName) { + name = `${row.posTypeName}`; + } else if (row.posLevelName) { + name = `(${row.posLevelName})`; + } else name = "-"; + return name; + }, }, { - name: "organizationPositionOld", + name: "org", align: "left", label: "สังกัด", sortable: true, - field: "organizationPositionOld", + field: "org", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return findOrgName(row); + }, }, { - name: "statustext", + name: "status", align: "left", label: "สถานะ", sortable: true, - field: "statustext", + field: "status", headerStyle: "font-size: 14px", style: "font-size: 14px", + format: (val) => statusText(val), }, ]); @@ -78,16 +105,15 @@ const visibleColumns2 = ref([ "fullname", "position", "positionLevel", - "positionNumberOld", - "organizationPositionOld", - "statustext", + "org", + "status", ]); /** props*/ const props = defineProps({ modal: Boolean, closeModal: Function, - getData: Function, + fecthlistRecevice: Function, rows2: Array, filterKeyword2: String, }); @@ -128,7 +154,7 @@ const Ordersave = async () => { messageError($q, e); }) .finally(async () => { - props.getData?.(); + props.fecthlistRecevice?.(); hideLoader(); }); }; @@ -224,31 +250,15 @@ watchEffect(() => { v-model="props.selected" /> - - {{ props.rowIndex + 1 }} - - - {{ props.row.fullname }} - - - {{ props.row.position }} - - - {{ props.row.positionLevel }} - - -
- {{ props.row.organizationPositionOld }} + +
+ {{ props.rowIndex + 1 }}
-
- -
- {{ props.row.organization }} + +
+ {{ col.value ? col.value : "-" }}
- - {{ props.row.statustext }} - diff --git a/src/modules/06_retirement/components/DismissOrder/DismissOrder.vue b/src/modules/06_retirement/components/DismissOrder/DismissOrder.vue index c855856ea..49e0e64a6 100644 --- a/src/modules/06_retirement/components/DismissOrder/DismissOrder.vue +++ b/src/modules/06_retirement/components/DismissOrder/DismissOrder.vue @@ -22,6 +22,7 @@ const { hideLoader, success, dialogMessage, + findOrgName, } = mixin; const { statusText } = transferStore; const modal = ref(false); @@ -32,9 +33,9 @@ const visibleColumns = ref([ "fullname", "position", "positionLevel", - "organizationPositionOld", + "org", "createdAt", - "statustext", + "status", ]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง @@ -64,6 +65,9 @@ const columns = ref([ field: "fullname", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return `${row.prefix}${row.firstName} ${row.lastName}`; + }, }, { name: "position", @@ -77,20 +81,34 @@ const columns = ref([ { name: "positionLevel", align: "left", - label: "ระดับ", + label: "ประเภทตำแหน่ง", sortable: true, field: "positionLevel", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + let name = ""; + if (row.posTypeName && row.posLevelName) { + name = `${row.posTypeName} (${row.posLevelName})`; + } else if (row.posTypeName) { + name = `${row.posTypeName}`; + } else if (row.posLevelName) { + name = `(${row.posLevelName})`; + } else name = "-"; + return name; + }, }, { - name: "organizationPositionOld", + name: "org", align: "left", label: "สังกัด", sortable: true, - field: "organizationPositionOld", + field: "org", headerStyle: "font-size: 14px", style: "font-size: 14px", + format(val, row) { + return findOrgName(row); + }, }, { name: "createdAt", @@ -100,15 +118,17 @@ const columns = ref([ field: "createdAt", headerStyle: "font-size: 14px", style: "font-size: 14px", + format: (val) => date2Thai(val), }, { - name: "statustext", + name: "status", align: "left", label: "สถานะ", sortable: true, - field: "statustext", + field: "status", headerStyle: "font-size: 14px", style: "font-size: 14px", + format: (val) => statusText(val), }, ]); onMounted(async () => { @@ -140,33 +160,8 @@ const getData = async () => { .get(config.API.retirementOut) .then((res: any) => { const data = res.data.result; - let list: ResponseData[] = []; - data.map((r: ResponseData) => { - list.push({ - createdAt: date2Thai(r.createdAt), - date: r.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 ?? "", - position: r.position ?? "", - positionLevel: r.positionLevel ?? "", - positionLevelOld: r.positionLevelOld ?? "", - positionNumberOld: r.positionNumberOld ?? "", - positionTypeOld: r.positionTypeOld ?? "", - 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; + rows.value = data; + filters.value = data; }) .catch((e) => { messageError($q, e); @@ -192,7 +187,7 @@ const clickDelete = async (id: string) => { const deleteData = async (id: string) => { await http .delete(config.API.outByid(id)) - .then((res) => { + .then(() => { success($q, "ลบข้อมูลสำเร็จ"); }) .catch((e) => { @@ -295,70 +290,38 @@ const pagination = ref({