แก้ไขบัด จัดสรรเครื่องราช

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-08-28 14:45:47 +07:00
parent 4ca00ceadb
commit 91bb279158
7 changed files with 95 additions and 396 deletions

View file

@ -7,9 +7,7 @@ import { useRouter } from "vue-router";
const $q = useQuasar();
const myForm = ref<QForm>();
const mixin = useCounterMixin();
const {
dialogConfirm,
} = mixin;
const { dialogConfirm } = mixin;
const router = useRouter();
const routeName = router.currentRoute.value.name;
const amount = ref<number | null>();
@ -31,18 +29,17 @@ const props = defineProps({
},
insigniaList: {
type: Array,
default: []
default: [],
},
});
watch(props, () => {
if (props.modal) {
grandCross.value = ""
Org.value = ""
amount.value = null
if (props.modal === false) {
grandCross.value = "";
Org.value = "";
amount.value = null;
}
console.log("insigniaList===>", props.insigniaList)
})
});
const clickSave = () => {
dialogConfirm($q, () => props.save(grandCross.value, amount.value));
@ -54,22 +51,53 @@ const clickSave = () => {
<q-card style="width: 800px">
<q-toolbar class="q-py-sm">
<q-toolbar-title class="text-h6">ดสรรเครองราชฯ </q-toolbar-title>
<q-btn icon="close" unelevated round dense @click="closeModal"
style="color: #ff8080; background-color: #ffdede" />
<q-btn
icon="close"
unelevated
round
dense
@click="closeModal"
style="color: #ff8080; background-color: #ffdede"
/>
</q-toolbar>
<q-separator />
<q-form ref="myForm">
<div class="q-pa-md">
<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-6">
<q-select hide-bottom-space :options="insigniaList" dense borderless
option-label="name" option-value="id" emit-value map-options outlined options-cover v-model="grandCross"
:label="routeName == 'insigniaAllocate' ? `เครื่องราชฯ` : `เลือกหน่วยงาน`" />
<q-select
hide-bottom-space
:options="insigniaList"
dense
borderless
option-label="name"
option-value="id"
emit-value
map-options
outlined
options-cover
v-model="grandCross"
:label="
routeName == 'insigniaAllocate'
? `เครื่องราชฯ`
: `เลือกหน่วยงาน`
"
/>
</div>
<div class="col-xs-12 col-sm-6">
<q-input hide-bottom-space outlined class="inputgreen" v-model="amount" dense lazy-rules type="number"
label="จำนวน" />
<q-input
hide-bottom-space
outlined
class="inputgreen"
v-model="amount"
dense
lazy-rules
type="number"
label="จำนวน"
/>
<!-- :rules="[(val:any) =>val.length != 13 ||`${'กรุณากรอกเลขบัตรประจำตัวประชาชนให้ครบ'}`,]" -->
</div>
</div>