ระบบลา (ขรก.) >> ลาป่วย (กรณียื่นขอลาเกิน 30 วัน)
This commit is contained in:
parent
0bcf05531f
commit
d90af17be5
2 changed files with 15 additions and 2 deletions
|
|
@ -10,11 +10,14 @@ import { useLeaveStore } from "@/modules/05_leave/store";
|
||||||
import type { FormRef } from "@/modules/05_leave/interface/request/SickForm";
|
import type { FormRef } from "@/modules/05_leave/interface/request/SickForm";
|
||||||
|
|
||||||
/** Use */
|
/** Use */
|
||||||
|
const typeForm = defineModel<string>("type", { required: true });
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const dataStore = useLeaveStore();
|
const dataStore = useLeaveStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { date2Thai, dateToISO, messageError } = mixin;
|
const { date2Thai, dateToISO, messageError } = mixin;
|
||||||
const edit = ref<boolean>(true);
|
const edit = ref<boolean>(true);
|
||||||
|
const leaveDocumentRef = ref<any>(null);
|
||||||
|
|
||||||
/** รับ props มาจากหน้าหลัก */
|
/** รับ props มาจากหน้าหลัก */
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -161,6 +164,9 @@ async function fetchCheck() {
|
||||||
})
|
})
|
||||||
.catch((e: any) => {
|
.catch((e: any) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
leaveDocumentRef.value.resetValidation();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -241,7 +247,7 @@ onMounted(() => {
|
||||||
<q-icon name="mdi-numeric-3-circle" size="20px" color="primary" />
|
<q-icon name="mdi-numeric-3-circle" size="20px" color="primary" />
|
||||||
<div class="q-pl-sm text-weight-bold text-dark">กรอกข้อมูล</div>
|
<div class="q-pl-sm text-weight-bold text-dark">กรอกข้อมูล</div>
|
||||||
</div>
|
</div>
|
||||||
<form @submit.prevent.stop="onValidate">
|
<q-form greedy @submit.prevent @validation-success="onValidate">
|
||||||
<q-card bordered class="q-pa-md bg-grey-1">
|
<q-card bordered class="q-pa-md bg-grey-1">
|
||||||
<div class="col-12 row q-pa-sm q-col-gutter-sm">
|
<div class="col-12 row q-pa-sm q-col-gutter-sm">
|
||||||
<q-input
|
<q-input
|
||||||
|
|
@ -470,15 +476,21 @@ onMounted(() => {
|
||||||
<div class="q-col-gutter-sm row">
|
<div class="q-col-gutter-sm row">
|
||||||
<!-- multiple -->
|
<!-- multiple -->
|
||||||
<q-file
|
<q-file
|
||||||
|
ref="leaveDocumentRef"
|
||||||
for="leaveDocumentRef"
|
for="leaveDocumentRef"
|
||||||
v-model="formDataSick.leaveDocument"
|
v-model="formDataSick.leaveDocument"
|
||||||
dense
|
dense
|
||||||
label="เอกสารประกอบ"
|
label="เอกสารประกอบ"
|
||||||
outlined
|
outlined
|
||||||
use-chips
|
use-chips
|
||||||
|
lazy-rules
|
||||||
multiple
|
multiple
|
||||||
|
hide-bottom-space
|
||||||
bg-color="white"
|
bg-color="white"
|
||||||
class="col-12 q-pl-sm col-12"
|
class="col-12 q-pl-sm col-12"
|
||||||
|
:rules="typeForm == 'LV-001' && formDataSick.leaveTotal >= 30 ?[
|
||||||
|
(val:string) => !!val && val.length >= 30 || `${'กรุณาแนบเอกสารประกอบ หรือ ใบรับรองแพทย์ กรณีลาป่วยตั้งเเต่ 30 วันขึ้นไป'}`,
|
||||||
|
]:[]"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon name="attach_file" color="primary" />
|
<q-icon name="attach_file" color="primary" />
|
||||||
|
|
@ -590,5 +602,5 @@ onMounted(() => {
|
||||||
><q-tooltip>ยื่นใบลา</q-tooltip></q-btn
|
><q-tooltip>ยื่นใบลา</q-tooltip></q-btn
|
||||||
>
|
>
|
||||||
</q-card-actions>
|
</q-card-actions>
|
||||||
</form>
|
</q-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -198,6 +198,7 @@ onMounted(async () => {
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<SickForm
|
<SickForm
|
||||||
v-if="model === 'LV-001' || model === 'LV-002'"
|
v-if="model === 'LV-001' || model === 'LV-002'"
|
||||||
|
v-model:type="model"
|
||||||
:on-submit="onSubmit"
|
:on-submit="onSubmit"
|
||||||
/>
|
/>
|
||||||
<FormBirth v-if="model === 'LV-003'" :on-submit="onSubmit" />
|
<FormBirth v-if="model === 'LV-003'" :on-submit="onSubmit" />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue