ปรับ ui รายงาน
This commit is contained in:
parent
ebb5d0e65f
commit
8a6d34a02f
10 changed files with 4166 additions and 3079 deletions
|
|
@ -10,6 +10,8 @@ import { checkPermission } from "@/utils/permissions";
|
|||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import type { DataOption } from "@/modules/09_leave/interface/index/Main";
|
||||
|
||||
import LoadView from "@/components/LoadView.vue";
|
||||
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||
/** use*/
|
||||
const isReport = ref<boolean>(true);
|
||||
|
|
@ -17,6 +19,8 @@ const mixin = useCounterMixin();
|
|||
const $q = useQuasar();
|
||||
const { showLoader, hideLoader, date2Thai, dateToISO, messageError } = mixin;
|
||||
|
||||
const isLoadPDF = ref<boolean>(false);
|
||||
|
||||
const year = ref<number>(new Date().getFullYear());
|
||||
|
||||
const reportSelect = ref<DataOption>({
|
||||
|
|
@ -45,9 +49,9 @@ const detailReport = ref<any>();
|
|||
* @param endDate วันสิ้นสุด
|
||||
*/
|
||||
async function getReportRecruit() {
|
||||
isLoadPDF.value = true;
|
||||
pdfSrc.value = undefined;
|
||||
page.value = 1;
|
||||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
config.API.reportRecruit(reportSelect.value.id) +
|
||||
|
|
@ -63,7 +67,7 @@ async function getReportRecruit() {
|
|||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
isLoadPDF.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -134,200 +138,275 @@ function filterFnOptions(val: any, update: Function) {
|
|||
);
|
||||
});
|
||||
}
|
||||
|
||||
function clearFilter() {
|
||||
reportSelect.value = {
|
||||
id: "",
|
||||
name: "",
|
||||
};
|
||||
detailReport.value = undefined;
|
||||
year.value = new Date().getFullYear();
|
||||
pdfSrc.value = undefined;
|
||||
detailReport.value = undefined;
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
รายงานสถิติสำหรับการสอบแข่งขัน
|
||||
</div>
|
||||
|
||||
<q-form greedy @submit.prevent @validation-success="getReportRecruit">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-card class="q-pa-sm">
|
||||
<div class="row q-col-gutter-sm no-wrap">
|
||||
<q-space />
|
||||
<div>
|
||||
<q-btn
|
||||
:loading="isLoadPDF"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="download"
|
||||
:disable="!checkPermission($route)?.attrIsGet || !detailReport"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
genReportXLSX(detailReport, reportSelect.name, 'pdf')
|
||||
"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .pdf</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="genReportXLSX(detailReport, reportSelect.name)"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="green" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .xlsx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-card class="q-pa-sm">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col">
|
||||
<q-card flat bordered>
|
||||
<q-card-section
|
||||
bordered
|
||||
class="bg-primary text-subtitle2 text-white q-pa-sm row items-center"
|
||||
>
|
||||
<q-icon name="mdi-filter" class="q-mr-xs" />
|
||||
ตัวกรอง
|
||||
<q-space />
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
class="q-px-sm"
|
||||
rounded
|
||||
flat
|
||||
label="ล้างทั้งหมด"
|
||||
@click.stop.pervent="clearFilter"
|
||||
/>
|
||||
</q-card-section>
|
||||
<q-card-section class="q-pa-none">
|
||||
<div class="col-12 q-px-sm">
|
||||
<q-select
|
||||
borderless
|
||||
dense
|
||||
v-model="reportSelect"
|
||||
:options="reportSelectOption"
|
||||
label="รายงาน"
|
||||
map-options
|
||||
hide-selected
|
||||
fill-input
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
use-input
|
||||
@filter="(inputValue: any,
|
||||
doneFn: Function) => filterFnOptions(inputValue, doneFn)"
|
||||
><template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="col-12 q-px-sm">
|
||||
<datepicker
|
||||
v-model="year"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="bg-white"
|
||||
dense
|
||||
borderless
|
||||
:model-value="Number(year) + 543"
|
||||
:label="`${'ปีงบประมาณ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
size="18px"
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
dense
|
||||
class="q-px-md"
|
||||
label="ค้นหา"
|
||||
unelevated
|
||||
color="public"
|
||||
type="submit"
|
||||
:disable="!reportSelect.id"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12 col-xs-12 flex">
|
||||
<q-splitter
|
||||
horizontal
|
||||
style="
|
||||
height: 75vh;
|
||||
border: 1px solid rgb(210, 210, 210);
|
||||
border-radius: 5px;
|
||||
width: 100%;
|
||||
"
|
||||
before-class="overflow-hidden disable"
|
||||
separator-class="bg-white disabled"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<div class="q-px-sm">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:after>
|
||||
<div class="q-pa-md">
|
||||
<LoadView v-if="isLoadPDF" />
|
||||
<VuePDF
|
||||
v-else-if="!isLoadPDF && pdfSrc"
|
||||
ref="vuePDFRef"
|
||||
:pdf="pdfSrc"
|
||||
:page="page"
|
||||
fit-parent
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div class="q-pa-md">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</q-splitter>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
|
||||
<div class="q-pa-sm q-gutter-sm">
|
||||
<q-card flat bordered class="col-12">
|
||||
<div class="row q-col-gutter-sm q-pa-sm">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<q-select
|
||||
outlined
|
||||
dense
|
||||
v-model="reportSelect"
|
||||
:options="reportSelectOption"
|
||||
label="รายงาน"
|
||||
map-options
|
||||
hide-selected
|
||||
fill-input
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
use-input
|
||||
style="width: 500px"
|
||||
@update:model-value="getReportRecruit"
|
||||
@filter="(inputValue: any,
|
||||
doneFn: Function) => filterFnOptions(inputValue, doneFn)"
|
||||
><template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
<datepicker
|
||||
v-model="year"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
@update:model-value="getReportRecruit"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="bg-white"
|
||||
dense
|
||||
outlined
|
||||
:model-value="Number(year) + 543"
|
||||
:label="`${'ปีงบประมาณ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<q-space />
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="download"
|
||||
:disable="
|
||||
!checkPermission($route)?.attrIsGet ||
|
||||
isReport ||
|
||||
reportSelect.id == ''
|
||||
"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="genReportXLSX(detailReport, reportSelect.name, 'pdf')"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .pdf</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="genReportXLSX(detailReport, reportSelect.name)"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="green" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .xlsx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
<q-card flat bordered class="col-12">
|
||||
<q-card-section class="col-lg-9 col-md-8 col-xs-12 scroll">
|
||||
<q-splitter
|
||||
v-model="splitterModel"
|
||||
horizontal
|
||||
style="
|
||||
height: 70vh;
|
||||
border: 1px solid rgb(210, 210, 210);
|
||||
border-radius: 5px;
|
||||
"
|
||||
before-class="overflow-hidden disable"
|
||||
separator-class="bg-white disabled"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<div class="q-px-sm">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:after>
|
||||
<div class="q-pa-md">
|
||||
<VuePDF ref="vuePDFRef" :pdf="pdfSrc" :page="page" fit-parent />
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div class="q-pa-md">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</q-splitter>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
|
|
|||
|
|
@ -17,6 +17,10 @@ import LoadView from "@/components/LoadView.vue";
|
|||
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||
|
||||
/** use*/
|
||||
const expandedModal = ref<boolean>(false);
|
||||
const org = ref<string>("");
|
||||
const isLoadStructureTree = ref<boolean>(true);
|
||||
|
||||
const $q = useQuasar();
|
||||
const route = useRoute();
|
||||
const { fetchStructureTree } = useStructureTree();
|
||||
|
|
@ -78,21 +82,27 @@ const node = ref<DataStructureTree[]>([]);
|
|||
const expanded = ref<string[]>([]);
|
||||
|
||||
async function fetchDataTree() {
|
||||
node.value = await fetchStructureTree(route.meta.Key as string, true);
|
||||
try {
|
||||
isLoadStructureTree.value = true;
|
||||
node.value = await fetchStructureTree(route.meta.Key as string, true);
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
isLoadStructureTree.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function onUpdateYear(val: number) {
|
||||
dateStart.value = new Date(val - 1, 9, 1);
|
||||
dateEnd.value = new Date(val, 8, 30);
|
||||
|
||||
reportType.value && fetchDataReport();
|
||||
}
|
||||
|
||||
function onSelectedNode(id: string, level: number, orgDnaId: string) {
|
||||
nodeId.value = id;
|
||||
nodeLevel.value = level;
|
||||
orgTreeDnaId.value = orgDnaId;
|
||||
reportType.value && fetchDataReport();
|
||||
function onSelectedNode(data: any) {
|
||||
org.value = data.orgName;
|
||||
nodeId.value = data.orgTreeId;
|
||||
nodeLevel.value = data.orgLevel;
|
||||
orgTreeDnaId.value = data.orgTreeDnaId;
|
||||
expandedModal.value = false;
|
||||
}
|
||||
|
||||
function fetchDataReport() {
|
||||
|
|
@ -175,6 +185,20 @@ function backPage() {
|
|||
}
|
||||
}
|
||||
|
||||
function clearFilter() {
|
||||
org.value = "";
|
||||
nodeId.value = "";
|
||||
nodeLevel.value = 0;
|
||||
orgTreeDnaId.value = "";
|
||||
reportType.value = undefined;
|
||||
detailReport.value = undefined;
|
||||
pdfSrc.value = undefined;
|
||||
|
||||
year.value = new Date().getFullYear();
|
||||
dateStart.value = new Date(year.value - 1, 9, 1);
|
||||
dateEnd.value = new Date(year.value + 1, 8, 30);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchDataTree();
|
||||
});
|
||||
|
|
@ -185,308 +209,380 @@ onMounted(() => {
|
|||
รายงานบรรจุ แต่งตั้ง ย้าย โอน
|
||||
</div>
|
||||
|
||||
<div class="q-pa-sm q-gutter-sm">
|
||||
<q-card flat bordered class="col-12">
|
||||
<div class="row q-col-gutter-sm q-pa-sm">
|
||||
<div class="row col-12">
|
||||
<q-select
|
||||
outlined
|
||||
dense
|
||||
v-model="reportType"
|
||||
:options="optionReport"
|
||||
label="รายงาน"
|
||||
map-options
|
||||
option-label="name"
|
||||
style="width: 500px"
|
||||
@update:model-value="fetchDataReport"
|
||||
>
|
||||
</q-select>
|
||||
|
||||
<q-space />
|
||||
<q-btn
|
||||
:loading="isLoadPDF"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="download"
|
||||
:disable="!reportType || !nodeId"
|
||||
@click="genReportXLSX(detailReport, `${year}_${reportType?.name}`)"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
<div class="row col-12">
|
||||
<q-card bordered class="col-12 filter-card q-pa-sm">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div>
|
||||
<datepicker
|
||||
v-model="year"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
@update:model-value="onUpdateYear"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="bg-white"
|
||||
dense
|
||||
outlined
|
||||
:model-value="Number(year) + 543"
|
||||
:label="`${'ปีงบประมาณ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateStart"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
@update:model-value="fetchDataReport"
|
||||
:max-date="dateEnd"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="bg-white"
|
||||
outlined
|
||||
dense
|
||||
borderless
|
||||
:model-value="dateStart ? date2Thai(dateStart) : null"
|
||||
:label="`${'ตั้งเเต่วันที่'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div>
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateEnd"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
@update:model-value="fetchDataReport"
|
||||
:min-date="dateStart"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="bg-white"
|
||||
outlined
|
||||
dense
|
||||
borderless
|
||||
:model-value="dateEnd ? date2Thai(dateEnd) : null"
|
||||
:label="`${'ถึงวันที่'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<q-form greedy @submit.prevent @validation-success="fetchDataReport">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-card class="q-pa-sm">
|
||||
<div class="row q-col-gutter-sm no-wrap">
|
||||
<q-space />
|
||||
<div>
|
||||
<q-btn
|
||||
:loading="isLoadPDF"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="download"
|
||||
:disable="!reportType || !nodeId || !detailReport"
|
||||
@click="
|
||||
genReportXLSX(detailReport, `${year}_${reportType?.name}`)
|
||||
"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<q-card flat bordered class="col-12">
|
||||
<q-card-section :horizontal="$q.screen.gt.sm">
|
||||
<q-card-section class="col-lg-3 col-md-4 col-xs-12 q-gutter-sm">
|
||||
<div class="col">
|
||||
<q-input dense outlined v-model="filterTree" label="ค้นหา">
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
|
||||
<div class="bg-white tree-container q-pa-xs">
|
||||
<q-tree
|
||||
dense
|
||||
:nodes="node"
|
||||
node-key="orgTreeId"
|
||||
label-key="labelName"
|
||||
v-model:expanded="expanded"
|
||||
:filter="filterTree.trim()"
|
||||
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||
no-nodes-label="ไม่มีข้อมูล"
|
||||
>
|
||||
<template v-slot:default-header="prop">
|
||||
<q-item
|
||||
@click.stop="
|
||||
onSelectedNode(
|
||||
prop.node.orgTreeId,
|
||||
prop.node.orgLevel,
|
||||
prop.node.orgTreeDnaId
|
||||
)
|
||||
"
|
||||
:active="nodeId === prop.node.orgTreeId"
|
||||
clickable
|
||||
active-class="my-list-link text-primary text-weight-medium"
|
||||
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||
<div class="col-12">
|
||||
<q-card class="q-pa-sm">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col">
|
||||
<q-card flat bordered>
|
||||
<q-card-section
|
||||
bordered
|
||||
class="bg-primary text-subtitle2 text-white q-pa-sm row items-center"
|
||||
>
|
||||
<div>
|
||||
<div class="text-weight-medium">
|
||||
{{ prop.node.orgTreeName }}
|
||||
</div>
|
||||
<div class="text-weight-light text-grey-8">
|
||||
{{ prop.node.orgCode == null ? null : prop.node.orgCode }}
|
||||
{{
|
||||
prop.node.orgTreeShortName == null
|
||||
? null
|
||||
: prop.node.orgTreeShortName
|
||||
}}
|
||||
<q-icon name="mdi-filter" class="q-mr-xs" />
|
||||
ตัวกรอง
|
||||
<q-space />
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
class="q-px-sm"
|
||||
rounded
|
||||
flat
|
||||
label="ล้างทั้งหมด"
|
||||
@click.stop.pervent="clearFilter"
|
||||
/>
|
||||
</q-card-section>
|
||||
<q-card-section class="q-pa-none">
|
||||
<div class="col-12">
|
||||
<q-expansion-item
|
||||
v-model="expandedModal"
|
||||
dense
|
||||
dense-toggle
|
||||
expand-separator
|
||||
class="expansion-item"
|
||||
>
|
||||
<template #header>
|
||||
<div class="full-width flex items-stretch">
|
||||
<q-input
|
||||
dense
|
||||
:model-value="org"
|
||||
autogrow
|
||||
borderless
|
||||
label="สังกัด"
|
||||
class="bg-white full-width"
|
||||
>
|
||||
</q-input>
|
||||
</div>
|
||||
<!-- @click="onOpenOrg" -->
|
||||
</template>
|
||||
<q-separator />
|
||||
|
||||
<q-card-section v-if="isLoadStructureTree">
|
||||
<LoadView />
|
||||
</q-card-section>
|
||||
<q-card-section v-else>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="filterTree"
|
||||
label="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
v-if="filterTree !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="filterTree = ''"
|
||||
/>
|
||||
<q-icon v-else name="search" color="grey-5" />
|
||||
</template>
|
||||
</q-input>
|
||||
<q-tree
|
||||
dense
|
||||
:nodes="node"
|
||||
node-key="orgTreeId"
|
||||
label-key="labelName"
|
||||
v-model:expanded="expanded"
|
||||
:filter="filterTree.trim()"
|
||||
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||
no-nodes-label="ไม่มีข้อมูล"
|
||||
class="tree-container-report q-mt-sm"
|
||||
>
|
||||
<template v-slot:default-header="prop">
|
||||
<q-item
|
||||
@click.stop="onSelectedNode(prop.node)"
|
||||
:active="nodeId === prop.node.orgTreeId"
|
||||
clickable
|
||||
active-class="my-list-link text-primary text-weight-medium"
|
||||
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||
>
|
||||
<div>
|
||||
<div class="text-weight-medium">
|
||||
{{ prop.node.orgTreeName }}
|
||||
</div>
|
||||
<div class="text-weight-light text-grey-8">
|
||||
{{
|
||||
prop.node.orgCode == null
|
||||
? null
|
||||
: prop.node.orgCode
|
||||
}}
|
||||
{{
|
||||
prop.node.orgTreeShortName == null
|
||||
? null
|
||||
: prop.node.orgTreeShortName
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-tree>
|
||||
</q-card-section>
|
||||
</q-expansion-item>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="col-12 q-px-sm">
|
||||
<q-select
|
||||
borderless
|
||||
dense
|
||||
v-model="reportType"
|
||||
:options="optionReport"
|
||||
label="รายงาน"
|
||||
map-options
|
||||
option-label="name"
|
||||
>
|
||||
</q-select>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="col-12 q-pa-sm">
|
||||
<div class="row q-col-gutter-y-xs">
|
||||
<div class="text-grey-8 text-caption">เลือกช่วงเวลา</div>
|
||||
|
||||
<div class="col-12">
|
||||
<datepicker
|
||||
v-model="year"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
@update:model-value="onUpdateYear"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="bg-white"
|
||||
dense
|
||||
:model-value="Number(year) + 543"
|
||||
:label="`${'ปีงบประมาณ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
size="18px"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateStart"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
:max-date="dateEnd"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="bg-white"
|
||||
dense
|
||||
:model-value="
|
||||
dateStart ? date2Thai(dateStart) : null
|
||||
"
|
||||
:label="`${'ตั้งเเต่วันที่'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
size="18px"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateEnd"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
:min-date="dateStart"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="bg-white"
|
||||
dense
|
||||
:model-value="dateEnd ? date2Thai(dateEnd) : null"
|
||||
:label="`${'ถึงวันที่'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
size="18px"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-tree>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
dense
|
||||
class="q-px-md"
|
||||
label="ค้นหา"
|
||||
unelevated
|
||||
color="public"
|
||||
type="submit"
|
||||
:disable="nodeId == '' || reportType == undefined"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12 col-xs-12 flex">
|
||||
<q-splitter
|
||||
horizontal
|
||||
style="
|
||||
height: 75vh;
|
||||
border: 1px solid rgb(210, 210, 210);
|
||||
border-radius: 5px;
|
||||
width: 100%;
|
||||
"
|
||||
before-class="overflow-hidden disable"
|
||||
separator-class="bg-white disabled"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<div class="q-px-sm">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:after>
|
||||
<div class="q-pa-md">
|
||||
<LoadView v-if="isLoadPDF" />
|
||||
|
||||
<VuePDF
|
||||
v-else-if="!isLoadPDF && pdfSrc"
|
||||
ref="vuePDFRef"
|
||||
:pdf="pdfSrc"
|
||||
:page="page"
|
||||
fit-parent
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div class="q-pa-md">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</q-splitter>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-separator :vertical="$q.screen.gt.xs" />
|
||||
|
||||
<q-card-section class="col-lg-9 col-md-8 col-xs-12 scroll">
|
||||
<q-splitter
|
||||
horizontal
|
||||
style="
|
||||
height: 65vh;
|
||||
border: 1px solid rgb(210, 210, 210);
|
||||
border-radius: 5px;
|
||||
"
|
||||
before-class="overflow-hidden disable"
|
||||
separator-class="bg-white disabled"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<div class="q-px-sm">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:after>
|
||||
<div class="q-pa-md">
|
||||
<LoadView v-if="isLoadPDF" />
|
||||
<VuePDF
|
||||
v-else
|
||||
ref="vuePDFRef"
|
||||
:pdf="pdfSrc"
|
||||
:page="page"
|
||||
fit-parent
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div class="q-pa-md">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</q-splitter>
|
||||
</q-card-section>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
<style lang="scss" scoped>
|
||||
.tree-container {
|
||||
overflow: auto;
|
||||
height: 60vh;
|
||||
|
|
@ -500,4 +596,17 @@ onMounted(() => {
|
|||
font-weight: 600;
|
||||
border: 1px solid rgba(175, 185, 196, 0.217);
|
||||
}
|
||||
.tree-container-report {
|
||||
overflow: auto;
|
||||
max-height: 50vh;
|
||||
}
|
||||
|
||||
:deep(.expansion-item .q-item__section) {
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
||||
:deep(.expansion-item .q-item) {
|
||||
min-height: 32px;
|
||||
padding: 2px 9px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -43,6 +43,12 @@ const optionReport = ref<DataOption[]>([
|
|||
name: "จำนวนลูกจ้างประจำ กทม. ที่พ้นจากราชการ",
|
||||
},
|
||||
]);
|
||||
|
||||
const expandedModal = ref<boolean>(false);
|
||||
const org = ref<string>("");
|
||||
|
||||
const isLoadStructureTree = ref<boolean>(true);
|
||||
|
||||
const filterType = ref<string>("MONTH");
|
||||
const filterTypeOption = ref<DataOption[]>([
|
||||
{ id: "MONTH", name: "รายเดือน" },
|
||||
|
|
@ -76,8 +82,16 @@ const nodeLevel = ref<number>(0);
|
|||
const node = ref<DataStructureTree[]>([]);
|
||||
const expanded = ref<string[]>([]);
|
||||
|
||||
/** ฟังก์ชันเรียกข้อมูลโครงสร้างหน่วยงาน*/
|
||||
async function fetchDataTree() {
|
||||
node.value = await fetchStructureTree(route.meta.Key as string, true);
|
||||
try {
|
||||
isLoadStructureTree.value = true;
|
||||
node.value = await fetchStructureTree(route.meta.Key as string, true);
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
isLoadStructureTree.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function onUpdateFilter() {
|
||||
|
|
@ -97,14 +111,13 @@ function onUpdateFilter() {
|
|||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
fetchDataReport();
|
||||
}
|
||||
|
||||
function onSelectedNode(id: string, level: number) {
|
||||
nodeId.value = id;
|
||||
nodeLevel.value = level;
|
||||
fetchDataReport();
|
||||
function onSelectedNode(data: any) {
|
||||
nodeId.value = data.orgTreeId;
|
||||
nodeLevel.value = data.orgLevel;
|
||||
org.value = data.orgName;
|
||||
expandedModal.value = false;
|
||||
}
|
||||
|
||||
function fetchDataReport() {
|
||||
|
|
@ -186,6 +199,28 @@ function monthYearThai(val: DataDateMonthObject) {
|
|||
else return monthYear2Thai(val.month, val.year);
|
||||
}
|
||||
|
||||
function clearFilter() {
|
||||
nodeId.value = "";
|
||||
nodeLevel.value = 0;
|
||||
org.value = "";
|
||||
detailReport.value = undefined;
|
||||
pdfSrc.value = undefined;
|
||||
reportType.value = "";
|
||||
|
||||
filterType.value = "MONTH";
|
||||
year.value = new Date().getFullYear();
|
||||
dateMonth.value = {
|
||||
month: new Date().getMonth(),
|
||||
year: new Date().getFullYear(),
|
||||
};
|
||||
dateStart.value = new Date(
|
||||
dateMonth.value.year,
|
||||
dateMonth.value.month + 1 - 1,
|
||||
1
|
||||
);
|
||||
dateEnd.value = new Date(dateMonth.value.year, dateMonth.value.month + 1, 0);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchDataTree();
|
||||
});
|
||||
|
|
@ -196,391 +231,472 @@ onMounted(() => {
|
|||
รายงานพ้นจากราชการ
|
||||
</div>
|
||||
|
||||
<div class="q-pa-sm q-gutter-sm">
|
||||
<q-card flat bordered class="col-12">
|
||||
<div class="row q-col-gutter-sm q-pa-sm">
|
||||
<div class="row col-12">
|
||||
<q-select
|
||||
outlined
|
||||
dense
|
||||
v-model="reportType"
|
||||
:options="optionReport"
|
||||
label="รายงาน"
|
||||
map-options
|
||||
emit-value
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
style="width: 320px"
|
||||
@update:model-value="fetchDataReport"
|
||||
>
|
||||
</q-select>
|
||||
|
||||
<q-space />
|
||||
|
||||
<q-btn
|
||||
:loading="isLoadPDF"
|
||||
flat
|
||||
round
|
||||
:disable="!reportType || !nodeId"
|
||||
color="primary"
|
||||
icon="download"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop.pervent="
|
||||
genReportXLSX(
|
||||
detailReport,
|
||||
`${optionReport.find((e) => e.id === reportType)?.name}`,
|
||||
'pdf'
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .pdf</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop.pervent="
|
||||
genReportXLSX(
|
||||
detailReport,
|
||||
`${optionReport.find((e) => e.id === reportType)?.name}`
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="green" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .xlsx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
<div class="row col-12">
|
||||
<q-card bordered class="col-12 filter-card q-pa-sm">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div class="col-md-3 col-xs-12">
|
||||
<q-select
|
||||
class="bg-white"
|
||||
outlined
|
||||
dense
|
||||
v-model="filterType"
|
||||
:options="filterTypeOption"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
use-input
|
||||
@update:model-value="onUpdateFilter"
|
||||
>
|
||||
</q-select>
|
||||
</div>
|
||||
<div v-if="filterType === 'YEAR'">
|
||||
<datepicker
|
||||
v-model="year"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
@update:model-value="onUpdateFilter"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="bg-white"
|
||||
dense
|
||||
outlined
|
||||
:model-value="Number(year) + 543"
|
||||
:label="`${'ปีงบประมาณ'}`"
|
||||
<q-form greedy @submit.prevent @validation-success="fetchDataReport">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-card class="q-pa-sm">
|
||||
<div class="row q-col-gutter-sm no-wrap">
|
||||
<q-space />
|
||||
<div>
|
||||
<q-btn
|
||||
:loading="isLoadPDF"
|
||||
flat
|
||||
round
|
||||
:disable="!reportType || !nodeId || !detailReport"
|
||||
color="primary"
|
||||
icon="download"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop.pervent="
|
||||
genReportXLSX(
|
||||
detailReport,
|
||||
`${
|
||||
optionReport.find((e) => e.id === reportType)?.name
|
||||
}`,
|
||||
'pdf'
|
||||
)
|
||||
"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
|
||||
<div v-if="filterType === 'MONTH'">
|
||||
<datepicker
|
||||
v-model="dateMonth"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
month-picker
|
||||
:enableTimePicker="false"
|
||||
@update:model-value="onUpdateFilter"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="bg-white"
|
||||
outlined
|
||||
dense
|
||||
borderless
|
||||
:label="`${'เดือน'}`"
|
||||
:model-value="monthYearThai(dateMonth)"
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .pdf</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop.pervent="
|
||||
genReportXLSX(
|
||||
detailReport,
|
||||
`${
|
||||
optionReport.find((e) => e.id === reportType)?.name
|
||||
}`
|
||||
)
|
||||
"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
></q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateStart"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
@update:model-value="fetchDataReport"
|
||||
:max-date="dateEnd"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="bg-white"
|
||||
outlined
|
||||
dense
|
||||
borderless
|
||||
:model-value="dateStart ? date2Thai(dateStart) : null"
|
||||
:label="`${'ตั้งเเต่วันที่'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div>
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateEnd"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
@update:model-value="fetchDataReport"
|
||||
:min-date="dateStart"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="bg-white"
|
||||
outlined
|
||||
dense
|
||||
borderless
|
||||
:model-value="dateEnd ? date2Thai(dateEnd) : null"
|
||||
:label="`${'ถึงวันที่'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<q-item-section avatar
|
||||
><q-icon color="green" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .xlsx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<q-card flat bordered class="col-12">
|
||||
<q-card-section :horizontal="$q.screen.gt.sm">
|
||||
<q-card-section class="col-lg-3 col-md-4 col-xs-12 q-gutter-sm">
|
||||
<div class="col">
|
||||
<q-input dense outlined v-model="filterTree" label="ค้นหา">
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
|
||||
<div class="bg-white tree-container q-pa-xs">
|
||||
<q-tree
|
||||
dense
|
||||
:nodes="node"
|
||||
node-key="orgTreeId"
|
||||
label-key="labelName"
|
||||
v-model:expanded="expanded"
|
||||
:filter="filterTree.trim()"
|
||||
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||
no-nodes-label="ไม่มีข้อมูล"
|
||||
>
|
||||
<template v-slot:default-header="prop">
|
||||
<q-item
|
||||
@click.stop="
|
||||
onSelectedNode(prop.node.orgTreeId, prop.node.orgLevel)
|
||||
"
|
||||
:active="nodeId === prop.node.orgTreeId"
|
||||
clickable
|
||||
active-class="my-list-link text-primary text-weight-medium"
|
||||
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||
<div class="col-12">
|
||||
<q-card class="q-pa-sm">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col">
|
||||
<q-card flat bordered>
|
||||
<q-card-section
|
||||
bordered
|
||||
class="bg-primary text-subtitle2 text-white q-pa-sm row items-center"
|
||||
>
|
||||
<div>
|
||||
<div class="text-weight-medium">
|
||||
{{ prop.node.orgTreeName }}
|
||||
</div>
|
||||
<div class="text-weight-light text-grey-8">
|
||||
{{ prop.node.orgCode == null ? null : prop.node.orgCode }}
|
||||
{{
|
||||
prop.node.orgTreeShortName == null
|
||||
? null
|
||||
: prop.node.orgTreeShortName
|
||||
}}
|
||||
<q-icon name="mdi-filter" class="q-mr-xs" />
|
||||
ตัวกรอง
|
||||
<q-space />
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
class="q-px-sm"
|
||||
rounded
|
||||
flat
|
||||
label="ล้างทั้งหมด"
|
||||
@click.stop.pervent="clearFilter"
|
||||
/>
|
||||
</q-card-section>
|
||||
<q-card-section class="q-pa-none">
|
||||
<div class="col-12">
|
||||
<q-expansion-item
|
||||
v-model="expandedModal"
|
||||
dense
|
||||
dense-toggle
|
||||
expand-separator
|
||||
class="expansion-item"
|
||||
>
|
||||
<template #header>
|
||||
<div class="full-width flex items-stretch">
|
||||
<q-input
|
||||
dense
|
||||
:model-value="org"
|
||||
autogrow
|
||||
borderless
|
||||
label="สังกัด"
|
||||
class="bg-white full-width"
|
||||
>
|
||||
</q-input>
|
||||
</div>
|
||||
<!-- @click="onOpenOrg" -->
|
||||
</template>
|
||||
<q-separator />
|
||||
|
||||
<q-card-section v-if="isLoadStructureTree">
|
||||
<LoadView />
|
||||
</q-card-section>
|
||||
<q-card-section v-else>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="filterTree"
|
||||
label="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
v-if="filterTree !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="filterTree = ''"
|
||||
/>
|
||||
<q-icon v-else name="search" color="grey-5" />
|
||||
</template>
|
||||
</q-input>
|
||||
<q-tree
|
||||
dense
|
||||
:nodes="node"
|
||||
node-key="orgTreeId"
|
||||
label-key="labelName"
|
||||
v-model:expanded="expanded"
|
||||
:filter="filterTree.trim()"
|
||||
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||
no-nodes-label="ไม่มีข้อมูล"
|
||||
class="tree-container-report q-mt-sm"
|
||||
>
|
||||
<template v-slot:default-header="prop">
|
||||
<q-item
|
||||
@click.stop="onSelectedNode(prop.node)"
|
||||
:active="nodeId === prop.node.orgTreeId"
|
||||
clickable
|
||||
active-class="my-list-link text-primary text-weight-medium"
|
||||
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||
>
|
||||
<div>
|
||||
<div class="text-weight-medium">
|
||||
{{ prop.node.orgTreeName }}
|
||||
</div>
|
||||
<div class="text-weight-light text-grey-8">
|
||||
{{
|
||||
prop.node.orgCode == null
|
||||
? null
|
||||
: prop.node.orgCode
|
||||
}}
|
||||
{{
|
||||
prop.node.orgTreeShortName == null
|
||||
? null
|
||||
: prop.node.orgTreeShortName
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-tree>
|
||||
</q-card-section>
|
||||
</q-expansion-item>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="col-12 q-px-sm">
|
||||
<q-select
|
||||
dense
|
||||
v-model="reportType"
|
||||
:options="optionReport"
|
||||
label="รายงาน"
|
||||
map-options
|
||||
borderless
|
||||
emit-value
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
>
|
||||
</q-select>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="col-12 q-px-sm">
|
||||
<q-select
|
||||
class="bg-white"
|
||||
dense
|
||||
v-model="filterType"
|
||||
:options="filterTypeOption"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
use-input
|
||||
borderless
|
||||
@update:model-value="onUpdateFilter"
|
||||
>
|
||||
</q-select>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="col-12 q-pa-sm">
|
||||
<div class="row q-col-gutter-y-xs">
|
||||
<div class="text-grey-8 text-caption">เลือกช่วงเวลา</div>
|
||||
<div class="col-12">
|
||||
<div v-if="filterType === 'YEAR'">
|
||||
<datepicker
|
||||
v-model="year"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
@update:model-value="onUpdateFilter"
|
||||
>
|
||||
<template #year="{ year }">{{
|
||||
year + 543
|
||||
}}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="bg-white"
|
||||
dense
|
||||
:model-value="Number(year) + 543"
|
||||
:label="`${'ปีงบประมาณ'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
size="18px"
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
|
||||
<div v-if="filterType === 'MONTH'">
|
||||
<datepicker
|
||||
v-model="dateMonth"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
month-picker
|
||||
:enableTimePicker="false"
|
||||
@update:model-value="onUpdateFilter"
|
||||
>
|
||||
<template #year="{ year }">{{
|
||||
year + 543
|
||||
}}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="bg-white"
|
||||
dense
|
||||
:label="`${'เดือน'}`"
|
||||
:model-value="monthYearThai(dateMonth)"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
size="18px"
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
></q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateStart"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
:max-date="dateEnd"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="bg-white"
|
||||
dense
|
||||
:model-value="
|
||||
dateStart ? date2Thai(dateStart) : null
|
||||
"
|
||||
:label="`${'ตั้งเเต่วันที่'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
size="18px"
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="dateEnd"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
:min-date="dateStart"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="bg-white"
|
||||
dense
|
||||
:model-value="dateEnd ? date2Thai(dateEnd) : null"
|
||||
:label="`${'ถึงวันที่'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
size="18px"
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-tree>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
dense
|
||||
class="q-px-md"
|
||||
label="ค้นหา"
|
||||
unelevated
|
||||
color="public"
|
||||
type="submit"
|
||||
:disable="nodeId == '' || reportType == undefined"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12 col-xs-12 flex">
|
||||
<q-splitter
|
||||
horizontal
|
||||
style="
|
||||
height: 75vh;
|
||||
border: 1px solid rgb(210, 210, 210);
|
||||
border-radius: 5px;
|
||||
width: 100%;
|
||||
"
|
||||
before-class="overflow-hidden disable"
|
||||
separator-class="bg-white disabled"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<div class="q-px-sm">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:after>
|
||||
<div class="q-pa-md">
|
||||
<LoadView v-if="isLoadPDF" />
|
||||
<VuePDF
|
||||
v-else-if="!isLoadPDF && pdfSrc"
|
||||
ref="vuePDFRef"
|
||||
:pdf="pdfSrc"
|
||||
:page="page"
|
||||
fit-parent
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div class="q-pa-md">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</q-splitter>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-separator :vertical="$q.screen.gt.xs" />
|
||||
|
||||
<q-card-section class="col-lg-9 col-md-8 col-xs-12 scroll">
|
||||
<q-splitter
|
||||
horizontal
|
||||
style="
|
||||
height: 65vh;
|
||||
border: 1px solid rgb(210, 210, 210);
|
||||
border-radius: 5px;
|
||||
"
|
||||
before-class="overflow-hidden disable"
|
||||
separator-class="bg-white disabled"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<div class="q-px-sm">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:after>
|
||||
<div class="q-pa-md">
|
||||
<LoadView v-if="isLoadPDF" />
|
||||
<VuePDF
|
||||
v-else
|
||||
ref="vuePDFRef"
|
||||
:pdf="pdfSrc"
|
||||
:page="page"
|
||||
fit-parent
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div class="q-pa-md">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</q-splitter>
|
||||
</q-card-section>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
<style lang="scss" scoped>
|
||||
.tree-container {
|
||||
overflow: auto;
|
||||
height: 60vh;
|
||||
|
|
@ -594,4 +710,18 @@ onMounted(() => {
|
|||
font-weight: 600;
|
||||
border: 1px solid rgba(175, 185, 196, 0.217);
|
||||
}
|
||||
|
||||
.tree-container-report {
|
||||
overflow: auto;
|
||||
max-height: 50vh;
|
||||
}
|
||||
|
||||
:deep(.expansion-item .q-item__section) {
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
||||
:deep(.expansion-item .q-item) {
|
||||
min-height: 32px;
|
||||
padding: 2px 9px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -26,6 +26,10 @@ const route = useRoute();
|
|||
const { fetchStructureTree } = useStructureTree();
|
||||
const { messageError, showLoader, hideLoader } = useCounterMixin();
|
||||
|
||||
const expandedModal = ref<boolean>(false);
|
||||
const org = ref<string>("");
|
||||
const isLoadStructureTree = ref<boolean>(true);
|
||||
|
||||
const employeeClass = ref<string>("officer");
|
||||
const employeeClassOption = ref<OptionData[]>([
|
||||
{ id: "officer", name: "ข้าราชการ กทม. สามัญ" },
|
||||
|
|
@ -85,8 +89,16 @@ const pdfSrc = ref<any>();
|
|||
|
||||
const isLoadPDF = ref<boolean>(false);
|
||||
|
||||
/** ฟังก์ชันเรียกข้อมูลโครงสร้างหน่วยงาน*/
|
||||
async function fetchDataTree() {
|
||||
node.value = await fetchStructureTree(route.meta.Key as string, true);
|
||||
try {
|
||||
isLoadStructureTree.value = true;
|
||||
node.value = await fetchStructureTree(route.meta.Key as string, true);
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
isLoadStructureTree.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/** ฟังก์ชันคึงข้อมูลรอบการเสนอขอ*/
|
||||
|
|
@ -156,10 +168,11 @@ function filterSelector(val: string, update: Function, name: string) {
|
|||
* @param id id หน่วยงาน
|
||||
* @param level ระดับหน่วยงาน
|
||||
*/
|
||||
function onSelectedNode(id: string, level: number) {
|
||||
nodeId.value = id;
|
||||
nodeLevel.value = level;
|
||||
onUpdateFilter();
|
||||
function onSelectedNode(data: any) {
|
||||
nodeId.value = data.orgTreeDnaId;
|
||||
nodeLevel.value = data.orgLevel;
|
||||
org.value = data.orgName;
|
||||
expandedModal.value = false;
|
||||
}
|
||||
|
||||
const detailReport = ref<any>();
|
||||
|
|
@ -310,6 +323,18 @@ function downloadReport(type: string, download: "docx" | "" | "xlsx" = "") {
|
|||
}
|
||||
}
|
||||
|
||||
function clearFilter() {
|
||||
detailReport.value = undefined;
|
||||
pdfSrc.value = undefined;
|
||||
employeeClass.value = "officer";
|
||||
roundId.value = "";
|
||||
roundId2.value = "";
|
||||
typeReport.value = "";
|
||||
org.value = "";
|
||||
nodeId.value = "";
|
||||
nodeLevel.value = 0;
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await Promise.all([fetchDataTree(), fecthlistRound(), fecthlistRound2()]);
|
||||
});
|
||||
|
|
@ -319,333 +344,399 @@ onMounted(async () => {
|
|||
<div class="toptitle text-dark col-12 row items-center">
|
||||
รายงานเครื่องราชอิสริยาภรณ์
|
||||
</div>
|
||||
|
||||
<div class="q-pa-sm q-gutter-sm">
|
||||
<q-card flat bordered class="col-12">
|
||||
<div class="row q-col-gutter-sm q-pa-sm">
|
||||
<div class="row col-12">
|
||||
<q-select
|
||||
outlined
|
||||
dense
|
||||
v-model="employeeClass"
|
||||
:options="employeeClassOption"
|
||||
label="สถานภาพ"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
style="width: 230px"
|
||||
@update:model-value="onUpdateFilter"
|
||||
>
|
||||
</q-select>
|
||||
|
||||
<q-space />
|
||||
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
:loading="isLoadPDF"
|
||||
:disable="!nodeId || !employeeClass || (!roundId && !roundId2)"
|
||||
color="primary"
|
||||
icon="download"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
downloadReport(
|
||||
'pdf',
|
||||
!['report1', 'report2', 'report3'].includes(
|
||||
typeReport.val
|
||||
)
|
||||
? 'xlsx'
|
||||
: 'docx'
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .pdf</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="
|
||||
typeReport.val == 'report1' ||
|
||||
typeReport.val == 'report2' ||
|
||||
typeReport.val == 'report3'
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="downloadReport('docx')"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="blue" name="mdi-file-word"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .docx</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="downloadReport('xlsx')"
|
||||
v-if="typeReport.val !== 'report1'"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="green" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .xlsx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
<div class="row col-12">
|
||||
<q-card bordered class="col-12 filter-card q-pa-sm">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div class="col-md-4 col-xs-12">
|
||||
<q-select
|
||||
class="bg-white"
|
||||
hide-bottom-space
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
v-model="typeReport"
|
||||
:label="`${'รายงาน'}`"
|
||||
map-options
|
||||
:options="employeeClass == 'officer' ? optionReport.filter((item:any)=>item.id !== '7'):optionReport.filter((item:any)=>item.id !== '4')"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
@update:model-value="onUpdateFilter"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 col-xs-12">
|
||||
<q-select
|
||||
v-if="
|
||||
typeReport &&
|
||||
(typeReport.val == 'report1' ||
|
||||
typeReport.val == 'report2' ||
|
||||
typeReport.val == 'report3')
|
||||
"
|
||||
class="bg-white"
|
||||
use-input
|
||||
fill-input
|
||||
hide-selected
|
||||
dense
|
||||
lazy-rules
|
||||
outlined
|
||||
v-model="roundId"
|
||||
:options="roundOtion"
|
||||
label="เลือกรอบ"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
emit-value
|
||||
map-options
|
||||
@update:model-value="onUpdateFilter"
|
||||
@filter="(inputValue:string,doneFn:Function) =>
|
||||
filterSelector(inputValue, doneFn,'round') "
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
|
||||
<q-select
|
||||
v-else
|
||||
class="bg-white"
|
||||
use-input
|
||||
fill-input
|
||||
hide-selected
|
||||
dense
|
||||
lazy-rules
|
||||
outlined
|
||||
v-model="roundId2"
|
||||
:options="roundOtion2"
|
||||
label="เลือกรอบ"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
emit-value
|
||||
map-options
|
||||
@update:model-value="onUpdateFilter"
|
||||
@filter="(inputValue:string,doneFn:Function) =>
|
||||
filterSelector(inputValue, doneFn,'round') "
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
<q-form greedy @submit.prevent @validation-success="onUpdateFilter">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-card class="q-pa-sm">
|
||||
<div class="row q-col-gutter-sm no-wrap">
|
||||
<div class="col-lg-2 col-md-3 col-sm-3 col-xs-12">
|
||||
<q-select
|
||||
outlined
|
||||
dense
|
||||
v-model="employeeClass"
|
||||
:options="employeeClassOption"
|
||||
label="สถานภาพ"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
style="width: 230px"
|
||||
>
|
||||
</q-select>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
<q-space />
|
||||
<div>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
:loading="isLoadPDF"
|
||||
:disable="!detailReport"
|
||||
color="primary"
|
||||
icon="download"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
downloadReport(
|
||||
'pdf',
|
||||
!['report1', 'report2', 'report3'].includes(
|
||||
typeReport.val
|
||||
)
|
||||
? 'xlsx'
|
||||
: 'docx'
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .pdf</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="
|
||||
typeReport.val == 'report1' ||
|
||||
typeReport.val == 'report2' ||
|
||||
typeReport.val == 'report3'
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="downloadReport('docx')"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="blue" name="mdi-file-word"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .docx</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="downloadReport('xlsx')"
|
||||
v-if="typeReport.val !== 'report1'"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="green" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .xlsx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</q-card>
|
||||
<q-card flat bordered class="col-12">
|
||||
<q-card-section :horizontal="$q.screen.gt.sm">
|
||||
<q-card-section class="col-lg-3 col-md-4 col-xs-12 q-gutter-sm">
|
||||
<div class="col">
|
||||
<q-input dense outlined v-model="filterTree" label="ค้นหา">
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
|
||||
<div class="bg-white tree-container q-pa-xs">
|
||||
<q-tree
|
||||
dense
|
||||
:nodes="node"
|
||||
node-key="orgTreeId"
|
||||
label-key="labelName"
|
||||
v-model:expanded="expanded"
|
||||
:filter="filterTree.trim()"
|
||||
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||
no-nodes-label="ไม่มีข้อมูล"
|
||||
>
|
||||
<template v-slot:default-header="prop">
|
||||
<q-item
|
||||
@click.stop="
|
||||
onSelectedNode(prop.node.orgTreeDnaId, prop.node.orgLevel)
|
||||
"
|
||||
:active="nodeId === prop.node.orgTreeDnaId"
|
||||
clickable
|
||||
active-class="my-list-link text-primary text-weight-medium"
|
||||
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||
<div class="col-12">
|
||||
<q-card class="q-pa-sm">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col">
|
||||
<q-card flat bordered>
|
||||
<q-card-section
|
||||
bordered
|
||||
class="bg-primary text-subtitle2 text-white q-pa-sm row items-center"
|
||||
>
|
||||
<div>
|
||||
<div class="text-weight-medium">
|
||||
{{ prop.node.orgTreeName }}
|
||||
</div>
|
||||
<div class="text-weight-light text-grey-8">
|
||||
{{ prop.node.orgCode == null ? null : prop.node.orgCode }}
|
||||
{{
|
||||
prop.node.orgTreeShortName == null
|
||||
? null
|
||||
: prop.node.orgTreeShortName
|
||||
}}
|
||||
<q-icon name="mdi-filter" class="q-mr-xs" />
|
||||
ตัวกรอง
|
||||
<q-space />
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
class="q-px-sm"
|
||||
rounded
|
||||
flat
|
||||
label="ล้างทั้งหมด"
|
||||
@click.stop.pervent="clearFilter"
|
||||
/>
|
||||
</q-card-section>
|
||||
<q-card-section class="q-pa-none">
|
||||
<div class="col-12">
|
||||
<q-expansion-item
|
||||
v-model="expandedModal"
|
||||
dense
|
||||
dense-toggle
|
||||
expand-separator
|
||||
class="expansion-item"
|
||||
>
|
||||
<template #header>
|
||||
<div class="full-width flex items-stretch">
|
||||
<q-input
|
||||
dense
|
||||
:model-value="org"
|
||||
autogrow
|
||||
borderless
|
||||
label="สังกัด"
|
||||
class="bg-white full-width"
|
||||
>
|
||||
</q-input>
|
||||
</div>
|
||||
<!-- @click="onOpenOrg" -->
|
||||
</template>
|
||||
<q-separator />
|
||||
|
||||
<q-card-section v-if="isLoadStructureTree">
|
||||
<LoadView />
|
||||
</q-card-section>
|
||||
<q-card-section v-else>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="filterTree"
|
||||
label="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
v-if="filterTree !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="filterTree = ''"
|
||||
/>
|
||||
<q-icon v-else name="search" color="grey-5" />
|
||||
</template>
|
||||
</q-input>
|
||||
<q-tree
|
||||
dense
|
||||
:nodes="node"
|
||||
node-key="orgTreeId"
|
||||
label-key="labelName"
|
||||
v-model:expanded="expanded"
|
||||
:filter="filterTree.trim()"
|
||||
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||
no-nodes-label="ไม่มีข้อมูล"
|
||||
class="tree-container-report q-mt-sm"
|
||||
>
|
||||
<template v-slot:default-header="prop">
|
||||
<q-item
|
||||
@click.stop="onSelectedNode(prop.node)"
|
||||
:active="nodeId === prop.node.orgTreeId"
|
||||
clickable
|
||||
active-class="my-list-link text-primary text-weight-medium"
|
||||
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||
>
|
||||
<div>
|
||||
<div class="text-weight-medium">
|
||||
{{ prop.node.orgTreeName }}
|
||||
</div>
|
||||
<div class="text-weight-light text-grey-8">
|
||||
{{
|
||||
prop.node.orgCode == null
|
||||
? null
|
||||
: prop.node.orgCode
|
||||
}}
|
||||
{{
|
||||
prop.node.orgTreeShortName == null
|
||||
? null
|
||||
: prop.node.orgTreeShortName
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-tree>
|
||||
</q-card-section>
|
||||
</q-expansion-item>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="col-12 q-px-sm">
|
||||
<q-select
|
||||
class="bg-white"
|
||||
hide-bottom-space
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
v-model="typeReport"
|
||||
:label="`${'รายงาน'}`"
|
||||
map-options
|
||||
:options="employeeClass == 'officer' ? optionReport.filter((item:any)=>item.id !== '7'):optionReport.filter((item:any)=>item.id !== '4')"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
/>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="col-12 q-px-sm">
|
||||
<q-select
|
||||
v-if="
|
||||
typeReport &&
|
||||
(typeReport.val == 'report1' ||
|
||||
typeReport.val == 'report2' ||
|
||||
typeReport.val == 'report3')
|
||||
"
|
||||
class="bg-white"
|
||||
use-input
|
||||
fill-input
|
||||
hide-selected
|
||||
dense
|
||||
borderless
|
||||
lazy-rules
|
||||
v-model="roundId"
|
||||
:options="roundOtion"
|
||||
label="เลือกรอบ"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
emit-value
|
||||
map-options
|
||||
@filter="(inputValue:string,doneFn:Function) =>
|
||||
filterSelector(inputValue, doneFn,'round') "
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
|
||||
<q-select
|
||||
v-else
|
||||
class="bg-white"
|
||||
use-input
|
||||
fill-input
|
||||
hide-selected
|
||||
dense
|
||||
borderless
|
||||
lazy-rules
|
||||
v-model="roundId2"
|
||||
:options="roundOtion2"
|
||||
label="เลือกรอบ"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
emit-value
|
||||
map-options
|
||||
@filter="(inputValue:string,doneFn:Function) =>
|
||||
filterSelector(inputValue, doneFn,'round') "
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
dense
|
||||
class="q-px-md"
|
||||
label="ค้นหา"
|
||||
unelevated
|
||||
color="public"
|
||||
type="submit"
|
||||
:disable="
|
||||
nodeId == '' || !typeReport || (!roundId && !roundId2)
|
||||
"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12 col-xs-12 flex">
|
||||
<q-splitter
|
||||
horizontal
|
||||
style="
|
||||
height: 75vh;
|
||||
border: 1px solid rgb(210, 210, 210);
|
||||
border-radius: 5px;
|
||||
width: 100%;
|
||||
"
|
||||
before-class="overflow-hidden disable"
|
||||
separator-class="bg-white disabled"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<div class="q-px-sm">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-tree>
|
||||
</template>
|
||||
<template v-slot:after>
|
||||
<div class="q-pa-md">
|
||||
<LoadView v-if="isLoadPDF" />
|
||||
<VuePDF
|
||||
v-else-if="!isLoadPDF && pdfSrc"
|
||||
ref="vuePDFRef"
|
||||
:pdf="pdfSrc"
|
||||
:page="page"
|
||||
fit-parent
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div class="q-pa-md">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</q-splitter>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-separator :vertical="$q.screen.gt.xs" />
|
||||
|
||||
<q-card-section class="col-lg-9 col-md-8 col-xs-12 scroll">
|
||||
<q-splitter
|
||||
v-model="splitterModel"
|
||||
horizontal
|
||||
style="
|
||||
height: 65vh;
|
||||
border: 1px solid rgb(210, 210, 210);
|
||||
border-radius: 5px;
|
||||
"
|
||||
before-class="overflow-hidden disable"
|
||||
separator-class="bg-white disabled"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<div class="q-px-sm">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:after>
|
||||
<div class="q-pa-md">
|
||||
<LoadView v-if="isLoadPDF" />
|
||||
<VuePDF
|
||||
v-else
|
||||
ref="vuePDFRef"
|
||||
:pdf="pdfSrc"
|
||||
:page="page"
|
||||
fit-parent
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div class="q-pa-md">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</q-splitter>
|
||||
</q-card-section>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scope>
|
||||
<style lang="scss" scoped>
|
||||
.q-item.hover-green:hover {
|
||||
background-color: #d5f1ee57;
|
||||
border-radius: 2px;
|
||||
|
|
@ -667,4 +758,17 @@ onMounted(async () => {
|
|||
font-weight: 600;
|
||||
border: 1px solid rgba(175, 185, 196, 0.217);
|
||||
}
|
||||
.tree-container-report {
|
||||
overflow: auto;
|
||||
max-height: 50vh;
|
||||
}
|
||||
|
||||
:deep(.expansion-item .q-item__section) {
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
||||
:deep(.expansion-item .q-item) {
|
||||
min-height: 32px;
|
||||
padding: 2px 9px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -29,6 +29,10 @@ const route = useRoute();
|
|||
const { fetchStructureTree } = useStructureTree();
|
||||
const { messageError, showLoader, hideLoader } = useCounterMixin();
|
||||
|
||||
const expandedModal = ref<boolean>(false);
|
||||
const org = ref<string>("");
|
||||
const isLoadStructureTree = ref<boolean>(true);
|
||||
|
||||
const year = ref<number>(new Date().getFullYear());
|
||||
const employeeClass = ref<string>("officer");
|
||||
const employeeClassOption = ref<OptionData[]>([
|
||||
|
|
@ -104,13 +108,21 @@ const detailReport = ref<any>();
|
|||
const fileBlob = ref<any>();
|
||||
|
||||
async function fetchDataTree() {
|
||||
node.value = await fetchStructureTree(route.meta.Key as string, true);
|
||||
try {
|
||||
isLoadStructureTree.value = true;
|
||||
node.value = await fetchStructureTree(route.meta.Key as string, true);
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
isLoadStructureTree.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
function onSelectedNode(id: string, level: number) {
|
||||
nodeId.value = id;
|
||||
nodeLevel.value = level;
|
||||
onUpdateFilter();
|
||||
function onSelectedNode(data: any) {
|
||||
nodeId.value = data.orgTreeId;
|
||||
nodeLevel.value = data.orgLevel;
|
||||
org.value = data.orgName;
|
||||
expandedModal.value = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -142,7 +154,7 @@ async function onUpdateFilter() {
|
|||
.post(config.API.disciplineReportByType(employeeClass.value), body)
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
// detailReport.value = data;
|
||||
detailReport.value = data;
|
||||
data && (await genReportPreview(data));
|
||||
})
|
||||
.catch(async (e) => {
|
||||
|
|
@ -264,6 +276,22 @@ function updateLevel(val: string) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
function clearFilter() {
|
||||
year.value = new Date().getFullYear();
|
||||
offenseDetail.value = "ALL";
|
||||
disciplinaryFaultLevel.value = "ALL";
|
||||
status.value = "ALL";
|
||||
posType.value = "";
|
||||
posLevel.value = "";
|
||||
|
||||
pdfSrc.value = undefined;
|
||||
detailReport.value = undefined;
|
||||
org.value = "";
|
||||
nodeId.value = "";
|
||||
nodeLevel.value = 0;
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await Promise.all([fetchDataTree(), getType()]);
|
||||
});
|
||||
|
|
@ -272,383 +300,453 @@ onMounted(async () => {
|
|||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">รายงานวินัย</div>
|
||||
|
||||
<div class="q-pa-sm q-gutter-sm">
|
||||
<q-card flat bordered class="col-12">
|
||||
<div class="row q-col-gutter-sm q-pa-sm">
|
||||
<div class="row col-12">
|
||||
<q-select
|
||||
outlined
|
||||
dense
|
||||
v-model="employeeClass"
|
||||
:options="employeeClassOption"
|
||||
label="สภานภาพ"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
style="width: 230px"
|
||||
@update:model-value="getType"
|
||||
>
|
||||
</q-select>
|
||||
|
||||
<q-space />
|
||||
<q-btn
|
||||
:disable="!nodeId"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="download"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
:loading="isLoadPDF"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
genReportXLSX(
|
||||
detailReport,
|
||||
`รายชื่อที่กระทำความผิดทางวินัย_${
|
||||
employeeClass == 'officer'
|
||||
? 'ข้าราชการ กทม. สามัญ'
|
||||
: 'ลูกจ้างประจำ กทม.'
|
||||
}_${year + 543}`,
|
||||
'pdf'
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .pdf</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
genReportXLSX(
|
||||
detailReport,
|
||||
`รายชื่อที่กระทำความผิดทางวินัย_${
|
||||
employeeClass == 'officer'
|
||||
? 'ข้าราชการ กทม. สามัญ'
|
||||
: 'ลูกจ้างประจำ กทม.'
|
||||
}_${year + 543}`,
|
||||
'xlsx'
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="green" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .xlsx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
<div class="row col-12">
|
||||
<q-card bordered class="col-12 filter-card q-pa-sm">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div class="col-md-4 col-xs-12">
|
||||
<datepicker
|
||||
v-model="year"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
@update:model-value="onUpdateFilter"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="bg-white"
|
||||
dense
|
||||
outlined
|
||||
:model-value="Number(year) + 543"
|
||||
:label="`${'ปีพ.ศ.'}`"
|
||||
<q-form greedy @submit.prevent @validation-success="onUpdateFilter">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-card class="q-pa-sm">
|
||||
<div class="row q-col-gutter-sm no-wrap">
|
||||
<div class="col-lg-2 col-md-3 col-sm-3 col-xs-12">
|
||||
<q-select
|
||||
outlined
|
||||
dense
|
||||
v-model="employeeClass"
|
||||
:options="employeeClassOption"
|
||||
label="สภานภาพ"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
@update:model-value="getType"
|
||||
>
|
||||
</q-select>
|
||||
</div>
|
||||
<q-space />
|
||||
<div>
|
||||
<q-btn
|
||||
:disable="!detailReport"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="download"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
:loading="isLoadPDF"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
genReportXLSX(
|
||||
detailReport,
|
||||
`รายชื่อที่กระทำความผิดทางวินัย_${
|
||||
employeeClass == 'officer'
|
||||
? 'ข้าราชการ กทม. สามัญ'
|
||||
: 'ลูกจ้างประจำ กทม.'
|
||||
}_${year + 543}`,
|
||||
'pdf'
|
||||
)
|
||||
"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .pdf</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
genReportXLSX(
|
||||
detailReport,
|
||||
`รายชื่อที่กระทำความผิดทางวินัย_${
|
||||
employeeClass == 'officer'
|
||||
? 'ข้าราชการ กทม. สามัญ'
|
||||
: 'ลูกจ้างประจำ กทม.'
|
||||
}_${year + 543}`,
|
||||
'xlsx'
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="green" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .xlsx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-card class="q-pa-sm">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col">
|
||||
<q-card flat bordered>
|
||||
<q-card-section
|
||||
bordered
|
||||
class="bg-primary text-subtitle2 text-white q-pa-sm row items-center"
|
||||
>
|
||||
<q-icon name="mdi-filter" class="q-mr-xs" />
|
||||
ตัวกรอง
|
||||
<q-space />
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
class="q-px-sm"
|
||||
rounded
|
||||
flat
|
||||
label="ล้างทั้งหมด"
|
||||
@click.stop.pervent="clearFilter"
|
||||
/>
|
||||
</q-card-section>
|
||||
<q-card-section class="q-pa-none">
|
||||
<div class="col-12">
|
||||
<q-expansion-item
|
||||
v-model="expandedModal"
|
||||
dense
|
||||
dense-toggle
|
||||
expand-separator
|
||||
class="expansion-item"
|
||||
>
|
||||
<template #header>
|
||||
<div class="full-width flex items-stretch">
|
||||
<q-input
|
||||
dense
|
||||
:model-value="org"
|
||||
autogrow
|
||||
borderless
|
||||
label="สังกัด"
|
||||
class="bg-white full-width"
|
||||
>
|
||||
</q-input>
|
||||
</div>
|
||||
<!-- @click="onOpenOrg" -->
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-md-4 col-xs-12">
|
||||
<q-select
|
||||
class="bg-white"
|
||||
hide-bottom-space
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
v-model="offenseDetail"
|
||||
:label="`${'ลักษณะความผิด'}`"
|
||||
emit-value
|
||||
map-options
|
||||
:options="offenseDetailOp"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
@update:model-value="onUpdateFilter"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-4 col-xs-12">
|
||||
<q-select
|
||||
class="bg-white"
|
||||
hide-bottom-space
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
v-model="disciplinaryFaultLevel"
|
||||
:label="`${'ระดับความผิด'}`"
|
||||
emit-value
|
||||
map-options
|
||||
:options="disciplinaryFaultLevelOp"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
@update:model-value="onUpdateFilter"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-4 col-xs-12">
|
||||
<q-select
|
||||
class="bg-white"
|
||||
hide-bottom-space
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
v-model="status"
|
||||
:label="`${'สถานะของเรื่อง'}`"
|
||||
emit-value
|
||||
map-options
|
||||
:options="statusOp"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
@update:model-value="onUpdateFilter"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-4 col-xs-12">
|
||||
<q-select
|
||||
class="bg-white"
|
||||
hide-bottom-space
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
hide-selected
|
||||
v-model="posType"
|
||||
:label="`${
|
||||
employeeClass == 'officer' ? 'ประเภทตำแหน่ง' : 'กลุ่มงาน'
|
||||
}`"
|
||||
emit-value
|
||||
map-options
|
||||
:options="posTypeOp"
|
||||
option-value="id"
|
||||
option-label="posTypeName"
|
||||
use-input
|
||||
fill-input
|
||||
@update:model-value="(value:string)=>(posLevel = '',onUpdateFilter(),updateLevel(value))"
|
||||
@filter="(inputValue:any, doneFn:Function) =>
|
||||
<q-separator />
|
||||
|
||||
<q-card-section v-if="isLoadStructureTree">
|
||||
<LoadView />
|
||||
</q-card-section>
|
||||
<q-card-section v-else>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="filterTree"
|
||||
label="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
v-if="filterTree !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="filterTree = ''"
|
||||
/>
|
||||
<q-icon v-else name="search" color="grey-5" />
|
||||
</template>
|
||||
</q-input>
|
||||
<q-tree
|
||||
dense
|
||||
:nodes="node"
|
||||
node-key="orgTreeId"
|
||||
label-key="labelName"
|
||||
v-model:expanded="expanded"
|
||||
:filter="filterTree.trim()"
|
||||
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||
no-nodes-label="ไม่มีข้อมูล"
|
||||
class="tree-container-report q-mt-sm"
|
||||
>
|
||||
<template v-slot:default-header="prop">
|
||||
<q-item
|
||||
@click.stop="onSelectedNode(prop.node)"
|
||||
:active="nodeId === prop.node.orgTreeId"
|
||||
clickable
|
||||
active-class="my-list-link text-primary text-weight-medium"
|
||||
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||
>
|
||||
<div>
|
||||
<div class="text-weight-medium">
|
||||
{{ prop.node.orgTreeName }}
|
||||
</div>
|
||||
<div class="text-weight-light text-grey-8">
|
||||
{{
|
||||
prop.node.orgCode == null
|
||||
? null
|
||||
: prop.node.orgCode
|
||||
}}
|
||||
{{
|
||||
prop.node.orgTreeShortName == null
|
||||
? null
|
||||
: prop.node.orgTreeShortName
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-tree>
|
||||
</q-card-section>
|
||||
</q-expansion-item>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="col-12 q-px-sm q-pb-xs">
|
||||
<datepicker
|
||||
v-model="year"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
class="bg-white"
|
||||
dense
|
||||
borderless
|
||||
:model-value="Number(year) + 543"
|
||||
:label="`${'ปีพ.ศ.'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
size="18px"
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="col-12 q-px-sm">
|
||||
<q-select
|
||||
class="bg-white"
|
||||
hide-bottom-space
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
v-model="offenseDetail"
|
||||
:label="`${'ลักษณะความผิด'}`"
|
||||
emit-value
|
||||
map-options
|
||||
:options="offenseDetailOp"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
/>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="col-12 q-px-sm">
|
||||
<q-select
|
||||
class="bg-white"
|
||||
hide-bottom-space
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
v-model="disciplinaryFaultLevel"
|
||||
:label="`${'ระดับความผิด'}`"
|
||||
emit-value
|
||||
map-options
|
||||
:options="disciplinaryFaultLevelOp"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
/>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="col-12 q-px-sm">
|
||||
<q-select
|
||||
class="bg-white"
|
||||
hide-bottom-space
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
v-model="status"
|
||||
:label="`${'สถานะของเรื่อง'}`"
|
||||
emit-value
|
||||
map-options
|
||||
:options="statusOp"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
/>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="col-12 q-px-sm">
|
||||
<q-select
|
||||
class="bg-white"
|
||||
hide-bottom-space
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
hide-selected
|
||||
v-model="posType"
|
||||
:label="`${
|
||||
employeeClass == 'officer'
|
||||
? 'ประเภทตำแหน่ง'
|
||||
: 'กลุ่มงาน'
|
||||
}`"
|
||||
emit-value
|
||||
map-options
|
||||
:options="posTypeOp"
|
||||
option-value="id"
|
||||
option-label="posTypeName"
|
||||
use-input
|
||||
fill-input
|
||||
@update:model-value="(value:string)=>(posLevel = '',onUpdateFilter(),updateLevel(value))"
|
||||
@filter="(inputValue:any, doneFn:Function) =>
|
||||
filterOption(inputValue, doneFn,'type')
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-4 col-xs-12">
|
||||
<q-select
|
||||
class="bg-white"
|
||||
hide-bottom-space
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
hide-selected
|
||||
v-model="posLevel"
|
||||
:label="`${
|
||||
employeeClass == 'officer' ? 'ระดับตำแหน่ง' : 'ระดับชั้นงาน'
|
||||
}`"
|
||||
emit-value
|
||||
map-options
|
||||
:options="posLevelOp"
|
||||
option-value="id"
|
||||
option-label="posLevelName"
|
||||
use-input
|
||||
fill-input
|
||||
@update:model-value="onUpdateFilter"
|
||||
@filter="(inputValue:any, doneFn:Function) =>
|
||||
/>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="col-12 q-px-sm">
|
||||
<q-select
|
||||
class="bg-white"
|
||||
hide-bottom-space
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
hide-selected
|
||||
v-model="posLevel"
|
||||
:label="`${
|
||||
employeeClass == 'officer'
|
||||
? 'ระดับตำแหน่ง'
|
||||
: 'ระดับชั้นงาน'
|
||||
}`"
|
||||
emit-value
|
||||
map-options
|
||||
:options="posLevelOp"
|
||||
option-value="id"
|
||||
option-label="posLevelName"
|
||||
use-input
|
||||
fill-input
|
||||
@filter="(inputValue:any, doneFn:Function) =>
|
||||
filterOption(inputValue, doneFn,'level')
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
/>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
dense
|
||||
class="q-px-md"
|
||||
label="ค้นหา"
|
||||
unelevated
|
||||
color="public"
|
||||
type="submit"
|
||||
:disable="nodeId == ''"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12 col-xs-12 flex">
|
||||
<q-splitter
|
||||
horizontal
|
||||
style="
|
||||
height: 75vh;
|
||||
border: 1px solid rgb(210, 210, 210);
|
||||
border-radius: 5px;
|
||||
width: 100%;
|
||||
"
|
||||
before-class="overflow-hidden disable"
|
||||
separator-class="bg-white disabled"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<div class="q-px-sm">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:after>
|
||||
<div class="q-pa-md">
|
||||
<LoadView v-if="isLoadPDF" />
|
||||
<VuePDF
|
||||
v-else-if="!isLoadPDF && pdfSrc"
|
||||
ref="vuePDFRef"
|
||||
:pdf="pdfSrc"
|
||||
:page="page"
|
||||
fit-parent
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div class="q-pa-md">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</q-splitter>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</q-card>
|
||||
<q-card flat bordered class="col-12">
|
||||
<q-card-section :horizontal="$q.screen.gt.sm">
|
||||
<q-card-section class="col-lg-3 col-md-4 col-xs-12 q-gutter-sm">
|
||||
<div class="col">
|
||||
<q-input dense outlined v-model="filterTree" label="ค้นหา">
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
|
||||
<div class="bg-white tree-container q-pa-xs">
|
||||
<q-tree
|
||||
dense
|
||||
:nodes="node"
|
||||
node-key="orgTreeId"
|
||||
label-key="labelName"
|
||||
v-model:expanded="expanded"
|
||||
:filter="filterTree.trim()"
|
||||
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||
no-nodes-label="ไม่มีข้อมูล"
|
||||
>
|
||||
<template v-slot:default-header="prop">
|
||||
<q-item
|
||||
@click.stop="
|
||||
onSelectedNode(prop.node.orgTreeId, prop.node.orgLevel)
|
||||
"
|
||||
:active="nodeId === prop.node.orgTreeId"
|
||||
clickable
|
||||
active-class="my-list-link text-primary text-weight-medium"
|
||||
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||
>
|
||||
<div>
|
||||
<div class="text-weight-medium">
|
||||
{{ prop.node.orgTreeName }}
|
||||
</div>
|
||||
<div class="text-weight-light text-grey-8">
|
||||
{{ prop.node.orgCode == null ? null : prop.node.orgCode }}
|
||||
{{
|
||||
prop.node.orgTreeShortName == null
|
||||
? null
|
||||
: prop.node.orgTreeShortName
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-tree>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-separator :vertical="$q.screen.gt.xs" />
|
||||
|
||||
<q-card-section class="col-lg-9 col-md-8 col-xs-12 scroll">
|
||||
<q-splitter
|
||||
v-model="splitterModel"
|
||||
horizontal
|
||||
style="
|
||||
height: 65vh;
|
||||
border: 1px solid rgb(210, 210, 210);
|
||||
border-radius: 5px;
|
||||
"
|
||||
before-class="overflow-hidden disable"
|
||||
separator-class="bg-white disabled"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<div class="q-px-sm">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:after>
|
||||
<div class="q-pa-md">
|
||||
<LoadView v-if="isLoadPDF" />
|
||||
<VuePDF
|
||||
v-else
|
||||
ref="vuePDFRef"
|
||||
:pdf="pdfSrc"
|
||||
:page="page"
|
||||
fit-parent
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div class="q-pa-md">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</q-splitter>
|
||||
</q-card-section>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scope>
|
||||
<style lang="scss" scoped>
|
||||
.q-item.hover-green:hover {
|
||||
background-color: #d5f1ee57;
|
||||
border-radius: 2px;
|
||||
|
|
@ -670,4 +768,18 @@ onMounted(async () => {
|
|||
font-weight: 600;
|
||||
border: 1px solid rgba(175, 185, 196, 0.217);
|
||||
}
|
||||
|
||||
.tree-container-report {
|
||||
overflow: auto;
|
||||
max-height: 50vh;
|
||||
}
|
||||
|
||||
:deep(.expansion-item .q-item__section) {
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
||||
:deep(.expansion-item .q-item) {
|
||||
min-height: 32px;
|
||||
padding: 2px 9px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import config from "@/app.config";
|
|||
import http from "@/plugins/http";
|
||||
import axios from "axios";
|
||||
import genReport from "@/plugins/genreport";
|
||||
|
||||
import LoadView from "@/components/LoadView.vue";
|
||||
/**
|
||||
* importType
|
||||
*/
|
||||
|
|
@ -43,13 +43,15 @@ const route = useRoute();
|
|||
/**
|
||||
* ตัวแปรงาน
|
||||
*/
|
||||
const fullNameShow = ref<string>("");
|
||||
const isLoadPDF = ref<boolean>(false);
|
||||
const year = ref<number | null>(new Date().getFullYear());
|
||||
const round = ref<string>("");
|
||||
const organization = ref<string>("");
|
||||
const roundOp = ref<DataOption[]>([]);
|
||||
const organizationOpsMain = ref<DataOption[]>([]);
|
||||
const organizationOps = ref<DataOption[]>([]);
|
||||
const typeReport = ref<string>("");
|
||||
const typeReport = ref<string>("KPI1");
|
||||
const listReportMain = ref<DataOption[]>([
|
||||
{
|
||||
id: "KPI1",
|
||||
|
|
@ -88,7 +90,7 @@ const listReportMain = ref<DataOption[]>([
|
|||
name: "จัดทำประกาศผู้มีผลการปฏิบัติราชการระดับดีเด่นและดีมาก",
|
||||
},
|
||||
]);
|
||||
const listReport = ref<DataOption[]>([]); // รายการรายงานทั้งหมด
|
||||
const listReport = ref<DataOption[]>(listReportMain.value); // รายการรายงานทั้งหมด
|
||||
|
||||
/**
|
||||
* funtion fetchข้อมูลรอบการประเมิน
|
||||
|
|
@ -170,6 +172,7 @@ function fetchListOrg(id: string) {
|
|||
* function fetch รายงาน
|
||||
*/
|
||||
function fetchReport() {
|
||||
isLoadPDF.value = true;
|
||||
showLoader();
|
||||
const body = {
|
||||
type: typeReport.value,
|
||||
|
|
@ -180,12 +183,14 @@ function fetchReport() {
|
|||
http
|
||||
.post(config.API.kpiReport(), body)
|
||||
.then((res) => {
|
||||
isLoadPDF.value = false;
|
||||
dataDownload.value = res.data.result;
|
||||
page.value = 1;
|
||||
genPDf(res.data.result);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
isLoadPDF.value = false;
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
|
@ -462,8 +467,12 @@ function fetchListPerson() {
|
|||
* functiuon เลือกราชชื่อ
|
||||
* @param id profile ID
|
||||
*/
|
||||
function onSelectPerson(id: string) {
|
||||
persanalId.value = id;
|
||||
function onSelectPerson(data: any) {
|
||||
persanalId.value = data.id;
|
||||
fullNameShow.value = `${data.prefix ?? ""}${data.firstName ?? ""} ${
|
||||
data.lastName ?? ""
|
||||
}`;
|
||||
|
||||
onCloseModal();
|
||||
fetchReport();
|
||||
}
|
||||
|
|
@ -484,6 +493,14 @@ watch(
|
|||
}
|
||||
);
|
||||
|
||||
function clearFilter() {
|
||||
organization.value = "";
|
||||
year.value = new Date().getFullYear();
|
||||
typeReport.value = "KPI1";
|
||||
pdfSrc.value = undefined;
|
||||
dataDownload.value = undefined;
|
||||
fullNameShow.value = "";
|
||||
}
|
||||
onMounted(() => {
|
||||
fetchRoundOption();
|
||||
fetchActiveId();
|
||||
|
|
@ -491,77 +508,353 @@ onMounted(() => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">รายงาน</div>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
รายงานประเมินผลการปฏิบัติราชการระดับบุคคล
|
||||
</div>
|
||||
|
||||
<q-form greedy @submit.prevent @validation-success="fetchReport">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-card class="q-pa-sm">
|
||||
<div class="row q-col-gutter-sm no-wrap">
|
||||
<q-select
|
||||
:readonly="!checkPermission($route)?.attrIsGet"
|
||||
dense
|
||||
style="min-width: 550px"
|
||||
hide-bottom-space
|
||||
outlined
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
emit-value
|
||||
map-options
|
||||
v-model="typeReport"
|
||||
:options="listReport"
|
||||
label="รายงาน"
|
||||
use-input
|
||||
hide-selected
|
||||
fill-input
|
||||
@update:model-value="changOption"
|
||||
@filter="(inputValue: string,
|
||||
|
||||
doneFn: Function) => filterSelector(inputValue, doneFn ,'typereport')"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template></q-select
|
||||
>
|
||||
|
||||
<q-space />
|
||||
<div>
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="download"
|
||||
:disable="!dataDownload"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="downloadReport(dataDownload, 'pdf')"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .pdf</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="downloadReport(dataDownload, 'docx')"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="blue" name="mdi-file-word"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .docx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-card class="q-pa-sm">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col">
|
||||
<q-card flat bordered>
|
||||
<q-card-section
|
||||
bordered
|
||||
class="bg-primary text-subtitle2 text-white q-pa-sm row items-center"
|
||||
>
|
||||
<q-icon name="mdi-filter" class="q-mr-xs" />
|
||||
ตัวกรอง
|
||||
<q-space />
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
class="q-px-sm"
|
||||
rounded
|
||||
flat
|
||||
label="ล้างทั้งหมด"
|
||||
@click.stop.pervent="clearFilter"
|
||||
/>
|
||||
</q-card-section>
|
||||
<q-card-section class="q-pa-none">
|
||||
<div
|
||||
class="row"
|
||||
v-if="
|
||||
typeReport === 'KPI1' ||
|
||||
typeReport === 'KPI2' ||
|
||||
typeReport === 'KPI3' ||
|
||||
typeReport === 'KPI7' ||
|
||||
typeReport === 'KPI8' ||
|
||||
typeReport === 'KPI9'
|
||||
"
|
||||
>
|
||||
<div class="col-12 q-px-sm">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="year"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
@update:model-value="fetchRoundOption()"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
dense
|
||||
borderless
|
||||
hide-bottom-space
|
||||
:model-value="!!year ? year + 543 : null"
|
||||
:label="`${'ปีงบประมาณ'}`"
|
||||
class="bg-white"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-12"><q-separator/></div>
|
||||
<div class="col-12 q-px-sm">
|
||||
<q-select
|
||||
ref="roundRef"
|
||||
class="bg-white"
|
||||
v-model="round"
|
||||
label="รอบการประเมิน"
|
||||
dense
|
||||
borderless
|
||||
hide-bottom-space
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
:options="roundOp"
|
||||
style="min-width: 150px"
|
||||
emit-value
|
||||
map-options
|
||||
:disable="roundOp.length === 0"
|
||||
@update:model-value="changOption(typeReport)"
|
||||
lazy-rules
|
||||
:rules="
|
||||
typeReport === 'KPI8'
|
||||
? [(val:string) => !!val || 'กรุณาเลือกรอบการประเมิน']
|
||||
: []
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12"><q-separator/></div>
|
||||
<div class="col-12 q-pb-xs q-px-sm" v-if="typeReport !== 'KPI8'">
|
||||
<q-select
|
||||
class="bg-white"
|
||||
:disable="roundOp.length === 0"
|
||||
dense
|
||||
borderless
|
||||
hide-selected
|
||||
fill-input
|
||||
hide-bottom-space
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
emit-value
|
||||
map-options
|
||||
v-model="organization"
|
||||
:options="organizationOps"
|
||||
label="หน่วยงาน"
|
||||
use-input
|
||||
@update:model-value="changOption(typeReport)"
|
||||
@filter="(inputValue: string,
|
||||
|
||||
doneFn: Function) => filterSelector(inputValue, doneFn,'organization' )"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template></q-select
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="row q-pa-sm q-col-gutter-xs"
|
||||
v-if="
|
||||
typeReport === 'KPI4' ||
|
||||
typeReport === 'KPI5' ||
|
||||
typeReport === 'KPI6' ||
|
||||
typeReport === 'KPI8'
|
||||
"
|
||||
>
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
label="ชื่อ-นามสกุล"
|
||||
dense
|
||||
disable
|
||||
:model-value="
|
||||
fullNameShow ? fullNameShow : 'กรุณาเลือกรายชื่อ'
|
||||
"
|
||||
>
|
||||
</q-input>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-btn
|
||||
class="full-width"
|
||||
color="primary"
|
||||
label="เลือกรายชื่อ"
|
||||
@click="onClickModal"
|
||||
:disable="roundOp.length === 0 && typeReport === 'KPI8'"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12 col-xs-12 flex">
|
||||
<q-splitter
|
||||
horizontal
|
||||
style="
|
||||
height: 75vh;
|
||||
border: 1px solid rgb(210, 210, 210);
|
||||
border-radius: 5px;
|
||||
width: 100%;
|
||||
"
|
||||
before-class="overflow-hidden disable"
|
||||
separator-class="bg-white disabled"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<div class="q-px-sm">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:after>
|
||||
<div class="q-pa-md">
|
||||
<LoadView v-if="isLoadPDF" />
|
||||
<VuePDF
|
||||
v-else-if="!isLoadPDF && pdfSrc"
|
||||
ref="vuePDFRef"
|
||||
:pdf="pdfSrc"
|
||||
:page="page"
|
||||
fit-parent
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div class="q-pa-md">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</q-splitter>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
|
||||
<q-card flat bordered>
|
||||
<q-card-section class="q-gutter-y-sm">
|
||||
<q-toolbar style="padding: 0">
|
||||
<div class="row q-gutter-sm">
|
||||
<q-select
|
||||
:readonly="!checkPermission($route)?.attrIsGet"
|
||||
dense
|
||||
style="min-width: 550px"
|
||||
hide-bottom-space
|
||||
outlined
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
emit-value
|
||||
map-options
|
||||
v-model="typeReport"
|
||||
:options="listReport"
|
||||
label="รายงาน"
|
||||
use-input
|
||||
hide-selected
|
||||
fill-input
|
||||
@update:model-value="changOption"
|
||||
@filter="(inputValue: string,
|
||||
|
||||
doneFn: Function) => filterSelector(inputValue, doneFn ,'typereport')"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
||||
</q-item>
|
||||
</template></q-select
|
||||
>
|
||||
</div>
|
||||
<div class="row q-gutter-sm"></div>
|
||||
|
||||
<q-space />
|
||||
|
||||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="download"
|
||||
:disable="!dataDownload"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="downloadReport(dataDownload, 'pdf')"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .pdf</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="downloadReport(dataDownload, 'docx')"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="blue" name="mdi-file-word"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .docx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-toolbar>
|
||||
|
||||
<q-toolbar
|
||||
class="q-pa-sm bg-grey-2"
|
||||
style="padding: 0; border-radius: 5px"
|
||||
|
|
@ -577,94 +870,7 @@ onMounted(() => {
|
|||
typeReport === 'KPI8' ||
|
||||
typeReport === 'KPI9'
|
||||
"
|
||||
>
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="year"
|
||||
style="width: 150px"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
@update:model-value="fetchRoundOption()"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
hide-bottom-space
|
||||
:model-value="!!year ? year + 543 : null"
|
||||
:label="`${'ปีงบประมาณ'}`"
|
||||
class="bg-white"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
<q-select
|
||||
ref="roundRef"
|
||||
class="bg-white"
|
||||
v-model="round"
|
||||
outlined
|
||||
label="รอบการประเมิน"
|
||||
dense
|
||||
hide-bottom-space
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
:options="roundOp"
|
||||
style="min-width: 150px"
|
||||
emit-value
|
||||
map-options
|
||||
:disable="roundOp.length === 0"
|
||||
@update:model-value="changOption(typeReport)"
|
||||
lazy-rules
|
||||
:rules="
|
||||
typeReport === 'KPI8'
|
||||
? [(val:string) => !!val || 'กรุณาเลือกรอบการประเมิน']
|
||||
: []
|
||||
"
|
||||
/>
|
||||
<q-select
|
||||
v-if="typeReport !== 'KPI8'"
|
||||
class="bg-white"
|
||||
:disable="roundOp.length === 0"
|
||||
style="min-width: 100px"
|
||||
dense
|
||||
hide-selected
|
||||
fill-input
|
||||
hide-bottom-space
|
||||
outlined
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
emit-value
|
||||
map-options
|
||||
v-model="organization"
|
||||
:options="organizationOps"
|
||||
label="หน่วยงาน"
|
||||
use-input
|
||||
@update:model-value="changOption(typeReport)"
|
||||
@filter="(inputValue: string,
|
||||
|
||||
doneFn: Function) => filterSelector(inputValue, doneFn,'organization' )"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey"> ไม่มีข้อมูล </q-item-section>
|
||||
</q-item>
|
||||
</template></q-select
|
||||
>
|
||||
</div>
|
||||
></div>
|
||||
|
||||
<div
|
||||
class="q-pa-sm"
|
||||
|
|
@ -674,102 +880,8 @@ onMounted(() => {
|
|||
typeReport === 'KPI6' ||
|
||||
typeReport === 'KPI8'
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
color="primary"
|
||||
label="เลือกรายชื่อ"
|
||||
@click="onClickModal"
|
||||
:disable="roundOp.length === 0 && typeReport === 'KPI8'"
|
||||
/>
|
||||
</div>
|
||||
></div>
|
||||
</q-toolbar>
|
||||
|
||||
<q-splitter
|
||||
v-model="splitterModel"
|
||||
horizontal
|
||||
style="
|
||||
height: 70vh;
|
||||
border: 1px solid rgb(210, 210, 210);
|
||||
border-radius: 5px;
|
||||
"
|
||||
before-class="overflow-hidden disable"
|
||||
separator-class="bg-white disabled"
|
||||
>
|
||||
<template v-slot:before v-if="pdfSrc">
|
||||
<div class="q-px-sm">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:after v-if="pdfSrc">
|
||||
<div class="q-pa-md">
|
||||
<VuePDF ref="vuePDFRef" :pdf="pdfSrc" :page="page" fit-parent />
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:default v-if="pdfSrc">
|
||||
<div class="q-pa-md">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</q-splitter>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
|
||||
|
|
@ -853,7 +965,7 @@ onMounted(() => {
|
|||
outline
|
||||
color="primary"
|
||||
label="เลือก"
|
||||
@click="onSelectPerson(props.row.id)"
|
||||
@click="onSelectPerson(props.row)"
|
||||
/>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
|
|
|
|||
|
|
@ -193,9 +193,17 @@ async function getOrg(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
function clearFilter() {
|
||||
year.value = new Date().getFullYear();
|
||||
organization.value = "";
|
||||
typeReport.value = "";
|
||||
pdfSrc.value = undefined;
|
||||
detailReport.value = undefined;
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
showLoader();
|
||||
Promise.all([getReport(), getActiveId()])
|
||||
Promise.all([getActiveId()])
|
||||
.then(() => {
|
||||
hideLoader();
|
||||
})
|
||||
|
|
@ -215,262 +223,302 @@ onMounted(async () => {
|
|||
รายงานโครงการ/หลักสูตรการฝึกอบรมที่หน่วยงานของกรุงเทพมหานครเป็นผู้จัด
|
||||
</div>
|
||||
|
||||
<div class="q-pa-sm q-gutter-sm">
|
||||
<q-card flat bordered class="col-12">
|
||||
<div class="row q-col-gutter-sm q-pa-sm">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div class="col-md-6 col-xs-12">
|
||||
<q-select
|
||||
class="bg-white"
|
||||
hide-bottom-space
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
v-model="typeReport"
|
||||
:label="`${'รายงาน'}`"
|
||||
emit-value
|
||||
map-options
|
||||
:options="optionReport"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
@update:model-value="getReport"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<q-space />
|
||||
<div>
|
||||
<q-btn
|
||||
:disable="
|
||||
!typeReport ||
|
||||
((typeReport == 'main' || typeReport == 'report3') &&
|
||||
!organization)
|
||||
"
|
||||
:loading="loadingBtn"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="download"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
genReportXLSX(
|
||||
detailReport,
|
||||
`รายการโครงการ/หลักสูตรการฝึกอบรมที่หน่วยงานของกรุงเทพมหานครเป็นผู้จัด`,
|
||||
'pdf'
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .pdf</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
genReportXLSX(
|
||||
detailReport,
|
||||
`รายการโครงการ/หลักสูตรการฝึกอบรมที่หน่วยงานของกรุงเทพมหานครเป็นผู้จัด`,
|
||||
'xlsx'
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="green" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .xlsx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="typeReport" class="row col-12">
|
||||
<q-card bordered class="col-12 filter-card q-pa-sm">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-md-2 col-xs-6">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="year"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
@update:model-value="getReport"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
:model-value="year === 0 ? 'ทั้งหมด' : Number(year) + 543"
|
||||
:label="`${'ปีงบประมาณ'}`"
|
||||
bg-color="white"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div
|
||||
class="col-md-3 col-xs-6"
|
||||
v-if="typeReport == 'main' || typeReport == 'report3'"
|
||||
<q-form greedy @submit.prevent @validation-success="getReport">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-card class="q-pa-sm">
|
||||
<div class="row q-col-gutter-sm no-wrap">
|
||||
<q-space />
|
||||
<div>
|
||||
<q-btn
|
||||
:disable="
|
||||
!typeReport ||
|
||||
!detailReport ||
|
||||
((typeReport == 'main' || typeReport == 'report3') &&
|
||||
!organization)
|
||||
"
|
||||
:loading="loadingBtn"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="download"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
>
|
||||
<q-select
|
||||
class="bg-white"
|
||||
style="min-width: 100px"
|
||||
dense
|
||||
hide-selected
|
||||
fill-input
|
||||
hide-bottom-space
|
||||
outlined
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
emit-value
|
||||
map-options
|
||||
v-model="organization"
|
||||
:options="organizationOps"
|
||||
label="หน่วยงาน"
|
||||
use-input
|
||||
@update:model-value="getReport"
|
||||
@filter="(inputValue: string,
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
genReportXLSX(
|
||||
detailReport,
|
||||
`รายการโครงการ/หลักสูตรการฝึกอบรมที่หน่วยงานของกรุงเทพมหานครเป็นผู้จัด`,
|
||||
'pdf'
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .pdf</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
genReportXLSX(
|
||||
detailReport,
|
||||
`รายการโครงการ/หลักสูตรการฝึกอบรมที่หน่วยงานของกรุงเทพมหานครเป็นผู้จัด`,
|
||||
'xlsx'
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="green" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .xlsx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-card class="q-pa-sm">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col">
|
||||
<q-card flat bordered>
|
||||
<q-card-section
|
||||
bordered
|
||||
class="bg-primary text-subtitle2 text-white q-pa-sm row items-center"
|
||||
>
|
||||
<q-icon name="mdi-filter" class="q-mr-xs" />
|
||||
ตัวกรอง
|
||||
<q-space />
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
class="q-px-sm"
|
||||
rounded
|
||||
flat
|
||||
label="ล้างทั้งหมด"
|
||||
@click.stop.pervent="clearFilter"
|
||||
/>
|
||||
</q-card-section>
|
||||
<q-card-section class="q-pa-none">
|
||||
<div class="col-12 q-px-sm">
|
||||
<q-select
|
||||
class="bg-white"
|
||||
hide-bottom-space
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
v-model="typeReport"
|
||||
:label="`${'รายงาน'}`"
|
||||
emit-value
|
||||
map-options
|
||||
:options="optionReport"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
@update:model-value="
|
||||
(organization = ''), (year = new Date().getFullYear())
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<q-separator v-if="typeReport" />
|
||||
<div
|
||||
class="col-12 q-px-sm"
|
||||
v-if="typeReport == 'main' || typeReport == 'report3'"
|
||||
>
|
||||
<q-select
|
||||
class="bg-white"
|
||||
style="min-width: 100px"
|
||||
dense
|
||||
hide-selected
|
||||
fill-input
|
||||
hide-bottom-space
|
||||
borderless
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
emit-value
|
||||
map-options
|
||||
v-model="organization"
|
||||
:options="organizationOps"
|
||||
label="หน่วยงาน"
|
||||
use-input
|
||||
@filter="(inputValue: string,
|
||||
|
||||
doneFn: Function) => filterSelector(inputValue, doneFn)"
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template></q-select
|
||||
>
|
||||
</div>
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template></q-select
|
||||
>
|
||||
</div>
|
||||
<q-separator
|
||||
v-if="typeReport == 'main' || typeReport == 'report3'"
|
||||
/>
|
||||
<div class="col-12 q-px-sm q-pb-xs" v-if="typeReport">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="year"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
dense
|
||||
borderless
|
||||
:model-value="
|
||||
year === 0 ? 'ทั้งหมด' : Number(year) + 543
|
||||
"
|
||||
:label="`${'ปีงบประมาณ'}`"
|
||||
bg-color="white"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
size="18px"
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
dense
|
||||
class="q-px-md"
|
||||
label="ค้นหา"
|
||||
unelevated
|
||||
color="public"
|
||||
type="submit"
|
||||
:disable="
|
||||
!typeReport ||
|
||||
(typeReport == 'main' && organization == '') ||
|
||||
(typeReport == 'report3' && organization == '')
|
||||
"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12 col-xs-12 flex">
|
||||
<q-splitter
|
||||
horizontal
|
||||
style="
|
||||
height: 75vh;
|
||||
border: 1px solid rgb(210, 210, 210);
|
||||
border-radius: 5px;
|
||||
width: 100%;
|
||||
"
|
||||
before-class="overflow-hidden disable"
|
||||
separator-class="bg-white disabled"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<div class="q-px-sm">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:after>
|
||||
<div class="q-pa-md">
|
||||
<LoadView v-if="loadingBtn" />
|
||||
<VuePDF
|
||||
v-else-if="!loadingBtn && pdfSrc"
|
||||
ref="vuePDFRef"
|
||||
:pdf="pdfSrc"
|
||||
:page="page"
|
||||
fit-parent
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div class="q-pa-md">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</q-splitter>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</q-card>
|
||||
<q-card flat bordered class="col-12">
|
||||
<q-card-section :horizontal="$q.screen.gt.sm">
|
||||
<q-separator :vertical="$q.screen.gt.xs" />
|
||||
|
||||
<q-card-section class="col-lg-12 col-md-12 col-xs-12 scroll">
|
||||
<q-splitter
|
||||
v-model="splitterModel"
|
||||
horizontal
|
||||
style="
|
||||
height: 65vh;
|
||||
border: 1px solid rgb(210, 210, 210);
|
||||
border-radius: 5px;
|
||||
"
|
||||
before-class="overflow-hidden disable"
|
||||
separator-class="bg-white disabled"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<div class="q-px-sm">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:after>
|
||||
<div class="q-pa-md">
|
||||
<LoadView v-if="loadingBtn" />
|
||||
<VuePDF
|
||||
v-else
|
||||
ref="vuePDFRef"
|
||||
:pdf="pdfSrc"
|
||||
:page="page"
|
||||
fit-parent
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div class="q-pa-md">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</q-splitter>
|
||||
</q-card-section>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scope>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,12 @@ const { fetchStructureTree } = useStructureTree();
|
|||
const { messageError } = useCounterMixin();
|
||||
|
||||
const loadingBtn = ref<boolean>(false);
|
||||
const isReport = ref<boolean>(false);
|
||||
const isLoadPDF = ref<boolean>(false);
|
||||
const expandedModal = ref<boolean>(false);
|
||||
const org = ref<string>("");
|
||||
|
||||
const isLoadStructureTree = ref<boolean>(true);
|
||||
const filterTree = ref<string>("");
|
||||
const nodeId = ref<string>("");
|
||||
const nodeName = ref<string>("");
|
||||
|
|
@ -35,14 +40,22 @@ const numOfPages = ref<number>(0);
|
|||
const page = ref<number>(1);
|
||||
const pdfSrc = ref<any>();
|
||||
|
||||
/** ฟังก์ชันเรียกข้อมูลโครงสร้างหน่วยงาน*/
|
||||
async function fetchDataTree() {
|
||||
const dataTree = await fetchStructureTree("SYS_EVA_REQ", true);
|
||||
if (dataTree) {
|
||||
const data = dataTree.map((item: DataStructureTree) => ({
|
||||
...item,
|
||||
children: null,
|
||||
}));
|
||||
node.value = data;
|
||||
try {
|
||||
isLoadStructureTree.value = true;
|
||||
const dataTree = await fetchStructureTree("SYS_EVA_REQ", true);
|
||||
if (dataTree) {
|
||||
const data = dataTree.map((item: DataStructureTree) => ({
|
||||
...item,
|
||||
children: null,
|
||||
}));
|
||||
node.value = data;
|
||||
}
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
isLoadStructureTree.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -109,11 +122,12 @@ function onDownloadFile(type: string) {
|
|||
* @param id id หน่วยงาน
|
||||
* @param level ระดับหน่วยงาน
|
||||
*/
|
||||
function onSelectedNode(id: string, name: string) {
|
||||
if (id !== nodeId.value) {
|
||||
nodeId.value = id;
|
||||
nodeName.value = name;
|
||||
fetchReport();
|
||||
function onSelectedNode(data: any) {
|
||||
if (data.orgTreeId !== nodeId.value) {
|
||||
nodeId.value = data.orgTreeId;
|
||||
nodeName.value = data.orgTreeName;
|
||||
org.value = data.orgName;
|
||||
expandedModal.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -131,6 +145,15 @@ function nextPage() {
|
|||
}
|
||||
}
|
||||
|
||||
function clearFilter() {
|
||||
pdfSrc.value = undefined;
|
||||
detailReport.value = undefined;
|
||||
year.value = new Date().getFullYear();
|
||||
org.value = "";
|
||||
nodeId.value = "";
|
||||
nodeName.value = "";
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchDataTree();
|
||||
});
|
||||
|
|
@ -140,235 +163,314 @@ onMounted(() => {
|
|||
<div class="toptitle text-dark col-12 row items-center">
|
||||
รายงานประเมินบุคคล
|
||||
</div>
|
||||
|
||||
<div class="q-pa-sm q-gutter-sm">
|
||||
<q-card flat bordered class="col-12">
|
||||
<div class="row q-col-gutter-sm q-pa-sm">
|
||||
<div class="row col-12">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="year"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
@update:model-value="fetchReport"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
:model-value="year === 0 ? 'ทั้งหมด' : Number(year) + 543"
|
||||
:label="`${'ปีงบประมาณ'}`"
|
||||
bg-color="white"
|
||||
<q-form greedy @submit.prevent @validation-success="fetchReport">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-card class="q-pa-sm">
|
||||
<div class="row q-col-gutter-sm no-wrap">
|
||||
<q-space />
|
||||
<div>
|
||||
<q-btn
|
||||
:loading="loadingBtn"
|
||||
:disable="!detailReport"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="download"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
|
||||
<q-space />
|
||||
<q-btn
|
||||
:loading="loadingBtn"
|
||||
:disable="!nodeId"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="download"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop.pervent="onDownloadFile('pdf')"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .pdf</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop.pervent="onDownloadFile('xlsx')"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="green" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .xlsx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop.pervent="onDownloadFile('pdf')"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .pdf</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop.pervent="onDownloadFile('xlsx')"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="green" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .xlsx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<q-card flat bordered class="col-12">
|
||||
<q-card-section :horizontal="$q.screen.gt.sm">
|
||||
<q-card-section class="col-lg-3 col-md-4 col-xs-12 q-gutter-sm">
|
||||
<div class="col">
|
||||
<q-input dense outlined v-model="filterTree" label="ค้นหา">
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
|
||||
<div class="bg-white tree-containerevaluate q-pa-xs">
|
||||
<q-tree
|
||||
dense
|
||||
:nodes="node"
|
||||
node-key="orgTreeId"
|
||||
label-key="labelName"
|
||||
:filter="filterTree.trim()"
|
||||
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||
no-nodes-label="ไม่มีข้อมูล"
|
||||
>
|
||||
<template v-slot:default-header="prop">
|
||||
<q-item
|
||||
@click.stop="
|
||||
onSelectedNode(prop.node.orgTreeId, prop.node.orgTreeName)
|
||||
"
|
||||
:active="nodeId === prop.node.orgTreeId"
|
||||
clickable
|
||||
active-class="my-list-link text-primary text-weight-medium"
|
||||
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||
<div class="col-12">
|
||||
<q-card class="q-pa-sm">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col">
|
||||
<q-card flat bordered>
|
||||
<q-card-section
|
||||
bordered
|
||||
class="bg-primary text-subtitle2 text-white q-pa-sm row items-center"
|
||||
>
|
||||
<div>
|
||||
<div class="text-weight-medium">
|
||||
{{ prop.node.orgTreeName }}
|
||||
</div>
|
||||
<div class="text-weight-light text-grey-8">
|
||||
{{ prop.node.orgCode == null ? null : prop.node.orgCode }}
|
||||
{{
|
||||
prop.node.orgTreeShortName == null
|
||||
? null
|
||||
: prop.node.orgTreeShortName
|
||||
}}
|
||||
<q-icon name="mdi-filter" class="q-mr-xs" />
|
||||
ตัวกรอง
|
||||
<q-space />
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
class="q-px-sm"
|
||||
rounded
|
||||
flat
|
||||
label="ล้างทั้งหมด"
|
||||
@click.stop.pervent="clearFilter"
|
||||
/>
|
||||
</q-card-section>
|
||||
<q-card-section class="q-pa-none">
|
||||
<div class="col-12">
|
||||
<q-expansion-item
|
||||
v-model="expandedModal"
|
||||
dense
|
||||
dense-toggle
|
||||
expand-separator
|
||||
class="expansion-item"
|
||||
>
|
||||
<template #header>
|
||||
<div class="full-width flex items-stretch">
|
||||
<q-input
|
||||
dense
|
||||
:model-value="org"
|
||||
autogrow
|
||||
borderless
|
||||
label="สังกัด"
|
||||
class="bg-white full-width"
|
||||
>
|
||||
</q-input>
|
||||
</div>
|
||||
<!-- @click="onOpenOrg" -->
|
||||
</template>
|
||||
<q-separator />
|
||||
|
||||
<q-card-section v-if="loadingBtn">
|
||||
<LoadView />
|
||||
</q-card-section>
|
||||
<q-card-section v-else>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="filterTree"
|
||||
label="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
v-if="filterTree !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="filterTree = ''"
|
||||
/>
|
||||
<q-icon v-else name="search" color="grey-5" />
|
||||
</template>
|
||||
</q-input>
|
||||
<q-tree
|
||||
dense
|
||||
:nodes="node"
|
||||
node-key="orgTreeId"
|
||||
label-key="labelName"
|
||||
v-model:expanded="node"
|
||||
:filter="filterTree.trim()"
|
||||
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||
no-nodes-label="ไม่มีข้อมูล"
|
||||
class="tree-container-report q-mt-sm"
|
||||
>
|
||||
<template v-slot:default-header="prop">
|
||||
<q-item
|
||||
@click.stop="onSelectedNode(prop.node)"
|
||||
:active="nodeId === prop.node.orgTreeId"
|
||||
clickable
|
||||
active-class="my-list-link text-primary text-weight-medium"
|
||||
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||
>
|
||||
<div>
|
||||
<div class="text-weight-medium">
|
||||
{{ prop.node.orgTreeName }}
|
||||
</div>
|
||||
<div class="text-weight-light text-grey-8">
|
||||
{{
|
||||
prop.node.orgCode == null
|
||||
? null
|
||||
: prop.node.orgCode
|
||||
}}
|
||||
{{
|
||||
prop.node.orgTreeShortName == null
|
||||
? null
|
||||
: prop.node.orgTreeShortName
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-tree>
|
||||
</q-card-section>
|
||||
</q-expansion-item>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="col-12 q-px-sm">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="year"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
dense
|
||||
borderless
|
||||
:model-value="
|
||||
year === 0 ? 'ทั้งหมด' : Number(year) + 543
|
||||
"
|
||||
:label="`${'ปีงบประมาณ'}`"
|
||||
bg-color="white"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
dense
|
||||
class="q-px-md"
|
||||
label="ค้นหา"
|
||||
unelevated
|
||||
color="public"
|
||||
type="submit"
|
||||
:disable="nodeId == ''"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12 col-xs-12 flex">
|
||||
<q-splitter
|
||||
horizontal
|
||||
style="
|
||||
height: 75vh;
|
||||
border: 1px solid rgb(210, 210, 210);
|
||||
border-radius: 5px;
|
||||
width: 100%;
|
||||
"
|
||||
before-class="overflow-hidden disable"
|
||||
separator-class="bg-white disabled"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<div class="q-px-sm">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-tree>
|
||||
</template>
|
||||
<template v-slot:after>
|
||||
<div class="q-pa-md">
|
||||
<LoadView v-if="loadingBtn" />
|
||||
<VuePDF
|
||||
v-else-if="!loadingBtn && pdfSrc"
|
||||
ref="vuePDFRef"
|
||||
:pdf="pdfSrc"
|
||||
:page="page"
|
||||
fit-parent
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div class="q-pa-md">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</q-splitter>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
|
||||
<q-separator :vertical="$q.screen.gt.xs" />
|
||||
|
||||
<q-card-section class="col-lg-9 col-md-8 col-xs-12 scroll">
|
||||
<q-splitter
|
||||
horizontal
|
||||
style="
|
||||
height: 75vh;
|
||||
border: 1px solid rgb(210, 210, 210);
|
||||
border-radius: 5px;
|
||||
"
|
||||
before-class="overflow-hidden disable"
|
||||
separator-class="bg-white disabled"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<div class="q-px-sm">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:after>
|
||||
<div class="q-pa-md">
|
||||
<LoadView v-if="loadingBtn" />
|
||||
<VuePDF
|
||||
v-else
|
||||
ref="vuePDFRef"
|
||||
:pdf="pdfSrc"
|
||||
:page="page"
|
||||
fit-parent
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div class="q-pa-md">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</q-splitter>
|
||||
</q-card-section>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scope>
|
||||
<style lang="scss" scoped>
|
||||
.q-item.hover-green:hover {
|
||||
background-color: #d5f1ee57;
|
||||
border-radius: 2px;
|
||||
|
|
@ -390,4 +492,22 @@ onMounted(() => {
|
|||
font-weight: 600;
|
||||
border: 1px solid rgba(175, 185, 196, 0.217);
|
||||
}
|
||||
|
||||
.tree-container-report {
|
||||
overflow: auto;
|
||||
max-height: 50vh;
|
||||
}
|
||||
|
||||
:deep(.tree-container-report div) {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
:deep(.expansion-item .q-item__section) {
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
||||
:deep(.expansion-item .q-item) {
|
||||
min-height: 32px;
|
||||
padding: 2px 9px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -23,6 +23,10 @@ const storeEmp = useSalaryEmployeeListSDataStore();
|
|||
|
||||
const { messageError, showLoader, hideLoader } = useCounterMixin();
|
||||
|
||||
const checkId = ref<string>("");
|
||||
const isLoadStructureTree = ref<boolean>(true);
|
||||
const expandedModal = ref<boolean>(false);
|
||||
const org = ref<string>("");
|
||||
const year = ref<number>(new Date().getFullYear());
|
||||
const isLoadFilePdf = ref<boolean>(false);
|
||||
const employeeClass = ref<string>("officer");
|
||||
|
|
@ -104,20 +108,24 @@ async function fetchDataRound() {
|
|||
}
|
||||
|
||||
async function fetchDataOrg(revisionId: string) {
|
||||
if (revisionId) {
|
||||
await http
|
||||
.get(config.API.activeOrganizationRootById(revisionId))
|
||||
.then(async (res) => {
|
||||
const data = res.data.result.map((item: DataStructureTree) => ({
|
||||
...item,
|
||||
children: null,
|
||||
labelName: `${item.orgRootName} ${item.orgRootCode} ${item.orgRootShortName}`,
|
||||
}));
|
||||
node.value = data;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
if (!revisionId)
|
||||
return (isLoadStructureTree.value = false), (checkId.value = revisionId);
|
||||
|
||||
try {
|
||||
isLoadStructureTree.value = true;
|
||||
const res = await http.get(
|
||||
config.API.activeOrganizationRootById(revisionId)
|
||||
);
|
||||
const data = res.data.result.map((item: DataStructureTree) => ({
|
||||
...item,
|
||||
children: null,
|
||||
labelName: `${item.orgRootName} ${item.orgRootCode} ${item.orgRootShortName}`,
|
||||
}));
|
||||
node.value = data;
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
isLoadStructureTree.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -126,11 +134,12 @@ async function fetchDataOrg(revisionId: string) {
|
|||
* @param id id หน่วยงาน
|
||||
* @param level ระดับหน่วยงาน
|
||||
*/
|
||||
function onSelectedNode(id: string, name: string) {
|
||||
if (id !== nodeId.value) {
|
||||
nodeId.value = id;
|
||||
nodeName.value = name;
|
||||
fetchReportPDF();
|
||||
function onSelectedNode(data: any) {
|
||||
if (data.id !== nodeId.value) {
|
||||
nodeId.value = data.id;
|
||||
nodeName.value = data.orgRootName;
|
||||
org.value = data.orgName;
|
||||
expandedModal.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -139,13 +148,7 @@ function onChangeYear() {
|
|||
}
|
||||
|
||||
function fetchReportPDF() {
|
||||
if (
|
||||
employeeClass.value &&
|
||||
round.value &&
|
||||
group.value &&
|
||||
report.value &&
|
||||
nodeId.value
|
||||
) {
|
||||
if (employeeClass.value && round.value && report.value && nodeId.value) {
|
||||
fetchDataReportUnified(report.value, employeeClass.value);
|
||||
}
|
||||
}
|
||||
|
|
@ -278,6 +281,20 @@ function nextPage() {
|
|||
}
|
||||
}
|
||||
|
||||
function clearFilter() {
|
||||
checkId.value = "";
|
||||
year.value = new Date().getFullYear();
|
||||
round.value = "";
|
||||
group.value = "GROUP1";
|
||||
report.value = "";
|
||||
|
||||
detailReport.value = undefined;
|
||||
pdfSrc.value = undefined;
|
||||
org.value = "";
|
||||
nodeId.value = "";
|
||||
nodeName.value = "";
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
fetchDataRound();
|
||||
});
|
||||
|
|
@ -286,323 +303,411 @@ onMounted(() => {
|
|||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">รายงานเงินเดือน</div>
|
||||
|
||||
<q-form greedy @submit.prevent @validation-success="fetchReportPDF">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-card class="q-pa-sm">
|
||||
<div class="row q-col-gutter-sm no-wrap">
|
||||
<div class="col-lg-2 col-md-3 col-sm-3 col-xs-12">
|
||||
<q-select
|
||||
outlined
|
||||
dense
|
||||
v-model="employeeClass"
|
||||
:options="employeeClassOption"
|
||||
label="สภานภาพ"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
bg-color="white"
|
||||
@update:model-value="(report = ''), fetchReportPDF"
|
||||
>
|
||||
</q-select>
|
||||
</div>
|
||||
<q-space />
|
||||
<div>
|
||||
<q-btn
|
||||
:loading="isLoadFilePdf"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="download"
|
||||
:disable="!detailReport"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop.pervent="onDownloadFile('pdf')"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .pdf</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop.pervent="onDownloadFile('xlsx')"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="green" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .xlsx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<q-card class="q-pa-sm">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col">
|
||||
<q-card flat bordered>
|
||||
<q-card-section
|
||||
bordered
|
||||
class="bg-primary text-subtitle2 text-white q-pa-sm row items-center"
|
||||
>
|
||||
<q-icon name="mdi-filter" class="q-mr-xs" />
|
||||
ตัวกรอง
|
||||
<q-space />
|
||||
<q-btn
|
||||
dense
|
||||
size="12px"
|
||||
class="q-px-sm"
|
||||
rounded
|
||||
flat
|
||||
label="ล้างทั้งหมด"
|
||||
@click.stop.pervent="clearFilter"
|
||||
/>
|
||||
</q-card-section>
|
||||
<q-card-section class="q-pa-none">
|
||||
<div class="col-12">
|
||||
<q-expansion-item
|
||||
v-model="expandedModal"
|
||||
dense
|
||||
dense-toggle
|
||||
expand-separator
|
||||
class="expansion-item"
|
||||
>
|
||||
<template #header>
|
||||
<div class="full-width flex items-stretch">
|
||||
<q-input
|
||||
dense
|
||||
:model-value="org"
|
||||
autogrow
|
||||
borderless
|
||||
label="สังกัด"
|
||||
class="bg-white full-width"
|
||||
>
|
||||
</q-input>
|
||||
</div>
|
||||
<!-- @click="onOpenOrg" -->
|
||||
</template>
|
||||
<q-separator />
|
||||
|
||||
<q-card-section v-if="isLoadStructureTree && checkId">
|
||||
<LoadView />
|
||||
</q-card-section>
|
||||
<q-card-section
|
||||
v-else-if="isLoadStructureTree && !checkId"
|
||||
class="q-pa-sm"
|
||||
>
|
||||
<div class="bg-grey-3 q-pa-sm rounded-borders">
|
||||
ไม่พบข้อมูลสังกัด
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-card-section v-else>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
v-model="filterTree"
|
||||
label="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
v-if="filterTree !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="filterTree = ''"
|
||||
/>
|
||||
<q-icon v-else name="search" color="grey-5" />
|
||||
</template>
|
||||
</q-input>
|
||||
<q-tree
|
||||
dense
|
||||
:nodes="node"
|
||||
node-key="orgTreeId"
|
||||
label-key="labelName"
|
||||
v-model:expanded="node"
|
||||
:filter="filterTree.trim()"
|
||||
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||
no-nodes-label="ไม่มีข้อมูล"
|
||||
class="tree-container-report q-mt-sm"
|
||||
>
|
||||
<template v-slot:default-header="prop">
|
||||
<q-item
|
||||
@click.stop="onSelectedNode(prop.node)"
|
||||
:active="nodeId === prop.node.orgTreeId"
|
||||
clickable
|
||||
active-class="my-list-link text-primary text-weight-medium"
|
||||
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||
>
|
||||
<div>
|
||||
<div class="text-weight-medium">
|
||||
{{ prop.node.orgTreeName }}
|
||||
</div>
|
||||
<div class="text-weight-light text-grey-8">
|
||||
{{
|
||||
prop.node.orgCode == null
|
||||
? null
|
||||
: prop.node.orgCode
|
||||
}}
|
||||
{{
|
||||
prop.node.orgTreeShortName == null
|
||||
? null
|
||||
: prop.node.orgTreeShortName
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-tree>
|
||||
</q-card-section>
|
||||
</q-expansion-item>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="col-12 q-px-sm">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="year"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
@update:model-value="onChangeYear"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
dense
|
||||
borderless
|
||||
:model-value="
|
||||
year === 0 ? 'ทั้งหมด' : Number(year) + 543
|
||||
"
|
||||
:label="`${'ปีงบประมาณ'}`"
|
||||
bg-color="white"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
size="18px"
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div class="col-12 q-px-sm">
|
||||
<q-select
|
||||
v-model="round"
|
||||
label="รอบการขึ้นเงินเดือน"
|
||||
dense
|
||||
borderless
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
:options="roundOptions"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
bg-color="white"
|
||||
@update:model-value="report = ''"
|
||||
>
|
||||
</q-select>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div
|
||||
class="col-12 q-px-sm"
|
||||
v-if="employeeClass === 'officer'"
|
||||
>
|
||||
<q-select
|
||||
v-model="group"
|
||||
label="กลุ่ม"
|
||||
dense
|
||||
borderless
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
:options="groupOptions"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
bg-color="white"
|
||||
/>
|
||||
</div>
|
||||
<q-separator v-if="employeeClass === 'officer'" />
|
||||
<div class="col-12 q-px-sm">
|
||||
<q-select
|
||||
borderless
|
||||
dense
|
||||
v-model="report"
|
||||
:options="reportOption"
|
||||
label="รายงาน"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
class="bg-white"
|
||||
/>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
dense
|
||||
class="q-px-md"
|
||||
label="ค้นหา"
|
||||
unelevated
|
||||
color="public"
|
||||
type="submit"
|
||||
:disable="nodeId == '' || round == '' || report == ''"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12 col-xs-12 flex">
|
||||
<q-splitter
|
||||
horizontal
|
||||
style="
|
||||
height: 75vh;
|
||||
border: 1px solid rgb(210, 210, 210);
|
||||
border-radius: 5px;
|
||||
width: 100%;
|
||||
"
|
||||
before-class="overflow-hidden disable"
|
||||
separator-class="bg-white disabled"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<div class="q-px-sm">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:after>
|
||||
<div class="q-pa-md">
|
||||
<LoadView v-if="isLoadFilePdf" />
|
||||
<VuePDF
|
||||
v-else
|
||||
ref="vuePDFRef"
|
||||
:pdf="pdfSrc"
|
||||
:page="page"
|
||||
fit-parent
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div class="q-pa-md">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</q-splitter>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-form>
|
||||
|
||||
<div class="q-pa-sm q-gutter-sm">
|
||||
<q-card flat bordered class="col-12">
|
||||
<div class="row q-col-gutter-sm q-pa-sm">
|
||||
<div class="row col-12">
|
||||
<q-select
|
||||
outlined
|
||||
dense
|
||||
v-model="employeeClass"
|
||||
:options="employeeClassOption"
|
||||
label="สภานภาพ"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
bg-color="white"
|
||||
@update:model-value="(report = ''), fetchReportPDF"
|
||||
>
|
||||
</q-select>
|
||||
|
||||
<q-space />
|
||||
<q-btn
|
||||
:loading="isLoadFilePdf"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="download"
|
||||
:disable="report === '' || nodeId === ''"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop.pervent="onDownloadFile('pdf')"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .pdf</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click.stop.pervent="onDownloadFile('xlsx')"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="green" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .xlsx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
||||
<div class="row col-12">
|
||||
<q-card bordered class="col-12 filter-card q-pa-sm">
|
||||
<div class="row col-12 q-col-gutter-sm items-center">
|
||||
<div class="row col-md-8 col-sx-12 q-col-gutter-sm">
|
||||
<div class="col-md-3 col-xs-6">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="year"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
@update:model-value="onChangeYear"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
:model-value="
|
||||
year === 0 ? 'ทั้งหมด' : Number(year) + 543
|
||||
"
|
||||
:label="`${'ปีงบประมาณ'}`"
|
||||
bg-color="white"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
style="color: var(--q-primary)"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-md-3 col-xs-6">
|
||||
<q-select
|
||||
v-model="round"
|
||||
label="รอบการขึ้นเงินเดือน"
|
||||
dense
|
||||
outlined
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
:options="roundOptions"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
bg-color="white"
|
||||
@update:model-value="(report = ''), fetchReportPDF"
|
||||
>
|
||||
</q-select>
|
||||
</div>
|
||||
<div class="col-md-3 col-xs-6"></div>
|
||||
<div class="col-md-3 col-xs-6"></div>
|
||||
|
||||
<div
|
||||
class="col-md-3 col-xs-6"
|
||||
v-if="employeeClass === 'officer'"
|
||||
>
|
||||
<q-select
|
||||
v-model="group"
|
||||
label="กลุ่ม"
|
||||
dense
|
||||
outlined
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
:options="groupOptions"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
bg-color="white"
|
||||
@update:model-value="fetchReportPDF"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-3 col-xs-6"></div>
|
||||
</div>
|
||||
<div class="row q-col-gutter-sm col-md-12">
|
||||
<div class="col-md-4 col-xs-12">
|
||||
<q-select
|
||||
outlined
|
||||
dense
|
||||
v-model="report"
|
||||
:options="reportOption"
|
||||
label="รายงาน"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
class="bg-white"
|
||||
@update:model-value="fetchReportPDF"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-md-4 col-xs-12"></div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<q-card flat bordered class="col-12" v-if="isRound">
|
||||
<q-card-section :horizontal="$q.screen.gt.sm">
|
||||
<q-card-section class="col-lg-3 col-md-4 col-xs-12 q-gutter-sm">
|
||||
<div class="col">
|
||||
<q-input dense outlined v-model="filterTree" label="ค้นหา">
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
|
||||
<div class="bg-white tree-container q-pa-xs">
|
||||
<q-tree
|
||||
dense
|
||||
:nodes="node"
|
||||
node-key="id"
|
||||
label-key="labelName"
|
||||
:filter="filterTree.trim()"
|
||||
no-results-label="ไม่พบข้อมูลที่ค้นหา"
|
||||
no-nodes-label="ไม่มีข้อมูล"
|
||||
>
|
||||
<template v-slot:default-header="prop">
|
||||
<q-item
|
||||
@click.stop="
|
||||
onSelectedNode(prop.node.id, prop.node.orgRootName)
|
||||
"
|
||||
:active="nodeId === prop.node.id"
|
||||
clickable
|
||||
active-class="my-list-link text-primary text-weight-medium"
|
||||
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||
>
|
||||
<div>
|
||||
<div class="text-weight-medium">
|
||||
{{ prop.node.orgRootName }}
|
||||
</div>
|
||||
<div class="text-weight-light text-grey-8">
|
||||
{{
|
||||
prop.node.orgRootCode == null
|
||||
? null
|
||||
: prop.node.orgRootCode
|
||||
}}
|
||||
{{
|
||||
prop.node.orgRootShortName == null
|
||||
? null
|
||||
: prop.node.orgRootShortName
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-tree>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator :vertical="$q.screen.gt.xs" />
|
||||
|
||||
<q-card-section class="col-lg-9 col-md-8 col-xs-12 scroll">
|
||||
<q-splitter
|
||||
horizontal
|
||||
style="
|
||||
height: 63vh;
|
||||
border: 1px solid rgb(210, 210, 210);
|
||||
border-radius: 5px;
|
||||
"
|
||||
before-class="overflow-hidden disable"
|
||||
separator-class="bg-white disabled"
|
||||
>
|
||||
<template v-slot:before>
|
||||
<div class="q-px-sm">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:after>
|
||||
<div class="q-pa-md">
|
||||
<LoadView v-if="isLoadFilePdf" />
|
||||
<VuePDF
|
||||
v-else
|
||||
ref="vuePDFRef"
|
||||
:pdf="pdfSrc"
|
||||
:page="page"
|
||||
fit-parent
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:default>
|
||||
<div class="q-pa-md">
|
||||
<div class="row items-start items-center">
|
||||
<div class="col">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-left"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
class="my-auto"
|
||||
@click="backPage"
|
||||
:disable="page == 1"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-auto">
|
||||
<div class="q-pa-md flex">
|
||||
หน้าที่ {{ page }} จาก {{ numOfPages }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
<q-btn
|
||||
padding="xs"
|
||||
icon="mdi-chevron-right"
|
||||
color="grey-2"
|
||||
text-color="grey-5"
|
||||
size="md"
|
||||
@click="nextPage"
|
||||
:disable="page === numOfPages"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</q-splitter>
|
||||
</q-card-section>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
|
||||
<q-card flat bordered class="col-12" v-else>
|
||||
<div class="q-pa-sm">
|
||||
<q-banner inline-actions rounded class="bg-grey-1 text-center">
|
||||
ไม่มีข้อมูล
|
||||
</q-banner>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -628,4 +733,18 @@ onMounted(() => {
|
|||
font-weight: 600;
|
||||
border: 1px solid rgba(175, 185, 196, 0.217);
|
||||
}
|
||||
|
||||
.tree-container-report {
|
||||
overflow: auto;
|
||||
max-height: 50vh;
|
||||
}
|
||||
|
||||
:deep(.expansion-item .q-item__section) {
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
||||
:deep(.expansion-item .q-item) {
|
||||
min-height: 32px;
|
||||
padding: 2px 9px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue