diff --git a/src/interface/Main.ts b/src/interface/Main.ts new file mode 100644 index 0000000..d330ce4 --- /dev/null +++ b/src/interface/Main.ts @@ -0,0 +1,30 @@ +interface ProfileData { + rank?: string; + prefix: string; + firstName: string; + lastName: string; + position: string; + posExecutiveName?: string; + posTypeName: string; + posLevelName: string; + posNo: string; +} + +interface InformationData { + rank?: string; //ยศ + citizenId: string; //เลขประจำตัวประชาชน + prefix: string; + firstName: string; + lastName: string; + birthDate: Date | null; //วันเกิด + gender: string; //เพศ + relationship: string; //สถานภาพ + nationality: string; //สัญชาติ + ethnicity: string; //เชื้อชาติ + religion: string; //ศาสนา + bloodGroup: string; //หมู่เลือด + phone: string; //เบอร์โทร + email: string; +} + +export type { ProfileData, InformationData }; diff --git a/src/modules/10_registry/01_Information/01_Information.vue b/src/modules/10_registry/01_Information/01_Information.vue index 76b3bad..00ad738 100644 --- a/src/modules/10_registry/01_Information/01_Information.vue +++ b/src/modules/10_registry/01_Information/01_Information.vue @@ -9,6 +9,7 @@ import http from "@/plugins/http"; import config from "@/app.config"; import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue"; +import type { InformationData } from "@/interface/Main"; const link = ref(""); const $q = useQuasar(); @@ -31,12 +32,13 @@ const rowsHistory = ref([]); const modalHistory = ref(false); /** ตัวแปรข้อมูล */ -const formDataInformation = reactive({ +const formDataInformation = reactive({ + rank: "", //ยศ citizenId: "", //เลขประจำตัวประชาชน prefix: "", firstName: "", lastName: "", - birthDate: "", //วันเกิด + birthDate: null, //วันเกิด gender: "", //เพศ relationship: "", //สถานภาพ nationality: "", //สัญชาติ @@ -247,6 +249,7 @@ async function getData() { .get(config.API.dataUserInformationByType(link.value)) .then(async (res) => { const data = await res.data.result; + formDataInformation.rank = data.rank; formDataInformation.citizenId = data.citizenId; formDataInformation.prefix = data.prefix; formDataInformation.firstName = data.firstName; @@ -395,7 +398,13 @@ onMounted(async () => {
{{ formDataInformation.firstName - ? `${formDataInformation.prefix}${formDataInformation.firstName} ${formDataInformation.lastName}` + ? `${ + formDataInformation.rank + ? formDataInformation.rank + : formDataInformation.prefix + }${formDataInformation.firstName} ${ + formDataInformation.lastName + }` : "-" }}
diff --git a/src/modules/10_registry/views/main.vue b/src/modules/10_registry/views/main.vue index dac383a..1ebb704 100644 --- a/src/modules/10_registry/views/main.vue +++ b/src/modules/10_registry/views/main.vue @@ -112,7 +112,6 @@ const clickBack = () => { function redirectToPagePetition() { router.push(`/registry/request-edit`); } -