แยก dialog

This commit is contained in:
setthawutttty 2024-10-22 17:42:03 +07:00
parent e0a2a2bc35
commit 17d1cc19c8
8 changed files with 1067 additions and 876 deletions

View file

@ -117,47 +117,25 @@ watch(
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<q-select
<q-input
dense
outlined
use-input
lazy-rules
emit-value
map-options
hide-bottom-space
input-debounce="0"
option-label="name"
option-value="name"
v-model="formInformations.prefix"
class="inputgreen"
:options="props.Ops.prefixOps"
:label="dataLabel.prefix"
:rules="[(val: string) => !!val || `${'กรุณาเลือก คำนำหน้าชื่อ'}`]"
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'prefixOps'
)"
:rules="[(val: string) => !!val || `${'กรุณากรอก คำนำหน้าชื่อ'}`]"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<q-select
<q-input
dense
outlined
clearable
use-input
lazy-rules
emit-value
map-options
hide-bottom-space
input-debounce="0"
option-label="name"
option-value="name"
v-model="formInformations.rank"
class="inputgreen"
:options="props.Ops.rankOps"
:label="dataLabel.rank"
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'rankOps'
)"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
@ -239,47 +217,23 @@ watch(
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<q-select
<q-input
dense
outlined
use-input
clearable
lazy-rules
emit-value
map-options
hide-bottom-space
input-debounce="0"
option-label="name"
option-value="name"
v-model="formInformations.gender"
class="inputgreen"
:options="props.Ops.genderOps"
:label="dataLabel.gender"
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'genderOps'
)"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<q-select
<q-input
dense
outlined
use-input
clearable
lazy-rules
emit-value
map-options
hide-bottom-space
option-value="name"
option-label="name"
input-debounce="0"
class="inputgreen"
v-model="formInformations.relationship"
:options="props.Ops.statusOps"
class="inputgreen"
:label="dataLabel.relationship"
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'statusOps'
)"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
@ -305,47 +259,13 @@ watch(
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<q-select
<q-input
dense
outlined
use-input
clearable
lazy-rules
emit-value
map-options
hide-bottom-space
option-value="name"
option-label="name"
input-debounce="0"
v-model="formInformations.religion"
class="inputgreen"
:options="props.Ops.religionOps"
:label="dataLabel.religion"
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'religionOps'
)"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<q-select
dense
outlined
use-input
clearable
lazy-rules
emit-value
map-options
hide-bottom-space
option-value="name"
option-label="name"
input-debounce="0"
v-model="formInformations.bloodGroup"
class="inputgreen"
:options="props.Ops.bloodOps"
:label="dataLabel.bloodGroup"
@filter="(inputValue: string,
doneFn: Function) => filterSelector(inputValue, doneFn, 'bloodOps'
)"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
@ -353,11 +273,9 @@ watch(
dense
outlined
lazy-rules
hide-bottom-space
mask="##########"
v-model="formInformations.bloodGroup"
class="inputgreen"
v-model="formInformations.phone"
:label="dataLabel.phone"
:label="dataLabel.bloodGroup"
/>
</div>
</div>

View file

@ -1,571 +0,0 @@
<script setup lang="ts">
import { useDataLinkCenter } from "@/modules/04_registryPerson/stores/LinkCenter";
import { useProfileDataStore } from "@/modules/04_registryPerson/stores/profile";
import type {
FormPerson,
FormChildren,
} from "@/modules/04_registryPerson/interface/index/family";
const fatherData = defineModel<FormPerson>("fatherData", { required: true });
const motherData = defineModel<FormPerson>("motherData", { required: true });
const coupleData = defineModel<FormPerson>("coupleData", { required: true });
const childData = defineModel<FormChildren[]>("childData", { required: true });
const storeProfile = useProfileDataStore();
const storeLinkCenter = useDataLinkCenter();
/**
* function นหาขอมลใน select
* @param val คำคนหา
* @param update function
*/
function filterSelectorRelation(val: any, update: Function) {
update(() => {
storeLinkCenter.optionRelationship =
storeLinkCenter.optionRelationshipMain.filter(
(v: any) => v.name.indexOf(val) > -1
);
});
}
/**
* เพมลบ row
* @param type 1 = เพ / 0 = ลบ
* @param index ระบาเป object วไหน
*/
function onChild(type: number, index?: number) {
if (type === 1) {
childData.value.push({
id: "",
createdAt: "",
createdUserId: "",
createdFullName: "",
lastUpdatedAt: "",
lastUpdateUserId: "",
lastUpdateFullName: "",
profileId: "",
profileEmployeeId: "",
childrenCitizenId: "",
childrenPrefix: "",
childrenFirstName: "",
childrenLastName: "",
childrenCareer: "",
childrenLive: 1,
} as FormChildren);
} else if (type === 0 && index !== undefined) {
childData.value.splice(index, 1);
}
}
</script>
<template>
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-12 text-tooltip text-weight-medium">อมลครอบคร</div>
<div class="col-xs-12 text-weight-bold"> ดา</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<q-input
outlined
hide-bottom-space
bg-color="white"
dense
v-model="fatherData.citizenId"
:label="`${'เลขประจำตัวประชาชน'}`"
maxlength="13"
:rules="[
(val:string) => !!val || 'กรุณากรอกเลขบัตรประชาชน',
(val:string) =>
val.length === 13 ||
'กรุณากรอกเลขบัตรประชาชนให้ครบ 13 หลัก',
]
"
class="inputgreen"
mask="#############"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-select
outlined
bg-color="white"
lazy-rules
hidden-space
hide-bottom-space
dense
class="inputgreen"
:rules="
[(val:string) => !!val || 'กรุณาเลือกคำนำหน้าชื่อ']
"
label="คำนำหน้าชื่อ"
v-model="fatherData.prefix"
use-input
input-debounce="0"
emit-value
map-options
:options="storeLinkCenter.OpsPerson.prefixOps"
option-label="name"
option-value="name"
@filter="(inputValue:string,
doneFn:Function) => storeProfile.filterSelector(inputValue, doneFn,'prefixOps'
) "
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
hide-bottom-space
bg-color="white"
class="inputgreen"
lazy-rules
v-model="fatherData.firstName"
:rules="
[(val:string) => !!val || 'กรุณากรอกชื่อ']
"
label="ชื่อ"
hidden-space
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
class="inputgreen"
bg-color="white"
hide-bottom-space
lazy-rules
v-model="fatherData.lastName"
:rules="
[(val:string) => !!val || 'กรุณากรอกนามสกุล']
"
label="นามสกุล"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<q-input
outlined
dense
class="inputgreen"
bg-color="white"
v-model="fatherData.job"
label="อาชีพ"
/>
</div>
<div class="col-12">
<div class="row q-my-xs">
<div class="q-mr-sm">สถานภาพการม</div>
<div>
<q-radio
class="q-mr-sm"
v-model="fatherData.isLive"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
:val="1"
label="ยังมีชีวิตอยู่"
dense
:color="!fatherData.isLive ? 'grey' : 'primary'"
/>
<q-radio
v-model="fatherData.isLive"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
:val="0"
:color="!fatherData.isLive ? 'grey' : 'red'"
label="ถึงแก่กรรม"
dense
/>
</div>
</div>
</div>
<div class="col-xs-12 text-weight-bold"> มารดา</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<q-input
outlined
hide-bottom-space
bg-color="white"
dense
v-model="motherData.citizenId"
:label="`${'เลขประจำตัวประชาชน'}`"
maxlength="13"
:rules="[
(val:string) => !!val || 'กรุณากรอกเลขบัตรประชาชน',
(val:string) =>
val.length === 13 ||
'กรุณากรอกเลขบัตรประชาชนให้ครบ 13 หลัก',
]
"
class="inputgreen"
mask="#############"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-select
outlined
bg-color="white"
lazy-rules
hidden-space
hide-bottom-space
dense
class="inputgreen"
:rules="
[(val:string) => !!val || 'กรุณาเลือกคำนำหน้าชื่อ']
"
label="คำนำหน้าชื่อ"
v-model="motherData.prefix"
use-input
input-debounce="0"
emit-value
map-options
:options="storeLinkCenter.OpsPerson.prefixOps"
option-label="name"
option-value="name"
@filter="(inputValue:string,
doneFn:Function) => storeProfile.filterSelector(inputValue, doneFn,'prefixOps'
) "
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
hide-bottom-space
bg-color="white"
class="inputgreen"
lazy-rules
v-model="motherData.firstName"
:rules="
[(val:string) => !!val || 'กรุณากรอกชื่อ']
"
label="ชื่อ"
hidden-space
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
class="inputgreen"
bg-color="white"
hide-bottom-space
lazy-rules
v-model="motherData.lastName"
:rules="
[(val:string) => !!val || 'กรุณากรอกนามสกุล']
"
label="นามสกุล"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<q-input
outlined
dense
class="inputgreen"
bg-color="white"
v-model="motherData.job"
label="อาชีพ"
/>
</div>
<div class="col-12">
<div class="row q-my-xs">
<div class="q-mr-sm">สถานภาพการม</div>
<div>
<q-radio
class="q-mr-sm"
v-model="motherData.isLive"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
:val="1"
label="ยังมีชีวิตอยู่"
dense
:color="!motherData.isLive ? 'grey' : 'primary'"
/>
<q-radio
v-model="motherData.isLive"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
:val="0"
:color="!motherData.isLive ? 'grey' : 'red'"
label="ถึงแก่กรรม"
dense
/>
</div>
</div>
</div>
<div class="col-xs-12 text-weight-bold"> สมรส</div>
<div class="col-12">
<div class="row q-col-gutter-x-xs">
<div class="col-xs-6 col-sm-6 col-md-2">
<q-select
outlined
bg-color="white"
lazy-rules
hidden-space
dense
class="inputgreen"
label="สถานภาพการสมรส"
v-model="coupleData.statusMarital"
use-input
input-debounce="0"
emit-value
map-options
:options="storeLinkCenter.optionRelationship"
option-label="name"
option-value="name"
@filter="(inputValue:string,
doneFn:Function) => filterSelectorRelation(inputValue, doneFn) "
/>
</div>
</div>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
bg-color="white"
dense
v-model="coupleData.citizenId"
:label="`${'เลขประจำตัวประชาชน'}`"
maxlength="13"
class="inputgreen"
mask="#############"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-select
outlined
bg-color="white"
lazy-rules
hidden-space
dense
class="inputgreen"
label="คำนำหน้าชื่อ"
v-model="coupleData.prefix"
use-input
input-debounce="0"
emit-value
map-options
:options="storeLinkCenter.OpsPerson.prefixOps"
option-label="name"
option-value="name"
@filter="(inputValue:string,
doneFn:Function) => storeProfile.filterSelector(inputValue, doneFn,'prefixOps'
) "
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
bg-color="white"
class="inputgreen"
lazy-rules
v-model="coupleData.firstName"
label="ชื่อ"
hidden-space
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
class="inputgreen"
bg-color="white"
hide-bottom-space
lazy-rules
v-model="coupleData.lastName"
label="นามสกุล"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
class="inputgreen"
bg-color="white"
lazy-rules
v-model="coupleData.lastNameOld"
label="นามสกุลเดิม"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
class="inputgreen"
bg-color="white"
v-model="coupleData.job"
label="อาชีพ"
/>
</div>
<div class="col-12">
<div class="row q-my-xs">
<div class="q-mr-sm">สถานภาพการม</div>
<div>
<q-radio
class="q-mr-sm"
v-model="coupleData.isLive"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
:val="1"
label="ยังมีชีวิตอยู่"
dense
:color="!coupleData.isLive ? 'grey' : 'primary'"
/>
<q-radio
v-model="coupleData.isLive"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
:val="0"
:color="!coupleData.isLive ? 'grey' : 'red'"
label="ถึงแก่กรรม"
dense
/>
</div>
</div>
</div>
<div class="col-xs-12 text-weight-bold">
ตร
<q-btn dense round flat icon="add" color="primary" @click="onChild(1)"
><q-tooltip>เพ</q-tooltip></q-btn
>
</div>
<div
class="row col-12 q-col-gutter-x-xs"
v-for="(item, index) in childData"
:key="index"
>
<div class="col-12 q-mb-xs">ตรคนท:{{ index + 1 }}</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<q-input
outlined
hide-bottom-space
bg-color="white"
dense
v-model="item.childrenCitizenId"
:label="`${'เลขประจำตัวประชาชน'}`"
maxlength="13"
:rules="[
(val:string) => !!val || 'กรุณากรอกเลขบัตรประชาชน',
(val:string) =>
val.length === 13 ||
'กรุณากรอกเลขบัตรประชาชนให้ครบ 13 หลัก',
]
"
class="inputgreen"
mask="#############"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-select
outlined
bg-color="white"
lazy-rules
hidden-space
hide-bottom-space
dense
class="inputgreen"
:rules="
[(val:string) => !!val || 'กรุณาเลือกคำนำหน้าชื่อ']
"
label="คำนำหน้าชื่อ"
v-model="item.childrenPrefix"
use-input
input-debounce="0"
emit-value
map-options
:options="storeLinkCenter.OpsPerson.prefixOps"
option-label="name"
option-value="name"
@filter="(inputValue:string,
doneFn:Function) => storeProfile.filterSelector(inputValue, doneFn,'prefixOps'
) "
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
hide-bottom-space
bg-color="white"
class="inputgreen"
lazy-rules
v-model="item.childrenFirstName"
:rules="
[(val:string) => !!val || 'กรุณากรอกชื่อ']
"
label="ชื่อ"
hidden-space
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
class="inputgreen"
bg-color="white"
hide-bottom-space
lazy-rules
v-model="item.childrenLastName"
:rules="
[(val:string) => !!val || 'กรุณากรอกนามสกุล']
"
label="นามสกุล"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
class="inputgreen"
bg-color="white"
v-model="item.childrenCareer"
label="อาชีพ"
/>
</div>
<div class="self-center">
<q-btn
dense
flat
round
icon="mdi-trash-can"
color="red"
@click="onChild(0, index)"
>
<q-tooltip>ลบ</q-tooltip>
</q-btn>
</div>
<div class="col-12">
<div class="row q-my-xs">
<div class="q-mr-sm">สถานภาพการม</div>
<div>
<q-radio
class="q-mr-sm"
v-model="item.childrenLive"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
:val="1"
label="ยังมีชีวิตอยู่"
dense
:color="!item.childrenLive ? 'grey' : 'primary'"
/>
<q-radio
v-model="item.childrenLive"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
:val="0"
:color="!item.childrenLive ? 'grey' : 'red'"
label="ถึงแก่กรรม"
dense
/>
</div>
</div>
</div>
</div>
</div>
</template>

View file

@ -0,0 +1,251 @@
<script setup lang="ts">
import { reactive } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataLinkCenter } from "@/modules/04_registryPerson/stores/LinkCenter";
import { useProfileDataStore } from "@/modules/04_registryPerson/stores/profile";
import type { FormPerson } from "@/modules/04_registryPerson/interface/index/family";
import Header from "@/components/DialogHeader.vue"; // popup
const $q = useQuasar();
const mixin = useCounterMixin();
const storeLinkCenter = useDataLinkCenter();
const storeProfile = useProfileDataStore();
const {
showLoader,
hideLoader,
messageError,
dialogConfirm,
modalError,
success,
} = mixin;
const modal = defineModel<boolean>("modal", { required: true }); // popup
const profileId = defineModel<string>("profileId", { required: true }); //id
const props = defineProps({
fetchData: Function,
requestId: String,
});
const fatherData = reactive<FormPerson>({
isLive: 1,
citizenId: "",
prefix: "",
firstName: "",
lastName: "",
job: "",
});
/** ปิด popup */
async function closeDialog() {
modal.value = false;
fatherData.isLive = 1;
fatherData.citizenId = "";
fatherData.prefix = "";
fatherData.firstName = "";
fatherData.lastName = "";
fatherData.job = "";
}
async function onSubmit() {
dialogConfirm($q, async () => {
const body = {
profileId: profileId.value,
fatherCitizenId: fatherData.citizenId,
fatherPrefix: fatherData.prefix,
fatherFirstName: fatherData.firstName,
fatherLastName: fatherData.lastName,
fatherCareer: fatherData.job,
fatherLive: fatherData.isLive === 1 ? true : false,
};
http
.post(config.API.profileFamily("", "father"), body)
.then(async (res) => {
await upDateStatus();
success($q, "บันทึกข้อมูลสำเร็จ");
closeDialog();
await props.fetchData?.();
})
.catch((e) => {
messageError($q, e);
hideLoader();
})
.finally(() => {});
});
}
/** ส่ง สถานะ ดำเนินการเเล้ว */
async function upDateStatus() {
await http
.patch(config.API.requestEdit + `${props.requestId}`, {
status: "COMPLETE",
remark: "",
})
.then(async () => {
await props.fetchData?.();
await success($q, "บันทึกข้อมูลสำเร็จ");
closeDialog();
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
</script>
<template>
<q-dialog v-model="modal" persistent>
<q-card class="col-12" style="width: 80vw">
<q-form greedy @submit.prevent @validation-success="onSubmit">
<Header tittle="ขอปรับปรุงข้อมูลบิดา" :close="closeDialog" />
<q-separator />
<q-card-section class="scroll" style="max-height: 80vh">
<div class="row q-col-gutter-sm">
<div class="col-12">
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-xs-6 col-sm-6 col-md-3">
<q-input
outlined
hide-bottom-space
bg-color="white"
dense
v-model="fatherData.citizenId"
:label="`${'เลขประจำตัวประชาชน'}`"
maxlength="13"
:rules="[
(val:string) => !!val || 'กรุณากรอกเลขบัตรประชาชน',
(val:string) =>
val.length === 13 ||
'กรุณากรอกเลขบัตรประชาชนให้ครบ 13 หลัก',
]
"
class="inputgreen"
mask="#############"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-select
outlined
bg-color="white"
lazy-rules
hidden-space
hide-bottom-space
dense
class="inputgreen"
:rules="
[(val:string) => !!val || 'กรุณาเลือกคำนำหน้าชื่อ']
"
label="คำนำหน้าชื่อ"
v-model="fatherData.prefix"
use-input
input-debounce="0"
emit-value
map-options
:options="storeLinkCenter.OpsPerson.prefixOps"
option-label="name"
option-value="name"
@filter="(inputValue:string,
doneFn:Function) => storeProfile.filterSelector(inputValue, doneFn,'prefixOps'
) "
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
hide-bottom-space
bg-color="white"
class="inputgreen"
lazy-rules
v-model="fatherData.firstName"
:rules="
[(val:string) => !!val || 'กรุณากรอกชื่อ']
"
label="ชื่อ"
hidden-space
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
class="inputgreen"
bg-color="white"
hide-bottom-space
lazy-rules
v-model="fatherData.lastName"
:rules="
[(val:string) => !!val || 'กรุณากรอกนามสกุล']
"
label="นามสกุล"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<q-input
outlined
dense
class="inputgreen"
bg-color="white"
v-model="fatherData.job"
label="อาชีพ"
/>
</div>
<div class="col-12">
<div class="row q-my-xs">
<div class="q-mr-sm">สถานภาพการม</div>
<div>
<q-radio
class="q-mr-sm"
v-model="fatherData.isLive"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
:val="1"
label="ยังมีชีวิตอยู่"
dense
:color="!fatherData.isLive ? 'grey' : 'primary'"
/>
<q-radio
v-model="fatherData.isLive"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
:val="0"
:color="!fatherData.isLive ? 'grey' : 'red'"
label="ถึงแก่กรรม"
dense
/>
</div>
</div>
</div>
</div>
</div>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right">
<q-btn
label="บันทึกลงทะเบียนประวัติ"
color="secondary"
type="submit"
/>
<q-btn label="ยกเลิก" color="orange" @click="modal = false"
><q-tooltip>ยกเล</q-tooltip></q-btn
>
</q-card-actions>
</q-form>
</q-card>
</q-dialog>
</template>

View file

@ -0,0 +1,250 @@
<script setup lang="ts">
import { reactive } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataLinkCenter } from "@/modules/04_registryPerson/stores/LinkCenter";
import { useProfileDataStore } from "@/modules/04_registryPerson/stores/profile";
import type { FormPerson } from "@/modules/04_registryPerson/interface/index/family";
import Header from "@/components/DialogHeader.vue"; // popup
const $q = useQuasar();
const mixin = useCounterMixin();
const storeLinkCenter = useDataLinkCenter();
const storeProfile = useProfileDataStore();
const {
showLoader,
hideLoader,
messageError,
dialogConfirm,
modalError,
success,
} = mixin;
const props = defineProps({
fetchData: Function,
requestId: String,
});
const modal = defineModel<boolean>("modal", { required: true }); // popup
const profileId = defineModel<string>("profileId", { required: true }); //id
const motherData = reactive<FormPerson>({
isLive: 1,
citizenId: "",
prefix: "",
firstName: "",
lastName: "",
job: "",
});
/** ปิด popup */
async function closeDialog() {
modal.value = false;
motherData.isLive = 1;
motherData.citizenId = "";
motherData.prefix = "";
motherData.firstName = "";
motherData.lastName = "";
motherData.job = "";
}
async function onSubmit() {
dialogConfirm($q, async () => {
const body = {
profileId: profileId.value,
motherCitizenId: motherData.citizenId,
motherPrefix: motherData.prefix,
motherFirstName: motherData.firstName,
motherLastName: motherData.lastName,
motherCareer: motherData.job,
motherLive: motherData.isLive === 1 ? true : false,
};
http
.post(config.API.profileFamily("", "mother"), body)
.then(async (res) => {
await upDateStatus();
success($q, "บันทึกข้อมูลสำเร็จ");
closeDialog();
await props.fetchData?.();
})
.catch((e) => {
messageError($q, e);
hideLoader();
})
.finally(() => {});
});
}
/** ส่ง สถานะ ดำเนินการเเล้ว */
async function upDateStatus() {
await http
.patch(config.API.requestEdit + `${props.requestId}`, {
status: "COMPLETE",
remark: "",
})
.then(async () => {
await props.fetchData?.();
await success($q, "บันทึกข้อมูลสำเร็จ");
closeDialog();
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
</script>
<template>
<q-dialog v-model="modal" persistent>
<q-card class="col-12" style="width: 80vw">
<q-form greedy @submit.prevent @validation-success="onSubmit">
<Header tittle="ขอปรับปรุงข้อมูลมารดา" :close="closeDialog" />
<q-separator />
<q-card-section class="scroll" style="max-height: 80vh">
<div class="row q-col-gutter-sm">
<div class="col-12">
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
<div class="col-xs-6 col-sm-6 col-md-3">
<q-input
outlined
hide-bottom-space
bg-color="white"
dense
v-model="motherData.citizenId"
:label="`${'เลขประจำตัวประชาชน'}`"
maxlength="13"
:rules="[
(val:string) => !!val || 'กรุณากรอกเลขบัตรประชาชน',
(val:string) =>
val.length === 13 ||
'กรุณากรอกเลขบัตรประชาชนให้ครบ 13 หลัก',
]
"
class="inputgreen"
mask="#############"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-select
outlined
bg-color="white"
lazy-rules
hidden-space
hide-bottom-space
dense
class="inputgreen"
:rules="
[(val:string) => !!val || 'กรุณาเลือกคำนำหน้าชื่อ']
"
label="คำนำหน้าชื่อ"
v-model="motherData.prefix"
use-input
input-debounce="0"
emit-value
map-options
:options="storeLinkCenter.OpsPerson.prefixOps"
option-label="name"
option-value="name"
@filter="(inputValue:string,
doneFn:Function) => storeProfile.filterSelector(inputValue, doneFn,'prefixOps'
) "
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
hide-bottom-space
bg-color="white"
class="inputgreen"
lazy-rules
v-model="motherData.firstName"
:rules="
[(val:string) => !!val || 'กรุณากรอกชื่อ']
"
label="ชื่อ"
hidden-space
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
class="inputgreen"
bg-color="white"
hide-bottom-space
lazy-rules
v-model="motherData.lastName"
:rules="
[(val:string) => !!val || 'กรุณากรอกนามสกุล']
"
label="นามสกุล"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<q-input
outlined
dense
class="inputgreen"
bg-color="white"
v-model="motherData.job"
label="อาชีพ"
/>
</div>
<div class="col-12">
<div class="row q-my-xs">
<div class="q-mr-sm">สถานภาพการม</div>
<div>
<q-radio
class="q-mr-sm"
v-model="motherData.isLive"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
:val="1"
label="ยังมีชีวิตอยู่"
dense
:color="!motherData.isLive ? 'grey' : 'primary'"
/>
<q-radio
v-model="motherData.isLive"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
:val="0"
:color="!motherData.isLive ? 'grey' : 'red'"
label="ถึงแก่กรรม"
dense
/>
</div>
</div>
</div>
</div>
</div>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right">
<q-btn
label="บันทึกลงทะเบียนประวัติ"
color="secondary"
type="submit"
/>
<q-btn label="ยกเลิก" color="orange" @click="modal = false"
><q-tooltip>ยกเล</q-tooltip></q-btn
>
</q-card-actions>
</q-form>
</q-card>
</q-dialog>
</template>

View file

@ -0,0 +1,280 @@
<script setup lang="ts">
import { reactive } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataLinkCenter } from "@/modules/04_registryPerson/stores/LinkCenter";
import { useProfileDataStore } from "@/modules/04_registryPerson/stores/profile";
import type { FormPerson } from "@/modules/04_registryPerson/interface/index/family";
import Header from "@/components/DialogHeader.vue"; // popup
const $q = useQuasar();
const mixin = useCounterMixin();
const storeLinkCenter = useDataLinkCenter();
const storeProfile = useProfileDataStore();
const {
showLoader,
hideLoader,
messageError,
dialogConfirm,
modalError,
success,
} = mixin;
const modal = defineModel<boolean>("modal", { required: true }); // popup
const profileId = defineModel<string>("profileId", { required: true }); //id
const props = defineProps({
fetchData: Function,
requestId: String,
});
const coupleData = reactive<FormPerson>({
isLive: 1,
citizenId: "",
prefix: "",
firstName: "",
lastName: "",
job: "",
lastNameOld: "",
statusMarital: "",
});
/** ปิด popup */
async function closeDialog() {
modal.value = false;
coupleData.isLive = 1;
coupleData.citizenId = "";
coupleData.prefix = "";
coupleData.firstName = "";
coupleData.lastName = "";
coupleData.job = "";
coupleData.lastNameOld = "";
coupleData.statusMarital = "";
}
async function onSubmit() {
dialogConfirm($q, async () => {
const body = {
profileId: profileId.value,
coupleCitizenId: coupleData.citizenId,
couplePrefix: coupleData.prefix,
coupleFirstName: coupleData.firstName,
coupleLastName: coupleData.lastName,
coupleCareer: coupleData.job,
coupleLive: coupleData.isLive === 1 ? true : false,
relationship: coupleData.statusMarital,
coupleLastNameOld: coupleData.lastNameOld,
};
http
.post(config.API.profileFamily("", "couple"), body)
.then(async (res) => {
await upDateStatus();
success($q, "บันทึกข้อมูลสำเร็จ");
closeDialog();
await props.fetchData?.();
})
.catch((e) => {
messageError($q, e);
hideLoader();
})
.finally(() => {});
});
}
/** ส่ง สถานะ ดำเนินการเเล้ว */
async function upDateStatus() {
await http
.patch(config.API.requestEdit + `${props.requestId}`, {
status: "COMPLETE",
remark: "",
})
.then(async () => {
await props.fetchData?.();
await success($q, "บันทึกข้อมูลสำเร็จ");
closeDialog();
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
/**
* function นหาขอมลใน select
* @param val คำคนหา
* @param update function
*/
function filterSelectorRelation(val: any, update: Function) {
update(() => {
storeLinkCenter.optionRelationship =
storeLinkCenter.optionRelationshipMain.filter(
(v: any) => v.name.indexOf(val) > -1
);
});
}
</script>
<template>
<q-dialog v-model="modal" persistent>
<q-card class="col-12" style="width: 80vw">
<q-form greedy @submit.prevent @validation-success="onSubmit">
<Header tittle="คู่สมรส" :close="closeDialog" />
<q-separator />
<q-card-section class="scroll" style="max-height: 80vh">
<div class="row q-col-gutter-sm">
<div class="col-12">
<div class="row q-col-gutter-x-xs">
<div class="col-xs-6 col-sm-6 col-md-2">
<q-select
outlined
bg-color="white"
lazy-rules
hidden-space
dense
class="inputgreen"
label="สถานภาพการสมรส"
v-model="coupleData.statusMarital"
use-input
input-debounce="0"
emit-value
map-options
:options="storeLinkCenter.optionRelationship"
option-label="name"
option-value="name"
@filter="(inputValue:string,
doneFn:Function) => filterSelectorRelation(inputValue, doneFn) "
/>
</div>
</div>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
bg-color="white"
dense
v-model="coupleData.citizenId"
:label="`${'เลขประจำตัวประชาชน'}`"
maxlength="13"
class="inputgreen"
mask="#############"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-select
outlined
bg-color="white"
lazy-rules
hidden-space
dense
class="inputgreen"
label="คำนำหน้าชื่อ"
v-model="coupleData.prefix"
use-input
input-debounce="0"
emit-value
map-options
:options="storeLinkCenter.OpsPerson.prefixOps"
option-label="name"
option-value="name"
@filter="(inputValue:string,
doneFn:Function) => storeProfile.filterSelector(inputValue, doneFn,'prefixOps'
) "
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
bg-color="white"
class="inputgreen"
lazy-rules
v-model="coupleData.firstName"
label="ชื่อ"
hidden-space
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
class="inputgreen"
bg-color="white"
hide-bottom-space
lazy-rules
v-model="coupleData.lastName"
label="นามสกุล"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
class="inputgreen"
bg-color="white"
lazy-rules
v-model="coupleData.lastNameOld"
label="นามสกุลเดิม"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
class="inputgreen"
bg-color="white"
v-model="coupleData.job"
label="อาชีพ"
/>
</div>
<div class="col-12">
<div class="row q-my-xs">
<div class="q-mr-sm">สถานภาพการม</div>
<div>
<q-radio
class="q-mr-sm"
v-model="coupleData.isLive"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
:val="1"
label="ยังมีชีวิตอยู่"
dense
:color="!coupleData.isLive ? 'grey' : 'primary'"
/>
<q-radio
v-model="coupleData.isLive"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
:val="0"
:color="!coupleData.isLive ? 'grey' : 'red'"
label="ถึงแก่กรรม"
dense
/>
</div>
</div>
</div>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right">
<q-btn
label="บันทึกลงทะเบียนประวัติ"
color="secondary"
type="submit"
/>
<q-btn label="ยกเลิก" color="orange" @click="modal = false"
><q-tooltip>ยกเล</q-tooltip></q-btn
>
</q-card-actions>
</q-form>
</q-card>
</q-dialog>
</template>

View file

@ -0,0 +1,276 @@
<script setup lang="ts">
import { ref, reactive } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataLinkCenter } from "@/modules/04_registryPerson/stores/LinkCenter";
import { useProfileDataStore } from "@/modules/04_registryPerson/stores/profile";
import type { FormChildren } from "@/modules/04_registryPerson/interface/index/family";
import Header from "@/components/DialogHeader.vue"; // popup
const $q = useQuasar();
const mixin = useCounterMixin();
const storeLinkCenter = useDataLinkCenter();
const storeProfile = useProfileDataStore();
const {
showLoader,
hideLoader,
messageError,
dialogConfirm,
modalError,
success,
} = mixin;
const props = defineProps({
fetchData: Function,
requestId: String,
});
const modal = defineModel<boolean>("modal", { required: true }); // popup
const profileId = defineModel<string>("profileId", { required: true }); //id
const childData = ref<FormChildren[]>([]);
/** ปิด popup */
async function closeDialog() {
modal.value = false;
childData.value = [];
}
/** อัพเดตข้อมูลครอบครัว */
async function onSubmit() {
if (childData.value.length !== 0) {
for (const child of childData.value) {
saveChildren(child);
}
}
}
async function saveChildren(child: FormChildren) {
const body = {
profileId: profileId.value,
childrenCitizenId: child.childrenCitizenId,
childrenPrefix: child.childrenPrefix,
childrenFirstName: child.childrenFirstName,
childrenLastName: child.childrenLastName,
childrenCareer: child.childrenCareer,
childrenLive: child.childrenLive === 1 ? true : false,
};
return http
.post(config.API.profileFamily("", "children"), body)
.then((res) => {})
.catch((e) => {
messageError($q, e);
hideLoader();
})
.finally(() => {});
}
/**
* เพมลบ row
* @param type 1 = เพ / 0 = ลบ
* @param index ระบาเป object วไหน
*/
function onChild(type: number, index?: number) {
if (type === 1) {
childData.value.push({
id: "",
createdAt: "",
createdUserId: "",
createdFullName: "",
lastUpdatedAt: "",
lastUpdateUserId: "",
lastUpdateFullName: "",
profileId: "",
profileEmployeeId: "",
childrenCitizenId: "",
childrenPrefix: "",
childrenFirstName: "",
childrenLastName: "",
childrenCareer: "",
childrenLive: 1,
} as FormChildren);
} else if (type === 0 && index !== undefined) {
childData.value.splice(index, 1);
}
}
</script>
<template>
<q-dialog v-model="modal" persistent>
<q-card class="col-12" style="width: 80vw">
<q-form greedy @submit.prevent @validation-success="onSubmit">
<Header tittle="ขอปรับปรุงข้อมูลบุตร" :close="closeDialog" />
<q-separator />
<q-card-section class="scroll" style="max-height: 80vh">
<div class="row q-col-gutter-sm">
<div class="col-xs-12 text-weight-bold">
ตร
<q-btn
dense
round
flat
icon="add"
color="primary"
@click="onChild(1)"
><q-tooltip>เพ</q-tooltip></q-btn
>
</div>
<div
class="row col-12 q-col-gutter-x-xs"
v-for="(item, index) in childData"
:key="index"
>
<div class="col-12 q-mb-xs">ตรคนท:{{ index + 1 }}</div>
<div class="col-xs-6 col-sm-6 col-md-3">
<q-input
outlined
hide-bottom-space
bg-color="white"
dense
v-model="item.childrenCitizenId"
:label="`${'เลขประจำตัวประชาชน'}`"
maxlength="13"
:rules="[
(val:string) => !!val || 'กรุณากรอกเลขบัตรประชาชน',
(val:string) =>
val.length === 13 ||
'กรุณากรอกเลขบัตรประชาชนให้ครบ 13 หลัก',
]
"
class="inputgreen"
mask="#############"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-select
outlined
bg-color="white"
lazy-rules
hidden-space
hide-bottom-space
dense
class="inputgreen"
:rules="
[(val:string) => !!val || 'กรุณาเลือกคำนำหน้าชื่อ']
"
label="คำนำหน้าชื่อ"
v-model="item.childrenPrefix"
use-input
input-debounce="0"
emit-value
map-options
:options="storeLinkCenter.OpsPerson.prefixOps"
option-label="name"
option-value="name"
@filter="(inputValue:string,
doneFn:Function) => storeProfile.filterSelector(inputValue, doneFn,'prefixOps'
) "
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
hide-bottom-space
bg-color="white"
class="inputgreen"
lazy-rules
v-model="item.childrenFirstName"
:rules="
[(val:string) => !!val || 'กรุณากรอกชื่อ']
"
label="ชื่อ"
hidden-space
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
class="inputgreen"
bg-color="white"
hide-bottom-space
lazy-rules
v-model="item.childrenLastName"
:rules="
[(val:string) => !!val || 'กรุณากรอกนามสกุล']
"
label="นามสกุล"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-2">
<q-input
outlined
dense
class="inputgreen"
bg-color="white"
v-model="item.childrenCareer"
label="อาชีพ"
/>
</div>
<div class="self-center">
<q-btn
dense
flat
round
icon="mdi-trash-can"
color="red"
@click="onChild(0, index)"
>
<q-tooltip>ลบ</q-tooltip>
</q-btn>
</div>
<div class="col-12">
<div class="row q-my-xs">
<div class="q-mr-sm">สถานภาพการม</div>
<div>
<q-radio
class="q-mr-sm"
v-model="item.childrenLive"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
:val="1"
label="ยังมีชีวิตอยู่"
dense
:color="!item.childrenLive ? 'grey' : 'primary'"
/>
<q-radio
v-model="item.childrenLive"
checked-icon="task_alt"
unchecked-icon="panorama_fish_eye"
:val="0"
:color="!item.childrenLive ? 'grey' : 'red'"
label="ถึงแก่กรรม"
dense
/>
</div>
</div>
</div>
</div>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right">
<q-btn
label="บันทึกลงทะเบียนประวัติ"
color="secondary"
type="submit"
/>
<q-btn label="ยกเลิก" color="orange" @click="modal = false"
><q-tooltip>ยกเล</q-tooltip></q-btn
>
</q-card-actions>
</q-form>
</q-card>
</q-dialog>
</template>

