This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-07-15 11:10:55 +07:00
parent 1dbc40ddfb
commit 65cc0d0816
6 changed files with 34 additions and 30 deletions

View file

@ -1,4 +1,3 @@
div
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, watch } from "vue"; import { ref, onMounted, watch } from "vue";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
@ -174,7 +173,8 @@ const fecthTypeOption = async (actions: string) => {
showLoader(); showLoader();
await http await http
.get(config.API.typeOrder()) .get(config.API.typeOrder())
.then((res) => { .then(async (res) => {
await fecthCommand();
const response = res.data.result; const response = res.data.result;
const filterRes = response.filter((e: any) => const filterRes = response.filter((e: any) =>
@ -208,7 +208,6 @@ const fecthTypeOption = async (actions: string) => {
messageError($q, e); messageError($q, e);
}) })
.finally(async () => { .finally(async () => {
await fecthCommand();
if (actions == "hasData") { if (actions == "hasData") {
await fetchdetailOrder(); // await fetchdetailOrder(); //
} }
@ -311,6 +310,7 @@ const fecthCommand = async () => {
await http await http
.get(config.API.organizationsOrder()) .get(config.API.organizationsOrder())
.then((res) => { .then((res) => {
byOrderOptionUse.value = res.data.result;
byOrderOption.value = res.data.result; byOrderOption.value = res.data.result;
}) })
.catch((e) => { .catch((e) => {

View file

@ -276,19 +276,6 @@ 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 เปลี่ยนขั้น*/ /**function เปลี่ยนขั้น*/
function changeTabType() { function changeTabType() {
formFilter.page = 1; formFilter.page = 1;
@ -303,7 +290,7 @@ function fetchDataPeriodNew() {
store.groupId && fetchDataQuota(store.groupId); store.groupId && fetchDataQuota(store.groupId);
} }
function onClickDownload(data: DataOption) { function onClickDownload(data: DataOption, type: string = "xlsx") {
showLoader(); showLoader();
if (data.id === "emp-08" || data.id === "emp2-08") { if (data.id === "emp-08" || data.id === "emp2-08") {
const formData = { const formData = {
@ -341,7 +328,13 @@ function onClickDownload(data: DataOption) {
) )
.then((res) => { .then((res) => {
const dataList = res.data.result; const dataList = res.data.result;
genReportXLSX(dataList, data.name); // if (type === "pdf") {
// console.log(type);
// genReport(dataList, data.name, type);
// } else {
genReportXLSX(dataList, data.name, type);
// }
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -455,7 +448,7 @@ const updateIsShowRetire = async () => {
:key="index" :key="index"
clickable clickable
v-close-popup v-close-popup
@click="onClickDownload(item)" @click="onClickDownload(item, item.type)"
> >
<q-item-section> <q-item-section>
<q-item-label>{{ item.name }}</q-item-label> <q-item-label>{{ item.name }}</q-item-label>

View file

@ -304,7 +304,7 @@ function fetchDataPeriodNew() {
store.groupId && fetchDataQuota(store.groupId); store.groupId && fetchDataQuota(store.groupId);
} }
function onClickDownload(data: DataOption) { function onClickDownload(data: DataOption, type: string = "xlsx") {
showLoader(); showLoader();
if (data.id === "go1" || data.id === "go2") { if (data.id === "go1" || data.id === "go2") {
const formData = { const formData = {
@ -354,7 +354,7 @@ function onClickDownload(data: DataOption) {
.get(finalUrl) .get(finalUrl)
.then((res) => { .then((res) => {
const dataList = res.data.result; const dataList = res.data.result;
genReportXLSX(dataList, data.name); genReportXLSX(dataList, data.name, type);
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -539,7 +539,7 @@ const updateIsShowRetire = async () => {
:key="index" :key="index"
clickable clickable
v-close-popup v-close-popup
@click="onClickDownload(item)" @click="onClickDownload(item, item.type)"
> >
<q-item-section> <q-item-section>
<q-item-label>{{ item.name }}</q-item-label> <q-item-label>{{ item.name }}</q-item-label>

View file

@ -1,6 +1,7 @@
interface DataOption { interface DataOption {
id: string; id: string;
name: string; name: string;
type?: string;
} }
interface DataOptionShort { interface DataOptionShort {

View file

@ -110,6 +110,7 @@ export const useSalaryEmployeeListSDataStore = defineStore(
{ {
id: "emp-12", id: "emp-12",
name: "บัญชีรายละเอียดผู้ได้รับอัตราค่าจ้างสูงกว่าขั้นสูง (แนบท้ายคำสั่ง PDF) ", name: "บัญชีรายละเอียดผู้ได้รับอัตราค่าจ้างสูงกว่าขั้นสูง (แนบท้ายคำสั่ง PDF) ",
type: "pdf",
}, },
{ {
id: "emp-13", id: "emp-13",
@ -122,6 +123,7 @@ export const useSalaryEmployeeListSDataStore = defineStore(
{ {
id: "emp-15", id: "emp-15",
name: "บัญชีรายละเอียดลูกจ้างประจำที่ได้รับค่าตอบแทนพิเศษ(แนบท้ายคำสั่ง PDF)", name: "บัญชีรายละเอียดลูกจ้างประจำที่ได้รับค่าตอบแทนพิเศษ(แนบท้ายคำสั่ง PDF)",
type: "pdf",
}, },
{ {
id: "emp-14", id: "emp-14",
@ -182,6 +184,7 @@ export const useSalaryEmployeeListSDataStore = defineStore(
{ {
id: "emp2-13", id: "emp2-13",
name: "บัญชีรายละเอียดแสดงการเลื่อนขั้นค่าจ้างและให้ลูกจ้างประจำกรุงเทพมหานครได้รับอัตราค่าจ้างสูงกว่า ฯ ที่เกษียณอายุราชการ ในสิ้นปีงบประมาณ (แนบท้ายคำสั่ง PDF)", name: "บัญชีรายละเอียดแสดงการเลื่อนขั้นค่าจ้างและให้ลูกจ้างประจำกรุงเทพมหานครได้รับอัตราค่าจ้างสูงกว่า ฯ ที่เกษียณอายุราชการ ในสิ้นปีงบประมาณ (แนบท้ายคำสั่ง PDF)",
type: "pdf",
}, },
{ {
id: "emp2-14", id: "emp2-14",
@ -198,6 +201,7 @@ export const useSalaryEmployeeListSDataStore = defineStore(
{ {
id: "emp2-17", id: "emp2-17",
name: "บัญชีรายละเอียดแสดงการเลื่อนขั้นค่าจ้างและให้ลูกจ้างประจำกรุงเทพมหานครได้รับอัตราค่าจ้างสูงกว่า อัตราค่าจ้างขั้นสูงของตำแหน่งที่ได้รับแต่งตั้งในแต่ละระดับ (แนบท้ายคำสั่ง PDF)", name: "บัญชีรายละเอียดแสดงการเลื่อนขั้นค่าจ้างและให้ลูกจ้างประจำกรุงเทพมหานครได้รับอัตราค่าจ้างสูงกว่า อัตราค่าจ้างขั้นสูงของตำแหน่งที่ได้รับแต่งตั้งในแต่ละระดับ (แนบท้ายคำสั่ง PDF)",
type: "pdf",
}, },
{ {
id: "emp2-18", id: "emp2-18",
@ -210,19 +214,20 @@ export const useSalaryEmployeeListSDataStore = defineStore(
{ {
id: "emp2-20", id: "emp2-20",
name: "บัญชีรายละเอียดให้ลูกจ้างประจำกรุงเทพมหานครได้รับค่าตอบแทนพิเศษ (แนบท้ายคำสั่ง PDF)", name: "บัญชีรายละเอียดให้ลูกจ้างประจำกรุงเทพมหานครได้รับค่าตอบแทนพิเศษ (แนบท้ายคำสั่ง PDF)",
type: "pdf",
}, },
{ {
id: "emp2-21", id: "emp2-21",
name: "บัญชีรายชื่อลูกจ้างประจำกรุงเทพมหานครผู้ไม่ได้รับค่าตอบแทนพิเศษ", name: "บัญชีรายชื่อลูกจ้างประจำกรุงเทพมหานครผู้ไม่ได้รับค่าตอบแทนพิเศษ",
}, },
{ // {
id: "emp2-23", // id: "emp2-23",
name: "บัญชีรายละเอียดแสดงการเลื่อนขั้นค่าจ้างและให้ลูกจ้างประจำกรุงเทพมหานครได้รับอัตราค่าจ้างสูงกว่า อัตราค่าจ้างขั้นสูงของตำแหน่งที่ได้รับแต่งตั้งในแต่ละระดับ (แนบท้ายคำสั่ง)", // name: "บัญชีรายละเอียดแสดงการเลื่อนขั้นค่าจ้างและให้ลูกจ้างประจำกรุงเทพมหานครได้รับอัตราค่าจ้างสูงกว่า อัตราค่าจ้างขั้นสูงของตำแหน่งที่ได้รับแต่งตั้งในแต่ละระดับ (แนบท้ายคำสั่ง)",
}, // },
{ // {
id: "emp2-23", // id: "emp2-23",
name: "บัญชีรายละเอียดแสดงการเลื่อนขั้นค่าจ้างและให้ลูกจ้างประจำกรุงเทพมหานครได้รับอัตราค่าจ้างสูงกว่า อัตราค่าจ้างขั้นสูงของตำแหน่งที่ได้รับแต่งตั้งในแต่ละระดับ (แนบท้ายคำสั่ง PDF)", // name: "บัญชีรายละเอียดแสดงการเลื่อนขั้นค่าจ้างและให้ลูกจ้างประจำกรุงเทพมหานครได้รับอัตราค่าจ้างสูงกว่า อัตราค่าจ้างขั้นสูงของตำแหน่งที่ได้รับแต่งตั้งในแต่ละระดับ (แนบท้ายคำสั่ง PDF)",
}, // },
{ {
id: "emp2-25", id: "emp2-25",
name: "แบบฟอร์มบัญชีถือจ่ายอัตราค่าจ้างลูกจ้างประจำกรุงเทพมหานคร ประจำปีงบประมาณ", name: "แบบฟอร์มบัญชีถือจ่ายอัตราค่าจ้างลูกจ้างประจำกรุงเทพมหานคร ประจำปีงบประมาณ",

View file

@ -92,6 +92,7 @@ export const useSalaryListSDataStore = defineStore("salaryListStore", () => {
{ {
id: "gov-07", id: "gov-07",
name: "แนบท้ายคำสั่งเลื่อนเงินเดือน รอบเมษายน (PDF)", name: "แนบท้ายคำสั่งเลื่อนเงินเดือน รอบเมษายน (PDF)",
type: "pdf",
}, },
{ {
id: "gov-08", id: "gov-08",
@ -100,6 +101,7 @@ export const useSalaryListSDataStore = defineStore("salaryListStore", () => {
{ {
id: "gov-08", id: "gov-08",
name: "แนบท้ายคำสั่งค่าตอบแทนพิเศษ และผู้ไม่ได้เลื่อน รอบเมษายน (PDF)", name: "แนบท้ายคำสั่งค่าตอบแทนพิเศษ และผู้ไม่ได้เลื่อน รอบเมษายน (PDF)",
type: "pdf",
}, },
]); ]);
@ -148,6 +150,7 @@ export const useSalaryListSDataStore = defineStore("salaryListStore", () => {
{ {
id: "gov-07-01", id: "gov-07-01",
name: "แนบท้ายคำสั่งเลื่อนเงินเดือนข้าราชการเกษียณ (PDF)", name: "แนบท้ายคำสั่งเลื่อนเงินเดือนข้าราชการเกษียณ (PDF)",
type: "pdf",
}, },
{ {
id: "gov-07", id: "gov-07",
@ -156,6 +159,7 @@ export const useSalaryListSDataStore = defineStore("salaryListStore", () => {
{ {
id: "gov-07", id: "gov-07",
name: "แนบท้ายคำสั่งเลื่อนเงินเดือน รอบตุลาคม (PDF)", name: "แนบท้ายคำสั่งเลื่อนเงินเดือน รอบตุลาคม (PDF)",
type: "pdf",
}, },
{ {
id: "gov-08", id: "gov-08",
@ -164,6 +168,7 @@ export const useSalaryListSDataStore = defineStore("salaryListStore", () => {
{ {
id: "gov-08", id: "gov-08",
name: "แนบท้ายคำสั่งค่าตอบแทนพิเศษ และผู้ไม่ได้เลื่อนเงินเดือน รอบตุลาคม (PDF)", name: "แนบท้ายคำสั่งค่าตอบแทนพิเศษ และผู้ไม่ได้เลื่อนเงินเดือน รอบตุลาคม (PDF)",
type: "pdf",
}, },
]); ]);