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/DialogAddPerson.vue b/src/modules/13_salary/components/SalaryLists/DialogAddPerson.vue index 3985213bb..43c04b675 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); @@ -108,7 +109,8 @@ function closeModal() { /** function เรียกรายชื่อ คนเลื่อนเงินเดือน*/ function fetchListPerson() { - showLoader(); + showLoader(); + formFilter.rootId = store.rootId; http .post(config.API.salaryListPerson, formFilter) .then((res) => { 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/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/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..2b43dc022 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([ { @@ -46,7 +47,7 @@ export const useSalaryListSDataStore = defineStore("salaryListStore", () => { label: "แก้ไขคุณสมบัติ", icon: "mdi-format-list-checks", color: "blue-6", - type: "moveLevel", + type: "properties", }, { label: "ลบ", @@ -151,5 +152,6 @@ export const useSalaryListSDataStore = defineStore("salaryListStore", () => { groupOp, roundMainCode, remaining, + isClosedRound }; }); 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}` }} diff --git a/src/modules/13_salary/views/salaryLists.vue b/src/modules/13_salary/views/salaryLists.vue index 56c4d262f..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); @@ -168,6 +170,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 ); @@ -227,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); @@ -256,6 +262,8 @@ async function onChangeSnap() { /** function เปลี่ยนหน่วยงาน*/ async function onChangeAgency() { + store.rootId = agencyFilter.value; + if (agencyFilter.value && roundFilter.value.id && snapFilter.value) { await fetchSalalyPeriod( agencyFilter.value, @@ -388,7 +396,7 @@ onMounted(async () => { - + 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))" + > + +
+ +
ลบข้อมูล
+
+
+ + +