<style lang='scss'>
    .signup_mannage{
        .bh{
            font-size: 14px;
            color: #666;
            line-height: 27px;
            margin-bottom: 10px;
            label{
                color:#333;
                font-size: 16px;
                display: inline-block;
                padding-right: 10px;
            }
        }
        .hotel{
            .el-dialog{
                margin-top: 30px !important;
                .el-form-item{
                    margin-bottom: 10px;
                }
            }
        }
    }
</style>
<template>
    <section class="signup_mannage">
        <p><span>会议管理></span>报名管理</p>
        <div class="content">
            <div class="filter">
                <el-form size="small" label-width="70px" :inline="true"  label-position="left">
                    <el-form-item label="">
                            <el-input clearable placeholder="请输入姓名" v-model="form.name"></el-input>
                    </el-form-item>
                    <el-form-item>
                        <el-button @click="getData" type="primary">搜索</el-button>
                    </el-form-item>
                    <el-form-item style="float:right" >
                        <el-button @click="download" plain icon="el-icon-download" type="primary">导出Excel</el-button>
                    </el-form-item>
                </el-form>
            </div>
            <el-table
                    class="table"
                    :data="list"
                    height='52vh'
                    border  v-loading="loading"
                    default-expand-all row-key="id"
                    style="width: 100%">
                    <el-table-column
                    prop="name"  
                    label="用户姓名">
                    </el-table-column>
                    <el-table-column
                    prop="nickname"  
                    label="微信昵称">
                    </el-table-column>
                    <el-table-column
                    prop="avatar"  
                    label="微信头像">
                        <template slot-scope="scope">
                            <img :src="scope.row.avatar" alt="" width="80">
                        </template>
                    </el-table-column>
                    <el-table-column
                    prop=""  
                    label="性别">
                    <template slot-scope="scope">
                        <span v-if="scope.row.sex==0">男</span>
                        <span v-if="scope.row.sex==1">女</span>
                    </template>
                    </el-table-column>
                    <el-table-column
                    prop="conference_count"  
                    label="参与次数">
                    </el-table-column>
                    <el-table-column
                    prop="conference_name" 
                    width="250" 
                    label="参与会议">
                    </el-table-column>
                    <el-table-column
                    prop="phone"  width="120"
                    label="手机号">
                    </el-table-column>
                    <el-table-column
                    prop="email"  width="120"
                    label="邮箱">
                    </el-table-column>
                    <el-table-column
                    prop="organizer_unit"  
                    label="单位">
                        <template slot-scope="scope">
                            <span v-if="scope.row.is_caos">中科院</span>
                            <span v-else>非中科院</span>
                        </template>
                    </el-table-column>
                    <el-table-column
                    prop="organizer_city"  
                    label="所在城市">
                    </el-table-column>
                    <el-table-column width="150"
                    prop="organizer_unit"  
                    label="所属所">
                    </el-table-column>
                    <el-table-column width="150"
                    prop="organizer_college"  
                    label="所属院">
                    </el-table-column>
                    <el-table-column width="150"
                    prop="organizer_journal"  
                    label="期刊单位">
                    </el-table-column>
            </el-table>
            <Page  ref="pageButton" :current='form.page' :page_size='form.page_size' :total='total' @pageChange='gopage'/>
        </div>
    </section>
</template>
<script>
import Page from '../../components/Page';
export default {
    components:{
        Page
    },
    data(){
        return{
            form:{order_status:'-2',type:'conference'},
            conferenceList:[],
            hotelList:[],
            list:[{}],
            reason:{},
            invoice:{},
            total:0,
            loading:false,
            dialogVisible:false,
            dialogVisible1:false,
            dialogVisible2:false,
            dialogVisible3:false,
            proof_img:''
        }
    },
    methods:{
        download(){
            var parm={...this.form};        
            this.$api.downloadSignupAnalyseData(parm).then(res=>{
                var elink = document.createElement("a");
                let blob = new Blob([res.data], {
                    type: "application/vnd.ms-excel,charset=UTF-8",
                });
                let objUrl = URL.createObjectURL(blob);
                let file_name = decodeURIComponent(
                    res.headers["content-disposition"].split("=")[1]
                );
                console.log(file_name);
                elink.download = file_name;
                elink.style.display = "none";
                elink.href = objUrl;
                document.body.appendChild(elink);
                elink.click();
                document.body.removeChild(elink);
            })
        },
        gopage(size){
            if(size){
                this.form.page_size=size
            }
            this.form.page=this.$refs.pageButton.page
            this.getData()
        },
        getData(){
            var parm={...this.form};        
            if(parm.order_status==-2){parm.order_status=''}
            this.loading=true
            this.$api.getSignupAnalyseList(parm).then(res=>{
                this.list=res.data.data.list;
                this.total=res.data.data.total
                this.loading=false;
            })

            this.$api.getConferenceList().then(res=>{
                this.conferenceList=res.data.data.list;
            })
             this.$api.getHotelList().then(res=>{
                this.hotelList=res.data.data.list;
            })
        }
    },
    created(){
        this.getData();
    }
}



</script>


