ปรับ form เพิ่มกรรมการ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-01-15 13:06:25 +07:00
parent 53cd8e593c
commit 7a39d4fccd
2 changed files with 8 additions and 14 deletions

View file

@ -67,23 +67,22 @@ watch(props.data, async () => {
formData.position = props.data.position;
formData.phone = props.data.phone;
formData.email = props.data.email;
});
/**
* เพมบคลากร
*/
function addEmployee() {
if (idCard.value.length === 13) {
showLoader();
if (idCard.value.length === 17) {
console.log("idCard===>", idCard.value);
showLoader();
http
.post(config.API.profileSearchPersonal(), {
fieldName: "idcard",
keyword: idCard.value,
})
.then((res) => {
console.log(res)
console.log(res);
const dataApi = res.data.result;
if (dataApi.length > 0) {
const dataList = dataApi[0];
@ -104,12 +103,9 @@ function addEmployee() {
.finally(async () => {
hideLoader();
});
}
if (idCard.value.length !== 13) {
hideLoader();
dialogMessageNotify($q, "กรุณากรอกเลขบัตรประชาชนให้ครบ 13 หลัก");
} else {
console.log("nodata");
dialogMessageNotify($q, "กรุณากรอกเลขบัตรประชาชนให้ครบ 13 หลัก");
hideLoader();
}
}
@ -183,6 +179,7 @@ function inputEdit(val: boolean) {
ref="idCardRef"
for="idCardRef"
hide-bottom-space
mask="#-####-#####-##-#"
:rules="[(val: string) => !!val || `${'กรุณากรอกรหัสบัตรประชาชน'}`]"
/>
</div>