fix bug calendar
This commit is contained in:
parent
2737810c6c
commit
6f5f1f90c9
111 changed files with 2002 additions and 1866 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue