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