ทะเบียนประวัติ => เพิ่ม fetchข้อมูล personal ใหม่

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-05-16 09:41:57 +07:00
parent 689a05e68e
commit 884ff3c487
4 changed files with 17 additions and 3 deletions

View file

@ -33,6 +33,9 @@ const profileId = ref<string>(route.params.id.toString());
const empType = ref<string>(
route.name === "registryNewByid" ? "" : "-employee"
);
const props = defineProps({
fetchDataPersonal: { type: Function, require: true },
});
const editId = ref<string>("");
const dialog = ref<boolean>(false);
@ -371,6 +374,7 @@ async function addData() {
subId.value = res.data.result;
fetchData(profileId.value);
props.fetchDataPersonal();
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {
@ -392,6 +396,7 @@ function editData(idData: string) {
)
.then(() => {
fetchData(profileId.value);
props.fetchDataPersonal();
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {

View file

@ -12,6 +12,9 @@ import SpecialSkill from "@/modules/04_registryNew/components/detail/PersonalInf
import FamilyNew from "@/modules/04_registryNew/components/detail/PersonalInformation/04_FamilyNew.vue";
const tab = ref<string>("1");
const props = defineProps({
fetchDataPersonal: { type: Function, require: true },
});
</script>
<template>
<div class="row items-center q-my-md">
@ -47,7 +50,7 @@ const tab = ref<string>("1");
<Profile />
</q-tab-panel>
<q-tab-panel name="2">
<NameChangeHistory />
<NameChangeHistory :fetchDataPersonal="props.fetchDataPersonal" />
</q-tab-panel>
<q-tab-panel name="3">
<Address />

View file

@ -10,6 +10,9 @@ import AchievementMain from "@/modules/04_registryNew/components/detail/Achievem
import OtherMaim from "@/modules/04_registryNew/components/detail/Other/Main.vue";
const store = useRegistryDetailNewDataStore();
const props = defineProps({
fetchDataPersonal: { type: Function, require: true },
});
const itemsTab = ref<any>([
{
@ -81,7 +84,10 @@ const splitterModel = ref<number>(12);
:name="tab.name"
class="q-pa-none"
>
<PersonalInformationMain v-if="store.tabMain === '1'" />
<PersonalInformationMain
v-if="store.tabMain === '1'"
:fetchDataPersonal="props.fetchDataPersonal"
/>
<GovernmentInformationMain v-if="store.tabMain === '2'" />
<salaryMain v-if="store.tabMain === '3'" />
<AchievementMain v-if="store.tabMain === '4'" />

View file

@ -556,7 +556,7 @@ onMounted(async () => {
</q-card>
<q-card bordered class="q-mt-md rounded">
<TabMain />
<TabMain :fetchDataPersonal="fetchDataPersonal"/>
</q-card>
<!-- Dialog แนบใบมรณบตร -->