Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2024-12-12 15:02:22 +07:00
commit b6d0057750
14 changed files with 1028 additions and 154 deletions

View file

@ -11,6 +11,7 @@ const placemenRelocation = `${placement}/relocation`;
const placemenOther = `${env.API_URI}/retirement/other`;
const placemenAppointment = `${placement}/appointment`;
const orgSearchCommand = `${env.API_URI}/org/profile/search/profile/command`;
const report = `${env.API_PLACEMENT_URI}/placement/report`;
export default {
MainDetail: (year: number) => `${placement}/exam/${year}`,
@ -178,4 +179,7 @@ export default {
appointEmployeeOrder: (typeId: string) =>
`${placement}/appointment/temp/report/${typeId}`,
apppointmentPositionUse: () => `${placement}/appointment/temp/use`,
//รายงาน
placementReport: `${report}`,
};

View file

@ -7,6 +7,7 @@ const evaluate = `${env.API_PROBATION_URI}`;
const appointMain = `${env.API_PROBATION_URI}/appoint`;
const orgProfile = `${env.API_URI}/org`;
const probation = `${env.API_URI}/probation`;
const report = `${env.API_URI}/probation/report`;
export default {
competencyOptions: (personalId: string) =>
@ -87,9 +88,12 @@ export default {
`${orgProfile}/profile/probation/${profileId}`,
appointMain,
appointMainList:(id:string)=>`${appointMain}/list/${id}`,
appointMainList: (id: string) => `${appointMain}/list/${id}`,
orgProfileDirector:`${orgProfile}/profile/commander-director`,
orgProfileDirector: `${orgProfile}/profile/commander-director`,
permissionsCheck:(id:string)=>`${probation}/permissions/${id}`
permissionsCheck: (id: string) => `${probation}/permissions/${id}`,
//รายงาน
probationReport: `${report}`,
};

View file

@ -3,6 +3,7 @@ const retirement = `${env.API_URI}/retirement`;
const retirementDischarge = `${retirement}/discharge`;
const retirementExpulsion = `${retirement}/expulsion`;
const retirementOut = `${retirement}/out`;
const report = `${retirement}/report`;
export default {
profile: (type: string, year: string) =>
@ -72,4 +73,7 @@ export default {
editDetail: (retireId: string) => `${retirement}/detail/${retireId}`,
// ตำถาม Exit interview
questionnaireList: () => `${retirement}/resign/questionnaire/question/admin`,
//รายงาน
retirementReport: `${report}`,
};

View file

@ -14,6 +14,12 @@ interface DataOption1 {
name: string | null;
disable?: boolean;
}
interface DataTypeReport {
id: string;
name: string;
type: string;
}
interface DataOptionInsignia {
id: string;
name: string;
@ -484,6 +490,7 @@ export type {
DataPermissions,
TabPermissions,
MainData,
DataTypeReport,
};
export { AddressDataDefualt, FamilyDataDefualt };

View file

@ -1,23 +1,65 @@
<script setup lang="ts">
import { ref } from "vue";
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import { VuePDF, usePDF } from "@tato30/vue-pdf";
import axios from "axios";
import type { optionData } from "@/modules/05_placement/interface/index/Main";
import { useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useStructureTree } from "@/stores/structureTree";
import http from "@/plugins/http";
import config from "@/app.config";
import type { DataStructureTree } from "@/interface/main";
import type { DataTypeReport } from "@/modules/05_placement/interface/index/Main";
import LoadView from "@/components/LoadView.vue";
/** use*/
const $q = useQuasar();
const route = useRoute();
const { fetchStructureTree } = useStructureTree();
const {
showLoader,
hideLoader,
date2Thai,
dateToISO,
messageError,
monthYear2Thai,
} = useCounterMixin();
/** Filter*/
const reportType = ref<string>("");
const optionReport = ref<optionData[]>([
const reportType = ref<DataTypeReport>();
const optionReport = ref<DataTypeReport[]>([
{
id: "1",
name: "จำนวนข้าราชการ กทม. สามัญที่ได้รับการบรรจุ แต่งตั้ง ย้าย และโอน",
type: "placement",
},
{
id: "2",
name: "จำนวนลูกจ้างประจำ กทม. ที่ได้รับการจ้าง แต่งตั้งและย้าย",
type: "placement",
},
{
id: "1",
name: "การทดลองปฏิบัติหน้าที่ราชการสำหรับข้าราชการ กทม. สามัญ",
type: "probation",
},
{
id: "2",
name: "ข้อมูลการทดลองปฏิบัติหน้าที่ราชการของข้าราชการ กทม. สามัญ บรรจุใหม่",
type: "probation",
},
{
id: "3",
name: "สถิติการทดลองปฏิบัติหน้าที่ราชการของข้าราชการ กทม. สามัญ บรรจุใหม่",
type: "probation",
},
]);
const year = ref<number>(new Date().getFullYear());
const dateStart = ref<Date>(new Date(year.value - 1, 9, 1));
const dateEnd = ref<Date>(new Date(year.value + 1, 8, 30));
/** View*/
const isLoadPDF = ref<boolean>(false);
@ -25,6 +67,90 @@ const numOfPages = ref<number>(0);
const page = ref<number>(1);
const pdfSrc = ref<any>();
/** tree*/
const filterTree = ref<string>("");
const nodeId = ref<string>("");
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);
}
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) {
nodeId.value = id;
nodeLevel.value = level;
reportType.value && fetchDataReport();
}
function fetchDataReport() {
if (!reportType.value || !nodeId.value) {
return false;
}
isLoadPDF.value = true;
const queryParams = {
nodeId: nodeId.value,
node: nodeLevel.value,
startDate: dateToISO(dateStart.value),
endDate: dateToISO(dateEnd.value),
};
const apiEndpoint =
reportType.value.type === "probation"
? config.API.probationReport
: config.API.placementReport;
http
.get(apiEndpoint + `${reportType.value.id}`, {
params: queryParams,
})
.then(async (res) => {
const data = await res.data.result;
await fetchDocumentTemplate(data);
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
isLoadPDF.value = false;
});
}
/**
* function เรยกไฟล PDF
* @param data อมลบญชนลา
*/
async function fetchDocumentTemplate(data: any) {
await axios
.post(`${config.API.reportTemplate}/xlsx`, data, {
headers: {
accept: "application/pdf",
"content-Type": "application/json",
},
responseType: "blob",
})
.then(async (res) => {
const blob = new Blob([res.data]);
const objectUrl = URL.createObjectURL(blob);
const pdfData = usePDF(`${objectUrl}`);
setTimeout(() => {
pdfSrc.value = pdfData.pdf.value;
numOfPages.value = pdfData.pages.value;
}, 1500);
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
});
}
/** ไปหน้าต่อไปของรายงาน */
function nextPage() {
if (page.value < numOfPages.value) {
@ -38,6 +164,10 @@ function backPage() {
page.value--;
}
}
onMounted(() => {
fetchDataTree();
});
</script>
<template>
@ -55,124 +185,304 @@ function backPage() {
v-model="reportType"
:options="optionReport"
label="รายงาน"
emit-value
map-options
option-label="name"
option-value="id"
style="width: 500px"
@update:model-value="fetchDataReport"
>
</q-select>
<q-space />
<q-btn
:loading="isLoadPDF"
flat
round
color="primary"
icon="download"
:disable="!reportType"
:disable="!reportType || !nodeId"
>
</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>
</div>
</q-card>
</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
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="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>
<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="col-12 col-md-auto">
<div class="q-pa-md flex">
หนาท {{ page }} จาก {{ numOfPages }}
<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
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 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>
</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>
</div>
</template>
</q-splitter>
</template>
</q-splitter>
</q-card-section>
</q-card-section>
</q-card>
</div>
</template>
<style scoped></style>
<style scoped>
.tree-container {
overflow: auto;
height: 60vh;
border: 1px solid #e6e6e7;
border-radius: 10px;
}
.my-list-link {
color: rgb(118, 168, 222);
border-radius: 5px;
background: #a3d3fb48 !important;
font-weight: 600;
border: 1px solid rgba(175, 185, 196, 0.217);
}
</style>

View file

@ -51,4 +51,22 @@ interface DataStatus {
group: string;
}
export type { Pagination, RetirementList, PersonData, RoundData, DataStatus };
interface DataOption {
id: string;
name: string;
}
interface DataDateMonthObject {
month: number;
year: number;
}
export type {
Pagination,
RetirementList,
PersonData,
RoundData,
DataStatus,
DataOption,
DataDateMonthObject,
};

View file

@ -59,6 +59,10 @@ const outDetail = () =>
const outDetailOnly = () =>
import("@/modules/06_retirement/components/06_dismissOrder/Detail.vue");
/** รายงาน*/
const ReportView = () => import("@/modules/06_retirement/views/07_report.vue");
export default [
{
path: "/retirement",
@ -305,44 +309,15 @@ export default [
Role: "STAFF",
},
},
// {
// path: "/retirement/discharged",
// name: "discharged",
// component: dischargedMain,
// meta: {
// Auth: true,
// Key: [7.6],
// Role: "retirement",
// },
// },
// {
// path: "/retirement/discharged/:id",
// name: "dischargedDetails",
// component: dischargedDetails,
// meta: {
// Auth: true,
// Key: [7.6],
// Role: "retirement",
// },
// },
// {
// path: "/retirement/expulsion",
// name: "expulsion",
// component: expulsionMain,
// meta: {
// Auth: true,
// Key: [7.7],
// Role: "retirement",
// },
// },
// {
// path: "/retirement/expulsion/:id",
// name: "expulsionDetails",
// component: expulsionDetails,
// meta: {
// Auth: true,
// Key: [7.7],
// Role: "retirement",
// },
// },
{
path: "/retirement/report",
name: "retireReport",
component: ReportView,
meta: {
Auth: true,
Key: "SYS_DISMISSAL_REPORT",
Role: "STAFF",
},
},
];

View file

@ -0,0 +1,555 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import { VuePDF, usePDF } from "@tato30/vue-pdf";
import axios from "axios";
import { useRoute } from "vue-router";
import { useStructureTree } from "@/stores/structureTree";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import type { DataStructureTree } from "@/interface/main";
import type {
DataOption,
DataDateMonthObject,
} from "@/modules/06_retirement/interface/index/Main";
import LoadView from "@/components/LoadView.vue";
const $q = useQuasar();
const route = useRoute();
const { fetchStructureTree } = useStructureTree();
const {
showLoader,
hideLoader,
date2Thai,
dateToISO,
messageError,
monthYear2Thai,
} = useCounterMixin();
/** Filter*/
const reportType = ref<string>("");
const optionReport = ref<DataOption[]>([
{
id: "1",
name: "จำนวนข้าราชการ กทม. สามัญ ที่พ้นจากราชการ",
},
{
id: "2",
name: "จำนวนลูกจ้างประจำ กทม. ที่พ้นจากราชการ",
},
]);
const filterType = ref<string>("MONTH");
const filterTypeOption = ref<DataOption[]>([
{ id: "MONTH", name: "รายเดือน" },
{ id: "YEAR", name: "รายปี" },
]);
const year = ref<number>(new Date().getFullYear());
const dateMonth = ref<DataDateMonthObject>({
month: new Date().getMonth(),
year: new Date().getFullYear(),
});
const dateStart = ref<Date>(
new Date(dateMonth.value.year, dateMonth.value.month + 1 - 1, 1)
);
const dateEnd = ref<Date>(
new Date(dateMonth.value.year, dateMonth.value.month + 1, 0)
);
/** View*/
const isLoadPDF = ref<boolean>(false);
const numOfPages = ref<number>(0);
const page = ref<number>(1);
const pdfSrc = ref<any>();
/** tree*/
const filterTree = ref<string>("");
const nodeId = ref<string>("");
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);
}
function onUpdateFilter() {
switch (filterType.value) {
case "MONTH":
const mount = dateMonth.value.month + 1;
//
dateStart.value = new Date(dateMonth.value.year, mount - 1, 1);
//
dateEnd.value = new Date(dateMonth.value.year, mount, 0);
break;
case "YEAR":
dateStart.value = new Date(year.value - 1, 9, 1);
dateEnd.value = new Date(year.value, 8, 30);
break;
default:
break;
}
fetchDataReport();
}
function onSelectedNode(id: string, level: number) {
nodeId.value = id;
nodeLevel.value = level;
fetchDataReport();
}
function fetchDataReport() {
if (!reportType.value || !nodeId.value) {
return false;
}
isLoadPDF.value = true;
const queryParams = {
nodeId: nodeId.value,
node: nodeLevel.value,
startDate: dateToISO(dateStart.value),
endDate: dateToISO(dateEnd.value),
};
http
.get(config.API.retirementReport + `${reportType.value}`, {
params: queryParams,
})
.then(async (res) => {
const data = await res.data.result;
await fetchDocumentTemplate(data);
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
isLoadPDF.value = false;
});
}
/**
* function เรยกไฟล PDF
* @param data อมลบญชนลา
*/
async function fetchDocumentTemplate(data: any) {
await axios
.post(`${config.API.reportTemplate}/xlsx`, data, {
headers: {
accept: "application/pdf",
"content-Type": "application/json",
},
responseType: "blob",
})
.then(async (res) => {
const blob = new Blob([res.data]);
const objectUrl = URL.createObjectURL(blob);
const pdfData = usePDF(`${objectUrl}`);
setTimeout(() => {
pdfSrc.value = pdfData.pdf.value;
numOfPages.value = pdfData.pages.value;
}, 1500);
})
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
});
}
/** ไปหน้าต่อไปของรายงาน */
function nextPage() {
if (page.value < numOfPages.value) {
page.value++;
}
}
/** กลับหน้าก่อนหน้าของรายงาน */
function backPage() {
if (page.value !== 1) {
page.value--;
}
}
function monthYearThai(val: DataDateMonthObject) {
if (val == null) return "";
else return monthYear2Thai(val.month, val.year);
}
onMounted(() => {
fetchDataTree();
});
</script>
<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="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
color="primary"
icon="download"
:disable="!reportType || !nodeId"
>
</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="`${'ปีงบประมาณ'}`"
>
<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)"
>
<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>
</div>
</q-card>
</div>
</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
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>
</template>
<style scoped>
.tree-container {
overflow: auto;
height: 60vh;
border: 1px solid #e6e6e7;
border-radius: 10px;
}
.my-list-link {
color: rgb(118, 168, 222);
border-radius: 5px;
background: #a3d3fb48 !important;
font-weight: 600;
border: 1px solid rgba(175, 185, 196, 0.217);
}
</style>

