<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">
			<el-form-item label="预约日期" prop="reservatConfigDate">
				<!-- multiple -->
				<el-select  style="width:100%;" v-model="queryParams.reservatConfigDate" placeholder="请选择可预约日期">
				  <el-option
				    v-for="dict in dict.type.zhouji"
				   :key="dict.value"
				   :label="dict.label"
				   :value="dict.value"
				   @keyup.enter.native="handleQuery"
				  ></el-option>
				</el-select>
			 <!-- <el-input
			  style="width:100%;"
			    v-model="queryParams.reservatConfigDate"
			    placeholder="请输入教师工号"
			    clearable
			    @keyup.enter.native="handleQuery"
			  /> -->
			</el-form-item>  
		  </el-col>
		  <!-- <el-col :span="8">
		  	<el-form-item label="发放时间(年份)" prop="keyTime">
		  		<el-date-picker style="width:100%;" clearable
		  		  v-model="queryParams.year"
		  		  type="year"
		  		  value-format="yyyy"
		  		  placeholder="请选择发放时间">
		  		</el-date-picker>
		  	</el-form-item>		  
		  </el-col>
		  <el-col :span="8">
		  	<el-form-item label="发放时间(月份)" prop="keyTime">
		  		<el-date-picker style="width:100%;" clearable
		  		  v-model="queryParams.month"
		  		  type="month"
		  		  value-format="MM"
		  		  placeholder="请选择发放时间">
		  		</el-date-picker>
		  	</el-form-item>		  
		  </el-col>
		  <el-col :span="8">
		  	<el-form-item label="发放时间(年月日)" prop="keyTime">
		  		<el-date-picker style="width:100%;" clearable
		  		  v-model="queryParams.keyTime"
		  		  type="data"
		  		  value-format="yyyy-MM-dd"
		  		  placeholder="请选择发放时间">
		  		</el-date-picker>
		  	</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-item label="考试时间" prop="scoreTime">
        <el-date-picker clearable
          v-model="queryParams.scoreTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择考试时间">
        </el-date-picker>
      </el-form-item> -->
      <!-- <el-form-item label="接收班级id" prop="scoreClassId">
        <el-input
          v-model="queryParams.scoreClassId"
          placeholder="请输入接收班级id"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="接收班级名称" prop="scoreClassName">
        <el-input
          v-model="queryParams.scoreClassName"
          placeholder="请输入接收班级名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <!-- <el-form-item label="隐私设置 1:仅自己 2:仅本班 3:全部" prop="privacyType">
        <el-select v-model="queryParams.privacyType" placeholder="请选择隐私设置 1:仅自己 2:仅本班 3:全部" clearable>
          <el-option
            v-for="dict in dict.type.typeone"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item> -->
      
    </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:reservatConfig: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:reservatConfig: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 border :max-height="tableMaxHeight"  :data="dataList" @selection-change="handleSelectionChange">
	  <el-table-column type="selection" width="55" align="center" />
	   <el-table-column label="教职工姓名" align="center" prop="teacherName" />
	    <el-table-column label="教职工手机号" align="center" prop="teacherPhone" />
	    <el-table-column label="教职工可预约日期" align="center" prop="reservatConfigDate" >
		<template slot-scope="scope">
			<div style="display:flex; width:100%; justify-content: center;">
				<dict-tag v-for="(item,index) in scope.row.reservatConfigDate" :options="dict.type.zhouji" :value="item"/>
			</div>
		  </template>
		</el-table-column>	
		<el-table-column label="预约时间上午" align="center" prop="reservatConfigTimeAmBegin" width="180">
		          <template slot-scope="scope">
		            <span>{{ scope.row.reservatConfigTimeAmBegin == null?'暂无数据' : scope.row.reservatConfigTimeAmBegin  +  '-' +scope.row.reservatConfigTimeAmEnd}}</span>
		          </template>
		</el-table-column>
		        <el-table-column label="可预约时间下午" align="center" prop="reservatConfigTimePmBegin" width="180">
		          <template slot-scope="scope">
		            <span>{{scope.row.reservatConfigTimePmBegin == null? '暂无数据' : scope.row.reservatConfigTimePmBegin  + '-' +scope.row.reservatConfigTimePmEnd}}</span>
		          </template>
		        </el-table-column>
		        <el-table-column label="可预约次数" align="center" prop="reservatConfigNum" />
	  <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
	    <template slot-scope="scope">
	      <el-button
	        size="mini"
	        type="text"
	        icon="el-icon-edit"
	        @click="handleUpdate(scope.row)"
	        v-hasPermi="['system:reservatConfig:edit']"
	      >修改</el-button>
	      <el-button
	        size="mini"
	        type="text"
	        icon="el-icon-delete"
	        @click="handleDelete(scope.row)"
	        v-hasPermi="['system:reservatConfig: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-input v-model="form.scoreClassName" placeholder="请输入接收班级名称" /> -->
			  				</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">
			
	      <!-- <div class="el-upload__tip" slot="tip">
	        <el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的用户数据
	      </div> -->
	      <span>仅允许导入xls、xlsx格式文件。</span>
		  <!-- <p style="margin: 0;">一个文件只包含一个sheet页，请删除其他sheet (也不可隐藏)</p>
		  <p style="margin: 0;">表中不支持多列姓名，只支持一列姓名</p>
		  <p style="margin: 0;">姓名在第一列</p>
		  <p style="margin: 0;">一种信息占一列</p>
		  <p style="margin: 0;">不支持合并单元格</p>
		  <p style="margin: 0;">不得使用筛选、冻结、公式、宏等功能</p> -->
		  
	      <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="130px">
        		  <el-row>
        			  <el-col :span="24">
        			  				<el-form-item label="可预约日期(周几)" prop="reservatConfigDate">
        			  					<el-select multiple style="width:100%;" v-model="form.reservatConfigDate" placeholder="请选择可预约日期">
        			  					  <el-option
        			  					    v-for="dict in dict.type.zhouji"
        			  					   :key="dict.value"
        			  					   :label="dict.label"
        			  					   :value="dict.value"
        			  						@click.native="mjyhesst(dict)"
        			  					  ></el-option>
        			  					</el-select>
        			  				  <!-- <el-input v-model="form.scoreClassName" placeholder="请输入接收班级名称" /> -->
        			  				</el-form-item>  
        			  </el-col>
        			  <el-col :span="24">
        			  	<el-form-item label="可预约时间(上午)" prop="reservatConfigTimeAmBegin">
							<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="reservatConfigTimePmBegin">
							<div style="display: flex;">
								<el-time-picker @change="starchas" v-model="startimes" value-format="HH:mm:ss" format="HH:mm:ss"  style="width:180px" size="mini" placeholder="开始时间" />
								<span class="">-</span>
								<el-time-picker @change="endchas" v-model="endtimes" 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="ihgs"
        			  		    arrow-control
        			  		    v-model="tmjeg"
								value-format="HH:mm:ss"
        			  		    range-separator="至"
        			  		    start-placeholder="开始时间"
        			  		    end-placeholder="结束时间"
        			  		    placeholder="选择时间范围">
        			  		  </el-time-picker> -->
        			  	</el-form-item>
        			  </el-col>
					  <el-col :span="24">
					  	<el-form-item label="可预约次数" prop="reservatConfigNum">
					  		<el-input type="number" v-model="form.reservatConfigNum" placeholder="请输入可预约次数" />
					  	</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 } from "@/api/zhihuixy/yuyuepzh";
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'],
  components: {
  	Calendar
  },
  data() {
    return {
      // 遮罩层
      loading: true,
	  date: "",
	        week: "",
      // 选中数组
      ids: [],
	  startime:'',
	  endtime:'',
	  startimes:'',
	  endtimes:'',
      // 子表选中数据
      checkedScoreDataDetails: [],
	  tableMaxHeight:400,
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      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: {
		reservatConfigDate: [
		  { required: true, message: "不能为空", trigger: "blur" }
		],  
		// reservatConfigTimeAmBegin: [
		//   { required: true, message: "不能为空", trigger: "blur" }
		// ], 
		reservatConfigNum: [
		  { required: true, 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 = {
       reservatConfigId: null,
         reservatConfigDate: null,
         reservatConfigTimeAmBegin: null,
         reservatConfigTimeAmEnd: null,
         reservatConfigTimePmBegin: null,
         reservatConfigTimePmEnd: null,
         reservatConfigNum: 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.tmjeg = ''
	  this.tmje = ''
	  this.lhtre = []
	  this.startime = ''
	  this.endtime = ''
	  this.startimes = ''
	  this.endtimes = ''
	  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 = ''
	  this.startime = ''
	  this.endtime = ''
	  this.startimes = ''
	  this.endtimes = ''
	  this.form.reservatConfigNum = null
      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.startime = this.form.reservatConfigTimeAmBegin
		 this.endtime = this.form.reservatConfigTimeAmEnd
		// this.tmje = ng
		// let mj=[]
		// mj.push(this.form.reservatConfigTimePmBegin,this.form.reservatConfigTimePmEnd)
		// this.tmjeg = mj
		this.startimes = this.form.reservatConfigTimePmBegin
		this.endtimes = this.form.reservatConfigTimePmEnd
		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)
		 
		 // if(this.form.reservatConfigTimeAmBegin == null){
			//  if(this.form.reservatConfigTimeAmBegin == null){
			// 	if(this.form.reservatConfigTimePmBegin == null){
			// 		if(this.form.reservatConfigTimePmEnd == null){
			// 		this.$message.error("请先选可预约时间");
			// 		console.log(1)
			// 		return	
			// 		}
			// 	} 
			//  }
		 // }
		 if(this.form.reservatConfigTimeAmBegin == null && this.form.reservatConfigTimeAmEnd == null){
			if(this.form.reservatConfigTimePmBegin == null &&  this.form.reservatConfigTimePmEnd == null){
				this.$message.error("请先选可预约时间");
				console.log(1)
				return	
			}else if(this.form.reservatConfigTimePmBegin != null){
				if(this.form.reservatConfigTimePmEnd == null){
					this.$message.error("请选择可预约结束时间");
					console.log(3)
					return	
				}
			}
		 }else if( this.form.reservatConfigTimeAmBegin != null  ){
			 if(this.form.reservatConfigTimeAmEnd == null){
				this.$message.error("请选择可预约结束时间"); 
				console.log(2)
				return	
			 }
		 }
		 
		 
		 
		 this.form.reservatConfigDate = this.form.reservatConfigDate.join(',')
		 
		  // return
		  // this.form.scoreDataStudentBoList = nhgeo
		  // this.form.scoreDataMfBoList = this.lhtre
          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.reservatConfigId || 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)
		if(val != null){
			this.form.reservatConfigTimeAmBegin = val[0]
			this.form.reservatConfigTimeAmEnd = val[1]
		}else{
			this.form.reservatConfigTimeAmBegin = null
			this.form.reservatConfigTimeAmEnd = null
		}
		
	},
	ihgs(val){
		console.log(val)
		if(val != null){
			this.form.reservatConfigTimePmBegin = val[0]
			this.form.reservatConfigTimePmEnd = val[1]
		}else{
			this.form.reservatConfigTimePmBegin = null
			this.form.reservatConfigTimePmEnd = null
		}
		
	},
	starcha(val){
		console.log(val)
		if(this.endtime !='' || this.endtime !=null){
			this.form.reservatConfigTimeAmBegin = this.startime 
		}else if(this.endtime == ''){
			this.form.reservatConfigTimeAmBegin = this.startime
		}else{
			this.form.reservatConfigTimeAmBegin = this.startime
		}
	},
	endcha(val){
		console.log(val)
		if(this.startime !=''){
			this.form.reservatConfigTimeAmEnd =  this.endtime
		}else if(this.startime == ''){
			this.$message.error("请先选择开始时间");
			this.form.reservatConfigTimeAmEnd =  this.endtime
			return
			// this.form.visitTime = this.endtime
		}
	},
	starchas(val){
		console.log(val)
		if(this.endtimes !='' || this.endtimes !=null){
			this.form.reservatConfigTimePmBegin  = this.startimes
		}else if(this.endtimes == ''){
			this.form.reservatConfigTimePmBegin  = this.startimes
		}else{
			this.form.reservatConfigTimePmBegin  = this.startimes
		}
	},
	endchas(val){
		console.log(val)
		if(this.startimes !=''){
			this.form.reservatConfigTimePmEnd =this.endtimes
		}else if(this.startimes == ''){
			this.$message.error("请先选择开始时间");
			this.form.reservatConfigTimePmEnd =this.endtimes
			return
			// this.form.visitTime = this.endtime
		}
	},
	// 获取屏幕高度
	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>