<template>
  <div class="app-container">
    <el-form style="background-color: #fff; padding: 15px 5px; border-radius:10px;" :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="128px">
       <p class="bgtan" style="margin-top: 0;">搜索条件</p>
	  <el-row>
		  <el-col :span="8">
				<!-- multiple -->
				<el-form-item label="来访日期" prop="visitDate">
					<el-date-picker style="width:100%;" clearable
					  v-model="queryParams.visitDate"
					  type="date"
					  value-format="yyyy-MM-dd"
					  @keyup.enter.native="handleQuery"
					  placeholder="请选择来访日期">
					</el-date-picker>
				</el-form-item>

		  </el-col>
		  <el-col :span="8">
		  	<el-form-item label="来访者姓名" prop="visitName">
		  	            <el-input v-model="queryParams.visitName" placeholder="请输入来访者姓名" clearable @keyup.enter="handleQuery" />
		  	</el-form-item>
		  </el-col>
		  <el-col :span="8">
		  	<el-form-item label="来访者手机号" prop="visitPhone">
		  	            <el-input v-model="queryParams.visitPhone" placeholder="请输入来访者手机号" clearable @keyup.enter="handleQuery" />
		  	</el-form-item>
		  </el-col>

		  <el-col :span="8">
		  	 <el-form-item>
		  	   <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
		  	   <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
		  	 </el-form-item>
		  </el-col>
	  </el-row>
    </el-form>

    <el-row :gutter="10" class="mb8" style=" border-top-left-radius: 12px; border-top-right-radius: 12px; background-color: #fff;margin: 0;margin-top: 20px;padding: 10px 5px; ">
      <p class="bgtan" style="margin-top: 0;">访客预约信息</p>
	  <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:reservat:add']"
        >教师新增来访人员</el-button>
      </el-col>
      <!-- <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['score:data:edit']"
        >修改</el-button>
      </el-col> -->
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:reservat:remove']"
        >删除</el-button>
      </el-col>
      <!-- <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['score:data:export']"
        >导出</el-button>
      </el-col>
	  <el-col :span="1.5">
	    <el-button
	      type="info"
	      plain
	      icon="el-icon-upload2"
	      size="mini"
	      @click="handleImport"
	      v-hasPermi="['system:user:import']"
	    >导入</el-button>
	  </el-col> -->
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

	<div style="background-color: #fff; padding: 0 10px;  padding-bottom: 40px; border-bottom-left-radius: 12px; border-bottom-right-radius: 12px;">
	<el-table stripe :max-height="tableMaxHeight"  :data="dataList" @selection-change="handleSelectionChange">
	  <el-table-column type="selection" width="55" align="center" />
	    <el-table-column label="来访者姓名" align="center" prop="visitName" />
	           <el-table-column label="联系方式" align="center" prop="visitPhone" width="120" />
	           <el-table-column label="证件号码" align="center" prop="visitIdCard" />
	           <el-table-column label="事由" align="center" prop="visitReason" show-overflow-tooltip/>
	           <el-table-column label="补充事由" align="center" prop="visitRemark" show-overflow-tooltip/>
	    <el-table-column label="预约日期" align="center" prop="visitDate" width="100">
		<template slot-scope="scope">
			 <span>{{ scope.row.visitDate}}</span>
		  </template>
		</el-table-column>
		<el-table-column label="预约时间" align="center" prop="visitTime" width="140">
		          <template slot-scope="scope">
		            <span>{{ scope.row.visitTime }}</span>
		          </template>
		</el-table-column>
		<el-table-column label="预约状态 " align="center" prop="visitType" >
				<template slot-scope="scope">
          <dict-tag :options="dict.type.visitt" :value="scope.row.visitType"/>
					 <!-- <span>{{ scope.row.visitType == 1?'等待审核':scope.row.visitType == 2?'未同意' :'已通过'}}</span> -->
				</template>
		</el-table-column>
		<el-table-column label="是否入场" align="center" prop="visitStatus" >
				<template slot-scope="scope">
          <dict-tag :options="dict.type.tatus" :value="scope.row.visitStatus"/>
					<!-- <span>{{ scope.row.visitType == 1? '未入场': '已入场'}}</span> -->
				</template>
		</el-table-column>

	  <el-table-column label="操作" width="160" align="center" class-name="small-padding fixed-width">
	    <template slot-scope="scope">
	     <el-button size="mini" type="text" style="background: #00B034;color: #FFF;padding: 7px;" v-hasPermi="['system:reservat:sh']"
	     	   				    @click="getPass(scope.row)" v-if="scope.row.visitType == 1">审核</el-button>
	     	   				  <el-button size="mini" type="text" style="background: #3FBCEF;color: #FFF;padding: 7px; margin-left: 5px;" v-hasPermi="['system:reservat:sh']"
	     	   				    @click="infoBtn(scope.row)" v-if="scope.row.visitType == 1">驳回</el-button>
	     <el-button
	       size="mini"
	       type="text"
	       style="background: red;color: #FFF;padding: 7px; margin-left: 5px;"
	       @click="handleDelete(scope.row)"
	       v-hasPermi="['system:reservat:remove']"
	     >删除</el-button>
	    </template>
	  </el-table-column>
	</el-table>

	<pagination
	  v-show="total>0"
	  :total="total"
	  :page.sync="queryParams.pageNum"
	  :limit.sync="queryParams.pageSize"
	  @pagination="getList"
	/>
	</div>



    <!-- 添加或修改成绩对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1280px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
		  <el-row>
			  <el-col :span="6">
			  				<el-form-item label="班级名称" prop="classId">
			  					<el-select v-model="form.classId" placeholder="请选择班级名称">
			  					  <el-option
			  					    v-for="dict in kiuesegh"
			  					    :key="dict.deptId"
			  					    :label="dict.deptName"
			  					    :value="dict.deptId"
			  						@click.native="mjyhesst(dict)"
			  					  ></el-option>
			  					</el-select>
			  				</el-form-item>
			  </el-col>
			  <el-col :span="6">
			  	<el-form-item label="姓名" prop="teacherName">
			  		<el-select  filterable v-model="form.teacherName" placeholder="请选择老师名称">
			  		  <el-option
			  		    v-for="dict in infoListstu"
			  		    :key="dict.teacherId"
			  		    :label="dict.teacherName"
			  		    :value="dict.teacherName"
			  			@click.native="mjyhesstu(dict)"
			  		  ></el-option>
			  		</el-select>
			  	</el-form-item>
			  </el-col>
			  <el-col :span="6">
			  	<el-form-item label="发放时间" prop="keyTime">
			  		<el-date-picker style='width:100%;' clearable
			  		  v-model="form.keyTime"
			  		  type="date"
			  		  value-format="yyyy-MM-dd"
			  		  placeholder="请选择发布时间">
			  		</el-date-picker>
			  	</el-form-item>
			  </el-col>
			  <el-col :span="6" v-for="(col, index) in lhtre"
		                  :key="index"
						  >
			  	<el-form-item :label="col.xueke" prop="privacyType">
			  	  <el-input v-model="col.manfen" :placeholder="col.xueke" />
			  	</el-form-item>
			  </el-col>
			  <el-col :span="6">
			  	<el-form-item label="备注" prop="remark">
			  	  <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
			  	</el-form-item>
			  </el-col>
		  </el-row>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button v-if="isxiuge == false" type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

	<el-dialog :title="upload.title" :visible.sync="upload.open" width="700px" append-to-body>

	  <el-upload
	    ref="upload"
	    :limit="1"
	    accept=".xlsx, .xls"
	    :headers="upload.headers"
	    :action="upload.url + '?updateSupport=' + upload.updateSupport"
	    :disabled="upload.isUploading"
	    :on-progress="handleFileUploadProgress"
	    :on-success="handleFileSuccess"
	    :auto-upload="false"
		:data="upload.selectIndex"
	    drag
		style="width: 100%;"
	  >
	    <i class="el-icon-upload"></i>
	    <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
	    <div class="el-upload__tip text-center" slot="tip">
	      <span>仅允许导入xls、xlsx格式文件。</span>
	      <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
	    </div>
	  </el-upload>
	  <div slot="footer" class="dialog-footer">
	    <el-button type="primary" @click="submitFileForm">确 定</el-button>
	    <el-button @click="upload.open = false">取 消</el-button>
	  </div>
	</el-dialog>

	<el-drawer
	  title="新增预约"
	  :visible.sync="drawer"
	  size="28%">
	  <!-- class="con" -->
	  <div >
		 <!-- <Calendar
		       v-on:choseDay="clickDay"
		       v-on:changeMonth="changeDate"
		       v-on:isToday="clickToday"
		     ></Calendar> -->
        <el-form ref="form" :model="form" :rules="rules" label-width="110px">
        		  <el-row>
        			  <el-col :span="24">
        			  				<el-form-item label="来访日期" prop="visitDate">

        			  					<el-date-picker style="width:100%;" clearable
        			  					  v-model="form.visitDate"
        			  					  type="date"
										  :picker-options="pickerOptions"
        			  					  value-format="yyyy-MM-dd"
        			  					  placeholder="请选择来访日期">
        			  					</el-date-picker>
        			  				  <!-- <el-input v-model="form.scoreClassName" placeholder="请输入接收班级名称" /> -->
        			  				</el-form-item>
        			  </el-col>
        			  <el-col :span="24">
        			  	<el-form-item label="来访时间" prop="visitTime" >
							<div style="display: flex;">
								<el-time-picker @change="starcha" v-model="startime" value-format="HH:mm:ss" format="HH:mm:ss"  style="width:180px" size="mini" placeholder="开始时间" />
								<span class="">-</span>
								<el-time-picker @change="endcha" v-model="endtime" value-format="HH:mm:ss" format="HH:mm:ss" :picker-options="{'selectableRange':`${startime ? startime + ':00' : '00:00:00'}-23:59:59`}" style="width:180px" size="mini" placeholder="结束时间" />
							</div>

							<!-- <el-time-picker
							    style="width:100%;"
							    is-range
								@change="ihg"
							    arrow-control
							    v-model="tmje"
							    range-separator="至"
							    start-placeholder="开始时间"
							    end-placeholder="结束时间"
								value-format="HH:mm:ss"
							    placeholder="选择时间范围">
							  </el-time-picker> -->
        			  	</el-form-item>
        			  </el-col>
					  <el-col :span="24">
					  	<el-form-item label="来访者姓名" prop="visitName">
					  	            <el-input v-model="form.visitName" placeholder="请输入来访者姓名" clearable @keyup.enter="handleQuery" />
					  	</el-form-item>
					  </el-col>
					  <el-col :span="24">
					  	 <el-form-item label="来访者手机号" prop="visitPhone">
					  	            <el-input v-model="form.visitPhone" placeholder="请输入来访者手机号" clearable @keyup.enter="handleQuery" />
					  	</el-form-item>
					  </el-col>
					  <el-col :span="24">
					  	<el-form-item label="来访者事由" prop="visitRemark">
					  	            <el-input v-model="form.visitRemark" placeholder="请输入来访者补充事由" clearable @keyup.enter="handleQuery" />
					  	</el-form-item>
					  </el-col>
        		  </el-row>

        </el-form>
        <div style="text-align: center;" slot="footer" class="dialog-footer">
          <el-button  type="primary" @click="submitForm">确 定</el-button>
          <el-button @click="cancel">取 消</el-button>
        </div>
	  </div>


	  <div>
	   <!-- <el-button @click="innerDrawer = true">打开里面的!</el-button> -->

	  </div>
	</el-drawer>

  </div>
