UI ข้อมูลทะเบียนประวัติ(ยังไม่เสร็จ)
This commit is contained in:
parent
3221535748
commit
8e7e120d73
10 changed files with 958 additions and 0 deletions
615
src/modules/10_registry/tabs/01_information.vue
Normal file
615
src/modules/10_registry/tabs/01_information.vue
Normal file
|
|
@ -0,0 +1,615 @@
|
|||
<script setup lang="ts">
|
||||
import { useQuasar, type QTableProps } from "quasar";
|
||||
import { ref, reactive, onMounted } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
|
||||
const router = useRouter();
|
||||
const rowsHistoryName = ref<any[]>([]);
|
||||
const filter = ref<string>("");
|
||||
|
||||
const typeChangeName = (val: string) => {
|
||||
switch (val) {
|
||||
case "prefix":
|
||||
return "เปลี่ยนคำนำหน้าชื่อ";
|
||||
case "firstName":
|
||||
return "เปลี่ยนชื่อ";
|
||||
case "lastName":
|
||||
return "เปลี่ยนนามสกุล";
|
||||
case "all":
|
||||
return "เปลี่ยนคำนำหน้าชื่อ, ชื่อ-นามสกุล";
|
||||
case "firstNameLastName":
|
||||
return "เปลี่ยนชื่อ-นามสกุล";
|
||||
case "prefixAndlastName":
|
||||
return "เปลี่ยนคำนำหน้าชื่อ และนามสกุล";
|
||||
default:
|
||||
return "-";
|
||||
}
|
||||
};
|
||||
|
||||
const formDataInformation = reactive<any>({
|
||||
citizenId: "", //เลขบัตรประจำตัวประชาชน
|
||||
name: "", //ชื่อ
|
||||
birthDate: "", //วันเกิด
|
||||
gender: "", //เพศ
|
||||
relationship: "", //สถานภาพ
|
||||
|
||||
nationality: "", //สัญชาติ
|
||||
ethnicity: "", //เชื้อชาติ
|
||||
religion: "", //ศาสนา
|
||||
bloodGroup: "", //หมู่เลือด
|
||||
phone: "", //เบอร์โทร
|
||||
});
|
||||
|
||||
const formDataAddress = reactive<any>({
|
||||
registrationAddress: "", //ที่อยู่ตามทะเบียนบ้าน
|
||||
registrationProvince: "", //จังหวัด
|
||||
registrationDistrict: "", //เขต / อำเภอ
|
||||
registrationSubDistrict: "", //แขวง / ตำบล
|
||||
registrationZipCode: "", //รหัสไปรษณีย์
|
||||
|
||||
currentAddress: "", //ที่อยู่ปัจจุบัน
|
||||
currentProvince: "", //จังหวัด
|
||||
currentDistrict: "", //เขต / อำเภอ
|
||||
currentSubDistrict: "", //แขวง / ตำบล
|
||||
currentZipCode: "", //รหัสไปรษณีย์
|
||||
});
|
||||
|
||||
const visibleColumnsHistoryName = ref<string[]>([
|
||||
"no",
|
||||
"prefix",
|
||||
"firstName",
|
||||
"lastName",
|
||||
"status",
|
||||
]);
|
||||
|
||||
const columnsHistoryName = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "prefix",
|
||||
align: "left",
|
||||
label: "คำนำหน้าชื่อ",
|
||||
sortable: true,
|
||||
field: "prefix",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "firstName",
|
||||
align: "left",
|
||||
label: "ชื่อ",
|
||||
sortable: true,
|
||||
field: "firstName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "lastName",
|
||||
align: "left",
|
||||
label: "นามสกุล",
|
||||
sortable: true,
|
||||
field: "lastName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "status",
|
||||
align: "left",
|
||||
label: "สถานะการเปลี่ยนชื่อ",
|
||||
sortable: true,
|
||||
field: "status",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
|
||||
function getData() {
|
||||
showLoader()
|
||||
http
|
||||
.get(config.API.dataUserInformation)
|
||||
.then((res)=>{
|
||||
console.log(res.data)
|
||||
}).catch((e)=>{
|
||||
messageError($q,e)
|
||||
}).finally(()=>{
|
||||
hideLoader()
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getData()
|
||||
formDataInformation.citizenId = "4016500103241";
|
||||
formDataInformation.name = "นางกัณฐิมา กาฬสินธุ์";
|
||||
formDataInformation.birthDate = "24 พ.ย. 2511";
|
||||
formDataInformation.gender = "หญิง";
|
||||
formDataInformation.relationship = "";
|
||||
|
||||
formDataInformation.nationality = "";
|
||||
formDataInformation.ethnicity = "";
|
||||
formDataInformation.religion = "";
|
||||
formDataInformation.bloodGroup = "";
|
||||
formDataInformation.phone = "";
|
||||
|
||||
rowsHistoryName.value = [
|
||||
{
|
||||
prefix: "นางสาว",
|
||||
firstName: "อรัญญาวินัย",
|
||||
lastName: "พรไชยะสาร",
|
||||
status: "all",
|
||||
},
|
||||
{
|
||||
prefix: "นางสาว1",
|
||||
firstName: "อรัญญาวินัย1",
|
||||
lastName: "พรไชยะสาร1",
|
||||
status: "prefix",
|
||||
},
|
||||
];
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
<div v-if="!$q.screen.gt.xs" class="col-xs-12 col-sm-12 col-md-11">
|
||||
<div class="toptitle text-white col-12 row items-center">
|
||||
<q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/>
|
||||
<div>ข้อมูลส่วนตัว</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div :class="`row q-my-sm ${$q.screen.gt.xs ? '' : 'mobileClass'}`">
|
||||
<!-- ประวัติส่วนตัว -->
|
||||
<div class="col-12">
|
||||
<q-toolbar class="q-px-none">
|
||||
<span class="text-blue-6 text-weight-bold text-body1"
|
||||
>ประวัติส่วนตัว</span
|
||||
>
|
||||
<q-space />
|
||||
<q-btn icon="mdi-history" color="info" flat dense round size="14px">
|
||||
<q-tooltip>ประวัติแก้ไขข้อมูลส่วนตัว</q-tooltip>
|
||||
</q-btn>
|
||||
</q-toolbar>
|
||||
<q-card bordered class="bg-grey-1 q-pa-md">
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-12 col-md-6 q-gutter-y-sm">
|
||||
<div class="row">
|
||||
<div class="col-5 text-grey-6 text-weight-medium">
|
||||
เลขบัตรประจำตัวประชาชน
|
||||
</div>
|
||||
<div class="col-7">
|
||||
{{
|
||||
formDataInformation.citizenId
|
||||
? formDataInformation.citizenId
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-5 text-grey-6 text-weight-medium">
|
||||
ชื่อ - สกุล
|
||||
</div>
|
||||
<div class="col-7">
|
||||
{{ formDataInformation.name ? formDataInformation.name : "-" }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-5 text-grey-6 text-weight-medium">
|
||||
วัน/เดือน/ปีเกิด
|
||||
</div>
|
||||
<div class="col-7">
|
||||
{{
|
||||
formDataInformation.birthDate
|
||||
? formDataInformation.birthDate
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-5 text-grey-6 text-weight-medium">เพศ</div>
|
||||
<div class="col-7">
|
||||
{{
|
||||
formDataInformation.gender ? formDataInformation.gender : "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-5 text-grey-6 text-weight-medium">สถานภาพ</div>
|
||||
<div class="col-7">
|
||||
{{
|
||||
formDataInformation.relationship
|
||||
? formDataInformation.relationship
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-12 col-md-6 q-gutter-y-sm">
|
||||
<div class="row">
|
||||
<div class="col-5 text-grey-6 text-weight-medium">สัญชาติ</div>
|
||||
<div class="col-7">
|
||||
{{
|
||||
formDataInformation.nationality
|
||||
? formDataInformation.nationality
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-5 text-grey-6 text-weight-medium">เชื้อชาติ</div>
|
||||
<div class="col-7">
|
||||
{{
|
||||
formDataInformation.ethnicity
|
||||
? formDataInformation.ethnicity
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-5 text-grey-6 text-weight-medium">ศาสนา</div>
|
||||
<div class="col-7">
|
||||
{{
|
||||
formDataInformation.religion
|
||||
? formDataInformation.religion
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-5 text-grey-6 text-weight-medium">หมู่เลือด</div>
|
||||
<div class="col-7">
|
||||
{{
|
||||
formDataInformation.bloodGroup
|
||||
? formDataInformation.bloodGroup
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-5 text-grey-6 text-weight-medium">เบอร์โทร</div>
|
||||
<div class="col-7">
|
||||
{{
|
||||
formDataInformation.phone ? formDataInformation.phone : "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
|
||||
<!-- ประวัติการเปลี่ยนชื่อ-นามสกุล -->
|
||||
<div v-if="$q.screen.gt.xs" class="col-12">
|
||||
<q-toolbar class="q-px-none q-mt-md">
|
||||
<span class="text-blue-6 text-weight-bold text-body1"
|
||||
>ประวัติการเปลี่ยนชื่อ-นามสกุล</span
|
||||
>
|
||||
<q-space />
|
||||
<q-input
|
||||
v-if="$q.screen.gt.xs"
|
||||
class="inputgreen"
|
||||
outlined
|
||||
dense
|
||||
v-model="filter"
|
||||
label="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon
|
||||
v-if="filter !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="filter = ''"
|
||||
/>
|
||||
<q-icon
|
||||
v-else
|
||||
name="search"
|
||||
class="cursor-pointer"
|
||||
@click="filter = ''"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-select
|
||||
v-if="$q.screen.gt.xs"
|
||||
class="q-ml-sm"
|
||||
dense
|
||||
multiple
|
||||
outlined
|
||||
emit-value
|
||||
map-options
|
||||
options-cover
|
||||
options-dense
|
||||
option-value="name"
|
||||
style="min-width: 150px"
|
||||
v-model="visibleColumnsHistoryName"
|
||||
:options="columnsHistoryName"
|
||||
:display-value="$q.lang.table.columns"
|
||||
/>
|
||||
</q-toolbar>
|
||||
<d-table
|
||||
flat
|
||||
dense
|
||||
bordered
|
||||
virtual-scroll
|
||||
:rows="rowsHistoryName"
|
||||
:columns="columnsHistoryName"
|
||||
:filter="filter"
|
||||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
:visible-columns="visibleColumnsHistoryName"
|
||||
:virtual-scroll-sticky-size-start="48"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
<q-th auto-width />
|
||||
</q-tr>
|
||||
</template>
|
||||
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td v-for="(col, index) in props.cols" :key="col.name">
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'status'">
|
||||
{{ props.row.status ? typeChangeName(props.row.status) : "-" }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value }}
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
color="info"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="14px"
|
||||
icon="mdi-history"
|
||||
>
|
||||
<q-tooltip>ดูประวัติการเปลี่ยนชื่อ-นามสกุล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
|
||||
<div v-else class="col-12">
|
||||
<q-toolbar class="q-px-none q-mt-md">
|
||||
<span class="text-blue-6 text-weight-bold text-body1"
|
||||
>ประวัติการเปลี่ยนชื่อ-นามสกุล</span
|
||||
>
|
||||
</q-toolbar>
|
||||
|
||||
<q-list bordered style="border-radius: 8px">
|
||||
<div
|
||||
v-for="(item, index) in rowsHistoryName"
|
||||
:class="`${index % 2 !== 0 ? 'bg-grey-1' : ''}`"
|
||||
>
|
||||
<q-item class="q-pt-md relative-position" dense>
|
||||
<q-btn
|
||||
icon="mdi-history"
|
||||
color="info"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="14px"
|
||||
class="absolute-top-right"
|
||||
>
|
||||
<q-tooltip>ประวัติแก้ไขข้อมูลส่วนตัว</q-tooltip>
|
||||
</q-btn>
|
||||
<q-item-section class="text-grey-6 text-weight-medium"
|
||||
>คำนำหน้า</q-item-section
|
||||
>
|
||||
<q-item-section>{{
|
||||
item.prefix ? item.prefix : "-"
|
||||
}}</q-item-section>
|
||||
</q-item>
|
||||
<q-item class="q-py-none" dense>
|
||||
<q-item-section class="text-grey-6 text-weight-medium"
|
||||
>ชื่อ</q-item-section
|
||||
>
|
||||
<q-item-section>{{
|
||||
item.firstName ? item.firstName : "-"
|
||||
}}</q-item-section>
|
||||
</q-item>
|
||||
<q-item class="q-py-none" dense>
|
||||
<q-item-section class="text-grey-6 text-weight-medium"
|
||||
>นามสกุล</q-item-section
|
||||
>
|
||||
<q-item-section>{{
|
||||
item.lastName ? item.lastName : "-"
|
||||
}}</q-item-section>
|
||||
</q-item>
|
||||
<q-item class="q-py-none q-pb-sm" dense>
|
||||
<q-item-section class="text-grey-6 text-weight-medium"
|
||||
>สถานะ</q-item-section
|
||||
>
|
||||
<q-item-section>{{
|
||||
item.status ? typeChangeName(item.status) : "-"
|
||||
}}</q-item-section>
|
||||
</q-item>
|
||||
<q-separator v-if="index < rowsHistoryName.length - 1" />
|
||||
</div>
|
||||
</q-list>
|
||||
</div>
|
||||
|
||||
<!-- ข้อมูลที่อยู่ -->
|
||||
<div class="col-12">
|
||||
<q-toolbar class="q-px-none">
|
||||
<span class="text-blue-6 text-weight-bold text-body1"
|
||||
>ข้อมูลที่อยู่</span
|
||||
>
|
||||
<q-space />
|
||||
<q-btn icon="mdi-history" color="info" flat dense round size="14px">
|
||||
<q-tooltip>ประวัติข้อมูลที่อยู่</q-tooltip>
|
||||
</q-btn>
|
||||
</q-toolbar>
|
||||
<q-card bordered class="bg-grey-1 q-pa-md">
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-12 col-md-6 q-gutter-y-sm">
|
||||
<div class="row">
|
||||
<div class="col-5 text-grey-6 text-weight-medium">
|
||||
เลขบัตรประจำตัวประชาชน
|
||||
</div>
|
||||
<div class="col-7">
|
||||
{{
|
||||
formDataAddress.registrationAddress
|
||||
? formDataAddress.registrationAddress
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-5 text-grey-6 text-weight-medium">
|
||||
ชื่อ - สกุล
|
||||
</div>
|
||||
<div class="col-7">
|
||||
{{
|
||||
formDataAddress.registrationProvince
|
||||
? formDataAddress.registrationProvince
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-5 text-grey-6 text-weight-medium">
|
||||
วัน/เดือน/ปีเกิด
|
||||
</div>
|
||||
<div class="col-7">
|
||||
{{
|
||||
formDataAddress.registrationDistrict
|
||||
? formDataAddress.registrationDistrict
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-5 text-grey-6 text-weight-medium">เพศ</div>
|
||||
<div class="col-7">
|
||||
{{
|
||||
formDataAddress.registrationSubDistrict
|
||||
? formDataAddress.registrationSubDistrict
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-5 text-grey-6 text-weight-medium">สถานภาพ</div>
|
||||
<div class="col-7">
|
||||
{{
|
||||
formDataAddress.registrationZipCode
|
||||
? formDataAddress.registrationZipCode
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-12 col-md-6 q-gutter-y-sm">
|
||||
<div class="row">
|
||||
<div class="col-5 text-grey-6 text-weight-medium">สัญชาติ</div>
|
||||
<div class="col-7">
|
||||
{{
|
||||
formDataAddress.currentAddress
|
||||
? formDataAddress.currentAddress
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-5 text-grey-6 text-weight-medium">เชื้อชาติ</div>
|
||||
<div class="col-7">
|
||||
{{
|
||||
formDataAddress.currentProvince
|
||||
? formDataAddress.currentProvince
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-5 text-grey-6 text-weight-medium">ศาสนา</div>
|
||||
<div class="col-7">
|
||||
{{
|
||||
formDataAddress.currentDistrict
|
||||
? formDataAddress.currentDistrict
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-5 text-grey-6 text-weight-medium">หมู่เลือด</div>
|
||||
<div class="col-7">
|
||||
{{
|
||||
formDataAddress.currentSubDistrict
|
||||
? formDataAddress.currentSubDistrict
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-5 text-grey-6 text-weight-medium">เบอร์โทร</div>
|
||||
<div class="col-7">
|
||||
{{
|
||||
formDataAddress.currentZipCode
|
||||
? formDataAddress.currentZipCode
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style>
|
||||
.mobileClass {
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
3
src/modules/10_registry/tabs/02_government.vue
Normal file
3
src/modules/10_registry/tabs/02_government.vue
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<template>
|
||||
<div>government</div>
|
||||
</template>
|
||||
3
src/modules/10_registry/tabs/03_salary.vue
Normal file
3
src/modules/10_registry/tabs/03_salary.vue
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<template>
|
||||
<div>salary</div>
|
||||
</template>
|
||||
3
src/modules/10_registry/tabs/04_insignia.vue
Normal file
3
src/modules/10_registry/tabs/04_insignia.vue
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<template>
|
||||
<div>insignia</div>
|
||||
</template>
|
||||
3
src/modules/10_registry/tabs/05_other.vue
Normal file
3
src/modules/10_registry/tabs/05_other.vue
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<template>
|
||||
<div>other</div>
|
||||
</template>
|
||||
Loading…
Add table
Add a link
Reference in a new issue