diff --git a/miniprogram/pages/bx/reimburse/apply.vue b/miniprogram/pages/bx/reimburse/apply.vue index e53b1a589..0c5cf9e78 100644 --- a/miniprogram/pages/bx/reimburse/apply.vue +++ b/miniprogram/pages/bx/reimburse/apply.vue @@ -535,7 +535,6 @@ async function fetchInvoiceAttachPage(isRefresh) { } } catch (e) { uni.showToast({ title: '发票列表加载失败', icon: 'none' }) - if (isRefresh) invFinished.value = true } finally { invLoading.value = false } @@ -558,7 +557,7 @@ async function onInvoicePickerLoadMore() { async function openInvoicePicker() { pickerDraftKeys.value = selectedInvoicePicks.value.map((p) => p.key) showInvoicePicker.value = true - if (!attachItems.value.length && !invFinished.value) { + if (!attachItems.value.length) { await resetAndLoadInvoices() } } @@ -759,27 +758,16 @@ async function loadEditData(id) { for (const inv of linked) { const invoiceId = String(inv.id || inv.invoiceId || '') if (!invoiceId) continue - let attachmentId = String(inv.attachmentId || inv.attachment_id || '') - let fileName = inv.fileName || inv.file_name || '发票附件' - let fileType = inv.fileType || inv.file_type || '' - const createTime = inv.createTime || inv.create_time || '' - if (!attachmentId) { - const src = attachItems.value.find((w) => String(w.invoiceId) === invoiceId) - if (src) { - attachmentId = src.attachmentId - fileName = src.fileName - fileType = src.fileType - } - } + const attachmentId = String(inv.attachmentId || inv.attachment_id || '') if (!attachmentId) continue picks.push({ key: `${invoiceId}:${attachmentId}`, invoiceId, attachmentId, amount: inv.amount, - createTime, - fileName, - fileType, + createTime: inv.createTime || inv.create_time || '', + fileName: inv.fileName || inv.file_name || '发票附件', + fileType: inv.fileType || inv.file_type || '', previewUrl: '', previewLoading: false })