แก้uiสรรหา
This commit is contained in:
parent
b01e667f34
commit
6976007b64
9 changed files with 438 additions and 197 deletions
|
|
@ -62,12 +62,12 @@
|
|||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
:class="getClass(false)"
|
||||
:outlined="false"
|
||||
dense
|
||||
lazy-rules
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
:readonly="!false"
|
||||
:borderless="!false"
|
||||
v-model="defaultInformation.nationality"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอก สัญชาติ'}`]"
|
||||
:label="`${'สัญชาติ'}`"
|
||||
|
|
@ -149,17 +149,17 @@
|
|||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
:borderless="!(status == 'checkRegister' || status == 'payment')"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก สถานภาพ'}`]"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือก ศาสนา'}`]"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="defaultInformation.relationshipId"
|
||||
v-model="defaultInformation.religionId"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="relationshipOptions"
|
||||
:options="religionOptions"
|
||||
option-value="id"
|
||||
:label="`${'สถานภาพ'}`"
|
||||
:label="`${'ศาสนา'}`"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
|
|
@ -178,8 +178,7 @@
|
|||
v-model="defaultInformation.cardid"
|
||||
maxlength="13"
|
||||
:rules="[
|
||||
(val) =>
|
||||
val.length == 13 || `${'กรุณากรอก เลขประจำตัวประชาชน'}`,
|
||||
(val) => val.length == 13 || `${'กรุณากรอก เลขประจำตัวประชาชน'}`,
|
||||
(val) =>
|
||||
/^[0-9]*$/.test(val) ||
|
||||
`${'กรุณากรอกเลขประจำตัวประชาชนให้ถูกต้อง'}`,
|
||||
|
|
@ -187,7 +186,7 @@
|
|||
label="เลขประจำตัวประชาชน"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<!-- <div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-select
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:readonly="!(status == 'checkRegister' || status == 'payment')"
|
||||
|
|
@ -276,7 +275,7 @@
|
|||
</q-input>
|
||||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||
<q-input
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
|
|
@ -370,7 +369,7 @@
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-9 col-md-12">
|
||||
<!-- <div class="col-xs-12 col-sm-9 col-md-12">
|
||||
<q-input
|
||||
:class="getClass(status == 'checkRegister' || status == 'payment')"
|
||||
:outlined="status == 'checkRegister' || status == 'payment'"
|
||||
|
|
@ -382,7 +381,7 @@
|
|||
label="ความรู้ความสามารถพิเศษ"
|
||||
type="textarea"
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
</q-form>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
|
@ -409,7 +408,7 @@ const props = defineProps({
|
|||
type: Array as PropType<DataOption[]>,
|
||||
required: true,
|
||||
},
|
||||
relationshipOptions: {
|
||||
religionOptions: {
|
||||
type: Array as PropType<DataOption[]>,
|
||||
required: true,
|
||||
},
|
||||
|
|
@ -476,7 +475,7 @@ const fetchData = async () => {
|
|||
data.citizenDate == null ? null : new Date(data.citizenDate);
|
||||
defaultInformation.value.cardid = data.citizenId;
|
||||
defaultInformation.value.firstname = data.firstName;
|
||||
defaultInformation.value.relationshipId = data.relationshipId;
|
||||
defaultInformation.value.religionId = data.religionId;
|
||||
defaultInformation.value.nationality = data.nationality;
|
||||
defaultInformation.value.email = data.email;
|
||||
defaultInformation.value.phone = data.mobilePhone;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<div class="q-px-sm">
|
||||
<Information
|
||||
:prefixOptions="prefixOptions"
|
||||
:relationshipOptions="relationshipOptions"
|
||||
:religionOptions="religionOptions"
|
||||
:provinceOptions="provinceOptions"
|
||||
:status="status"
|
||||
v-model:form="formInformation"
|
||||
|
|
@ -19,14 +19,14 @@
|
|||
/>
|
||||
</div>
|
||||
|
||||
<q-separator class="q-my-lg bg-gray" size="5px" />
|
||||
<!-- <q-separator class="q-my-lg bg-gray" size="5px" />
|
||||
<div class="q-px-sm">
|
||||
<Family
|
||||
:prefixOptions="prefixOptions"
|
||||
:status="status"
|
||||
v-model:form="formFamily"
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<q-separator class="q-my-lg bg-gray" size="5px" />
|
||||
<div class="q-px-sm">
|
||||
|
|
@ -77,10 +77,10 @@ const props = defineProps({
|
|||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
formFamily: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
// formFamily: {
|
||||
// type: Object,
|
||||
// required: true,
|
||||
// },
|
||||
formOccupation: {
|
||||
type: Object,
|
||||
required: true,
|
||||
|
|
@ -90,11 +90,11 @@ const props = defineProps({
|
|||
const $q = useQuasar();
|
||||
|
||||
const prefixOptions = ref<DataOption[]>([]);
|
||||
const relationshipOptions = ref<DataOption[]>([]);
|
||||
const religionOptions = ref<DataOption[]>([]);
|
||||
const provinceOptions = ref<DataOption[]>([]);
|
||||
const formInformation = ref<any>({});
|
||||
const formAddress = ref<any>({});
|
||||
const formFamily = ref<any>({});
|
||||
// const formFamily = ref<any>({});
|
||||
const formOccupation = ref<any>({});
|
||||
const mixin = useCounterMixin();
|
||||
const { messageError, showLoader, hideLoader } = mixin;
|
||||
|
|
@ -102,7 +102,7 @@ const { messageError, showLoader, hideLoader } = mixin;
|
|||
const emit = defineEmits([
|
||||
"update:formInformation",
|
||||
"update:formAddress",
|
||||
"update:formFamily",
|
||||
// "update:formFamily",
|
||||
"update:formOccupation",
|
||||
]);
|
||||
|
||||
|
|
@ -114,9 +114,9 @@ watch(formAddress, async (count: Object, prevCount: Object) => {
|
|||
emit("update:formAddress", count);
|
||||
});
|
||||
|
||||
watch(formFamily, async (count: Object, prevCount: Object) => {
|
||||
emit("update:formFamily", count);
|
||||
});
|
||||
// watch(formFamily, async (count: Object, prevCount: Object) => {
|
||||
// emit("update:formFamily", count);
|
||||
// });
|
||||
|
||||
watch(formOccupation, async (count: Object, prevCount: Object) => {
|
||||
emit("update:formOccupation", count);
|
||||
|
|
@ -125,7 +125,7 @@ watch(formOccupation, async (count: Object, prevCount: Object) => {
|
|||
onMounted(() => {
|
||||
hideLoader();
|
||||
fetchPrefix();
|
||||
fetchRelationship();
|
||||
fetchReligion();
|
||||
fetchProvince();
|
||||
});
|
||||
|
||||
|
|
@ -149,17 +149,17 @@ const fetchPrefix = async () => {
|
|||
});
|
||||
};
|
||||
|
||||
const fetchRelationship = async () => {
|
||||
const fetchReligion = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.relationship)
|
||||
.get(config.API.religion)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
let option: DataOption[] = [];
|
||||
data.map((r: any) => {
|
||||
option.push({ id: r.id.toString(), name: r.name.toString() });
|
||||
});
|
||||
relationshipOptions.value = option;
|
||||
religionOptions.value = option;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue