From 42badd9978e4db3a8be3fe0904d505b25bb91149 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 28 Feb 2024 14:53:38 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=94?= =?UTF-8?q?=E0=B8=B7=E0=B8=AD=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SalaryLists/DialogAddPerson.vue | 34 ++++++---- .../interface/response/SalaryList.ts | 40 ++++++++++- src/modules/13_salary/views/salaryLists.vue | 67 +++++++++++++------ 3 files changed, 105 insertions(+), 36 deletions(-) diff --git a/src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue b/src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue index 5475beac9..ce110f65f 100644 --- a/src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue +++ b/src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue @@ -11,33 +11,28 @@ import type { DataFilterPerson } from "@/modules/13_salary/interface/index/Salar import type { DataPersonReq } from "@/modules/13_salary/interface/request/SalaryList"; import type { DataPerson } from "@/modules/13_salary/interface/response/SalaryList"; +/** importComponents*/ import Header from "@/components/DialogHeader.vue"; /** importStore*/ import { useCounterMixin } from "@/stores/mixin"; import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsStore"; -const store = useSalaryListSDataStore(); - +/** use*/ const $q = useQuasar(); -const { - date2Thai, - dialogRemove, - messageError, - showLoader, - hideLoader, - dialogConfirm, - success, -} = useCounterMixin(); +const store = useSalaryListSDataStore(); +const { messageError, showLoader, hideLoader, dialogConfirm, success } = + useCounterMixin(); +/** props*/ const modal = defineModel("modal", { required: true }); - const props = defineProps({ fetchData: { type: Function, }, }); +/** Table*/ const columns = ref([ { name: "no", @@ -96,6 +91,7 @@ const columns = ref([ ]); const rows = ref([]); +/** ข้อมูุลค้นหา*/ const formFilter = reactive({ page: 1, pageSize: 10, @@ -103,10 +99,13 @@ const formFilter = reactive({ }); const maxPage = ref(1); +/** function close popup*/ function closeModal() { modal.value = false; + formFilter.page = 1; } +/** function เรียกรายชื่อ คนเลื่อนเงินเดือน*/ async function fetchListPerson() { showLoader(); await http @@ -125,6 +124,10 @@ async function fetchListPerson() { }); } +/** + * function ยืนยันการเพิ่มคนเลื่อนเงินเดือน + * @param data ข้อมูลคนที่เพิ่ม + */ async function onClickAddPerson(data: DataPerson) { const body: DataPersonReq = { id: store.groupId, @@ -154,22 +157,24 @@ async function onClickAddPerson(data: DataPerson) { ); } +/** function updatePage*/ async function updatePagePagination() { fetchListPerson(); } +/** function updatePageSize*/ function updatePageSizePagination(newPagination: NewPagination) { - console.log("teset"); - formFilter.page = 1; formFilter.pageSize = newPagination.rowsPerPage; } +/** function ค้นหาข้อมูลตาม keyword*/ function searchData() { formFilter.page = 1; fetchListPerson(); } +/** callblack function เรียกข้อมูลรายชื่อคนเลื่อนเงินเดือน เมื่อมีการเปิด Popup*/ watch( () => modal.value, async () => { @@ -179,6 +184,7 @@ watch( } ); +/** callblack function เรียกข้อมูลรายชื่อคนเลื่อนเงินเดือน เมื่อมีการเปลี่ยน PageSize*/ watch( () => formFilter.pageSize, () => { diff --git a/src/modules/13_salary/interface/response/SalaryList.ts b/src/modules/13_salary/interface/response/SalaryList.ts index a5c431246..7c8ea0350 100644 --- a/src/modules/13_salary/interface/response/SalaryList.ts +++ b/src/modules/13_salary/interface/response/SalaryList.ts @@ -12,6 +12,38 @@ interface DataPeriodQuota { remaining: number; //คงเหลือโควตาnumber } +interface DataRound { + effectiveDate: string; + id: string; + isActive: boolean; + period: string; + revisionId: string; + status: string; + year: number; +} + +interface DataAgency { + ancestorDNA: string; + createdAt: string; + createdFullName: string; + createdUserId: string; + id: string; + lastUpdateFullName: string; + lastUpdateUserId: string; + lastUpdatedAt: string; + orgChild1s: any[]; + orgRevision: any[]; + orgRevisionId: string; + orgRootCode: string; + orgRootFax: string; + orgRootName: string; + orgRootOrder: number; + orgRootPhoneEx: string; + orgRootPhoneIn: string; + orgRootRank: string; + orgRootShortName: string; +} + interface DataPerson { amount: number; child1: string; @@ -42,4 +74,10 @@ interface DataPerson { root: string; rootId: string; } -export type { DataPeriodLatest, DataPeriodQuota, DataPerson }; +export type { + DataPeriodLatest, + DataPeriodQuota, + DataRound, + DataAgency, + DataPerson, +}; diff --git a/src/modules/13_salary/views/salaryLists.vue b/src/modules/13_salary/views/salaryLists.vue index 809ed54b7..2546c3be7 100644 --- a/src/modules/13_salary/views/salaryLists.vue +++ b/src/modules/13_salary/views/salaryLists.vue @@ -1,42 +1,51 @@