ระบบลา (ขรก.) >> ลาป่วย (กรณียื่นขอลาเกิน 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";
|
||||
|
||||
/** Use */
|
||||
const typeForm = defineModel<string>("type", { required: true });
|
||||
|
||||
const $q = useQuasar();
|
||||
const dataStore = useLeaveStore();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, dateToISO, messageError } = mixin;
|
||||
const edit = ref<boolean>(true);
|
||||
const leaveDocumentRef = ref<any>(null);
|
||||
|
||||
/** รับ props มาจากหน้าหลัก */
|
||||
const props = defineProps({
|
||||
|
|
@ -161,6 +164,9 @@ async function fetchCheck() {
|
|||
})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
leaveDocumentRef.value.resetValidation();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -241,7 +247,7 @@ onMounted(() => {
|
|||
<q-icon name="mdi-numeric-3-circle" size="20px" color="primary" />
|
||||
<div class="q-pl-sm text-weight-bold text-dark">กรอกข้อมูล</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">
|
||||
<div class="col-12 row q-pa-sm q-col-gutter-sm">
|
||||
<q-input
|
||||
|
|
@ -470,15 +476,21 @@ onMounted(() => {
|
|||
<div class="q-col-gutter-sm row">
|
||||
<!-- multiple -->
|
||||
<q-file
|
||||
ref="leaveDocumentRef"
|
||||
for="leaveDocumentRef"
|
||||
v-model="formDataSick.leaveDocument"
|
||||
dense
|
||||
label="เอกสารประกอบ"
|
||||
outlined
|
||||
use-chips
|
||||
lazy-rules
|
||||
multiple
|
||||
hide-bottom-space
|
||||
bg-color="white"
|
||||
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>
|
||||
<q-icon name="attach_file" color="primary" />
|
||||
|
|
@ -590,5 +602,5 @@ onMounted(() => {
|
|||
><q-tooltip>ยื่นใบลา</q-tooltip></q-btn
|
||||
>
|
||||
</q-card-actions>
|
||||
</form>
|
||||
</q-form>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -198,6 +198,7 @@ onMounted(async () => {
|
|||
<div class="col-12">
|
||||
<SickForm
|
||||
v-if="model === 'LV-001' || model === 'LV-002'"
|
||||
v-model:type="model"
|
||||
:on-submit="onSubmit"
|
||||
/>
|
||||
<FormBirth v-if="model === 'LV-003'" :on-submit="onSubmit" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue