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,22 +182,33 @@ async function fetchRequestAttachment(type: 'customer' | 'employee') {
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentListDocument = computed(() => {
|
const currentListDocument = computed(() => {
|
||||||
return props.listDocument.map((v, i) => {
|
return props.listDocument
|
||||||
const fileIds = attachmentList.value[v]
|
.map((v, i) => {
|
||||||
? Object.values(attachmentList.value[v])
|
const fileIds = attachmentList.value[v]
|
||||||
: [];
|
? Object.values(attachmentList.value[v])
|
||||||
const fileNames = fileIds.map((id) => String(id));
|
: [];
|
||||||
return {
|
const fileNames = fileIds.map((id) => String(id));
|
||||||
no: i + 1,
|
return {
|
||||||
documentType: v,
|
no: i + 1,
|
||||||
fileName: fileNames,
|
documentType: v,
|
||||||
amount: fileIds.length,
|
fileName: fileNames,
|
||||||
documentInSystem: fileIds.length > 0,
|
amount: fileIds.length,
|
||||||
status: attributes.value
|
documentInSystem: fileIds.length > 0,
|
||||||
? (attributes.value[state.tab]?.[v] ?? docStatus[0])
|
status: attributes.value
|
||||||
: docStatus[0],
|
? (attributes.value[state.tab]?.[v] ?? 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);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function triggerCancel() {
|
function triggerCancel() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue