เปลี่ยน api ค้นหาคนจากทะเบียนประวัติใหม่ ของวินัยและประเมิน

This commit is contained in:
Warunee Tamkoo 2024-02-16 14:05:12 +07:00
parent 3b0dea6b52
commit 4c54ac272c
3 changed files with 5 additions and 88 deletions

View file

@ -142,45 +142,6 @@ const visibleColumnsRespondent = ref<string[]>([
"organization",
]);
/**
* เพมบคลากร
*/
function addEmployee() {
if (idCard.value.length === 13) {
showLoader();
http
.post(config.API.profileSearchPersonal(), {
fieldName: "idcard",
keyword: idCard.value,
})
.then((res) => {
const dataApi = res.data.result;
if (dataApi.length > 0) {
const dataList = dataApi[0];
formData.prefix = dataList.prefix;
formData.firstname = dataList.firstName;
formData.lastname = dataList.lastName;
formData.position = dataList.position;
formData.phone = dataList.phone;
formData.email = dataList.email;
} else {
dialogMessageNotify($q, "ไม่มีข้อมูลบุคคลากรที่ต้องการค้นหา");
}
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
});
}
if (idCard.value.length !== 13) {
hideLoader();
dialogMessageNotify($q, "กรุณากรอกเลขประจำตัวประชาชนให้ครบ 13 หลัก");
} else {
}
}
/** ฟังชั่นตรวจสอบความถูกต้องก่อน บันทึก */
function onValidate() {
const hasError = [];
@ -219,7 +180,7 @@ async function searchInput() {
keyword: search.value,
};
await http
.post(config.API.searchPersonal(), body)
.post(config.API.orgSearchPersonal(), body)
.then((res) => {
const data = res.data.result;
const list = data.map((e: ResponsePreson) => ({