去掉确认回款

This commit is contained in:
2025-08-11 16:47:30 +08:00
parent 35ea8e25b4
commit ac3f5cac7b

View File

@@ -69,17 +69,6 @@
已回款
</el-tag>
</div>
<!-- 回款确认按钮 -->
<div v-if="!allocation.return_date && canConfirmReturn(allocation)" class="return-action">
<el-button
type="success"
size="small"
@click="showReturnConfirmDialog(allocation)"
>
确认收到回款
</el-button>
</div>
</div>
<!-- 超时警告 -->
@@ -303,49 +292,6 @@
</span>
</template>
</el-dialog>
<!-- 回款确认对话框 -->
<el-dialog
v-model="showReturnDialog"
title="确认回款"
width="500px"
:close-on-click-modal="false"
>
<el-form :model="returnForm" label-width="100px">
<el-form-item label="回款金额">
<el-input
v-model="returnForm.returnAmount"
type="number"
placeholder="请输入回款金额"
:disabled="true"
>
<template #append></template>
</el-input>
</el-form-item>
<el-form-item label="备注说明">
<el-input
v-model="returnForm.description"
type="textarea"
:rows="3"
placeholder="请输入备注说明"
/>
</el-form-item>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="showReturnDialog = false">取消</el-button>
<el-button
type="success"
@click="confirmReturn"
:loading="confirmLoading"
>
确认回款
</el-button>
</span>
</template>
</el-dialog>
</div>
</template>
@@ -367,7 +313,6 @@ const submitLoading = ref(false)
const confirmLoading = ref(false)
const showCreateTransfer = ref(false)
const showVoucherDialog = ref(false)
const showReturnDialog = ref(false)
const statusFilter = ref('')
const currentTransfer = ref({})
const currentAllocation = ref({})
@@ -385,11 +330,6 @@ const confirmRules = {
]
}
const returnForm = reactive({
returnAmount: '',
description: ''
})
const pendingTransfers = ref([])
const pendingAllocations = ref([])
const allTransferHistory = ref([])
@@ -620,31 +560,36 @@ const canConfirmReturn = (allocation) => {
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 () => {
const confirmReturn = async (allocation) => {
try {
await ElMessageBox.confirm(
`确定已收到¥${allocation.amount}回款吗?`,
'确认回款',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning'
}
)
confirmLoading.value = true
await api.post(`/matching/confirm-return/${currentAllocation.value.id}`, {
returnAmount: returnForm.returnAmount,
description: returnForm.description
const response = await api.post(`/matching/confirm-return/${allocation.id}`, {
returnAmount: allocation.amount,
description: `匹配订单 ${allocation.matching_order_id} 回款确认`
})
if (response.data.success) {
ElMessage.success('回款确认成功')
showReturnDialog.value = false
await loadPendingAllocations()
await loadTransferHistory()
}
} catch (error) {
if (error !== 'cancel') {
console.error('确认回款失败:', error)
ElMessage.error(error.response?.data?.message || '确认回款失败')
const errorMsg = error.response?.data?.message || '确认回款失败'
ElMessage.error(errorMsg)
}
} finally {
confirmLoading.value = false
}