แก้่การค้นหาราชื่อกรรมการ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-01-17 10:59:48 +07:00
parent 7f78fe2b2c
commit 67ea8a7f9a

View file

@ -74,12 +74,12 @@ watch(props.data, async () => {
*/ */
function addEmployee() { function addEmployee() {
showLoader(); showLoader();
if (idCard.value.length === 17) { const idCardNew = idCard.value.replace(/-/g, "");
console.log("idCard===>", idCard.value); if (idCardNew.length === 13) {
http http
.post(config.API.profileSearchPersonal(), { .post(config.API.profileSearchPersonal(), {
fieldName: "idcard", fieldName: "idcard",
keyword: idCard.value, keyword: idCardNew,
}) })
.then((res) => { .then((res) => {
console.log(res); console.log(res);
@ -95,6 +95,13 @@ function addEmployee() {
formData.email = dataList.email; formData.email = dataList.email;
} else { } else {
dialogMessageNotify($q, "ไม่มีข้อมูลบุคคลากรที่ต้องการค้นหา"); dialogMessageNotify($q, "ไม่มีข้อมูลบุคคลากรที่ต้องการค้นหา");
formData.personalId = "";
formData.prefix = "";
formData.firstname = "";
formData.lastname = "";
formData.position = "";
formData.phone = "";
formData.email = "";
} }
}) })
.catch((e) => { .catch((e) => {
@ -208,6 +215,7 @@ function inputEdit(val: boolean) {
for="prefixRef" for="prefixRef"
hide-bottom-space hide-bottom-space
:rules="[(val: string) => val !== null && val !== '' || `${'กรุณากรอกคำนำหน้า'}`]" :rules="[(val: string) => val !== null && val !== '' || `${'กรุณากรอกคำนำหน้า'}`]"
lazy-rules
/> />
</div> </div>
<div class="col-3"> <div class="col-3">
@ -221,6 +229,7 @@ function inputEdit(val: boolean) {
for="firstnameRef" for="firstnameRef"
hide-bottom-space hide-bottom-space
:rules="[(val: string) => val !== null && val !== '' || `${'กรุณากรอกชื่อ'}`]" :rules="[(val: string) => val !== null && val !== '' || `${'กรุณากรอกชื่อ'}`]"
lazy-rules
/> />
</div> </div>
<div class="col-3"> <div class="col-3">
@ -234,6 +243,7 @@ function inputEdit(val: boolean) {
for="lastnameRef" for="lastnameRef"
hide-bottom-space hide-bottom-space
:rules="[(val: string) => !!val || `${'กรุณากรอกนามสกุล'}`]" :rules="[(val: string) => !!val || `${'กรุณากรอกนามสกุล'}`]"
lazy-rules
/> />
</div> </div>
<div class="col-3"> <div class="col-3">
@ -247,6 +257,7 @@ function inputEdit(val: boolean) {
for="positionRef" for="positionRef"
hide-bottom-space hide-bottom-space
:rules="[(val: string) => !!val || `${'กรุณากรอกตำแหน่ง'}`]" :rules="[(val: string) => !!val || `${'กรุณากรอกตำแหน่ง'}`]"
lazy-rules
/> />
</div> </div>
<div class="col-3"> <div class="col-3">
@ -261,7 +272,6 @@ function inputEdit(val: boolean) {
type="tel" type="tel"
mask="##########" mask="##########"
hide-bottom-space hide-bottom-space
:rules="[(val: string) => !!val || `${'กรุณากรอกเบอร์โทร'}`]"
/> />
</div> </div>
<div class="col-3"> <div class="col-3">
@ -274,7 +284,6 @@ function inputEdit(val: boolean) {
ref="emailRef" ref="emailRef"
hide-bottom-space hide-bottom-space
for="emailRef" for="emailRef"
:rules="[(val: string) => !!val || `${'กรุณากรอกอีเมล'}`]"
/> />
</div> </div>
</div> </div>
@ -287,7 +296,7 @@ function inputEdit(val: boolean) {
id="formSubmit" id="formSubmit"
color="secondary" color="secondary"
label="บันทึก" label="บันทึก"
type="submit" @click.stop="onValidate"
><q-tooltip>บทกขอม</q-tooltip></q-btn ><q-tooltip>บทกขอม</q-tooltip></q-btn
> >
</div> </div>