From 9955bc4fe0f700e6f309976792598f1695e45bd8 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 28 Feb 2024 14:05:58 +0700 Subject: [PATCH 1/3] =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80?= =?UTF-8?q?=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99=20=3D>=20=E0=B9=80?= =?UTF-8?q?=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1=E0=B8=84=E0=B8=99=E0=B9=80?= =?UTF-8?q?=E0=B8=A5=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=99=E0=B9=80=E0=B8=87?= =?UTF-8?q?=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/13_salary/api.salary.ts | 2 + .../SalaryLists/DialogAddPerson.vue | 303 ++++++++++++++++++ .../components/SalaryLists/TabMain.vue | 9 +- .../components/SalaryLists/TableTypeOther.vue | 37 ++- .../SalaryLists/TableTypePending.vue | 28 +- .../13_salary/interface/index/SalaryList.ts | 8 +- .../13_salary/interface/request/SalaryList.ts | 33 ++ .../interface/response/SalaryList.ts | 33 +- 8 files changed, 426 insertions(+), 27 deletions(-) create mode 100644 src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue create mode 100644 src/modules/13_salary/interface/request/SalaryList.ts diff --git a/src/api/13_salary/api.salary.ts b/src/api/13_salary/api.salary.ts index f835154f9..9af69c3c1 100644 --- a/src/api/13_salary/api.salary.ts +++ b/src/api/13_salary/api.salary.ts @@ -26,4 +26,6 @@ export default { salaryListPeriodQuota: (id: string) => `${salaryPeriod}/quota/${id}`, salaryListPeriodORG: (id: string) => `${salaryPeriod}/org/${id}`, salaryListPeriodProfileById: (id: string) => `${salaryPeriod}/profile/${id}`, + salaryListPerson: `${env.API_URI}/org/profile/salary/gen`, + salaryPeriodProfile: `${salary}/period/org/profile`, }; diff --git a/src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue b/src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue new file mode 100644 index 000000000..5475beac9 --- /dev/null +++ b/src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue @@ -0,0 +1,303 @@ + + + + diff --git a/src/modules/13_salary/components/SalaryLists/TabMain.vue b/src/modules/13_salary/components/SalaryLists/TabMain.vue index d21ade94e..895bc4c80 100644 --- a/src/modules/13_salary/components/SalaryLists/TabMain.vue +++ b/src/modules/13_salary/components/SalaryLists/TabMain.vue @@ -136,7 +136,6 @@ async function fetchDataPeriod(id: string) { .then((res) => { rows.value = res.data.result.data; maxPage.value = Math.ceil(res.data.result.total / formFilter.pageSize); - // maxPage.value = 10; }) .catch((err) => { messageError($q, err); @@ -278,28 +277,28 @@ onMounted(async () => { :rows="rows" v-model:maxPage="maxPage" v-model:formFilter="formFilter" - :updatePagination="updatePagination" + :fetchDataTable="updatePagination" /> diff --git a/src/modules/13_salary/components/SalaryLists/TableTypeOther.vue b/src/modules/13_salary/components/SalaryLists/TableTypeOther.vue index 7716dae31..f944d8da0 100644 --- a/src/modules/13_salary/components/SalaryLists/TableTypeOther.vue +++ b/src/modules/13_salary/components/SalaryLists/TableTypeOther.vue @@ -13,6 +13,7 @@ import type { import type { DataFilter } from "@/modules/13_salary/interface/index/SalaryList"; /** importComponents*/ +import DialogAddPerson from "@/modules/13_salary/components/SalaryLists//DialogAddPerson.vue"; import DialogFormEdit from "@/modules/13_salary/components/SalaryLists/DialogFormEdit.vue"; import DialogMoveGroup from "@/modules/13_salary/components/SalaryLists/DialogMoveGroup.vue"; import DialogMoveLevel from "@/modules/13_salary/components/SalaryLists/DialogMoveLevel.vue"; @@ -36,7 +37,7 @@ const formFilter = defineModel("formFilter", { required: true }); const maxPage = defineModel("maxPage", { required: true }); const props = defineProps({ rows: { type: Array }, - updatePagination: { + fetchDataTable: { type: Function, }, }); @@ -70,11 +71,11 @@ const columns = ref([ style: "font-size: 14px", }, { - name: "posPath", + name: "position", align: "left", label: "ตำแหน่งในสายงาน", sortable: true, - field: "posPath", + field: "position", headerStyle: "font-size: 14px", style: "font-size: 14px", }, @@ -119,7 +120,7 @@ const visibleColumns = ref([ "no", "posNo", "fullName", - "posPath", + "position", "posLevel", "posExecutive", "amount", @@ -127,10 +128,15 @@ const visibleColumns = ref([ ]); /** modal*/ +const modalDialogAddPerson = ref(false); const modalDialogForm = ref(false); const modalDialogMoveGroup = ref(false); const modalDialogMoveLeve = ref(false); +function onClickAddPerson() { + modalDialogAddPerson.value = !modalDialogAddPerson.value; +} + const profileId = ref(""); const amount = ref(0); function onClickEdit(id: string, amountSalary: number) { @@ -156,7 +162,7 @@ function onClickDelete(id: string) { .delete(config.API.salaryListPeriodProfileById(id)) .then(() => { success($q, "ลบข้อมูลสำเร็จ"); - props.updatePagination?.(); + props.fetchDataTable?.(); }) .catch((err) => { messageError($q, err); @@ -168,7 +174,7 @@ function onClickDelete(id: string) { } function updatePagePagination() { - props.updatePagination?.(); + props.fetchDataTable?.(); } function updatePageSizePagination(newPagination: NewPagination) { @@ -178,7 +184,7 @@ function updatePageSizePagination(newPagination: NewPagination) { function searchData() { formFilter.value.page = 1; - props.updatePagination?.(); + props.fetchDataTable?.(); } watch( () => formFilter.value.pageSize, @@ -189,7 +195,7 @@ watch( diff --git a/src/modules/13_salary/components/SalaryLists/TableTypePending.vue b/src/modules/13_salary/components/SalaryLists/TableTypePending.vue index 4081d582e..34832561c 100644 --- a/src/modules/13_salary/components/SalaryLists/TableTypePending.vue +++ b/src/modules/13_salary/components/SalaryLists/TableTypePending.vue @@ -8,6 +8,7 @@ import type { NewPagination } from "@/modules/13_salary/interface/index/Main"; import type { DataFilter } from "@/modules/13_salary/interface/index/SalaryList"; /** importComponents*/ +import DialogAddPerson from "@/modules/13_salary/components/SalaryLists//DialogAddPerson.vue"; import DialogFormEdit from "@/modules/13_salary/components/SalaryLists/DialogFormEdit.vue"; import DialogMoveGroup from "@/modules/13_salary/components/SalaryLists/DialogMoveGroup.vue"; import DialogMoveLevel from "@/modules/13_salary/components/SalaryLists/DialogMoveLevel.vue"; @@ -127,7 +128,7 @@ const formFilter = defineModel("formFilter", { required: true }); const maxPage = defineModel("maxPage", { required: true }); const props = defineProps({ rows: { type: Array }, - updatePagination: { + fetchDataTable: { type: Function, }, maxPage: { @@ -136,6 +137,7 @@ const props = defineProps({ }); /** modal*/ +const modalDialogAddPerson = ref(false); const modalDialogForm = ref(false); const modalDialogMoveGroup = ref(false); const modalDialogMoveLeve = ref(false); @@ -148,6 +150,9 @@ function onClickDelete() { success($q, "ลบข้อมูลสำเร็จ"); }); } +function onClickAddPerson() { + modalDialogAddPerson.value = !modalDialogAddPerson.value; +} function onClickEdit(id: string, amountSalary: number) { profileId.value = id; @@ -166,7 +171,7 @@ function onClickMoveLevel(id: string) { } function updatePagePagination() { - props.updatePagination?.(); + props.fetchDataTable?.(); } function updatePageSizePagination(newPagination: NewPagination) { @@ -176,7 +181,7 @@ function updatePageSizePagination(newPagination: NewPagination) { function searchData() { formFilter.value.page = 1; - props.updatePagination?.(); + props.fetchDataTable?.(); } watch( () => formFilter.value.pageSize, @@ -187,7 +192,7 @@ watch( + + diff --git a/src/modules/13_salary/interface/index/SalaryList.ts b/src/modules/13_salary/interface/index/SalaryList.ts index 0f8d7fa16..4a2767dfd 100644 --- a/src/modules/13_salary/interface/index/SalaryList.ts +++ b/src/modules/13_salary/interface/index/SalaryList.ts @@ -5,4 +5,10 @@ interface DataFilter { type: string; } -export type { DataFilter }; +interface DataFilterPerson { + page: number; + pageSize: number; + keyword: string; +} + +export type { DataFilter, DataFilterPerson }; diff --git a/src/modules/13_salary/interface/request/SalaryList.ts b/src/modules/13_salary/interface/request/SalaryList.ts new file mode 100644 index 000000000..11938e9a5 --- /dev/null +++ b/src/modules/13_salary/interface/request/SalaryList.ts @@ -0,0 +1,33 @@ +interface DataPersonReq { + id: string; + type: string; + amount: number; + child1: string; + child1Id: string; + child2: string; + child2Id: string; + child3: string | null; + child3Id: string | null; + child4: string | null; + child4Id: string | null; + citizenId: string; + firstName: string; + isDuration: boolean; + isPunish: boolean; + isResult: boolean; + isRetired: boolean; + isRetired2: boolean; + lastName: string; + orgShortName: string; + posExecutive: string | null; + posLevel: string; + posMasterNo: number; + posMasterNoPrefix: string; + posMasterNoSuffix: string; + posType: string; + position: string; + prefix: string; + root: string; + rootId: string; +} +export type { DataPersonReq }; diff --git a/src/modules/13_salary/interface/response/SalaryList.ts b/src/modules/13_salary/interface/response/SalaryList.ts index 4f9848b6f..a5c431246 100644 --- a/src/modules/13_salary/interface/response/SalaryList.ts +++ b/src/modules/13_salary/interface/response/SalaryList.ts @@ -11,4 +11,35 @@ interface DataPeriodQuota { chosen: number; //เลือกไปแล้ว remaining: number; //คงเหลือโควตาnumber } -export type { DataPeriodLatest, DataPeriodQuota }; + +interface DataPerson { + amount: number; + child1: string; + child1Id: string; + child2: string; + child2Id: string; + child3: string | null; + child3Id: string | null; + child4: string | null; + child4Id: string | null; + citizenId: string; + firstName: string; + isDuration: boolean; + isPunish: boolean; + isResult: boolean; + isRetired: boolean; + isRetired2: boolean; + lastName: string; + orgShortName: string; + posExecutive: string | null; + posLevel: string; + posMasterNo: number; + posMasterNoPrefix: string; + posMasterNoSuffix: string; + posType: string; + position: string; + prefix: string; + root: string; + rootId: string; +} +export type { DataPeriodLatest, DataPeriodQuota, DataPerson }; 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 2/3] =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80?= =?UTF-8?q?=E0=B8=94=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 @@ From 84978b8ada6ff5382e1622f5ebcf806b32e60552 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Wed, 28 Feb 2024 15:10:09 +0700 Subject: [PATCH 3/3] =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99=E0=B9=80?= =?UTF-8?q?=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/SalaryLists/DialogFormEdit.vue | 11 +---------- .../components/SalaryLists/DialogMoveGroup.vue | 10 +++++++--- .../components/SalaryLists/DialogMoveLevel.vue | 14 +++++++++----- .../13_salary/components/SalaryLists/TabMain.vue | 1 + 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/modules/13_salary/components/SalaryLists/DialogFormEdit.vue b/src/modules/13_salary/components/SalaryLists/DialogFormEdit.vue index b81c553c1..342b1f64d 100644 --- a/src/modules/13_salary/components/SalaryLists/DialogFormEdit.vue +++ b/src/modules/13_salary/components/SalaryLists/DialogFormEdit.vue @@ -34,7 +34,7 @@ function close() { function onSubmit() { dialogConfirm($q, () => { - if (amount.value) { + if (amount.value !== null) { const amountString: string = amount.value.toString(); const body = { profileId: profileId.value, @@ -58,13 +58,6 @@ function onSubmit() { } }); } - -function inputEdit(val: boolean) { - return { - "full-width cursor-pointer inputgreen ": val, - "full-width cursor-pointer inputgreen": !val, - }; -}