From 9cae42bc7d410364e4254ac8cbba96312837c979 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 11 Mar 2025 17:43:20 +0700 Subject: [PATCH 01/23] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A?= =?UTF-8?q?=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5=E0=B8=A2=E0=B8=99?= =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1=E0=B8=95=E0=B8=B7?= =?UTF-8?q?=20=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B8=A1=E0=B8=B9=E0=B8=A5?= =?UTF-8?q?=E0=B8=AA=E0=B9=88=E0=B8=A7=E0=B8=99=E0=B8=95=E0=B8=B1=E0=B8=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/DialogHistory.vue | 34 +- .../components/detail/DialogHistory.vue | 128 +++++ .../detail/PersonalInformation/01_Profile.vue | 135 +---- .../02_NameChangeHistory.vue | 126 ++--- .../detail/PersonalInformation/03_Address.vue | 132 +---- .../PersonalInformation/04_FamilyNew.vue | 221 +++----- .../PersonalInformation/05_Education.vue | 515 ++++-------------- .../PersonalInformation/06_SpecialSkill.vue | 348 ++++-------- .../requestEdit/01_TabInformation.vue | 29 +- .../components/requestEdit/02_TabIDP.vue | 2 +- .../requestEdit/Page02_DetailIDP.vue | 1 - .../interface/request/SpecialSkill.ts | 2 - .../views/requestEditView.vue | 6 +- 13 files changed, 492 insertions(+), 1187 deletions(-) create mode 100644 src/modules/04_registryPerson/components/detail/DialogHistory.vue diff --git a/src/modules/04_registryPerson/components/DialogHistory.vue b/src/modules/04_registryPerson/components/DialogHistory.vue index a7d3f4d95..15d41a880 100644 --- a/src/modules/04_registryPerson/components/DialogHistory.vue +++ b/src/modules/04_registryPerson/components/DialogHistory.vue @@ -33,10 +33,7 @@ const employeeClass = ref( const typeKeyword = ref(""); const Keyword = ref(""); const positionKeyword = ref(""); -const employeeClassOps = ref([ - { id: "officer", name: "ข้าราชการ กทม.สามัญ" }, - { id: "perm", name: "ลูกจ้างประจำ" }, -]); + //ตัวเลือกประเภทการค้นหา const typeKeywordOps = ref([ { id: "no", name: "ตำแหน่งเลขที่" }, @@ -97,14 +94,6 @@ const columns = ref([ ]); const rows = ref([]); -/** function เปลี่ยนประเภท*/ -function changeEmployeeClass() { - typeKeyword.value = ""; - Keyword.value = ""; - positionKeyword.value = ""; - rows.value = []; -} - /** * function ค้นหาประวัติถือครองตำแหน่ง * @param type ประเภทข่าราชการ @@ -186,27 +175,6 @@ function closeDialog() {
- -
+import { ref, watch } from "vue"; +import { useCounterMixin } from "@/stores/mixin"; + +import type { QTableColumn, QTableProps } from "quasar"; + +import DialogHeader from "@/components/DialogHeader.vue"; + +const { onSearchDataTable } = useCounterMixin(); + +const modal = defineModel("modal", { required: true }); +const title = defineModel("title", { required: true }); +const columns = defineModel("columns", { + required: true, +}); +const visibleColumnsMain = defineModel("visibleColumns", { + required: true, +}); + +const props = defineProps({ + fetchData: { type: Function, required: true }, +}); + +const filter = ref(""); +const rows = ref([]); +const dataMain = ref([]); +const visibleColumns = ref([]); +const pagination = ref({ + sortBy: "lastUpdatedAt", +}); + +async function fetchDataTable() { + visibleColumns.value = visibleColumnsMain.value; + const data = await props?.fetchData?.(); + dataMain.value = data; + rows.value = data; +} + +/** ฟังก์ค้นหาข้อมูลรายการประวัติแก้ไขข้อมูลส่วนตัว */ +function serchDataTable() { + rows.value = onSearchDataTable(filter.value, dataMain.value, columns.value); +} + +watch( + () => modal.value, + () => { + if (modal.value) { + fetchDataTable(); + } else { + filter.value = ""; + dataMain.value = []; + rows.value = []; + pagination.value.sortBy = "lastUpdatedAt"; + } + } +); + + + + + diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue index 9915ecf7b..ac0565fcf 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue @@ -1,5 +1,5 @@ @@ -509,7 +478,6 @@ onMounted(async () => { bordered virtual-scroll ref="table" - v-bind="attrs" :rows="rows" :columns="columns" :visible-columns="visibleColumns" diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/03_Address.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/03_Address.vue index 4aa8531f5..ec28446c5 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/03_Address.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/03_Address.vue @@ -9,13 +9,13 @@ import { useAddressDataStore } from "@/modules/04_registryPerson/stores/Address" import http from "@/plugins/http"; import config from "@/app.config"; -import type { QTableProps } from "quasar"; +import type { QTableColumn } from "quasar"; import type { DataOption } from "@/modules/04_registryPerson/interface/index/Main"; import type { ResponseObject } from "@/modules/04_registryPerson/interface/response/Address"; import type { RequestObject } from "@/modules/04_registryPerson/interface/request/Address"; import DialogHeader from "@/components/DialogHeader.vue"; - +import DialogHistory from "@/modules/04_registryPerson/components/detail/DialogHistory.vue"; const $q = useQuasar(); const store = useAddressDataStore(); @@ -36,7 +36,6 @@ const { hideLoader, dialogConfirm, pathRegistryEmp, - onSearchDataTable, } = mixin; /** @@ -81,10 +80,7 @@ const dataLabel = { }; const modalHistory = ref(false); //แสดง Popup ประวัติแก้ไขข้อมูลที่อยู่ -const rowsHistory = ref([]); //ข้อมูลรายการประวัติแก้ไขข้อมูลที่อยู่ -const rowsHistoryMain = ref([]); //ข้อมูลรายการประวัติแก้ไขข้อมูลที่อยู่ -const filterHistory = ref(""); //คำค้นหา -const visibleColumnsHistory = ref([ +const visibleColumnsHistory = ref([ "currentAddress", "currentDistrict", "currentSubDistrict", @@ -99,7 +95,7 @@ const visibleColumnsHistory = ref([ "lastUpdateFullName", "lastUpdatedAt", ]); -const columnsHistory = ref([ +const columnsHistory = ref([ { name: "registrationAddress", align: "left", @@ -252,9 +248,6 @@ const columnsHistory = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, ]); -const pagination = ref({ - sortBy: "lastUpdatedAt", -}); /** * ฟังก์ชันดึงข้อมูลที่อยู่ @@ -470,26 +463,23 @@ function clickClose() { modal.value = false; } -/** - * ฟังก์ชันเปิด popup ประวัติแก้ไขข้อมูลที่อยู่ - * และดึงข้อมูลรายการประวัติแก้ไขข้อมูลที่อยู่ - */ +/** ฟังก์ชันเปิด popup ประวัติแก้ไขข้อมูลที่อยู่*/ async function clickHistory() { - showLoader(); modalHistory.value = true; - filterHistory.value = ""; - await http - .get(config.API.profileNewAddressHisById(profileId.value, empType.value)) - .then(async (res) => { - rowsHistory.value = await res.data.result; - rowsHistoryMain.value = await res.data.result; - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - hideLoader(); - }); +} + +async function fetchDataHistory() { + showLoader(); + try { + const res = await http.get( + config.API.profileNewAddressHisById(profileId.value, empType.value) + ); + const data = res.data.result; + return data; + } catch (err) { + } finally { + hideLoader(); + } } /** @@ -508,15 +498,6 @@ function sameAddressToggle(v: string) { } } -/** ฟังก์ค้นหาข้อมูลรายการประวัติแก้ไขข้อมูลที่อยู่ */ -function serchDataTable() { - rowsHistory.value = onSearchDataTable( - filterHistory.value, - rowsHistoryMain.value, - columnsHistory.value ? columnsHistory.value : [] - ); -} - /** ดูการเปลี่ยนแปลงที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้า*/ watch( () => sameAddress.value, @@ -904,74 +885,13 @@ onMounted(async () => { - - - - - - -
- - - - - -
- - > - - - -
-
-
+ diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/04_FamilyNew.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/04_FamilyNew.vue index efed70aa5..6305f3d9c 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/04_FamilyNew.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/04_FamilyNew.vue @@ -9,7 +9,7 @@ import { useCounterMixin } from "@/stores/mixin"; import http from "@/plugins/http"; import config from "@/app.config"; -import type { QTableProps } from "quasar"; +import type { QTableColumn } from "quasar"; import type { DataOption } from "@/modules/04_registryPerson/interface/index/Main"; import type { FormPerson, @@ -17,6 +17,7 @@ import type { } from "@/modules/04_registryPerson/interface/index/family"; import DialogHeader from "@/components/DialogHeader.vue"; +import DialogHistory from "@/modules/04_registryPerson/components/detail/DialogHistory.vue"; const $q = useQuasar(); const route = useRoute(); @@ -30,7 +31,6 @@ const { messageError, success, pathRegistryEmp, - onSearchDataTable, } = useCounterMixin(); /** props*/ @@ -43,9 +43,7 @@ const profileId = ref( const empType = ref(pathRegistryEmp(route.name?.toString() ?? "")); /** TableHisoty*/ -const rows = ref([]); -const rowsMain = ref([]); -const visibleColumns = ref([ +const visibleColumns = ref([ "statusMarital", "citizenId", "prefix", @@ -57,7 +55,7 @@ const visibleColumns = ref([ "lastUpdateFullName", "lastUpdatedAt", ]); -const columns = ref([ +const columns = ref([ { name: "statusMarital", align: "left", @@ -151,9 +149,6 @@ const columns = ref([ format: (val) => date2Thai(val, false, true), }, ]); -const pagination = ref({ - sortBy: "lastUpdatedAt", -}); /** ข้อมูล*/ const fatherData = reactive({ @@ -190,6 +185,7 @@ const modalHistory = ref(false); const filterHistory = ref(""); const titleForm = ref(""); const typeForm = ref(""); +const historyId = ref(""); const isEdit = ref(false); const childernId = ref(""); @@ -353,7 +349,6 @@ function closeDialog() { fromData.job = ""; fromData.lastNameOld = ""; fromData.statusMarital = ""; - rows.value = []; filterHistory.value = ""; } @@ -418,10 +413,9 @@ function onOpenDialogForm( * @param id */ async function onOpenDialogHistory(type: string, id: string = "") { - modalHistory.value = true; typeForm.value = type; - const historyId = type === "children" ? id : profileId.value; - await fetchHistory(historyId, type); + historyId.value = type === "children" ? id : profileId.value; + modalHistory.value = true; } /** function fetch ข้อมูลความสัมพันธ์ */ @@ -453,59 +447,41 @@ function filterSelectorRelation(val: string, update: Function) { }); } -/** - * function fetch ข้อมูลประวัติการแก้ไขข้อมูล - * @param id - * @param type - */ -async function fetchHistory(id: string, type: string) { +async function fetchDataHistory() { showLoader(); - await http - .get(config.API.profileFamilyHistory(id, empType.value, type)) - .then(async (res) => { - const data = await res.data.result; - rows.value = await data.map((e: any) => ({ - citizenId: e[`${type}CitizenId`], - prefix: e[`${type}Prefix`], - firstName: e[`${type}FirstName`], - lastName: e[`${type}LastName`], - job: e[`${type}Career`], - isLive: e[`${type}Live`], - lastNameOld: - type === "couple" - ? e.coupleLastNameOld - : type === "mother" - ? e.motherLastNameOld - : undefined, - lastUpdateFullName: e.lastUpdateFullName, - lastUpdatedAt: e.lastUpdatedAt, - statusMarital: type === "couple" ? e.relationship : undefined, - })); - rowsMain.value = rows.value; - }) - .catch((err) => { - messageError($q, err); - }) - .finally(() => { - hideLoader(); - }); -} + try { + const res = await http.get( + config.API.profileFamilyHistory( + historyId.value, + empType.value, + typeForm.value + ) + ); -/** ฟังก์ค้นหาข้อมูลรายการประวัติแก้ไขข้อมูล */ -function serchDataTable() { - const baseColumns = - typeForm.value === "couple" - ? columns.value - : typeForm.value === "mother" - ? columns.value?.filter((e) => e.name !== "statusMarital") - : columns.value?.filter( - (e) => e.name !== "lastNameOld" && e.name !== "statusMarital" - ); - rows.value = onSearchDataTable( - filterHistory.value, - rowsMain.value, - baseColumns ? baseColumns : [] - ); + const data = await res.data.result.map((e: any) => ({ + citizenId: e[`${typeForm.value}CitizenId`], + prefix: e[`${typeForm.value}Prefix`], + firstName: e[`${typeForm.value}FirstName`], + lastName: e[`${typeForm.value}LastName`], + job: e[`${typeForm.value}Career`], + isLive: e[`${typeForm.value}Live`], + lastNameOld: + typeForm.value === "couple" + ? e.coupleLastNameOld + : typeForm.value === "mother" + ? e.motherLastNameOld + : undefined, + lastUpdateFullName: e.lastUpdateFullName, + lastUpdatedAt: e.lastUpdatedAt, + statusMarital: typeForm.value === "couple" ? e.relationship : undefined, + })); + + return data; + } catch (err) { + messageError($q, err); + } finally { + hideLoader(); + } } /** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ @@ -1073,100 +1049,29 @@ onMounted(async () => { - - - - - - -
- - - - - -
- - - > - - - -
-
-
+ diff --git a/src/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue b/src/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue index 0dc06d5c4..222fa2033 100644 --- a/src/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue +++ b/src/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue @@ -1,4 +1,3 @@ -div + diff --git a/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue b/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue index e64fa3808..58150d506 100644 --- a/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue +++ b/src/modules/04_registryPerson/components/detail/Achievement/04_DeclarationHonor.vue @@ -9,7 +9,7 @@ import { useCounterMixin } from "@/stores/mixin"; import http from "@/plugins/http"; import config from "@/app.config"; -import type { QTableProps } from "quasar"; +import type { QTableColumn } from "quasar"; import type { RequestItemsObject } from "@/modules/04_registryPerson/interface/request/DeclarationHonor"; import type { DataOption, @@ -18,6 +18,7 @@ import type { import type { ResponseObject } from "@/modules/04_registryPerson/interface/response/DeclarationHonor"; import DialogHeader from "@/components/DialogHeader.vue"; +import DialogHistory from "@/modules/04_registryPerson/components/detail/DialogHistory.vue"; const $q = useQuasar(); const route = useRoute(); @@ -31,6 +32,7 @@ const { dialogConfirm, pathRegistryEmp, onSearchDataTable, + convertDateToAPI, } = mixin; const profileId = ref( @@ -76,10 +78,7 @@ const modeView = ref("table"); //การแสดงผล Table,Card const modalHistory = ref(false); //แสดง popup ประวัติแก้ไข //Table Main -const rows = ref([]); -const rowsMain = ref([]); -const filterSearch = ref(""); -const columns = ref([ +const baseColumns = ref([ { name: "issueDate", align: "left", @@ -88,101 +87,8 @@ const columns = ref([ field: "issueDate", format(val, row) { return row.isDate - ? date2Thai(row.issueDate) - : new Date(row.issueDate).getFullYear() + 543; - }, - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "issuer", - align: "left", - label: "ผู้มีอำนาจลงนาม", - sortable: true, - field: "issuer", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "detail", - align: "left", - label: "รายละเอียด", - sortable: true, - field: "detail", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "refCommandNo", - align: "left", - label: "เลขที่คำสั่ง", - sortable: true, - field: "refCommandNo", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "refCommandDate", - align: "left", - label: "เอกสารอ้างอิง (ลงวันที่)", - sortable: true, - field: "refCommandDate", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (v) => date2Thai(v), - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "lastUpdatedAt", - align: "left", - label: "วันที่แก้ไข", - sortable: true, - field: "lastUpdatedAt", - format: (v) => date2Thai(v, false, true), - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, -]); -const visibleColumns = ref([ - "issuer", - "detail", - "issueDate", - "refCommandNo", - "refCommandDate", - "lastUpdatedAt", -]); -const pagination = ref({ - sortBy: "lastUpdatedAt", -}); - -//Table ประวัติแก้ไข -const rowsHistory = ref([]); -const rowsHistoryMain = ref([]); -const filterHistory = ref(""); -const columnsHistory = ref([ - { - name: "issueDate", - align: "left", - label: "วันที่ได้รับ", - sortable: true, - field: "issueDate", - format(val, row) { - return row.isDate - ? date2Thai(row.issueDate) - : new Date(row.issueDate).getFullYear() + 543; + ? date2Thai(row.issueDate).toString() + : (new Date(row.issueDate).getFullYear() + 543).toString(); }, headerStyle: "font-size: 14px", style: "font-size: 14px", @@ -260,7 +166,7 @@ const columnsHistory = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, ]); -const visibleColumnsHistory = ref([ +const baseVisibleColumns = ref([ "issuer", "detail", "issueDate", @@ -269,6 +175,27 @@ const visibleColumnsHistory = ref([ "lastUpdateFullName", "lastUpdatedAt", ]); + +const rows = ref([]); +const rowsMain = ref([]); +const filterSearch = ref(""); +const columns = ref( + baseColumns.value.filter((e: QTableColumn) => e.name !== "lastUpdateFullName") +); +const visibleColumns = ref( + baseVisibleColumns.value.filter((e: string) => e !== "lastUpdateFullName") +); +const pagination = ref({ + sortBy: "lastUpdatedAt", +}); + +//Table ประวัติแก้ไข +const rowsHistory = ref([]); +const rowsHistoryMain = ref([]); +const filterHistory = ref(""); +const historyId = ref(""); +const columnsHistory = ref(baseColumns.value); +const visibleColumnsHistory = ref(baseVisibleColumns.value); const historyPagination = ref({ sortBy: "lastUpdatedAt", }); @@ -303,7 +230,7 @@ async function addEditData(editStatus: boolean = false) { ? config.API.profileNewHonorById(id.value, empType.value) : config.API.profileNewHonor(empType.value); const method = editStatus ? "patch" : "post"; - const reqBody: RequestItemsObject = { + const reqBody = { ...declHonorForm, isUpload: !isEdit.value ? undefined : isUpload.value, profileEmployeeId: @@ -313,10 +240,10 @@ async function addEditData(editStatus: boolean = false) { isDate: declHonorForm.isDate === "true" ? true : false, issueDate: declHonorForm.isDate === "true" - ? declHonorForm.issueDate - : new Date(`${issueDateYear.value}-01-01`), + ? convertDateToAPI(declHonorForm.issueDate) + : convertDateToAPI(new Date(`${issueDateYear.value}-01-01`)), + refCommandDate: convertDateToAPI(declHonorForm.refCommandDate), }; - try { await http[method](url, reqBody).then(async (res) => { if ((fileUpload.value && id.value) || res.data.result) { @@ -324,7 +251,7 @@ async function addEditData(editStatus: boolean = false) { } }); await fetchData(); - await success($q, "บันทึกข้อมูลสำเร็จ"); + success($q, "บันทึกข้อมูลสำเร็จ"); modal.value = false; } catch (e) { messageError($q, e); @@ -469,15 +396,17 @@ async function clickClose() { /** fetch ช้อมูลประวัติการแก้ไขรายการข้อมูลประกาศเกียรติคุณ*/ async function clickHistory(row: ResponseObject) { + historyId.value = row.id; modalHistory.value = true; - filterSearch.value = ""; +} + +async function fetchDataHistory() { showLoader(); try { const res = await http.get( - config.API.profileNewHonorHisById(row.id, empType.value) + config.API.profileNewHonorHisById(historyId.value, empType.value) ); - rowsHistory.value = res.data.result; - rowsHistoryMain.value = res.data.result; + return res.data.result; } catch (e) { messageError($q, e); } finally { @@ -522,19 +451,12 @@ function serchDataTable() { ); } -function serchDataTableHistory() { - rowsHistory.value = onSearchDataTable( - filterHistory.value, - rowsHistoryMain.value, - columnsHistory.value ? columnsHistory.value : [] - ); -} - /** ทำงานเมื่อ Components ถูกเรียกใช้งาน*/ onMounted(() => { fetchData(); }); + diff --git a/src/modules/04_registryPerson/components/detail/Achievement/05_ResultsPerformance.vue b/src/modules/04_registryPerson/components/detail/Achievement/05_ResultsPerformance.vue index 5d4fb6d09..7fb80f998 100644 --- a/src/modules/04_registryPerson/components/detail/Achievement/05_ResultsPerformance.vue +++ b/src/modules/04_registryPerson/components/detail/Achievement/05_ResultsPerformance.vue @@ -9,7 +9,7 @@ import { useResultsPerformDataStore } from "@/modules/04_registryPerson/stores/R import http from "@/plugins/http"; import config from "@/app.config"; -import type { QTableProps } from "quasar"; +import type { QTableColumn } from "quasar"; import type { RequestItemsObject, DataOptions, @@ -18,6 +18,7 @@ import type { ResponseObject } from "@/modules/04_registryPerson/interface/respo import DialogHeader from "@/components/DialogHeader.vue"; import DialogDevelop from "@/modules/04_registryPerson/components/detail/Achievement/DialogDevelopmance.vue"; +import DialogHistory from "@/modules/04_registryPerson/components/detail/DialogHistory.vue"; const $q = useQuasar(); const route = useRoute(); @@ -33,6 +34,7 @@ const { dialogConfirm, pathRegistryEmp, onSearchDataTable, + convertDateToAPI, } = mixin; const profileId = ref( @@ -80,266 +82,7 @@ const resPerformForm = reactive({ }); //Table ผลการประเมินการปฏิบัติราชการ -const rows = ref([]); -const rowsMain = ref([]); -const filterSearch = ref(""); -const columns = ref([ - { - name: "date", - align: "left", - label: "วันที่ได้รับ", - sortable: true, - field: "date", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (v) => date2Thai(v), - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "year", - align: "left", - label: "ปีงบประมาณ", - sortable: true, - field: "year", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (v) => { - return `${v ? Number(v) + 543 : "-"}`; - }, - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "period", - align: "left", - label: "รอบการประเมิน", - sortable: true, - field: "period", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (v) => { - return ( - periodOp.value.find((item: DataOptions) => item.id === v)?.name || "-" - ); - }, - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "point1Total", - align: "left", - label: "ส่วนที่ 1 (น้ำหนัก)", - sortable: true, - field: "point1Total", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "point1", - align: "left", - label: "ผลประเมินส่วนที่ 1 (คะแนน)", - sortable: true, - field: "point1", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "point2Total", - align: "left", - label: "ส่วนที่ 2 (น้ำหนัก)", - sortable: true, - field: "point2Total", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "point2", - align: "left", - label: "ผลประเมินส่วนที่ 2 (คะแนน)", - sortable: true, - field: "point2", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "pointSumTotal", - align: "left", - label: "ผลรวม (น้ำหนัก)", - sortable: true, - field: "pointSumTotal", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "pointSum", - align: "left", - label: "ผลประเมินรวม (คะแนน)", - sortable: true, - field: "pointSum", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "name", - align: "left", - label: "ผลประเมิน", - sortable: true, - field: "name", - format(val, row) { - return `${textPoint(row.pointSum)} ${textRangePoint(row.pointSum)}`; - }, - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a - .toString() - .localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "lastUpdatedAt", - align: "left", - label: "วันที่แก้ไข", - sortable: true, - field: "lastUpdatedAt", - format: (v) => date2Thai(v, false, true), - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, -]); -const visibleColumns = ref([ - "point1Total", - "year", - "period", - "point1", - "point2Total", - "point2", - "pointSumTotal", - "pointSum", - "name", - "date", - "lastUpdatedAt", -]); -const pagination = ref({ - sortBy: "lastUpdatedAt", -}); - -//Table การพัฒนารายบุคคล (Individual Development Plan) -const rowsPlan = ref([]); -const filterSearchPlan = ref(""); -const columnsPlan = ref([ - { - name: "no", - align: "left", - label: "ลำดับ", - sortable: false, - field: "no", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - format: (v) => date2Thai(v), - }, - { - name: "name", - align: "left", - label: "ความรู้/ทักษะ/สมรรถนะที่ต้องได้รับการพัฒนา", - sortable: false, - field: "name", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "developmentProjects", - align: "left", - label: "วิธีการพัฒนา", - sortable: false, - field: "developmentProjects", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "developmentTarget", - align: "left", - label: "เป้าหมายการพัฒนา", - sortable: false, - field: "developmentTarget", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "developmentResults", - align: "left", - label: "วิธีการวัดผลการพัฒนา", - sortable: false, - field: "developmentResults", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, - { - name: "developmentReport", - align: "left", - label: "รายงานผลการพัฒนา", - sortable: false, - field: "developmentReport", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - sort: (a: string, b: string) => - a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), - }, -]); -const visibleColumnsPlan = ref([ - "no", - "name", - "developmentProjects", - "developmentTarget", - "developmentResults", - "developmentReport", -]); - -//Table ประวัติแก้ไข -const rowsHistory = ref([]); -const rowsHistoryMain = ref([]); -const filterHistory = ref(""); -const columnsHistory = ref([ +const baseColumns = ref([ { name: "date", align: "left", @@ -506,7 +249,7 @@ const columnsHistory = ref([ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, ]); -const visibleColumnsHistory = ref([ +const baseVisibleColumns = ref([ "point1Total", "year", "period", @@ -520,10 +263,106 @@ const visibleColumnsHistory = ref([ "lastUpdateFullName", "lastUpdatedAt", ]); -const historyPagination = ref({ + +const rows = ref([]); +const rowsMain = ref([]); +const filterSearch = ref(""); +const columns = ref( + baseColumns.value.filter((e: QTableColumn) => e.name !== "lastUpdateFullName") +); +const visibleColumns = ref( + baseVisibleColumns.value.filter((e: string) => e !== "lastUpdateFullName") +); +const pagination = ref({ sortBy: "lastUpdatedAt", }); +//Table การพัฒนารายบุคคล (Individual Development Plan) +const rowsPlan = ref([]); +const filterSearchPlan = ref(""); +const columnsPlan = ref([ + { + name: "no", + align: "left", + label: "ลำดับ", + sortable: false, + field: "no", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + format: (v) => date2Thai(v), + }, + { + name: "name", + align: "left", + label: "ความรู้/ทักษะ/สมรรถนะที่ต้องได้รับการพัฒนา", + sortable: false, + field: "name", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "developmentProjects", + align: "left", + label: "วิธีการพัฒนา", + sortable: false, + field: "developmentProjects", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "developmentTarget", + align: "left", + label: "เป้าหมายการพัฒนา", + sortable: false, + field: "developmentTarget", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "developmentResults", + align: "left", + label: "วิธีการวัดผลการพัฒนา", + sortable: false, + field: "developmentResults", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "developmentReport", + align: "left", + label: "รายงานผลการพัฒนา", + sortable: false, + field: "developmentReport", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, +]); +const visibleColumnsPlan = ref([ + "no", + "name", + "developmentProjects", + "developmentTarget", + "developmentResults", + "developmentReport", +]); + +//Table ประวัติแก้ไข +const rowsHistory = ref([]); +const rowsHistoryMain = ref([]); +const historyId = ref(""); +const columnsHistory = ref(baseColumns.value); +const visibleColumnsHistory = ref(baseVisibleColumns.value); + /** fetch รายการข้อมูลผลการประเมินการปฏิบัติราชการ*/ async function fetchData() { if (!profileId.value) return; @@ -585,8 +424,9 @@ async function addEditData(editStatus: boolean = false) { ? config.API.profileNewAssessmentsById(id.value, empType.value) : config.API.profileNewAssessments(empType.value); const method = editStatus ? "patch" : "post"; - const reqBody: RequestItemsObject = { + const reqBody = { ...resPerformForm, + date: convertDateToAPI(resPerformForm.date), period: period.value, year: year.value, profileEmployeeId: @@ -636,16 +476,18 @@ async function clickClose() { /** fetch ช้อมูลประวัติการแก้ไขรายการข้อมูลผลการประเมินการปฏิบัติราชการ*/ async function clickHistory(row: ResponseObject) { + historyId.value = row.id; modalHistory.value = true; - filterSearch.value = ""; +} + +async function fetchDataHistory() { showLoader(); try { const res = await http.get( - config.API.profileNewAssessmentsHisById(row.id, empType.value) + config.API.profileNewAssessmentsHisById(historyId.value, empType.value) ); - rowsHistory.value = res.data.result; - rowsHistoryMain.value = res.data.result; + return res.data.result; } catch (e) { messageError($q, e); } finally { @@ -702,14 +544,6 @@ function serchDataTable() { ); } -function serchDataTableHistory() { - rowsHistory.value = onSearchDataTable( - filterHistory.value, - rowsHistoryMain.value, - columnsHistory.value ? columnsHistory.value : [] - ); -} - watch( () => paginationIdp.value.rowsPerPage, async () => { @@ -1391,78 +1225,13 @@ onMounted(async () => { - - - - - -
- - - - - -
- - > - - - -
-
-
+ Date: Thu, 13 Mar 2025 14:11:05 +0700 Subject: [PATCH 11/23] =?UTF-8?q?=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A?= =?UTF-8?q?=E0=B8=B5=E0=B8=A2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7?= =?UTF-8?q?=E0=B8=B1=E0=B8=95=E0=B8=B4=20=3D=3D>=20=E0=B8=AD=E0=B8=B7?= =?UTF-8?q?=E0=B9=88=E0=B8=99=E0=B9=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detail/Other/01_OtherInformation.vue | 166 ++++++++------ .../Other/01_OtherInformationHistory.vue | 211 ------------------ 2 files changed, 101 insertions(+), 276 deletions(-) delete mode 100644 src/modules/04_registryPerson/components/detail/Other/01_OtherInformationHistory.vue diff --git a/src/modules/04_registryPerson/components/detail/Other/01_OtherInformation.vue b/src/modules/04_registryPerson/components/detail/Other/01_OtherInformation.vue index 6f957d53b..0051c3db2 100644 --- a/src/modules/04_registryPerson/components/detail/Other/01_OtherInformation.vue +++ b/src/modules/04_registryPerson/components/detail/Other/01_OtherInformation.vue @@ -1,6 +1,6 @@ - - From 7e6878a1b2a768449cc65a2a679931c973c50717 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 13 Mar 2025 15:00:02 +0700 Subject: [PATCH 12/23] =?UTF-8?q?=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A?= =?UTF-8?q?=E0=B8=B5=E0=B8=A2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7?= =?UTF-8?q?=E0=B8=B1=E0=B8=95=E0=B8=B4=E0=B8=A5=E0=B8=B9=E0=B8=81=E0=B8=88?= =?UTF-8?q?=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B8=8A=E0=B8=B1=E0=B9=88=E0=B8=A7?= =?UTF-8?q?=E0=B8=84=E0=B8=A3=E0=B8=B2=E0=B8=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detail/Employee/01_DataEmployee.vue | 131 +++-------------- .../detail/Employee/02_Employment.vue | 136 ++++-------------- 2 files changed, 54 insertions(+), 213 deletions(-) diff --git a/src/modules/04_registryPerson/components/detail/Employee/01_DataEmployee.vue b/src/modules/04_registryPerson/components/detail/Employee/01_DataEmployee.vue index 7ae0444c1..8c637bd94 100644 --- a/src/modules/04_registryPerson/components/detail/Employee/01_DataEmployee.vue +++ b/src/modules/04_registryPerson/components/detail/Employee/01_DataEmployee.vue @@ -1,11 +1,12 @@