ต่อ api บุคคลที่สามารถติดต่อได้
This commit is contained in:
parent
a022234412
commit
f45af7bb86
12 changed files with 449 additions and 178 deletions
|
|
@ -215,11 +215,6 @@
|
|||
>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-5 text-grey-7">ลำดับที่สอบได้</div>
|
||||
<div class="col-xs-6 col-sm-7 q-pr-xs">
|
||||
{{ number }}
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-5 text-grey-7">
|
||||
วันหมดอายุบัญชีคัดเลือกคนพิการ
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
v-model:formInformation="formInformation"
|
||||
v-model:formAddress="formAddress"
|
||||
v-model:formOccupation="formOccupation"
|
||||
v-model:formContact="formContact"
|
||||
v-model:formEducation="formEducation"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -131,6 +132,7 @@ import Profile from "@/modules/03_recruiting/components/Profile.vue";
|
|||
import {
|
||||
defaultInformation,
|
||||
defaultOccupation,
|
||||
defaultContact,
|
||||
defaultAddress,
|
||||
defaultEducation,
|
||||
} from "@/modules/03_recruiting/interface/index/Main";
|
||||
|
|
@ -143,7 +145,14 @@ import config from "@/app.config";
|
|||
const router = useRouter();
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
const { success, dateToISO, messageError, showLoader, hideLoader } = mixin;
|
||||
const {
|
||||
success,
|
||||
dateToISO,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
notifyError,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const examId = ref<string>(route.params.examId.toString());
|
||||
const candidateId = ref<string>(route.params.candidateId.toString());
|
||||
|
|
@ -154,6 +163,7 @@ const formInformation = ref<any>({});
|
|||
const formAddress = ref<any>({});
|
||||
const formEducation = ref<any>({});
|
||||
const formOccupation = ref<any>({});
|
||||
const formContact = ref<any>({});
|
||||
const status = ref<string>("");
|
||||
|
||||
onMounted(async () => {
|
||||
|
|
@ -240,80 +250,106 @@ const clickSave = async () => {
|
|||
.validate()
|
||||
.then(async (suc: boolean) => {
|
||||
if (suc) {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.candidateId(candidateId.value), {
|
||||
prefixId: defaultInformation.value.prefixId,
|
||||
lastName: defaultInformation.value.lastname,
|
||||
dateOfBirth:
|
||||
defaultInformation.value.birthDate == null
|
||||
? null
|
||||
: dateToISO(defaultInformation.value.birthDate),
|
||||
citizenId: defaultInformation.value.cardid,
|
||||
firstName: defaultInformation.value.firstname,
|
||||
religionId: defaultInformation.value.religionId,
|
||||
nationality: defaultInformation.value.nationality,
|
||||
email: defaultInformation.value.email,
|
||||
mobilePhone: defaultInformation.value.phone,
|
||||
telephone: defaultInformation.value.tel,
|
||||
knowledge: defaultInformation.value.knowledge,
|
||||
occupationOrg: defaultOccupation.value.org,
|
||||
occupationPile: defaultOccupation.value.pile,
|
||||
occupationGroup: defaultOccupation.value.group,
|
||||
occupationSalary: defaultOccupation.value.salary,
|
||||
occupationPosition: defaultOccupation.value.position,
|
||||
occupationPositionType:
|
||||
defaultOccupation.value.positionType,
|
||||
occupationTelephone: defaultOccupation.value.tel,
|
||||
registAddress: defaultAddress.value.address,
|
||||
currentAddress: defaultAddress.value.addressC,
|
||||
registProvinceId: defaultAddress.value.provinceId,
|
||||
currentProvinceId: defaultAddress.value.provinceIdC,
|
||||
registDistrictId: defaultAddress.value.districtId,
|
||||
currentDistrictId: defaultAddress.value.districtIdC,
|
||||
registSubDistrictId: defaultAddress.value.subdistrictId,
|
||||
currentSubDistrictId:
|
||||
defaultAddress.value.subdistrictIdC,
|
||||
registZipCode: defaultAddress.value.code,
|
||||
currentZipCode: defaultAddress.value.codeC,
|
||||
registSame:
|
||||
defaultAddress.value.same == "1"
|
||||
? true
|
||||
: defaultAddress.value.same == "0"
|
||||
? false
|
||||
: null,
|
||||
educationLevelExamId:
|
||||
defaultEducation.value.educationLevelExamId,
|
||||
educationName: defaultEducation.value.educationName,
|
||||
educationMajor: defaultEducation.value.educationMajor,
|
||||
educationLocation:
|
||||
defaultEducation.value.educationLocation,
|
||||
educationType: defaultEducation.value.educationType,
|
||||
educationEndDate:
|
||||
defaultEducation.value.educationEndDate == null
|
||||
? null
|
||||
: dateToISO(
|
||||
defaultEducation.value.educationEndDate
|
||||
),
|
||||
educationScores: defaultEducation.value.educationScores,
|
||||
educationLevelHighId:
|
||||
defaultEducation.value.educationLevelHighId,
|
||||
})
|
||||
.then(async () => {
|
||||
success($q, "บันทึกข้อมูลส่วนตัวสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
await formContact.value
|
||||
.validate()
|
||||
.then(async (suc: boolean) => {
|
||||
if (suc) {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.candidateId(candidateId.value), {
|
||||
prefixId: defaultInformation.value.prefixId,
|
||||
lastName: defaultInformation.value.lastname,
|
||||
dateOfBirth:
|
||||
defaultInformation.value.birthDate == null
|
||||
? null
|
||||
: dateToISO(
|
||||
defaultInformation.value.birthDate
|
||||
),
|
||||
citizenId: defaultInformation.value.cardid,
|
||||
firstName: defaultInformation.value.firstname,
|
||||
religionId: defaultInformation.value.religionId,
|
||||
nationality: defaultInformation.value.nationality,
|
||||
email: defaultInformation.value.email,
|
||||
mobilePhone: defaultInformation.value.phone,
|
||||
telephone: defaultInformation.value.tel,
|
||||
knowledge: defaultInformation.value.knowledge,
|
||||
occupationOrg: defaultOccupation.value.org,
|
||||
occupationPile: defaultOccupation.value.pile,
|
||||
occupationGroup: defaultOccupation.value.group,
|
||||
occupationSalary: defaultOccupation.value.salary,
|
||||
occupationPosition:
|
||||
defaultOccupation.value.position,
|
||||
occupationPositionType:
|
||||
defaultOccupation.value.positionType,
|
||||
occupationTelephone: defaultOccupation.value.tel,
|
||||
registAddress: defaultAddress.value.address,
|
||||
currentAddress: defaultAddress.value.addressC,
|
||||
registProvinceId: defaultAddress.value.provinceId,
|
||||
currentProvinceId:
|
||||
defaultAddress.value.provinceIdC,
|
||||
registDistrictId: defaultAddress.value.districtId,
|
||||
currentDistrictId:
|
||||
defaultAddress.value.districtIdC,
|
||||
registSubDistrictId:
|
||||
defaultAddress.value.subdistrictId,
|
||||
currentSubDistrictId:
|
||||
defaultAddress.value.subdistrictIdC,
|
||||
registZipCode: defaultAddress.value.code,
|
||||
currentZipCode: defaultAddress.value.codeC,
|
||||
registSame:
|
||||
defaultAddress.value.same == "1"
|
||||
? true
|
||||
: defaultAddress.value.same == "0"
|
||||
? false
|
||||
: null,
|
||||
educationLevelExamId:
|
||||
defaultEducation.value.educationLevelExamId,
|
||||
educationName:
|
||||
defaultEducation.value.educationName,
|
||||
educationMajor:
|
||||
defaultEducation.value.educationMajor,
|
||||
educationLocation:
|
||||
defaultEducation.value.educationLocation,
|
||||
educationType:
|
||||
defaultEducation.value.educationType,
|
||||
educationEndDate:
|
||||
defaultEducation.value.educationEndDate == null
|
||||
? null
|
||||
: dateToISO(
|
||||
defaultEducation.value.educationEndDate
|
||||
),
|
||||
educationScores:
|
||||
defaultEducation.value.educationScores,
|
||||
educationLevelHighId:
|
||||
defaultEducation.value.educationLevelHighId,
|
||||
})
|
||||
.then(async () => {
|
||||
success($q, "บันทึกข้อมูลส่วนตัวสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
});
|
||||
} else {
|
||||
notifyError($q, "กรุณากรอกข้อมูลให้ครบถ้วน");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
notifyError($q, "กรุณากรอกข้อมูลให้ครบถ้วน");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
notifyError($q, "กรุณากรอกข้อมูลให้ครบถ้วน");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
notifyError($q, "กรุณากรอกข้อมูลให้ครบถ้วน");
|
||||
}
|
||||
});
|
||||
} else {
|
||||
notifyError($q, "กรุณากรอกข้อมูลให้ครบถ้วน");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ const visibleColumns = ref<String[]>([
|
|||
"no",
|
||||
"number",
|
||||
"position",
|
||||
"positionLevel",
|
||||
// "positionLevel",
|
||||
"registerDate",
|
||||
"examIdenNumber",
|
||||
"seatNumber",
|
||||
|
|
@ -346,15 +346,15 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px; min-width: 200px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
{
|
||||
name: "positionLevel",
|
||||
align: "left",
|
||||
label: "ระดับ",
|
||||
sortable: true,
|
||||
field: "positionLevel",
|
||||
headerStyle: "font-size: 14px; min-width: 200px",
|
||||
style: "font-size: 14px; ",
|
||||
},
|
||||
// {
|
||||
// name: "positionLevel",
|
||||
// align: "left",
|
||||
// label: "ระดับ",
|
||||
// sortable: true,
|
||||
// field: "positionLevel",
|
||||
// headerStyle: "font-size: 14px; min-width: 200px",
|
||||
// style: "font-size: 14px; ",
|
||||
// },
|
||||
{
|
||||
name: "citizenId",
|
||||
align: "left",
|
||||
|
|
@ -489,7 +489,9 @@ const fetchData = async () => {
|
|||
pass: r.pass,
|
||||
email: r.email,
|
||||
status: r.status,
|
||||
position: r.positionExam == null ? "-" : r.positionExam.positionName,
|
||||
position: `${
|
||||
r.positionExam == null ? "-" : r.positionExam.positionName
|
||||
}${r.positionExam == null ? "-" : r.positionExam.positionLevelName}`,
|
||||
positionLevel:
|
||||
r.positionExam == null ? "-" : r.positionExam.positionLevelName,
|
||||
check: false,
|
||||
|
|
|
|||
|
|
@ -23,8 +23,15 @@ import { useQuasar } from "quasar";
|
|||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
||||
|
||||
const { date2Thai, messageError, showLoader, hideLoader, dialogMessageNotify,dialogConfirm ,dialogRemove} =
|
||||
mixin;
|
||||
const {
|
||||
date2Thai,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogMessageNotify,
|
||||
dialogConfirm,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
const previous = ref<boolean>(false);
|
||||
const next = ref<boolean>(false);
|
||||
const addDialog = ref<boolean>(false);
|
||||
|
|
@ -192,8 +199,7 @@ const selectData = (id: string, agency: boolean) => {
|
|||
};
|
||||
|
||||
const editDialog = () => {
|
||||
|
||||
inputName.value = inputNameBack.value
|
||||
inputName.value = inputNameBack.value;
|
||||
|
||||
editvisible.value = !editvisible.value;
|
||||
};
|
||||
|
|
@ -236,7 +242,7 @@ const saveAdd = async () => {
|
|||
name: inputName.value,
|
||||
link: inputLink.value,
|
||||
});
|
||||
await saveDataAgency(arrData,'');
|
||||
await saveDataAgency(arrData, "");
|
||||
dialog.value = false;
|
||||
} else {
|
||||
let arrData: DataLink[] = [];
|
||||
|
|
@ -250,14 +256,14 @@ const saveAdd = async () => {
|
|||
name: inputName.value,
|
||||
link: inputLink.value,
|
||||
});
|
||||
await saveDataGoverment(arrData,'');
|
||||
await saveDataGoverment(arrData, "");
|
||||
dialog.value = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const saveDelete = async (del:string) => {
|
||||
const saveDelete = async (del: string) => {
|
||||
if (agencyRow.value) {
|
||||
const filt = cmsAgency.value.filter((r: any) => r.id != idRow.value);
|
||||
let arrData: DataLink[] = [];
|
||||
|
|
@ -267,7 +273,7 @@ const saveDelete = async (del:string) => {
|
|||
link: r.link,
|
||||
});
|
||||
});
|
||||
await saveDataAgency(arrData,del);
|
||||
await saveDataAgency(arrData, del);
|
||||
dialog.value = false;
|
||||
} else {
|
||||
const filt = cmsGoverment.value.filter((r: any) => r.id != idRow.value);
|
||||
|
|
@ -278,7 +284,7 @@ const saveDelete = async (del:string) => {
|
|||
link: r.link,
|
||||
});
|
||||
});
|
||||
await saveDataGoverment(arrData,del);
|
||||
await saveDataGoverment(arrData, del);
|
||||
dialog.value = false;
|
||||
}
|
||||
};
|
||||
|
|
@ -299,7 +305,7 @@ const saveEdit = async () => {
|
|||
});
|
||||
}
|
||||
});
|
||||
await saveDataAgency(arrData,'');
|
||||
await saveDataAgency(arrData, "");
|
||||
dialog.value = false;
|
||||
} else {
|
||||
let arrData: DataLink[] = [];
|
||||
|
|
@ -316,66 +322,65 @@ const saveEdit = async () => {
|
|||
});
|
||||
}
|
||||
});
|
||||
await saveDataGoverment(arrData,'');
|
||||
|
||||
await saveDataGoverment(arrData, "");
|
||||
}
|
||||
};
|
||||
|
||||
const saveDataAgency = async (data: DataLink[],del:string) => {
|
||||
const saveDataAgency = async (data: DataLink[], del: string) => {
|
||||
dialogform.value?.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
if (data.length === 0) {
|
||||
dialogMessageNotify($q, "ลบข้อมูลต้องมี 2 ลิ้งอย่างน้อย 2 ลิ้ง");
|
||||
} else if(del){
|
||||
dialogRemove($q,() => dataPostAgency(data))
|
||||
}else {
|
||||
dialogConfirm($q,() => dataPostAgency(data))
|
||||
// if (data.length === 0) {
|
||||
// dialogMessageNotify($q, "ลบข้อมูลต้องมี 2 ลิ้งอย่างน้อย 2 ลิ้ง");
|
||||
// } else
|
||||
if (del) {
|
||||
dialogRemove($q, () => dataPostAgency(data));
|
||||
} else {
|
||||
dialogConfirm($q, () => dataPostAgency(data));
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const saveDataGoverment = async (data: DataLink[],del:string) => {
|
||||
const saveDataGoverment = async (data: DataLink[], del: string) => {
|
||||
dialogform.value?.validate().then(async (result: boolean) => {
|
||||
if (result) {
|
||||
if (data.length === 0) {
|
||||
dialogMessageNotify($q, "ลบข้อมูลต้องมี 2 ลิ้งอย่างน้อย 2 ลิ้ง");
|
||||
} else if(del){
|
||||
dialogRemove($q,() => dataPost(data))
|
||||
}else {
|
||||
dialogConfirm($q,() => dataPost(data))
|
||||
// if (data.length === 0) {
|
||||
// dialogMessageNotify($q, "ลบข้อมูลต้องมี 2 ลิ้งอย่างน้อย 2 ลิ้ง");
|
||||
// } else
|
||||
if (del) {
|
||||
dialogRemove($q, () => dataPost(data));
|
||||
} else {
|
||||
dialogConfirm($q, () => dataPost(data));
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
const dataPostAgency = async(data: DataLink[]) => {
|
||||
const dataPostAgency = async (data: DataLink[]) => {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.cmsAgency, data)
|
||||
.then((res) => {})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
dialog.value = false;
|
||||
await fetchData();
|
||||
});
|
||||
}
|
||||
const dataPost = async(data: DataLink[]) => {
|
||||
await http
|
||||
.post(config.API.cmsAgency, data)
|
||||
.then((res) => {})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
dialog.value = false;
|
||||
await fetchData();
|
||||
});
|
||||
};
|
||||
const dataPost = async (data: DataLink[]) => {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.cmsGoverment, data)
|
||||
.then((res) => {})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
dialog.value = false;
|
||||
await fetchData();
|
||||
});
|
||||
}
|
||||
await http
|
||||
.post(config.API.cmsGoverment, data)
|
||||
.then((res) => {})
|
||||
.catch((e: any) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
dialog.value = false;
|
||||
await fetchData();
|
||||
});
|
||||
};
|
||||
const fetchData = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -399,7 +404,7 @@ const fetchData = async () => {
|
|||
address.value.provinceId = data.provinceId;
|
||||
address.value.districtId = data.districtId;
|
||||
address.value.subdistrictId = data.subDistrictId;
|
||||
|
||||
cmsGoverment.value = [];
|
||||
if (data.cmsGovernments.length > 0) {
|
||||
let setData: CmsTable[] = [];
|
||||
data.cmsGovernments.map((r: CmsTable) => {
|
||||
|
|
@ -414,6 +419,7 @@ const fetchData = async () => {
|
|||
cmsGoverment.value = setData;
|
||||
}
|
||||
|
||||
cmsAgency.value = [];
|
||||
if (data.cmsAgencys.length > 0) {
|
||||
let setData: CmsTable[] = [];
|
||||
data.cmsAgencys.map((r: CmsTable) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue