Merge branch 'nice_dev' into develop

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-02-09 15:53:19 +07:00
commit ca7c6db5d8
4 changed files with 102 additions and 55 deletions

View file

@ -594,19 +594,19 @@ const clickHistory = async () => {
rowsHistory.value = []; rowsHistory.value = [];
data.map((e: RequestItemsHistoryObject) => { data.map((e: RequestItemsHistoryObject) => {
rowsHistory.value.push({ rowsHistory.value.push({
currentAddress: e.currentAddress, currentAddress: e.currentAddress ?? "-",
currentDistrict: e.currentDistrict, currentDistrict: e.currentDistrict ?? "-",
currentProvince: e.currentProvince, currentProvince: e.currentProvince ?? "-",
currentSubDistrict: e.currentSubDistrict, currentSubDistrict: e.currentSubDistrict ?? "-",
currentZipCode: e.currentZipCode, currentZipCode: e.currentZipCode ?? "-",
registrationSame: e.registrationSame, registrationSame: e.registrationSame,
registrationAddress: e.registrationAddress, registrationAddress: e.registrationAddress ?? "-",
registrationDistrict: e.registrationDistrict, registrationDistrict: e.registrationDistrict ?? "-",
registrationProvince: e.registrationProvince, registrationProvince: e.registrationProvince ?? "-",
registrationSubDistrict: e.registrationSubDistrict, registrationSubDistrict: e.registrationSubDistrict ?? "-",
registrationZipCode: e.registrationZipCode, registrationZipCode: e.registrationZipCode ?? "-",
createdFullName: e.createdFullName, createdFullName: e.createdFullName ?? "-",
createdAt: new Date(e.createdAt), createdAt: new Date(e.createdAt) ?? "-",
}); });
}); });
}) })

View file

