ปรับหน้ารายละเอียดของผู้สอบผ่าน เเก้เป็นส่ง name แทน id

This commit is contained in:
STW_TTTY\stwtt 2024-05-16 15:43:18 +07:00
parent 507c94b955
commit 15738c7668
6 changed files with 33 additions and 27 deletions

View file

@ -129,12 +129,11 @@ const fetchData = async () => {
InformationData.value.lastname = data.lastname;
InformationData.value.nationality = data.nationality;
InformationData.value.race = data.race;
InformationData.value.genderId = guidCheck(data.genderId) ?? "";
InformationData.value.prefixId = guidCheck(data.prefixId) ?? "";
InformationData.value.relationshipId =
guidCheck(data.relationshipId) ?? "";
InformationData.value.religionId = guidCheck(data.religionId) ?? "";
InformationData.value.bloodGroupId = guidCheck(data.bloodGroupId) ?? "";
InformationData.value.genderId = guidCheck(data.gender) ?? "";
InformationData.value.prefixId = guidCheck(data.prefix) ?? "";
InformationData.value.relationshipId = guidCheck(data.relationship) ?? "";
InformationData.value.religionId = guidCheck(data.religion) ?? "";
InformationData.value.bloodGroupId = guidCheck(data.bloodGroup) ?? "";
InformationData.value.dateOfBirth = new Date(data.dateOfBirth);
InformationData.value.age = data.age;
InformationData.value.telephone = data.telephone;
@ -165,17 +164,17 @@ const fetchData = async () => {
FamilyData.value.couple = data.couple ? "1" : "0";
FamilyData.value.marryPrefix = data.marryPrefix ?? "";
FamilyData.value.marryPrefixId = guidCheck(data.marryPrefixId) ?? "";
FamilyData.value.marryPrefixId = guidCheck(data.marryPrefix) ?? "";
FamilyData.value.marryFirstName = data.marryFirstName ?? "";
FamilyData.value.marryLastName = data.marryLastName ?? "";
FamilyData.value.marryOccupation = data.marryOccupation ?? "";
FamilyData.value.fatherPrefix = data.fatherPrefix ?? "";
FamilyData.value.fatherPrefixId = guidCheck(data.fatherPrefixId) ?? "";
FamilyData.value.fatherPrefixId = guidCheck(data.fatherPrefix) ?? "";
FamilyData.value.fatherFirstName = data.fatherFirstName ?? "";
FamilyData.value.fatherLastName = data.fatherLastName ?? "";
FamilyData.value.fatherOccupation = data.fatherOccupation ?? "";
FamilyData.value.motherPrefix = data.motherPrefix ?? "";
FamilyData.value.motherPrefixId = guidCheck(data.motherPrefixId) ?? "";
FamilyData.value.motherPrefixId = guidCheck(data.motherPrefix) ?? "";
FamilyData.value.motherFirstName = data.motherFirstName ?? "";
FamilyData.value.motherLastName = data.motherLastName ?? "";
FamilyData.value.motherOccupation = data.motherOccupation ?? "";

View file

@ -291,7 +291,7 @@ onMounted(async () => {
const fetchLevel = async () => {
showLoader();
await http
.get(config.API.educationLevel)
.get(config.API.orgEducationLevel)
.then((res) => {
const data = res.data.result;
let option: optionData[] = [];
@ -774,6 +774,7 @@ const getClass = (val: boolean) => {
</ProfileTable>
</q-form>
</q-card>
<q-dialog v-model="modal" persistent>
<q-card style="width: 600px">
<q-form ref="myForm" greedy @submit.prevent @validation-success="clickSave">

View file

@ -247,7 +247,7 @@ const selectSubDistrict = (e: string | null, name: string) => {
const fetchProvince = async () => {
showLoader();
await http
.get(config.API.province)
.get(config.API.orgProvince)
.then(async (res) => {
const data = res.data.result;
let option: optionData[] = [];
@ -326,9 +326,9 @@ const fetchDistrict = async (id: string | null, position: string) => {
if (id != null && id != "") {
showLoader();
await http
.get(config.API.listDistrict(id))
.get(config.API.orgProvince+`/${id}`)
.then(async (res) => {
const data = res.data.result;
const data = res.data.result.districts;
let option: optionData[] = [];
data.map((r: any) => {
option.push({ id: r.id.toString(), name: r.name.toString() });
@ -372,9 +372,9 @@ const fetchSubDistrict = async (id: string | null, position: string) => {
if (id != null && id != "") {
showLoader();
await http
.get(config.API.listSubDistrict(id))
.get(config.API.orgDistrict+`/${id}`)
.then(async (res) => {
const data = res.data.result;
const data = res.data.result.subDistricts;
let option: zipCodeOption[] = [];
data.map((r: any) => {
option.push({

View file

@ -81,12 +81,12 @@ const refreshData = async () => {
const fetchPrefix = async () => {
showLoader();
await http
.get(config.API.prefix)
.get(config.API.profileNewMetaMain)
.then((res) => {
const data = res.data.result;
let option: DataOption[] = [];
data.map((r: any) => {
option.push({ id: r.id.toString(), name: r.name.toString() });
data.prefixs.map((r: any) => {
option.push({ id: r.name.toString(), name: r.name.toString() });
});
Ops.value.prefixOps = option;
OpsFilter.value.prefixOps = option;

View file

@ -112,53 +112,59 @@ const onCancel = async () => {
const fetchPerson = async () => {
showLoader();
await http
.get(config.API.person)
.get(config.API.profileNewMetaMain)
.then((res) => {
const data = res.data.result;
//
let optionbloodGroups: optionData[] = [];
data.bloodGroups.map((r: any) => {
optionbloodGroups.push({
id: r.id ?? "",
id: r.name ?? "",
name: r.name ?? "",
});
});
Ops.value.bloodOps = optionbloodGroups;
OpsFilter.value.bloodOps = optionbloodGroups;
//
let optiongenders: optionData[] = [];
data.genders.map((r: any) => {
optiongenders.push({
id: r.id ?? "",
id: r.name ?? "",
name: r.name ?? "",
});
});
Ops.value.genderOps = optiongenders;
OpsFilter.value.genderOps = optiongenders;
//
let optionprefixs: optionData[] = [];
data.prefixs.map((r: any) => {
optionprefixs.push({
id: r.id ?? "",
id: r.name ?? "",
name: r.name ?? "",
});
});
Ops.value.prefixOps = optionprefixs;
OpsFilter.value.prefixOps = optionprefixs;
//
let optionrelationships: optionData[] = [];
data.relationships.map((r: any) => {
optionrelationships.push({
id: r.id ?? "",
id: r.name ?? "",
name: r.name ?? "",
});
});
Ops.value.statusOps = optionrelationships;
OpsFilter.value.statusOps = optionrelationships;
//
let optionreligions: optionData[] = [];
data.religions.map((r: any) => {
optionreligions.push({
id: r.id ?? "",
id: r.name ?? "",
name: r.name ?? "",
});
});

View file

@ -142,10 +142,10 @@ interface Address {
}
interface AddressData {
subDistrictId: string;
subDistrictId: any;
zipCode: string;
districtId: string;
provinceId: string;
districtId: any;
provinceId: any;
}
interface Certificate {