<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="teacherNum">
			  <el-input
			  style="width:100%;"
			    v-model="queryParams.teacherNum"
			    placeholder="请输入联系方式"
			    clearable
			    @keyup.enter.native="handleQuery"
			  />
			</el-form-item>  
		  </el-col>
		  <el-col :span="8">
		  	<el-form-item label="发放时间(年份)" prop="year">
		  		<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="month">
		  		<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:94%;" clearable
			  	  v-model="queryParams.keyTime"
			  	  type="date"
			  	  value-format="yyyy-MM-dd"
			  	  placeholder="请选择发放时间">
			  	</el-date-picker>
			  </el-form-item>	
		  	<!-- <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>

    <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="['score:data: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="['xiaoYuan:pay: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="['xiaoYuan:pay: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="['xiaoYuan:data:importData']"
	    >导入</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" v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
	  <el-table-column type="selection" width="55" align="center" />
	  <el-table-column
	  align="center"
	                  v-for="(col, index) in hstwet" 
	                  :key="index"
	  				  :label="col.lable"
	              >
	                  <!-- 通过插槽为表头绑定mousedown和dragover方法 -->
	                  <template  slot-scope="scope">
						  <span> {{scope.row[col.lable]}}</span>
	                  </template>
	    </el-table-column>
	  <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="['score:data:edit']"
	      >查看信息</el-button> -->
	      <el-button
	        size="mini"
	        type="text"
	        icon="el-icon-delete"
	        @click="handleDelete(scope.row)"
	        v-hasPermi="['xiaoYuan:pay: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>
  </div>
</template>

<script>
import { listData, getData, delData, addData, updateData } from "@/api/zhihuixy/gongzt";
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";
export default {
  name: "Data",
  dicts: ['typeone','sys_subject','kaoshi'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 子表选中数据
      checkedScoreDataDetails: [],
	  tableMaxHeight:400,
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 成绩表格数据
      dataList: [],
      // 成绩_子表格数据
      scoreDataDetailsList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        scoreTitle: null,
        scoreTime: null,
        scoreClassId: null,
        scoreClassName: null,
        privacyType: null,
		params:{}
      },
	  kiuesegh:[],
      // 表单参数
      form: {},
      // 表单校验
      rules: {
		teacherName: [
		  { required: true, message: "班级不能为空", trigger: "blur" }
		],  
		keyTime: [
		  { 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,
   };
  },
  created() {
	  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: {
	  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 
	  			  }
	  			  // 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.data.records[0].tableDataJO;
        this.total = response.data.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        scoreId: null,
        teacherId: null,
        teacherName: null,
        keyTime: null,
        remark: null,
		// scoreDataMfBoList:[]
      };
      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.typeOptionsname = []
	  // this.hstwet=[]
	  this.lhtre = []
	  this.jueg()
      this.title = "添加工资";
	  this.isxiuge = false
	  
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const scoreId = row.scoreId || this.ids
	  let dee={}
	  dee.scoreId = scoreId
	  this.typeOptionsname = []
	  this.lhtre = []
	  this.hstwet = []
	  this.scoreDataDetailsList = []
	  let gnhdkt = []
	  this.isxiuge = true
      getData(dee).then(response => {
        this.form = response.data;
		this.form.scoreClassId = this.form.scoreClassId
		this.getListuye(this.form.scoreClassId)
		this.lhtre = this.form.scoreDataMfVoList
		this.open = true;
		this.title = "修改工资";
		console.log(this.form,this.form.scoreDataStudentVoList)
		// this.form.km= 
		for(var y = 0 ; y < this.form.scoreDataStudentVoList.length; y++){
			console.log(this.form.scoreDataStudentVoList[y],y,this.form.scoreDataStudentVoList.length,4)
			if(y < this.form.scoreDataStudentVoList.length){
				let nhget = {'scoreDataName':null,"scoreDataNameId":null,'zongfen':null}
				nhget.scoreDataName = this.form.scoreDataStudentVoList[y].scoreDataName
				nhget.scoreDataNameId = this.form.scoreDataStudentVoList[y].scoreDataNameId
				nhget.zongfen = this.form.scoreDataStudentVoList[y].zongfen
				let ghd = this.form.scoreDataStudentVoList[y]
				let kjhfe = this.form.scoreDataStudentVoList[y].scoreDataDetailVoList
				for(var i = 0; i < kjhfe.length; i++){
					let ngeoks={'value':null,}
					let jhgd={'dictValue':null,'dictLabel':null}
											this.jhgre.filter( rou=>{
												let ng=''
												if(rou.dictLabel == kjhfe[i].xueke){
												   ngeoks.value = rou.dictValue
												   ngeoks.lable = kjhfe[i].xueke
												   this.$set(nhget,rou.dictValue,kjhfe[i].score)
												   // ng = rou.dictValue
												   // nhget.ng =  kjhfe[i].score
												   jhgd.dictLabel = rou.dictLabel
												   jhgd.dictValue = rou.dictValue
												   gnhdkt.push(rou.dictValue)
												}
												// console.log(nhget,7)
											}) 
											this.typeOptionsname.push(jhgd)
											this.hstwet.push(ngeoks)
				
			    }
				this.scoreDataDetailsList.push(nhget)
			  }
			  
				
		}
		    this.nhgefisdi = true
			 const res = new Map();
		let ihge = this.hstwet.filter(t => !res.has(t.lable) && res.set(t.lable,1))
		const ret = new Map()
		let ghytfw = this.typeOptionsname.filter(t => !ret.has(t.dictLabel) && ret.set(t.dictLabel,1))
		this.hstwet = ihge
		this.typeOptionsname = ghytfw
		// console.log(ghytfw)
		let uniqueArr = Array.from(new Set(gnhdkt));
		this.form.km = uniqueArr
		console.log(this.hstwet,uniqueArr,this.typeOptionsname,8)
		console.log(this.scoreDataDetailsList,9)
        
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
			
			
          // this.form.scoreDataDetailsList = this.scoreDataDetailsList;
		  let nhgeo = []
		  let bgtr = []
		  for(var i = 0 ; i < this.lhtre.length; i++){
		  				 let nhget = {}
		  				 let ghd = this.hstwet[i]
		  				 for(var s in ghd) {
		  				 // console.log(s,":",ghd[s]);
		  				 let hg = ghd[s]
		  				 let nhges={'xueke':null,'score':null}
		  				   this.jhgre.filter( rou=>{
		  					   if(rou.dictLabel == hg){
								   // console.log(hg,rou.dictLabel,this.lhtre[i].manfen,4)
		  						   this.$set(this.form,rou.dictValue,this.lhtre[i].manfen)
								   // console.log(this.form,rou.dictValue,this.lhtre[i].manfen,6)

		  					   }
		  				   })
		  				 }
		  }
		  console.log(this.form,this.lhtre)
		  console.log(this.form,this.lhtre,79)
		  // return
		  // this.form.scoreDataStudentBoList = nhgeo
		  // this.form.scoreDataMfBoList = this.lhtre
          if (this.form.scoreId != null) {
			  this.form.scoreDataStudentVoList = undefined
			  this.form.scoreDataMfVoList = undefined
            updateData(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addData(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
			
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const scoreIds = row.payId || 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`)
	  window.open("https://xygl.qs163.cn/prod-api/profile/upload/template/工资.xls")
	  
    },
	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() {
	  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)s
	},
	djieskle(val){
		let hyeg = {'value':val.dictValue,'dictLabel':val.dictLabel,'dictValue':val.dictValue,'dictCode':val.dictCode}
		this.typeOptionsname.push(hyeg)
		console.log(this.hstwet)
	},
	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
	},
	// 获取屏幕高度
	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">
	.bgtan{
		border-left: 3px solid #4775EA;
		padding-left: 10px;
	}
	
	.app-container{
		background-color: #f6f6f6;
		// height: 100vh;
	}
</style>