<style lang="scss">
    .preview{
        .el-form-item{
            margin-bottom:15px;
        }
        label,p{
            line-height: 25px !important;
        }
    }
</style>
<template>
    <section>
        <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  type="primary">搜索</el-button>
                    </el-form-item>
                    <el-form-item style="float:right" >
                        <el-button @click="addConference" type="primary">新增会议</el-button>
                    </el-form-item>
                </el-form>
            </div>
            <el-table
                    class="table"
                    :data="list"
                    height='50vh'
                    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="username"  
                    label="会议海报">
                    </el-table-column>
                    <el-table-column
                    prop="username"  
                    label="主办方">
                    </el-table-column>
                    <el-table-column
                    prop="username"  
                    label="主讲人">
                    </el-table-column>
                    <el-table-column
                    prop=""  
                    label="会议时间">
                    </el-table-column>
                    <el-table-column
                    prop=""  
                    label="会议简介">
                    </el-table-column>
                    <el-table-column
                    prop=""  
                    label="酒店信息">
                    </el-table-column>
                    <el-table-column
                    prop=""  
                    label="状态">
                    </el-table-column>
                    <el-table-column  
                    prop="zip"  width="150"
                    label="操作">
                    <template slot-scope="">
                        <el-button    type="text" >添加酒店</el-button>
                        <el-button class="edit" type="text">查看酒店</el-button>
                    </template>
                    </el-table-column>
            </el-table>
            <Page  ref="pageButton" :current='form.page' :page_size='form.page_size' :total='total' @pageChange='gopage'/>
        </div>

        <el-dialog width="80%"
        :title="dialogTitle" :close-on-click-modal='false'
        :visible.sync="dialogVisible">
            <Hotel/>
        </el-dialog>
    </section>
</template>
<script>
import Page from '../../components/Page';
import Hotel from '../../components/hotel';
export default {
  components:{
        Page,Hotel
  },
  data(){
    return{
      edit:0,
      form:{name:'',page:1,page_size:20},
      form1:{},
      total:1,
      list:[{name:'2333'}],
      loading:false,
      input:'',
      dialogVisible:true,
      dialogTitle:"添加酒店",
      defaultProps:{},
      data: [],
    }
  },
  methods:{
      addConference(){
          this.$router.push({path:'/conference/conference/add'})
      },
      gopage(size){
            if(size){
                this.form.page_size=size
            }
            this.form.page=this.$refs.pageButton.page
            this.getData()
        },
        getPermissions(){
            this.$api.getUserPermissions().then(res=>{
                this.data = res.data.data
            })
        },
        getData(){
            var parm=this.form;        
            this.loading=true
            this.$api.getEnterpriseList(parm).then(res=>{
                this.list=res.data.data.list;
                this.total=res.data.data.total
                this.loading=false
            })
        },
        del(id){
                this.$confirm('确定删除吗', '提示', {
                        type: 'warning'
                    }).then(() => {
                    this.$api.deleteEnterprise({id:id}).then((res)=>{
                            this.$message({
                                message: '删除成功',
                                type: 'success'
                            })
                            this.getData()
                    })
                })
        },
  },
  created(){
    //   this.getPermissions()
    //   this.getData()
  }
}
</script>
