diff --git a/src/modules/13_salary/components/SalaryEmployeeLists/TabMain.vue b/src/modules/13_salary/components/SalaryEmployeeLists/TabMain.vue index 56747c560..dae239097 100644 --- a/src/modules/13_salary/components/SalaryEmployeeLists/TabMain.vue +++ b/src/modules/13_salary/components/SalaryEmployeeLists/TabMain.vue @@ -30,6 +30,9 @@ const { messageError, showLoader, hideLoader } = useCounterMixin(); /** props*/ const props = defineProps({ periodLatest: { type: Object as () => DataPeriodLatest, require: true }, + rootId: { type: String, require: true }, + periodId: { type: String, require: true }, + roundFilter: { type: Object, require: true }, }); const total = ref(); @@ -269,17 +272,17 @@ function fetchDataPeriod(id: string) { } /**function เปลี่ยนกลุ่ม*/ -function changeTabGroup() { - formFilter.page = 1; - formFilter.pageSize = 10; - formFilter.keyword = ""; - store.tabType = "PENDING"; - props.periodLatest && - store.fetchPeriodLatest(props?.periodLatest, store.tabGroup); - store.groupId && fetchDataQuota(store.groupId); - store.groupId && fetchDataPeriod(store.groupId); - splitterModel.value = store.roundMainCode === "APR" ? 13 : 16; -} +// function changeTabGroup() { +// formFilter.page = 1; +// formFilter.pageSize = 10; +// formFilter.keyword = ""; +// store.tabType = "PENDING"; +// props.periodLatest && +// store.fetchPeriodLatest(props?.periodLatest, store.tabGroup); +// store.groupId && fetchDataQuota(store.groupId); +// store.groupId && fetchDataPeriod(store.groupId); +// splitterModel.value = store.roundMainCode === "APR" ? 13 : 16; +// } /**function เปลี่ยนขั้น*/ function changeTabType() { @@ -296,20 +299,53 @@ function fetchDataPeriodNew() { } function onClickDownload(data: DataOption) { - console.log(data); - // showLoader(); - // http - // .get(config.API.salaryReportByid(salaryId.value)) - // .then((res) => { - // const dataList = res.data.result; - // genReportXLSX(dataList, "อัตราเงินเดือน"); - // }) - // .catch((e) => { - // messageError($q, e); - // }) - // .finally(() => { - // hideLoader(); - // }); + showLoader(); + if (data.id === "emp-08") { + const formData = { + type: "HAFT", + startDate: + props?.roundFilter?.shortCode === "APR" + ? `${props?.roundFilter?.year - 1}-10-01` + : `${props?.roundFilter?.year}-04-01`, + endDate: + props?.roundFilter?.shortCode === "APR" + ? `${props?.roundFilter?.year}-03-31` + : `${props?.roundFilter?.year}-09-30`, + }; + http + .post(config.API.leaveReportLeaveday("employee"), formData) + .then((res) => { + const dataList = res.data.result; + genReportXLSX(dataList, data.name); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); + } else { + if (props.rootId && props.periodId) { + http + .get( + config.API.salaryReportListsByid( + data.id, + props.rootId, + props.periodId + ) + ) + .then((res) => { + const dataList = res.data.result; + genReportXLSX(dataList, data.name); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); + } + } } const modalDialogInfoCriteria = ref(false); diff --git a/src/modules/13_salary/components/SalaryLists/TabMain.vue b/src/modules/13_salary/components/SalaryLists/TabMain.vue index 6d69d2928..28b8eb96c 100644 --- a/src/modules/13_salary/components/SalaryLists/TabMain.vue +++ b/src/modules/13_salary/components/SalaryLists/TabMain.vue @@ -309,15 +309,16 @@ function fetchDataPeriodNew() { } function onClickDownload(data: DataOption) { + showLoader(); if (data.id === "gov-06") { const formData = { type: "HAFT", startDate: - data.id === "gov-06" + props?.roundFilter?.shortCode === "APR" ? `${props?.roundFilter?.year - 1}-10-01` : `${props?.roundFilter?.year}-04-01`, endDate: - data.id === "gov-06" + props?.roundFilter?.shortCode === "APR" ? `${props?.roundFilter?.year}-03-31` : `${props?.roundFilter?.year}-09-30`, }; @@ -335,7 +336,6 @@ function onClickDownload(data: DataOption) { }); } else { if (props.rootId && props.periodId) { - showLoader(); console.log("id==>", data.id); console.log("rootId==>", props.rootId); console.log("periodId==>", props.periodId); diff --git a/src/modules/13_salary/store/SalaryEmployeeListsStore.ts b/src/modules/13_salary/store/SalaryEmployeeListsStore.ts index 291ec65d5..baa134a7b 100644 --- a/src/modules/13_salary/store/SalaryEmployeeListsStore.ts +++ b/src/modules/13_salary/store/SalaryEmployeeListsStore.ts @@ -64,36 +64,60 @@ export const useSalaryEmployeeListSDataStore = defineStore( /** List Download รายงานของรอบเมษายน*/ const itemDownloadApr = ref([ { - id: "gov-01", - name: "รายชื่อข้าราชการผู้ที่ครองตำแหน่ง ณ วันที่ 1 มีนาคม", + id: "emp-01", + name: "รบัญชีคำนวณโควตา", }, { - id: "gov-02", - name: "บัญชีการคำนวณโควตาเลื่อนเงินเดือน รอบเมษายน", + id: "emp-02", + name: "รายชื่อลูกจ้างประจำผู้ครองตำแหน่ง ณ วันที่ 1 มีนาคม", }, { - id: "gov-03", - name: "รายชื่อข้าราชการที่ได้รับการเสนอขอเลื่อนหนึ่งขั้น", + id: "emp-03", + name: "รายชื่อลูกจ้างประจำที่ได้รับการเสนอขอเลื่อนขั้นค่าจ้างหนึ่งขั้น", }, { - id: "gov-04", - name: "แบบ 1 กท รอบเมษายน", + id: "emp-04", + name: "แบบ ลจ.กทม.1-รายชื่อลูกจ้างผู้สมควรได้เลื่อนขั้นค่าจ้าง", }, { - id: "gov-05", - name: "แบบ 2 กท รอบเมษายน", + id: "emp-05", + name: "แบบ ลจ.กทม.1-1-รายชื่อลูกจ้างผู้สมควรได้รับค่าตอบแทนพิเศษ", }, { - id: "gov-06", - name: "แบบ 3 กท บัญชีแสดงวันลาครึ่งปี ขรก.", + id: "emp-06", + name: "แบบ ลจ.กทม.2-รายชื่อลูกจ้างผู้ไม่สมควรเลื่อนขั้นค่าจ้าง", }, { - id: "gov-07", - name: "คำสั่งเลื่อนเงินเดือน รอบเมษายน", + id: "emp-07", + name: "แบบ ลจ.กทม.2-1-รายชื่อลูกจ้างผู้ไม่สมควรได้รับค่าตอบแทนพิเศษ", }, { - id: "gov-08", - name: "คำสั่งค่าตอบแทนพิเศษ และผู้ไม่ได้เลื่อน รอบเมษายน", + id: "emp-08", + name: "แบบ ลจ.กทม.3-บัญชีแสดงวันลาในครึ่งปีของลูกจ้าง", + }, + { + id: "emp-09", + name: "บัญชีรายชื่อลูกจ้างประจำผู้ไม่ได้รับเลื่อนขั้นค่าจ้างในวันที่ 1 เมษายน ย้อนหลัง 3 ครั้ง ", + }, + { + id: "emp-10", + name: "รายชื่อลูกจ้างประจำผู้มีผลการประเมินดีเด่น", + }, + { + id: "emp-12", + name: "บัญชีรายละเอียดผู้ได้รับอัตราค่าจ้างสูงกว่าขั้นสูง (แนบท้ายคำสั่ง) ", + }, + { + id: "emp-13", + name: "บัญชีรายชื่อลูกจ้างประจำผู้ไม่ได้รับการเลื่อนขั้นค่าจ้าง", + }, + { + id: "emp-15", + name: "บัญชีรายละเอียดลูกจ้างประจำที่ได้รับค่าตอบแทนพิเศษ(แนบท้ายคำสั่ง)", + }, + { + id: "emp-14", + name: "บัญชีรายชื่อลูกจ้างประจำผู้ไม่ได้รับค่าตอบแทนพิเศษ", }, ]); diff --git a/src/modules/13_salary/views/salaryEmployeeLists.vue b/src/modules/13_salary/views/salaryEmployeeLists.vue index 34611c38a..58ea40a5c 100644 --- a/src/modules/13_salary/views/salaryEmployeeLists.vue +++ b/src/modules/13_salary/views/salaryEmployeeLists.vue @@ -64,6 +64,7 @@ function getRound() { revisionId: x.revisionId, shortCode: x.period, isClose: x.isClose, + year: x.year, name: (x.period === "OCT" ? "รอบตุลาคม " @@ -368,7 +369,13 @@ onMounted(() => {
- +