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] =?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=20=3D>=20=E0=B9=80=E0=B8=9E?= =?UTF-8?q?=E0=B8=B4=E0=B9=88=E0=B8=A1=E0=B8=84=E0=B8=99=E0=B9=80=E0=B8=A5?= =?UTF-8?q?=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=99=E0=B9=80=E0=B8=87=E0=B8=B4?= =?UTF-8?q?=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 };