<template>
    <el-dialog
      :visible.sync="visible"
      title="审核权限配置检查"
      :footer="false"
      @close="onClose"

    >
    <el-tabs v-model="tab" type="card" >
    <el-tab-pane label="未配置部门管理员权限部门" name="first">
      <div style="float: left;margin-bottom: 8px;font-size: 16px;">检测结果：共{{deptTotal}}个</div>
        <el-table
        :data="deptData"
        :header-cell-style="{ textAlign: 'center', height: '40px' }"
        :cell-style="{ textAlign: 'center' }"
        style="width: 100%"
      >
      <el-table-column   width="80px" label="序号" align="center">
        <template slot-scope="scop">
          {{scop.$index+1}}
        </template>
      </el-table-column>
        <el-table-column
          prop="name"
          label="部门名称"
          header-align="center"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="type"
          label="类型"
          header-align="center"
          align="center"
        ></el-table-column>
      </el-table>
      <div class="block" >
      <el-pagination
        @current-change="handleCurrentChange1"
        layout=" prev, pager, next"
         :total="deptTotal"
        :page-size="pageSize"
        :current-page="currentPageDept"
      >
      </el-pagination>
      </div>
    </el-tab-pane>
    <el-tab-pane label="未配置区市审核人权限区市" name="second">
      <div style="float: left;margin-bottom: 8px;font-size: 16px;">检测结果：共{{districtTotal}}个</div>
        <el-table
        :data="districtData"
        :header-cell-style="{ textAlign: 'center', height: '40px' }"
        :cell-style="{ textAlign: 'center' }"
        style="width: 100%"
      >
      <el-table-column   width="80px" label="序号" align="center">
        <template slot-scope="scop">
          {{scop.$index+1}}
        </template>
      </el-table-column>
        <el-table-column
          prop="NAME"
          label="区市名称"
          header-align="center"
          align="center"
        ></el-table-column>
        <!-- <el-table-column
          prop="type"
          label="类型"
          header-align="center"
          align="center"
        ></el-table-column> -->
        
      </el-table>
      <div class="block" >
      <el-pagination
        @current-change="handleCurrentChange2"
        layout="prev, pager, next"
         :total="deptTotal"
        :page-size="pageSize"
        :current-page="currentPageDistrict"
      >
      </el-pagination>
      </div>
    </el-tab-pane>
    </el-tabs>
    </el-dialog>
  </template>
  
  <script>

  export default {
    data () {
      return {
        visible:false,
        tab:'first',
        deptTotal:0,
        districtTotal:0,
        deptData:[],
        districtData:[],
        currentPageDistrict:1,
        currentPageDept:1,
        pageSize:10,
      }
    },
 watch:{

},
    methods: {
      handleCurrentChange1 (val) {
      this.currentPageDept = val
      this.getDeptList()
    },
    handleCurrentChange2 (val) {
      this.currentPageDistrict = val
      this.getDistrinctList()
    },
      getDeptList(){
        let params = {
          pageNum:this.currentPageDept,
          pageSize:this.pageSize

        }
        this.$http
        .get('/sys/user/getApproverUnconfiguredDepartment/', {params
         
        })
        .then((res) => {
          this.deptData = res.data.data.list
          this.deptTotal = Number(res.data.data.total)
        })
      },
      getDistrinctList(){
        let params = {
          pageNum:this.currentPageDistrict,
          pageSize:this.pageSize

        }
        this.$http
        .get('/sys/user/getApproverUnconfiguredRegion', {params
         
        })
        .then((res) => {
          this.districtData = res.data.data
          this.districtTotal = Number(res.data.data.length)
        })
      },
        onClose(){
    this.visible=false;
    this.$emit("refreshCheck",false)
        },
      init(){
        this.visible = true   
        this.getDeptList()
        this.getDistrinctList()
      }
    }
    
}
     
 
  
  </script>
  
  <style lang="scss" scoped>

  ::v-deep .aui-content   .el-tabs__header {
    left: 0px;
  }
  </style>
  