ปฏิบัติราชการพิเศษ

This commit is contained in:
setthawutttty 2024-03-12 17:49:46 +07:00
parent d499781409
commit eb6d256eaa
7 changed files with 1133 additions and 29 deletions

View file

@ -404,7 +404,6 @@ const fieldLabels = {
</script>
<template>
<div class="row">
<div class="text-weight-bold text-subtitle1">ประวราชการ</div>
<q-space />
<div class="q-gutter-x-sm">
<q-btn

View file

@ -422,7 +422,6 @@ onMounted(() => {
</script>
<template>
<div class="row items-center q-gutter-x-sm q-py-sm">
<div class="text-weight-bold text-subtitle1"></div>
<q-btn color="teal-5" icon="add" flat round @click="openDialogAdd()"
><q-tooltip>เพมขอม</q-tooltip></q-btn
@ -588,7 +587,7 @@ onMounted(() => {
flat
round
@click="openDialogHistory(props.row.id)"
><q-tooltip>ประวอมลราชการ</q-tooltip></q-btn
><q-tooltip>ประวแกไขว</q-tooltip></q-btn
>
</div>
</div>

View file

@ -479,7 +479,6 @@ onMounted(() => {
</script>
<template>
<div class="row items-center q-gutter-x-sm q-py-sm">
<div class="text-weight-bold text-subtitle1">การลา</div>
<q-btn color="teal-5" icon="add" flat round @click="openDialogAdd()"
><q-tooltip>เพมขอม</q-tooltip></q-btn
@ -643,7 +642,7 @@ onMounted(() => {
flat
round
@click="openDialogHistory(props.row.id)"
><q-tooltip>ประวอมลราชการ</q-tooltip></q-btn
><q-tooltip>ประวแกไขการลา</q-tooltip></q-btn
>
</div>
</div>

View file

@ -1,6 +1,749 @@
<script setup lang="ts"></script>
<script setup lang="ts">
import { ref, reactive, onMounted } from "vue";
import { useQuasar, type QTableProps } from "quasar";
import type {
FormFilter,
RequestItemsObject,
MyObjectRef,
} from "@/modules/04_registryNew/interface/index/performSpecialWork";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import DialogHeader from "@/components/DialogHeader.vue";
import DialogHistory from "@/modules/04_registryNew/components/detail/GovernmentInformation/04_PerformSpecialWorkHistory.vue";
import { useRoute } from "vue-router";
const route = useRoute();
const profileId = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const $q = useQuasar();
const mixin = useCounterMixin();
const {
date2Thai,
dialogConfirm,
messageError,
showLoader,
hideLoader,
success,
} = mixin;
const modal = ref<boolean>(false);
const edit = ref<boolean>(false);
const modalHistory = ref<boolean>(false);
const id = ref<string>("");
const dateStart = ref<Date | null>(null);
const dateEnd = ref<Date | null>(null);
const detail = ref<string>();
const reference = ref<string>();
const refCommandNo = ref<string>();
const refCommandDate = ref<Date | null>(null);
const dateStartRef = ref<object | null>(null);
const dateEndRef = ref<object | null>(null);
const detailRef = ref<object | null>(null);
const referenceRef = ref<object | null>(null);
const objectRef: MyObjectRef = {
dateStart: dateStartRef,
dateEnd: dateEndRef,
detail: detailRef,
reference: referenceRef,
};
const rows = ref<RequestItemsObject[]>([]);
const filterKeyword = ref<string>("");
const mode = ref<string>("card");
const formFilter = reactive<FormFilter>({
page: 1,
pageSize: 12,
keyword: "",
type: "",
posType: "",
posLevel: "",
retireYear: "",
rangeYear: { min: 0, max: 60 },
isShowRetire: false,
isProbation: false,
});
const currentPage = ref<number>(1);
const maxPage = ref<number>(1);
const visibleColumns = ref<String[]>([
"dateStart",
"dateEnd",
"detail",
"reference",
"refCommandNo",
"refCommandDate",
]);
const columns = ref<QTableProps["columns"]>([
{
name: "dateStart",
align: "left",
label: "เริ่มต้น",
sortable: true,
field: "dateStart",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "dateEnd",
align: "left",
label: "สิ้นสุด",
sortable: true,
field: "dateEnd",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "reference",
align: "left",
label: "เอกสารอ้างอิง",
sortable: true,
field: "reference",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "detail",
align: "left",
label: "รายละเอียด",
sortable: true,
field: "detail",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "refCommandNo",
align: "left",
label: "เลขที่คำสั่ง",
sortable: true,
field: "refCommandNo",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "refCommandDate",
align: "left",
label: "เอกสารอ้างอิง (ลงวันที่)",
sortable: true,
field: "refCommandDate",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
/** เปิด dialog */
function openDialogAdd() {
modal.value = true;
}
function openDialogEdit(props: RequestItemsObject) {
modal.value = true;
id.value = props.id;
dateStart.value = props.dateStart;
dateEnd.value = props.dateEnd;
detail.value = props.detail;
reference.value = props.reference;
refCommandNo.value = props.refCommandNo;
refCommandDate.value = props.refCommandDate;
}
/**
* งชนดอมลประวแกไขขอมลทเลอก
* @param row อม row ประวการแกไข
*/
function openDialogHistory(idOrder: string) {
modalHistory.value = true;
id.value = idOrder;
}
/** ปิด dialog */
function closeDialog() {
modal.value = false;
edit.value = false;
dateStart.value = null;
dateEnd.value = null;
detail.value = "";
reference.value = "";
refCommandNo.value = "";
refCommandDate.value = null;
}
function getData() {
// showLoader()
// http
// .get(config.API.??)
// .then((res)=>{
// })
// .catch((e)=>{
// messageError($q,e)
// }).finally(()=>{
// })
const data: RequestItemsObject[] = [
{
dateStart: new Date("2024-02-15T00:00:00"),
dateEnd: new Date("2024-02-15T00:00:00"),
detail: "111",
reference: "111",
refCommandNo: "",
refCommandDate: null,
id: "08dc2e13-1c3f-4261-8168-30018e5d953c",
},
];
rows.value = data;
}
/** validate check*/
function validateForm() {
const hasError = [];
for (const key in objectRef) {
if (Object.prototype.hasOwnProperty.call(objectRef, key)) {
const property = objectRef[key];
if (property.value && typeof property.value.validate === "function") {
const isValid = property.value.validate();
hasError.push(isValid);
}
}
}
if (hasError.every((result) => result === true)) {
if ((edit.value = false)) {
saveData();
} else {
editData();
}
}
}
/**
* นทกเพมขอม
*/
function saveData() {
// showLoader();
// await http
// .post(config.API.profileDutyId(profileId.value), {
// id: id.value,
// dateStart: dateToISO(dateStart.value),
// dateEnd: dateToISO(dateEnd.value),
// detail: detail.value,
// reference: reference.value,
// refCommandNo: refCommandNo.value,
// refCommandDate:
// refCommandDate.value == null
// ? null
// : dateToISO(refCommandDate.value as Date),
// })
// .then((res) => {
// success($q, "");
// modal.value = false;
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(async () => {
// await fetchData();
// });
closeDialog();
}
/**
* นทกแกไขขอม
*/
const editData = async () => {
// showLoader();
// await http
// .put(config.API.profileDutyId(id.value), {
// id: id.value,
// dateStart: dateToISO(dateStart.value),
// dateEnd: dateToISO(dateEnd.value),
// detail: detail.value,
// reference: reference.value,
// refCommandNo: refCommandNo.value,
// refCommandDate:
// refCommandDate.value == null
// ? null
// : dateToISO(refCommandDate.value as Date),
// })
// .then((res) => {
// success($q, "");
// modal.value = false;
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(async () => {
// await fetchData();
// });
closeDialog();
};
onMounted(() => {
getData();
});
</script>
<template>
<div>ปฏราชการพเศษ</div>
<div class="row items-center q-gutter-x-sm q-py-sm">
<q-btn color="teal-5" icon="add" flat round @click="openDialogAdd()"
><q-tooltip>เพมขอม</q-tooltip></q-btn
>
<q-space />
<q-input
standout
dense
v-model="filterKeyword"
ref="filterRef"
outlined
placeholder="ค้นหา"
debounce="300"
>
<template v-slot:append>
<q-icon
v-if="filterKeyword == ''"
name="search"
@click.stop.prevent="filterKeyword = ''"
class="cursor-pointer"
/>
<q-icon
v-if="filterKeyword"
name="cancel"
@click.stop.prevent="filterKeyword = ''"
class="cursor-pointer"
/>
</template>
</q-input>
<q-select
v-if="mode == 'table'"
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 150px"
/>
<q-btn-toggle
v-model="mode"
dense
class="no-shadow toggle-borderd"
toggle-color="grey-4"
:options="[
{ value: 'table', slot: 'table' },
{ value: 'card', slot: 'card' },
]"
>
<template v-slot:table>
<q-icon
name="format_list_bulleted"
size="24px"
:style="{
color: mode === 'table' ? '#787B7C' : '#C9D3DB',
}"
/>
</template>
<template v-slot:card>
<q-icon
name="mdi-view-grid-outline"
size="24px"
:style="{
color: mode === 'card' ? '#787B7C' : '#C9D3DB',
}"
/>
</template>
</q-btn-toggle>
</div>
<d-table
ref="table"
flat
bordered
dense
:card-container-class="mode === 'card' ? 'q-col-gutter-md' : ''"
:columns="columns"
:rows="rows"
:grid="mode === 'card'"
:paging="true"
:rows-per-page-options="[10, 25, 50, 100]"
:visible-columns="visibleColumns"
:filter="filterKeyword"
>
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width></q-th>
</q-tr>
</template>
<template v-slot:body="props" v-if="mode === 'table'">
<q-tr :props="props" class="cursor-pointer">
<q-td
v-for="col in props.cols"
:key="col.id"
@click="openDialogEdit(props.row)"
>
<div v-if="col.name === 'no'">
{{
(formFilter.page - 1) * formFilter.pageSize + props.rowIndex + 1
}}
</div>
<div
v-else-if="
col.name == 'dateStart' ||
col.name == 'dateEnd' ||
col.name == 'refCommandDate'
"
>
{{ col.value ? date2Thai(col.value) : "-" }}
</div>
<div v-else>
{{ col.value ? col.value : "-" }}
</div>
</q-td>
<q-td auto-width>
<q-btn
color="info"
flat
dense
round
size="14px"
icon="mdi-history"
@click="openDialogHistory(props.row.id)"
>
<q-tooltip>ประวแกไขปฏราชการพเศษ</q-tooltip>
</q-btn>
</q-td>
</q-tr>
</template>
<template v-slot:item="props" v-else>
<div class="col-xs-12 col-sm-6 col-md-4">
<q-card flat bordered class="q-pa-md">
<div class="row q-pb-sm">
<div class="column">
<div class="text-weight-bold">
{{ props.row.level !== "" ? props.row.level : "-" }}
</div>
<div class="text-weight-light full-width text-left text-grey-9">
{{ date2Thai(props.row.date) }}
</div>
</div>
<q-space />
<div class="q-gutter-x-sm">
<q-btn
color="teal-5"
icon="mdi-pencil-outline"
flat
round
@click="openDialogEdit(props.row)"
><q-tooltip>แกไข</q-tooltip></q-btn
>
<q-btn
color="edit"
icon="mdi-history"
flat
round
@click="openDialogHistory(props.row.id)"
><q-tooltip>ประวแกไขปฏราชการพเศษ</q-tooltip></q-btn
>
</div>
</div>
<q-separator />
<q-list>
<q-item
v-for="col in props.cols.filter((col) => col.name !== 'desc')"
:key="col.name"
>
<q-item-section>
<q-item-label>{{ col.label }}</q-item-label>
</q-item-section>
<q-item-section side>
<q-item-label
caption
v-if="
col.name === 'refCommandDate' ||
col.name == 'dateStart' ||
col.name == 'dateEnd'
"
>
{{ col.value ? date2Thai(col.value) : "-" }}
</q-item-label>
<q-item-label caption v-else>{{
col.value ? col.value : "-"
}}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-card>
</div>
</template>
<template v-slot:pagination="scope">
<q-pagination
v-model="currentPage"
active-color="primary"
color="dark"
:max="Number(maxPage)"
size="sm"
boundary-links
direction-links
></q-pagination>
</template>
<template v-slot:no-data="{ icon, message, filter }">
<div class="full-width row flex-center text-accent q-gutter-sm">
<span
><div
style="
height: 50vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
"
class="text-grey-5"
>
<q-icon name="search" size="4rem" />
<span>ไมพบขอม</span>
</div>
</span>
</div>
</template>
</d-table>
<q-dialog v-model="modal" persistent>
<q-card style="min-width: 600px">
<form @submit.prevent="validateForm">
<q-card-section class="flex justify-between" style="padding: 0">
<DialogHeader tittle="ปฏิบัติราชการพิเศษ" :close="closeDialog" />
</q-card-section>
<q-separator />
<q-card-section class="q-p-sm">
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-xs-6 col-sm-6 col-md-6">
<datepicker
menu-class-name="modalfix"
v-model="dateStart"
:locale="'th'"
autoApply
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
ref="dateStartRef"
class="full-width inputgreen cursor-pointer"
outlined
dense
:model-value="date2Thai(dateStart)"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่เริ่มต้น'}`]"
hide-bottom-space
:label="`${'วันที่เริ่มต้น'}`"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
:style="
edit
? 'color: var(--q-primary)'
: 'color: var(--q-grey)'
"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<datepicker
menu-class-name="modalfix"
v-model="dateEnd"
:locale="'th'"
autoApply
:enableTimePicker="false"
:min-date="dateStart"
:readonly="!dateStart"
week-start="0"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
ref="dateEndRef"
:readonly="!dateStart"
class="full-width inputgreen cursor-pointer"
dense
outlined
:model-value="date2Thai(dateEnd)"
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่สิ้นสุด'}`]"
hide-bottom-space
:label="`${'วันที่สิ้นสุด'}`"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
:style="
edit
? 'color: var(--q-primary)'
: 'color: var(--q-grey)'
"
>
</q-icon>
</template>
</q-input>
</template>
</datepicker>
</div>
<div class="col-12">
<q-input
ref="referenceRef"
class="full-width inputgreen cursor-pointer"
outlined
dense
lazy-rules
autogrow
v-model="reference"
:rules="[(val) => !!val || `${'กรุณากรอกเอกสารอ้างอิง'}`]"
hide-bottom-space
:label="`${'เอกสารอ้างอิง'}`"
/>
</div>
<div class="col-12">
<q-input
ref="detailRef"
class="full-width inputgreen cursor-pointer"
outlined
dense
lazy-rules
autogrow
v-model="detail"
:rules="[(val) => !!val || `${'กรุณากรอกรายละเอียด'}`]"
hide-bottom-space
:label="`${'รายละเอียด'}`"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<q-input
class="full-width inputgreen cursor-pointer"
outlined
dense
v-model="refCommandNo"
:label="`${'เลขที่คำสั่ง'}`"
>
<template v-slot:append>
<q-icon name="mdi-file" class="cursor-pointer" />
</template>
</q-input>
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
<datepicker
menu-class-name="modalfix"
v-model="refCommandDate"
:locale="'th'"
autoApply
:enableTimePicker="false"
week-start="0"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
parseInt(value + 543)
}}</template>
<template #trigger>
<q-input
class="full-width inputgreen cursor-pointer"
outlined
dense
lazy-rules
:borderless="!edit"
:model-value="
refCommandDate == null ? null : date2Thai(refCommandDate as Date)
"
hide-bottom-space
:label="`${'เอกสารอ้างอิง (ลงวันที่)'}`"
>
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
:style="
edit
? 'color: var(--q-primary)'
: 'color: var(--q-grey)'
"
>
</q-icon>
</template>
<template v-if="refCommandDate && edit" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="refCommandDate = null"
class="cursor-pointer"
/>
</template>
</q-input>
</template>
</datepicker>
</div>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right">
<q-btn
id="onSubmit"
type="submit"
dense
unelevated
label="บันทึก"
color="public"
class="q-px-md"
>
<q-tooltip>นทกขอม</q-tooltip>
</q-btn>
</q-card-actions>
</form>
</q-card>
</q-dialog>
<DialogHistory v-model:modal="modalHistory" v-model:id="id" />
</template>
<style scoped></style>

View file

@ -0,0 +1,315 @@
<script setup lang="ts">
import { ref, watch, reactive } from "vue";
import DialogHeader from "@/components/DialogHeader.vue";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar, type QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import type {
FormFilter,
ResponseObject,
} from "@/modules/04_registryNew/interface/index/performSpecialWork";
const modal = defineModel<boolean>("modal", { required: true });
const id = defineModel<string>("id", { required: true });
const $q = useQuasar();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const currentPage = ref<number>(1);
const maxPage = ref<number>(1);
const filterKeyword = ref<string>("");
const rows = ref<ResponseObject[]>([]); //select data history
const formFilter = reactive<FormFilter>({
page: 1,
pageSize: 12,
keyword: "",
type: "",
posType: "",
posLevel: "",
retireYear: "",
rangeYear: { min: 0, max: 60 },
isShowRetire: false,
isProbation: false,
});
const visibleColumns = ref<String[]>([
"dateStart",
"dateEnd",
"detail",
"reference",
"refCommandNo",
"refCommandDate",
"createdFullName",
"createdAt",
]);
const columns = ref<QTableProps["columns"]>([
{
name: "dateStart",
align: "left",
label: "เริ่มต้น",
sortable: true,
field: "dateStart",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "dateEnd",
align: "left",
label: "สิ้นสุด",
sortable: true,
field: "dateEnd",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "reference",
align: "left",
label: "เอกสารอ้างอิง",
sortable: true,
field: "reference",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "detail",
align: "left",
label: "รายละเอียด",
sortable: true,
field: "detail",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "refCommandNo",
align: "left",
label: "เลขที่คำสั่ง",
sortable: true,
field: "refCommandNo",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "refCommandDate",
align: "left",
label: "เอกสารอ้างอิง (ลงวันที่)",
sortable: true,
field: "refCommandDate",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "createdFullName",
align: "left",
label: "ผู้ดำเนินการ",
sortable: true,
field: "createdFullName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "createdAt",
align: "left",
label: "วันที่แก้ไข",
sortable: true,
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
function getHistory() {
showLoader();
http
.get(config.API.profileDutyHisId(id.value))
.then((res) => {
let data = res.data.result;
rows.value = [];
data.map((e: ResponseObject) => {
rows.value.push({
id: e.id,
dateStart: new Date(e.dateStart),
dateEnd: new Date(e.dateEnd),
detail: e.detail,
reference: e.reference,
refCommandNo: e.refCommandNo,
refCommandDate:
e.refCommandDate == null ? null : new Date(e.refCommandDate),
createdFullName: e.createdFullName,
createdAt: new Date(e.createdAt),
});
});
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
watch(modal, (status) => {
if (status == true) {
getHistory();
filterKeyword.value = "";
} else {
filterKeyword.value = "";
}
});
</script>
<template>
<q-dialog v-model="modal" persistent>
<q-card style="min-width: 80%">
<q-card-section class="flex justify-between" style="padding: 0">
<DialogHeader
tittle="ประวัติแก้ไขปฏิบัติราชการพิเศษ"
:close="() => (modal = false)"
/>
</q-card-section>
<q-separator />
<q-card-section class="q-p-sm">
<div class="row q-gutter-sm q-mb-sm">
<q-space />
<q-input
standout
dense
v-model="filterKeyword"
ref="filterRef"
outlined
placeholder="ค้นหา"
debounce="300"
>
<template v-slot:append>
<q-icon
v-if="filterKeyword == ''"
name="search"
@click.stop.prevent="filterKeyword = ''"
class="cursor-pointer"
/>
<q-icon
v-if="filterKeyword"
name="cancel"
@click.stop.prevent="filterKeyword = ''"
class="cursor-pointer"
/>
</template>
</q-input>
<q-select
v-model="visibleColumns"
multiple
outlined
dense
options-dense
:display-value="$q.lang.table.columns"
emit-value
map-options
:options="columns"
option-value="name"
options-cover
style="min-width: 150px"
/>
</div>
<d-table
ref="table"
flat
bordered
dense
:columns="columns"
:rows="rows"
:paging="true"
:rows-per-page-options="[10, 25, 50, 100]"
:visible-columns="visibleColumns"
:filter="filterKeyword"
>
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td v-for="col in props.cols" :key="col.id">
<div v-if="col.name === 'no'">
{{
(formFilter.page - 1) * formFilter.pageSize +
props.rowIndex +
1
}}
</div>
<div
v-else-if="
col.name == 'dateStart' ||
col.name == 'dateEnd' ||
col.name == 'createdAt' ||
col.name == 'refCommandDate'
"
class="table_ellipsis"
>
{{ col.value ? date2Thai(col.value) : "-" }}
</div>
<div v-else class="table_ellipsis">
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>
</template>
<template v-slot:pagination="scope">
<q-pagination
v-model="currentPage"
active-color="primary"
color="dark"
:max="Number(maxPage)"
size="sm"
boundary-links
direction-links
></q-pagination>
</template>
<template v-slot:no-data="{ icon, message, filter }">
<div class="full-width row flex-center text-accent q-gutter-sm">
<span
><div
style="
height: 50vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
"
class="text-grey-5"
>
<q-icon name="search" size="4rem" />
<span>ไมพบขอม</span>
</div>
</span>
</div>
</template>
</d-table>
</q-card-section>
</q-card>
</q-dialog>
</template>

View file

@ -1,15 +1,16 @@
interface DetailData{
id: string;
typeLeave: string;
dateStartLeave: Date|null;
dateEndLeave: Date|null;
numLeave: number;
sumLeave: number;
totalLeave: number;
status: string;
reason: string;
typeLeaveId: string;
interface DetailData {
id: string;
typeLeave: string;
dateStartLeave: Date | null;
dateEndLeave: Date | null;
numLeave: number;
sumLeave: number;
totalLeave: number;
status: string;
reason: string;
typeLeaveId: string;
}
interface FormFilter {
page: number;
pageSize: number;
@ -21,26 +22,29 @@ interface FormFilter {
rangeYear: { min: number; max: number };
isShowRetire: boolean;
isProbation: boolean;
}
interface DataOptionLeave {
}
interface DataOptionLeave {
id: string;
name: string;
totalLeave: number;
}
interface DataOption {
}
interface DataOption {
id: string;
name: string;
disable?: boolean;
}
interface ResponseTotalObject {
}
interface ResponseTotalObject {
typeLeaveId: string;
typeLeave: string;
totalLeave: number;
limitLeave: string;
remainLeave: string;
}
interface MyObjectRef {
}
interface MyObjectRef {
typeLeave: object | null;
dateRange: object | null;
numLeave: object | null;
@ -48,5 +52,5 @@ interface FormFilter {
reason: object | null;
[key: string]: any;
}
export type { DetailData,FormFilter,DataOptionLeave,DataOption,ResponseTotalObject,MyObjectRef };
export type { DetailData, FormFilter, DataOptionLeave, DataOption, ResponseTotalObject, MyObjectRef };

View file

@ -0,0 +1,45 @@
interface FormFilter {
page: number;
pageSize: number;
keyword: string;
type: string;
posType: string;
posLevel: string;
retireYear: string | null;
rangeYear: { min: number; max: number };
isShowRetire: boolean;
isProbation: boolean;
}
//ข้อมูล
interface RequestItemsObject {
id: string;
dateStart: Date;
dateEnd: Date;
detail: string;
reference: string;
refCommandNo: string;
refCommandDate: Date | null;
}
interface MyObjectRef {
dateStart:object|null
dateEnd:object|null
detail:object|null
reference:object|null
[key: string]: any;
}
interface ResponseObject {
id: string;
dateStart: Date;
dateEnd: Date;
detail: string;
reference: string;
refCommandNo: string;
refCommandDate: Date | null;
createdFullName: string;
createdAt: Date;
}
export type{ FormFilter,RequestItemsObject,MyObjectRef,ResponseObject }