ทะเบียนประวัติ => ข้อมูลครอบครัว
This commit is contained in:
parent
8c829c03bd
commit
f7c8315209
2 changed files with 56 additions and 12 deletions
|
|
@ -2,12 +2,15 @@
|
||||||
import { reactive, ref, onMounted } from "vue";
|
import { reactive, ref, onMounted } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import type { DataOption } from "@/modules/04_registryNew/interface/index/Main";
|
import type { DataOption } from "@/modules/04_registryNew/interface/index/Main";
|
||||||
|
import type {
|
||||||
|
FormPerson,
|
||||||
|
FormChildren,
|
||||||
|
} from "@/modules/04_registryNew/interface/index/family";
|
||||||
|
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
|
|
@ -109,7 +112,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
const rows = ref<any[]>([]);
|
const rows = ref<any[]>([]);
|
||||||
|
|
||||||
/** ข้อมูล*/
|
/** ข้อมูล*/
|
||||||
const fatherData = reactive<any>({
|
const fatherData = reactive<FormPerson>({
|
||||||
isLive: null,
|
isLive: null,
|
||||||
citizenId: "",
|
citizenId: "",
|
||||||
prefix: "",
|
prefix: "",
|
||||||
|
|
@ -117,7 +120,7 @@ const fatherData = reactive<any>({
|
||||||
lastName: "",
|
lastName: "",
|
||||||
job: "",
|
job: "",
|
||||||
});
|
});
|
||||||
const motherData = reactive<any>({
|
const motherData = reactive<FormPerson>({
|
||||||
isLive: null,
|
isLive: null,
|
||||||
citizenId: "",
|
citizenId: "",
|
||||||
prefix: "",
|
prefix: "",
|
||||||
|
|
@ -125,7 +128,7 @@ const motherData = reactive<any>({
|
||||||
lastName: "",
|
lastName: "",
|
||||||
job: "",
|
job: "",
|
||||||
});
|
});
|
||||||
const coupleData = reactive<any>({
|
const coupleData = reactive<FormPerson>({
|
||||||
isLive: null,
|
isLive: null,
|
||||||
citizenId: "",
|
citizenId: "",
|
||||||
prefix: "",
|
prefix: "",
|
||||||
|
|
@ -135,7 +138,7 @@ const coupleData = reactive<any>({
|
||||||
lastNameOld: "",
|
lastNameOld: "",
|
||||||
statusMarital: "",
|
statusMarital: "",
|
||||||
});
|
});
|
||||||
const childData = ref<any[]>([{}]);
|
const childData = ref<FormChildren[]>([]);
|
||||||
|
|
||||||
const modal = ref<boolean>(false);
|
const modal = ref<boolean>(false);
|
||||||
const modalHistory = ref<boolean>(false);
|
const modalHistory = ref<boolean>(false);
|
||||||
|
|
@ -150,7 +153,7 @@ const optionRelationshipMain = ref<DataOption[]>([]);
|
||||||
const optionRelationship = ref<DataOption[]>([]);
|
const optionRelationship = ref<DataOption[]>([]);
|
||||||
|
|
||||||
const fromData = reactive({
|
const fromData = reactive({
|
||||||
isLive: 0,
|
isLive: 1,
|
||||||
citizenId: "",
|
citizenId: "",
|
||||||
prefix: "",
|
prefix: "",
|
||||||
firstName: "",
|
firstName: "",
|
||||||
|
|
@ -300,7 +303,7 @@ function onSubmit(type: string) {
|
||||||
function closeDialog() {
|
function closeDialog() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
modalHistory.value = false;
|
modalHistory.value = false;
|
||||||
fromData.isLive = 0;
|
fromData.isLive = 1;
|
||||||
fromData.citizenId = "";
|
fromData.citizenId = "";
|
||||||
fromData.prefix = "";
|
fromData.prefix = "";
|
||||||
fromData.firstName = "";
|
fromData.firstName = "";
|
||||||
|
|
@ -322,8 +325,10 @@ function onOpenDialogForm(
|
||||||
|
|
||||||
if (type === "father") {
|
if (type === "father") {
|
||||||
titleForm.value = "บิดา";
|
titleForm.value = "บิดา";
|
||||||
|
console.log(fatherData.isLive);
|
||||||
|
|
||||||
fromData.isLive = fatherData.isLive ? 1 : 0;
|
fromData.isLive =
|
||||||
|
fatherData.isLive === null ? 1 : fatherData.isLive ? 1 : 0;
|
||||||
fromData.citizenId = fatherData.citizenId;
|
fromData.citizenId = fatherData.citizenId;
|
||||||
fromData.prefix = fatherData.prefix;
|
fromData.prefix = fatherData.prefix;
|
||||||
fromData.firstName = fatherData.firstName;
|
fromData.firstName = fatherData.firstName;
|
||||||
|
|
@ -332,7 +337,8 @@ function onOpenDialogForm(
|
||||||
} else if (type === "mother") {
|
} else if (type === "mother") {
|
||||||
titleForm.value = "มารดา";
|
titleForm.value = "มารดา";
|
||||||
|
|
||||||
fromData.isLive = motherData.isLive ? 1 : 0;
|
fromData.isLive =
|
||||||
|
motherData.isLive === null ? 1 : motherData.isLive ? 1 : 0;
|
||||||
fromData.citizenId = motherData.citizenId;
|
fromData.citizenId = motherData.citizenId;
|
||||||
fromData.prefix = motherData.prefix;
|
fromData.prefix = motherData.prefix;
|
||||||
fromData.firstName = motherData.firstName;
|
fromData.firstName = motherData.firstName;
|
||||||
|
|
@ -340,11 +346,13 @@ function onOpenDialogForm(
|
||||||
fromData.job = motherData.job;
|
fromData.job = motherData.job;
|
||||||
} else if (type === "couple") {
|
} else if (type === "couple") {
|
||||||
titleForm.value = "คู่สมรส";
|
titleForm.value = "คู่สมรส";
|
||||||
|
fromData.isLive = 1;
|
||||||
} else if (type === "children") {
|
} else if (type === "children") {
|
||||||
titleForm.value = "บุตร";
|
titleForm.value = "บุตร";
|
||||||
if (isStatusEdit) {
|
if (isStatusEdit) {
|
||||||
childernId.value = data.id;
|
childernId.value = data.id;
|
||||||
fromData.isLive = data.childrenLive ? 1 : 0;
|
fromData.isLive =
|
||||||
|
data.childrenLive === null ? 1 : data.childrenLive ? 1 : 0;
|
||||||
fromData.citizenId = data.childrenCitizenId;
|
fromData.citizenId = data.childrenCitizenId;
|
||||||
fromData.prefix = data.childrenPrefix;
|
fromData.prefix = data.childrenPrefix;
|
||||||
fromData.firstName = data.childrenFirstName;
|
fromData.firstName = data.childrenFirstName;
|
||||||
|
|
@ -593,7 +601,7 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<q-space />
|
<q-space />
|
||||||
<div class="row q-col-gutter-sm">
|
<div class="row q-col-gutter-sm" v-if="coupleData.statusMarital">
|
||||||
<q-btn
|
<q-btn
|
||||||
round
|
round
|
||||||
flat
|
flat
|
||||||
|
|
@ -651,6 +659,12 @@ onMounted(() => {
|
||||||
{{ coupleData.job ?? "-" }}
|
{{ coupleData.job ?? "-" }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row items-center" v-if="coupleData.lastNameOld">
|
||||||
|
<div class="col-2 text-grey-6 text-weight-medium">นามสกุลเดิม</div>
|
||||||
|
<div class="col">
|
||||||
|
{{ coupleData.lastNameOld }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row items-center">
|
<div class="row items-center">
|
||||||
<div class="col-2 text-grey-6 text-weight-medium">
|
<div class="col-2 text-grey-6 text-weight-medium">
|
||||||
สถานภาพการมีชีวิต
|
สถานภาพการมีชีวิต
|
||||||
|
|
@ -775,7 +789,7 @@ onMounted(() => {
|
||||||
<q-form @submit.prevent greedy @validation-success="onSubmit(typeForm)">
|
<q-form @submit.prevent greedy @validation-success="onSubmit(typeForm)">
|
||||||
<DialogHeader
|
<DialogHeader
|
||||||
:tittle="
|
:tittle="
|
||||||
isEdit ? `แก้ไขข้อมูล${titleForm}` : `เพิ้มข้อมูลค${titleForm}`
|
isEdit ? `แก้ไขข้อมูล${titleForm}` : `เพิ้มข้อมูล${titleForm}`
|
||||||
"
|
"
|
||||||
:close="closeDialog"
|
:close="closeDialog"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
30
src/modules/04_registryNew/interface/index/family.ts
Normal file
30
src/modules/04_registryNew/interface/index/family.ts
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
interface FormPerson {
|
||||||
|
isLive: null | number | boolean | string;
|
||||||
|
citizenId: string;
|
||||||
|
prefix: string;
|
||||||
|
firstName: string;
|
||||||
|
lastName: string;
|
||||||
|
job: string;
|
||||||
|
lastNameOld?: string;
|
||||||
|
statusMarital?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface FormChildren {
|
||||||
|
id: string;
|
||||||
|
createdAt: string;
|
||||||
|
createdUserId: string;
|
||||||
|
lastUpdatedAt: string;
|
||||||
|
lastUpdateUserId: string;
|
||||||
|
createdFullName: string;
|
||||||
|
lastUpdateFullName: string;
|
||||||
|
childrenCareer: string;
|
||||||
|
childrenFirstName: string;
|
||||||
|
childrenLastName: string;
|
||||||
|
childrenPrefix: string;
|
||||||
|
childrenLive: boolean | number | null;
|
||||||
|
childrenCitizenId: string;
|
||||||
|
profileId: string | null;
|
||||||
|
profileEmployeeId: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type { FormPerson, FormChildren };
|
||||||
Loading…
Add table
Add a link
Reference in a new issue