From 8b0eeb5f9536859302efa19e223a49f2af82bec0 Mon Sep 17 00:00:00 2001 From: waruneeta Date: Fri, 8 Mar 2024 09:34:14 +0700 Subject: [PATCH 1/4] salary - get list persons by agency rootId --- .../13_salary/components/SalaryLists/DialogAddPerson.vue | 4 ++++ src/modules/13_salary/interface/index/SalaryList.ts | 1 + src/modules/13_salary/views/salaryLists.vue | 3 +++ 3 files changed, 8 insertions(+) diff --git a/src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue b/src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue index 3985213bb..81ed4e349 100644 --- a/src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue +++ b/src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue @@ -96,6 +96,7 @@ const formFilter = reactive({ page: 1, pageSize: 10, keyword: "", + rootId: "" }); const maxPage = ref(1); @@ -109,6 +110,9 @@ function closeModal() { /** function เรียกรายชื่อ คนเลื่อนเงินเดือน*/ function fetchListPerson() { showLoader(); + console.log(store.rootId); + + formFilter.rootId = store.rootId; http .post(config.API.salaryListPerson, formFilter) .then((res) => { diff --git a/src/modules/13_salary/interface/index/SalaryList.ts b/src/modules/13_salary/interface/index/SalaryList.ts index 4a2767dfd..a490b5dff 100644 --- a/src/modules/13_salary/interface/index/SalaryList.ts +++ b/src/modules/13_salary/interface/index/SalaryList.ts @@ -9,6 +9,7 @@ interface DataFilterPerson { page: number; pageSize: number; keyword: string; + rootId: string; } export type { DataFilter, DataFilterPerson }; diff --git a/src/modules/13_salary/views/salaryLists.vue b/src/modules/13_salary/views/salaryLists.vue index 56c4d262f..554150035 100644 --- a/src/modules/13_salary/views/salaryLists.vue +++ b/src/modules/13_salary/views/salaryLists.vue @@ -168,6 +168,7 @@ async function getAgencyPosition(id: string) { .then(async (res) => { const data = await res.data.result; + store.rootId = data.rootId; const position = agencyOptions.value?.find( (e: DataOption) => e.id === data.rootId ); @@ -256,6 +257,8 @@ async function onChangeSnap() { /** function เปลี่ยนหน่วยงาน*/ async function onChangeAgency() { + store.rootId = agencyFilter.value; + if (agencyFilter.value && roundFilter.value.id && snapFilter.value) { await fetchSalalyPeriod( agencyFilter.value, From 2e0f98448f50dbe3c05323002035b49fcc8d0a22 Mon Sep 17 00:00:00 2001 From: waruneeta Date: Fri, 8 Mar 2024 09:48:49 +0700 Subject: [PATCH 2/4] salary - check isClose round --- .../13_salary/components/SalaryLists/DialogAddPerson.vue | 4 +--- src/modules/13_salary/interface/response/SalaryList.ts | 1 + src/modules/13_salary/store/SalaryListsStore.ts | 2 ++ src/modules/13_salary/views/salaryLists.vue | 7 ++++++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue b/src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue index 81ed4e349..43c04b675 100644 --- a/src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue +++ b/src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue @@ -109,9 +109,7 @@ function closeModal() { /** function เรียกรายชื่อ คนเลื่อนเงินเดือน*/ function fetchListPerson() { - showLoader(); - console.log(store.rootId); - + showLoader(); formFilter.rootId = store.rootId; http .post(config.API.salaryListPerson, formFilter) diff --git a/src/modules/13_salary/interface/response/SalaryList.ts b/src/modules/13_salary/interface/response/SalaryList.ts index d32951527..2f5c3fb0f 100644 --- a/src/modules/13_salary/interface/response/SalaryList.ts +++ b/src/modules/13_salary/interface/response/SalaryList.ts @@ -20,6 +20,7 @@ interface DataRound { revisionId: string; status: string; year: number; + isClose: boolean } interface DataAgency { diff --git a/src/modules/13_salary/store/SalaryListsStore.ts b/src/modules/13_salary/store/SalaryListsStore.ts index 11393fee5..acad72648 100644 --- a/src/modules/13_salary/store/SalaryListsStore.ts +++ b/src/modules/13_salary/store/SalaryListsStore.ts @@ -22,6 +22,7 @@ export const useSalaryListSDataStore = defineStore("salaryListStore", () => { const rootId = ref(""); const roundMainCode = ref(""); const roundCode = ref(""); + const isClosedRound = ref(false); // การปิดรอบ /** List Menu*/ const itemMenu = ref([ { @@ -151,5 +152,6 @@ export const useSalaryListSDataStore = defineStore("salaryListStore", () => { groupOp, roundMainCode, remaining, + isClosedRound }; }); diff --git a/src/modules/13_salary/views/salaryLists.vue b/src/modules/13_salary/views/salaryLists.vue index 554150035..c6c8d7d1a 100644 --- a/src/modules/13_salary/views/salaryLists.vue +++ b/src/modules/13_salary/views/salaryLists.vue @@ -62,6 +62,7 @@ function getRound() { id: x.id, revisionId: x.revisionId, shortCode: x.period, + isClose: x.isClose, name: (x.period === "OCT" ? "รอบตุลาคม " @@ -77,6 +78,7 @@ function getRound() { : ""); store.roundMainCode = roundFilter.value.shortCode; + store.isClosedRound = roundFilter.value.isClose; await getSnap(roundFilter.value.shortCode); await getAgency(roundFilter.value.revisionId); @@ -228,6 +230,9 @@ function fetchSalalyPeriod(rootId: string, periodId: string, snap: string) { /** function เปลี่ยนรอบการขั้นเงินเดือน*/ async function onChangeRound() { + // เก็บสถานะการปิดรอบในตัวแปร isClosedRound เพื่อใช้ในการเช็ค + store.isClosedRound = roundFilter.value.isClose; + await getSnap(roundFilter.value.shortCode); await getAgency(roundFilter.value.revisionId); await getAgencyPosition(roundFilter.value.revisionId); @@ -391,7 +396,7 @@ onMounted(async () => { - + From f06d3174e4e42201d9ebae38e3d5c9e4ec0fc4b8 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Fri, 8 Mar 2024 10:10:34 +0700 Subject: [PATCH 3/4] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A?= =?UTF-8?q?=E0=B8=AB=E0=B8=99=E0=B9=89=E0=B8=B2=E0=B8=A3=E0=B8=B2=E0=B8=A2?= =?UTF-8?q?=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B9=88?= =?UTF-8?q?=E0=B8=AD=E0=B8=99=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=E0=B8=82=E0=B9=89=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=8A=E0=B8=81=E0=B8=B2=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/13_salary/api.salary.ts | 2 + .../SalaryLists/DialogProperties.vue | 176 ++++++++++++++++++ .../SalaryLists/TableTypePending.vue | 139 ++++++++++++-- .../13_salary/store/SalaryListsStore.ts | 2 +- src/modules/13_salary/views/salaryChart.vue | 4 +- 5 files changed, 307 insertions(+), 16 deletions(-) diff --git a/src/api/13_salary/api.salary.ts b/src/api/13_salary/api.salary.ts index 9af69c3c1..7d2d377c2 100644 --- a/src/api/13_salary/api.salary.ts +++ b/src/api/13_salary/api.salary.ts @@ -28,4 +28,6 @@ export default { salaryListPeriodProfileById: (id: string) => `${salaryPeriod}/profile/${id}`, salaryListPerson: `${env.API_URI}/org/profile/salary/gen`, salaryPeriodProfile: `${salary}/period/org/profile`, + + salaryProperty:(id:string)=> `${salaryPeriod}/org/property/${id}`, }; diff --git a/src/modules/13_salary/components/SalaryLists/DialogProperties.vue b/src/modules/13_salary/components/SalaryLists/DialogProperties.vue index e69de29bb..e4dda3aab 100644 --- a/src/modules/13_salary/components/SalaryLists/DialogProperties.vue +++ b/src/modules/13_salary/components/SalaryLists/DialogProperties.vue @@ -0,0 +1,176 @@ + + + + + diff --git a/src/modules/13_salary/components/SalaryLists/TableTypePending.vue b/src/modules/13_salary/components/SalaryLists/TableTypePending.vue index e0672e84b..787a84042 100644 --- a/src/modules/13_salary/components/SalaryLists/TableTypePending.vue +++ b/src/modules/13_salary/components/SalaryLists/TableTypePending.vue @@ -12,6 +12,7 @@ import DialogAddPerson from "@/modules/13_salary/components/SalaryLists//DialogA 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"; +import DialogProperties from "@/modules/13_salary/components/SalaryLists/DialogProperties.vue"; /** importStore*/ import { useCounterMixin } from "@/stores/mixin"; @@ -61,6 +62,24 @@ const columns = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, + { + name: "posType", + align: "left", + label: "ตำแหน่งประเภท", + sortable: true, + field: "posType", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "posExecutive", + align: "left", + label: "ตำแหน่งทางการบริหาร", + sortable: true, + field: "posExecutive", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, { name: "position", align: "left", @@ -70,6 +89,24 @@ const columns = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, + { + name: "posLevel", + align: "left", + label: "ระดับตำแหน่ง", + field: "posLevel", + sortable: true, + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, + { + name: "amount", + align: "left", + label: "เงินเดือน", + field: "amount", + sortable: true, + headerStyle: "font-size: 14px", + style: "font-size: 14px", + }, { name: "organization", align: "left", @@ -98,38 +135,38 @@ const columns = ref([ style: "font-size: 14px", }, { - name: "punish", + name: "isPunish", align: "center", label: "ไม่ถูกลงโทษทางวินัย", sortable: false, - field: "punish", + field: "isPunish", headerStyle: "font-size: 14px", style: "font-size: 14px", }, { - name: "retired", + name: "isSuspension", align: "center", label: "ไม่ถูกพักราชการ", sortable: false, - field: "retired", + field: "isSuspension", headerStyle: "font-size: 14px", style: "font-size: 14px", }, { - name: "retired2", + name: "isAbsent", align: "center", label: "ไม่ขาดราชการ", sortable: false, - field: "retired2", + field: "isAbsent", headerStyle: "font-size: 14px", style: "font-size: 14px", }, { - name: "leave", + name: "isLeave", align: "center", label: "วันลาไม่เกิน", sortable: false, - field: "leave", + field: "isLeave", headerStyle: "font-size: 14px", style: "font-size: 14px", }, @@ -137,14 +174,18 @@ const columns = ref([ const visibleColumns = ref([ "no", "fullName", + "posType", + "posExecutive", "position", + "posLevel", + "amount", "organization", "result", "duration", - "punish", - "retired", - "retired2", - "leave", + "isPunish", + "isSuspension", + "isAbsent", + "isLeave", ]); /** modalDialog*/ @@ -152,11 +193,15 @@ const modalDialogAddPerson = ref(false); const modalDialogForm = ref(false); const modalDialogMoveGroup = ref(false); const modalDialogMoveLeve = ref(false); +const modalDialogProperties = ref(false); /** ตัวแปร*/ const profileId = ref(""); const amount = ref(0); - +const isPunish = ref(false) +const isSuspension = ref(false) +const isAbsent = ref(false) +const isLeave = ref(false) /** * function ยืนยันการลบรายชื่อ * @param id profileId @@ -237,6 +282,15 @@ function searchData() { props.fetchDataTable?.(); } +function onProperties(data:any){ + console.log(data) + modalDialogProperties.value = true + profileId.value = data.id + isPunish.value = data.isPunish + isSuspension.value = data.isSuspension + isAbsent.value = data.isAbsent + isLeave.value = data.isLeave +} /** callblack function เรียกข้อมูลรายชื่อใหม่ เมื่อมีการเปลี่ยน PageSize*/ watch( () => formFilter.value.pageSize, @@ -377,6 +431,54 @@ watch( false /> --> +
+ +
+ {{ props.row.isPunish == null ? '-':''}} +
+
+
+ +
+ {{ props.row.isSuspension == null ? '-':''}} +
+
+
+ +
+ {{ props.row.isAbsent == null ? '-':''}} +
+
+
+ {{Number(props.row.amount).toLocaleString()}} +
+
+ +
+ {{ props.row.isLeave == null ? '-':''}} +
+ +
{{ col.value ? col.value : "-" }}
@@ -410,6 +512,8 @@ watch( ) : item.type === 'delete' ? onClickDelete(props.row.id) + : item.type === 'properties' + ? onProperties(props.row) : null " > @@ -470,6 +574,15 @@ watch( v-model:profileId="profileId" :fetchData="props.fetchDataTable" /> + diff --git a/src/modules/13_salary/store/SalaryListsStore.ts b/src/modules/13_salary/store/SalaryListsStore.ts index 11393fee5..eaca80c1b 100644 --- a/src/modules/13_salary/store/SalaryListsStore.ts +++ b/src/modules/13_salary/store/SalaryListsStore.ts @@ -46,7 +46,7 @@ export const useSalaryListSDataStore = defineStore("salaryListStore", () => { label: "แก้ไขคุณสมบัติ", icon: "mdi-format-list-checks", color: "blue-6", - type: "moveLevel", + type: "properties", }, { label: "ลบ", diff --git a/src/modules/13_salary/views/salaryChart.vue b/src/modules/13_salary/views/salaryChart.vue index 9595ee85b..176711e1d 100644 --- a/src/modules/13_salary/views/salaryChart.vue +++ b/src/modules/13_salary/views/salaryChart.vue @@ -295,13 +295,13 @@ async function filterFn(page: number) { />
-
+
ประเภทตำแหน่ง ระดับตำแหน่ง
-
+
{{ props.row.posType }} {{ props.row.isSpecial ? `${props.row.posLevel} (ฉ)` : `${props.row.posLevel}` }} From 01fcd48b06c23cdc8b1865ad5d7b67e8c130138a Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Fri, 8 Mar 2024 10:26:49 +0700 Subject: [PATCH 4/4] =?UTF-8?q?=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=20icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/13_salary/views/salaryRound.vue | 124 ++++++++++++-------- 1 file changed, 77 insertions(+), 47 deletions(-) diff --git a/src/modules/13_salary/views/salaryRound.vue b/src/modules/13_salary/views/salaryRound.vue index e3ea41081..99776a592 100644 --- a/src/modules/13_salary/views/salaryRound.vue +++ b/src/modules/13_salary/views/salaryRound.vue @@ -161,13 +161,11 @@ function deleteData(id: string) { } function editPopup(data: RowList, status: string) { - console.log(data); if (status == "read") { isRead.value = true; } editCheck.value = true; dialog.value = true; - console.log(dialog.value); idRound.value = data.id; period.value = data.period ? data.period : ""; yearData.value = data.year ? data.year : 0; @@ -382,58 +380,90 @@ onMounted(async () => { {{ col.value }}
- + + + +
+ +
+ {{ + dateToISO(new Date()) >= + dateToISO(props.row.effectiveDate) + ? "ดูข้อมูล" + : "แก้ไขข้อมูล" + }} +
+
+
+
+ + + +
+ +
ปิดรอบ
+
+
+
+ - {{ - dateToISO(new Date()) >= dateToISO(props.row.effectiveDate) - ? "ดูข้อมูล" - : "แก้ไขข้อมูล" - }} -
- - ปิดรอบ - - - ลบข้อมูล + clickable + v-close-popup + @click.stop=" dialogRemove($q, async () => await deleteData(props.row.id))" + > + +
+ +
ลบข้อมูล
+
+
+ + +