|
@@ -0,0 +1,507 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <el-card class="main-card">
|
|
|
|
|
+ <template #header>
|
|
|
|
|
+ <el-breadcrumb separator-class="el-icon-arrow-right">
|
|
|
|
|
+ <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
|
|
|
|
|
+ <el-breadcrumb-item>订单退款</el-breadcrumb-item>
|
|
|
|
|
+ </el-breadcrumb>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <el-form :model="forms" ref="forms" label-width="70px" class="search-form">
|
|
|
|
|
+ <el-row style="align-items: center">
|
|
|
|
|
+ <el-form-item label="关键词" prop="keyword">
|
|
|
|
|
+ <el-col>
|
|
|
|
|
+ <el-input v-model="forms.keyword" prefix-icon="Search"></el-input>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="退款状态" prop="refundStatus" style="margin-left: 10px;">
|
|
|
|
|
+ <el-select v-model="forms.refundStatus" :empty-values="[null, undefined]" :value-on-clear="null" clearable
|
|
|
|
|
+ style="width: 100px">
|
|
|
|
|
+ <el-option label="全部" value=""></el-option>
|
|
|
|
|
+ <el-option label="待审核" value="Pending"></el-option>
|
|
|
|
|
+ <el-option label="已通过" value="Approved"></el-option>
|
|
|
|
|
+ <el-option label="已驳回" value="Rejected"></el-option>
|
|
|
|
|
+ <el-option label="退款中" value="Refunding"></el-option>
|
|
|
|
|
+ <el-option label="已退款" value="Refunded"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="" label-width="20px">
|
|
|
|
|
+ <el-button type="primary" icon="search" @click="submit">
|
|
|
|
|
+ 搜索
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button icon="refresh" @click="reset">
|
|
|
|
|
+ 重置
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+
|
|
|
|
|
+ <el-table class="table" ref="table" :data="tableData" row-key="id" border size="small">
|
|
|
|
|
+ <el-table-column type="index" label="序号" align="center" width="60"></el-table-column>
|
|
|
|
|
+ <el-table-column prop="refundNo" label="退款单号" min-width="180" show-overflow-tooltip></el-table-column>
|
|
|
|
|
+ <el-table-column prop="orderID" label="订单ID" min-width="220" show-overflow-tooltip>
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <el-link type="primary" @click="viewOrderDetail(scope.row.orderID)">{{ scope.row.orderID }}</el-link>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="refundAmount" label="退款金额" width="120" align="right">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ ¥{{ scope.row.refundAmount?.toFixed(2) || '0.00' }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="reason" label="退款原因" min-width="150" show-overflow-tooltip></el-table-column>
|
|
|
|
|
+ <el-table-column prop="auditStatus" label="审核状态" width="100" align="center">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <el-tag :type="getRefundStatusType(scope.row.auditStatus)">
|
|
|
|
|
+ {{ getRefundStatusText(scope.row.auditStatus) }}
|
|
|
|
|
+ </el-tag>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="status" label="退款状态" width="100" align="center">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <el-tag :type="getRefundStatusType(scope.row.status)">
|
|
|
|
|
+ {{ getRefundStatusText(scope.row.status) }}
|
|
|
|
|
+ </el-tag>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="refundMethod" label="退款方式" width="100" align="center">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ {{ scope.row.refundMethod === 'Online' ? '在线退款' : scope.row.refundMethod }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="refundUserName" label="申请人" width="120"></el-table-column>
|
|
|
|
|
+ <el-table-column prop="refundDate" label="申请时间" width="160">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ {{ scope.row.refundDate ? moment(scope.row.refundDate).format('YYYY-MM-DD HH:mm') : '-' }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="auditUserName" label="审核人" width="120"></el-table-column>
|
|
|
|
|
+ <el-table-column prop="auditDate" label="审核时间" width="160">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ {{ scope.row.auditDate ? moment(scope.row.auditDate).format('YYYY-MM-DD HH:mm') : '-' }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="remark" label="备注" min-width="200" show-overflow-tooltip></el-table-column>
|
|
|
|
|
+
|
|
|
|
|
+ <el-table-column fixed="right" label="操作" width="120">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <el-button v-if="scope.row.auditStatus === 'Approved'" type="primary" link size="small"
|
|
|
|
|
+ @click="refund(scope.row)">退费</el-button>
|
|
|
|
|
+ <el-button v-else type="primary" link size="small" @click="reviewRefund(scope.row)">审核</el-button>
|
|
|
|
|
+ <el-button type="info" link size="small" @click="paymentRecord(scope.row)">支付记录</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+
|
|
|
|
|
+ <el-pagination class="pagination" background layout="total, sizes, prev, pager, next"
|
|
|
|
|
+ :page-sizes="[10, 20, 50, 100]" :page-size="forms.rows" :total="total" @size-change="sizeHandler"
|
|
|
|
|
+ @current-change="pageHandler">
|
|
|
|
|
+ </el-pagination>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 退款详情对话框 -->
|
|
|
|
|
+ <el-dialog title="退款详情" width="800px" v-model="detailDialogVisible" destroy-on-close>
|
|
|
|
|
+ <el-descriptions :column="2" border>
|
|
|
|
|
+ <el-descriptions-item label="订单ID">{{ detailData.orderID }}</el-descriptions-item>
|
|
|
|
|
+ <el-descriptions-item label="旅行社">{{ detailData.agencyName }}</el-descriptions-item>
|
|
|
|
|
+ <el-descriptions-item label="订单总额">¥{{ detailData.totalAmount }}</el-descriptions-item>
|
|
|
|
|
+ <el-descriptions-item label="已支付">¥{{ detailData.paidAmount }}</el-descriptions-item>
|
|
|
|
|
+ <el-descriptions-item label="申请退款">¥{{ detailData.refundAmount }}</el-descriptions-item>
|
|
|
|
|
+ <el-descriptions-item label="实退金额">¥{{ detailData.actualRefundAmount || 0 }}</el-descriptions-item>
|
|
|
|
|
+ <el-descriptions-item label="退款状态">
|
|
|
|
|
+ <el-tag :type="getRefundStatusType(detailData.refundStatus)">
|
|
|
|
|
+ {{ getRefundStatusText(detailData.refundStatus) }}
|
|
|
|
|
+ </el-tag>
|
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
|
+ <el-descriptions-item label="申请时间">
|
|
|
|
|
+ {{ detailData.applyDate ? moment(detailData.applyDate).format('YYYY-MM-DD HH:mm:ss') : '-' }}
|
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
|
+ <el-descriptions-item label="退款原因" :span="2">{{ detailData.refundReason || '-' }}</el-descriptions-item>
|
|
|
|
|
+ <el-descriptions-item label="审核人" v-if="detailData.auditUserName">
|
|
|
|
|
+ {{ detailData.auditUserName }}
|
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
|
+ <el-descriptions-item label="审核时间" v-if="detailData.auditDate">
|
|
|
|
|
+ {{ moment(detailData.auditDate).format('YYYY-MM-DD HH:mm:ss') }}
|
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
|
+ <el-descriptions-item label="审核备注" :span="2" v-if="detailData.auditRemark">
|
|
|
|
|
+ {{ detailData.auditRemark }}
|
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
|
+ </el-descriptions>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 退款审核对话框 -->
|
|
|
|
|
+ <el-dialog title="退款审核" width="600px" v-model="auditDialogVisible" destroy-on-close @close="closeAudit">
|
|
|
|
|
+ <el-form :model="auditForm" :rules="auditRules" ref="auditFormRef" label-width="100px">
|
|
|
|
|
+ <el-form-item label="订单ID">
|
|
|
|
|
+ <span>{{ auditForm.orderID }}</span>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="退款金额">
|
|
|
|
|
+ <span>¥{{ auditForm.refundAmount }}</span>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="退款原因">
|
|
|
|
|
+ <span>{{ auditForm.refundReason }}</span>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="审核结果" prop="isApproved">
|
|
|
|
|
+ <el-radio-group v-model="auditForm.isApproved">
|
|
|
|
|
+ <el-radio :label="true">通过</el-radio>
|
|
|
|
|
+ <el-radio :label="false">驳回</el-radio>
|
|
|
|
|
+ </el-radio-group>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="审核备注" prop="remark">
|
|
|
|
|
+ <el-input v-model="auditForm.remark" type="textarea" :rows="3" placeholder="请输入审核备注">
|
|
|
|
|
+ </el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <span class="dialog-footer">
|
|
|
|
|
+ <el-button @click="auditDialogVisible = false">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="submitAudit">确 定</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 退款操作对话框 -->
|
|
|
|
|
+ <el-dialog title="退款确认" width="500px" v-model="refundDialogVisible" destroy-on-close @close="closeRefund">
|
|
|
|
|
+ <el-alert title="请确认退款信息" type="warning" :closable="false" show-icon style="margin-bottom: 20px">
|
|
|
|
|
+ </el-alert>
|
|
|
|
|
+ <el-descriptions :column="1" border>
|
|
|
|
|
+ <el-descriptions-item label="订单ID">{{ refundForm.orderID }}</el-descriptions-item>
|
|
|
|
|
+ <el-descriptions-item label="实退金额">¥{{ refundForm.actualRefundAmount }}</el-descriptions-item>
|
|
|
|
|
+ <el-descriptions-item label="退款方式">
|
|
|
|
|
+ <el-select v-model="refundForm.refundMethod" style="width: 100%">
|
|
|
|
|
+ <el-option label="原路退回" value="Original"></el-option>
|
|
|
|
|
+ <el-option label="银行转账" value="BankTransfer"></el-option>
|
|
|
|
|
+ <el-option label="现金退款" value="Cash"></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-descriptions-item>
|
|
|
|
|
+ </el-descriptions>
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <span class="dialog-footer">
|
|
|
|
|
+ <el-button @click="refundDialogVisible = false">取 消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="submitRefund">确认退款</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+ <!-- 订单支付记录对话框 -->
|
|
|
|
|
+ <el-dialog title="订单支付记录" width="900px" v-model="paymentRecordDialogVisible" destroy-on-close>
|
|
|
|
|
+ <el-table :data="paymentRecordData" border size="small">
|
|
|
|
|
+ <el-table-column type="index" label="序号" align="center" width="60"></el-table-column>
|
|
|
|
|
+ <el-table-column prop="paymentNo" label="支付单号" min-width="180" show-overflow-tooltip></el-table-column>
|
|
|
|
|
+ <el-table-column prop="paymentAmount" label="支付金额" width="120" align="right">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ ¥{{ scope.row.paymentAmount?.toFixed(2) || '0.00' }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="paymentMethod" label="支付方式" width="120" align="center">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ {{ scope.row.paymentMethod === 'Online' ? '在线支付' : scope.row.paymentMethod }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="status" label="支付状态" width="100" align="center">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <el-tag :type="scope.row.status === 'Pending' ? 'warning' : 'success'">
|
|
|
|
|
+ {{ scope.row.status === 'Pending' ? '待支付' : scope.row.status === 'Success' ? '已支付' : scope.row.status }}
|
|
|
|
|
+ </el-tag>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="paymentDate" label="支付时间" width="160">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ {{ scope.row.paymentDate ? moment(scope.row.paymentDate).format('YYYY-MM-DD HH:mm') : '-' }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="createDate" label="创建时间" width="160">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ {{ scope.row.createDate ? moment(scope.row.createDate).format('YYYY-MM-DD HH:mm') : '-' }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column prop="remark" label="备注" min-width="200" show-overflow-tooltip></el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <span class="dialog-footer">
|
|
|
|
|
+ <el-button @click="paymentRecordDialogVisible = false">关 闭</el-button>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+ <order-detail-dialog ref="orderDetailDialog" :orderId="currentOrderId"></order-detail-dialog>
|
|
|
|
|
+ </el-card>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+import {
|
|
|
|
|
+ getOrderRefundList,
|
|
|
|
|
+ getOrderRefundFields,
|
|
|
|
|
+ getOrderRefundInfo,
|
|
|
|
|
+ reviewRefundOrder,
|
|
|
|
|
+ processRefund,
|
|
|
|
|
+ wxRefundOrder,
|
|
|
|
|
+ getPaymentInfoByOrderId,
|
|
|
|
|
+} from '@/api/order';
|
|
|
|
|
+import moment from 'moment';
|
|
|
|
|
+import { getOrderStatusText, getOrderStatusType, getPaymentStatusText, getPaymentStatusType } from '@/utils/order';
|
|
|
|
|
+import OrderDetailDialog from './detial.vue';
|
|
|
|
|
+
|
|
|
|
|
+export default {
|
|
|
|
|
+ name: "RefundManage",
|
|
|
|
|
+ components: { OrderDetailDialog },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ forms: {
|
|
|
|
|
+ keyword: "",
|
|
|
|
|
+ refundStatus: "",
|
|
|
|
|
+ columns: [
|
|
|
|
|
+ { label: "订单ID", prop: "orderID" },
|
|
|
|
|
+ { label: "旅行社名称", prop: "agencyName" },
|
|
|
|
|
+ { label: "订单总额", prop: "totalAmount" },
|
|
|
|
|
+ { label: "已支付金额", prop: "paidAmount" },
|
|
|
|
|
+ { label: "申请退款", prop: "refundAmount" },
|
|
|
|
|
+ { label: "实退金额", prop: "actualRefundAmount" },
|
|
|
|
|
+ { label: "退款原因", prop: "refundReason" },
|
|
|
|
|
+ { label: "退款状态", prop: "refundStatus" },
|
|
|
|
|
+ { label: "申请时间", prop: "applyDate" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ sorters: [],
|
|
|
|
|
+ filters: [],
|
|
|
|
|
+ page: 1,
|
|
|
|
|
+ rows: 10,
|
|
|
|
|
+ },
|
|
|
|
|
+ tableData: [],
|
|
|
|
|
+ total: 0,
|
|
|
|
|
+
|
|
|
|
|
+ // 详情对话框
|
|
|
|
|
+ detailDialogVisible: false,
|
|
|
|
|
+ detailData: {},
|
|
|
|
|
+
|
|
|
|
|
+ // 审核对话框
|
|
|
|
|
+ auditDialogVisible: false,
|
|
|
|
|
+ auditForm: {
|
|
|
|
|
+ id: '',
|
|
|
|
|
+ orderID: '',
|
|
|
|
|
+ refundAmount: 0,
|
|
|
|
|
+ refundReason: '',
|
|
|
|
|
+ isApproved: true,
|
|
|
|
|
+ actualRefundAmount: 0,
|
|
|
|
|
+ remark: '',
|
|
|
|
|
+ },
|
|
|
|
|
+ auditRules: {
|
|
|
|
|
+ isApproved: [
|
|
|
|
|
+ { required: true, message: "请选择审核结果", trigger: "change" }
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ // 退款对话框
|
|
|
|
|
+ refundDialogVisible: false,
|
|
|
|
|
+ refundForm: {
|
|
|
|
|
+ id: '',
|
|
|
|
|
+ orderID: '',
|
|
|
|
|
+ actualRefundAmount: 0,
|
|
|
|
|
+ refundMethod: 'Original',
|
|
|
|
|
+ },
|
|
|
|
|
+ paymentRecordDialogVisible: false,
|
|
|
|
|
+ paymentRecordData: [],
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ moment,
|
|
|
|
|
+
|
|
|
|
|
+ sizeHandler(val) {
|
|
|
|
|
+ this.forms.rows = val;
|
|
|
|
|
+ this.getRefundList();
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ pageHandler(val) {
|
|
|
|
|
+ this.forms.page = val;
|
|
|
|
|
+ this.getRefundList();
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ submit() {
|
|
|
|
|
+ this.forms.page = 1;
|
|
|
|
|
+ this.buildFilters();
|
|
|
|
|
+ this.getRefundList();
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ reset() {
|
|
|
|
|
+ this.forms.keyword = '';
|
|
|
|
|
+ this.forms.refundStatus = '';
|
|
|
|
|
+ this.forms.page = 1;
|
|
|
|
|
+ this.buildFilters();
|
|
|
|
|
+ this.getRefundList();
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ buildFilters() {
|
|
|
|
|
+ this.forms.filters = [];
|
|
|
|
|
+
|
|
|
|
|
+ if (this.forms.refundStatus) {
|
|
|
|
|
+ this.forms.filters.push({
|
|
|
|
|
+ name: "refundStatus",
|
|
|
|
|
+ operate: 0,
|
|
|
|
|
+ value: this.forms.refundStatus,
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ getRefundList() {
|
|
|
|
|
+ getOrderRefundList(this.forms || {}).then((res) => {
|
|
|
|
|
+ this.tableData = res.data?.data || [];
|
|
|
|
|
+ this.total = res.data?.records || 0;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ viewDetail(row) {
|
|
|
|
|
+ getOrderRefundInfo(row.orderId).then((res) => {
|
|
|
|
|
+ this.detailData = res.data || {};
|
|
|
|
|
+ this.detailDialogVisible = true;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ closeAudit() {
|
|
|
|
|
+ this.$refs.auditFormRef?.resetFields();
|
|
|
|
|
+ this.auditForm = {
|
|
|
|
|
+ id: '',
|
|
|
|
|
+ refundAmount: 0,
|
|
|
|
|
+ refundReason: '',
|
|
|
|
|
+ isApproved: true,
|
|
|
|
|
+ actualRefundAmount: 0,
|
|
|
|
|
+ remark: '',
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ reviewRefund(row) {
|
|
|
|
|
+ this.auditForm = {
|
|
|
|
|
+ id: row.id,
|
|
|
|
|
+ orderID: row.orderID,
|
|
|
|
|
+ refundAmount: row.refundAmount,
|
|
|
|
|
+ refundReason: row.auditRemark,
|
|
|
|
|
+ isApproved: true,
|
|
|
|
|
+ actualRefundAmount: row.refundAmount,
|
|
|
|
|
+ remark: '',
|
|
|
|
|
+ };
|
|
|
|
|
+ this.auditDialogVisible = true;
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ submitAudit() {
|
|
|
|
|
+ this.$refs.auditFormRef.validate((valid) => {
|
|
|
|
|
+ if (!valid) return;
|
|
|
|
|
+
|
|
|
|
|
+ const { id, isApproved, remark } = this.auditForm;
|
|
|
|
|
+
|
|
|
|
|
+ reviewRefundOrder(id, isApproved, remark).then((res) => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ this.$message.success('审核成功');
|
|
|
|
|
+ this.auditDialogVisible = false;
|
|
|
|
|
+ this.getRefundList();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ refund(row) {
|
|
|
|
|
+ this.refundForm = {
|
|
|
|
|
+ id: row.id,
|
|
|
|
|
+ orderID: row.orderID,
|
|
|
|
|
+ actualRefundAmount: row.actualRefundAmount,
|
|
|
|
|
+ refundMethod: 'Original',
|
|
|
|
|
+ };
|
|
|
|
|
+ this.refundDialogVisible = true;
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ closeRefund() {
|
|
|
|
|
+ this.refundForm = {
|
|
|
|
|
+ id: '',
|
|
|
|
|
+ orderID: '',
|
|
|
|
|
+ actualRefundAmount: 0,
|
|
|
|
|
+ refundMethod: 'Original',
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ submitRefund() {
|
|
|
|
|
+ const { id, refundMethod } = this.refundForm;
|
|
|
|
|
+
|
|
|
|
|
+ this.$confirm('确认执行退款操作?', '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ processRefund(id, refundMethod).then((res) => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ this.$message.success('退款成功');
|
|
|
|
|
+ this.refundDialogVisible = false;
|
|
|
|
|
+ this.getRefundList();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ refund(row) {
|
|
|
|
|
+ this.$confirm('确认执行退款操作?线上退款可能失败,需要再次确认', '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ wxRefundOrder(row.id).then((res) => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ this.$message.success('操作退款成功,请注意查看退款状态');
|
|
|
|
|
+ this.getRefundList();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }).catch(() => {
|
|
|
|
|
+ // 用户取消操作
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ paymentRecord(row) {
|
|
|
|
|
+ getPaymentInfoByOrderId(row.orderID).then((res) => {
|
|
|
|
|
+ this.paymentRecordData = res.data || [];
|
|
|
|
|
+ this.paymentRecordDialogVisible = true;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ getOrderStatusType,
|
|
|
|
|
+ getOrderStatusText,
|
|
|
|
|
+ getPaymentStatusType,
|
|
|
|
|
+ getPaymentStatusText,
|
|
|
|
|
+
|
|
|
|
|
+ getRefundStatusType(status) {
|
|
|
|
|
+ const types = {
|
|
|
|
|
+ 'Pending': 'warning',
|
|
|
|
|
+ 'Approved': 'success',
|
|
|
|
|
+ 'Rejected': 'danger',
|
|
|
|
|
+ 'Refunding': 'info',
|
|
|
|
|
+ 'Refunded': 'success',
|
|
|
|
|
+ };
|
|
|
|
|
+ return types[status] || 'info';
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ getRefundStatusText(status) {
|
|
|
|
|
+ const texts = {
|
|
|
|
|
+ 'Pending': '待审核',
|
|
|
|
|
+ 'Approved': '已通过',
|
|
|
|
|
+ 'Rejected': '已驳回',
|
|
|
|
|
+ 'Refunding': '退款中',
|
|
|
|
|
+ 'Refunded': '已退款',
|
|
|
|
|
+ };
|
|
|
|
|
+ return texts[status] || status;
|
|
|
|
|
+ },
|
|
|
|
|
+ viewOrderDetail(orderID) {
|
|
|
|
|
+ this.$refs.orderDetailDialog.open(orderID);
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ async created() {
|
|
|
|
|
+ const res = await getOrderRefundFields();
|
|
|
|
|
+ this.forms.columns = res.data?.columns || []
|
|
|
|
|
+ this.getRefundList();
|
|
|
|
|
+ },
|
|
|
|
|
+};
|
|
|
|
|
+</script>
|
|
|
|
|
+
|
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
|
+.search-form {
|
|
|
|
|
+ .el-form-item {
|
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.main-card {
|
|
|
|
|
+ margin: 10px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.pagination {
|
|
|
|
|
+ margin-top: 20px;
|
|
|
|
|
+ text-align: right;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|