<!--
 * @Author: Fly
 * @Date: 2025-12-10 10:06:13
 * @LastEditTime: 2025-12-22 09:54:24
 * @Description: 
-->
<template>
  <div class="">
    <el-table v-loading="loading" :border="TableBorder" :size="ELTableSize" :data="dataList">
      <el-table-column type="index" width="55" label="序号" align="center">
        <template slot-scope="{$index}">
          {{ $getTableIndex(queryParams, $index + 1) }}
        </template>
      </el-table-column>
      <el-table-column label="订单编号" align="center">
        <template slot-scope="{row}">
          {{ row.orderNo | TableItemEmpty }}
        </template>
      </el-table-column>
      <el-table-column label="插队序" align="center">
        <template slot-scope="{row}">
          <!-- {{ row.queueOrder | TableItemEmpty }} -->
          {{ (SubsidyStatusEnum.QUENING === row.subsidyStatus ? row.queueOrder : '') | TableItemEmpty }}
        </template>
      </el-table-column>
      <el-table-column label="订单金额" align="center">
        <template slot-scope="{row}">
          {{ row.payAmount | TableItemEmpty }}
        </template>
      </el-table-column>
      <el-table-column label="补贴金额" align="center">
        <template slot-scope="{row}">
          {{ row.shouldSubsidyAmount | TableItemEmpty }}
        </template>
      </el-table-column>
      <el-table-column label="已补贴金额" align="center">
        <template slot-scope="{row}">
          {{ row.actualSubsidyAmount | TableItemEmpty }}
        </template>
      </el-table-column>
      <el-table-column label="已补贴积分" align="center">
        <template slot-scope="{row}">
          {{ row.subsidyPoints | TableItemEmpty }}
        </template>
      </el-table-column>
      <el-table-column label="插队占比(%)" align="center">
        <template slot-scope="{row}">
          {{ row.cutInRatio | TableItemEmpty }}
        </template>
      </el-table-column>
      <el-table-column label="插队金额" align="center">
        <template slot-scope="{row}">
          {{ row.cutInShouldSubsidyAmount | TableItemEmpty }}
        </template>
      </el-table-column>
      <el-table-column label="店铺名称" align="center">
        <template slot-scope="{row}">
          {{ row.currentBusinessName | TableItemEmpty }}
        </template>
      </el-table-column>
      <el-table-column label="用户手机号" align="center">
        <template slot-scope="{row}">
          {{ row.userMobile | TableItemEmpty }}
        </template>
      </el-table-column>
      <el-table-column label="用户姓名" align="center">
        <template slot-scope="{row}">
          {{ row.userName | TableItemEmpty }}
        </template>
      </el-table-column>
      <el-table-column label="消费时间" align="center" width="100">
        <template slot-scope="{row}">
          {{ row.consumeTime | TableItemEmpty }}
        </template>
      </el-table-column>
      <el-table-column label="排队开始时间" align="center" width="100">
        <template slot-scope="{row}">
          {{ row.queueTime | TableItemEmpty }}
        </template>
      </el-table-column>
      <el-table-column label="状态" align="center" width="100">
        <template slot-scope="{row}">
          <!-- {{ isCancelQueue(row) ? '不参与' : row.subsidyStatus | SubsidyStatusOptionFilter | TableItemEmpty }} -->
          <!-- <template v-if="isCancelQueue(row)">
            <StatusTag :status-vo="{ label: '不参与', type: 'info' }" />
          </template>
          <template v-else>
            <StatusTag :status-vo="row.subsidyStatus | SubsidyStatusOptionFilter(true)" />
          </template> -->
          <StatusTag :status-vo="row.subsidyStatus | SubsidyStatusOptionFilter(true)" />
        </template>
      </el-table-column>
    </el-table>


    <QuotaCutIn ref="QuotaCutInRef" @success="refreshFn" />
  </div>
</template>

<script>
import QuotaCutIn from './QuotaCutIn.vue'
import { SubsidyStatusEnum } from '@/utils/statusEnum.js';
import { isCancelQueue } from '@/utils/estimate.js';
export default {
  components: { QuotaCutIn },
  props: {
    refreshFn: {
      type: Function,
      default: () => { }
    },
    dataList: {
      type: Array,
      default: () => []
    },
    loading: {
      type: Boolean,
      default: false
    },
    queryParams: {
      type: Object,
      default: () => { }
    }
  },
  data() {
    return {
      SubsidyStatusEnum,
      isCancelQueue,
    }
  },
  methods: {

    newQuotaCutIn() {
      this.$refs.QuotaCutInRef.openHandle()
    }
  }

}
</script>