fix loading
This commit is contained in:
parent
4646a3fdbb
commit
23dbf79067
6 changed files with 112 additions and 41 deletions
|
|
@ -17,7 +17,7 @@ import type { DataProfile } from "@/modules/04_registryPerson/interface/response
|
||||||
import type { FormChangeName } from "@/modules/04_registryPerson/interface/request/Main";
|
import type { FormChangeName } from "@/modules/04_registryPerson/interface/request/Main";
|
||||||
|
|
||||||
/** importComponents*/
|
/** importComponents*/
|
||||||
import dialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
/** use*/
|
/** use*/
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
@ -314,11 +314,11 @@ async function addData() {
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
subId.value = await res.data.result;
|
subId.value = await res.data.result;
|
||||||
await uploadProfile(res.data.result);
|
await uploadProfile(res.data.result);
|
||||||
closeDialog();
|
await fetchData(profileId.value);
|
||||||
|
await props?.fetchDataPersonal?.();
|
||||||
|
await fetchDataPersonal();
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
fetchData(profileId.value);
|
closeDialog();
|
||||||
props?.fetchDataPersonal?.();
|
|
||||||
fetchDataPersonal();
|
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -344,11 +344,11 @@ function editData(idData: string) {
|
||||||
)
|
)
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await uploadProfile(subId.value);
|
await uploadProfile(subId.value);
|
||||||
closeDialog();
|
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
fetchData(profileId.value);
|
await fetchData(profileId.value);
|
||||||
props.fetchDataPersonal?.();
|
await props.fetchDataPersonal?.();
|
||||||
fetchDataPersonal();
|
await fetchDataPersonal();
|
||||||
|
closeDialog();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -553,7 +553,7 @@ onMounted(async () => {
|
||||||
<q-dialog v-model="dialog" persistent>
|
<q-dialog v-model="dialog" persistent>
|
||||||
<q-card>
|
<q-card>
|
||||||
<q-form @submit.prevent greedy @validation-success="onSubmit()">
|
<q-form @submit.prevent greedy @validation-success="onSubmit()">
|
||||||
<dialog-header tittle="เปลี่ยนชื่อ - นามสกุล" :close="closeDialog" />
|
<DialogHeader tittle="เปลี่ยนชื่อ - นามสกุล" :close="closeDialog" />
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
<div class="row q-mb-sm">
|
<div class="row q-mb-sm">
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import type {
|
||||||
DataEducationLevel,
|
DataEducationLevel,
|
||||||
} from "@/modules/04_registryPerson/interface/response/Education";
|
} from "@/modules/04_registryPerson/interface/response/Education";
|
||||||
|
|
||||||
import dialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
import DialogSortEducation from "@/modules/04_registryPerson/components/detail/PersonalInformation/DialogSortEducation.vue";
|
import DialogSortEducation from "@/modules/04_registryPerson/components/detail/PersonalInformation/DialogSortEducation.vue";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
@ -1046,7 +1046,7 @@ onMounted(async () => {
|
||||||
<q-dialog v-model="dialog" class="dialog" persistent>
|
<q-dialog v-model="dialog" class="dialog" persistent>
|
||||||
<q-card>
|
<q-card>
|
||||||
<q-form @submit.prevent greedy @validation-success="onSubmit()">
|
<q-form @submit.prevent greedy @validation-success="onSubmit()">
|
||||||
<dialog-header
|
<DialogHeader
|
||||||
:tittle="
|
:tittle="
|
||||||
dialogStatus == 'edit'
|
dialogStatus == 'edit'
|
||||||
? 'แก้ไขข้อมูลประวัติการศึกษา'
|
? 'แก้ไขข้อมูลประวัติการศึกษา'
|
||||||
|
|
@ -1481,7 +1481,7 @@ onMounted(async () => {
|
||||||
<!-- ประวัติแก้ไขประวัติการศึกษา -->
|
<!-- ประวัติแก้ไขประวัติการศึกษา -->
|
||||||
<q-dialog v-model="historyDialog" class="dialog" persistent>
|
<q-dialog v-model="historyDialog" class="dialog" persistent>
|
||||||
<q-card style="min-width: 80%">
|
<q-card style="min-width: 80%">
|
||||||
<dialog-header
|
<DialogHeader
|
||||||
tittle="ประวัติแก้ไขประวัติการศึกษา"
|
tittle="ประวัติแก้ไขประวัติการศึกษา"
|
||||||
:close="closeHistoryDialog"
|
:close="closeHistoryDialog"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,51 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref, defineAsyncComponent } from "vue";
|
||||||
|
|
||||||
import { useRegistryNewDataStore } from "@/modules/04_registryPerson/store";
|
import { useRegistryNewDataStore } from "@/modules/04_registryPerson/store";
|
||||||
|
|
||||||
/** importComponents*/
|
/** importComponents*/
|
||||||
import Profile from "@/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue"; //ประวัติส่วนตัว
|
//ประวัติส่วนตัว
|
||||||
import NameChangeHistory from "@/modules/04_registryPerson/components/detail/PersonalInformation/02_NameChangeHistory.vue"; //ประวัติการเปลี่ยนชื่อ
|
const Profile = defineAsyncComponent(
|
||||||
import Address from "@/modules/04_registryPerson/components/detail/PersonalInformation/03_Address.vue"; //ข้อมูลที่อยู่
|
() =>
|
||||||
import FamilyNew from "@/modules/04_registryPerson/components/detail/PersonalInformation/04_FamilyNew.vue"; //ข้อมูลครอบครัว
|
import(
|
||||||
import Education from "@/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue"; //ประวัติการศึกษา
|
"@/modules/04_registryPerson/components/detail/PersonalInformation/01_Profile.vue"
|
||||||
import SpecialSkill from "@/modules/04_registryPerson/components/detail/PersonalInformation/06_SpecialSkill.vue"; //ความสามารถพิเศษ
|
)
|
||||||
|
);
|
||||||
|
//ประวัติการเปลี่ยนชื่อ
|
||||||
|
const NameChangeHistory = defineAsyncComponent(
|
||||||
|
() =>
|
||||||
|
import(
|
||||||
|
"@/modules/04_registryPerson/components/detail/PersonalInformation/02_NameChangeHistory.vue"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
//ข้อมูลที่อยู่
|
||||||
|
const Address = defineAsyncComponent(
|
||||||
|
() =>
|
||||||
|
import(
|
||||||
|
"@/modules/04_registryPerson/components/detail/PersonalInformation/03_Address.vue"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
//ข้อมูลครอบครัว
|
||||||
|
const FamilyNew = defineAsyncComponent(
|
||||||
|
() =>
|
||||||
|
import(
|
||||||
|
"@/modules/04_registryPerson/components/detail/PersonalInformation/04_FamilyNew.vue"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
//ประวัติการศึกษา
|
||||||
|
const Education = defineAsyncComponent(
|
||||||
|
() =>
|
||||||
|
import(
|
||||||
|
"@/modules/04_registryPerson/components/detail/PersonalInformation/05_Education.vue"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
//ความสามารถพิเศษ
|
||||||
|
const SpecialSkill = defineAsyncComponent(
|
||||||
|
() =>
|
||||||
|
import(
|
||||||
|
"@/modules/04_registryPerson/components/detail/PersonalInformation/06_SpecialSkill.vue"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
const storeRegistry = useRegistryNewDataStore();
|
const storeRegistry = useRegistryNewDataStore();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,43 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref, defineAsyncComponent } from "vue";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
|
|
||||||
import { useRegistryDetailNewDataStore } from "@/modules/04_registryPerson/stores/DetailMain";
|
import { useRegistryDetailNewDataStore } from "@/modules/04_registryPerson/stores/DetailMain";
|
||||||
|
|
||||||
import type { ItemTab } from "@/modules/04_registryPerson/interface/index/Main";
|
import type { ItemTab } from "@/modules/04_registryPerson/interface/index/Main";
|
||||||
|
|
||||||
import PersonalInformationMain from "@/modules/04_registryPerson/components/detail/PersonalInformation/Main.vue"; //ข้อมูลส่วนตัว
|
//ข้อมูลส่วนตัว
|
||||||
import GovernmentInformationMain from "@/modules/04_registryPerson/components/detail/GovernmentInformation/Main.vue"; //ข้อมูลราชการ
|
const PersonalInformationMain = defineAsyncComponent(
|
||||||
import salaryMain from "@/modules/04_registryPerson/components/detail/Salary/Main.vue"; //ข้อมูลเงินเดือน/ค่าจ้าง
|
() =>
|
||||||
import AchievementMain from "@/modules/04_registryPerson/components/detail/Achievement/Main.vue"; //ข้อมูลผลงานและเครื่องราชฯ
|
import(
|
||||||
import OtherMaim from "@/modules/04_registryPerson/components/detail/Other/Main.vue"; //เอกสารหลักฐานและอื่นๆ
|
"@/modules/04_registryPerson/components/detail/PersonalInformation/Main.vue"
|
||||||
import EmployeeMain from "@/modules/04_registryPerson/components/detail/Employee/Main.vue"; //ข้อมูลลูกจ้าง
|
)
|
||||||
|
);
|
||||||
|
//ข้อมูลราชการ
|
||||||
|
const GovernmentInformationMain = defineAsyncComponent(
|
||||||
|
() =>
|
||||||
|
import(
|
||||||
|
"@/modules/04_registryPerson/components/detail/GovernmentInformation/Main.vue"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
//ข้อมูลเงินเดือน/ค่าจ้าง
|
||||||
|
const salaryMain = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registryPerson/components/detail/Salary/Main.vue")
|
||||||
|
);
|
||||||
|
//ข้อมูลผลงานและเครื่องราชฯ
|
||||||
|
const AchievementMain = defineAsyncComponent(
|
||||||
|
() =>
|
||||||
|
import("@/modules/04_registryPerson/components/detail/Achievement/Main.vue")
|
||||||
|
);
|
||||||
|
//เอกสารหลักฐานและอื่นๆ
|
||||||
|
const OtherMaim = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registryPerson/components/detail/Other/Main.vue")
|
||||||
|
);
|
||||||
|
//ข้อมูลลูกจ้าง
|
||||||
|
const EmployeeMain = defineAsyncComponent(
|
||||||
|
() =>
|
||||||
|
import("@/modules/04_registryPerson/components/detail/Employee/Main.vue")
|
||||||
|
);
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ interface ResponseObject {
|
||||||
religion: string | null;
|
religion: string | null;
|
||||||
telephoneNumber: string | null;
|
telephoneNumber: string | null;
|
||||||
prefixMain: string;
|
prefixMain: string;
|
||||||
|
statusEmail: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Religion {
|
interface Religion {
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,15 @@ import type {
|
||||||
import type { ResponseObject } from "@/modules/04_registryPerson/interface/response/Profile";
|
import type { ResponseObject } from "@/modules/04_registryPerson/interface/response/Profile";
|
||||||
|
|
||||||
/** importComponents*/
|
/** importComponents*/
|
||||||
import CardNotPermission from "@/components/CardNotPermission.vue";
|
const CardNotPermission = defineAsyncComponent(
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
() => import("@/components/CardNotPermission.vue")
|
||||||
import TabMain from "@/modules/04_registryPerson/components/detail/TabMain.vue";
|
);
|
||||||
|
const DialogHeader = defineAsyncComponent(
|
||||||
|
() => import("@/components/DialogHeader.vue")
|
||||||
|
);
|
||||||
|
const TabMain = defineAsyncComponent(
|
||||||
|
() => import("@/modules/04_registryPerson/components/detail/TabMain.vue")
|
||||||
|
);
|
||||||
|
|
||||||
const DialogRetired = defineAsyncComponent(
|
const DialogRetired = defineAsyncComponent(
|
||||||
() => import("@/modules/04_registryPerson/components/DialogRetired.vue")
|
() => import("@/modules/04_registryPerson/components/DialogRetired.vue")
|
||||||
|
|
@ -392,11 +398,7 @@ async function fetchDataPersonal() {
|
||||||
} else {
|
} else {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
}
|
}
|
||||||
})
|
hideLoader();
|
||||||
.finally(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
hideLoader();
|
|
||||||
}, 2800);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -604,6 +606,8 @@ function clickSaveDeceased() {
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -627,14 +631,17 @@ async function getImage() {
|
||||||
.get(config.API.orgProfileAvatar + `/${profileId.value}`)
|
.get(config.API.orgProfileAvatar + `/${profileId.value}`)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
let data = res.data.result;
|
let data = res.data.result;
|
||||||
imagesAlldata.value = data;
|
if (!data || !Array.isArray(data)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (let i = 0; i < data.length; i++) {
|
imagesAlldata.value = data;
|
||||||
await getImg(data[i]);
|
for (const img of data) {
|
||||||
|
await getImg(img);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
// messageError($q, e);
|
messageError($q, e);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
|
|
@ -655,10 +662,11 @@ async function getImg(dataList: any) {
|
||||||
isActive: dataList.isActive,
|
isActive: dataList.isActive,
|
||||||
...data,
|
...data,
|
||||||
};
|
};
|
||||||
images.value = [...images.value, newData];
|
|
||||||
|
images.value.push(newData);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
// messageError($q, e);
|
messageError($q, e);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue