| | |
| | | import { getApprovalModuleConfig } from "../_utils/approvalModuleRegistry.js"; |
| | | import { |
| | | createModuleSearchForm, |
| | | filterRowsByModuleSearch, |
| | | formatDateRangeLabel, |
| | | getModuleSearchMeta, |
| | | } from "../_utils/approvalModuleListSearch.js"; |
| | |
| | | deleteFinReimbursement, |
| | | getReimbursementTypeByModuleKey, |
| | | enrichReimbursementListRowsWithApprovalFlow, |
| | | filterReimbursementRowsBySearch, |
| | | filterRowsByReimbursementType, |
| | | hasActiveReimbursementSearch, |
| | | mapFinReimbursementFromApi, |
| | | resolveReimbursementDeleteId, |
| | | unwrapFinReimbursementPage, |
| | |
| | | } |
| | | |
| | | const displayList = computed(() => |
| | | filterRowsByModuleSearch(props.moduleKey, list.value, searchForm) |
| | | filterReimbursementRowsBySearch(list.value, searchForm) |
| | | ); |
| | | |
| | | const hasActiveFilter = computed(() => Boolean(filterSummary.value)); |
| | |
| | | mapped, |
| | | reimbursementType.value |
| | | ); |
| | | if (hasActiveReimbursementSearch(searchForm)) { |
| | | mapped = filterReimbursementRowsBySearch(mapped, searchForm); |
| | | } |
| | | |
| | | if (page.current === 1) { |
| | | list.value = mapped; |
| | |
| | | list.value = [...list.value, ...mapped]; |
| | | } |
| | | const dropped = records.length - filtered.length; |
| | | page.total = |
| | | let nextTotal = |
| | | dropped > 0 ? Math.max(0, Number(total) - dropped) : Number(total); |
| | | if (hasActiveReimbursementSearch(searchForm)) { |
| | | nextTotal = list.value.length; |
| | | } |
| | | page.total = nextTotal; |
| | | |
| | | if (list.value.length >= total || records.length < page.size) { |
| | | pageStatus.value = "nomore"; |