@ -467,7 +467,8 @@
/> />
</div> </div>
<div class="col-xs-12 col-sm-2 col-md-2"> <div class="col-xs-12 col-sm-2 col-md-2">
<selector <q-select
ref="childrenPrefixIdRef"
:hide-dropdown-icon="!edit" :hide-dropdown-icon="!edit"
hide-bottom-space hide-bottom-space
:class="getClass(edit)" :class="getClass(edit)"
@ -493,6 +494,7 @@
</div> </div>
<div class="col-xs-6 col-sm-3 col-md-3"> <div class="col-xs-6 col-sm-3 col-md-3">
<q-input <q-input
ref="childrenFirstNameRef"
:class="getClass(edit)" :class="getClass(edit)"
hide-bottom-space hide-bottom-space
:outlined="edit" :outlined="edit"
@ -507,6 +509,7 @@
</div> </div>
<div class="col-xs-6 col-sm-3 col-md-3"> <div class="col-xs-6 col-sm-3 col-md-3">
<q-input <q-input
ref="childrenLastNameRef"
:class="getClass(edit)" :class="getClass(edit)"
hide-bottom-space hide-bottom-space
:outlined="edit" :outlined="edit"
@ -1603,6 +1606,10 @@ const fetchPrefix = async () => {
}); });
}; };
const childrenPrefixIdRef = ref<any>();
const childrenFirstNameRef = ref<any>();
const childrenLastNameRef = ref<any>();
const addChildren = async () => { const addChildren = async () => {
familyData.value.childrens.push({ familyData.value.childrens.push({
id: `${familyData.value.childrens.length + 1}`, id: `${familyData.value.childrens.length + 1}`,
@ -1617,6 +1624,22 @@ const addChildren = async () => {
familyData.value.childrens.sort( familyData.value.childrens.sort(
(a: childrenFamily, b: childrenFamily) => Number(b.id) - Number(a.id) (a: childrenFamily, b: childrenFamily) => Number(b.id) - Number(a.id)
); );
if (childrenPrefixIdRef.value) {
childrenPrefixIdRef.value.forEach((e: any) => {
e.resetValidation();
});
}
if (childrenFirstNameRef.value) {
childrenFirstNameRef.value.forEach((e: any) => {
e.resetValidation();
});
}
if (childrenLastNameRef.value) {
childrenLastNameRef.value.forEach((e: any) => {
e.resetValidation();
});
}
}; };
const deleteChildren = (items: childrenFamily) => { const deleteChildren = (items: childrenFamily) => {
@ -1637,28 +1660,28 @@ const fetchHistory = async () => {
data.map((row: ResponseObject) => { data.map((row: ResponseObject) => {
const arrayData: ResponseHistory = { const arrayData: ResponseHistory = {
couple: row.couple ? "1" : "0", couple: row.couple ? "1" : "0",
couplePrefixId: row.couplePrefixId, couplePrefixId: row.couplePrefixId ?? "-",
coupleFirstName: row.coupleFirstName, coupleFirstName: row.coupleFirstName ?? "-",
coupleLastName: row.coupleLastName, coupleLastName: row.coupleLastName ?? "-",
coupleLastNameOld: row.coupleLastNameOld, coupleLastNameOld: row.coupleLastNameOld ?? "-",
coupleCareer: row.coupleCareer, coupleCareer: row.coupleCareer ?? "-",
coupleLive: row.coupleLive ? "1" : "0", coupleLive: row.coupleLive ? "1" : "0",
coupleCitizenId: row.coupleCitizenId, coupleCitizenId: row.coupleCitizenId ?? "-",
fatherPrefixId: row.fatherPrefixId, fatherPrefixId: row.fatherPrefixId ?? "-",
fatherFirstName: row.fatherFirstName, fatherFirstName: row.fatherFirstName ?? "-",
fatherLastName: row.fatherLastName, fatherLastName: row.fatherLastName ?? "-",
fatherCareer: row.fatherCareer, fatherCareer: row.fatherCareer ?? "-",
fatherLive: row.fatherLive ? "1" : "0", fatherLive: row.fatherLive ? "1" : "0",
fatherCitizenId: row.fatherCitizenId, fatherCitizenId: row.fatherCitizenId ?? "-",
motherPrefixId: row.motherPrefixId, motherPrefixId: row.motherPrefixId ?? "-",
motherFirstName: row.motherFirstName, motherFirstName: row.motherFirstName ?? "-",
motherLastName: row.motherLastName, motherLastName: row.motherLastName ?? "-",
motherCareer: row.motherCareer, motherCareer: row.motherCareer ?? "-",
motherLive: row.motherLive ? "1" : "0", motherLive: row.motherLive ? "1" : "0",
motherCitizenId: row.motherCitizenId, motherCitizenId: row.motherCitizenId ?? "-",
childrens: row.childrens, childrens: row.childrens ?? "-",
createdFullName: row.createdFullName, createdFullName: row.createdFullName ?? "-",
createdAt: new Date(row.createdAt), createdAt: new Date(row.createdAt) ?? "-",
}; };
familyDataHistory.value.push(arrayData); familyDataHistory.value.push(arrayData);
}); });
@ -1752,7 +1775,7 @@ const fetchData = async () => {
}) })
.finally(async () => { .finally(async () => {
// hideLoader(); // hideLoader();
profileStore.isLoad++ profileStore.isLoad++;
}); });
} }
}; };

View file

@ -387,7 +387,7 @@
" "
class="table_ellipsis" class="table_ellipsis"
> >
{{ date2Thai(col.value) }} {{ col.value }}
</div> </div>
<div v-else class="table_ellipsis"> <div v-else class="table_ellipsis">
{{ col.value }} {{ col.value }}
@ -409,7 +409,10 @@ import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import HistoryTable from "@/components/TableHistory.vue"; import HistoryTable from "@/components/TableHistory.vue";
import type { RequestItemsHistoryObject } from "@/modules/04_registry/interface/request/Government"; import type { RequestItemsHistoryObject } from "@/modules/04_registry/interface/request/Government";
import type { ResponseObject } from "@/modules/04_registry/interface/response/Government"; import type {
ResponseObject,
RowHistory,
} from "@/modules/04_registry/interface/response/Government";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import { useProfileDataStore } from "@/modules/04_registry/store"; import { useProfileDataStore } from "@/modules/04_registry/store";
import { storeToRefs } from "pinia"; import { storeToRefs } from "pinia";
@ -442,7 +445,7 @@ const { birthDate, retireText } = storeToRefs(profileStore);
const edit = ref<boolean>(false); const edit = ref<boolean>(false);
const govermentData = ref<Goverment>(defaultGoverment); const govermentData = ref<Goverment>(defaultGoverment);
const myform = ref<any>(); const myform = ref<any>();
const rowsHistory = ref<RequestItemsHistoryObject[]>([]); //select data history const rowsHistory = ref<RowHistory[]>([]); //select data history
const tittleHistory = ref<string>("ประวัติแก้ไขข้อมูลราชการ"); // const tittleHistory = ref<string>("ประวัติแก้ไขข้อมูลราชการ"); //
const filterHistory = ref<string>(""); //search data table history const filterHistory = ref<string>(""); //search data table history
const modalHistory = ref<boolean>(false); //modal const modalHistory = ref<boolean>(false); //modal
@ -784,24 +787,24 @@ const clickHistory = async () => {
rowsHistory.value = []; rowsHistory.value = [];
data.map((e: RequestItemsHistoryObject) => { data.map((e: RequestItemsHistoryObject) => {
rowsHistory.value.push({ rowsHistory.value.push({
oc: e.oc, oc: e.oc ?? "-",
position: e.position, position: e.position ?? "-",
positionPathSide: e.positionPathSide, positionPathSide: e.positionPathSide ?? "-",
posNo: e.posNo, posNo: e.posNo ?? "-",
positionLine: e.positionLine, positionLine: e.positionLine ?? "-",
positionType: e.positionType, positionType: e.positionType ?? "-",
positionLevel: e.positionLevel, positionLevel: e.positionLevel ?? "-",
positionExecutive: e.positionExecutive, positionExecutive: e.positionExecutive ?? "-",
positionExecutiveSide: e.positionExecutiveSide, positionExecutiveSide: e.positionExecutiveSide ?? "-",
dateAppoint: new Date(e.dateAppoint), dateAppoint: date2Thai(e.dateAppoint) ?? "-",
dateStart: new Date(e.dateStart), dateStart: date2Thai(e.dateStart) ?? "-",
retireDate: e.retireDate, retireDate: e.retireDate ?? "-",
govAge: e.govAge, govAge: e.govAge ?? "-",
govAgeAbsent: e.govAgeAbsent, govAgeAbsent: e.govAgeAbsent ?? "-",
govAgePlus: e.govAgePlus, govAgePlus: e.govAgePlus ?? "-",
reasonSameDate: e.reasonSameDate, reasonSameDate: e.reasonSameDate ?? "-",
createdFullName: e.createdFullName, createdFullName: e.createdFullName ?? "-",
createdAt: new Date(e.createdAt), createdAt: date2Thai(e.createdAt) ?? "-",
}); });
}); });
}) })

View file

@ -20,4 +20,25 @@ interface ResponseObject {
reasonSameDate: string | null; reasonSameDate: string | null;
} }
export type { ResponseObject }; interface RowHistory {
oc: string | null;
position: string | null;
positionPathSide: string | null;
posNo: string | null;
positionLine: string | null;
positionType: string | null;
positionLevel: string | null;
positionExecutive: string | null;
positionExecutiveSide: string | null;
dateAppoint: string | null;
dateStart: string | null;
retireDate: string | null;
govAge: string | null;
govAgeAbsent: string | null;
govAgePlus: string | null;
reasonSameDate: string | null;
createdFullName: string | null;
createdAt: string | null;
}
export type { ResponseObject, RowHistory };