Merge branch 'develop' into devTee
# Conflicts: # src/interface/request/main/main.ts # src/modules/09_leave/router.ts
This commit is contained in:
commit
580f8ac565
15 changed files with 930 additions and 307 deletions
|
|
@ -67,7 +67,7 @@ function changTab() {
|
|||
<q-tab
|
||||
@click="changTab"
|
||||
name="1"
|
||||
label="รายการลาที่อยู่ระหว่างดำเนิดการ"
|
||||
label="รายการลาที่อยู่ระหว่างดำเนินการ"
|
||||
>
|
||||
<q-badge
|
||||
color="grey-4"
|
||||
|
|
|
|||
|
|
@ -3,15 +3,15 @@ import { ref, useAttrs, onMounted } from "vue";
|
|||
|
||||
import router from "@/router";
|
||||
import { useQuasar } from "quasar";
|
||||
import DialogForm from '@/modules/09_leave/components/3_WorkTime/DialogForm.vue'
|
||||
import { useRoundDataStore } from '@/modules/09_leave/stores/RoundStores'
|
||||
import DialogForm from "@/modules/09_leave/components/3_WorkTime/DialogForm.vue";
|
||||
import { useRoundDataStore } from "@/modules/09_leave/stores/RoundStores";
|
||||
const dataStore = useRoundDataStore();
|
||||
const { fetchData } = dataStore;
|
||||
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const modal = ref<boolean>(false)
|
||||
const detailData = ref<any>()
|
||||
const editCheck = ref<string>('')
|
||||
const modal = ref<boolean>(false);
|
||||
const detailData = ref<any>();
|
||||
const editCheck = ref<string>("");
|
||||
// ค้นหาในตาราง
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterRef = ref<HTMLInputElement | null>(null);
|
||||
|
|
@ -35,17 +35,17 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
else return start + "-" + end + " ใน " + total;
|
||||
};
|
||||
|
||||
function openModal(data:any,check:string){
|
||||
modal.value = true
|
||||
editCheck.value = check
|
||||
if(check === 'edit'){
|
||||
detailData.value = data
|
||||
}
|
||||
};
|
||||
function openModal(data: any, check: string) {
|
||||
modal.value = true;
|
||||
editCheck.value = check;
|
||||
if (check === "edit") {
|
||||
detailData.value = data;
|
||||
}
|
||||
}
|
||||
|
||||
function closeDialog(){
|
||||
modal.value = false
|
||||
editCheck.value = 'add'
|
||||
function closeDialog() {
|
||||
modal.value = false;
|
||||
editCheck.value = "add";
|
||||
}
|
||||
onMounted(() => {
|
||||
dataStore.fetchData([
|
||||
|
|
@ -54,36 +54,32 @@ onMounted(() => {
|
|||
amOut: "12:00",
|
||||
pm: "13:00",
|
||||
pmOut: "15:30",
|
||||
note: "",
|
||||
status: true,
|
||||
isDefault:true
|
||||
isDefault: true,
|
||||
},
|
||||
{
|
||||
am: "08:30",
|
||||
amOut: "12:00",
|
||||
pm: "13:00",
|
||||
pmOut: "15:30",
|
||||
note: "",
|
||||
status: false,
|
||||
isDefault:false
|
||||
isDefault: false,
|
||||
},
|
||||
{
|
||||
am: "09:30",
|
||||
amOut: "12:00",
|
||||
pm: "13:00",
|
||||
pmOut: "15:30",
|
||||
note: "",
|
||||
status: true,
|
||||
isDefault:false
|
||||
isDefault: false,
|
||||
},
|
||||
{
|
||||
am: "10:30",
|
||||
amOut: "12:00",
|
||||
pm: "13:00",
|
||||
pmOut: "15:30",
|
||||
note: "",
|
||||
status: true,
|
||||
isDefault:false
|
||||
isDefault: false,
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
|
@ -97,7 +93,7 @@ onMounted(() => {
|
|||
<div>
|
||||
<q-btn
|
||||
for="#addInvestigatefacts"
|
||||
@click="openModal(null,'add')"
|
||||
@click="openModal(null, 'add')"
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
|
|
@ -172,9 +168,9 @@ onMounted(() => {
|
|||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
style="color: #000000; font-weight: 500;"
|
||||
style="color: #000000; font-weight: 500"
|
||||
>
|
||||
<span class="text-weight-medium ">{{ col.label }}</span>
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
</q-tr>
|
||||
</template>
|
||||
|
|
@ -182,15 +178,20 @@ onMounted(() => {
|
|||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td auto-width>
|
||||
<q-icon
|
||||
v-if="props.row.isDefault === true"
|
||||
name="mdi-bookmark"
|
||||
size="xs"
|
||||
color="primary"
|
||||
>
|
||||
<q-tooltip>เวลา Default</q-tooltip>
|
||||
v-if="props.row.isDefault === true"
|
||||
name="mdi-bookmark"
|
||||
size="xs"
|
||||
color="primary"
|
||||
>
|
||||
<q-tooltip>เวลา Default</q-tooltip>
|
||||
</q-icon>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props" @click.prevent="openModal(props.row,'edit')">
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click.prevent="openModal(props.row, 'edit')"
|
||||
>
|
||||
<div v-if="col.name === 'status'" class="text-center">
|
||||
<q-icon
|
||||
v-if="props.row.status === true"
|
||||
|
|
@ -214,12 +215,12 @@ onMounted(() => {
|
|||
</d-table>
|
||||
</div>
|
||||
</q-card>
|
||||
<DialogForm
|
||||
:modal="modal"
|
||||
:closeDialog="closeDialog"
|
||||
:editCheck="editCheck"
|
||||
:detailData="detailData"
|
||||
/>
|
||||
<DialogForm
|
||||
:modal="modal"
|
||||
:closeDialog="closeDialog"
|
||||
:editCheck="editCheck"
|
||||
:detailData="detailData"
|
||||
/>
|
||||
</template>
|
||||
<style scoped lang="scss">
|
||||
.q-table tbody td:before.no-background {
|
||||
|
|
|
|||
150
src/modules/09_leave/views/SpecialTimeMain.vue
Normal file
150
src/modules/09_leave/views/SpecialTimeMain.vue
Normal file
|
|
@ -0,0 +1,150 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref, useAttrs } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import type { Pagination } from "@/modules/03_recruiting/interface/index/Main";
|
||||
import Table from "@/modules/09_leave/components/4_specialTime/Table.vue";
|
||||
import { useSpecialTimeStore } from "@/modules/09_leave/stores/SpecialTimeStore";
|
||||
import DialogReason from "@/components/Dialogs/PopupReason.vue";
|
||||
|
||||
import { useRouter } from "vue-router";
|
||||
const dataSpecialTime = useSpecialTimeStore();
|
||||
const { fecthList } = dataSpecialTime;
|
||||
const $q = useQuasar(); // show dialog
|
||||
const mixin = useCounterMixin();
|
||||
const router = useRouter();
|
||||
const { hideLoader, monthYear2Thai } = mixin;
|
||||
const filter = ref<string>(""); //search data table
|
||||
const initialPagination = ref<Pagination>({
|
||||
rowsPerPage: 0,
|
||||
});
|
||||
const attrs = ref<any>(useAttrs());
|
||||
const modalUnapprove = ref(false);
|
||||
const pagination = ref({
|
||||
// sortBy: "desc",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
});
|
||||
const dialogTitle = ref<string>("");
|
||||
const dialogDesc = ref<string>("");
|
||||
const name = ref("");
|
||||
const unapprove = async (fullname: string) => {
|
||||
dialogTitle.value = " ไม่อนุมัติการลงเวลาพิเศษของ" + fullname;
|
||||
name.value = fullname;
|
||||
modalUnapprove.value = true;
|
||||
};
|
||||
const closeReason = () => {
|
||||
modalUnapprove.value = false;
|
||||
};
|
||||
const clickSave = () => {
|
||||
modalUnapprove.value = false;
|
||||
};
|
||||
// ค้นหาในตาราง
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterRef = ref<HTMLInputElement | null>(null);
|
||||
const resetFilter = () => {
|
||||
filterKeyword.value = "";
|
||||
if (filterRef.value) {
|
||||
filterRef.value.focus();
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
fecthList([
|
||||
{
|
||||
fullname: "นางสาวณัฐกา ชมสิน",
|
||||
date: "2023-10-30",
|
||||
dateFix: "2023-10-30",
|
||||
type: "Checkin",
|
||||
reason: "ลืม",
|
||||
unapprove: "1",
|
||||
approve: "0",
|
||||
},
|
||||
{
|
||||
fullname: "นางสาวรัชภรณ์ ภักดี",
|
||||
date: "2023-10-30",
|
||||
dateFix: "2023-10-30",
|
||||
type: "Checkin",
|
||||
reason: "ลืม",
|
||||
unapprove: "1",
|
||||
approve: "0",
|
||||
},
|
||||
{
|
||||
fullname: "นางสาวภาพรรณ ลออ",
|
||||
date: "2023-10-30",
|
||||
dateFix: "2023-10-30",
|
||||
type: "Checkin",
|
||||
reason: "ลืม",
|
||||
unapprove: "1",
|
||||
approve: "0",
|
||||
},
|
||||
]);
|
||||
await hideLoader();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
รายการลงเวลากรณีพิเศษ
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm q-pt-sm q-pa-md">
|
||||
<div>
|
||||
<Table
|
||||
style="max-height: 80vh"
|
||||
:rows="dataSpecialTime.rows"
|
||||
:columns="dataSpecialTime.columns"
|
||||
:filter="filter"
|
||||
:visible-columns="dataSpecialTime.visibleColumns"
|
||||
v-model:inputfilter="filter"
|
||||
v-model:inputvisible="dataSpecialTime.visibleColumns"
|
||||
:pagination="initialPagination"
|
||||
:nornmalData="true"
|
||||
:paging="true"
|
||||
:titleText="''"
|
||||
>
|
||||
<template #columns="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
<q-th auto-width />
|
||||
<q-th auto-width />
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
color="orange"
|
||||
class="q-px-md"
|
||||
dense
|
||||
unelevated
|
||||
@click="unapprove(props.row.fullname)"
|
||||
>ไม่อนุมัติ</q-btn
|
||||
>
|
||||
<span>{{ props.row.unapprove }}</span>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn color="primary" class="q-px-md" dense unelevated
|
||||
>อนุมัติ</q-btn
|
||||
>
|
||||
<span>{{ props.row.approve }}</span>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
</q-card>
|
||||
<DialogReason
|
||||
:modal="modalUnapprove"
|
||||
:title="dialogTitle"
|
||||
:desc="dialogDesc"
|
||||
:click-close="closeReason"
|
||||
label="เหตุผล"
|
||||
:savaForm="clickSave"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style></style>
|
||||
|
|
@ -17,6 +17,8 @@ const workStore = useWorklistDataStore();
|
|||
const { date2Thai } = mixin;
|
||||
const { fetchList } = workStore;
|
||||
|
||||
const tab = ref("1")
|
||||
|
||||
onMounted(() => {
|
||||
fecthWorkList();
|
||||
});
|
||||
|
|
@ -84,9 +86,38 @@ function fecthWorkList() {
|
|||
รายการลงเวลาปฏิบัติงาน
|
||||
</div>
|
||||
<div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm">
|
||||
<div class="q-pa-md"><ToolBar /> <TableList /></div
|
||||
></q-card>
|
||||
<q-card bordered flat>
|
||||
<q-tabs
|
||||
v-model="tab"
|
||||
dense
|
||||
align="left"
|
||||
inline-label
|
||||
class="rounded-borders"
|
||||
indicator-color="primary"
|
||||
active-bg-color="teal-1"
|
||||
active-class="text-primary"
|
||||
>
|
||||
<q-tab name="1" label="รายการลงเวลาที่ประมวลผลแล้ว"/>
|
||||
<q-tab name="2" label="รายการลงเวลา" />
|
||||
</q-tabs>
|
||||
|
||||
<q-separator />
|
||||
|
||||
<q-tab-panels v-model="tab" animated>
|
||||
<q-tab-panel name="1">
|
||||
<!-- <TableList1 /> -->
|
||||
<ToolBar />
|
||||
<TableList />
|
||||
</q-tab-panel>
|
||||
|
||||
<q-tab-panel name="2">
|
||||
<!-- <TabList2Vue /> -->
|
||||
<ToolBar />
|
||||
<TableList />
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
<!-- </q-card> -->
|
||||
</q-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue