This commit is contained in:
@@ -68,7 +68,7 @@ export class RefundService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退回退款申请
|
* 驳回申请
|
||||||
* @param id 退款申请ID
|
* @param id 退款申请ID
|
||||||
* @param data 退回请求参数
|
* @param data 退回请求参数
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -102,38 +102,6 @@
|
|||||||
</template>
|
</template>
|
||||||
</ElDialog>
|
</ElDialog>
|
||||||
|
|
||||||
<!-- 退回对话框 -->
|
|
||||||
<ElDialog
|
|
||||||
v-model="returnDialogVisible"
|
|
||||||
title="退回退款申请"
|
|
||||||
width="500px"
|
|
||||||
@closed="handleReturnDialogClosed"
|
|
||||||
>
|
|
||||||
<ElForm ref="returnFormRef" :model="returnForm" :rules="returnRules" label-width="120px">
|
|
||||||
<ElFormItem label="退款单号">
|
|
||||||
<span>{{ refund?.refund_no }}</span>
|
|
||||||
</ElFormItem>
|
|
||||||
<ElFormItem label="退回备注">
|
|
||||||
<ElInput
|
|
||||||
v-model="returnForm.remark"
|
|
||||||
type="textarea"
|
|
||||||
:rows="3"
|
|
||||||
maxlength="500"
|
|
||||||
show-word-limit
|
|
||||||
placeholder="请输入退回备注"
|
|
||||||
/>
|
|
||||||
</ElFormItem>
|
|
||||||
</ElForm>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<ElButton @click="returnDialogVisible = false">取消</ElButton>
|
|
||||||
<ElButton type="warning" @click="handleReturnRefund" :loading="returnLoading">
|
|
||||||
确认退回
|
|
||||||
</ElButton>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</ElDialog>
|
|
||||||
|
|
||||||
<!-- 重新提交对话框 -->
|
<!-- 重新提交对话框 -->
|
||||||
<ElDialog
|
<ElDialog
|
||||||
v-model="resubmitDialogVisible"
|
v-model="resubmitDialogVisible"
|
||||||
@@ -206,7 +174,6 @@
|
|||||||
RefundStatus,
|
RefundStatus,
|
||||||
ApproveRefundRequest,
|
ApproveRefundRequest,
|
||||||
RejectRefundRequest,
|
RejectRefundRequest,
|
||||||
ReturnRefundRequest,
|
|
||||||
ResubmitRefundRequest
|
ResubmitRefundRequest
|
||||||
} from '@/types/api'
|
} from '@/types/api'
|
||||||
import { formatDateTime } from '@/utils/business/format'
|
import { formatDateTime } from '@/utils/business/format'
|
||||||
@@ -224,24 +191,20 @@
|
|||||||
|
|
||||||
const approveDialogVisible = ref(false)
|
const approveDialogVisible = ref(false)
|
||||||
const rejectDialogVisible = ref(false)
|
const rejectDialogVisible = ref(false)
|
||||||
const returnDialogVisible = ref(false)
|
|
||||||
const resubmitDialogVisible = ref(false)
|
const resubmitDialogVisible = ref(false)
|
||||||
|
|
||||||
const approveLoading = ref(false)
|
const approveLoading = ref(false)
|
||||||
const rejectLoading = ref(false)
|
const rejectLoading = ref(false)
|
||||||
const returnLoading = ref(false)
|
|
||||||
const resubmitLoading = ref(false)
|
const resubmitLoading = ref(false)
|
||||||
|
|
||||||
const approveFormRef = ref()
|
const approveFormRef = ref()
|
||||||
const rejectFormRef = ref()
|
const rejectFormRef = ref()
|
||||||
const returnFormRef = ref()
|
|
||||||
const resubmitFormRef = ref()
|
const resubmitFormRef = ref()
|
||||||
|
|
||||||
const approveRules = ref()
|
const approveRules = ref()
|
||||||
const rejectRules = ref({
|
const rejectRules = ref({
|
||||||
reject_reason: [{ required: true, message: '请输入拒绝原因', trigger: 'blur' }]
|
reject_reason: [{ required: true, message: '请输入拒绝原因', trigger: 'blur' }]
|
||||||
})
|
})
|
||||||
const returnRules = ref()
|
|
||||||
const resubmitRules = ref()
|
const resubmitRules = ref()
|
||||||
|
|
||||||
const approveForm = reactive<ApproveRefundRequest>({
|
const approveForm = reactive<ApproveRefundRequest>({
|
||||||
@@ -253,10 +216,6 @@
|
|||||||
reject_reason: ''
|
reject_reason: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
const returnForm = reactive<ReturnRefundRequest>({
|
|
||||||
remark: ''
|
|
||||||
})
|
|
||||||
|
|
||||||
const resubmitForm = reactive<{
|
const resubmitForm = reactive<{
|
||||||
requested_refund_amount?: number
|
requested_refund_amount?: number
|
||||||
actual_received_amount?: number
|
actual_received_amount?: number
|
||||||
@@ -426,11 +385,6 @@
|
|||||||
rejectForm.reject_reason = ''
|
rejectForm.reject_reason = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleReturnDialogClosed = () => {
|
|
||||||
returnFormRef.value?.resetFields()
|
|
||||||
returnForm.remark = ''
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleResubmitDialogClosed = () => {
|
const handleResubmitDialogClosed = () => {
|
||||||
resubmitFormRef.value?.resetFields()
|
resubmitFormRef.value?.resetFields()
|
||||||
resubmitForm.requested_refund_amount = undefined
|
resubmitForm.requested_refund_amount = undefined
|
||||||
@@ -485,26 +439,6 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleReturnRefund = async () => {
|
|
||||||
if (!returnFormRef.value || !refund.value) return
|
|
||||||
|
|
||||||
await returnFormRef.value.validate(async (valid) => {
|
|
||||||
if (valid) {
|
|
||||||
returnLoading.value = true
|
|
||||||
try {
|
|
||||||
await RefundService.returnRefund(refund.value.id, returnForm)
|
|
||||||
ElMessage.success('退回成功')
|
|
||||||
returnDialogVisible.value = false
|
|
||||||
await fetchRefundDetail(refund.value.id)
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error)
|
|
||||||
} finally {
|
|
||||||
returnLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleResubmitRefund = async () => {
|
const handleResubmitRefund = async () => {
|
||||||
if (!resubmitFormRef.value || !refund.value) return
|
if (!resubmitFormRef.value || !refund.value) return
|
||||||
|
|
||||||
|
|||||||
@@ -136,11 +136,11 @@
|
|||||||
<!-- 退回对话框 -->
|
<!-- 退回对话框 -->
|
||||||
<ElDialog
|
<ElDialog
|
||||||
v-model="returnDialogVisible"
|
v-model="returnDialogVisible"
|
||||||
title="退回退款申请"
|
title="驳回申请"
|
||||||
width="500px"
|
width="30%"
|
||||||
@closed="handleReturnDialogClosed"
|
@closed="handleReturnDialogClosed"
|
||||||
>
|
>
|
||||||
<ElForm ref="returnFormRef" :model="returnForm" :rules="returnRules" label-width="120px">
|
<ElForm ref="returnFormRef" :model="returnForm" :rules="returnRules" label-width="80">
|
||||||
<ElFormItem label="退款单号">
|
<ElFormItem label="退款单号">
|
||||||
<span>{{ currentRefund?.refund_no }}</span>
|
<span>{{ currentRefund?.refund_no }}</span>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
@@ -155,6 +155,9 @@
|
|||||||
/>
|
/>
|
||||||
</ElFormItem>
|
</ElFormItem>
|
||||||
</ElForm>
|
</ElForm>
|
||||||
|
<div class="return-dialog-tip">
|
||||||
|
驳回后该订单不可再申请退款,若还需申请退款点击审核拒绝。
|
||||||
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<ElButton @click="returnDialogVisible = false">取消</ElButton>
|
<ElButton @click="returnDialogVisible = false">取消</ElButton>
|
||||||
@@ -878,10 +881,10 @@
|
|||||||
type: 'danger'
|
type: 'danger'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 打回
|
// 驳回
|
||||||
if (hasAuth('refund:return')) {
|
if (hasAuth('refund:return')) {
|
||||||
actions.push({
|
actions.push({
|
||||||
label: '打回',
|
label: '驳回',
|
||||||
handler: () => handleShowReturn(row),
|
handler: () => handleShowReturn(row),
|
||||||
type: 'primary'
|
type: 'primary'
|
||||||
})
|
})
|
||||||
@@ -904,5 +907,13 @@
|
|||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.refund-page {
|
.refund-page {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
|
.return-dialog-tip {
|
||||||
|
margin-top: 8px;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 1.6;
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user