</template>

<script>
import { listData, getData, delData, addData, updateData,setPass } from "@/api/zhihuixy/yuyue";
import { listInfo} from "@/api/zhihuixy/info";
import { listInfostu } from "@/api/zhihuixy/teacherdan";
import axios from 'axios'
import { getToken } from "@/utils/auth";
import { listDept ,listDeptode,listDeptold} from "@/api/system/dept";
import Calendar from 'vue-calendar-component';
export default {
  name: "Data",
  dicts: ['typeone','sys_subject','kaoshi','zhouji','visitt','tatus',],
  components: {
  	Calendar
  },
  data() {
    return {
		pickerOptions:{
		          disabledDate (time) {
		            //disabledDate 文档上：设置禁用状态，参数为当前日期，要求返回 Boolean
		            // return time.getTime() > Date.now()//选当前时间之前的时间
		            return time.getTime() < Date.now()  - 8.64e7;//选当前时间之后的时间
		          }
		      },
      // 遮罩层
      loading: true,
	  date: "",
	        week: "",
      // 选中数组
      ids: [],
      // 子表选中数据
      checkedScoreDataDetails: [],
	  tableMaxHeight:400,
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
	  startime:'',
	  endtime:'',
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 成绩表格数据
      dataList: [],
	  drawer:false,
      // 成绩_子表格数据
      scoreDataDetailsList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        scoreTitle: null,
        scoreTime: null,
        scoreClassId: null,
        scoreClassName: null,
        privacyType: null,
		params:{}
      },
	  kiuesegh:[],
      // 表单参数
      form: {},
      // 表单校验
      rules: {
		visitDate: [
		  { required: true, message: "不能为空", trigger: "blur" }
		],
		visitTime: [
		  { required: true, message: "不能为空", trigger: "blur" }
		],
		visitName: [
		  { required: true, message: "不能为空", trigger: "blur" }
		],
		visitPhone:[
		 {
		   required: true,
		   message: "不能为空",
		   trigger: "blur",
		 },
		 {
		   pattern: /^1(3|4|5|7|8|9)\d{9}$/,
		   message: "手机号格式不对",
		   trigger: "blur",
		 },
		]
      },
	  rulesf:{

	  },
	  // 用户导入参数
	  upload: {
	    // 是否显示弹出层（用户导入）
	    open: false,
	    // 弹出层标题（用户导入）
	    title: "",
	    // 是否禁用上传
	    isUploading: false,
	    // 是否更新已经存在的用户数据
	    updateSupport: 0,
		selectIndex:{},
	    // 设置上传的请求头部
	    headers: { Authorization: "Bearer " + getToken(),
		  clientid:process.env.VUE_APP_CLIENT_ID
		 },
	    // 上传的地址
	    url: process.env.VUE_APP_BASE_API + "/xiaoYuan/pay/importData"
	  },
	  fornh:{},
	  typeOptionsname:[],
	  queryParamstud:{},
	  infoListstu:[],
	  listInfostucs:{
		  params:{}
	  },
	  hstwet:[],
	  nhgefisdi:false,
	  jhgre:[],
	  lhtre:[],
	  isxiuge:false,
	  tmje:[],
	  tmjeg:[]
   };
  },
  created() {
	  var now = new Date();
	      this.date = now.getDate();//得到日期
	      var day = now.getDay();//得到周几
	      var arr_week = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
	      this.week = arr_week[day];
	  window.onresize = () => {
	            this.changeTableMaxHeight()
	          }
	          this.changeTableMaxHeight()
    this.getList();
	// this.getdept(0)
	this.getDicts('wages').then(response => {
				this.typeOptionsname = response.data;
				this.jhgre = response.data;
				for(var i = 0 ; i < this.typeOptionsname.length; i++){
					if(i < this.typeOptionsname.length){
						let bgde = {
							lable:'',
							value:''
						}
						bgde.value = this.typeOptionsname[i].dictValue
						bgde.lable = this.typeOptionsname[i].dictLabel
						this.hstwet.push(bgde)
					}
		       }
			})
  },
  mounted() {
  	window.onresize = () => {
  	          this.changeTableMaxHeight()
  	        }
  	        this.changeTableMaxHeight()
  },
  methods: {
	  clickDay(data) {
	        console.log(data); //选中某天
	      },
	      changeDate(data) {
	        console.log(data); //左右点击切换月份
	      },
	      clickToday(data) {
	        console.log(data); // 跳到了本月
	      },

	  sortChange(column){
		  console.log(scolumn)

	  },
	  /** 查询学生档案信息列表 */
	  getListuye(val) {
	    this.loading = true;
	  	this.listInfostucs.classId = val
		this.listInfostucs.params.role=this.roleqh()
	    listInfostu(this.listInfostucs).then(response => {
	      this.infoListstu = response.rows;
	      this.loading = false;
	    });
	  },
	  getdept(val){
	  		  let kuesf={'parentId':val}
	  		  // this.kiuesegh = []
	  		listDeptode(kuesf).then(response => {
	  		  this.deptOptions = this.handleTree(response.data, "deptId");
	  		  this.deptOptions.filter(rou =>{
	  			  if(rou.children != undefined){
	  			  	rou.children.filter(rour =>{
	  			  		this.kiuesegh.push(rour)
	  			  	})
	  				this.queryParams.scoreClassId = this.kiuesegh[0].scoreClassId
	  			  }else{
	  				this.queryParams.scoreClassId = null
	  			  }
	  			  // this.kiuesegh = rou.children
	  			  // this.kiuesegh.push(rou.children)
	  			  console.log(rou.children,6)
	  		  })
	  		  this.queryParams.scoreClassId = this.kiuesegh[0].scoreClassId
	  		  this.kiueseghs = this.kiuesegh
	  		  // this.deptOptions = response.data
	  		  console.log(this.kiuesegh)
	  		});
	  },
    /** 查询成绩列表 */
    getList() {
      this.loading = true;
	  if(this.roleqh() == 'school'){
		 this.queryParams.params = {}
	  }else{
		 this.queryParams.params.role=this.roleqh()
	  }
      listData(this.queryParams).then(response => {
        this.dataList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.drawer = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
		  reservatId: null,
		    teacherName: null,
		    teacherPhone: null,
		    visitName: null,
		    visitPhone: null,
		    visitDate: null,
		    visitTime: null,
		    visitReason: null,
		  		 visitRemark: null,
		  		 remark: null,

      };
      // this.scoreDataDetailsList = [];
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.scoreId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
	jueg(){
		for(var i = 0 ; i < this.typeOptionsname.length; i++){
							if(i < this.typeOptionsname.length){
								let bgde = {
									lable:'',
									value:''
								}
								let ght={
									xueke:'',
									manfen:null
								}
								bgde.value = this.typeOptionsname[i].dictValue
								bgde.lable = this.typeOptionsname[i].dictLabel
								ght.xueke = this.typeOptionsname[i].dictLabel
								this.hstwet.push(bgde)
								this.lhtre.push(ght)
							}
		}
	},
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      // this.open = true;
	  this.drawer = true
	  // this.typeOptionsname = []
	  // this.hstwet=[]
	  this.form.teacherName = this.$store.state.user.nickName
	  if(this.roleqh() == undefined){
	  }else{
	  		this.form.teacherPhone = this.$store.state.user.name
	  }
	  this.form.tenantId  = this.$store.state.user.tenantId
	  this.tmjeg = ''
	  this.tmje = ''
	  this.lhtre = []
	  this.jueg()
      this.title = "添加配置";
	  this.isxiuge = false

    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const reservatConfigId = row.reservatConfigId || this.ids
	  let dee={}
	  // dee.scoreId = scoreId
	  this.typeOptionsname = []
	  this.lhtre = []
	  this.hstwet = []
	  this.scoreDataDetailsList = []
	  let gnhdkt = []
	  this.isxiuge = true
	  this.tmjeg = ''
	  this.tmje = ''
      getData(reservatConfigId).then(response => {
        this.form = response.data;
		this.form.reservatConfigDate = this.form.reservatConfigDate.split(',')
		let ng=[]
		ng.push( this.form.reservatConfigTimeAmBegin,this.form.reservatConfigTimeAmEnd)
		this.tmje = ng
		let mj=[]
		mj.push(this.form.reservatConfigTimePmBegin,this.form.reservatConfigTimePmEnd)
		this.tmjeg = mj
		this.lhtre = this.form.scoreDataMfVoList
		this.drawer = true;
		this.title = "修改配置";
		this.nhgefisdi = true
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
		 // console.log(this.tmje,this.tmjeg)
		 // this.form.reservatConfigDate = this.form.reservatConfigDate.join(',')
		  // return
		  // this.form.scoreDataStudentBoList = nhgeo
		  // this.form.scoreDataMfBoList = this.lhtre
		  if(this.endtime == ''){
			  this.$message.error("请选择结束时间");
			  return
		  }
          if (this.form.reservatId != null) {
			  this.form.scoreDataStudentVoList = undefined
			  this.form.scoreDataMfVoList = undefined
            updateData(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.drawer = false;
              this.getList();
            });
          } else {
            addData(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.drawer = false;
              this.getList();
            });

          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const scoreIds = row.reservatId || this.ids;
      this.$modal.confirm('是否确认删除数据项？').then(function() {
        return delData(scoreIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
	/** 成绩_子序号 */
    rowScoreDataDetailsIndex({ row, rowIndex }) {
      row.index = rowIndex + 1;
    },
    /** 成绩_子添加按钮操作 */
    handleAddScoreDataDetails() {
		if(this.form.scoreClassId == null){
			this.$message.error("请先选择班级");
			return
		}
		if(this.typeOptionsname.length == 0){
			this.$message.error("请先选择科目");
			return
		}
		this.hstwet = []
		let bgert = {

		}
		let nhdw = ''
		for(var i = 0 ; i < this.typeOptionsname.length; i++){
			if(i < this.typeOptionsname.length){
				let bgde = {
					lable:'',
					value:''
				}
				bgde.value = this.typeOptionsname[i].dictValue
				bgde.lable = this.typeOptionsname[i].dictLabel
				this.hstwet.push(bgde)
			}

		 nhdw = this.typeOptionsname[i].dictValue
         console.log(this.typeOptionsname[i].dictValue,345)
			// bgde.nhdw = ''
		this.$set(bgert,nhdw,"")
		}
		console.log(this.hstwet,34)
		// for()
      let obj = {};
      obj.scoreDataNameId = "";
      obj.scoreDataName = "";
      obj.yuwen = "";
      obj.shuxue = "";
      obj.yingyu = "";
      obj.wuli = "";
      obj.huaxue = "";
      obj.shengwu = "";
      obj.zhengzhi = "";
      obj.lishi = "";
      obj.dili = "";
      obj.tiyu = "";
      obj.wenzong = "";
      obj.lizong = "";
      obj.zhengcefen = "";
      obj.remark = "";
	  obj.zongfen = ""
      this.scoreDataDetailsList.push(bgert);
	  this.nhgefisdi = true
	  console.log(this.scoreDataDetailsList)
    },
    /** 成绩_子删除按钮操作 */
    handleDeleteScoreDataDetails() {
      if (this.checkedScoreDataDetails.length == 0) {
        this.$modal.msgError("请先选择要删除的数据");
      } else {
        const scoreDataDetailsList = this.scoreDataDetailsList;
        const checkedScoreDataDetails = this.checkedScoreDataDetails;
        this.scoreDataDetailsList = scoreDataDetailsList.filter(function(item) {
          return checkedScoreDataDetails.indexOf(item.index) == -1
        });
      }
    },
    /** 复选框选中数据 */
    handleScoreDataDetailsSelectionChange(selection) {
      this.checkedScoreDataDetails = selection.map(item => item.index)
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('xiaoYuan/pay/export', {
        ...this.queryParams
      }, `data_${new Date().getTime()}.xlsx`)
    },
	ngtew(val){
		console.log(val)
	},

	/** 导入按钮操作 */
	handleImport() {
	  this.upload.title = "学生成绩信息";
	  this.upload.open = true;
	  this.upload.selectIndex = {}
	},

	/** 下载模板操作 */
	importTemplate() {
	  this.download('system/user/importTemplate', {
	  }, `user_template_${new Date().getTime()}.xlsx`)
	},
	// 文件上传中处理
	handleFileUploadProgress(event, file, fileList) {
	  this.upload.isUploading = true;
	},
	// 文件上传成功处理
	handleFileSuccess(response, file, fileList) {
	  this.upload.open = false;
	  this.upload.isUploading = false;
	  this.$refs.upload.clearFiles();
	  this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
	  this.getList();
	},
	// 提交上传文件
	submitFileForm() {
		// if(this.upload.selectIndex.scoreClassId == undefined){
		// 	this.$message.error("班级必填");
		// 	return false
		// }else if(this.upload.selectIndex.scoreClassId == null || this.upload.selectIndex.scoreClassId == ''){
		// 	this.$message.error("班级必填");
		// 	return false
		// }
		// if(this.upload.selectIndex.scoreTitle == undefined){
		// 	this.$message.error("考试名称必填");
		// 	return false
		// }else if(this.upload.selectIndex.scoreTitle == null || this.upload.selectIndex.scoreTitle == ''){
		// 	this.$message.error("考试名称必填");
		// 	return false
		// }
		// if(this.upload.selectIndex.scoreTime == undefined){
		// 	this.$message.error("考试时间必填");
		// 	return false
		// }else if(this.upload.selectIndex.scoreTime == null || this.upload.selectIndex.scoreTime == ''){
		// 	this.$message.error("考试时间必填");
		// 	return false
		// }

	  this.$refs.upload.submit();
	},
	mjyhess(val){
		this.getListuye(val.deptId)
	},
	mjyhesst(val){
		console.log(val)
		this.form.teacherName = val.teacherName
		this.getListuye(val.deptId)
	},
	nbstyu(val){
		console.log(val)
		// this.form.scoreClassName.scoreDataNameId =
	},
	hyt(val){
		console.log(val,val.index)
		let hyjd = val.index - 1
		let nhgegk = this.infoListstu.filter( rou=>{
			console.log(rou,val.scoreDataNameId,47)
			if(rou.id == val.scoreDataNameId){
				console.log(rou.id,val.scoreDataNameId,)
				this.scoreDataDetailsList[hyjd].scoreDataName = rou.studentName
				this.scoreDataDetailsList[hyjd].studentNumber = rou.studentNumber
			}
		})

		console.log(this.scoreDataDetailsList[hyjd].scoreDataName)
	},
	djieskle(val){
		console.log(val)
		 // let obj = this.typeOptionsname.find((item) => {
			//  console.log(item.dictLabel,val.dictLabel)
		 //              // return item.dictLabel === val.raw.dictLabel
   //     })
	   // console.log(obj,5)
		let hyeg = {'value':val.dictValue,'dictLabel':val.dictLabel,'dictValue':val.dictValue,'dictCode':val.dictCode}
		this.typeOptionsname.push(hyeg)

		console.log(this.hstwet)
		// let nhd = {'deptId':node.id,'deptName':node.label,'xmId':this.form.xmId,'xmbh':this.form.xmbh,'xmmc':this.form.xmxsmc}
		// this.form.ysbmList.push(nhd)
	},
	remiue(val){
		 this.typeOptionsname = this.typeOptionsname.filter(t => t.value !== val)
		 this.hstwet = []
		 for(var i = 0 ; i < this.typeOptionsname.length; i++){
		 					if(i < this.typeOptionsname.length){
		 						let bgde = {
		 							lable:'',
		 							value:''
		 						}
		 						bgde.value = this.typeOptionsname[i].dictValue
		 						bgde.lable = this.typeOptionsname[i].dictLabel
		 						this.hstwet.push(bgde)
		 					}
		 }
		 this.nhgefisdi = true
		 console.log(val,this.form.km,this.typeOptionsname)
	},
	bhgeskeu(val){
		console.log(val,3)
		this.nhgefisdi = true
		this.hstwet = []
		this.lhtre = []
		if(val == false){
			// 收缩
			for(var i = 0 ; i < this.typeOptionsname.length; i++){
								if(i < this.typeOptionsname.length){
									let bgde = {
										lable:'',
										value:''
									}
									let ght={
										xueke:'',
										manfen:null
									}
									bgde.value = this.typeOptionsname[i].dictValue
									bgde.lable = this.typeOptionsname[i].dictLabel
									ght.xueke = this.typeOptionsname[i].dictLabel
									this.hstwet.push(bgde)
									this.lhtre.push(ght)
								}
			}
			console.log(this.hstwet,this.lhtre,this.typeOptionsname)

		}else{
			// 下拉

		}
	},
	nhge(){
		console.log(87)

	},
	// 老师姓名选择器
	mjyhesstu(val){
		this.form.teacherId = val.teacherId
		// this.form.studentNumber = val.studentNumber
	},
	ihg(val){
		console.log(val)
		this.form.visitTime = val[0] + '-' + val[1]
		// this.form.visitDateTime = val[1]
	},
	ihgs(val){
		console.log(val)
		this.form.reservatConfigTimePmBegin = val[0]
		this.form.reservatConfigTimePmEnd = val[1]
	},
	starcha(val){
		console.log(val)
		if(this.endtime !='' || this.endtime !=null){
			this.form.visitTime = this.startime + '-' + this.endtime
		}else if(this.endtime == ''){
			this.form.visitTime = this.startime
		}
	},
	endcha(val){
		console.log(val)
		if(this.startime !=''){
			this.form.visitTime = this.startime + '-' + this.endtime
		}else if(this.startime == ''){
			this.$message.error("请先选择开始时间");
			return
			// this.form.visitTime = this.endtime
		}
	},
	getPass(row) {
	  const _this = this
	  this.$confirm('是否审核通过', "提醒", {
	    confirmButtonText: "确定",
	    cancelButtonText: "取消",
	    type: "warning"
	  }).then(function() {
	    return setPass({
	    visitType: 3,
	    reservatId: row.reservatId,
		 visitPhone:row.visitPhone
	    // xmStatus:row.xmStatus
	  })
	  }).then(() => {
		   _this.getList();
	    _this.msgSuccess("提交成功");
	  })
	},
	infoBtn(row) {
		const _this = this
		this.$confirm('是否拒绝', "提醒", {
		  confirmButtonText: "确定",
		  cancelButtonText: "取消",
		  type: "warning"
		}).then(function() {
		  return setPass({
		  visitType: 2,
		  reservatId: row.reservatId,
		  visitPhone:row.visitPhone
		  // xmStatus:row.xmStatus
		})
		}).then(() => {
		  _this.getList();
		  _this.msgSuccess("提交成功");
		})
	//   const _this = this
	//     this.$prompt("请输入拒绝意见", "提醒", {
	//       confirmButtonText: "确定",
	//       cancelButtonText: "取消",
	//       type: "warning",
	//     })
	//       .then(function({ value }) {
	//           return setPass({
	//             visitType: 2,
	//             reservatId: row.reservatId,
	//           });

	//       })
	//       .then(({ value }) => {
	//         _this.msgSuccess("驳回成功");
	//         _this.getList();
	//       });
	},
	// 获取屏幕高度
	showFilterForm () {
	      this.filterActive = !this.filterActive
	      this.changeTableMaxHeight()
	    },

	    changeTableMaxHeight () {
	      let height = document.body.offsetHeight // 网页可视区域高度
	      // if (this.filterActive) {
	      //   this.tableMaxHeight = height - 320
	      // } else {
	        this.tableMaxHeight = height - 250
	      // }
	      console.log(height)
	    }
  }
};
</script>

<style scoped lang="scss">
	.now-data-myself {
	  width: 40%;
	  position: absolute;
	  border-right: 1px solid rgba(227, 227, 227, 0.6);
	}
	.con {
	  position: relative;
	  max-width: 280px;
	  margin: auto;
	}
	.con .wh_content_all {
	  background: transparent !important;
	}
	.wh_top_changge li {
	  color: #F56C6C !important;
	  font-size: 15px !important;
	}
	.wh_content_item, .wh_content_item_tag {
	  color: #303133 !important;
	}
	.wh_content_item .wh_isToday {
	  background: #00d985  !important;
	  color: #fff  !important;
	}
	.wh_content_item .wh_chose_day {
	  background: #409EFF  !important;
	  color: #ffff  !important;
	}
	.wh_item_date:hover {
	    background: rgb(217, 236, 255) !important;
	    border-radius: 100px !important;
	    color: rgb(102, 177, 255)  !important;
	}
	.wh_jiantou1[data-v-2ebcbc83] {
	    border-top: 2px solid #909399;
	    border-left: 2px solid #909399;
	    width: 7px;
	    height: 7px;
	}
	.wh_jiantou2[data-v-2ebcbc83] {
	    border-top: 2px solid #909399;
	    border-right: 2px solid #909399;
	    width: 7px;
	    height: 7px;
	}
	.wh_top_tag[data-v-2ebcbc83] {
	  color: #409EFF;
	  border-top: 1px solid rgba(227, 227, 227, 0.6);
	  border-bottom: 1px solid rgba(227, 227, 227, 0.6);
	}
	.wh_container[data-v-2ebcbc83] {
	    max-width: 280px;
	}
	.wh_top_changge[data-v-2ebcbc83] {
	    display: flex;
	    width: 50%;
	    margin-left: 43%;
	}
	.now-data-myself-time {
	  color: #F56C6C;
	  font-size: 28px;
	  height: 30px;
	  font-family: "Helvetica Neue";
	}
	.now-data-myself-week {
	  font-size: 10px;
	  color: #909399;
	}
	.wh_top_changge .wh_content_li[data-v-2ebcbc83] {
	  font-family: Helvetica;
	}

	.bgtan{
		border-left: 3px solid #4775EA;
		padding-left: 10px;
	}

	.app-container{
		background-color: #f6f6f6;
		// height: 100vh;
	}
</style>
