ปรับวันที่สืบสวน

This commit is contained in:
Warunee Tamkoo 2023-12-07 13:18:42 +07:00
parent c50e00968c
commit fabc55134c
6 changed files with 348 additions and 323 deletions

View file

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch } from "vue"; import { ref, watch, type PropType } from "vue";
import config from "@/app.config"; // import config from "@/app.config";
import http from "@/plugins/http"; // import http from "@/plugins/http";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import FullCalendar from "@fullcalendar/vue3"; import FullCalendar from "@fullcalendar/vue3";
import dayGridPlugin from "@fullcalendar/daygrid"; import dayGridPlugin from "@fullcalendar/daygrid";
@ -12,7 +12,7 @@ import allLocales from "@fullcalendar/core/locales-all";
import listPlugin from "@fullcalendar/list"; import listPlugin from "@fullcalendar/list";
import type { DataDateMonthObject } from "@/modules/09_leave/interface/response/leave"; import type { DataDateMonthObject } from "@/modules/09_leave/interface/response/leave";
import type { CaledarInvestigatefacts } from "@/modules/11_discipline/interface/response/Main"; import type { ExtendHistoryObject } from "@/modules/11_discipline/interface/response/Main";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
@ -23,6 +23,10 @@ const { monthYear2Thai, showLoader, hideLoader, messageError, dateToISO } =
const $q = useQuasar(); const $q = useQuasar();
const props = defineProps({ const props = defineProps({
lists: {
type: Array as PropType<ExtendHistoryObject[]>,
default: [],
},
modal: { modal: {
type: Boolean, type: Boolean,
default: false, default: false,
@ -57,8 +61,8 @@ const calendarOptions = ref<CalendarOptions>({
expandRows: true, expandRows: true,
nowIndicator: true, nowIndicator: true,
height: "100%", height: "100%",
eventColor: "#02A998", eventColor: "#E3FDDA",
eventTextColor: "#fff", eventTextColor: "#000000",
eventBorderColor: "#50a5fc", eventBorderColor: "#50a5fc",
displayEventTime: false, displayEventTime: false,
editable: true, editable: true,
@ -73,53 +77,86 @@ const dateMonth = ref<DataDateMonthObject>({
/** function เรียกข่อมูล calendar*/ /** function เรียกข่อมูล calendar*/
function getRandomColor() { function getRandomColor() {
const letters = "0123456789ABCDEF"; return (
let color = "#"; "hsl(" +
for (let i = 0; i < 6; i++) { 360 * Math.random() +
color += letters[Math.floor(Math.random() * 16)]; "," +
} (25 + 70 * Math.random()) +
return color; "%," +
(85 + 10 * Math.random()) +
"%)"
);
} }
async function fetchCalendar() { async function fetchCalendar() {
showLoader(); showLoader();
await http const defaultColor = "#E3FDDA";
.post(config.API.investigateCalendar(), { const gradientColors = generateGradientColors(props.lists.length);
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) => ({ const events = await props.lists.map(
id: e.id, (e: ExtendHistoryObject, index: number) => ({
title: e.title, id: index.toString(),
start: e.investigationDateStart, title: e.name,
end: e.investigationDateEnd, start: e.dateStart,
allDay: true, end: e.dateEnd,
color: allDay: false,
data.length > 1 && index > 0 ? gradientColors[index] : defaultColor, color:
})); props.lists.length > 1 && index > 0
? gradientColors[index]
: defaultColor,
})
);
calendarOptions.value.events = events;
calendarOptions.value.events = events; setTimeout(() => {
}) if (fullCalendar !== undefined) {
.catch((err) => { const calen = fullCalendar.value.getApi();
messageError($q, err); const date = new Date(dateMonth.value.year, dateMonth.value.month);
}) calen.gotoDate(date);
.finally(() => { }
setTimeout(() => { hideLoader();
if (fullCalendar !== undefined) { }, 1000);
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) { function generateGradientColors(length: number) {
const colors = []; const colors = [];
for (let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
@ -128,11 +165,6 @@ function generateGradientColors(length: number) {
return colors; return colors;
} }
/** function เปลี่ยนปฎิทิน*/
function changCalendar() {
fetchCalendar();
}
/** /**
* function convert เดอนป * function convert เดอนป
* @param val เดอนป * @param val เดอนป
@ -164,15 +196,6 @@ watch(
*/ */
const modalCancel = ref(false); const modalCancel = ref(false);
const title = ref(""); 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); const modeCancel = ref(true);
function gotoPrevMonth() { function gotoPrevMonth() {
@ -195,13 +218,14 @@ function updateDateMonth(date: Date) {
fetchCalendar(); fetchCalendar();
} }
</script> </script>
<template> <template>
<q-dialog v-model="props.modal"> <q-dialog v-model="props.modal">
<q-card style="min-width: 60vw"> <q-card style="min-width: 60vw">
<q-toolbar> <q-toolbar>
<q-toolbar-title class="text-subtitle2 text-bold" <q-toolbar-title class="text-subtitle2 text-bold">
>ปฎ</q-toolbar-title ปฎแสดงวนทบสวน
> </q-toolbar-title>
<q-btn <q-btn
icon="close" icon="close"
unelevated unelevated
@ -213,6 +237,7 @@ function updateDateMonth(date: Date) {
</q-toolbar> </q-toolbar>
<q-separator /> <q-separator />
<q-card-section class="q-pa-md bg-grey-1 scroll"> <q-card-section class="q-pa-md bg-grey-1 scroll">
<div class="q-ma-sm"> <div class="q-ma-sm">
<div class="row q-gutter-sm"> <div class="row q-gutter-sm">
@ -317,84 +342,6 @@ function updateDateMonth(date: Date) {
</q-card-section> </q-card-section>
</q-card> </q-card>
</q-dialog> </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> </template>
<style scope lang="scss"> <style scope lang="scss">
.main-content { .main-content {

View file

@ -56,6 +56,7 @@ const data = reactive<FormData>({
respondentType: "", respondentType: "",
organizationId: "", organizationId: "",
persons: [], persons: [],
investigationExtendHistory: [],
}); });
/** ข้อมูล v-model ของฟอร์มเรื่องร้องเรียน */ /** ข้อมูล v-model ของฟอร์มเรื่องร้องเรียน */
@ -139,7 +140,7 @@ function getData() {
.get(config.API.investigateById(id.value)) .get(config.API.investigateById(id.value))
.then((res) => { .then((res) => {
const dataList = res.data.result; const dataList = res.data.result;
console.log(dataList); // console.log(dataList);
data.id = dataList.id; data.id = dataList.id;
data.idComplaint = dataList.idComplaint; data.idComplaint = dataList.idComplaint;
data.respondentType = dataList.respondentType; data.respondentType = dataList.respondentType;
@ -160,7 +161,8 @@ function getData() {
data.investigationStatusResult = dataList.investigationStatusResult; data.investigationStatusResult = dataList.investigationStatusResult;
data.investigationExtendStatus = dataList.investigationExtendStatus; data.investigationExtendStatus = dataList.investigationExtendStatus;
data.investigationDaysExtend = dataList.investigationDaysExtend; data.investigationDaysExtend = dataList.investigationDaysExtend;
console.log(dataList); data.investigationExtendHistory = dataList.investigationExtendHistory ?? [];
// console.log(dataList);
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -176,7 +178,6 @@ function getData() {
*/ */
async function onSubmit(data: any) { async function onSubmit(data: any) {
// put // put
console.log("edit", data);
showLoader(); showLoader();
http http
.put(config.API.investigateById(id.value), data) .put(config.API.investigateById(id.value), data)

View file

@ -64,6 +64,7 @@ const daysExtendRef = ref<Object | null>(null);
const investigationStatusResultRef = ref<Object | null>(null); const investigationStatusResultRef = ref<Object | null>(null);
const investigationCauseTextRef = ref<Object | null>(null); const investigationCauseTextRef = ref<Object | null>(null);
const resultRef = ref<Object | null>(null); const resultRef = ref<Object | null>(null);
const investigationExtendStatus = ref<boolean>(false);
const isSave = ref<boolean>(false); // const isSave = ref<boolean>(false); //
const isReadonly = ref<boolean>(false); // const isReadonly = ref<boolean>(false); //
@ -114,6 +115,7 @@ const formData = reactive<FormData>({
respondentType: "", respondentType: "",
organizationId: "", organizationId: "",
persons: [], persons: [],
investigationExtendHistory: [],
}); });
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */ /** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
@ -142,7 +144,7 @@ const initialPagination = ref<any>({
}); });
const calendarModal = ref<boolean>(false); const calendarModal = ref<boolean>(false);
const calendarModalclose = () =>(calendarModal.value = !calendarModal.value) const calendarModalclose = () => (calendarModal.value = !calendarModal.value);
/*** ฟังก์ชั่นสำหรับ validate ฟอร์ม */ /*** ฟังก์ชั่นสำหรับ validate ฟอร์ม */
function validateForm() { function validateForm() {
@ -161,7 +163,7 @@ function validateForm() {
onSubmit(); onSubmit();
} else { } else {
console.log("ไม่ผ่าน "); console.log("ไม่ผ่าน ");
console.log(hasError); // console.log(hasError);
} }
} }
@ -179,6 +181,7 @@ function onSubmit() {
} }
props.onSubmit(formData); props.onSubmit(formData);
isSave.value = false; isSave.value = false;
investigationExtendStatus.value = false;
}, },
"ยืนยันการบันทึกข้อมูล", "ยืนยันการบันทึกข้อมูล",
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?" "ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
@ -189,15 +192,19 @@ function onSubmit() {
* งชนคำนวณเวลาวนทนสดจาก นทนสดการสบสวน * งชนคำนวณเวลาวนทนสดจาก นทนสดการสบสวน
* @param val จำนวนวนทองการขยาย * @param val จำนวนวนทองการขยาย
*/ */
function calEndDate(val: string) { async function calEndDate(val: string) {
changeFormData(); changeFormData();
const date = new Date(props.data.investigationDateEnd); const date = await new Date(props.data.investigationDateEnd);
const dateNew = new Date(); formData.investigationDateEnd = await new Date(
formData.investigationDateEnd = new Date( date.setDate(date.getDate() + Number(val))
dateNew.setDate(date.getDate() + Number(val))
); );
} }
function resetExtend() {
formData.investigationDateEnd = props.data.investigationDateEnd;
formData.investigationDaysExtend = 0;
}
const modal = ref<boolean>(false); const modal = ref<boolean>(false);
const filterKeyword2 = ref<string>(""); const filterKeyword2 = ref<string>("");
const type = ref<string>(""); const type = ref<string>("");
@ -243,6 +250,7 @@ watch(props.data, async () => {
formData.disciplineInvestigateRelevantDocs = formData.disciplineInvestigateRelevantDocs =
props.data.disciplineInvestigateRelevantDocs; props.data.disciplineInvestigateRelevantDocs;
formData.status = props.data.status; formData.status = props.data.status;
formData.investigationExtendHistory = props.data.investigationExtendHistory;
mainStore.rowsAdd = props.data.persons; mainStore.rowsAdd = props.data.persons;
@ -730,27 +738,27 @@ onMounted(async () => {
> >
<div> <div>
นทบสวน นทบสวน
<q-checkbox <q-checkbox
v-if=" v-if="
formData.investigationDateStart != null && props.data.investigationExtendHistory.length > 0 &&
formData.investigationDateEnd != null && !isReadonly
((isReadonly && formData.investigationExtendStatus) ||
!isReadonly)
" "
:disable="isReadonly" :disable="isReadonly"
for="#extendStatus" for="#extendStatus"
size="md" size="md"
v-model="formData.investigationExtendStatus" v-model="investigationExtendStatus"
label="ขยายเวลา" label="ขยายเวลา"
color="primary" color="primary"
dense dense
class="text-weight-medium q-ml-sm" class="text-weight-medium q-ml-sm"
keep-color keep-color
@update:model-value="changeFormData()" @update:model-value="
changeFormData();
resetExtend();
"
/> />
</div> </div>
<q-space style="height: 1px;"/> <q-space style="height: 1px" />
<div> <div>
<q-btn <q-btn
name="calendar" name="calendar"
@ -769,157 +777,204 @@ onMounted(async () => {
</div> </div>
<div class="col-12"><q-separator /></div> <div class="col-12"><q-separator /></div>
<div class="q-pa-sm"> <div class="q-pa-sm">
<div class="q-col-gutter-sm row"> <div class="q-col-gutter-sm row col-12">
<div <div class="col-12">
class="col-3" <div class="row q-col-gutter-sm">
v-if="!formData.investigationExtendStatus" <div v-if="investigationExtendStatus" class="col-3">
> <q-select
<datepicker
menu-class-name="modalfix"
:readonly="isReadonly"
v-model="formData.investigationDateStart"
: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
? { color: 'black' }
: { color: 'teal' }
"
:readonly="isReadonly" :readonly="isReadonly"
for="#daysExtend"
outlined outlined
dense dense
lazy-rules lazy-rules
borderless ref="daysExtendRef"
v-model="formData.investigationDaysExtend"
:options="investigateFactStore.daysExtendOp"
label="จำนวนวันที่ต้องการขยาย"
emit-value
hide-bottom-space hide-bottom-space
:model-value=" map-options
formData.investigationDateStart
? date2Thai(formData.investigationDateStart)
: null
"
:rules="[ :rules="[
(val) => (val) =>
!!val || formData.investigationExtendStatus
`${'กรุณาเลือกวันที่เริ่มการสืบสวน'}`, ? !!val ||
'กรุณาเลือกจำนวนวันที่ต้องการขยาย'
: true,
]" ]"
:label="`${'วันที่เริ่มการสืบสวน'}`" option-label="name"
> option-value="id"
<template v-slot:prepend> use-input
<q-icon @update:model-value="calEndDate"
name="event" ><template v-slot:no-option>
class="cursor-pointer" <q-item>
color="primary" <q-item-section class="text-grey">
> ไมอม
</q-icon> </q-item-section>
</q-item>
</template> </template>
</q-input> </q-select>
</template> </div>
</datepicker>
<div v-if="!investigationExtendStatus" class="col-3">
<datepicker
menu-class-name="modalfix"
:readonly="
isReadonly ||
formData.investigationExtendHistory.length > 0
"
v-model="formData.investigationDateStart"
: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.investigationExtendHistory.length >
0
? { color: 'black' }
: { color: 'teal' }
"
:readonly="
isReadonly ||
formData.investigationExtendHistory.length >
0
"
outlined
dense
lazy-rules
borderless
hide-bottom-space
:model-value="
formData.investigationDateStart
? date2Thai(
formData.investigationDateStart
)
: 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.investigationDateEnd"
:readonly="
isReadonly ||
formData.investigationExtendHistory.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.investigationExtendHistory.length >
0
? { color: 'black' }
: { color: 'teal' }
"
ref="dateEndRef"
class="full-width cursor-pointer"
:readonly="
isReadonly ||
formData.investigationExtendHistory.length >
0
"
outlined
dense
lazy-rules
hide-bottom-space
borderless
:model-value="
formData.investigationDateEnd
? date2Thai(formData.investigationDateEnd)
: 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> </div>
<!-- นทบสวน (List Log) -->
<div <div
class="col-3" v-if="
v-if="formData.investigationExtendStatus" formData.investigationExtendHistory !== null &&
formData.investigationExtendHistory.length > 1
"
class="col-12 fixed-height-history"
> >
<q-select <q-list bordered separator>
:readonly="isReadonly" <q-item
for="#daysExtend" v-for="(
outlined e, key
dense ) in formData.investigationExtendHistory.slice(1)"
lazy-rules >
ref="daysExtendRef" <q-item-section :key="key">
v-model="formData.investigationDaysExtend" {{ e.name }} ({{ e.daysExtend }} )
:options="investigateFactStore.daysExtendOp" <p class="q-mb-none">
label="จำนวนวันที่ต้องการขยาย" {{ date2Thai(e.dateStart) }} -
emit-value {{ date2Thai(e.dateEnd) }}
hide-bottom-space </p>
map-options </q-item-section>
:rules="[ </q-item>
(val) => </q-list>
formData.investigationExtendStatus
? !!val || 'กรุณาเลือกจำนวนวันที่ต้องการขยาย'
: true,
]"
option-label="name"
option-value="id"
use-input
@update:model-value="calEndDate"
><template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
ไมอม
</q-item-section>
</q-item>
</template>
</q-select>
</div>
<div class="col-3">
<datepicker
menu-class-name="modalfix"
v-model="formData.investigationDateEnd"
: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"
:input-style="
isReadonly
? { color: 'black' }
: { color: 'teal' }
"
ref="dateEndRef"
class="full-width cursor-pointer"
:readonly="isReadonly"
outlined
dense
lazy-rules
hide-bottom-space
borderless
:model-value="
formData.investigationDateEnd
? date2Thai(formData.investigationDateEnd)
: 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> </div>
</div> </div>
@ -1367,9 +1422,10 @@ onMounted(async () => {
@returnDirector="returnDirector" @returnDirector="returnDirector"
/> />
<CalandarDialog <CalandarDialog
:modal="calendarModal" :modal="calendarModal"
:close="calendarModalclose" :close="calendarModalclose"
:lists="props.data.investigationExtendHistory"
/> />
</template> </template>
@ -1377,5 +1433,8 @@ onMounted(async () => {
.q-banner { .q-banner {
min-height: 25px; min-height: 25px;
} }
.fixed-height-history {
overflow-y: auto;
height: 150px;
}
</style> </style>
@/modules/11_discipline/store/store

View file

@ -96,14 +96,15 @@ async function fetchCalendar() {
const events = data.map((e: CaledarDisciplinary, index: number) => ({ const events = data.map((e: CaledarDisciplinary, index: number) => ({
id: e.id, id: e.id,
title: e.title, title: e.title,
start: e.disciplinaryDateEnd, start: e.disciplinaryDateStart,
end: e.disciplinaryDateStart, end: e.disciplinaryDateEnd,
allDay: true, allDay: true,
color: color:
data.length > 1 && index > 0 ? gradientColors[index] : defaultColor, data.length > 1 && index > 0 ? gradientColors[index] : defaultColor,
})); }));
calendarOptions.value.events = events; calendarOptions.value.events = events;
console.log("events===>",events)
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);

View file

@ -1,6 +1,6 @@
interface FormData { interface FormData {
id:string id: string;
idComplaint:string idComplaint: string;
investigationDetail: string; investigationDetail: string;
complaint: string; complaint: string;
complaintdetail: string; complaintdetail: string;
@ -11,27 +11,37 @@ interface FormData {
fileComplaint: File | null; fileComplaint: File | null;
investigationExtendStatus: boolean | null; investigationExtendStatus: boolean | null;
investigationDateStart: Date | null; investigationDateStart: Date | null;
investigationDateEnd: Date|null; investigationDateEnd: Date | null;
investigationDaysExtend: number | null; investigationDaysExtend: number | null;
investigationStatusResult: string; investigationStatusResult: string;
investigationCauseText: string; investigationCauseText: string;
complaintStatus:string complaintStatus: string;
result: string result: string;
directors:object|null directors: object | null;
status:string status: string;
disciplineInvestigateDocs:any disciplineInvestigateDocs: any;
disciplineInvestigateRelevantDocs:any disciplineInvestigateRelevantDocs: any;
documentFile:any|null documentFile: any | null;
respondentType:string respondentType: string;
organizationId:string organizationId: string;
persons:object|null persons: object | null;
investigationExtendHistory: ExtendHistoryObject[];
} }
interface ArrayPerson{
id:string interface ExtendHistoryObject {
name:string name: string;
position:string num: number;
email:string daysExtend: number | null;
phone:string dateStart: Date;
dateEnd: Date;
}
interface ArrayPerson {
id: string;
name: string;
position: string;
email: string;
phone: string;
} }
interface MyObjectInvestigateRef { interface MyObjectInvestigateRef {
complaint: object | null; complaint: object | null;
@ -49,5 +59,4 @@ interface MyObjectInvestigateRef {
[key: string]: any; [key: string]: any;
} }
export type { FormData, MyObjectInvestigateRef }; export type { FormData, MyObjectInvestigateRef };

View file

@ -2,12 +2,14 @@ interface DataOptionRes {
organizationId: string; organizationId: string;
organizationName: string; organizationName: string;
} }
interface CaledarInvestigatefacts { interface CaledarInvestigatefacts {
id: string; id: string;
title: string; title: string;
investigationDateStart: Date; investigationDateStart: Date;
investigationDateEnd: Date; investigationDateEnd: Date;
} }
interface CaledarDisciplinary { interface CaledarDisciplinary {
id: string; id: string;
title: string; title: string;
@ -15,4 +17,10 @@ interface CaledarDisciplinary {
disciplinaryDateStart: Date; disciplinaryDateStart: Date;
} }
export type { DataOptionRes, CaledarInvestigatefacts, CaledarDisciplinary }; interface ExtendHistoryObject {
name: string;
dateStart: Date;
dateEnd: Date;
}
export type { DataOptionRes, CaledarInvestigatefacts, CaledarDisciplinary, ExtendHistoryObject };