รายการเงินเดือน => ดาวน์โหลไฟล์
This commit is contained in:
parent
b331a79277
commit
dd91af09f3
2 changed files with 24 additions and 3 deletions
|
|
@ -3,8 +3,10 @@ import { ref, onMounted, reactive, computed } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||||
|
|
||||||
/** importType*/
|
/** importType*/
|
||||||
|
import type { DataOption } from "@/modules/13_salary/interface/index/Main";
|
||||||
import type { DataFilter } from "@/modules/13_salary/interface/index/SalaryList";
|
import type { DataFilter } from "@/modules/13_salary/interface/index/SalaryList";
|
||||||
import type {
|
import type {
|
||||||
DataPeriodLatest,
|
DataPeriodLatest,
|
||||||
|
|
@ -18,6 +20,7 @@ import TableTabType2 from "@/modules/13_salary/components/SalaryLists/TableTypeO
|
||||||
/** importStore*/
|
/** importStore*/
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsStore";
|
import { useSalaryListSDataStore } from "@/modules/13_salary/store/SalaryListsStore";
|
||||||
|
import { log } from "console";
|
||||||
|
|
||||||
/** use*/
|
/** use*/
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
@ -259,6 +262,23 @@ function fetchDataPeriodNew() {
|
||||||
store.groupId && fetchDataQuota(store.groupId);
|
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 () => {
|
onMounted(async () => {
|
||||||
await fetchDataQuota(store.groupId);
|
await fetchDataQuota(store.groupId);
|
||||||
await fetchDataPeriod(store.groupId);
|
await fetchDataPeriod(store.groupId);
|
||||||
|
|
@ -330,6 +350,7 @@ onMounted(async () => {
|
||||||
:key="index"
|
:key="index"
|
||||||
clickable
|
clickable
|
||||||
v-close-popup
|
v-close-popup
|
||||||
|
@click="onClickDownload(item)"
|
||||||
>
|
>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label>{{ item.name }}</q-item-label>
|
<q-item-label>{{ item.name }}</q-item-label>
|
||||||
|
|
|
||||||
|
|
@ -160,17 +160,17 @@ function getAgency(id: string) {
|
||||||
* function เรียกข้อมูลหน่ยวงานปจุบัน
|
* function เรียกข้อมูลหน่ยวงานปจุบัน
|
||||||
* @param id revisionId
|
* @param id revisionId
|
||||||
*/
|
*/
|
||||||
function getAgencyPosition(id: string) {
|
async function getAgencyPosition(id: string) {
|
||||||
if (id) {
|
if (id) {
|
||||||
http
|
http
|
||||||
.get(config.API.keycloakPositionByid(id))
|
.get(config.API.keycloakPositionByid(id))
|
||||||
.then((res) => {
|
.then(async (res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
||||||
const position = agencyOptions.value?.find(
|
const position = agencyOptions.value?.find(
|
||||||
(e: DataOption) => e.id === data.rootId
|
(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) {
|
if (agencyFilter.value && roundFilter.value.id && snapFilter.value) {
|
||||||
fetchSalalyPeriod(
|
fetchSalalyPeriod(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue