| | |
| | | canEditReimbursementRow, |
| | | deleteFinReimbursement, |
| | | getReimbursementTypeByModuleKey, |
| | | enrichReimbursementListRowsWithApprovalFlow, |
| | | filterRowsByReimbursementType, |
| | | mapFinReimbursementFromApi, |
| | | resolveReimbursementDeleteId, |
| | |
| | | }) |
| | | ); |
| | | const { records, total } = unwrapFinReimbursementPage(res); |
| | | const mapped = filterRowsByReimbursementType( |
| | | const filtered = filterRowsByReimbursementType( |
| | | records, |
| | | reimbursementType.value |
| | | ).map(row => |
| | | ); |
| | | let mapped = filtered.map(row => |
| | | mapFinReimbursementFromApi(row, { |
| | | reimbursementType: reimbursementType.value, |
| | | moduleKey: props.moduleKey, |
| | | }) |
| | | ); |
| | | mapped = await enrichReimbursementListRowsWithApprovalFlow( |
| | | mapped, |
| | | reimbursementType.value |
| | | ); |
| | | |
| | | if (page.current === 1) { |
| | |
| | | } else { |
| | | list.value = [...list.value, ...mapped]; |
| | | } |
| | | page.total = total; |
| | | const dropped = records.length - filtered.length; |
| | | page.total = |
| | | dropped > 0 ? Math.max(0, Number(total) - dropped) : Number(total); |
| | | |
| | | if (list.value.length >= total || records.length < page.size) { |
| | | pageStatus.value = "nomore"; |