View file

@ -192,6 +192,7 @@ onMounted(async () => {
<q-btn
flat
round
:loading="isLoadPDF"
:disable="!nodeId || !employeeClass || !roundId"
color="primary"
icon="download"

View file

@ -34,7 +34,7 @@ const {
} = useCounterMixin();
const year = ref<number>(new Date().getFullYear());
const dateStart = ref<Date>(new Date(year.value, 9, 1));
const dateStart = ref<Date>(new Date(year.value - 1, 9, 1));
const dateEnd = ref<Date>(new Date(year.value + 1, 8, 30));
const dateMonth = ref<DataDateMonthObject>({
@ -239,8 +239,6 @@ async function fetchDocumentTemplate(data: any) {
}, 2000);
});
}
const splitterModel = ref(14);
const numOfPages = ref<number>(0);
const page = ref<number>(1);
const pdfSrc = ref<any>();
@ -294,6 +292,7 @@ onMounted(() => {
<q-space />
<q-btn
:disable="!isReport || !nodeId || !employeeClass"
:loading="isLoadPDF"
flat
round
color="primary"
@ -397,11 +396,8 @@ onMounted(() => {
:options="yearTypeOptionOption"
emit-value
map-options
hide-selected
fill-input
option-label="name"
option-value="id"
use-input
@update:model-value="updateLeaveday"
>
</q-select>
@ -613,7 +609,6 @@ onMounted(() => {
<q-card-section class="col-lg-9 col-md-8 col-xs-12 scroll">
<q-splitter
v-model="splitterModel"
horizontal
style="
height: 65vh;

View file

@ -32,7 +32,6 @@ const {
} = useCounterMixin();
const { fetchStructureTree } = useStructureTree();
const splitterModel = ref<number>(14);
/** filter*/
const typeReport = ref<string>("");
@ -297,6 +296,7 @@ onMounted(() => {
v-if="checkPermission($route)?.attrIsGet"
flat
:disable="!isReport || !nodeId || !employeeClass"
:loading="isLoadPDF"
round
color="primary"
icon="download"
@ -533,7 +533,6 @@ onMounted(() => {
<q-card-section class="col-lg-9 col-md-8 col-xs-12 scroll">
<q-splitter
v-model="splitterModel"
horizontal
style="
height: 65vh;

View file

@ -238,7 +238,7 @@ watch(
<template>
<q-dialog v-model="modal" persistent>
<q-card class="col-12" style="width: 60%">
<Header :tittle="'เลือกข้าราชการ ฯ'" :close="closeDialog" />
<Header :tittle="'เลือกข้าราชการฯ'" :close="closeDialog" />
<q-separator />
<q-card-section>
@ -271,7 +271,8 @@ watch(
label="ค้นหา"
class="full-width full-height"
unelevated
color="teal"
outline
color="primary"
@click="(formFilter.page = 1), searchFilter()"
>
</q-btn>

View file

@ -317,7 +317,7 @@ onMounted(() => {
<q-space />
<q-btn
class="q-px-sm"
v-if="storeActing.isOfficer === true"
v-if="storeActing.isOfficer"
dense
flat
round

View file

@ -206,7 +206,6 @@ async function fetchCommandType() {
*/
function filterOption(val: string, update: Function) {
update(() => {
group.value = val ? "" : group.value;
groupOp.value = groupDataOp.value.filter(
(v: DataOption) => v.name.indexOf(val) > -1
);
@ -487,12 +486,14 @@ watch(modal, async () => {
option-label="name"
:options="groupOp"
option-value="id"
class="inputgreen"
:class="isStaff ? '' : 'inputgreen'"
dense
:readonly="isStaff"
emit-value
map-options
use-input
hide-selected
fill-input
outlined
@update:model-value="updateValue"
@filter="(inputValue:any,doneFn:Function) => filterOption(inputValue, doneFn) "