Merge branch 'develop' of https://github.com/Frappet/bma-ehr-frontend into develop
This commit is contained in:
commit
442158bdfc
5 changed files with 117 additions and 31 deletions
|
|
@ -70,15 +70,6 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "status",
|
||||
align: "left",
|
||||
label: "สถานะ",
|
||||
sortable: true,
|
||||
field: "status",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
const visibleColumns = ref<string[]>([
|
||||
"no",
|
||||
|
|
@ -87,7 +78,6 @@ const visibleColumns = ref<string[]>([
|
|||
"coordinatesIn",
|
||||
"timeOut",
|
||||
"coordinatesOut",
|
||||
"status",
|
||||
]);
|
||||
|
||||
onMounted(() => {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ const { filterFn, searchDataFn } = workStore;
|
|||
|
||||
function calculateMaxDate() {
|
||||
const today = new Date();
|
||||
today.setDate(today.getDate() - 1);
|
||||
today.setDate(today.getDate());
|
||||
return today;
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
94
src/modules/09_leave/components/1_Work/ToolBarDate.vue
Normal file
94
src/modules/09_leave/components/1_Work/ToolBarDate.vue
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
<script setup lang="ts">
|
||||
//import Stores
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useWorklistDataStore } from "@/modules/09_leave/stores/WorkStore";
|
||||
|
||||
const workStore = useWorklistDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
|
||||
const { date2Thai } = mixin;
|
||||
const { filterFn, searchDataFn } = workStore;
|
||||
|
||||
function calculateMaxDate() {
|
||||
const today = new Date();
|
||||
today.setDate(today.getDate());
|
||||
return today;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="row col-12 q-col-gutter-sm q-mb-sm">
|
||||
<div class="col-xs-12 col-sm-3 col-md-2">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="workStore.selectDate"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
:max-date="calculateMaxDate()"
|
||||
@update:model-value="
|
||||
searchDataFn(workStore.selectDate, workStore.selectStatus)
|
||||
"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
for="selectDate"
|
||||
dense
|
||||
outlined
|
||||
lazy-rules
|
||||
:model-value="
|
||||
workStore.selectDate !== null
|
||||
? date2Thai(workStore.selectDate)
|
||||
: null
|
||||
"
|
||||
hide-bottom-space
|
||||
:label="`${'วันที่'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="event" class="cursor-pointer text-primary">
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<q-space />
|
||||
<div class="col-xs-12 col-sm-3 col-md-2">
|
||||
<q-input
|
||||
for="filterTable"
|
||||
dense
|
||||
outlined
|
||||
v-model="workStore.filterTable"
|
||||
label="ค้นหา"
|
||||
debounce="300"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon name="search" />
|
||||
</template>
|
||||
</q-input>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-2">
|
||||
<q-select
|
||||
for="visibleColumns"
|
||||
v-model="workStore.visibleColumns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="workStore.columns"
|
||||
option-value="name"
|
||||
options-cover
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
Loading…
Add table
Add a link
Reference in a new issue