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 "อนุมัติ";