ปรับ UI หน้าจอแก้ไขข้อมูลส่วนตัวของผู้สอบผ่านให้ตรงกับ Req. #25
This commit is contained in:
parent
b9c272a49d
commit
95a20c7050
11 changed files with 1351 additions and 1454 deletions
|
|
@ -348,56 +348,56 @@ const fetchData = async () => {
|
|||
};
|
||||
|
||||
const editData = async () => {
|
||||
const body: ResponseObject = {
|
||||
registrationSame: addressData.value.same == "1",
|
||||
registrationAddress: addressData.value.address,
|
||||
registrationSubDistrictId: addressData.value.subdistrictId,
|
||||
registrationDistrictId: addressData.value.districtId,
|
||||
registrationProvinceId: addressData.value.provinceId,
|
||||
registrationZipCode: codep.value,
|
||||
currentAddress:
|
||||
addressData.value.same == "1"
|
||||
? addressData.value.address
|
||||
: addressData.value.addressC,
|
||||
currentSubDistrictId:
|
||||
addressData.value.same == "1"
|
||||
? addressData.value.subdistrictId
|
||||
: addressData.value.subdistrictIdC,
|
||||
currentDistrictId:
|
||||
addressData.value.same == "1"
|
||||
? addressData.value.districtId
|
||||
: addressData.value.districtIdC,
|
||||
currentProvinceId:
|
||||
addressData.value.same == "1"
|
||||
? addressData.value.provinceId
|
||||
: addressData.value.provinceIdC,
|
||||
currentZipCode: addressData.value.same == "1" ? codep.value : codec.value,
|
||||
createdAt: new Date(),
|
||||
createdFullName: "-",
|
||||
};
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.profileAdrsId(route.params.id.toString()), body)
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
edit.value = false;
|
||||
emit("update:statusEdit", false);
|
||||
await getNewData();
|
||||
});
|
||||
// const body: ResponseObject = {
|
||||
// registrationSame: addressData.value.same == "1",
|
||||
// registrationAddress: addressData.value.address,
|
||||
// registrationSubDistrictId: addressData.value.subdistrictId,
|
||||
// registrationDistrictId: addressData.value.districtId,
|
||||
// registrationProvinceId: addressData.value.provinceId,
|
||||
// registrationZipCode: codep.value,
|
||||
// currentAddress:
|
||||
// addressData.value.same == "1"
|
||||
// ? addressData.value.address
|
||||
// : addressData.value.addressC,
|
||||
// currentSubDistrictId:
|
||||
// addressData.value.same == "1"
|
||||
// ? addressData.value.subdistrictId
|
||||
// : addressData.value.subdistrictIdC,
|
||||
// currentDistrictId:
|
||||
// addressData.value.same == "1"
|
||||
// ? addressData.value.districtId
|
||||
// : addressData.value.districtIdC,
|
||||
// currentProvinceId:
|
||||
// addressData.value.same == "1"
|
||||
// ? addressData.value.provinceId
|
||||
// : addressData.value.provinceIdC,
|
||||
// currentZipCode: addressData.value.same == "1" ? codep.value : codec.value,
|
||||
// createdAt: new Date(),
|
||||
// createdFullName: "-",
|
||||
// };
|
||||
// showLoader();
|
||||
// await http
|
||||
// .put(config.API.profileAdrsId(route.params.id.toString()), body)
|
||||
// .then((res) => {
|
||||
// success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// edit.value = false;
|
||||
// emit("update:statusEdit", false);
|
||||
// await getNewData();
|
||||
// });
|
||||
};
|
||||
|
||||
const saveData = async () => {
|
||||
await myform.value.validate().then(async (success: boolean) => {
|
||||
if (success) {
|
||||
await editData();
|
||||
} else {
|
||||
}
|
||||
});
|
||||
// await myform.value.validate().then(async (success: boolean) => {
|
||||
// if (success) {
|
||||
// await editData();
|
||||
// } else {
|
||||
// }
|
||||
// });
|
||||
};
|
||||
|
||||
const selectProvince = async (e: string | null, name: string) => {
|
||||
|
|
@ -546,13 +546,13 @@ const getClass = (val: boolean) => {
|
|||
};
|
||||
</script>
|
||||
<template>
|
||||
<q-card flat 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
|
||||
v-model:edit="edit"
|
||||
header="ข้อมูลที่อยู่"
|
||||
icon="mdi-map-marker"
|
||||
:save="saveData"
|
||||
:history="true"
|
||||
:history="false"
|
||||
:changeBtn="changeBtn"
|
||||
:disable="statusEdit"
|
||||
:cancel="refreshData"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue