From 8c21b94fbd4d96343f8ecdd12e82d139f9163087 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Wed, 7 Feb 2024 10:33:17 +0700 Subject: [PATCH] clearForm --- .../components/DialogSelectPerson.vue | 398 +++++++++--------- 1 file changed, 203 insertions(+), 195 deletions(-) diff --git a/src/modules/02_organizationalNew/components/DialogSelectPerson.vue b/src/modules/02_organizationalNew/components/DialogSelectPerson.vue index 0a36505e6..e70868570 100644 --- a/src/modules/02_organizationalNew/components/DialogSelectPerson.vue +++ b/src/modules/02_organizationalNew/components/DialogSelectPerson.vue @@ -247,10 +247,17 @@ function inputEdit(val: boolean) { }; } +function clearForm() { + formData.positionType = ""; + formData.positionLevel = ""; + formData.personal = ""; +} + watch( () => modal.value, () => { if (modal.value == true) { + clearForm(); fetchType(); fetchExecutive(); @@ -302,36 +309,33 @@ function validateForm() { // } // } // if (hasError.every((result) => result === true)) { - onSubmit(); + onSubmit(); // } else { // } } /** ฟังชั่น บันทึก */ function onSubmit() { - dialogConfirm( - $q, - () => { - // showLoader(); - // http - // .post(config.API.createOrganization, formData) - // .then((res) => { - // status.value = true; - // store.typeOrganizational = "draft"; - // store.draftId = res.data.result.id; - // success($q, "บันทึกข้อมูลสำเร็จ"); - // // props.fetchActive?.(); - // }) - // .catch((err) => { - // messageError($q, err); - // }) - // .finally(async () => { - // modal.value = await false; - // await close(); - // await hideLoader(); - // }); - }, - ); + dialogConfirm($q, () => { + // showLoader(); + // http + // .post(config.API.createOrganization, formData) + // .then((res) => { + // status.value = true; + // store.typeOrganizational = "draft"; + // store.draftId = res.data.result.id; + // success($q, "บันทึกข้อมูลสำเร็จ"); + // // props.fetchActive?.(); + // }) + // .catch((err) => { + // messageError($q, err); + // }) + // .finally(async () => { + // modal.value = await false; + // await close(); + // await hideLoader(); + // }); + }); } /** เมื่อ enter ให้ทำการ ค้นหาข้อมูล */ @@ -351,7 +355,7 @@ function filterFn() { }, ]; - rowResult.value = data + rowResult.value = data; // props.fetchListDisciplinary?.(); } @@ -360,189 +364,193 @@ function filterFn() {
- - + + - -
-
-
-
-

เลขที่ตำแหน่ง

+ +
+
+
+
+

เลขที่ตำแหน่ง

+
+
+
+

{{ formData.positionNo }}

-
-

{{ formData.positionNo }}

-
-
-
-
- - - + +
-
-
-
+
+
+ +
+
+ +
+
+ +
+ -
-
- -
-
- -
- - -
- - - + +
-
- - - - - + + + + +