diff --git a/src/views/Transfers.vue b/src/views/Transfers.vue index 7008e5b..79dade2 100644 --- a/src/views/Transfers.vue +++ b/src/views/Transfers.vue @@ -59,23 +59,6 @@ {{ formatTime(allocation.can_return_after) }} - - ({{ getReturnTimeText(allocation) }}) - - - 已回款 - - - - -
- - 确认收到回款 -
@@ -314,45 +297,6 @@ - - - - - - - - - - - - - - @@ -601,66 +545,6 @@ const getReturnTimeStatus = (allocation) => { } } -const getReturnTimeText = (allocation) => { - if (!allocation.can_return_after) return '' - - const now = new Date() - const canReturnTime = new Date(allocation.can_return_after) - - if (now >= canReturnTime) { - return '可以回款' - } else { - const timeDiff = canReturnTime - now - const hours = Math.floor(timeDiff / (60 * 60 * 1000)) - const minutes = Math.floor((timeDiff % (60 * 60 * 1000)) / (60 * 1000)) - - if (hours > 0) { - return `${hours}小时${minutes}分钟后可回款` - } else { - return `${minutes}分钟后可回款` - } - } -} - -const canConfirmReturn = (allocation) => { - if (!allocation.can_return_after) return false - - const now = new Date() - const canReturnTime = new Date(allocation.can_return_after) - - return now >= canReturnTime -} - -const showReturnConfirmDialog = (allocation) => { - currentAllocation.value = allocation - returnForm.returnAmount = allocation.amount - returnForm.description = `匹配订单 ${allocation.matching_order_id} 回款确认` - showReturnDialog.value = true -} - -const confirmReturn = async () => { - try { - confirmLoading.value = true - - const response = await api.post(`/matching/confirm-return/${currentAllocation.value.id}`, { - returnAmount: returnForm.returnAmount, - description: returnForm.description - }) - - if (response.data.success) { - ElMessage.success('回款确认成功') - showReturnDialog.value = false - await loadPendingAllocations() - await loadTransferHistory() - } - } catch (error) { - console.error('确认回款失败:', error) - ElMessage.error(error.response?.data?.message || '确认回款失败') - } finally { - confirmLoading.value = false - } -} - const showVoucherConfirmDialog = (transfer) => { currentTransfer.value = transfer showVoucherDialog.value = true