refactor: handle filter file customer or employee
This commit is contained in:
parent
1df27aeed0
commit
29c7186f9a
1 changed files with 27 additions and 16 deletions
|
|
@ -182,7 +182,8 @@ async function fetchRequestAttachment(type: 'customer' | 'employee') {
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentListDocument = computed(() => {
|
const currentListDocument = computed(() => {
|
||||||
return props.listDocument.map((v, i) => {
|
return props.listDocument
|
||||||
|
.map((v, i) => {
|
||||||
const fileIds = attachmentList.value[v]
|
const fileIds = attachmentList.value[v]
|
||||||
? Object.values(attachmentList.value[v])
|
? Object.values(attachmentList.value[v])
|
||||||
: [];
|
: [];
|
||||||
|
|
@ -197,6 +198,16 @@ const currentListDocument = computed(() => {
|
||||||
? (attributes.value[state.tab]?.[v] ?? docStatus[0])
|
? (attributes.value[state.tab]?.[v] ?? docStatus[0])
|
||||||
: docStatus[0],
|
: docStatus[0],
|
||||||
};
|
};
|
||||||
|
})
|
||||||
|
.filter((v) => {
|
||||||
|
const filterFileCustomer = ['passport', 'visa', 'tm6'];
|
||||||
|
const filterFileEmployee = ['citizen'];
|
||||||
|
|
||||||
|
if (state.tab === 'customer') {
|
||||||
|
return !filterFileCustomer.includes(v.documentType);
|
||||||
|
} else {
|
||||||
|
return !filterFileEmployee.includes(v.documentType);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue