fixing rank registry & change type any to interface
This commit is contained in:
parent
32b83298cd
commit
516a405df4
4 changed files with 68 additions and 11 deletions
|
|
@ -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<string>("");
|
||||
const $q = useQuasar();
|
||||
|
|
@ -31,12 +32,13 @@ const rowsHistory = ref<any[]>([]);
|
|||
const modalHistory = ref<boolean>(false);
|
||||
|
||||
/** ตัวแปรข้อมูล */
|
||||
const formDataInformation = reactive<any>({
|
||||
const formDataInformation = reactive<InformationData>({
|
||||
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 () => {
|
|||
<div class="col-7">
|
||||
{{
|
||||
formDataInformation.firstName
|
||||
? `${formDataInformation.prefix}${formDataInformation.firstName} ${formDataInformation.lastName}`
|
||||
? `${
|
||||
formDataInformation.rank
|
||||
? formDataInformation.rank
|
||||
: formDataInformation.prefix
|
||||
}${formDataInformation.firstName} ${
|
||||
formDataInformation.lastName
|
||||
}`
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue