去掉确认回款
This commit is contained in:
@@ -69,17 +69,6 @@
|
|||||||
已回款
|
已回款
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
|
|
||||||
<!-- 超时警告 -->
|
<!-- 超时警告 -->
|
||||||
@@ -303,49 +292,6 @@
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -367,7 +313,6 @@ const submitLoading = ref(false)
|
|||||||
const confirmLoading = ref(false)
|
const confirmLoading = ref(false)
|
||||||
const showCreateTransfer = ref(false)
|
const showCreateTransfer = ref(false)
|
||||||
const showVoucherDialog = ref(false)
|
const showVoucherDialog = ref(false)
|
||||||
const showReturnDialog = ref(false)
|
|
||||||
const statusFilter = ref('')
|
const statusFilter = ref('')
|
||||||
const currentTransfer = ref({})
|
const currentTransfer = ref({})
|
||||||
const currentAllocation = ref({})
|
const currentAllocation = ref({})
|
||||||
@@ -385,11 +330,6 @@ const confirmRules = {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
const returnForm = reactive({
|
|
||||||
returnAmount: '',
|
|
||||||
description: ''
|
|
||||||
})
|
|
||||||
|
|
||||||
const pendingTransfers = ref([])
|
const pendingTransfers = ref([])
|
||||||
const pendingAllocations = ref([])
|
const pendingAllocations = ref([])
|
||||||
const allTransferHistory = ref([])
|
const allTransferHistory = ref([])
|
||||||
@@ -620,31 +560,36 @@ const canConfirmReturn = (allocation) => {
|
|||||||
return now >= canReturnTime
|
return now >= canReturnTime
|
||||||
}
|
}
|
||||||
|
|
||||||
const showReturnConfirmDialog = (allocation) => {
|
const confirmReturn = async (allocation) => {
|
||||||
currentAllocation.value = allocation
|
|
||||||
returnForm.returnAmount = allocation.amount
|
|
||||||
returnForm.description = `匹配订单 ${allocation.matching_order_id} 回款确认`
|
|
||||||
showReturnDialog.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
const confirmReturn = async () => {
|
|
||||||
try {
|
try {
|
||||||
|
await ElMessageBox.confirm(
|
||||||
|
`确定已收到¥${allocation.amount}回款吗?`,
|
||||||
|
'确认回款',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确认',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
confirmLoading.value = true
|
confirmLoading.value = true
|
||||||
|
|
||||||
await api.post(`/matching/confirm-return/${currentAllocation.value.id}`, {
|
const response = await api.post(`/matching/confirm-return/${allocation.id}`, {
|
||||||
returnAmount: returnForm.returnAmount,
|
returnAmount: allocation.amount,
|
||||||
description: returnForm.description
|
description: `匹配订单 ${allocation.matching_order_id} 回款确认`
|
||||||
})
|
})
|
||||||
|
|
||||||
ElMessage.success('回款确认成功')
|
if (response.data.success) {
|
||||||
showReturnDialog.value = false
|
ElMessage.success('回款确认成功')
|
||||||
|
await loadPendingAllocations()
|
||||||
await loadPendingAllocations()
|
await loadTransferHistory()
|
||||||
await loadTransferHistory()
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('确认回款失败:', error)
|
if (error !== 'cancel') {
|
||||||
ElMessage.error(error.response?.data?.message || '确认回款失败')
|
console.error('确认回款失败:', error)
|
||||||
|
const errorMsg = error.response?.data?.message || '确认回款失败'
|
||||||
|
ElMessage.error(errorMsg)
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
confirmLoading.value = false
|
confirmLoading.value = false
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user