ปรับปฎิทิน
This commit is contained in:
parent
bc6c78c0a6
commit
8500d25a5a
5 changed files with 374 additions and 343 deletions
|
|
@ -1,7 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
import config from "@/app.config";
|
||||
import http from "@/plugins/http";
|
||||
import { ref, watch, type PropType } from "vue";
|
||||
// import config from "@/app.config";
|
||||
// import http from "@/plugins/http";
|
||||
import { useQuasar } from "quasar";
|
||||
import FullCalendar from "@fullcalendar/vue3";
|
||||
import dayGridPlugin from "@fullcalendar/daygrid";
|
||||
|
|
@ -12,16 +12,21 @@ import allLocales from "@fullcalendar/core/locales-all";
|
|||
import listPlugin from "@fullcalendar/list";
|
||||
|
||||
import type { DataDateMonthObject } from "@/modules/09_leave/interface/response/leave";
|
||||
import type { CaledarDisciplinary } from "@/modules/11_discipline/interface/response/Main";
|
||||
import type { ExtendHistoryObject } from "@/modules/11_discipline/interface/response/Main";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { monthYear2Thai, showLoader, hideLoader, messageError } = mixin;
|
||||
const { monthYear2Thai, showLoader, hideLoader, messageError, dateToISO } =
|
||||
mixin;
|
||||
|
||||
const $q = useQuasar();
|
||||
|
||||
const props = defineProps({
|
||||
lists: {
|
||||
type: Array as PropType<ExtendHistoryObject[]>,
|
||||
default: [],
|
||||
},
|
||||
modal: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
|
|
@ -32,7 +37,6 @@ const props = defineProps({
|
|||
},
|
||||
});
|
||||
|
||||
/** Option ของปฏิทิน */
|
||||
const fullCalendar = ref<any>(); //ref calendar
|
||||
const calendarOptions = ref<CalendarOptions>({
|
||||
plugins: [
|
||||
|
|
@ -57,8 +61,8 @@ const calendarOptions = ref<CalendarOptions>({
|
|||
expandRows: true,
|
||||
nowIndicator: true,
|
||||
height: "100%",
|
||||
eventColor: "#50a5fc",
|
||||
eventTextColor: "#fff",
|
||||
eventColor: "#E3FDDA",
|
||||
eventTextColor: "#000000",
|
||||
eventBorderColor: "#50a5fc",
|
||||
displayEventTime: false,
|
||||
editable: true,
|
||||
|
|
@ -73,54 +77,86 @@ const dateMonth = ref<DataDateMonthObject>({
|
|||
|
||||
/** function เรียกข่อมูล calendar*/
|
||||
function getRandomColor() {
|
||||
const letters = "0123456789ABCDEF";
|
||||
let color = "#";
|
||||
for (let i = 0; i < 6; i++) {
|
||||
color += letters[Math.floor(Math.random() * 16)];
|
||||
}
|
||||
return color;
|
||||
return (
|
||||
"hsl(" +
|
||||
360 * Math.random() +
|
||||
"," +
|
||||
(25 + 70 * Math.random()) +
|
||||
"%," +
|
||||
(85 + 10 * Math.random()) +
|
||||
"%)"
|
||||
);
|
||||
}
|
||||
|
||||
async function fetchCalendar() {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.disciplinaryCalendar(), {
|
||||
year: dateMonth.value.year,
|
||||
month: dateMonth.value.month,
|
||||
})
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
const defaultColor = "#02A998";
|
||||
const gradientColors = generateGradientColors(data.length);
|
||||
const defaultColor = "#E3FDDA";
|
||||
const gradientColors = generateGradientColors(props.lists.length);
|
||||
|
||||
const events = data.map((e: CaledarDisciplinary, index: number) => ({
|
||||
id: e.id,
|
||||
title: e.title,
|
||||
start: e.disciplinaryDateStart,
|
||||
end: e.disciplinaryDateEnd,
|
||||
allDay: true,
|
||||
color:
|
||||
data.length > 1 && index > 0 ? gradientColors[index] : defaultColor,
|
||||
}));
|
||||
const events = await props.lists.map(
|
||||
(e: ExtendHistoryObject, index: number) => ({
|
||||
id: index.toString(),
|
||||
title: e.name,
|
||||
start: e.dateStart,
|
||||
end: e.dateEnd,
|
||||
allDay: false,
|
||||
color:
|
||||
props.lists.length > 1 && index > 0
|
||||
? gradientColors[index]
|
||||
: defaultColor,
|
||||
})
|
||||
);
|
||||
calendarOptions.value.events = events;
|
||||
|
||||
calendarOptions.value.events = events;
|
||||
console.log("events===>",events)
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
setTimeout(() => {
|
||||
if (fullCalendar !== undefined) {
|
||||
const calen = fullCalendar.value.getApi();
|
||||
const date = new Date(dateMonth.value.year, dateMonth.value.month);
|
||||
calen.gotoDate(date);
|
||||
}
|
||||
hideLoader();
|
||||
}, 1000);
|
||||
});
|
||||
setTimeout(() => {
|
||||
if (fullCalendar !== undefined) {
|
||||
const calen = fullCalendar.value.getApi();
|
||||
const date = new Date(dateMonth.value.year, dateMonth.value.month);
|
||||
calen.gotoDate(date);
|
||||
}
|
||||
hideLoader();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
// async function fetchCalendar() {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .post(config.API.investigateCalendar(), {
|
||||
// year: dateMonth.value.year,
|
||||
// month: dateMonth.value.month,
|
||||
// })
|
||||
// .then((res) => {
|
||||
// const data = res.data.result;
|
||||
// const defaultColor = "#02A998";
|
||||
// const gradientColors = generateGradientColors(data.length);
|
||||
|
||||
// const events = data.map((e: CaledarInvestigatefacts, index: number) => ({
|
||||
// id: e.id,
|
||||
// title: e.title,
|
||||
// start: e.investigationDateStart,
|
||||
// end: e.investigationDateEnd,
|
||||
// allDay: true,
|
||||
// color:
|
||||
// data.length > 1 && index > 0 ? gradientColors[index] : defaultColor,
|
||||
// }));
|
||||
|
||||
// calendarOptions.value.events = events;
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// messageError($q, err);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// setTimeout(() => {
|
||||
// if (fullCalendar !== undefined) {
|
||||
// const calen = fullCalendar.value.getApi();
|
||||
// const date = new Date(dateMonth.value.year, dateMonth.value.month);
|
||||
// calen.gotoDate(date);
|
||||
// }
|
||||
// hideLoader();
|
||||
// }, 1000);
|
||||
// });
|
||||
// }
|
||||
|
||||
function generateGradientColors(length: number) {
|
||||
const colors = [];
|
||||
for (let i = 0; i < length; i++) {
|
||||
|
|
@ -129,25 +165,24 @@ function generateGradientColors(length: number) {
|
|||
return colors;
|
||||
}
|
||||
|
||||
/** function เปลี่ยนปฎิทิน*/
|
||||
function changCalendar() {
|
||||
fetchCalendar();
|
||||
}
|
||||
|
||||
const monthYearThai = (val: DataDateMonthObject) => {
|
||||
/**
|
||||
* function convert เดือนปี
|
||||
* @param val เดือนปี
|
||||
*/
|
||||
function monthYearThai(val: DataDateMonthObject) {
|
||||
if (val == null) return "";
|
||||
else return monthYear2Thai(val.month, val.year);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชั่นเปิด model
|
||||
* @param text
|
||||
* function openModalDetail
|
||||
* @param text เรื่อง
|
||||
*/
|
||||
const view = async (text: string) => {
|
||||
async function view(text: string) {
|
||||
title.value = text;
|
||||
modalCancel.value = true;
|
||||
modeCancel.value = false;
|
||||
};
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.modal,
|
||||
|
|
@ -161,28 +196,17 @@ watch(
|
|||
*/
|
||||
const modalCancel = ref(false);
|
||||
const title = ref("");
|
||||
const location = ref("บ้าน");
|
||||
const subject = ref("ลาป่วย");
|
||||
const dateStart = ref("20 ส.ค. 2566");
|
||||
const dateEnd = ref("21 ส.ค. 2566");
|
||||
const numDate = ref("20");
|
||||
const place = ref("บ้าน");
|
||||
const phone = ref("000-00000000");
|
||||
const reason = ref("ยกเลิกการลา");
|
||||
const model = ref(null);
|
||||
const modeCancel = ref(true);
|
||||
|
||||
function gotoPrevMonth() {
|
||||
const calen = fullCalendar.value.getApi();
|
||||
calen.prev();
|
||||
console.log("b", calen.getDate());
|
||||
updateDateMonth(calen.getDate());
|
||||
}
|
||||
|
||||
function gotoNextMonth() {
|
||||
const calen = fullCalendar.value.getApi();
|
||||
calen.next();
|
||||
console.log("n", calen.getDate());
|
||||
updateDateMonth(calen.getDate());
|
||||
}
|
||||
|
||||
|
|
@ -192,13 +216,14 @@ function updateDateMonth(date: Date) {
|
|||
fetchCalendar();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<q-dialog v-model="props.modal">
|
||||
<q-card style="min-width: 60vw">
|
||||
<q-toolbar>
|
||||
<q-toolbar-title class="text-subtitle2 text-bold"
|
||||
>ปฎิทิน</q-toolbar-title
|
||||
>
|
||||
<q-toolbar-title class="text-subtitle2 text-bold">
|
||||
ปฎิทินแสดงวันที่สืบสวน
|
||||
</q-toolbar-title>
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
|
|
@ -210,12 +235,13 @@ function updateDateMonth(date: Date) {
|
|||
</q-toolbar>
|
||||
|
||||
<q-separator />
|
||||
|
||||
<q-card-section class="q-pa-md bg-grey-1 scroll">
|
||||
<div class="q-ma-sm">
|
||||
<div class="row q-gutter-sm">
|
||||
<div class="col-12">
|
||||
<div class="row q-gutter-sm q-pb-sm main-content">
|
||||
<div class="demo-app-main">
|
||||
<div class="demo-app-main q-mb-xl">
|
||||
<!-- <div class="row col-12 q-mb-sm">
|
||||
<div class="col-xs-12 col-sm-3 col-md-2">
|
||||
<datepicker
|
||||
|
|
@ -306,17 +332,6 @@ function updateDateMonth(date: Date) {
|
|||
</div>
|
||||
</template>
|
||||
</FullCalendar>
|
||||
<div class="row q-col-gutter-lg justify-end q-pb-lg">
|
||||
<div class="items-center row">
|
||||
<q-icon
|
||||
size="10px"
|
||||
color="light-blue-14"
|
||||
name="mdi-circle"
|
||||
class="q-mr-sm"
|
||||
/>
|
||||
<span class="text-caption text-grey-8">สอบสวน</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -325,88 +340,10 @@ function updateDateMonth(date: Date) {
|
|||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<!-- modal ขอยกเลิก/ดูรายละเอียด -->
|
||||
<q-dialog v-model="modalCancel" persistent>
|
||||
<q-card :style="modeCancel == true ? 'min-width: 50%;' : 'min-width:30%'">
|
||||
<q-card-section class="row items-center q-pa-sm">
|
||||
<div v-if="modeCancel == false" class="text-bold q-pl-sm">
|
||||
รายละเอียดของ{{ title }}
|
||||
</div>
|
||||
<div v-else class="text-bold q-pl-sm">ขอยกเลิก{{ title }}</div>
|
||||
<q-space />
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
v-close-popup
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
/>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-section class="q-p-md row q-gutter-y-md">
|
||||
<div flat :class="modeCancel == true ? 'col-xs-6 col-sm-6' : 'col-12'">
|
||||
<div class="col-12 q-col-gutter-sm row items-center">
|
||||
<div class="col-6 text-grey-7">เขียนที่</div>
|
||||
<div class="col-6 text-black">{{ location }}</div>
|
||||
<div class="col-6 text-grey-7">เรื่องและเหตุผลการลา</div>
|
||||
<div class="col-6 text-black">{{ subject }}</div>
|
||||
<div class="col-6 text-grey-7">วัน เดือน ปีเริ่มต้น</div>
|
||||
<div class="col-6 text-black">{{ dateStart }}</div>
|
||||
<div class="col-6 text-grey-7">วัน เดือน ปีสิ้นสุด</div>
|
||||
<div class="col-6 text-black">{{ dateEnd }}</div>
|
||||
<div class="col-6 text-grey-7">จำนวนวันที่ลา</div>
|
||||
<div class="col-6 text-black">{{ numDate }}</div>
|
||||
<div class="col-6 text-grey-7">สถานที่ติดต่อขณะลา</div>
|
||||
<div class="col-6 text-black">{{ place }}</div>
|
||||
<div class="col-6 text-grey-7">หมายเลขโทรศัพท์</div>
|
||||
<div class="col-6 text-black">{{ phone }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div flat class="col-xs-6 col-sm-6" v-if="modeCancel == true">
|
||||
<q-input
|
||||
v-model="reason"
|
||||
type="textarea"
|
||||
label="กรอกเหตุผล"
|
||||
outlined
|
||||
dense
|
||||
/>
|
||||
<q-file
|
||||
outlined
|
||||
v-model="model"
|
||||
label="เลือกไฟล์เอกสารหลักฐาน"
|
||||
class="q-mt-md"
|
||||
use-chips
|
||||
dense
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-section
|
||||
class="row items-center q-pa-sm"
|
||||
v-if="modeCancel == true"
|
||||
>
|
||||
<q-space />
|
||||
<q-btn
|
||||
label="ยืนยัน"
|
||||
unelevated
|
||||
color="secondary"
|
||||
dense
|
||||
class="q-px-md"
|
||||
v-close-popup
|
||||
/>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
<style scope lang="scss">
|
||||
.main-content {
|
||||
height: 65vh;
|
||||
height: 80vh;
|
||||
}
|
||||
|
||||
.color-main {
|
||||
|
|
@ -419,6 +356,7 @@ function updateDateMonth(date: Date) {
|
|||
|
||||
.demo-app-main {
|
||||
flex-grow: 1;
|
||||
|
||||
/* padding: 3em; */
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -224,7 +224,6 @@ function cancelInvestigate() {
|
|||
|
||||
/** ฟังชั่น ยุติเรื่อง*/
|
||||
function confirmEndInvestigate() {
|
||||
console.log("sent");
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.disciplinaryReject(id.value))
|
||||
|
|
@ -242,7 +241,6 @@ function confirmEndInvestigate() {
|
|||
|
||||
/** ฟังชั่น ยกเลิกการยุติเรื่อง*/
|
||||
function confirmCancelInvestigate() {
|
||||
console.log("sent");
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.disciplinaryResume(id.value))
|
||||
|
|
@ -307,7 +305,6 @@ const fileListObjComplaint = reactive<ArrayFileList>({
|
|||
});
|
||||
|
||||
function emitPerson(data: PersonsArray[]) {
|
||||
console.log(data);
|
||||
const dataMapId = data.map((item: PersonsArray) => item.id);
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -376,6 +373,7 @@ const dataInvestigatefacts = reactive<FormInvestigateFact>({
|
|||
respondentType: "",
|
||||
organizationId: "",
|
||||
persons: [],
|
||||
investigationExtendHistory:[]
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import type {
|
|||
responseType,
|
||||
directorType,
|
||||
} from "@/modules/11_discipline/interface/index/Main";
|
||||
import type { FormDataList } from "@/modules/11_discipline/interface/request/investigate";
|
||||
import type { DataOptionRes } from "@/modules/11_discipline/interface/response/Main";
|
||||
|
||||
/** import components*/
|
||||
|
|
@ -89,6 +90,7 @@ const formData = reactive<FormData>({
|
|||
disciplinaryStatusResult: "",
|
||||
disciplinaryCauseText: "",
|
||||
disciplinaryResult: "",
|
||||
disciplinaryExtendHistory: [],
|
||||
});
|
||||
const disciplineDisciplinary_DocRelevants = ref<FileLists[]>([]); // ยังไม่มีรอ api
|
||||
const disciplineDisciplinary_DocSummaryEvidences = ref<FileLists[]>([]);
|
||||
|
|
@ -188,6 +190,7 @@ function validateForm() {
|
|||
if (hasError.every((result) => result === true)) {
|
||||
onSubmit();
|
||||
isSave.value = false;
|
||||
formData.extendStatus = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -195,13 +198,12 @@ function validateForm() {
|
|||
* ฟังชั้นคำนวณเวลาวันที่สิ้นสุดจาก วันที่สิ้นสุดการสอบสวน
|
||||
* @param val จำนวนวันที่ต้องการขยาย
|
||||
*/
|
||||
function calEndDate(val: string) {
|
||||
const date = new Date(props.data.disciplinaryDateEnd);
|
||||
const dateNew = new Date();
|
||||
formData.disciplinaryDateEnd = new Date(
|
||||
dateNew.setDate(date.getDate() + Number(val))
|
||||
);
|
||||
async function calEndDate(val: string) {
|
||||
changeFormData();
|
||||
const date = await new Date(props.data.disciplinaryDateEnd);
|
||||
formData.disciplinaryDateEnd = await new Date(
|
||||
date.setDate(date.getDate() + Number(val))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -279,6 +281,7 @@ async function fetchDatadetail() {
|
|||
formData.disciplinaryStatusResult = props.data.disciplinaryStatusResult;
|
||||
formData.disciplinaryCauseText = props.data.disciplinaryCauseText;
|
||||
formData.disciplinaryResult = props.data.disciplinaryResult;
|
||||
formData.disciplinaryExtendHistory = props.data.disciplinaryExtendHistory;
|
||||
|
||||
mainStore.rowsAdd = props.data.persons;
|
||||
|
||||
|
|
@ -439,6 +442,11 @@ function calendarOpen() {
|
|||
calendarModal.value = true;
|
||||
}
|
||||
|
||||
function resetExtend() {
|
||||
formData.disciplinaryDateEnd = props.data.disciplinaryDateEnd;
|
||||
formData.daysExtend = 0;
|
||||
}
|
||||
|
||||
/** Hook */
|
||||
onMounted(async () => {
|
||||
mainStore.rowsAdd = [];
|
||||
|
|
@ -778,23 +786,21 @@ onMounted(async () => {
|
|||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
|
||||
<div class="row col-12">
|
||||
<q-card
|
||||
bordered
|
||||
class="col-12"
|
||||
style="border: 1px solid #d6dee1"
|
||||
<q-card
|
||||
bordered
|
||||
class="col-12"
|
||||
style="border: 1px solid #d6dee1"
|
||||
>
|
||||
<div
|
||||
class="row col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-sm q-px-md"
|
||||
>
|
||||
<div
|
||||
class="row col-xs-12 col-sm-12 text-weight-medium bg-grey-1 q-py-sm q-px-md"
|
||||
>
|
||||
วันที่สอบสวน
|
||||
|
||||
<div>
|
||||
วันที่สืบสวน
|
||||
<q-checkbox
|
||||
v-if="
|
||||
formData.disciplinaryDateStart != null &&
|
||||
formData.disciplinaryDateEnd != null &&
|
||||
((isReadonly && formData.extendStatus) || !isReadonly)
|
||||
formData.disciplinaryExtendHistory.length > 0 &&
|
||||
!isReadonly
|
||||
"
|
||||
:disable="isReadonly"
|
||||
for="#extendStatus"
|
||||
|
|
@ -805,88 +811,36 @@ onMounted(async () => {
|
|||
dense
|
||||
class="text-weight-medium q-ml-sm"
|
||||
keep-color
|
||||
@update:model-value="changeFormData()"
|
||||
@update:model-value="
|
||||
changeFormData();
|
||||
resetExtend();
|
||||
"
|
||||
/>
|
||||
<q-space style="height: 1px" />
|
||||
<div>
|
||||
<q-btn
|
||||
name="calendar"
|
||||
round
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
icon="mdi-calendar-month"
|
||||
class="self-center items-center"
|
||||
color="primary"
|
||||
@click="calendarOpen"
|
||||
>
|
||||
<q-tooltip>ปฏิทิน</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="q-pa-sm">
|
||||
<div class="q-col-gutter-sm row">
|
||||
<div class="col-3" v-if="!formData.extendStatus">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
:readonly="isReadonly"
|
||||
v-model="formData.disciplinaryDateStart"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
@update:model-value="changeFormData()"
|
||||
>
|
||||
<template #year="{ year }">{{
|
||||
year + 543
|
||||
}}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
for="#date"
|
||||
class="full-width cursor-pointer"
|
||||
ref="dateRef"
|
||||
:readonly="isReadonly"
|
||||
outlined
|
||||
:input-style="
|
||||
isReadonly
|
||||
? { color: 'black' }
|
||||
: { color: 'teal' }
|
||||
"
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
hide-bottom-space
|
||||
:model-value="
|
||||
formData.disciplinaryDateStart
|
||||
? date2Thai(formData.disciplinaryDateStart)
|
||||
: null
|
||||
"
|
||||
:rules="[
|
||||
(val) =>
|
||||
!!val ||
|
||||
`${'กรุณาเลือกวันที่เริ่มการสอบสวน'}`,
|
||||
]"
|
||||
:label="`${'วันที่เริ่มการสอบสวน'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
|
||||
<div class="col-3" v-if="formData.extendStatus">
|
||||
<q-select
|
||||
<q-space style="height: 1px" />
|
||||
<div>
|
||||
<q-btn
|
||||
name="calendar"
|
||||
round
|
||||
size="12px"
|
||||
flat
|
||||
dense
|
||||
icon="mdi-calendar-month"
|
||||
class="self-center items-center"
|
||||
color="primary"
|
||||
@click="calendarOpen"
|
||||
>
|
||||
<q-tooltip>ปฏิทิน</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12"><q-separator /></div>
|
||||
<div class="q-pa-sm">
|
||||
<div class="q-col-gutter-sm row col-12">
|
||||
<div class="col-12">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div v-if="formData.extendStatus" class="col-3">
|
||||
<q-select
|
||||
:readonly="isReadonly"
|
||||
for="#daysExtend"
|
||||
outlined
|
||||
|
|
@ -917,69 +871,173 @@ onMounted(async () => {
|
|||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-3">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="formData.disciplinaryDateEnd"
|
||||
:readonly="isReadonly"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
@update:model-value="changeFormData()"
|
||||
>
|
||||
<template #year="{ year }">{{
|
||||
year + 543
|
||||
}}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
for="#dateEnd"
|
||||
ref="dateEndRef"
|
||||
class="full-width cursor-pointer"
|
||||
:readonly="isReadonly"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
:input-style="
|
||||
isReadonly
|
||||
? { color: 'black' }
|
||||
: { color: 'teal' }
|
||||
"
|
||||
hide-bottom-space
|
||||
borderless
|
||||
:model-value="
|
||||
formData.disciplinaryDateEnd
|
||||
? date2Thai(formData.disciplinaryDateEnd)
|
||||
: null
|
||||
"
|
||||
:rules="[
|
||||
(val) =>
|
||||
!!val ||
|
||||
`${'กรุณาเลือกวันที่สิ้นสุดการสอบสวน'}`,
|
||||
]"
|
||||
:label="`${'วันที่สิ้นสุดการสอบสวน'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
<div v-if="!formData.extendStatus" class="col-3">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
:readonly="
|
||||
isReadonly ||
|
||||
formData.disciplinaryExtendHistory.length > 0
|
||||
"
|
||||
v-model="formData.disciplinaryDateStart"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
@update:model-value="changeFormData()"
|
||||
>
|
||||
<template #year="{ year }">{{
|
||||
year + 543
|
||||
}}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
for="#date"
|
||||
class="full-width cursor-pointer"
|
||||
ref="dateRef"
|
||||
:input-style="
|
||||
isReadonly ||
|
||||
formData.disciplinaryExtendHistory.length >
|
||||
0
|
||||
? { color: 'black' }
|
||||
: { color: 'teal' }
|
||||
"
|
||||
:readonly="
|
||||
isReadonly ||
|
||||
formData.disciplinaryExtendHistory.length >
|
||||
0
|
||||
"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
borderless
|
||||
hide-bottom-space
|
||||
:model-value="
|
||||
formData.disciplinaryDateStart
|
||||
? date2Thai(
|
||||
formData.disciplinaryDateStart
|
||||
)
|
||||
: null
|
||||
"
|
||||
:rules="[
|
||||
(val) =>
|
||||
!!val ||
|
||||
`${'กรุณาเลือกวันที่เริ่มการสืบสวน'}`,
|
||||
]"
|
||||
:label="`${'วันที่เริ่มการสืบสวน'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="formData.disciplinaryDateEnd"
|
||||
:readonly="
|
||||
isReadonly ||
|
||||
formData.disciplinaryExtendHistory.length > 0
|
||||
"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
:enableTimePicker="false"
|
||||
week-start="0"
|
||||
@update:model-value="changeFormData()"
|
||||
>
|
||||
<template #year="{ year }">{{
|
||||
year + 543
|
||||
}}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
parseInt(value + 543)
|
||||
}}</template>
|
||||
<template #trigger>
|
||||
<q-input
|
||||
for="#dateEnd"
|
||||
:input-style="
|
||||
isReadonly ||
|
||||
formData.disciplinaryExtendHistory.length >
|
||||
0
|
||||
? { color: 'black' }
|
||||
: { color: 'teal' }
|
||||
"
|
||||
ref="dateEndRef"
|
||||
class="full-width cursor-pointer"
|
||||
:readonly="
|
||||
isReadonly ||
|
||||
formData.disciplinaryExtendHistory.length >
|
||||
0
|
||||
"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
borderless
|
||||
:model-value="
|
||||
formData.disciplinaryDateEnd
|
||||
? date2Thai(formData.disciplinaryDateEnd)
|
||||
: null
|
||||
"
|
||||
:rules="[
|
||||
(val) =>
|
||||
!!val ||
|
||||
`${'กรุณาเลือกวันที่สิ้นสุดการสืบสวน'}`,
|
||||
]"
|
||||
:label="`${'วันที่สิ้นสุดการสืบสวน'}`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
name="event"
|
||||
class="cursor-pointer"
|
||||
color="primary"
|
||||
>
|
||||
</q-icon>
|
||||
</template>
|
||||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- วันที่สืบสวน (List Log) -->
|
||||
<div
|
||||
v-if="
|
||||
formData.disciplinaryExtendHistory !== null &&
|
||||
formData.disciplinaryExtendHistory.length > 1
|
||||
"
|
||||
class="col-12 fixed-height-history"
|
||||
>
|
||||
<q-list bordered separator>
|
||||
<q-item
|
||||
v-for="(
|
||||
e, key
|
||||
) in formData.disciplinaryExtendHistory.slice(1)"
|
||||
>
|
||||
<q-item-section :key="key">
|
||||
{{ e.name }} ({{ e.daysExtend }} วัน)
|
||||
<p class="q-mb-none">
|
||||
{{ date2Thai(e.dateStart) }} -
|
||||
{{ date2Thai(e.dateEnd) }}
|
||||
</p>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
|
||||
<datepicker
|
||||
:readonly="isReadonly"
|
||||
|
|
@ -1506,5 +1564,12 @@ onMounted(async () => {
|
|||
@returnDirector="returnDirector"
|
||||
/>
|
||||
|
||||
<CalandarDialog :modal="calendarModal" :close="calendarModalclose" />
|
||||
<CalandarDialog :modal="calendarModal" :close="calendarModalclose" :lists="formData.disciplinaryExtendHistory"/>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.fixed-height-history {
|
||||
overflow-y: auto;
|
||||
max-height: 150px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -76,23 +76,15 @@ interface FormData {
|
|||
disciplinaryStatusResult: string;
|
||||
disciplinaryCauseText: string;
|
||||
disciplinaryResult: string;
|
||||
disciplinaryExtendHistory: ExtendHistoryObject[];
|
||||
}
|
||||
|
||||
// filesWitnesses: File | null;
|
||||
// filesEtc: File | null;
|
||||
// casefault: string;
|
||||
// typefault: string;
|
||||
// faultLevel: string;
|
||||
// refLaw: string;
|
||||
// detailComplaint: string;
|
||||
// whereInvestigate: string;
|
||||
// trueDetail: string;
|
||||
// evidence: string;
|
||||
// recordAccuser: string;
|
||||
// witnesses: string;
|
||||
// InvestResults: string;
|
||||
// complaintStatus: string;
|
||||
|
||||
// consideredAgency: string;
|
||||
interface ExtendHistoryObject {
|
||||
name: string;
|
||||
num: number;
|
||||
daysExtend: number | null;
|
||||
dateStart: Date;
|
||||
dateEnd: Date;
|
||||
}
|
||||
|
||||
interface DisciplinaryRef {
|
||||
|
|
|
|||
|
|
@ -32,4 +32,42 @@ interface MyObjectInvestigateRef {
|
|||
reason: object | null;
|
||||
[key: string]: any;
|
||||
}
|
||||
export type { FormData, MyObjectInvestigateRef };
|
||||
|
||||
interface FormDataList {
|
||||
id: string;
|
||||
idComplaint: string;
|
||||
investigationDetail: string;
|
||||
complaint: string;
|
||||
complaintdetail: string;
|
||||
investigationDescription: string;
|
||||
fault: string;
|
||||
investigationDetailOther: string;
|
||||
evidenceFiles: any | null;
|
||||
fileComplaint: File | null;
|
||||
investigationExtendStatus: boolean | null;
|
||||
investigationDateStart: Date | null;
|
||||
investigationDateEnd: Date | null;
|
||||
investigationDaysExtend: number | null;
|
||||
investigationStatusResult: string;
|
||||
investigationCauseText: string;
|
||||
complaintStatus: string;
|
||||
result: string;
|
||||
directors: object | null;
|
||||
status: string;
|
||||
disciplineInvestigateDocs: any;
|
||||
disciplineInvestigateRelevantDocs: any;
|
||||
documentFile: any | null;
|
||||
respondentType: string;
|
||||
organizationId: string;
|
||||
persons: object | null;
|
||||
disciplinaryExtendHistory: ExtendHistoryObject[];
|
||||
}
|
||||
|
||||
interface ExtendHistoryObject {
|
||||
name: string;
|
||||
num: number;
|
||||
daysExtend: number | null;
|
||||
dateStart: Date;
|
||||
dateEnd: Date;
|
||||
}
|
||||
export type { FormData, MyObjectInvestigateRef,FormDataList };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue