<!--
 * @Author: Fly
 * @Date: 2025-12-17 15:11:04
 * @LastEditTime: 2025-12-20 09:15:31
 * @Description: 
-->
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" :size="ELsize" label-width="auto">

      <el-form-item label="迁出店铺名称" prop="originalBusinessName">
        <el-input v-model="queryParams.originalBusinessName" placeholder="请输入" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="迁入店铺名称" prop="currentBusinessName">
        <el-input v-model="queryParams.currentBusinessName" placeholder="请输入" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="迁移时间" prop="moveTime">
        <el-date-picker v-model="queryParams.moveTime" value-format="yyyy-MM-dd" type="daterange" range-separator="-"
          start-placeholder="开始日期" end-placeholder="结束日期" />
      </el-form-item>
      <el-form-item label="订单编号" prop="orderNo">
        <el-input v-model="queryParams.orderNo" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="用户手机号" prop="userMobile">
        <el-input v-model="queryParams.userMobile" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="用户姓名" prop="userName">
        <el-input v-model="queryParams.userName" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" @click="resetQuery('queryForm')">重置</el-button>
      </el-form-item>
    </el-form>


    <el-row :gutter="10" class="mb8">
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table :border="TableBorder" :size="ELTableSize" v-loading="loading" :data="dataList">
      <el-table-column type="index" width="55" label="序号" align="center">
        <template slot-scope="{$index}">
          {{ $getTableIndex(queryParams, $index + 1) }}
        </template>
      </el-table-column>
      <template v-for="item in TableColumn">
        <el-table-column :label="item.label" :align="item.align || 'center'" :width="item.width || 'auto'">
          <template slot-scope="{row}">
            {{ (item.formatter ? item.formatter(row) : row[item.prop]) | TableItemEmpty }}
          </template>
        </el-table-column>
      </template>

    </el-table>

  </div>
</template>

<script>
import getListApi from "@/mixins/getListApi";
import { getSubsidyQueueMovePageApi } from "@/api/shop";
export default {
  name: '',
  mixins: [getListApi],
  data() {
    return {
      listURL: getSubsidyQueueMovePageApi,
      queryParams: {
        originalBusinessName: undefined,
        currentBusinessName: undefined,
        moveTime: undefined,
        orderNo: undefined,
        userName: undefined,
        userMobile: undefined
      },
      // 日期范围字段映射配置
      dateRangeMapping: {
        // 日期范围字段名: { start: 开始时间字段名, end: 结束时间字段名 }
        moveTime: { start: 'moveStartTime', end: 'moveEndTime' },
      },
      TableColumn: [
        {
          label: '订单编号',
          prop: 'orderNo'
        },
        {
          label: '迁出店铺名称',
          prop: 'originalBusinessName'
        },
        {
          label: '迁入店铺名称',
          prop: 'currentBusinessName'
        },
        {
          label: '当前队序',
          prop: 'queueOrder'
        },
        {
          label: '订单金额',
          prop: 'payAmount'
        },
        {
          label: '最多补贴金额',
          prop: 'shouldSubsidyAmount'
        },
        {
          label: '已补贴金额',
          prop: 'actualSubsidyAmount'
        },
        {
          label: '已补贴积分',
          prop: 'subsidyPoints'
        },
        {
          label: '用户手机号',
          prop: 'userMobile'
        },
        {
          label: '用户姓名',
          prop: 'userName'
        },
        {
          label: '消费时间',
          prop: 'consumeTime',
          width: '100'
        },
        {
          label: '迁移时间',
          prop: 'moveTime',
          width: '100'
        },
        {
          label: '状态',
          prop: 'subsidyStatus',
          formatter: (row) => {
            const { subsidyStatus } = row;
            try {
              return this.$options.filters.SubsidyStatusOptionFilter(subsidyStatus) || subsidyStatus;
            } catch (error) {
              return subsidyStatus;
            }
          }
        }
      ],
    };
  },
};
</script>

<style lang='scss' scoped></style>