เปลี่ยน api ค้นหาคนจากทะเบียนประวัติใหม่ ของวินัยและประเมิน
This commit is contained in:
parent
3b0dea6b52
commit
4c54ac272c
3 changed files with 5 additions and 88 deletions
|
|
@ -48,4 +48,7 @@ export default {
|
|||
/** struct-chart*/
|
||||
orgStructChart: (id: string, type: string) =>
|
||||
`${organization}/struct-chart/${id}/${type}`,
|
||||
|
||||
// ค้นหาคนตามเงื่อนไข
|
||||
orgSearchPersonal: () => `${organization}/profile/search-personal`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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) => ({
|
||||
|
|
|
|||
|
|
@ -145,53 +145,6 @@ watch(props.data, async () => {
|
|||
formData.email = props.data.email;
|
||||
});
|
||||
|
||||
/**
|
||||
* เพิ่มบุคลากร
|
||||
*/
|
||||
function addEmployee() {
|
||||
showLoader();
|
||||
const idCardNew = idCard.value.replace(/-/g, "");
|
||||
if (idCardNew.length === 13) {
|
||||
http
|
||||
.post(config.API.profileSearchPersonal(), {
|
||||
fieldName: "idcard",
|
||||
keyword: idCardNew,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
const dataApi = res.data.result;
|
||||
if (dataApi.length > 0) {
|
||||
const dataList = dataApi[0];
|
||||
formData.personalId = dataList.personId;
|
||||
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, "ไม่มีข้อมูลบุคคลากรที่ต้องการค้นหา");
|
||||
formData.personalId = "";
|
||||
formData.prefix = "";
|
||||
formData.firstname = "";
|
||||
formData.lastname = "";
|
||||
formData.position = "";
|
||||
formData.phone = "";
|
||||
formData.email = "";
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
});
|
||||
} else {
|
||||
dialogMessageNotify($q, "กรุณากรอกเลขประจำตัวประชาชนให้ครบ 13 หลัก");
|
||||
hideLoader();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* ตรวจสอบข้อมูลก่อนส่งไปยัง api
|
||||
*/
|
||||
|
|
@ -250,7 +203,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) => ({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue