<!--
 * @Description: 详情弹框
 * @Author: Sugar.
 * @Date: 2023-11-24 13:55:00
 * @LastEditors: Sugar.
 * @LastEditTime: 2023-11-24 13:55:00
 * @FilePath: \cattle_webui\src\views\performMr\dialog\AddOrEditDialog.vue
 * @Copyright: Copyright (c) 2016~2023 by Sugar., All Rights Reserved.
-->
<template>
  <el-dialog
    title="订单详情"
    :visible.sync="open"
    width="800px"
    append-to-body
    :close-on-click-modal="false"
    @close="cancel"
  >
    <div class="dialog" v-if="form">
      <!--   基础信息   -->
      <div class="title-class" style="margin-top: 0">基础信息</div>
      <el-row>
        <el-col :span="12">
          <div class="grid-content bg-purple item-class">团队名称: <span>{{ form.teamName || ''}}</span></div>
        </el-col>
        <el-col :span="12">
          <div class="grid-content bg-purple item-class">团队类型: <span><dict-tag style="display: inline-block" :options="dict.type.team_type" :value="form.teamType"/></span></div>
        </el-col>
        <el-col :span="12">
          <div class="grid-content bg-purple item-class">预约场馆: <span>{{ form.theatreName || '' }}</span></div>
        </el-col>
        <el-col :span="12">
          <div class="grid-content bg-purple item-class">预约演出厅: <span>{{ form.auditoriumName || '' }}</span></div>
        </el-col>
        <el-col :span="12">
          <div class="grid-content bg-purple item-class">预约剧目: <span>{{ form.performName || '' }}</span></div>
        </el-col>
        <el-col :span="12">
          <div class="grid-content bg-purple item-class">票务名称: <span>{{ form.goodsName || '' }}</span></div>
        </el-col>
        <el-col :span="12">
          <div class="grid-content bg-purple item-class">座位类型: <span>{{ form.seatTypeName || '' }}</span></div>
        </el-col>
        <el-col :span="12">
          <div class="grid-content bg-purple item-class">团购单价: <span>￥{{ form.price || '' }}</span></div>
        </el-col>
        <el-col :span="12">
          <div class="grid-content bg-purple item-class">预约时间: <span>{{ form.performDate || '' }}日 {{ form.performTimeStart || '' }} {{ form.performTimeEnd || '' }}</span></div>
        </el-col>
        <el-col :span="12">
          <div class="grid-content bg-purple item-class">报名时间: <span>{{ form.createTime || '' }}</span></div>
        </el-col>
        <el-col :span="12">
          <div class="grid-content bg-purple item-class">负责人: <span>{{ form.teamContact || '' }}</span></div>
        </el-col>
        <el-col :span="12">
          <div class="grid-content bg-purple item-class">联系电话: <span>{{ form.teamMobile || '' }}</span></div>
        </el-col>
<!--        <el-col :span="12">-->
<!--          <div class="grid-content bg-purple item-class">支付总额: <span>￥{{ form.priceTotal || '' }}</span></div>-->
<!--        </el-col>-->
<!--        <el-col :span="12">-->
<!--          <div class="grid-content bg-purple item-class">团购人数: <span>{{ form.viewerNum || '' }}</span></div>-->
<!--        </el-col>-->
<!--        <el-col :span="12">-->
<!--          <div class="grid-content bg-purple item-class">支付时间: <span>{{ form.payTime || '' }}</span></div>-->
<!--        </el-col>-->
<!--        <el-col :span="12">-->
<!--          <div class="grid-content bg-purple item-class">支付方式: <span>{{ payList[form.payStatus] || '' }}</span></div>-->
<!--        </el-col>-->
<!--        <el-col :span="12">-->
<!--          <div class="grid-content bg-purple item-class">订单状态: <span>{{ statusList[form.status] || '' }}</span></div>-->
<!--        </el-col>-->
      </el-row>


      <!--   观影人员信息   -->
      <div class="title-class">观影人员信息</div>
      <el-row>
        <el-col :span="24">
          <el-table ref="tables" :data="form.viewersList" border>
            <el-table-column label="序号" align="center" type="index" width="60"></el-table-column>
            <el-table-column label="姓名" align="center" prop="name" />
            <el-table-column label="身份证号码" align="center" prop="idcard" />
            <el-table-column label="核销状态" align="center">
              <template slot-scope="scope">
                <el-tag v-if="scope.row.qrcodeStatus == 0">未使用</el-tag>
                <el-tag v-if="scope.row.qrcodeStatus == 1" type="success">已使用</el-tag>
                <el-tag v-if="scope.row.qrcodeStatus == 2" type="info">过期</el-tag>
              </template>
            </el-table-column>
            <el-table-column label="核销时间" align="center" prop="useTime" />
            <el-table-column label="座位信息" align="center" prop="seatName" />
          </el-table>
        </el-col>
      </el-row>
    </div>

    <span slot="footer" class="dialog-footer">
      <el-button type="primary" @click="cancel">确定</el-button>
    </span>

  </el-dialog>
</template>

<script>
import { getOrderDetail } from '@/api/team/applicationMr'
export default {
  name: "orderDetails",
  props: {
    dict: {
      type: Object,
      default: () => [],
    },
  },
  data() {
    return {
      title: "编辑",
      model: "EDIT",
      open: false,
      loading: false,
      form: {
        id: undefined,
      },
      performerVisible: false,
      performerList: [],
      refund: false,
      statusList: {
        0: '待支付',
        2: '超时取消',
        3: '支付完成，待使用',
        4: '退款中',
        5: '己退款',
        6: '退款失败',
        7: '己使用',
        8: '己超期',
        9: '关闭',
      },
      payList: {
        0: '未支付',
        1: '已支付',
        2: '支付中',
        3: '支付失败',
        4: '支付退款',
      },
      sourceList: {
        1: '小程序',
        2: '美团',
        3: '携程',
        4: '公众号',
        5: '支付宝',
      },
      dataList: []
    };
  },
  methods: {
    /**
     * 打开弹框
     * @date 2023-11-22
     * @param {any} obj
     * @returns {any}
     */
    openDialog(title, obj, type) {
      this.open = true;
      this.getSelectByIdApi(obj);
    },
    /** 获取详情 */
    getSelectByIdApi(row) {
      const id = row.id
      getOrderDetail(id).then(response => {
        this.form = response.data;
      });
    },
    /**
     * 关闭弹框
     * @date 2023-11-22
     * @returns {any}
     */
    cancel() {
      this.open = false;
    },
  },
};
</script>

<style lang="scss" scoped>
.dialog {
  padding: 0 30px;
  max-height: 65vh;
  overflow-y: auto;
}
.dialog {
  padding: 0 30px;
  .upload-btn {
    width: 100px;
    height: 100px;
    background-color: #fbfdff;
    border: dashed 1px #c0ccda;
    border-radius: 5px;
    i {
      font-size: 30px;
      margin-top: 20px;
    }
    &-text {
      margin-top: -10px;
    }
  }
  .avatar {
    cursor: pointer;
  }
  .title-class{
    font-size: 16px;
    font-weight: bold;
    color: black;
    margin-bottom: 20px;
    margin-top: 20px;
  }
  .item-class{
    margin-bottom: 20px;
  }
}
</style>
