From d5b5eec3e8c923717429439727062d7ec618ce74 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 20 Aug 2024 13:52:36 +0700 Subject: [PATCH 1/3] =?UTF-8?q?=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99?= =?UTF-8?q?=E0=B9=80=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99=20=3D>=20?= =?UTF-8?q?=E0=B8=A3=E0=B8=B2=E0=B8=A2=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B9=80?= =?UTF-8?q?=E0=B8=A5=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=99=E0=B9=80=E0=B8=87?= =?UTF-8?q?=E0=B8=B4=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99?= =?UTF-8?q?=E0=B8=82=E0=B9=89=E0=B8=B2=E0=B8=A3=E0=B8=B2=E0=B8=8A=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=20=E0=B8=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../13_salary/components/InfoDiscipline.vue | 2 +- .../13_salary/components/InfoLeave.vue | 8 ++--- .../13_salary/components/InfoSalary.vue | 2 +- .../SalaryLists/DialogAddPerson.vue | 11 +++---- .../components/SalaryLists/DialogFormEdit.vue | 18 +++++------ .../SalaryLists/DialogMoveGroup.vue | 14 +++------ .../SalaryLists/DialogMoveLevel.vue | 13 +++----- .../SalaryLists/DialogProperties.vue | 13 +++----- .../components/SalaryLists/ProcessStep.vue | 31 ++++++++++--------- .../components/SalaryLists/TableTypeOther.vue | 6 ++-- .../SalaryLists/TableTypePending.vue | 24 ++++++++------ .../components/SalaryRound/DialogForm.vue | 5 ++- src/modules/13_salary/views/salaryLists.vue | 8 ++--- src/modules/13_salary/views/salaryRound.vue | 24 +++++++++----- 14 files changed, 90 insertions(+), 89 deletions(-) diff --git a/src/modules/13_salary/components/InfoDiscipline.vue b/src/modules/13_salary/components/InfoDiscipline.vue index 867ee7cf3..1abf65e2e 100644 --- a/src/modules/13_salary/components/InfoDiscipline.vue +++ b/src/modules/13_salary/components/InfoDiscipline.vue @@ -178,7 +178,7 @@ onMounted(() => { + + + + + + + + (""); -const isReadonly = ref(false); // อ่านได้อย่างเดียว const isActive = ref(false); const effectiveDate = ref(null); const typeOptions = ref([ @@ -81,10 +80,10 @@ function onSubmit() { ? config.API.salaryPeriod() : config.API.salaryPeriod() + `/${props.idRound}`; await http[!props.edit ? "post" : "put"](url, body); + await props.getData?.(); + await success($q, "บันทีกข้อมูลสำเร็จ"); modal.value = false; - props.getData?.(); clearForm(); - success($q, "บันทีกข้อมูลสำเร็จ"); } catch (err) { messageError($q, err); } finally { diff --git a/src/modules/13_salary/views/salaryLists.vue b/src/modules/13_salary/views/salaryLists.vue index bafc1e27b..6f9d79e48 100644 --- a/src/modules/13_salary/views/salaryLists.vue +++ b/src/modules/13_salary/views/salaryLists.vue @@ -145,9 +145,9 @@ function getSnap(code: string) { * function เรียกข้อมูลหน่ยวงาน * @param id revisionId */ -async function getAgency(id: string) { +function getAgency(id: string) { if (id) { - await http + http .get(config.API.activeOrganizationRootById(id)) .then(async (res) => { const data = res.data.result; @@ -179,9 +179,9 @@ async function getAgency(id: string) { * function เรียกข้อมูลหน่ยวงานปจุบัน * @param id revisionId */ -async function getAgencyPosition(id: string) { +function getAgencyPosition(id: string) { if (id) { - await http + http .get(config.API.keycloakPositionByid(id)) .then(async (res) => { const data = await res.data.result; diff --git a/src/modules/13_salary/views/salaryRound.vue b/src/modules/13_salary/views/salaryRound.vue index bcba2d192..4da92db65 100644 --- a/src/modules/13_salary/views/salaryRound.vue +++ b/src/modules/13_salary/views/salaryRound.vue @@ -124,7 +124,9 @@ function clickAdd() { editCheck.value = false; } -/** ดึงข้อมูลเริ่มต้น */ +/** + * fetch รายการรอบการขึ้นเงินเดือน + */ function getData() { showLoader(); http @@ -165,9 +167,9 @@ function deleteData(id: string) { showLoader(); http .delete(config.API.salaryPeriod() + `/${id}`) - .then(() => { - getData(); - success($q, "ลบข้อมูลสำเร็จ"); + .then(async () => { + await getData(); + await success($q, "ลบข้อมูลสำเร็จ"); }) .catch((e) => { messageError($q, e); @@ -204,15 +206,19 @@ function dialogClose(id: string) { dialogConfirm( $q, () => { + showLoader(); http .get(config.API.salaryPeriod() + `/close/${id}`) - .then((res) => { + .then(() => { getData(); + success($q, "ลบข้อมูลสำเร็จ"); }) .catch((e) => { messageError($q, e); }) - .finally(() => {}); + .finally(() => { + hideLoader(); + }); }, "ยืนยันการปิดรอบ", "หากปิดรอบแล้วจะไม่สามารถแก้ไขรายการเงินเดือนของรอบนี้ได้ ต้องการยืนยันการปิดรอบนี้ใช่หรือไม่?" @@ -406,14 +412,16 @@ onMounted(async () => { color="edit" size="17px" :name=" - props.row.revisionId !== null || !checkPermission($route)?.attrIsUpdate + props.row.revisionId !== null || + !checkPermission($route)?.attrIsUpdate ? 'mdi-eye-outline' : 'edit' " />
{{ - props.row.revisionId !== null || !checkPermission($route)?.attrIsUpdate + props.row.revisionId !== null || + !checkPermission($route)?.attrIsUpdate ? "ดูข้อมูล" : "แก้ไขข้อมูล" }} From d0bbf5f68ee19a9e55897ff4e289fdb66062de7c Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 20 Aug 2024 15:18:31 +0700 Subject: [PATCH 2/3] =?UTF-8?q?=E0=B9=80=E0=B8=87=E0=B8=B4=E0=B8=99?= =?UTF-8?q?=E0=B9=80=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99=20=3D>=20?= =?UTF-8?q?=E0=B9=80=E0=B8=A5=E0=B8=B7=E0=B9=88=E0=B8=AD=E0=B8=99=E0=B8=84?= =?UTF-8?q?=E0=B9=88=E0=B8=B2=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B8=A5?= =?UTF-8?q?=E0=B8=B9=E0=B8=81=E0=B8=88=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B8=9B?= =?UTF-8?q?=E0=B8=A3=E0=B8=B0=E0=B8=88=E0=B8=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SalaryEmployeeLists/DialogAddPerson.vue | 7 +-- .../SalaryEmployeeLists/DialogFormEdit.vue | 18 ++++---- .../SalaryEmployeeLists/DialogMoveGroup.vue | 13 +++--- .../SalaryEmployeeLists/DialogMoveLevel.vue | 14 +++--- .../SalaryEmployeeLists/DialogProperties.vue | 14 +++--- .../SalaryEmployeeLists/ProcessStep.vue | 44 +++++++++---------- .../SalaryEmployeeLists/TableTypeOther.vue | 6 +-- .../SalaryEmployeeLists/TableTypePending.vue | 9 ++-- .../components/SalaryLists/ProcessStep.vue | 4 +- .../SalaryLists/TableTypePending.vue | 6 +-- 10 files changed, 60 insertions(+), 75 deletions(-) diff --git a/src/modules/13_salary/components/SalaryEmployeeLists/DialogAddPerson.vue b/src/modules/13_salary/components/SalaryEmployeeLists/DialogAddPerson.vue index 98b8fe22f..2022ef5d2 100644 --- a/src/modules/13_salary/components/SalaryEmployeeLists/DialogAddPerson.vue +++ b/src/modules/13_salary/components/SalaryEmployeeLists/DialogAddPerson.vue @@ -148,11 +148,12 @@ function onClickAddPerson(data: DataPerson) { dialogConfirm( $q, () => { + showLoader(); http .post(config.API.salaryPeriodProfileEmp, body) - .then(() => { - props.fetchData?.(); - success($q, "เพื่มรายชื่อสำเร็จ"); + .then(async () => { + await props.fetchData?.(); + await success($q, "เพื่มรายชื่อสำเร็จ"); closeModal(); }) .catch((err) => { diff --git a/src/modules/13_salary/components/SalaryEmployeeLists/DialogFormEdit.vue b/src/modules/13_salary/components/SalaryEmployeeLists/DialogFormEdit.vue index 3f8893b56..89b69c2ba 100644 --- a/src/modules/13_salary/components/SalaryEmployeeLists/DialogFormEdit.vue +++ b/src/modules/13_salary/components/SalaryEmployeeLists/DialogFormEdit.vue @@ -13,7 +13,7 @@ import { useCounterMixin } from "@/stores/mixin"; /** use*/ const $q = useQuasar(); const mixin = useCounterMixin(); -const { dialogConfirm, success, messageError } = mixin; +const { dialogConfirm, success, messageError, showLoader, hideLoader } = mixin; /** props*/ const modal = defineModel("modal", { required: true }); @@ -44,6 +44,7 @@ function close() { function onSubmit() { dialogConfirm($q, () => { if (amount.value !== null) { + showLoader(); const amountString: string = amount.value.toString(); const body = { profileId: profileId.value, @@ -54,15 +55,16 @@ function onSubmit() { }; http .post(config.API.salaryPeriodEmp() + `/change/amount`, body) - .then(() => { - success($q, "บันทึกข้อมูลสำเร็จ"); - props.fetchData?.(); + .then(async () => { + await props.fetchData?.(); + await success($q, "บันทึกข้อมูลสำเร็จ"); + close(); }) .catch((e) => { messageError($q, e); }) .finally(() => { - close(); + hideLoader(); }); } }); @@ -88,6 +90,7 @@ function onSubmit() { :rules="[(val) => !!val || `${'กรุณากรอกเงินเดือนฐาน'}`]" lazy-rules hide-bottom-space + class="inputgreen" />
@@ -97,10 +100,7 @@ function onSubmit() { diff --git a/src/modules/13_salary/components/SalaryEmployeeLists/DialogMoveGroup.vue b/src/modules/13_salary/components/SalaryEmployeeLists/DialogMoveGroup.vue index 409210efc..28c814adc 100644 --- a/src/modules/13_salary/components/SalaryEmployeeLists/DialogMoveGroup.vue +++ b/src/modules/13_salary/components/SalaryEmployeeLists/DialogMoveGroup.vue @@ -55,16 +55,16 @@ function onSubmit() { }; http .post(config.API.salaryPeriod() + `/change/group`, body) - .then(() => { - success($q, "บันทึกข้อมูลสำเร็จ"); - props.fetchData?.(); + .then(async () => { + await props.fetchData?.(); + await success($q, "บันทึกข้อมูลสำเร็จ"); + close(); }) .catch((e) => { messageError($q, e); }) .finally(() => { hideLoader(); - close(); }); }); } @@ -120,10 +120,7 @@ function inputEdit(val: boolean) { diff --git a/src/modules/13_salary/components/SalaryEmployeeLists/DialogMoveLevel.vue b/src/modules/13_salary/components/SalaryEmployeeLists/DialogMoveLevel.vue index 00d8267c0..c4fb4e080 100644 --- a/src/modules/13_salary/components/SalaryEmployeeLists/DialogMoveLevel.vue +++ b/src/modules/13_salary/components/SalaryEmployeeLists/DialogMoveLevel.vue @@ -81,15 +81,15 @@ function onSubmit() { }; http .post(config.API.salaryPeriodEmp() + `/change/type`, body) - .then(() => { - success($q, "บันทึกข้อมูลสำเร็จ"); - props.fetchData?.(); + .then(async () => { + await props.fetchData?.(); + await success($q, "บันทึกข้อมูลสำเร็จ"); + close(); }) .catch((e) => { messageError($q, e); }) .finally(() => { - close(); hideLoader(); }); }); @@ -168,15 +168,11 @@ function inputEdit(val: boolean) {
- diff --git a/src/modules/13_salary/components/SalaryEmployeeLists/DialogProperties.vue b/src/modules/13_salary/components/SalaryEmployeeLists/DialogProperties.vue index c9ed6f8c4..ce5e3eefb 100644 --- a/src/modules/13_salary/components/SalaryEmployeeLists/DialogProperties.vue +++ b/src/modules/13_salary/components/SalaryEmployeeLists/DialogProperties.vue @@ -66,15 +66,15 @@ function onSubmit() { }; http .put(config.API.salaryPropertyEmp(profileId.value), body) - .then(() => { - success($q, "บันทึกข้อมูลสำเร็จ"); - props.fetchData?.(); + .then(async () => { + await props.fetchData?.(); + await success($q, "บันทึกข้อมูลสำเร็จ"); + close(); }) .catch((e) => { messageError($q, e); }) .finally(() => { - close(); hideLoader(); }); }); @@ -132,14 +132,10 @@ watch( - diff --git a/src/modules/13_salary/components/SalaryEmployeeLists/ProcessStep.vue b/src/modules/13_salary/components/SalaryEmployeeLists/ProcessStep.vue index 5bc5fbc0b..1f44a86b8 100644 --- a/src/modules/13_salary/components/SalaryEmployeeLists/ProcessStep.vue +++ b/src/modules/13_salary/components/SalaryEmployeeLists/ProcessStep.vue @@ -67,7 +67,7 @@ async function uploadFile(event: any) { res.data[key]?.fileName !== "" ); const link = res.data[foundKey]?.uploadUrl; - fileUpLoad(link); + await fileUpLoad(link); }) .catch((err) => { messageError($q, err); @@ -85,10 +85,10 @@ function fileUpLoad(url: string) { headers: { "Content-Type": fileUpload.value?.type }, onUploadProgress: (e) => console.log(e), }) - .then(() => { - success($q, "อัปโหลดไฟล์สำเร็จ"); + .then(async () => { + await fetchListFile(); + await success($q, "อัปโหลดไฟล์สำเร็จ"); fileUpload.value = null; - fetchListFile(); }) .catch((e) => { messageError($q, e); @@ -114,9 +114,10 @@ function saveReccommend(reason: string) { titleRecommend: reason, } ) - .then((res) => { - console.log(res); - props.getData?.(); + .then(async () => { + await props.getData?.(); + sendStep.value = sendStep.value + 1; + modalRecommend.value = false; }) .catch((e) => { messageError($q, e); @@ -124,8 +125,6 @@ function saveReccommend(reason: string) { .finally(() => { hideLoader(); }); - sendStep.value = sendStep.value + 1; - modalRecommend.value = false; }, "ยืนยันการ" + titleRecommend.value, "ต้องการยืนยันการ" + titleRecommend.value + "หรือไม่?" @@ -145,9 +144,9 @@ function sendToDirector(msg: string, type: string) { props.rootId ? props.rootId : "" ) ) - .then((res) => { - console.log(res); - props.getData?.(); + .then(async () => { + await props.getData?.(); + sendStep.value = sendStep.value == 3 ? 6 : sendStep.value + 1; }) .catch((e) => { messageError($q, e); @@ -155,7 +154,6 @@ function sendToDirector(msg: string, type: string) { .finally(() => { hideLoader(); }); - sendStep.value = sendStep.value == 3 ? 6 : sendStep.value + 1; }, "ยืนยันการ" + msg, "ต้องการยืนยันการ" + msg + "หรือไม่?" @@ -202,16 +200,16 @@ function onDeleteFile(fileName: string) { ) ) .then(() => { - success($q, "ลบไฟล์สำเร็จ"); - setTimeout(() => { - fetchListFile(); - hideLoader(); - }, 1000); + setTimeout(async () => { + await fetchListFile(); + await success($q, "ลบไฟล์สำเร็จ"); + await hideLoader(); + }, 2000); }) .catch((e) => { messageError($q, e); - }) - .finally(async () => {}); + hideLoader(); + }); }); } @@ -377,9 +375,8 @@ onMounted(() => { dense flat round - size="12px" color="blue" - icon="mdi-download-outline" + icon="mdi-download" @click="downloadFile(item.fileName)" > ดาวน์โหลดเอกสาร @@ -391,9 +388,8 @@ onMounted(() => { dense flat round - size="12px" color="red" - icon="mdi-delete-outline" + icon="mdi-delete" @click="onDeleteFile(item.fileName)" >ลบเอกสาร diff --git a/src/modules/13_salary/components/SalaryEmployeeLists/TableTypeOther.vue b/src/modules/13_salary/components/SalaryEmployeeLists/TableTypeOther.vue index 702f7a278..4e3d1db50 100644 --- a/src/modules/13_salary/components/SalaryEmployeeLists/TableTypeOther.vue +++ b/src/modules/13_salary/components/SalaryEmployeeLists/TableTypeOther.vue @@ -260,9 +260,9 @@ function onClickDelete(id: string) { showLoader(); await http .delete(config.API.salaryListPeriodProfileByIdEmp(id)) - .then(() => { - success($q, "ลบข้อมูลสำเร็จ"); - props.fetchDataTable?.(); + .then(async () => { + await props.fetchDataTable?.(); + await success($q, "ลบข้อมูลสำเร็จ"); }) .catch((err) => { messageError($q, err); diff --git a/src/modules/13_salary/components/SalaryEmployeeLists/TableTypePending.vue b/src/modules/13_salary/components/SalaryEmployeeLists/TableTypePending.vue index 810ffeb99..605d41ebe 100644 --- a/src/modules/13_salary/components/SalaryEmployeeLists/TableTypePending.vue +++ b/src/modules/13_salary/components/SalaryEmployeeLists/TableTypePending.vue @@ -217,9 +217,9 @@ function onClickDelete(id: string) { showLoader(); await http .delete(config.API.salaryListPeriodProfileByIdEmp(id)) - .then(() => { - success($q, "ลบข้อมูลสำเร็จ"); - props.fetchDataTable?.(); + .then(async () => { + await props.fetchDataTable?.(); + await success($q, "ลบข้อมูลสำเร็จ"); }) .catch((err) => { messageError($q, err); @@ -289,7 +289,6 @@ function searchData() { } function onProperties(data: any) { - console.log(data); modalDialogProperties.value = true; profileId.value = data.id; isPunish.value = data.isPunish; @@ -382,7 +381,7 @@ function onClickViewInfo(type: string, id: string) {