แก้ไขรับ-คืนเครื่องราช

This commit is contained in:
Warunee Tamkoo 2023-09-25 23:50:03 +07:00
parent 925c06c9fc
commit ac71abb53a

View file

@ -18,6 +18,7 @@ const OrganazationId = ref<string>("");
const OrgList = ref<DataOption[]>([]);
const Datereceive = ref<Date | null>();
const Datereturn = ref<Date | null>();
const remark = ref<string>("")
const props = defineProps({
modal: Boolean,
@ -41,39 +42,21 @@ const close = () => {
<q-dialog v-model="props.modal" persistent>
<q-card style="min-width: 900px">
<q-toolbar>
<q-toolbar-title class="text-subtitle2 text-bold"
>-นเครองราชฯ</q-toolbar-title
>
<q-btn
icon="close"
unelevated
round
dense
@click="close"
style="color: #ff8080; background-color: #ffdede"
/>
<q-toolbar-title class="text-subtitle2 text-bold">-นเครองราชฯ</q-toolbar-title>
<q-btn icon="close" unelevated round dense @click="close" style="color: #ff8080; background-color: #ffdede" />
</q-toolbar>
<q-separator />
<q-form ref="myForm">
<div class="q-pa-md bg-grey-1">
<div
class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs"
>
<div class="row col-12 items-center q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-12 text-weight-bold text-grey-7">
บเครองราชฯ
</div>
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-xs-12 col-sm-4">
<datepicker
menu-class-name="modalfix"
v-model="Datereceive"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
>
<datepicker menu-class-name="modalfix" v-model="Datereceive" :locale="'th'" autoApply borderless
:enableTimePicker="false" week-start="0">
<template #year="{ year }">
{{ year + 543 }}
</template>
@ -81,26 +64,11 @@ const close = () => {
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
dense
borderless
outlined
lazy-rules
:rules="[(val) => !!val || 'กรุณาเลือกวันที่ได้รับ']"
hide-bottom-space
:model-value="
Datereceive != null ? date2Thai(Datereceive) : undefined
"
:label="`${'วันที่ได้รับ'}`"
clearable
@clear="clearReceiveDate"
>
<q-input dense borderless outlined lazy-rules :rules="[(val) => !!val || 'กรุณาเลือกวันที่ได้รับ']"
hide-bottom-space :model-value="Datereceive != null ? date2Thai(Datereceive) : undefined
" :label="`${'วันที่ได้รับ'}`" clearable @clear="clearReceiveDate">
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
color="primary"
>
<q-icon name="event" class="cursor-pointer" color="primary">
</q-icon>
</template>
</q-input>
@ -109,51 +77,24 @@ const close = () => {
</div>
<div class="col-xs-12 col-sm-4">
<q-file
ref="myForm"
outlined
dense
v-model="files"
label="ไฟล์หลักฐานการรับ"
lazy-rules
:rules="[(val) => val || 'กรุณาเลือกไฟล์หลักฐานการรับ']"
hide-bottom-space
>
<q-file ref="myForm" outlined dense v-model="files" label="ไฟล์หลักฐานการรับ" lazy-rules
:rules="[(val) => val || 'กรุณาเลือกไฟล์หลักฐานการรับ']" hide-bottom-space>
<template v-slot:prepend>
<q-icon name="attach_file" color="primary" />
</template>
</q-file>
</div>
<div class="col-xs-12 col-sm-4">
<q-select
hide-bottom-space
:options="OrgList"
dense
borderless
option-label="name"
option-value="id"
emit-value
map-options
outlined
v-model="OrganazationId"
lazy-rules
:label="`หน่วยงานที่รับ`"
:rules="[(val) => !!val || 'กรุณาเลือกหน่วยงานที่รับ']"
/>
<q-select hide-bottom-space :options="OrgList" dense borderless option-label="name" option-value="id"
emit-value map-options outlined v-model="OrganazationId" lazy-rules :label="`หน่วยงานที่รับ`"
:rules="[(val) => !!val || 'กรุณาเลือกหน่วยงานที่รับ']" />
</div>
<div class="col-12 q-mt-md text-weight-bold text-grey-7">
นเครองราชฯ
</div>
<div class="col-xs-12 col-sm-4">
<datepicker
menu-class-name="modalfix"
v-model="Datereturn"
:locale="'th'"
autoApply
borderless
:enableTimePicker="false"
week-start="0"
>
<datepicker menu-class-name="modalfix" v-model="Datereturn" :locale="'th'" autoApply borderless
:enableTimePicker="false" week-start="0">
<template #year="{ year }">
{{ year + 543 }}
</template>
@ -161,26 +102,11 @@ const close = () => {
{{ parseInt(value + 543) }}
</template>
<template #trigger>
<q-input
dense
borderless
outlined
lazy-rules
:rules="[(val) => !!val || 'กรุณาเลือกวันที่คืน']"
hide-bottom-space
:model-value="
Datereturn != null ? date2Thai(Datereturn) : undefined
"
:label="`${'วันที่ได้รับ'}`"
clearable
@clear="clearReturnDate"
>
<q-input dense borderless outlined lazy-rules :rules="[(val) => !!val || 'กรุณาเลือกวันที่คืน']"
hide-bottom-space :model-value="Datereturn != null ? date2Thai(Datereturn) : undefined
" :label="`${'วันที่ได้รับ'}`" clearable @clear="clearReturnDate">
<template v-slot:prepend>
<q-icon
name="event"
class="cursor-pointer"
color="primary"
>
<q-icon name="event" class="cursor-pointer" color="primary">
</q-icon>
</template>
</q-input>
@ -188,38 +114,23 @@ const close = () => {
</datepicker>
</div>
<div class="col-xs-12 col-sm-4">
<q-file
ref="myForm"
outlined
dense
v-model="filesReturn"
label="ไฟล์หลักฐานการคืน"
lazy-rules
:rules="[(val) => val || 'กรุณาเลือกไฟล์หลักฐานการคืน']"
hide-bottom-space
>
<q-file ref="myForm" outlined dense v-model="filesReturn" label="ไฟล์หลักฐานการคืน" lazy-rules
:rules="[(val) => val || 'กรุณาเลือกไฟล์หลักฐานการคืน']" hide-bottom-space>
<template v-slot:prepend>
<q-icon name="attach_file" color="primary" />
</template>
</q-file>
</div>
<div class="col-xs-12 col-sm-4">
<q-select
hide-bottom-space
:options="OrgList"
dense
borderless
option-label="name"
option-value="id"
emit-value
map-options
outlined
v-model="OrganazationId"
lazy-rules
:label="`หน่วยงานที่คืน`"
:rules="[(val) => !!val || 'กรุณาเลือกหน่วยงานที่คืน']"
/>
<q-select hide-bottom-space :options="OrgList" dense borderless option-label="name" option-value="id"
emit-value map-options outlined v-model="OrganazationId" lazy-rules :label="`หน่วยงานที่คืน`"
:rules="[(val) => !!val || 'กรุณาเลือกหน่วยงานที่คืน']" />
</div>
<div class="col-xs-12 col-sm-12">
<q-input type="textarea" v-model="remark" outlined dense rows="3" :label="`${'หมายเหตุ'}`"/>
</div>
</div>
</div>
</div>