updated req update profile
This commit is contained in:
parent
3c83bc8306
commit
f36e8e720c
3 changed files with 89 additions and 65 deletions
|
|
@ -128,7 +128,7 @@ watch(
|
|||
:rules="[(val: string) => !!val || `${'กรุณากรอก คำนำหน้าชื่อ'}`]"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-3">
|
||||
<!-- <div class="col-xs-6 col-sm-6 col-md-3">
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -137,7 +137,7 @@ watch(
|
|||
class="inputgreen"
|
||||
:label="dataLabel.rank"
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="col-xs-6 col-sm-6 col-md-3">
|
||||
<q-input
|
||||
dense
|
||||
|
|
@ -247,7 +247,7 @@ watch(
|
|||
:label="dataLabel.nationality"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-3">
|
||||
<!-- <div class="col-xs-6 col-sm-6 col-md-3">
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -267,8 +267,8 @@ watch(
|
|||
class="inputgreen"
|
||||
:label="dataLabel.religion"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-3">
|
||||
</div> -->
|
||||
<!-- <div class="col-xs-6 col-sm-6 col-md-3">
|
||||
<q-input
|
||||
dense
|
||||
outlined
|
||||
|
|
@ -277,6 +277,6 @@ watch(
|
|||
class="inputgreen"
|
||||
:label="dataLabel.bloodGroup"
|
||||
/>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -159,12 +159,12 @@ function onSubmit() {
|
|||
registrationProvinceId: formDataAddress.registrationProvinceId,
|
||||
registrationAddress: formDataAddress.registrationAddress,
|
||||
|
||||
bloodGroup: formInformations.bloodGroup,
|
||||
// bloodGroup: formInformations.bloodGroup,
|
||||
relationship: formInformations.relationship,
|
||||
gender: formInformations.gender,
|
||||
religion: formInformations.religion,
|
||||
// religion: formInformations.religion,
|
||||
nationality: formInformations.nationality,
|
||||
ethnicity: formInformations.ethnicity,
|
||||
// ethnicity: formInformations.ethnicity,
|
||||
birthDate: formInformations.birthDate,
|
||||
lastName: formInformations.lastName,
|
||||
firstName: formInformations.firstName,
|
||||
|
|
@ -174,7 +174,10 @@ function onSubmit() {
|
|||
showLoader();
|
||||
http
|
||||
.patch(
|
||||
config.API.requestInformationbyType("myprofile", storeRequestEdit.profileId),
|
||||
config.API.requestInformationbyType(
|
||||
"myprofile",
|
||||
storeRequestEdit.profileId
|
||||
),
|
||||
body
|
||||
)
|
||||
.then(async (res) => {
|
||||
|
|
@ -195,51 +198,55 @@ async function amiRequest() {
|
|||
data.value = profile;
|
||||
} else {
|
||||
data.value = {
|
||||
titleCode: 3,
|
||||
titleDesc: "นาย",
|
||||
titleName: "นาย",
|
||||
titleSex: 1,
|
||||
firstName: "ชัยชนะ",
|
||||
middleName: "",
|
||||
lastName: "เรืองโรจน์",
|
||||
genderCode: 1,
|
||||
genderDesc: "ชาย",
|
||||
dateOfBirth: 25211228,
|
||||
nationalityCode: 99,
|
||||
nationalityDesc: "ไทย",
|
||||
ownerStatusDesc: "เจ้าบ้าน",
|
||||
statusOfPersonCode: 0,
|
||||
statusOfPersonDesc: "บุคคลนี้มีภูมิลำเนาอยู่ในบ้านนี้",
|
||||
dateOfMoveIn: 25580728,
|
||||
age: 45,
|
||||
|
||||
fatherPersonalID: 3102100621479,
|
||||
fatherName: "บุญเชิด",
|
||||
fatherNationalityCode: 99,
|
||||
fatherNationalityDesc: "ไทย",
|
||||
|
||||
motherPersonalID: 3102100621487,
|
||||
motherName: "พยอม",
|
||||
motherNationalityCode: 99,
|
||||
motherNationalityDesc: "ไทย",
|
||||
|
||||
fullnameAndRank: "นายสุพลชัย พูลสวัสดิ์",
|
||||
englishTitleDesc: "MR.",
|
||||
englishFirstName: "SUPHONCHAI",
|
||||
englishMiddleName: "",
|
||||
englishLastName: "PHOONSAWAT",
|
||||
|
||||
registrationAddress: "1220-1222 ถนนเพชรบุรี",
|
||||
registrationProvinceId: "24bf701c-33d6-436e-ad49-6f82bb3ae017",
|
||||
registrationDistrictId: "34bf701c-33d6-436e-ad49-6f82bb3b0586",
|
||||
registrationSubDistrictId: "44bf701c-33d6-436e-ad49-6f82bb3b5649",
|
||||
registrationZipCode: "10400",
|
||||
currentAddress: "1220-1222 ถนนเพชรบุรี",
|
||||
currentProvinceId: "24bf701c-33d6-436e-ad49-6f82bb3ae017",
|
||||
currentDistrictId: "34bf701c-33d6-436e-ad49-6f82bb3b0586",
|
||||
currentSubDistrictId: "44bf701c-33d6-436e-ad49-6f82bb3b5649",
|
||||
currentZipCode: "10400",
|
||||
// titleCode: 3,
|
||||
// titleDesc: "นาย",
|
||||
titleName: "นาย", // use
|
||||
// titleSex: 1,
|
||||
firstName: "ชัยชนะ", // use
|
||||
middleName: "", // use
|
||||
lastName: "เรืองโรจน์", // use
|
||||
// genderCode: 1,
|
||||
genderDesc: "ชาย", // use
|
||||
dateOfBirth: 25211228, // use
|
||||
// nationalityCode: 99,
|
||||
nationalityDesc: "ไทย", // use
|
||||
// ownerStatusDesc: "เจ้าบ้าน",
|
||||
// statusOfPersonCode: 0,
|
||||
// statusOfPersonDesc: "บุคคลนี้มีภูมิลำเนาอยู่ในบ้านนี้",
|
||||
// dateOfMoveIn: 25580728,
|
||||
// age: 45,
|
||||
};
|
||||
|
||||
const address = {
|
||||
// houseID: 12020203651,
|
||||
houseNo: "62/25", // use
|
||||
// houseType: 1,
|
||||
// houseTypeDesc: "บ้าน",
|
||||
villageNo: 5, // use
|
||||
// alleyWayCode: 0,
|
||||
alleyWayDesc: null, // use
|
||||
// alleyCode: 0,
|
||||
alleyDesc: null, // use
|
||||
// roadCode: 3,
|
||||
roadDesc: "เทอดพระเกียรติ", // use
|
||||
// subdistrictCode: 1,
|
||||
subdistrictDesc: "วัดชลอ", // use
|
||||
// districtCode: 2,
|
||||
districtDesc: "บางกรวย", // use
|
||||
// provinceCode: 12,
|
||||
provinceDesc: "นนทบุรี", // use
|
||||
// rcodeCode: "1296",
|
||||
// rcodeDesc: "ท้องถิ่นเทศบาลเมืองบางกรวย",
|
||||
// dateOfTerminate: 0,
|
||||
// alleyWayEnglishDesc: null,
|
||||
// alleyEnglishDesc: null,
|
||||
// roadEnglishDesc: "Terdpragied",
|
||||
// subdistrictEnglishDesc: "Wat Chalo",
|
||||
// districtEnglishDesc: "Bang Kruai",
|
||||
// provinceEnglishDesc: "Nonthaburi",
|
||||
};
|
||||
|
||||
data.value = { ...data.value, ...address };
|
||||
}
|
||||
formInformations.citizenId = idCard.value;
|
||||
formInformations.prefix = data.value.titleName;
|
||||
|
|
@ -247,16 +254,34 @@ async function amiRequest() {
|
|||
formInformations.firstName = data.value.firstName;
|
||||
formInformations.lastName = data.value.lastName;
|
||||
formInformations.nationality = data.value.nationalityDesc;
|
||||
|
||||
// แปลง dateOfBirth เป็น format 1989-01-01
|
||||
formInformations.birthDate = data.value.dateOfBirth;
|
||||
age.value = storeLinkCenter.calculateAge(data.value.age);
|
||||
formInformations.gender = data.value.genderDesc;
|
||||
|
||||
formDataAddress.registrationAddress = data.value.registrationAddress;
|
||||
formDataAddress.registrationProvinceId = data.value.registrationProvinceId;
|
||||
formDataAddress.registrationDistrictId = data.value.registrationDistrictId;
|
||||
formDataAddress.registrationSubDistrictId =
|
||||
data.value.registrationSubDistrictId;
|
||||
formDataAddress.registrationZipCode = data.value.registrationZipCode;
|
||||
let registrationAddress = data.value.houseNo ? data.value.houseNo : "";
|
||||
registrationAddress += data.value.villageNo
|
||||
? ` หมู่ ${data.value.villageNo}`
|
||||
: "";
|
||||
registrationAddress += data.value.alleyWayDesc
|
||||
? ` ${data.value.alleyWayDesc}`
|
||||
: "";
|
||||
registrationAddress += data.value.roadDesc
|
||||
? `ถนน ${data.value.roadDesc}`
|
||||
: "";
|
||||
formDataAddress.registrationAddress = registrationAddress;
|
||||
|
||||
// ค้นหา จังหวัด อำเภอ ตำบล และรหัสไปรษณื
|
||||
// formDataAddress.registrationProvinceId = data.value.registrationProvinceId;
|
||||
// formDataAddress.registrationDistrictId = data.value.registrationDistrictId;
|
||||
// formDataAddress.registrationSubDistrictId =
|
||||
// data.value.registrationSubDistrictId;
|
||||
// formDataAddress.registrationZipCode = data.value.registrationZipCode;
|
||||
|
||||
console.log("province===>", data.value.provinceDesc);
|
||||
console.log("district===>", data.value.districtDesc);
|
||||
console.log("subdistrict===>", data.value.subdistrictDesc);
|
||||
}
|
||||
|
||||
watch(
|
||||
|
|
@ -300,7 +325,6 @@ watch(
|
|||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||
<Header tittle="ขอปรับปรุงข้อมูลจากกรมการปกครอง" :close="closeDialog" />
|
||||
<q-separator />
|
||||
|
||||
<q-card-section class="scroll" style="max-height: 80vh">
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@ interface RequestObject {
|
|||
// posLevelId: string;
|
||||
// posTypeId: string;
|
||||
prefix: string;
|
||||
rank: string | null;
|
||||
relationship: string | null;
|
||||
religion: string | null;
|
||||
phone: string | null;
|
||||
rank?: string | null;
|
||||
relationship?: string | null;
|
||||
religion?: string | null;
|
||||
phone?: string | null;
|
||||
// telephoneNumber: string | null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue