From 04184c0d70b9913e01228621a08788b3bb7d3830 Mon Sep 17 00:00:00 2001 From: setthawutttty Date: Wed, 6 Aug 2025 14:40:36 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A?= =?UTF-8?q?=E0=B9=82=E0=B8=AB=E0=B8=A5=E0=B8=94=20=E0=B8=82=E0=B8=AD?= =?UTF-8?q?=E0=B9=82=E0=B8=AD=E0=B8=99=20=E0=B8=AD=E0=B8=B8=E0=B8=97?= =?UTF-8?q?=E0=B8=A3=E0=B8=93=E0=B9=8C/=E0=B8=A3=E0=B9=89=E0=B8=AD?= =?UTF-8?q?=E0=B8=87=E0=B8=97=E0=B8=B8=E0=B8=81=E0=B8=82=E0=B9=8C=20?= =?UTF-8?q?=E0=B8=82=E0=B8=AD=E0=B8=A5=E0=B8=B2=E0=B8=AD=E0=B8=AD=E0=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/02_transfer/views/AddTransfer.vue | 29 ++++++++----- src/modules/02_transfer/views/Main.vue | 15 ++++--- src/modules/03_retire/views/addRetire.vue | 43 +++++++++++++------ src/modules/03_retire/views/main.vue | 37 ++++++++++------ src/modules/07_appealComplain/views/Add.vue | 8 +++- src/modules/07_appealComplain/views/Edit.vue | 11 ++--- src/modules/07_appealComplain/views/Form.vue | 9 ++++ src/modules/07_appealComplain/views/Main.vue | 17 +++++--- 8 files changed, 113 insertions(+), 56 deletions(-) diff --git a/src/modules/02_transfer/views/AddTransfer.vue b/src/modules/02_transfer/views/AddTransfer.vue index 0d013b1..10adab8 100644 --- a/src/modules/02_transfer/views/AddTransfer.vue +++ b/src/modules/02_transfer/views/AddTransfer.vue @@ -15,7 +15,7 @@ const $q = useQuasar(); const route = useRoute(); const router = useRouter(); const mixin = useCounterMixin(); -const { success, messageError, showLoader, hideLoader, dialogConfirm } = mixin; +const { success, messageError, dialogConfirm ,showLoader,hideLoader} = mixin; const id = ref( router.currentRoute.value.name === "addTransfer" @@ -23,6 +23,7 @@ const id = ref( : route.params.id.toString() ); //id path +const isLoading = ref(false); const files = ref(); //ไฟล์ const tranferOrg = ref(""); //ชื่อหน่วยงานที่ขอโอนไป const noteReason = ref(""); //เหตุผล @@ -42,7 +43,7 @@ async function saveData() { /** ฟังก์ชั่นสร้างขอโอน */ async function createTransfer() { - showLoader(); + showLoader() const formData = new FormData(); formData.append("Organization", tranferOrg.value); formData.append("Reason", noteReason.value); @@ -51,14 +52,14 @@ async function createTransfer() { .post(config.API.listtransfer(), formData) .then((res) => { router.push(`/transfer/` + res.data.result); + hideLoader() success($q, "บันทึกข้อมูลสำเร็จ"); }) .catch((e) => { messageError($q, e); + hideLoader() }) - .finally(() => { - hideLoader(); - }); + .finally(() => {}); } /** @@ -66,7 +67,7 @@ async function createTransfer() { * @param id ไอดีของข้อมูล */ async function fecthDataTransfer(id: string) { - showLoader(); + isLoading.value = true; await http .get(config.API.transferByid(id)) .then((res: any) => { @@ -74,13 +75,13 @@ async function fecthDataTransfer(id: string) { tranferOrg.value = data.organization; noteReason.value = data.reason; files.value = data.docs; + isLoading.value = false; }) .catch((e: any) => { messageError($q, e); + isLoading.value = false; }) - .finally(() => { - hideLoader(); - }); + .finally(() => {}); } /** @@ -129,6 +130,7 @@ onMounted(() => {
{ :readonly="routeName != 'addTransfer'" :rules="[(val:string) => !!val || `${'กรุณากรอกหน่วยงานที่ขอโอนไป'}`]" /> - +
+ +
{ :readonly="routeName != 'addTransfer'" :rules="[(val:string) => !!val || `${'กรุณากรอกเหตุผล'}`]" /> - +
+ +
(false); const rows = ref([]); const rowsData = ref([]); const filter = ref(""); @@ -120,7 +122,7 @@ const columns = ref([ //นำข้อมูลมาแสดง async function fecthListTransfer() { - showLoader(); + isLoading.value = true; await http .get(config.API.listUserTransfer()) .then((res) => { @@ -139,12 +141,11 @@ async function fecthListTransfer() { })); rows.value = listData; rowsData.value = listData; + isLoading.value = false; }) .catch((e: any) => { messageError($q, e); - }) - .finally(() => { - hideLoader(); + isLoading.value = false; }); } @@ -246,6 +247,7 @@ onMounted(async () => {
{
+
diff --git a/src/modules/03_retire/views/addRetire.vue b/src/modules/03_retire/views/addRetire.vue index 64080f6..1715d4f 100644 --- a/src/modules/03_retire/views/addRetire.vue +++ b/src/modules/03_retire/views/addRetire.vue @@ -1,6 +1,6 @@ + diff --git a/src/modules/07_appealComplain/views/Add.vue b/src/modules/07_appealComplain/views/Add.vue index dba72b8..b486884 100644 --- a/src/modules/07_appealComplain/views/Add.vue +++ b/src/modules/07_appealComplain/views/Add.vue @@ -21,6 +21,7 @@ const $q = useQuasar(); const mixin = useCounterMixin(); const storeData = useDataStore(); +const isLoad = ref(false) const { findOrgName, success, messageError, showLoader, hideLoader } = mixin; const formProfile = reactive({ @@ -34,15 +35,18 @@ const formProfile = reactive({ /** ดึงข้อมูลจาก keycloak*/ async function getProFile() { try { - showLoader(); + isLoad.value = true if (!storeData.dataprofilePosition) { const res = await http.get(config.API.profilePosition()); await updateFormProfile(res.data.result); + isLoad.value = false } else { await updateFormProfile(storeData.dataprofilePosition); + isLoad.value = false } } catch (error) { messageError($q, error); + isLoad.value = false } finally { hideLoader(); } @@ -113,7 +117,7 @@ onMounted(() => { /> เพิ่มอุทธรณ์/ร้องทุกข์ -
+ diff --git a/src/modules/07_appealComplain/views/Edit.vue b/src/modules/07_appealComplain/views/Edit.vue index 4cdcf58..9b80d58 100644 --- a/src/modules/07_appealComplain/views/Edit.vue +++ b/src/modules/07_appealComplain/views/Edit.vue @@ -22,6 +22,7 @@ const route = useRoute(); const mixin = useCounterMixin(); const { messageError, showLoader, hideLoader } = mixin; +const isLoad = ref(false); const id = ref(route.params.id as string); const historyStatusOb = reactive({ status: "", @@ -53,7 +54,7 @@ const data = reactive({ /** ดึงข้อมูล */ function getData() { - showLoader(); + isLoad.value = true; http .get(config.API.appealByID(id.value)) .then((res) => { @@ -73,13 +74,13 @@ function getData() { data.disciplineComplaint_Appeal_Docs = dataList.disciplineComplaint_Appeal_Docs; data.historyStatus = dataList.historyStatus; + isLoad.value = false; }) .catch((e) => { messageError($q, e); + isLoad.value = false; }) - .finally(() => { - hideLoader(); - }); + .finally(() => {}); } /** ดึงข้อมูลหน้า แก้ไขอุทธรณ์/ร้องทุกข์ @@ -122,7 +123,7 @@ onMounted(() => { /> แก้ไขอุทธรณ์/ร้องทุกข์ - + diff --git a/src/modules/07_appealComplain/views/Form.vue b/src/modules/07_appealComplain/views/Form.vue index 124d744..85ce7cd 100644 --- a/src/modules/07_appealComplain/views/Form.vue +++ b/src/modules/07_appealComplain/views/Form.vue @@ -17,6 +17,7 @@ const mixin = useCounterMixin(); const { dialogConfirm } = mixin; const dataStore = useAppealComplainStore(); +const isLoad = defineModel("isLoad", { required: true }); const printForm = ref(""); const isReadOnly = ref(false); const historyStatusOb = reactive({ @@ -237,6 +238,7 @@ watch(
+
+
+
+
diff --git a/src/modules/07_appealComplain/views/Main.vue b/src/modules/07_appealComplain/views/Main.vue index a526a1d..64e231d 100644 --- a/src/modules/07_appealComplain/views/Main.vue +++ b/src/modules/07_appealComplain/views/Main.vue @@ -13,6 +13,8 @@ import { useAppealComplainStore } from "@/modules/07_appealComplain/store"; import type { FormType } from "@/modules/07_appealComplain/interface/response/mainType"; import type { DataOption } from "@/modules/07_appealComplain/interface/index/main"; +import SkeletonTable from "@/components/SkeletonTable.vue"; + const $q = useQuasar(); const router = useRouter(); const mixin = useCounterMixin(); @@ -25,6 +27,7 @@ const type = ref([ ...dataStore.typeOptions, ]); +const isload = ref(false); const total = ref(0); const totalList = ref(1); const pagination = ref({ @@ -154,7 +157,7 @@ const columns = ref([ //นำข้อมูลมาแสดง async function getData() { - showLoader(); + isload.value = true; await http .get( config.API.appealMainList( @@ -166,20 +169,20 @@ async function getData() { filterKeyword.value ) ) - .then((res) => { + .then(async (res) => { totalList.value = Math.ceil( res.data.result.total / pagination.value.rowsPerPage ); total.value = res.data.result.total; let data = res.data.result.data; - dataStore.fetchAppealComplain(data); + await dataStore.fetchAppealComplain(data); + isload.value = false; }) .catch((e: any) => { messageError($q, e); + isload.value = false; }) - .finally(() => { - hideLoader(); - }); + .finally(() => {}); } /** @@ -374,7 +377,9 @@ onMounted(async () => { />
+