<template>
  <div>

    <div>
      <div ref="lxHeader">
        <lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
          <div slot="content" style="padding-left:0">
            <div class="txl">
              <div>课程名称：第六期高级科创人才研修班</div>
              <div>开课日期：2024.3.1-----2024.9.1</div>
              <div>类别：正常课程</div>
            </div>
            <div class="searchwrap" style="display: flex;align-items: center;">
              <div>
                <el-input v-model="select.name" placeholder="请输入姓名"></el-input>
              </div>
              <div>
                <el-select v-model="select.status" placeholder="请选择状态" clearable>
                  <el-option v-for="item in status_options" :key="item.id" :label="item.value" :value="item.id">
                  </el-option>
                </el-select>
              </div>
              <div>
                <el-button type="primary" size="small">查询</el-button>
              </div>
              <div>
                <el-button type="primary" size="small">导出</el-button>
              </div>
              <div>
                <el-button type="primary" size="small" @click="showCheckPay">批量核对</el-button>
              </div>
              <div>
                <el-button type="primary" size="small" @click="showSendMessage">催缴通知</el-button>
              </div>
            </div>
          </div>

        </lx-header>
      </div>
    </div>

    <div>
      <xy-table :list="list" :total="total" :showIndex='false' :table-item="table_item"
        @selection-change="selectionChange">
        <template v-slot:btns>
          <el-table-column align='center' fixed="right" label="操作" width="80" header-align="center">
            <template slot-scope="scope">
              <el-button type="primary" size="small" @click="showCheckPay">核对</el-button>
            </template>
          </el-table-column>
        </template>
      </xy-table>
    </div>
    <checkPay ref="checkPay"></checkPay>
    <sendMessage ref="sendMessage"></sendMessage>
  </div>
</template>

<script>
  import checkPay from './components/checkPay.vue';
  import sendMessage from './components/sendMessage.vue';
  export default {
    components: {
      checkPay,
      sendMessage
    },
    data() {
      return {
        select: {
          name: '',
          daterange: '',
          type: ''
        },
        status_options: [{
          id: 0,
          value: '未缴'
        }, {
          id: 1,
          value: '待确认'
        }, {
          id: 2,
          value: '已缴'
        }],
        showImg:false,
        srcList:[],
        list: [{
          name: '王同学',
          company: '**股份公司',
          zw: '总经理',
          mobile: '13812345671',
          date: '2024.2.4 10:21',
          status: '未缴',
          img: 'http://suzhoukeji-test.ali251.langye.net/admin/static/img/logo-mini.e480d6fa.png'
        },{
          name: '王同学',
          company: '**股份公司',
          zw: '总经理',
          mobile: '13812345671',
          date: '2024.2.4 10:21',
          status: '未缴',
          img: ''
        }],
        total: 0,
        table_item: [{
          type: 'selection',
          width: 50
        }, {
          prop: 'name',
          label: '姓名',
          align: 'center',
          width: 120
        }, {
          prop: 'company',
          label: '公司',
          align: 'left'
        }, {
          prop: 'zw',
          label: '职务',
          align: 'center',
          width: 160,
        }, {
          prop: 'mobile',
          label: '联系电话',
          align: 'center',
          width: 180,
        }, {
          prop: 'date',
          label: '报名时间',
          align: 'center',
          width: 180,
        }, {
          prop: 'status',
          label: '状态',
          align: 'center',
          width: 120,
        }, {
          prop: 'img',
          label: '缴费截图',
          align: 'center',
          width: 120,
          customFn: (cell) => {
            return ( cell.img?<el-image style={{width:'40px',height:'40px'}} src={cell.img} preview-src-list={this.srcList}
            on = {
              {
                ['click']: (e) => {
                  if(cell.img){
                    this.srcList = []
                    this.srcList.push(cell.img)
                  }
                }
              }
            }
            ></el-image>:'' )
          }
        }]

      }
    },
    created() {

    },
    methods: {

      showCheckPay(type, id){
        this.$refs.checkPay.isShow = true
      },
      showSendMessage(){
        this.$refs.sendMessage.isShow = true
      },
      selectionChange() {

      },
    }
  }
</script>

<style lang="scss" scoped>
  .txl {
    display: flex;
    align-items: center;
    margin-bottom: 10px;

    &>div {
      margin-right: 10px;
    }
  }

  .searchwrap {
    display: flex;
    align-items: center;

    &>div {
      display: flex;
      align-items: center;
      margin-right: 10px;

      span {
        min-width: 70px;
      }
    }
  }
</style>
