diff --git a/src/views/moneyManage/financialAccount/cashFlow.vue b/src/views/moneyManage/financialAccount/cashFlow.vue index efddb29..5e2cf4b 100644 --- a/src/views/moneyManage/financialAccount/cashFlow.vue +++ b/src/views/moneyManage/financialAccount/cashFlow.vue @@ -519,10 +519,51 @@ const formDataRow = ref({ //记录点击函数 const showDetail=ref(false) const showRecordDetail = async (row) => { - showDetail.value=true - formDataRow.value={ + // 先用当前行数据把弹窗打开,保证点击立刻有反应 + formDataRow.value = { ...row, - handlingCharge:row.handlingCharge || 0 + handlingCharge: row && row.handlingCharge ? row.handlingCharge : 0 + } + showDetail.value = true; + + try { + let realOrderCode = row && row.orderCode ? String(row.orderCode) : ''; + + // 退款单以 TK 开头,详情需要回显对应原订单的数据 + if (realOrderCode.startsWith('TK')) { + realOrderCode = realOrderCode.replace(/^TK/, ''); + } + + // 如果真的是退款订单(截取后和原单号不同),则异步查原单信息并覆盖 + if (realOrderCode && realOrderCode !== row.orderCode) { + const params = { + pageNum: 1, + pageSize: 10, + fundsDTO: { + jwcode: '', + localMarket: [], + startTime: '', + endTime: '', + payType: '', + orderCode: realOrderCode, + statuses: [], + markets: [], + } + } + const res = await Moneyfunds(params) + if (res.code == 200 && res.data && res.data.list && res.data.list.length > 0) { + const originalOrder = res.data.list.find(item => item.orderCode === realOrderCode) + if (originalOrder) { + // 查到原单数据后,覆盖当前弹窗的数据 + formDataRow.value = { + ...originalOrder, + handlingCharge: originalOrder.handlingCharge || 0 + } + } + } + } + } catch (error) { + console.error('获取原订单详情失败:', error) } } const paymentCurrency = ref([