Merge branch 'nice_dev' into develop
This commit is contained in:
commit
7a0376e080
9 changed files with 131 additions and 47 deletions
|
|
@ -46,8 +46,6 @@ const { date2Thai, success, messageError, showLoader, hideLoader } = mixin;
|
|||
const edit = ref<boolean>(false);
|
||||
const addressData = ref<AddressType>(props.data);
|
||||
const myform = ref<any>();
|
||||
const codep = ref<string>("");
|
||||
const codec = ref<string>("");
|
||||
const Ops = ref<AddressOps>({
|
||||
provinceOps: [],
|
||||
districtOps: [],
|
||||
|
|
@ -132,7 +130,7 @@ const editData = async () => {
|
|||
registrationSubDistrictId: addressData.value.registSubDistrictId,
|
||||
registrationDistrictId: addressData.value.registDistrictId,
|
||||
registrationProvinceId: addressData.value.registProvinceId,
|
||||
registrationZipCode: codep.value,
|
||||
registrationZipCode: addressData.value.registZipCode,
|
||||
currentAddress:
|
||||
addressData.value.registSame == "1"
|
||||
? addressData.value.registAddress
|
||||
|
|
@ -143,14 +141,16 @@ const editData = async () => {
|
|||
: addressData.value.currentSubDistrictId,
|
||||
currentDistrictId:
|
||||
addressData.value.registSame == "1"
|
||||
? addressData.value.registDistrict
|
||||
? addressData.value.registDistrictId
|
||||
: addressData.value.currentDistrictId,
|
||||
currentProvinceId:
|
||||
addressData.value.registSame == "1"
|
||||
? addressData.value.registProvinceId
|
||||
: addressData.value.currentProvinceId,
|
||||
currentZipCode:
|
||||
addressData.value.registSame == "1" ? codep.value : codec.value,
|
||||
addressData.value.registSame == "1"
|
||||
? addressData.value.registZipCode
|
||||
: addressData.value.currentZipCode,
|
||||
};
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -184,11 +184,11 @@ const selectProvince = async (e: string | null, name: string) => {
|
|||
if (name == "1") {
|
||||
addressData.value.registDistrictId = "";
|
||||
addressData.value.registSubDistrictId = "";
|
||||
codep.value = "";
|
||||
addressData.value.registZipCode = "";
|
||||
} else {
|
||||
addressData.value.currentDistrictId = "";
|
||||
addressData.value.currentSubDistrictId = "";
|
||||
codec.value = "";
|
||||
addressData.value.currentZipCode = "";
|
||||
}
|
||||
myform.value.resetValidation();
|
||||
await fetchDistrict(e, name);
|
||||
|
|
@ -199,10 +199,10 @@ const selectDistrict = async (e: string | null, name: string) => {
|
|||
if (e != null) {
|
||||
if (name == "1") {
|
||||
addressData.value.registSubDistrictId = "";
|
||||
codep.value = "";
|
||||
addressData.value.registZipCode = "";
|
||||
} else {
|
||||
addressData.value.currentSubDistrictId = "";
|
||||
codec.value = "";
|
||||
addressData.value.currentZipCode = "";
|
||||
}
|
||||
myform.value.resetValidation();
|
||||
await fetchSubDistrict(e, name);
|
||||
|
|
@ -214,11 +214,11 @@ const selectSubDistrict = (e: string | null, name: string) => {
|
|||
if (name == "1") {
|
||||
const findcode = Ops.value.subdistrictOps.filter((r) => r.id == e);
|
||||
const namecode = findcode.length > 0 ? findcode[0].zipCode : "";
|
||||
codep.value = namecode;
|
||||
addressData.value.registZipCode = namecode;
|
||||
} else {
|
||||
const findcode = Ops.value.subdistrictCOps.filter((r) => r.id == e);
|
||||
const namecode = findcode.length > 0 ? findcode[0].zipCode : "";
|
||||
codec.value = namecode;
|
||||
addressData.value.currentZipCode = namecode;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -440,7 +440,7 @@ const getClass = (val: boolean) => {
|
|||
lazy-rules
|
||||
readonly
|
||||
borderless
|
||||
v-model="codep"
|
||||
v-model="addressData.registZipCode"
|
||||
:style="!edit ? '' : 'padding:0 12px;'"
|
||||
:label="`${'รหัสไปรษณีย์'}`"
|
||||
/>
|
||||
|
|
@ -584,7 +584,7 @@ const getClass = (val: boolean) => {
|
|||
lazy-rules
|
||||
readonly
|
||||
borderless
|
||||
v-model="codec"
|
||||
v-model="addressData.currentZipCode"
|
||||
:style="!edit ? '' : 'padding:0 12px;'"
|
||||
:label="`${'รหัสไปรษณีย์'}`"
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue