From e8976a3d82ab713e9b4cd2ecd771d2382d752dda Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 11 Jun 2024 11:07:34 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=84=E0=B8=A3=E0=B8=B7=E0=B9=88?= =?UTF-8?q?=E0=B8=AD=E0=B8=87=E0=B8=A3=E0=B8=B2=E0=B8=8A=E0=B8=AD=E0=B8=B4?= =?UTF-8?q?=E0=B8=AA=E0=B8=A3=E0=B8=B4=E0=B8=A2=E0=B8=B2=E0=B8=A0=E0=B8=A3?= =?UTF-8?q?=E0=B8=93=E0=B9=8C=20=3D>=20=E0=B8=9B=E0=B8=A3=E0=B8=B1?= =?UTF-8?q?=E0=B8=9A=20form=20Dialog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../07_insignia/components/2_Manage/Tab1.vue | 1 - .../components/3_result/DialogForm.vue | 122 ++++++------ .../components/3_result/Dialogbody.vue | 148 +++++++------- .../components/4_Allocate/DialogEdit.vue | 36 ++-- .../components/4_Allocate/DialogForm.vue | 69 ++++--- .../components/5_Borrow/DialogForm.vue | 188 ++++++++---------- .../stores/registry-employee.ts | 2 +- 7 files changed, 276 insertions(+), 290 deletions(-) diff --git a/src/modules/07_insignia/components/2_Manage/Tab1.vue b/src/modules/07_insignia/components/2_Manage/Tab1.vue index 6a30a99fd..41321aad3 100644 --- a/src/modules/07_insignia/components/2_Manage/Tab1.vue +++ b/src/modules/07_insignia/components/2_Manage/Tab1.vue @@ -1360,7 +1360,6 @@ onMounted(async () => { @click="clickSave" class="q-px-md" > - บันทึก diff --git a/src/modules/07_insignia/components/3_result/DialogForm.vue b/src/modules/07_insignia/components/3_result/DialogForm.vue index 79252e3c8..6c6cd9a38 100644 --- a/src/modules/07_insignia/components/3_result/DialogForm.vue +++ b/src/modules/07_insignia/components/3_result/DialogForm.vue @@ -1,4 +1,4 @@ - diff --git a/src/modules/07_insignia/components/5_Borrow/DialogForm.vue b/src/modules/07_insignia/components/5_Borrow/DialogForm.vue index 9eff283e9..4b4017692 100644 --- a/src/modules/07_insignia/components/5_Borrow/DialogForm.vue +++ b/src/modules/07_insignia/components/5_Borrow/DialogForm.vue @@ -160,46 +160,44 @@ async function fetchOrgList() { // บันทึกข้อมูลการยืม-คืน /** function บันทึกการเพิ่มข้อมูล*/ -async function clickSave() { - await myForm.value!.validate().then((result: boolean) => { - if (result) { - dialogConfirm($q, async () => { - if (props.action == "addData") { - await http - .post(config.API.insigniaManageBorrow(), { - borrowDate: receivedate.value, - // borrowOrganizationId: OrganazationId.value, - insigniaNoteProfileId: insigniaNoteProfileId.value, - }) - .then(() => { - success($q, "บันทึกข้อมูลสำเร็จ"); - }) - .catch((err) => { - messageError($q, err); - }) - .finally(() => { - clearData(); - props.closeAndFecth(); - }); - } else { - await http - .put(config.API.insigniaManageBorrowReturn(props.profileId), { - returnDate: returndate.value, - returnOrganizationId: OrganazationId.value, - returnReason: reason.value, - }) - .then(() => { - success($q, "บันทึกข้อมูลสำเร็จ"); - }) - .catch((err) => { - messageError($q, err); - }) - .finally(() => { - clearData(); - props.closeAndFecth(); - }); - } - }); +async function onSubmit() { + dialogConfirm($q, async () => { + showLoader(); + if (props.action == "addData") { + await http + .post(config.API.insigniaManageBorrow(), { + borrowDate: receivedate.value, + insigniaNoteProfileId: insigniaNoteProfileId.value, + }) + .then(() => { + success($q, "บันทึกข้อมูลสำเร็จ"); + clearData(); + props.closeAndFecth(); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); + } else { + await http + .put(config.API.insigniaManageBorrowReturn(props.profileId), { + returnDate: returndate.value, + returnOrganizationId: OrganazationId.value, + returnReason: reason.value, + }) + .then(() => { + success($q, "บันทึกข้อมูลสำเร็จ"); + clearData(); + props.closeAndFecth(); + }) + .catch((err) => { + messageError($q, err); + }) + .finally(() => { + hideLoader(); + }); } }); } @@ -297,11 +295,15 @@ watch(props, () => { - -
{
+ + -->
{ :label="`สาเหตุที่ส่งคืนเครื่องราชอิสริยาภรณ์`" />
- - - - + - -
-
- + + + + บันทึก -
-
+ + diff --git a/src/modules/08_registryEmployee/stores/registry-employee.ts b/src/modules/08_registryEmployee/stores/registry-employee.ts index dfaca7844..0f34dac2e 100644 --- a/src/modules/08_registryEmployee/stores/registry-employee.ts +++ b/src/modules/08_registryEmployee/stores/registry-employee.ts @@ -36,7 +36,7 @@ export const useRegistryEmp = defineStore("registry-employee", () => { switch (val) { case "WAITTING": return "รอดำเนินการ"; - case "REPORT": + case "PENDING": return "เลือกตำแหน่งแล้ว"; case "APPROVE": return "อนุมัติ";