close #181 แก้ไขแสดง guid ที่อยู่ในหน้าประวัติผู้สอบของหน่วยงาน
This commit is contained in:
parent
029d9257a0
commit
d4a59110c0
1 changed files with 178 additions and 276 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
<!-- card ข้อมูลที่อยู่ -->
|
<!-- card ข้อมูลที่อยู่ -->
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from "vue";
|
import { ref, onMounted, reactive } from "vue";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
@ -16,7 +16,8 @@ import type {
|
||||||
AddressOps,
|
AddressOps,
|
||||||
Address as AddressType,
|
Address as AddressType,
|
||||||
optionData,
|
optionData,
|
||||||
} from "@/modules//05_placement/interface/index/Main";
|
AddressData,
|
||||||
|
} from "@/modules/05_placement/interface/index/Main";
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -61,6 +62,20 @@ const OpsFilter = ref<AddressOps>({
|
||||||
subdistrictCOps: [],
|
subdistrictCOps: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const registAddress = reactive<AddressData>({
|
||||||
|
subDistrictId: "",
|
||||||
|
zipCode: "",
|
||||||
|
districtId: "",
|
||||||
|
provinceId: "",
|
||||||
|
})
|
||||||
|
|
||||||
|
const currentAddress = reactive<AddressData>({
|
||||||
|
subDistrictId: "",
|
||||||
|
zipCode: "",
|
||||||
|
districtId: "",
|
||||||
|
provinceId: "",
|
||||||
|
})
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getNewData();
|
await getNewData();
|
||||||
emit("update:statusEdit", false);
|
emit("update:statusEdit", false);
|
||||||
|
|
@ -117,40 +132,37 @@ const refreshData = async () => {
|
||||||
const getNewData = async () => {
|
const getNewData = async () => {
|
||||||
await props.fetch();
|
await props.fetch();
|
||||||
await fetchProvince();
|
await fetchProvince();
|
||||||
await fetchDistrict(addressData.value.registProvinceId, "1");
|
|
||||||
await fetchDistrict(addressData.value.currentProvinceId, "2");
|
|
||||||
await fetchSubDistrict(addressData.value.registDistrictId, "1");
|
|
||||||
await fetchSubDistrict(addressData.value.currentDistrictId, "2");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// บันทึกข้อมูล
|
||||||
const editData = async () => {
|
const editData = async () => {
|
||||||
const body = {
|
const body = {
|
||||||
registrationSame: addressData.value.registSame == "1",
|
registrationSame: addressData.value.registSame == "1",
|
||||||
registrationAddress: addressData.value.registAddress,
|
registrationAddress: addressData.value.registAddress,
|
||||||
registrationSubDistrictId: addressData.value.registSubDistrictId,
|
registrationSubDistrictId: registAddress.subDistrictId,
|
||||||
registrationDistrictId: addressData.value.registDistrictId,
|
registrationDistrictId: registAddress.districtId,
|
||||||
registrationProvinceId: addressData.value.registProvinceId,
|
registrationProvinceId: registAddress.provinceId,
|
||||||
registrationZipCode: addressData.value.registZipCode,
|
registrationZipCode: registAddress.provinceId,
|
||||||
currentAddress:
|
currentAddress:
|
||||||
addressData.value.registSame == "1"
|
addressData.value.registSame == "1"
|
||||||
? addressData.value.registAddress
|
? addressData.value.registAddress
|
||||||
: addressData.value.currentAddress,
|
: addressData.value.currentAddress,
|
||||||
currentSubDistrictId:
|
currentSubDistrictId:
|
||||||
addressData.value.registSame == "1"
|
addressData.value.registSame == "1"
|
||||||
? addressData.value.registSubDistrictId
|
? registAddress.subDistrictId
|
||||||
: addressData.value.currentSubDistrictId,
|
: currentAddress.subDistrictId,
|
||||||
currentDistrictId:
|
currentDistrictId:
|
||||||
addressData.value.registSame == "1"
|
addressData.value.registSame == "1"
|
||||||
? addressData.value.registDistrictId
|
? registAddress.districtId
|
||||||
: addressData.value.currentDistrictId,
|
: currentAddress.districtId,
|
||||||
currentProvinceId:
|
currentProvinceId:
|
||||||
addressData.value.registSame == "1"
|
addressData.value.registSame == "1"
|
||||||
? addressData.value.registProvinceId
|
? registAddress.provinceId
|
||||||
: addressData.value.currentProvinceId,
|
: currentAddress.provinceId,
|
||||||
currentZipCode:
|
currentZipCode:
|
||||||
addressData.value.registSame == "1"
|
addressData.value.registSame == "1"
|
||||||
? addressData.value.registZipCode
|
? registAddress.zipCode
|
||||||
: addressData.value.currentZipCode,
|
: currentAddress.zipCode,
|
||||||
};
|
};
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
@ -171,63 +183,68 @@ const editData = async () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// เช็คข้อมูลก่อนบันทึก
|
||||||
const saveData = async () => {
|
const saveData = async () => {
|
||||||
await myform.value.validate().then(async (success: boolean) => {
|
myform.value.validate().then((success: boolean) => {
|
||||||
if (success) {
|
if (success) {
|
||||||
await editData();
|
editData();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// เลือกข้อมูลจังหวัด
|
||||||
const selectProvince = async (e: string | null, name: string) => {
|
const selectProvince = async (e: string | null, name: string) => {
|
||||||
if (e != null) {
|
if (e != null) {
|
||||||
if (name == "1") {
|
if (name == "1") {
|
||||||
addressData.value.registDistrictId = "";
|
registAddress.subDistrictId = ""
|
||||||
addressData.value.registSubDistrictId = "";
|
registAddress.zipCode = ""
|
||||||
addressData.value.registZipCode = "";
|
registAddress.districtId = ""
|
||||||
} else {
|
} else {
|
||||||
addressData.value.currentDistrictId = "";
|
currentAddress.subDistrictId = ""
|
||||||
addressData.value.currentSubDistrictId = "";
|
currentAddress.zipCode = ""
|
||||||
addressData.value.currentZipCode = "";
|
currentAddress.districtId = ""
|
||||||
}
|
}
|
||||||
myform.value.resetValidation();
|
myform.value.resetValidation();
|
||||||
await fetchDistrict(e, name);
|
await fetchDistrict(e, name);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// เลือกข้อมูลอำเภอ
|
||||||
const selectDistrict = async (e: string | null, name: string) => {
|
const selectDistrict = async (e: string | null, name: string) => {
|
||||||
if (e != null) {
|
if (e != null) {
|
||||||
if (name == "1") {
|
if (name == "1") {
|
||||||
addressData.value.registSubDistrictId = "";
|
registAddress.subDistrictId = "";
|
||||||
addressData.value.registZipCode = "";
|
registAddress.zipCode = "";
|
||||||
} else {
|
} else {
|
||||||
addressData.value.currentSubDistrictId = "";
|
currentAddress.subDistrictId = "";
|
||||||
addressData.value.currentZipCode = "";
|
currentAddress.zipCode = "";
|
||||||
}
|
}
|
||||||
myform.value.resetValidation();
|
myform.value.resetValidation();
|
||||||
await fetchSubDistrict(e, name);
|
await fetchSubDistrict(e, name);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// เลือกข้อมูลตำบล
|
||||||
const selectSubDistrict = (e: string | null, name: string) => {
|
const selectSubDistrict = (e: string | null, name: string) => {
|
||||||
if (e != null) {
|
if (e != null) {
|
||||||
if (name == "1") {
|
if (name == "1") {
|
||||||
const findcode = Ops.value.subdistrictOps.filter((r) => r.id == e);
|
const findcode = Ops.value.subdistrictOps.filter((r) => r.id == e);
|
||||||
const namecode = findcode.length > 0 ? findcode[0].zipCode : "";
|
const namecode = findcode.length > 0 ? findcode[0].zipCode : "";
|
||||||
addressData.value.registZipCode = namecode;
|
registAddress.zipCode = namecode;
|
||||||
} else {
|
} else {
|
||||||
const findcode = Ops.value.subdistrictCOps.filter((r) => r.id == e);
|
const findcode = Ops.value.subdistrictCOps.filter((r) => r.id == e);
|
||||||
const namecode = findcode.length > 0 ? findcode[0].zipCode : "";
|
const namecode = findcode.length > 0 ? findcode[0].zipCode : "";
|
||||||
addressData.value.currentZipCode = namecode;
|
currentAddress.zipCode = namecode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ดึงข้อมูลจังหวัด
|
||||||
const fetchProvince = async () => {
|
const fetchProvince = async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.province)
|
.get(config.API.province)
|
||||||
.then((res) => {
|
.then(async (res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
let option: optionData[] = [];
|
let option: optionData[] = [];
|
||||||
data.map((r: any) => {
|
data.map((r: any) => {
|
||||||
|
|
@ -235,6 +252,40 @@ const fetchProvince = async () => {
|
||||||
});
|
});
|
||||||
Ops.value.provinceOps = option;
|
Ops.value.provinceOps = option;
|
||||||
OpsFilter.value.provinceOps = option;
|
OpsFilter.value.provinceOps = option;
|
||||||
|
|
||||||
|
const checkRegistProvinceId = await option.find((e: any) => e.id === addressData.value.registProvinceId)
|
||||||
|
|
||||||
|
// ที่อยู่ถ้า id จังหวัดว่างไม่ดึงค่าอำเภอ ตำบล และรหัสไปรษณีย์
|
||||||
|
if (addressData.value.registProvinceId == '' || addressData.value.registProvinceId == '00000000-0000-0000-0000-000000000000' || !checkRegistProvinceId) {
|
||||||
|
registAddress.subDistrictId = ""
|
||||||
|
registAddress.zipCode = ""
|
||||||
|
registAddress.districtId = ""
|
||||||
|
} else {
|
||||||
|
registAddress.provinceId = await addressData.value.registProvinceId
|
||||||
|
registAddress.zipCode = await addressData.value.registZipCode
|
||||||
|
|
||||||
|
await fetchDistrict(addressData.value.registProvinceId, "1");
|
||||||
|
if (addressData.value.registDistrictId != null && addressData.value.registDistrictId != '00000000-0000-0000-0000-000000000000') {
|
||||||
|
await fetchSubDistrict(addressData.value.registDistrictId, "1");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const checkCurrentProvinceId = await option.find((e: any) => e.id === addressData.value.currentProvinceId)
|
||||||
|
|
||||||
|
// ที่อยู่ปัจจุบันถ้า id จังหวัดว่างไม่ดึงค่าอำเภอ ตำบล และรหัสไปรษณีย์
|
||||||
|
if (addressData.value.currentProvinceId == '' || addressData.value.currentProvinceId == '00000000-0000-0000-0000-000000000000' || !checkCurrentProvinceId) {
|
||||||
|
currentAddress.subDistrictId = ""
|
||||||
|
currentAddress.zipCode = ""
|
||||||
|
currentAddress.districtId = ""
|
||||||
|
} else {
|
||||||
|
currentAddress.provinceId = addressData.value.currentProvinceId
|
||||||
|
currentAddress.zipCode = addressData.value.currentZipCode
|
||||||
|
|
||||||
|
await fetchDistrict(addressData.value.currentProvinceId, "2");
|
||||||
|
if (addressData.value.currentDistrictId != null && addressData.value.currentDistrictId != '00000000-0000-0000-0000-000000000000') {
|
||||||
|
await fetchSubDistrict(addressData.value.currentDistrictId, "2");
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -244,12 +295,13 @@ const fetchProvince = async () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ดึงข้อมูลอำเภอ
|
||||||
const fetchDistrict = async (id: string | null, position: string) => {
|
const fetchDistrict = async (id: string | null, position: string) => {
|
||||||
if (id != null && id != "") {
|
if (id != null && id != "") {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.listDistrict(id))
|
.get(config.API.listDistrict(id))
|
||||||
.then((res) => {
|
.then(async (res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
let option: optionData[] = [];
|
let option: optionData[] = [];
|
||||||
data.map((r: any) => {
|
data.map((r: any) => {
|
||||||
|
|
@ -258,9 +310,22 @@ const fetchDistrict = async (id: string | null, position: string) => {
|
||||||
if (position == "1") {
|
if (position == "1") {
|
||||||
Ops.value.districtOps = option;
|
Ops.value.districtOps = option;
|
||||||
OpsFilter.value.districtOps = option;
|
OpsFilter.value.districtOps = option;
|
||||||
|
|
||||||
|
// ที่อยู่ เช็คอำเภอว่ามี id ใน array ไหม ถ้ามีค่อยกำหนดค่าไปในตัวแปรใหม่เพิ่มแสดงผล
|
||||||
|
const checkRegistDistrictId = option.find((e: any) => e.id === addressData.value.registDistrictId)
|
||||||
|
|
||||||
|
if (checkRegistDistrictId) {
|
||||||
|
registAddress.districtId = addressData.value.registDistrictId
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Ops.value.districtCOps = option;
|
Ops.value.districtCOps = option;
|
||||||
OpsFilter.value.districtCOps = option;
|
OpsFilter.value.districtCOps = option;
|
||||||
|
|
||||||
|
// ที่อยู่ปัจจุบัน เช็คอำเภอว่ามี id ใน array ไหม ถ้ามีค่อยกำหนดค่าไปในตัวแปรใหม่เพิ่มแสดงผล
|
||||||
|
const checkCurrentDistrictId = await option.find((e: any) => e.id === addressData.value.currentDistrictId)
|
||||||
|
if (checkCurrentDistrictId) {
|
||||||
|
currentAddress.districtId = addressData.value.currentDistrictId
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|
@ -272,12 +337,13 @@ const fetchDistrict = async (id: string | null, position: string) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ดึงข้อมูลตำบล
|
||||||
const fetchSubDistrict = async (id: string | null, position: string) => {
|
const fetchSubDistrict = async (id: string | null, position: string) => {
|
||||||
if (id != null && id != "") {
|
if (id != null && id != "") {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.listSubDistrict(id))
|
.get(config.API.listSubDistrict(id))
|
||||||
.then((res) => {
|
.then(async (res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
let option: zipCodeOption[] = [];
|
let option: zipCodeOption[] = [];
|
||||||
data.map((r: any) => {
|
data.map((r: any) => {
|
||||||
|
|
@ -290,9 +356,21 @@ const fetchSubDistrict = async (id: string | null, position: string) => {
|
||||||
if (position == "1") {
|
if (position == "1") {
|
||||||
Ops.value.subdistrictOps = option;
|
Ops.value.subdistrictOps = option;
|
||||||
OpsFilter.value.subdistrictOps = option;
|
OpsFilter.value.subdistrictOps = option;
|
||||||
|
|
||||||
|
// ที่อยู่ เช็คตำบลว่ามี id ใน array ไหม ถ้ามีค่อยกำหนดค่าไปในตัวแปรใหม่เพิ่มแสดงผล
|
||||||
|
const checkRegistSubDistrictId = await option.find((e: any) => e.id === addressData.value.registSubDistrictId)
|
||||||
|
if (checkRegistSubDistrictId) {
|
||||||
|
registAddress.subDistrictId = addressData.value.registSubDistrictId
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Ops.value.subdistrictCOps = option;
|
Ops.value.subdistrictCOps = option;
|
||||||
OpsFilter.value.subdistrictCOps = option;
|
OpsFilter.value.subdistrictCOps = option;
|
||||||
|
|
||||||
|
// ที่อยู่ปัจจุบัน เช็คตำบลว่ามี id ใน array ไหม ถ้ามีค่อยกำหนดค่าไปในตัวแปรใหม่เพิ่มแสดงผล
|
||||||
|
const checkCurrentSubDistrictId = await option.find((e: any) => e.id === addressData.value.currentSubDistrictId)
|
||||||
|
if (checkCurrentSubDistrictId) {
|
||||||
|
currentAddress.subDistrictId = addressData.value.currentSubDistrictId
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|
@ -324,270 +402,94 @@ const getClass = (val: boolean) => {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<q-card class="col-12 q-px-lg q-py-md q-mt-md no-border">
|
<q-card class="col-12 q-px-lg q-py-md q-mt-md no-border">
|
||||||
<HeaderTop
|
<HeaderTop v-model:edit="edit" header="ข้อมูลที่อยู่" icon="mdi-map-marker" :save="saveData" :history="false"
|
||||||
v-model:edit="edit"
|
:changeBtn="changeBtn" :disable="statusEdit" :cancel="refreshData" />
|
||||||
header="ข้อมูลที่อยู่"
|
|
||||||
icon="mdi-map-marker"
|
|
||||||
:save="saveData"
|
|
||||||
:history="false"
|
|
||||||
:changeBtn="changeBtn"
|
|
||||||
:disable="statusEdit"
|
|
||||||
:cancel="refreshData"
|
|
||||||
/>
|
|
||||||
<q-form ref="myform">
|
<q-form ref="myform">
|
||||||
<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-xs-12">
|
<div class="col-xs-12">
|
||||||
<q-input
|
<q-input :class="getClass(edit)" hide-bottom-space :outlined="edit" dense lazy-rules type="textarea" autogrow
|
||||||
:class="getClass(edit)"
|
:readonly="!edit" :borderless="!edit" v-model="addressData.registAddress"
|
||||||
hide-bottom-space
|
:rules="[(val: string) => !!val || `${'กรุณากรอก ที่อยู่ตามทะเบียนบ้าน'}`]"
|
||||||
:outlined="edit"
|
:label="`${'ที่อยู่ตามทะเบียนบ้าน'}`" />
|
||||||
dense
|
|
||||||
lazy-rules
|
|
||||||
type="textarea"
|
|
||||||
autogrow
|
|
||||||
:readonly="!edit"
|
|
||||||
:borderless="!edit"
|
|
||||||
v-model="addressData.registAddress"
|
|
||||||
:rules="[(val:string) => !!val || `${'กรุณากรอก ที่อยู่ตามทะเบียนบ้าน'}`]"
|
|
||||||
:label="`${'ที่อยู่ตามทะเบียนบ้าน'}`"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||||
<selector
|
<selector :hide-dropdown-icon="!edit" hide-bottom-space :class="getClass(edit)" :readonly="!edit"
|
||||||
:hide-dropdown-icon="!edit"
|
:borderless="!edit" :rules="[(val: string) => !!val || `${'กรุณาเลือก จังหวัด'}`]" :outlined="edit" dense
|
||||||
hide-bottom-space
|
lazy-rules v-model="registAddress.provinceId" emit-value map-options option-label="name"
|
||||||
:class="getClass(edit)"
|
:options="Ops.provinceOps" option-value="id" :label="`${'จังหวัด'}`"
|
||||||
:readonly="!edit"
|
@update:model-value="(value: string) => selectProvince(value, '1')" use-input input-debounce="0" @filter="(inputValue: string,
|
||||||
:borderless="!edit"
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'provinceOps'
|
||||||
:rules="[(val:string) => !!val || `${'กรุณาเลือก จังหวัด'}`]"
|
)" />
|
||||||
:outlined="edit"
|
|
||||||
dense
|
|
||||||
lazy-rules
|
|
||||||
v-model="addressData.registProvinceId"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
option-label="name"
|
|
||||||
:options="Ops.provinceOps"
|
|
||||||
option-value="id"
|
|
||||||
:label="`${'จังหวัด'}`"
|
|
||||||
@update:model-value="(value:string) => selectProvince(value, '1')"
|
|
||||||
use-input
|
|
||||||
input-debounce="0"
|
|
||||||
@filter="(inputValue:string,
|
|
||||||
doneFn:Function) => filterSelector(inputValue, doneFn,'provinceOps'
|
|
||||||
) "
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||||
<selector
|
<selector :hide-dropdown-icon="!edit" hide-bottom-space :class="getClass(edit)" :readonly="!edit"
|
||||||
:hide-dropdown-icon="!edit"
|
:borderless="!edit" :rules="[(val: string) => !!val || `${'กรุณาเลือก เขต / อำเภอ'}`]" :outlined="edit" dense
|
||||||
hide-bottom-space
|
lazy-rules v-model="registAddress.districtId" emit-value map-options option-label="name"
|
||||||
:class="getClass(edit)"
|
:options="Ops.districtOps" option-value="id" :label="`${'เขต / อำเภอ'}`"
|
||||||
:readonly="!edit"
|
@update:model-value="(value: string) => selectDistrict(value, '1')" use-input input-debounce="0" @filter="(inputValue: string,
|
||||||
:borderless="!edit"
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'districtOps'
|
||||||
:rules="[(val:string) => !!val || `${'กรุณาเลือก เขต / อำเภอ'}`]"
|
)" />
|
||||||
:outlined="edit"
|
|
||||||
dense
|
|
||||||
lazy-rules
|
|
||||||
v-model="addressData.registDistrictId"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
option-label="name"
|
|
||||||
:options="Ops.districtOps"
|
|
||||||
option-value="id"
|
|
||||||
:label="`${'เขต / อำเภอ'}`"
|
|
||||||
@update:model-value="(value:string) => selectDistrict(value, '1')"
|
|
||||||
use-input
|
|
||||||
input-debounce="0"
|
|
||||||
@filter="(inputValue:string,
|
|
||||||
doneFn:Function) => filterSelector(inputValue, doneFn,'districtOps'
|
|
||||||
) "
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||||
<selector
|
<selector :hide-dropdown-icon="!edit" hide-bottom-space :class="getClass(edit)" :readonly="!edit"
|
||||||
:hide-dropdown-icon="!edit"
|
:borderless="!edit" :rules="[(val: string) => !!val || `${'กรุณาเลือก แขวง / ตำบล '}`]" :outlined="edit" dense
|
||||||
hide-bottom-space
|
lazy-rules v-model="registAddress.subDistrictId" emit-value map-options option-label="name"
|
||||||
:class="getClass(edit)"
|
:options="Ops.subdistrictOps" option-value="id" :label="`${'แขวง / ตำบล '}`"
|
||||||
:readonly="!edit"
|
@update:model-value="(value: string) => selectSubDistrict(value, '1')" use-input input-debounce="0" @filter="(inputValue: string,
|
||||||
:borderless="!edit"
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'subdistrictOps'
|
||||||
:rules="[(val:string) => !!val || `${'กรุณาเลือก แขวง / ตำบล '}`]"
|
)" />
|
||||||
:outlined="edit"
|
|
||||||
dense
|
|
||||||
lazy-rules
|
|
||||||
v-model="addressData.registSubDistrictId"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
option-label="name"
|
|
||||||
:options="Ops.subdistrictOps"
|
|
||||||
option-value="id"
|
|
||||||
:label="`${'แขวง / ตำบล '}`"
|
|
||||||
@update:model-value="(value:string) => selectSubDistrict(value, '1')"
|
|
||||||
use-input
|
|
||||||
input-debounce="0"
|
|
||||||
@filter="(inputValue:string,
|
|
||||||
doneFn:Function) => filterSelector(inputValue, doneFn,'subdistrictOps'
|
|
||||||
) "
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-6 col-sm-3 col-md-3">
|
<div class="col-xs-6 col-sm-3 col-md-3">
|
||||||
<q-input
|
<q-input :class="getClass(edit)" hide-bottom-space dense lazy-rules readonly borderless
|
||||||
:class="getClass(edit)"
|
v-model="registAddress.zipCode" :style="!edit ? '' : 'padding:0 12px;'" :label="`${'รหัสไปรษณีย์'}`" />
|
||||||
hide-bottom-space
|
|
||||||
dense
|
|
||||||
lazy-rules
|
|
||||||
readonly
|
|
||||||
borderless
|
|
||||||
v-model="addressData.registZipCode"
|
|
||||||
:style="!edit ? '' : 'padding:0 12px;'"
|
|
||||||
:label="`${'รหัสไปรษณีย์'}`"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 q-pt-lg"><q-separator /></div>
|
<div class="col-12 q-pt-lg"><q-separator /></div>
|
||||||
<div class="col-xs-12 q-gutter-sm items-center flex q-my-sm">
|
<div class="col-xs-12 q-gutter-sm items-center flex q-my-sm">
|
||||||
<label class="text-bold"
|
<label class="text-bold">ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้าน</label>
|
||||||
>ที่อยู่ปัจจุบันตรงกับที่อยู่ตามทะเบียนบ้าน</label
|
<q-radio v-model="addressData.registSame" checked-icon="task_alt" unchecked-icon="panorama_fish_eye" val="1"
|
||||||
>
|
label="ใช่" dense :disable="!edit" />
|
||||||
<q-radio
|
<q-radio v-model="addressData.registSame" checked-icon="task_alt" unchecked-icon="panorama_fish_eye" val="0"
|
||||||
v-model="addressData.registSame"
|
label="ไม่" dense :disable="!edit" />
|
||||||
checked-icon="task_alt"
|
|
||||||
unchecked-icon="panorama_fish_eye"
|
|
||||||
val="1"
|
|
||||||
label="ใช่"
|
|
||||||
dense
|
|
||||||
:disable="!edit"
|
|
||||||
/>
|
|
||||||
<q-radio
|
|
||||||
v-model="addressData.registSame"
|
|
||||||
checked-icon="task_alt"
|
|
||||||
unchecked-icon="panorama_fish_eye"
|
|
||||||
val="0"
|
|
||||||
label="ไม่"
|
|
||||||
dense
|
|
||||||
:disable="!edit"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-12" v-if="addressData.registSame == '0'">
|
<div class="col-xs-12" v-if="addressData.registSame == '0'">
|
||||||
<q-input
|
<q-input :class="getClass(edit)" hide-bottom-space :outlined="edit" dense lazy-rules type="textarea" autogrow
|
||||||
:class="getClass(edit)"
|
:readonly="!edit" :borderless="!edit" v-model="addressData.currentAddress"
|
||||||
hide-bottom-space
|
:rules="[(val: string) => !!val || `${'กรุณากรอก ที่อยู่ปัจจุบัน'}`]" :label="`${'ที่อยู่ปัจจุบัน'}`" />
|
||||||
:outlined="edit"
|
|
||||||
dense
|
|
||||||
lazy-rules
|
|
||||||
type="textarea"
|
|
||||||
autogrow
|
|
||||||
:readonly="!edit"
|
|
||||||
:borderless="!edit"
|
|
||||||
v-model="addressData.currentAddress"
|
|
||||||
:rules="[(val:string) => !!val || `${'กรุณากรอก ที่อยู่ปัจจุบัน'}`]"
|
|
||||||
:label="`${'ที่อยู่ปัจจุบัน'}`"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="col-xs-6 col-sm-3 col-md-3" v-if="addressData.registSame == '0'">
|
||||||
class="col-xs-6 col-sm-3 col-md-3"
|
<selector :hide-dropdown-icon="!edit" hide-bottom-space :class="getClass(edit)" :readonly="!edit"
|
||||||
v-if="addressData.registSame == '0'"
|
:borderless="!edit" :rules="[(val: string) => !!val || `${'กรุณาเลือก จังหวัด'}`]" :outlined="edit" dense
|
||||||
>
|
lazy-rules v-model="currentAddress.provinceId" emit-value map-options option-label="name"
|
||||||
<selector
|
:options="Ops.provinceOps" option-value="id" :label="`${'จังหวัด'}`"
|
||||||
:hide-dropdown-icon="!edit"
|
@update:model-value="(value: string) => selectProvince(value, '2')" use-input input-debounce="0" @filter="(inputValue: string,
|
||||||
hide-bottom-space
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'provinceOps'
|
||||||
:class="getClass(edit)"
|
)" />
|
||||||
:readonly="!edit"
|
|
||||||
:borderless="!edit"
|
|
||||||
:rules="[(val:string) => !!val || `${'กรุณาเลือก จังหวัด'}`]"
|
|
||||||
:outlined="edit"
|
|
||||||
dense
|
|
||||||
lazy-rules
|
|
||||||
v-model="addressData.currentProvinceId"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
option-label="name"
|
|
||||||
:options="Ops.provinceOps"
|
|
||||||
option-value="id"
|
|
||||||
:label="`${'จังหวัด'}`"
|
|
||||||
@update:model-value="(value:string) => selectProvince(value, '2')"
|
|
||||||
use-input
|
|
||||||
input-debounce="0"
|
|
||||||
@filter="(inputValue:string,
|
|
||||||
doneFn:Function) => filterSelector(inputValue, doneFn,'provinceOps'
|
|
||||||
) "
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="col-xs-6 col-sm-3 col-md-3" v-if="addressData.registSame == '0'">
|
||||||
class="col-xs-6 col-sm-3 col-md-3"
|
<selector :hide-dropdown-icon="!edit" hide-bottom-space :class="getClass(edit)" :readonly="!edit"
|
||||||
v-if="addressData.registSame == '0'"
|
:borderless="!edit" :rules="[(val: string) => !!val || `${'กรุณาเลือก เขต / อำเภอ'}`]" :outlined="edit" dense
|
||||||
>
|
lazy-rules v-model="currentAddress.districtId" emit-value map-options option-label="name"
|
||||||
<selector
|
:options="Ops.districtCOps" option-value="id" :label="`${'เขต / อำเภอ'}`"
|
||||||
:hide-dropdown-icon="!edit"
|
@update:model-value="(value: string) => selectDistrict(value, '2')" use-input input-debounce="0" @filter="(inputValue: string,
|
||||||
hide-bottom-space
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'districtCOps'
|
||||||
:class="getClass(edit)"
|
)" />
|
||||||
:readonly="!edit"
|
|
||||||
:borderless="!edit"
|
|
||||||
:rules="[(val:string) => !!val || `${'กรุณาเลือก เขต / อำเภอ'}`]"
|
|
||||||
:outlined="edit"
|
|
||||||
dense
|
|
||||||
lazy-rules
|
|
||||||
v-model="addressData.currentDistrictId"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
option-label="name"
|
|
||||||
:options="Ops.districtCOps"
|
|
||||||
option-value="id"
|
|
||||||
:label="`${'เขต / อำเภอ'}`"
|
|
||||||
@update:model-value="(value:string) => selectDistrict(value, '2')"
|
|
||||||
use-input
|
|
||||||
input-debounce="0"
|
|
||||||
@filter="(inputValue:string,
|
|
||||||
doneFn:Function) => filterSelector(inputValue, doneFn,'districtCOps'
|
|
||||||
) "
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="col-xs-6 col-sm-3 col-md-3" v-if="addressData.registSame == '0'">
|
||||||
class="col-xs-6 col-sm-3 col-md-3"
|
<selector :hide-dropdown-icon="!edit" hide-bottom-space :class="getClass(edit)" :readonly="!edit"
|
||||||
v-if="addressData.registSame == '0'"
|
:borderless="!edit" :rules="[(val: string) => !!val || `${'กรุณาเลือก แขวง / ตำบล '}`]" :outlined="edit" dense
|
||||||
>
|
lazy-rules v-model="currentAddress.subDistrictId" emit-value map-options option-label="name"
|
||||||
<selector
|
:options="Ops.subdistrictCOps" option-value="id" :label="`${'แขวง / ตำบล '}`"
|
||||||
:hide-dropdown-icon="!edit"
|
@update:model-value="(value: string) => selectSubDistrict(value, '2')" use-input input-debounce="0" @filter="(inputValue: string,
|
||||||
hide-bottom-space
|
doneFn: Function) => filterSelector(inputValue, doneFn, 'subdistrictCOps'
|
||||||
:class="getClass(edit)"
|
)" />
|
||||||
:readonly="!edit"
|
|
||||||
:borderless="!edit"
|
|
||||||
:rules="[(val:string) => !!val || `${'กรุณาเลือก แขวง / ตำบล '}`]"
|
|
||||||
:outlined="edit"
|
|
||||||
dense
|
|
||||||
lazy-rules
|
|
||||||
v-model="addressData.currentSubDistrictId"
|
|
||||||
emit-value
|
|
||||||
map-options
|
|
||||||
option-label="name"
|
|
||||||
:options="Ops.subdistrictCOps"
|
|
||||||
option-value="id"
|
|
||||||
:label="`${'แขวง / ตำบล '}`"
|
|
||||||
@update:model-value="(value:string) => selectSubDistrict(value, '2')"
|
|
||||||
use-input
|
|
||||||
input-debounce="0"
|
|
||||||
@filter="(inputValue:string,
|
|
||||||
doneFn:Function) => filterSelector(inputValue, doneFn,'subdistrictCOps'
|
|
||||||
) "
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="col-xs-6 col-sm-3 col-md-3" v-if="addressData.registSame == '0'">
|
||||||
class="col-xs-6 col-sm-3 col-md-3"
|
<q-input :class="getClass(edit)" hide-bottom-space dense lazy-rules readonly borderless
|
||||||
v-if="addressData.registSame == '0'"
|
v-model="currentAddress.zipCode" :style="!edit ? '' : 'padding:0 12px;'" :label="`${'รหัสไปรษณีย์'}`" />
|
||||||
>
|
|
||||||
<q-input
|
|
||||||
:class="getClass(edit)"
|
|
||||||
hide-bottom-space
|
|
||||||
dense
|
|
||||||
lazy-rules
|
|
||||||
readonly
|
|
||||||
borderless
|
|
||||||
v-model="addressData.currentZipCode"
|
|
||||||
:style="!edit ? '' : 'padding:0 12px;'"
|
|
||||||
:label="`${'รหัสไปรษณีย์'}`"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-form>
|
</q-form>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue