Merge branch 'develop' into devTee
This commit is contained in:
commit
4ab2c5e139
1 changed files with 47 additions and 12 deletions
|
|
@ -41,6 +41,11 @@ const optionReport = ref<DataOption[]>([
|
|||
{ id: "1", name: "รายงานการเข้างาน" },
|
||||
{ id: "2", name: "รายงานการเข้างานสาย" },
|
||||
]);
|
||||
const employeeClass = ref<string>("officer");
|
||||
const employeeClassOption = ref<DataOption[]>([
|
||||
{ id: "officer", name: "ข้าราชการ กทม. สามัญ" },
|
||||
{ id: "employee", name: "ลูกจ้างประจำ กทม." },
|
||||
]);
|
||||
const filterType = ref<string>("DAY");
|
||||
const filterTypeMain = ref<DataOption[]>([
|
||||
{ id: "DAY", name: "รายวัน" },
|
||||
|
|
@ -92,10 +97,14 @@ async function fetchDataTree() {
|
|||
function onSelectedNode(id: string, level: number) {
|
||||
nodeId.value = id;
|
||||
nodeLevel.value = level;
|
||||
updateFilterType(filterType.value);
|
||||
}
|
||||
|
||||
/** function อัปเดทรายงานสถิติการลา*/
|
||||
async function updateFilterType(type: string) {
|
||||
if (!nodeId.value || !typeReport.value) {
|
||||
return false;
|
||||
}
|
||||
let body = {};
|
||||
isReport.value = false;
|
||||
isLoadPDF.value = true;
|
||||
|
|
@ -106,6 +115,8 @@ async function updateFilterType(type: string) {
|
|||
startDate: dateToISO(date.value),
|
||||
endDate: dateToISO(date.value),
|
||||
type: filterType.value,
|
||||
nodeId: nodeId.value,
|
||||
node: nodeLevel.value,
|
||||
};
|
||||
break;
|
||||
|
||||
|
|
@ -117,6 +128,8 @@ async function updateFilterType(type: string) {
|
|||
startDate: dateToISO(startOfWeek),
|
||||
endDate: dateToISO(endOfWeek),
|
||||
type: filterType.value,
|
||||
nodeId: nodeId.value,
|
||||
node: nodeLevel.value,
|
||||
};
|
||||
break;
|
||||
|
||||
|
|
@ -130,6 +143,8 @@ async function updateFilterType(type: string) {
|
|||
startDate: dateToISO(firstDay),
|
||||
endDate: dateToISO(lastDay),
|
||||
type: filterType.value,
|
||||
nodeId: nodeId.value,
|
||||
node: nodeLevel.value,
|
||||
};
|
||||
break;
|
||||
default:
|
||||
|
|
@ -146,6 +161,8 @@ async function updateFilterType(type: string) {
|
|||
* @param body วันเรื่มต้นและสิ้นสุด
|
||||
*/
|
||||
async function fetchReportTimeRecords(body: any) {
|
||||
console.log(body);
|
||||
|
||||
await http
|
||||
.post(config.API.leaveReportTimeRecords(), body)
|
||||
.then(async (res) => {
|
||||
|
|
@ -230,7 +247,7 @@ function monthYearThai(val: DataDateMonthObject) {
|
|||
else return monthYear2Thai(val.month, val.year);
|
||||
}
|
||||
|
||||
function formatWeekDisplay(week: any) {
|
||||
function formatWeekDisplay(week: Date[]) {
|
||||
if (week) {
|
||||
if (!week[0] || !week[1]) return "";
|
||||
return `${date2Thai(week[0])} - ${date2Thai(week[1])}`;
|
||||
|
|
@ -261,22 +278,21 @@ onMounted(() => {
|
|||
<q-card flat bordered class="col-12">
|
||||
<div class="row q-col-gutter-sm q-pa-md">
|
||||
<div class="row col-12">
|
||||
<div class="col-2">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<q-select
|
||||
hide-bottom-space
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
v-model="typeReport"
|
||||
:label="`${'รายงาน'}`"
|
||||
v-model="employeeClass"
|
||||
:options="employeeClassOption"
|
||||
label="สถานภาพ"
|
||||
emit-value
|
||||
map-options
|
||||
:options="optionReport"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
@update:model-value="updateFilterType(filterType)"
|
||||
/>
|
||||
style="width: 230px"
|
||||
>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<q-space />
|
||||
|
|
@ -284,7 +300,7 @@ onMounted(() => {
|
|||
<q-btn
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
flat
|
||||
:disable="!isReport || !nodeId"
|
||||
:disable="!isReport || !nodeId || !employeeClass"
|
||||
round
|
||||
color="primary"
|
||||
icon="download"
|
||||
|
|
@ -305,6 +321,25 @@ onMounted(() => {
|
|||
<div class="col-12 row">
|
||||
<q-card bordered class="col-12 filter-card q-pa-sm">
|
||||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div class="q-pr-xs col-2">
|
||||
<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="updateFilterType(filterType)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="q-pr-xs col-2">
|
||||
<q-select
|
||||
class="bg-white"
|
||||
|
|
@ -465,7 +500,7 @@ onMounted(() => {
|
|||
<template v-slot:default-header="prop">
|
||||
<q-item
|
||||
@click.stop="
|
||||
onSelectedNode(prop.node.orgTreeId, prop.node.nodeLevel)
|
||||
onSelectedNode(prop.node.orgTreeId, prop.node.orgLevel)
|
||||
"
|
||||
:active="nodeId === prop.node.orgTreeId"
|
||||
clickable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue