diff --git a/src/modules/13_salary/components/SalaryLists/TabMain.vue b/src/modules/13_salary/components/SalaryLists/TabMain.vue index 9d5086c1b..b2c19d015 100644 --- a/src/modules/13_salary/components/SalaryLists/TabMain.vue +++ b/src/modules/13_salary/components/SalaryLists/TabMain.vue @@ -3,8 +3,10 @@ import { ref, onMounted, reactive, computed } from "vue"; import { useQuasar } from "quasar"; import http from "@/plugins/http"; import config from "@/app.config"; +import genReportXLSX from "@/plugins/genreportxlsx"; /** importType*/ +import type { DataOption } from "@/modules/13_salary/interface/index/Main"; import type { DataFilter } from "@/modules/13_salary/interface/index/SalaryList"; import type { DataPeriodLatest, @@ -18,6 +20,7 @@ import TableTabType2 from "@/modules/13_salary/components/SalaryLists/TableTypeO /** importStore*/ import { useCounterMixin } from "@/stores/mixin"; import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsStore"; +import { log } from "console"; /** use*/ const $q = useQuasar(); @@ -259,6 +262,23 @@ function fetchDataPeriodNew() { store.groupId && fetchDataQuota(store.groupId); } +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(); + // }); +} + onMounted(async () => { await fetchDataQuota(store.groupId); await fetchDataPeriod(store.groupId); @@ -330,6 +350,7 @@ onMounted(async () => { :key="index" clickable v-close-popup + @click="onClickDownload(item)" > {{ item.name }} diff --git a/src/modules/13_salary/views/salaryLists.vue b/src/modules/13_salary/views/salaryLists.vue index 649e0f5c1..8405caf49 100644 --- a/src/modules/13_salary/views/salaryLists.vue +++ b/src/modules/13_salary/views/salaryLists.vue @@ -160,17 +160,17 @@ function getAgency(id: string) { * function เรียกข้อมูลหน่ยวงานปจุบัน * @param id revisionId */ -function getAgencyPosition(id: string) { +async function getAgencyPosition(id: string) { if (id) { http .get(config.API.keycloakPositionByid(id)) - .then((res) => { + .then(async (res) => { const data = res.data.result; const position = agencyOptions.value?.find( (e: DataOption) => e.id === data.rootId ); - agencyFilter.value = position ? position.id : ""; + agencyFilter.value = await (position ? position.id : ""); if (agencyFilter.value && roundFilter.value.id && snapFilter.value) { fetchSalalyPeriod(