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