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/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 eaca80c1b..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([ { @@ -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 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 () => { - +