UI ข้อมูลทะเบียนประวัติ(ยังไม่เสร็จ)

This commit is contained in:
STW_TTTY\stwtt 2024-05-23 18:03:23 +07:00
parent 3221535748
commit 8e7e120d73
10 changed files with 958 additions and 0 deletions

View 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>

View file

@ -0,0 +1,3 @@
<template>
<div>government</div>
</template>

View file

@ -0,0 +1,3 @@
<template>
<div>salary</div>
</template>

View file

@ -0,0 +1,3 @@
<template>
<div>insignia</div>
</template>

View file

@ -0,0 +1,3 @@
<template>
<div>other</div>
</template>