From e03d2a84a58de376add1fbb9f31eb157d1426dcd Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 21 Mar 2025 09:58:16 +0700 Subject: [PATCH] fix --- .../04_registryPerson/interface/index/Edit.ts | 11 +++++ .../interface/request/Edit.ts | 9 ++++ .../interface/response/Edit.ts | 26 ++++++++++ src/modules/04_registryPerson/stores/Edit.ts | 7 --- .../views/edit/components/FormPosition.vue | 16 +++--- .../views/edit/components/Table.vue | 2 +- .../04_registryPerson/views/edit/list.vue | 40 +++++++++------ .../04_registryPerson/views/edit/salary.vue | 49 ++++++++++++++----- 8 files changed, 117 insertions(+), 43 deletions(-) create mode 100644 src/modules/04_registryPerson/interface/index/Edit.ts create mode 100644 src/modules/04_registryPerson/interface/request/Edit.ts create mode 100644 src/modules/04_registryPerson/interface/response/Edit.ts diff --git a/src/modules/04_registryPerson/interface/index/Edit.ts b/src/modules/04_registryPerson/interface/index/Edit.ts new file mode 100644 index 000000000..c30fdac09 --- /dev/null +++ b/src/modules/04_registryPerson/interface/index/Edit.ts @@ -0,0 +1,11 @@ +interface DataProfile { + fullName: string; + position: string; + citizenId: string; + posNo: string; + posType: string; + posLevel: string; + org: string; +} + +export type { DataProfile }; diff --git a/src/modules/04_registryPerson/interface/request/Edit.ts b/src/modules/04_registryPerson/interface/request/Edit.ts new file mode 100644 index 000000000..691adc377 --- /dev/null +++ b/src/modules/04_registryPerson/interface/request/Edit.ts @@ -0,0 +1,9 @@ +interface DataFilter { + status: string; + empType: string; + keyword: string; + page: number; + pageSize: number; +} + +export type { DataFilter }; diff --git a/src/modules/04_registryPerson/interface/response/Edit.ts b/src/modules/04_registryPerson/interface/response/Edit.ts new file mode 100644 index 000000000..f3b8ec70e --- /dev/null +++ b/src/modules/04_registryPerson/interface/response/Edit.ts @@ -0,0 +1,26 @@ +interface DataSalaryPos { + avatar: string; + avatarName: string; + citizenId: string; + firstName: string; + id: string; + lastName: string; + org: string; + orgRevisionId: string; + orgRootShortName: string; + posExecutive: string; + posLevel: string; + posLevelId: string; + posNo: string; + posType: string; + posTypeId: string; + position: string; + prefix: string; + rank: string; + root: string; + rootId: string; + statusCheckEdit: string; + type: string; +} + +export type { DataSalaryPos }; diff --git a/src/modules/04_registryPerson/stores/Edit.ts b/src/modules/04_registryPerson/stores/Edit.ts index 4727c2256..6e05a62a8 100644 --- a/src/modules/04_registryPerson/stores/Edit.ts +++ b/src/modules/04_registryPerson/stores/Edit.ts @@ -1,15 +1,8 @@ import { ref } from "vue"; import { defineStore } from "pinia"; -import { useQuasar } from "quasar"; - -import { useCounterMixin } from "@/stores/mixin"; import type { DataOption } from "@/modules/04_registryPerson/interface/index/Main"; -const $q = useQuasar(); -const mixin = useCounterMixin(); -const {} = mixin; - export const useEditPosDataStore = defineStore("EditPos", () => { const commandCodeData = ref([]); const posTypeData = ref([]); //รายการประเภทตำแหน่ง | กลุ่มงาน diff --git a/src/modules/04_registryPerson/views/edit/components/FormPosition.vue b/src/modules/04_registryPerson/views/edit/components/FormPosition.vue index 3a6f31fe3..7275a9a03 100644 --- a/src/modules/04_registryPerson/views/edit/components/FormPosition.vue +++ b/src/modules/04_registryPerson/views/edit/components/FormPosition.vue @@ -308,7 +308,7 @@ function classInput(val: boolean) { borderless v-model="formData.posNo" hide-bottom-space - :label="empType === '' ? 'เลขที่ตำแหน่ง' : 'ตำแหน่งเลขที่'" + :label="empType === 'officer' ? 'เลขที่ตำแหน่ง' : 'ตำแหน่งเลขที่'" > @@ -323,7 +323,7 @@ function classInput(val: boolean) { lazy-rules borderless v-model="formData.positionName" - :label="empType == '' ? 'ตำแหน่งในสายงาน' : 'ตำแหน่ง'" + :label="empType === 'officer' ? 'ตำแหน่งในสายงาน' : 'ตำแหน่ง'" hide-bottom-space /> @@ -338,7 +338,7 @@ function classInput(val: boolean) { lazy-rules borderless v-model="formData.positionType" - :label="empType == '' ? 'ประเภทตำแหน่ง' : 'กลุ่มงาน'" + :label="empType === 'officer' ? 'ประเภทตำแหน่ง' : 'กลุ่มงาน'" emit-value map-options option-label="name" @@ -374,7 +374,7 @@ function classInput(val: boolean) { lazy-rules borderless v-model="formData.positionLevel" - :label="empType == '' ? 'ระดับตำแหน่ง' : 'ระดับชั้นงาน'" + :label="empType === 'officer' ? 'ระดับตำแหน่ง' : 'ระดับชั้นงาน'" emit-value map-options option-label="name" @@ -396,7 +396,7 @@ function classInput(val: boolean) { -
+
-
+
-
+
-
+
-import { ref, reactive, onMounted, watch, defineAsyncComponent } from "vue"; +import { ref, reactive, onMounted } from "vue"; import { useQuasar } from "quasar"; import http from "@/plugins/http"; @@ -9,20 +9,27 @@ import { useRoute, useRouter } from "vue-router"; /** importType*/ import type { QTableColumn } from "quasar"; +import type { DataStructureTree } from "@/interface/main"; +import type { + DataOption, + Pagination, +} from "@/modules/04_registryPerson/interface/index/Main"; +import type { DataSalaryPos } from "@/modules/04_registryPerson/interface/response/Edit"; +import type { DataFilter } from "@/modules/04_registryPerson/interface/request/Edit"; const $q = useQuasar(); const { showLoader, hideLoader, messageError } = useCounterMixin(); const route = useRoute(); const router = useRouter(); -const organizationOps = ref([]); -const organizationOpsMain = ref([]); -const employeeClassOpsMain = ref([ +const organizationOps = ref([]); +const organizationOpsMain = ref([]); +const employeeClassOpsMain = ref([ { id: "officer", name: "ข้าราชการ กทม.สามัญ" }, { id: "employee", name: "ลูกจ้างประจำ" }, ]); -const employeeClassOps = ref(employeeClassOpsMain.value); -const statusOpsMain = ref([ +const employeeClassOps = ref(employeeClassOpsMain.value); +const statusOpsMain = ref([ { id: "ALL", name: "ทั้งหมด", @@ -40,11 +47,11 @@ const statusOpsMain = ref([ name: "ตรวจสอบแล้ว", }, ]); -const statusOps = ref(statusOpsMain.value); +const statusOps = ref(statusOpsMain.value); //Table const organization = ref(""); -const filter = reactive({ +const filter = reactive({ status: "ALL", empType: "officer", keyword: "", @@ -53,7 +60,7 @@ const filter = reactive({ }); const total = ref(0); const maxPage = ref(0); -const rows = ref([]); +const rows = ref([]); const columns = ref([ { name: "posNo", @@ -174,7 +181,7 @@ function fetchListOrg(id: string) { http .get(config.API.orgByIdSystem(id, route.meta.Key as string)) .then(async (res) => { - const data = await res.data.result.map((item: any) => ({ + const data = await res.data.result.map((item: DataStructureTree) => ({ id: item.orgTreeId, name: item.orgName, })); @@ -200,14 +207,14 @@ function filterSelector(val: string, update: Function, type: string) { case "organization": update(() => { organizationOps.value = organizationOpsMain.value.filter( - (v: any) => v.name.toLowerCase().indexOf(val) > -1 + (v: DataOption) => v.name.toLowerCase().indexOf(val) > -1 ); }); break; case "employeeClass": update(() => { employeeClassOps.value = employeeClassOpsMain.value.filter( - (v: any) => v.name.toLowerCase().indexOf(val) > -1 + (v: DataOption) => v.name.toLowerCase().indexOf(val) > -1 ); }); break; @@ -215,7 +222,7 @@ function filterSelector(val: string, update: Function, type: string) { case "status": update(() => { statusOps.value = statusOpsMain.value.filter( - (v: any) => v.name.toLowerCase().indexOf(val) > -1 + (v: DataOption) => v.name.toLowerCase().indexOf(val) > -1 ); }); break; @@ -271,11 +278,16 @@ function onSearchData(val: boolean = true) { * function เปลี่ยนแถวต่อหน้า * @param newPagination ข้อมูล Pagination */ -function updatePageSize(newPagination: any) { +function updatePageSize(newPagination: Pagination) { filter.pageSize = newPagination.rowsPerPage; onSearchData(); } +/** + * function ไปหน้ารายการประวัติตำแหน่ง/เงินเดือน + * @param id ProfileID + * @param type ประเภทของข้าราชการ + */ function onRedirectToPosition(id: string, type: string) { const tyepeLower = type?.toLocaleLowerCase(); router.push(`/registry/edit/salary/${tyepeLower}/${id}`); diff --git a/src/modules/04_registryPerson/views/edit/salary.vue b/src/modules/04_registryPerson/views/edit/salary.vue index 07f297ed5..4cd5cbf50 100644 --- a/src/modules/04_registryPerson/views/edit/salary.vue +++ b/src/modules/04_registryPerson/views/edit/salary.vue @@ -1,29 +1,35 @@