Sfoglia il codice sorgente

feat: 更新门店支付页面和新增门店冗余销售页面

xw 3 settimane fa
parent
commit
4a7c73d160

+ 47 - 76
src/views/hisStore/storePayment/index.vue

@@ -97,6 +97,13 @@
                   />
             </el-select>
           </el-form-item>
+          <el-form-item label="审核状态" prop="refundAuditStatus">
+            <el-select v-model="queryParams.refundAuditStatus" placeholder="请选择审核状态" clearable size="small">
+              <el-option label="待审核" value="0"/>
+              <el-option label="审核通过" value="1"/>
+              <el-option label="退款成功" value="2"/>
+            </el-select>
+          </el-form-item>
           <el-form-item>
             <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -139,6 +146,17 @@
           </el-table-column>
           <el-table-column label="退款时间" align="center" prop="refundTime" width="180">
           </el-table-column>
+          <el-table-column label="审核状态" align="center" prop="refundAuditStatus" width="120">
+            <template slot-scope="scope">
+              <el-tag 
+                v-if="scope.row.refundAuditStatus !== null && scope.row.refundAuditStatus !== undefined"
+                :type="getAuditStatusTagType(scope.row.refundAuditStatus)"
+                size="small">
+                {{ getAuditStatusText(scope.row.refundAuditStatus) }}
+              </el-tag>
+              <span v-else style="color: #909399;">-</span>
+            </template>
+          </el-table-column>
           <el-table-column label="备注" align="center" prop="remark" />
           <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
             <template slot-scope="scope">
@@ -156,18 +174,6 @@
             @click="handleRefund(scope.row)"
             v-hasPermi="['store:storePayment:refund']"
           >退款</el-button>
-              <el-button
-                v-if="scope.row.status != -1 && scope.row.status != 0"
-                size="mini"
-                type="text"
-                :icon="scope.row.refundAuditStatus == 0 || !scope.row.refundAuditStatus ? 'el-icon-check' : 'el-icon-success'"
-                @click="handleAudit(scope.row)"
-                :disabled="scope.row.refundAuditStatus == 1 || scope.row.refundAuditStatus == 2"
-              >
-                <span v-if="scope.row.refundAuditStatus == 0 || !scope.row.refundAuditStatus">退款审核</span>
-                <span v-else-if="scope.row.refundAuditStatus == 1">审核通过</span>
-                <span v-else-if="scope.row.refundAuditStatus == 2">审核拒绝</span>
-              </el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -233,55 +239,11 @@
         <el-button @click="cancelRefund">取 消</el-button>
       </div>
     </el-dialog>
-
-    <!-- 退款审核对话框 -->
-    <el-dialog :title="audit.title" :visible.sync="audit.open" width="500px" append-to-body>
-      <el-form ref="auditForm" :model="auditForm" :rules="auditRules" label-width="100px">
-        <el-form-item label="支付订单号" prop="payCode">
-          <el-input v-model="auditForm.payCode" disabled placeholder="支付订单号" />
-        </el-form-item>
-        <el-form-item label="支付类型" prop="payTypeCode">
-          <el-input v-model="auditForm.payTypeCode" disabled placeholder="支付类型" />
-        </el-form-item>
-        <el-form-item label="支付金额" prop="payMoney">
-          <el-input v-model="auditForm.payMoney" disabled placeholder="支付金额">
-            <template slot="append">元</template>
-          </el-input>
-        </el-form-item>
-        <el-form-item label="退款金额" prop="refundMoney">
-          <el-input v-model="auditForm.refundMoney" disabled placeholder="退款金额">
-            <template slot="append">元</template>
-          </el-input>
-        </el-form-item>
-        <el-form-item label="退款原因" prop="refundReason">
-          <el-input v-model="auditForm.refundReason" disabled type="textarea" :rows="2" placeholder="退款原因" />
-        </el-form-item>
-        <el-form-item label="审核结果" prop="auditStatus">
-          <el-radio-group v-model="auditForm.auditStatus">
-            <el-radio :label="1">同意退款</el-radio>
-            <el-radio :label="2">拒绝退款</el-radio>
-          </el-radio-group>
-        </el-form-item>
-        <el-form-item label="审核人" prop="auditUser">
-          <el-input v-model="auditForm.auditUser" disabled placeholder="审核人" />
-        </el-form-item>
-        <el-form-item label="审核时间" prop="auditTime">
-          <el-input v-model="auditForm.auditTime" disabled placeholder="审核时间" />
-        </el-form-item>
-        <el-form-item label="审核意见" prop="auditComment">
-          <el-input v-model="auditForm.auditComment" type="textarea" :rows="3" placeholder="请输入审核意见" />
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitAuditForm" :loading="auditLoading">确认审核</el-button>
-        <el-button @click="cancelAudit">取 消</el-button>
-      </div>
-    </el-dialog>
   </div>
 </template>
 
 <script>
-import { refundStorePayment,listStorePayment, getStorePayment, delStorePayment, addStorePayment, updateStorePayment, exportStorePayment, auditRefund } from "@/api/hisStore/storePayment";
+import { refundStorePayment,listStorePayment, getStorePayment, delStorePayment, addStorePayment, updateStorePayment, exportStorePayment } from "@/api/hisStore/storePayment";
 import { treeselect } from "@/api/company/companyDept";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@@ -335,7 +297,8 @@ export default {
         openId: null,
         businessType: null,
         businessOrderId: null,
-        status: null
+        status: null,
+        refundAuditStatus: null // 新增审核状态查询参数
       },
       // 表单参数
       form: {},
@@ -346,15 +309,6 @@ export default {
       },
       // 退款表单参数
       refundForm: {},
-      // 审核相关
-      audit: {
-        title: "退款审核",
-        open: false
-      },
-      // 审核表单参数
-      auditForm: {},
-      // 审核加载状态
-      auditLoading: false,
       // 表单校验
       rules: {
       },
@@ -364,15 +318,6 @@ export default {
           { required: true, message: "退款金额不能为空", trigger: "blur" },
           { type: "number", message: "退款金额必须为数字", trigger: "blur" }
         ]
-      },
-      // 审核表单校验
-      auditRules: {
-        auditStatus: [
-          { required: true, message: "请选择审核结果", trigger: "change" }
-        ],
-        auditComment: [
-          { required: true, message: "请输入审核意见", trigger: "blur" }
-        ]
       }
     };
   },
@@ -691,6 +636,32 @@ export default {
           });
         }
       });
+    },
+    
+    // 获取审核状态文本
+    getAuditStatusText(status) {
+      const statusMap = {
+        0: '待审核',
+        1: '审核通过',
+        2: '退款成功',
+        '0': '待审核',
+        '1': '审核通过',
+        '2': '退款成功'
+      };
+      return statusMap[status] || '-';
+    },
+    
+    // 获取审核状态标签类型
+    getAuditStatusTagType(status) {
+      const typeMap = {
+        0: 'warning',
+        1: 'success',
+        2: 'danger',
+        '0': 'warning',
+        '1': 'success',
+        '2': 'danger'
+      };
+      return typeMap[status] || 'info';
     }
   }
 };

+ 713 - 0
src/views/hisStore/storeRedundSales/index.vue

