This commit is contained in:
Warunee Tamkoo 2024-11-29 18:10:09 +07:00
parent cd3ceaae97
commit c43f09a784
4 changed files with 40 additions and 18 deletions

View file

@ -45,6 +45,7 @@ const empType = ref<string>(pathRegistryEmp(route.name?.toString() ?? ""));
/** TableHisoty*/
const visibleColumns = ref<String[]>([
"statusMarital",
"citizenId",
"prefix",
"firstName",
@ -56,6 +57,15 @@ const visibleColumns = ref<String[]>([
"lastUpdatedAt",
]);
const columns = ref<QTableProps["columns"]>([
{
name: "statusMarital",
align: "left",
label: "สถานภาพการสมรส",
sortable: true,
field: "statusMarital",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "citizenId",
align: "left",
@ -65,7 +75,6 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "prefix",
align: "left",
@ -392,7 +401,6 @@ function onOpenDialogForm(
fromData.job = motherData.job;
} else if (type === "couple") {
titleForm.value = "คู่สมรส";
fromData.isLive = 1;
} else if (type === "children") {
titleForm.value = "บุตร";
@ -471,9 +479,15 @@ async function fetchHistory(id: string, type: string) {
lastName: e[`${type}LastName`],
job: e[`${type}Career`],
isLive: e[`${type}Live`],
lastNameOld: type === "couple" ? e.coupleLastNameOld : undefined,
lastNameOld:
type === "couple"
? e.coupleLastNameOld
: type === "mother"
? e.motherLastNameOld
: undefined,
lastUpdateFullName: e.lastUpdateFullName,
lastUpdatedAt: e.lastUpdatedAt,
statusMarital: type === "couple" ? e.relationship : undefined,
}));
})
.catch((err) => {
@ -1104,6 +1118,7 @@ onMounted(async () => {
style="min-width: 140px"
/>
</div>
<d-table
ref="table"
flat
@ -1112,7 +1127,11 @@ onMounted(async () => {
:columns="
typeForm === 'couple'
? columns
: columns?.filter((e) => e.name !== 'lastNameOld')
: typeForm === 'mother'
? columns?.filter((e) => e.name !== 'statusMarital')
: columns?.filter(
(e) => e.name !== 'lastNameOld' && e.name !== 'statusMarital'
)
"
:rows="rows"
:paging="true"