fix bug calendar

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-04-30 10:59:11 +07:00
parent 2737810c6c
commit 6f5f1f90c9
111 changed files with 2002 additions and 1866 deletions

View file

@ -14,7 +14,7 @@ const typeReport = route.params.type.toString();
const store = useReportDataStore();
const mixin = useCounterMixin();
const { date2Thai } = mixin;
const { date2Thai } = mixin;
const { filterFnOptionsType } = store;
const $q = useQuasar();
@ -28,33 +28,33 @@ const titleReport = ref<string>("");
const splitterModel = ref(14);
/** กลับหน้าหลัก */
function backHistory(){
function backHistory() {
window.history.back();
};
}
/** แสดงรายงาน */
function showDocument(url: any){
function showDocument(url: any) {
const pdfData = usePDF(url);
setTimeout(() => {
pdfSrc.value = pdfData.pdf.value;
numOfPages.value = pdfData.pages.value;
}, 1000);
};
}
/** ไปหน้าต่อไปของรายงาน */
function nextPage(){
function nextPage() {
if (page.value < numOfPages.value) {
page.value++;
}
};
}
/** กลับหน้าก่อนหน้าของรายงาน */
function backPage(){
function backPage() {
if (page.value !== 1) {
page.value--;
}
};
}
/** โหลดข้อมูลเมื่อเข้าหน้านี้ */
onMounted(async () => {
@ -98,7 +98,6 @@ onMounted(async () => {
class="full-width inputgreen cursor-pointer"
outlined
dense
lazy-rules
borderless
:model-value="date ? date2Thai(date) : null"
:label="`${'ตั้งเเต่วันที่'}`"
@ -110,7 +109,6 @@ onMounted(async () => {
</q-input>
</template>
</datepicker>
</div>
<div class="q-pl-xs">
<datepicker
@ -130,7 +128,6 @@ onMounted(async () => {
class="full-width inputgreen cursor-pointer"
outlined
dense
lazy-rules
borderless
:model-value="dateEnd ? date2Thai(dateEnd) : null"
:label="`${'ถึงวันที่'}`"
@ -142,7 +139,6 @@ onMounted(async () => {
</q-input>
</template>
</datepicker>
</div>
<q-space />
<div class="q-py-xs">
@ -182,7 +178,6 @@ onMounted(async () => {
</q-item>
</template>
</q-select>
</div>
<div class="q-pl-xs">
<q-select
@ -208,7 +203,6 @@ onMounted(async () => {
</q-item>
</template>
</q-select>
</div>
<div v-if="typeReport > '2'" class="q-pl-xs">
<q-select
@ -234,7 +228,6 @@ onMounted(async () => {
</q-item>
</template>
</q-select>
</div>
</q-toolbar>
<q-splitter
@ -262,7 +255,6 @@ onMounted(async () => {
@click="backPage"
:disable="page == 1"
/>
</div>
<div class="col-12 col-md-auto">
<div class="q-pa-md flex">
@ -279,7 +271,6 @@ onMounted(async () => {
@click="nextPage"
:disable="page === numOfPages"
/>
</div>
</div>
</div>

View file

@ -13,7 +13,7 @@ import { useDisciplineSuspendStore } from "@/modules/11_discipline/store/Suspend
import type { QForm } from "quasar";
import type { dataDetail } from "@/modules/11_discipline/interface/response/suspend";
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
const modalPersonal = ref<boolean>(false);
const personId = ref<string>("");
/** use */
@ -64,7 +64,7 @@ const data = reactive<dataDetail>({
});
/**นำข้อมูลจาก API มาแสดง */
async function getData(){
async function getData() {
showLoader();
await http
.get(config.API.suspendById(dataId))
@ -92,7 +92,7 @@ async function getData(){
data.offenseDetails = dataGet.offenseDetails;
data.disciplinaryFaultLevel = dataGet.disciplinaryFaultLevel;
data.disciplinaryCaseFault = dataGet.disciplinaryCaseFault;
getAvatar(dataGet.personId)
getAvatar(dataGet.personId);
})
.catch((e) => {
messageError($q, e);
@ -100,39 +100,37 @@ async function getData(){
.finally(() => {
hideLoader();
});
};
}
/**
* งช งรปภาพโปรไฟล
* @param id id ของบคคล
*/
function getAvatar(id:string){
if(id){
function getAvatar(id: string) {
if (id) {
http
.get(config.API.profileAvaId(id))
.then((res)=>{
console.log(res)
const dataList = res.data.result
data.avatar = dataList.avatar
}).catch((e)=>{
}).finally(()=>{
})
.get(config.API.profileAvaId(id))
.then((res) => {
console.log(res);
const dataList = res.data.result;
data.avatar = dataList.avatar;
})
.catch((e) => {})
.finally(() => {});
}
}
/**
* งก Cancle
*/
async function clickCancel(){
async function clickCancel() {
await getData();
edit.value = false;
};
}
/**
* งก Save
*/
async function conditionSave(){
async function conditionSave() {
if (myForm.value !== null) {
myForm.value.validate().then((success) => {
if (success) {
@ -149,12 +147,12 @@ function getAvatar(id:string){
}
});
}
};
}
/**
* งก Saveจาก API
*/
async function saveData(){
async function saveData() {
const body = {
organization: data.organization,
position: data.position,
@ -179,18 +177,18 @@ function getAvatar(id:string){
await getData();
hideLoader();
});
};
}
/**
* Function เพ Class เวลา Edit
* @param val เมอเปนEdit จะเปลยน Class
*/
function getClass(val: boolean){
function getClass(val: boolean) {
return {
"full-width inputgreen cursor-pointer": val,
"full-width cursor-pointer": !val,
};
};
}
function onclickViewinfo(id: string) {
modalPersonal.value = true;
@ -211,7 +209,6 @@ function changeFormDataDate() {
}
}
/** Hook */
onMounted(async () => {
if (keycloak.tokenParsed != null) {
@ -254,7 +251,10 @@ onMounted(async () => {
<div class="row col-12 q-pa-md">
<div class="col-12 row bg-white q-col-gutter-md">
<div class="col-xs-3 col-sm-2 col-md-1 row">
<q-img :src="data.avatar" v-if="data.avatar !== '' && data.avatar !== null" />
<q-img
:src="data.avatar"
v-if="data.avatar !== '' && data.avatar !== null"
/>
<q-img src="@/assets/avatar_user.jpg" v-else />
</div>
<div class="col-xs-6 col-sm-3 row items-center">
@ -428,7 +428,6 @@ onMounted(async () => {
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
:model-value="
@ -468,7 +467,6 @@ onMounted(async () => {
:enableTimePicker="false"
week-start="0"
:min-date="data.startDateSuspend"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
@ -479,7 +477,6 @@ onMounted(async () => {
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit || data.startDateSuspend === null"
:borderless="!edit"
:model-value="
@ -490,7 +487,6 @@ onMounted(async () => {
:rules="[(val) => !!val || `${'กรุณาเลือกถึงวันที่'}`]"
hide-bottom-space
:label="`${'ถึงวันที่'}`"
>
<template v-slot:prepend>
<q-icon

View file

@ -353,7 +353,6 @@ onMounted(async () => {
<template #trigger>
<q-input
dense
lazy-rules
outlined
:model-value="
formData.year === 0 ? null : Number(formData.year) + 543