@@ -0,0 +1,713 @@
+<template>
+  <div class="app-container">
+
+        <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+          <el-form-item label="所属部门" prop="deptId">
+              <treeselect style="width:205.4px" v-model="queryParams.deptId" :options="deptOptions" :show-count="true" placeholder="请选择所属部门" />
+          </el-form-item>
+          <el-form-item label="付款单号" prop="payCode">
+            <el-input
+              v-model="queryParams.payCode"
+              placeholder="请输入付款单号"
+              clearable
+              size="small"
+              @keyup.enter.native="handleQuery"
+            />
+          </el-form-item>
+          <el-form-item label="手机号" prop="mobile">
+            <el-input
+              v-model="queryParams.mobile"
+              placeholder="请输入手机号"
+              clearable
+              size="small"
+              @keyup.enter.native="handleQuery"
+            />
+          </el-form-item>
+          <el-form-item label="交易单号" prop="bankTransactionId">
+            <el-input
+              v-model="queryParams.bankTransactionId"
+              placeholder="请输入交易单号"
+              clearable
+              size="small"
+              @keyup.enter.native="handleQuery"
+            />
+          </el-form-item>
+          <el-form-item label="银行单号" prop="bankSerialNo">
+            <el-input
+              v-model="queryParams.bankSerialNo"
+              placeholder="请输入银行单号"
+              clearable
+              size="small"
+              @keyup.enter.native="handleQuery"
+            />
+          </el-form-item>
+
+
+      <el-form-item label="员工姓名" prop="companyUserNickName">
+          <el-input
+            v-model="queryParams.companyUserNickName"
+            placeholder="请输入员工姓名"
+            clearable
+            size="small"
+            @keyup.enter.native="handleQuery"
+          />
+      </el-form-item>
+
+          <el-form-item label="提交时间" prop="createTime">
+            <el-date-picker clearable size="small" style="width: 205.4px"
+              v-model="queryParams.createTime"
+              type="date"
+              value-format="yyyy-MM-dd"
+              placeholder="选择提交时间">
+            </el-date-picker>
+          </el-form-item>
+
+          <el-form-item label="支付时间" prop="payTime">
+            <el-date-picker
+            style="width: 215.4px"
+              clearable size="small"
+              v-model="dateRange"
+              type="daterange"
+              value-format="yyyy-MM-dd"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期">
+            </el-date-picker>
+          </el-form-item>
+
+          <el-form-item label="退款时间" prop="refundTime">
+              <el-date-picker
+                style="width: 215.4px"
+                clearable size="small"
+                v-model="refundDateRange"
+                type="daterange"
+                value-format="yyyy-MM-dd"
+                start-placeholder="开始日期"
+                end-placeholder="结束日期">
+              </el-date-picker>
+            </el-form-item>
+
+
+          <el-form-item label="状态" prop="status">
+            <el-select   v-model="queryParams.status" placeholder="请选择状态" clearable size="small" >
+            <el-option
+                    v-for="item in statusOptions"
+                    :key="item.dictValue"
+                    :label="item.dictLabel"
+                    :value="item.dictValue"
+                  />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="审核状态" prop="refundAuditStatus">
+            <el-select v-model="queryParams.refundAuditStatus" placeholder="请选择审核状态" clearable size="small">
+              <el-option label="未审核" value="0"/>
+              <el-option label="待审核" value="1"/>
+              <el-option label="已审核" value="2"/>
+            </el-select>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+          </el-form-item>
+        </el-form>
+        <el-row :gutter="10" class="mb8">
+          <el-col :span="1.5">
+            <el-button
+              type="warning"
+              icon="el-icon-download"
+              size="mini"
+              @click="handleExport"
+              v-hasPermi="['store:storePayment:export']"
+            >导出</el-button>
+          </el-col>
+
+        </el-row>
+
+        <el-table height="500" border v-loading="loading" :data="storePaymentList" @selection-change="handleSelectionChange">
+          <el-table-column type="selection" width="55" align="center" />
+          <el-table-column label="ID" align="center" prop="paymentId" />
+          <el-table-column label="付款单号" align="center" prop="payCode" width="120px" />
+          <el-table-column label="会员手机号" align="center" prop="userPhone"  width="120px" />
+          <el-table-column label="支付类型" align="center" prop="payTypeCode" />
+          <el-table-column label="支付金额" align="center" prop="payMoney" />
+          <el-table-column label="退款金额" align="center" prop="refundMoney" />
+          <el-table-column label="交易单号" align="center" prop="bankTransactionId" />
+          <el-table-column label="银行单号" align="center" prop="bankSerialNo" />
+          <el-table-column label="所属公司" align="center" prop="companyName" />
+          <el-table-column label="所属部门" align="center" prop="deptName" />
+          <el-table-column label="员工" align="center" prop="companyUserNickName" />
+          <el-table-column label="状态" align="center" prop="status" >
+              <template slot-scope="scope">
+                  <el-tag prop="status" v-for="(item, index) in statusOptions"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
+              </template>
+          </el-table-column>
+          <el-table-column label="提交时间" align="center" prop="createTime" width="180">
+          </el-table-column>
+          <el-table-column label="支付时间" align="center" prop="payTime" width="180">
+          </el-table-column>
+          <el-table-column label="退款时间" align="center" prop="refundTime" width="180">
+          </el-table-column>
+          <el-table-column label="审核状态" align="center" prop="refundAuditStatus" width="120">
+            <template slot-scope="scope">
+              <el-tag 
+                v-if="scope.row.refundAuditStatus !== null && scope.row.refundAuditStatus !== undefined"
+                :type="getAuditStatusTagType(scope.row.refundAuditStatus)"
+                size="small">
+                {{ getAuditStatusText(scope.row.refundAuditStatus) }}
+              </el-tag>
+              <span v-else style="color: #909399;">-</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="备注" align="center" prop="remark" />
+          <el-table-column label="操作" fixed="right" align="center" class-name="small-padding fixed-width">
+            <template slot-scope="scope">
+              <el-button
+                size="mini"
+                type="text"
+                @click="handleRefundAudit(scope.row)"
+                v-hasPermi="['store:storeAfterSales:query']"
+              >退款审核</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+
+        <pagination
+          v-show="total>0"
+          :total="total"
+          :page.sync="queryParams.pageNum"
+          :limit.sync="queryParams.pageSize"
+          @pagination="getList"
+        />
+
+
+    <!-- 添加或修改支付明细对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+        <el-form-item label="支付订单号" prop="payCode">
+          <el-input v-model="form.payCode" disabled placeholder="请输入支付订单号" />
+        </el-form-item>
+        <el-form-item label="支付类型" prop="payTypeCode">
+          <el-input v-model="form.payTypeCode" disabled placeholder="请输入支付类型" />
+        </el-form-item>
+        <el-form-item label="支付金额" prop="payMoney">
+          <el-input v-model="form.payMoney" disabled placeholder="请输入支付金额" />
+        </el-form-item>
+          <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark"  placeholder="请输入备注" />
+        </el-form-item>
+
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+        <el-dialog :title="refund.title" :visible.sync="refund.open" width="500px" append-to-body>
+      <el-form ref="refundForm" :model="refundForm" :rules="refundRules" label-width="100px">
+        <el-form-item label="支付订单号" prop="payCode">
+          <el-input v-model="refundForm.payCode" disabled placeholder="请输入支付订单号" />
+        </el-form-item>
+        <el-form-item label="支付类型" prop="payTypeCode">
+          <el-input v-model="refundForm.payTypeCode" disabled placeholder="请输入支付类型" />
+        </el-form-item>
+        <el-form-item label="支付金额" prop="payMoney">
+          <el-input v-model="refundForm.payMoney" disabled placeholder="请输入支付金额" />
+        </el-form-item>
+        <el-form-item label="退款金额" prop="refundMoney">
+          <el-input-number 
+            :min="0" 
+            :max="refundForm.payMoney"
+            :precision="2"
+            v-model="refundForm.refundMoney"  
+            placeholder="请输入退款金额"
+            style="width: 100%"
+          />
+          <div style="color: #909399; font-size: 12px; margin-top: 5px;">
+            支付金额:{{ refundForm.payMoney }} 元,最大可退款金额:{{ refundForm.payMoney }} 元
+          </div>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitRefundForm">确 定</el-button>
+        <el-button @click="cancelRefund">取 消</el-button>
+      </div>
+    </el-dialog>
+    
+    <!-- 退款审核弹窗 -->
+    <el-dialog :title="auditDialog.title" :visible.sync="auditDialog.open" width="500px" append-to-body>
+      <el-form ref="auditForm" :model="auditDialog.form" :rules="auditRules" label-width="100px">
+        <el-form-item label="审核人" prop="auditor">
+          <el-input v-model="auditDialog.form.auditor" placeholder="当前登录用户" readonly />
+        </el-form-item>
+        <el-form-item label="审核时间" prop="auditTime">
+          <el-date-picker
+            v-model="auditDialog.form.auditTime"
+            type="datetime"
+            placeholder="请选择审核时间"
+            format="yyyy-MM-dd HH:mm:ss"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            style="width: 100%"
+          />
+        </el-form-item>
+        <el-form-item label="审核备注" prop="auditRemark">
+          <el-input
+            v-model="auditDialog.form.auditRemark"
+            type="textarea"
+            :rows="3"
+            placeholder="请输入审核备注(可选)"
+            maxlength="500"
+            show-word-limit
+          />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitAuditForm">确 定</el-button>
+        <el-button @click="cancelAudit">取 消</el-button>
+      </div>
+    </el-dialog>
+    
+    <el-drawer
+     size="75%"
+      :title="title" :visible.sync="open"
+      >
+      <product-after-sales-order  ref="afterSalesOrder" />
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import { refundStorePayment,listStorePayment, getStorePayment, delStorePayment, addStorePayment, updateStorePayment, exportStorePayment, auditRefund } from "@/api/hisStore/storePayment";
+import productAfterSalesOrder from "../components/productAfterSalesOrder";
+import { treeselect } from "@/api/company/companyDept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+export default {
+  name: "StorePayment",
+  components: { Treeselect, productAfterSalesOrder },
+  data() {
+    return {
+      // 部门树选项
+      deptOptions: undefined,
+      // 是否显示弹出层
+      open: false,
+      // 部门名称
+      deptName: undefined,
+      defaultProps: {
+        children: "children",
+        label: "label",
+      },
+
+      statusOptions:[],
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      dateRange:[],
+      refundDateRange:[],
+      // 总条数
+      total: 0,
+      // 支付明细表格数据
+      storePaymentList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        payCode: null,
+        payTypeCode: null,
+        payMoney: null,
+        payTime: null,
+        tradeNo: null,
+        userId: null,
+        openId: null,
+        businessType: null,
+        businessOrderId: null,
+        status: null,
+        refundAuditStatus: null // 新增审核状态查询参数
+      },
+      // 表单参数
+      form: {},
+      // 退款相关
+      refund: {
+        title: "退款",
+        open: false
+      },
+      // 退款表单参数
+      refundForm: {},
+      // 表单校验
+      rules: {
+      },
+      // 退款表单校验
+      refundRules: {
+        refundMoney: [
+          { required: true, message: "退款金额不能为空", trigger: "blur" },
+          { type: "number", message: "退款金额必须为数字", trigger: "blur" }
+        ]
+      },
+      // 退款审核弹窗数据
+      auditDialog: {
+        open: false,
+        title: '退款审核',
+        form: {
+          paymentId: null,
+          auditor: '',
+          auditTime: '',
+          auditRemark: ''
+        }
+      },
+      // 审核表单校验
+      auditRules: {
+        auditor: [
+          { required: true, message: "审核人不能为空", trigger: "blur" }
+        ],
+        auditTime: [
+          { required: true, message: "审核时间不能为空", trigger: "blur" }
+        ]
+      }
+    };
+  },
+  watch: {
+    // 根据名称筛选部门树
+    deptName(val) {
+        this.$refs.tree.filter(val);
+      },
+  },
+  created() {
+    this.getTreeselect();
+    this.getDicts("store_payment_status").then((response) => {
+      this.statusOptions = response.data;
+    });
+    this.getList();
+  },
+  methods: {
+    /** 查询部门下拉树结构 */
+    getTreeselect() {
+      treeselect().then((response) => {
+        this.deptOptions = response.data;
+      });
+    },
+    // 筛选节点
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.label.indexOf(value) !== -1;
+    },
+    // 节点单击事件
+    handleNodeClick(data) {
+      this.queryParams.deptId = data.id;
+      this.getList();
+    },
+    /** 查询支付明细列表 */
+    getList() {
+      this.loading = true;
+      if(this.refundDateRange!=null&&this.refundDateRange.length==2){
+        this.queryParams.refundBeginTime=this.refundDateRange[0];
+        this.queryParams.refundEndTime=this.refundDateRange[1];
+      }
+      else{
+        this.queryParams.refundBeginTime=null;
+        this.queryParams.refundEndTime=null;
+      }
+      listStorePayment(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+        this.storePaymentList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        paymentId: null,
+        payCode: null,
+        payTypeCode: null,
+        payMoney: null,
+        payTime: null,
+        createTime: null,
+        tradeNo: null,
+        userId: null,
+        openId: null,
+        businessType: null,
+        businessOrderId: null,
+        status: 0
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.paymentId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加支付明细";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const paymentId = row.paymentId || this.ids
+      getStorePayment(paymentId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改支付明细";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.paymentId != null) {
+            updateStorePayment(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("修改成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          } else {
+            addStorePayment(this.form).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("新增成功");
+                this.open = false;
+                this.getList();
+              }
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const paymentIds = row.paymentId || this.ids;
+      this.$confirm('是否确认删除支付明细编号为"' + paymentIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delStorePayment(paymentIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(function() {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有支付明细数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportStorePayment(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        }).catch(function() {});
+    },
+    /** 退款按钮操作 */
+    handleRefund(row) {
+      this.resetRefundForm();
+      this.refundForm = {
+        paymentId: row.paymentId,
+        payCode: row.payCode,
+        payTypeCode: row.payTypeCode,
+        payMoney: row.payMoney,
+        refundMoney: row.payMoney // 默认显示支付金额
+      };
+      this.refund.open = true;
+    },
+    /** 退款表单重置 */
+    resetRefundForm() {
+      this.refundForm = {
+        paymentId: null,
+        payCode: null,
+        payTypeCode: null,
+        payMoney: null,
+        refundMoney: null
+      };
+      if (this.$refs.refundForm) {
+        this.$refs.refundForm.clearValidate();
+      }
+    },
+    /** 取消退款 */
+    cancelRefund() {
+      this.refund.open = false;
+      this.resetRefundForm();
+    },
+    /** 提交退款表单 */
+    submitRefundForm() {
+      this.$refs["refundForm"].validate(valid => {
+        if (valid) {
+          // 验证退款金额是否合理
+          if (this.refundForm.refundMoney <= 0) {
+            this.msgError("退款金额必须大于0");
+            return;
+          }
+          
+          if (this.refundForm.refundMoney > this.refundForm.payMoney) {
+            this.msgError("退款金额不能超过支付金额");
+            return;
+          }
+          
+          this.$confirm('是否确认退款金额 ' + this.refundForm.refundMoney + ' 元?', '确认退款', {
+            confirmButtonText: '确认退款',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            // 调用退款 API
+            const refundData = {
+              paymentId: this.refundForm.paymentId,
+              refundMoney: this.refundForm.refundMoney,
+              refundReason: '用户申请退款' // 可以后续添加退款原因输入框
+            };
+            
+            refundStorePayment(refundData).then(response => {
+              if (response.code === 200) {
+                this.msgSuccess("退款申请提交成功");
+                this.refund.open = false;
+                this.getList(); // 刷新列表
+              } else {
+                this.msgError(response.msg || "退款申请失败");
+              }
+            }).catch(error => {
+              console.error('退款申请失败:', error);
+              this.msgError("退款申请失败,请稍后重试");
+            });
+          }).catch(() => {
+            // 取消退款
+          });
+        }
+      });
+    },
+    
+    // 获取审核状态文本
+    getAuditStatusText(status) {
+      const statusMap = {
+        0: '未审核',
+        1: '待审核',
+        2: '已审核',
+        '0': '未审核',
+        '1': '待审核',
+        '2': '已审核'
+      };
+      return statusMap[status] || '-';
+    },
+    
+    // 获取审核状态标签类型
+    getAuditStatusTagType(status) {
+      const typeMap = {
+        0: 'info',     // 未审核 - 灰色
+        1: 'warning',  // 待审核 - 橙色
+        2: 'success',  // 已审核 - 绿色
+        '0': 'info',
+        '1': 'warning',
+        '2': 'success'
+      };
+      return typeMap[status] || 'info';
+    },
+
+    // 退款审核方法
+    handleRefundAudit(row){
+      // 重置审核表单
+      this.resetAuditForm();
+      // 设置待审核的订单ID
+      this.auditDialog.form.paymentId = row.paymentId;
+      // 设置默认审核时间为当前时间
+      this.auditDialog.form.auditTime = this.parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}');
+      // 自动获取当前登录用户作为审核人
+      this.auditDialog.form.auditor = this.$store.state.user.name || this.$store.getters.name || '系统管理员';
+      // 打开审核弹窗
+      this.auditDialog.open = true;
+    },
+    
+    // 重置审核表单
+    resetAuditForm() {
+      this.auditDialog.form = {
+        paymentId: null,
+        auditor: '',
+        auditTime: '',
+        auditRemark: ''
+      };
+      if (this.$refs.auditForm) {
+        this.$refs.auditForm.clearValidate();
+      }
+    },
+    
+    // 取消审核
+    cancelAudit() {
+      this.auditDialog.open = false;
+      this.resetAuditForm();
+    },
+    
+    // 提交审核表单
+    submitAuditForm() {
+      this.$refs["auditForm"].validate(valid => {
+        if (valid) {
+          const auditData = {
+            paymentId: this.auditDialog.form.paymentId,
+            auditor: this.auditDialog.form.auditor,
+            auditTime: this.auditDialog.form.auditTime,
+            auditRemark: this.auditDialog.form.auditRemark,
+            refundAuditStatus: 1 // 设置为待审核状态
+          };
+          
+          // 调用退款审核API
+          auditRefund(auditData).then(response => {
+            if (response.code === 200) {
+              // 找到对应的行并更新审核状态
+              const targetRow = this.storePaymentList.find(item => item.paymentId === this.auditDialog.form.paymentId);
+              if (targetRow) {
+                targetRow.refundAuditStatus = 1; // 设置为待审核
+                targetRow.auditor = this.auditDialog.form.auditor;
+                targetRow.auditTime = this.auditDialog.form.auditTime;
+              }
+              
+              this.$message({
+                type: 'success',
+                message: '审核提交成功!表格中的审核状态已更新为:待审核'
+              });
+              
+              this.auditDialog.open = false;
+              this.resetAuditForm();
+            } else {
+              this.$message({
+                type: 'error',
+                message: response.msg || '审核提交失败'
+              });
+            }
+          }).catch(error => {
+            console.error('审核提交失败:', error);
+            this.$message({
+              type: 'error',
+              message: '审核提交失败,请稍后重试'
+            });
+          });
+        }
+      });
+    }
+  }
+};
+</script>