View file

@ -19,7 +19,6 @@ import type {
import Header from "@/components/DialogHeader.vue"; // popup
import InformationPage from "@/modules/04_registryPerson/components/Dialog/01_Information.vue"; //form
import AddressPage from "@/modules/04_registryPerson/components/Dialog/02_Address.vue"; //form
import FamilyPage from "@/modules/04_registryPerson/components/Dialog/03_Family.vue"; //form
const modal = defineModel<boolean>("modal", { required: true }); // popup
const idCard = defineModel<string>("idCard", { required: true }); //
@ -57,7 +56,6 @@ const formInformations = reactive<RequestObject>({
nationality: null,
ethnicity: null,
birthDate: null,
phone: null,
lastName: "",
firstName: "",
prefix: "",
@ -78,38 +76,9 @@ const formDataAddress = reactive<RequestAddressObject>({
registrationAddress: "",
});
const fatherData = reactive<FormPerson>({
isLive: 1,
citizenId: "",
prefix: "",
firstName: "",
lastName: "",
job: "",
});
const motherData = reactive<FormPerson>({
isLive: 1,
citizenId: "",
prefix: "",
firstName: "",
lastName: "",
job: "",
});
const coupleData = reactive<FormPerson>({
isLive: 1,
citizenId: "",
prefix: "",
firstName: "",
lastName: "",
job: "",
lastNameOld: "",
statusMarital: "",
});
const childData = ref<FormChildren[]>([]);
/** ปิด popup */
async function closeDialog() {
modal.value = false;
childData.value = [];
formInformations.bloodGroup = null;
formInformations.relationship = null;
@ -119,34 +88,10 @@ async function closeDialog() {
formInformations.nationality = null;
formInformations.ethnicity = null;
formInformations.birthDate = null;
formInformations.phone = null;
formInformations.lastName = "";
formInformations.firstName = "";
formInformations.prefix = "";
formInformations.rank = null;
fatherData.isLive = 1;
fatherData.citizenId = "";
fatherData.prefix = "";
fatherData.firstName = "";
fatherData.lastName = "";
fatherData.job = "";
motherData.isLive = 1;
motherData.citizenId = "";
motherData.prefix = "";
motherData.firstName = "";
motherData.lastName = "";
motherData.job = "";
coupleData.isLive = 1;
coupleData.citizenId = "";
coupleData.prefix = "";
coupleData.firstName = "";
coupleData.lastName = "";
coupleData.job = "";
coupleData.lastNameOld = "";
coupleData.statusMarital = "";
}
/** อัพเดตข้อมูลส่วนตัว */
@ -195,104 +140,6 @@ async function upDateAddress() {
.finally(() => {});
}
/** อัพเดตข้อมูลครอบครัว */
async function upDateFamily() {
await saveFather();
await saveMother();
if (coupleData.citizenId !== "") {
saveCouple();
}
if (childData.value.length !== 0) {
for (const child of childData.value) {
saveChildren(child);
}
}
count.value += 1;
}
async function saveFather() {
const body = {
profileId: profileId.value,
fatherCitizenId: fatherData.citizenId,
fatherPrefix: fatherData.prefix,
fatherFirstName: fatherData.firstName,
fatherLastName: fatherData.lastName,
fatherCareer: fatherData.job,
fatherLive: fatherData.isLive === 1 ? true : false,
};
http
.post(config.API.profileFamily("", "father"), body)
.then((res) => {})
.catch((e) => {
messageError($q, e);
hideLoader();
})
.finally(() => {});
}
async function saveMother() {
const body = {
profileId: profileId.value,
motherCitizenId: motherData.citizenId,
motherPrefix: motherData.prefix,
motherFirstName: motherData.firstName,
motherLastName: motherData.lastName,
motherCareer: motherData.job,
motherLive: motherData.isLive === 1 ? true : false,
};
http
.post(config.API.profileFamily("", "mother"), body)
.then((res) => {})
.catch((e) => {
messageError($q, e);
hideLoader();
})
.finally(() => {});
}
async function saveCouple() {
const body = {
profileId: profileId.value,
coupleCitizenId: coupleData.citizenId,
couplePrefix: coupleData.prefix,
coupleFirstName: coupleData.firstName,
coupleLastName: coupleData.lastName,
coupleCareer: coupleData.job,
coupleLive: coupleData.isLive === 1 ? true : false,
relationship: coupleData.statusMarital,
coupleLastNameOld: coupleData.lastNameOld,
};
http
.post(config.API.profileFamily("", "couple"), body)
.then((res) => {})
.catch((e) => {
messageError($q, e);
hideLoader();
})
.finally(() => {});
}
async function saveChildren(child: FormChildren) {
const body = {
profileId: profileId.value,
childrenCitizenId: child.childrenCitizenId,
childrenPrefix: child.childrenPrefix,
childrenFirstName: child.childrenFirstName,
childrenLastName: child.childrenLastName,
childrenCareer: child.childrenCareer,
childrenLive: child.childrenLive === 1 ? true : false,
};
return http
.post(config.API.profileFamily("", "children"), body)
.then((res) => {})
.catch((e) => {
messageError($q, e);
hideLoader();
})
.finally(() => {});
}
/** ส่ง สถานะ ดำเนินการเเล้ว */
async function upDateStatus() {
await http
@ -318,8 +165,7 @@ function onSubmit() {
showLoader();
await upDateInfomation();
await upDateAddress();
await upDateFamily();
if (count.value == 3) {
if (count.value == 2) {
await upDateStatus();
success($q, "บันทึกข้อมูลสำเร็จ");
closeDialog();
@ -334,53 +180,6 @@ async function amiRequest() {
data.value = profile;
data.value = profile;
data.value = {
titleCode: 3,
titleDesc: "นาย",
titleName: "นาย",
titleSex: 1,
firstName: "ชัยชนะ",
middleName: "",
lastName: "เรืองโรจน์",
genderCode: 1,
genderDesc: "ชาย",
dateOfBirth: 25211228,
nationalityCode: 99,
nationalityDesc: "ไทย",
ownerStatusDesc: "เจ้าบ้าน",
statusOfPersonCode: 0,
statusOfPersonDesc: "บุคคลนี้มีภูมิลำเนาอยู่ในบ้านนี้",
dateOfMoveIn: 25580728,
age: 45,
fatherPersonalID: 3102100621479,
fatherName: "บุญเชิด",
fatherNationalityCode: 99,
fatherNationalityDesc: "ไทย",
motherPersonalID: 3102100621487,
motherName: "พยอม",
motherNationalityCode: 99,
motherNationalityDesc: "ไทย",
fullnameAndRank: "นายสุพลชัย พูลสวัสดิ์",
englishTitleDesc: "MR.",
englishFirstName: "SUPHONCHAI",
englishMiddleName: "",
englishLastName: "PHOONSAWAT",
registrationAddress: "1220-1222 ถนนเพชรบุรี",
registrationProvinceId: "24bf701c-33d6-436e-ad49-6f82bb3ae017",
registrationDistrictId: "34bf701c-33d6-436e-ad49-6f82bb3b0586",
registrationSubDistrictId: "44bf701c-33d6-436e-ad49-6f82bb3b5649",
registrationZipCode: "10400",
currentAddress: "1220-1222 ถนนเพชรบุรี",
currentProvinceId: "24bf701c-33d6-436e-ad49-6f82bb3ae017",
currentDistrictId: "34bf701c-33d6-436e-ad49-6f82bb3b0586",
currentSubDistrictId: "44bf701c-33d6-436e-ad49-6f82bb3b5649",
currentZipCode: "10400",
};
formInformations.citizenId = idCard.value;
formInformations.prefix = data.value.titleName;
fullName.value = data.value.fullnameAndRank;
@ -496,17 +295,6 @@ watch(
v-model:present-address="presentAddress"
/>
</div>
<div class="col-12">
<q-separator />
</div>
<div class="col-12">
<FamilyPage
v-model:father-data="fatherData"
v-model:mother-data="motherData"
v-model:couple-data="coupleData"
v-model:child-data="childData"
/>
</div>
</div>
</q-card-section>
<q-separator />

View file

@ -8,7 +8,6 @@ interface RequestObject {
gender: string | null;
lastName: string;
nationality: string | null;
phone: string | null;
// posLevelId: string;
// posTypeId: string;
prefix: string;