<!--准入凭证审核/待审核-->
<template>
  <div class="pending page-container">
    <div class="page-content-box">
      <el-table class="table-box" v-loading="loading" border :data="dataList">
        <el-table-column label="申请人" align="left" prop="userName" />
        <el-table-column label="申请人身份" align="left" prop="userType">
          <template slot-scope="scope">
            {{scope.row.userType == '1' ? '教职工':(scope.row.userType == '2' ? '学生':'')}}
          </template>
        </el-table-column>
        <el-table-column label="申请实验室" align="left" prop="subName" />
        <!--<el-table-column label="准入凭证名称" align="left" prop="configureName" />-->
        <el-table-column label="申请时间" align="left" prop="creatTime" >
          <template slot-scope="scope">
            <span>{{parseTime(scope.row.creatTime,"{y}-{m}-{d} {h}:{i}")}}</span>
          </template>
        </el-table-column>
        <el-table-column label="有效期" align="left" prop="validBeginTime">
          <template slot-scope="scope">
            <span>{{parseTime(scope.row.validBeginTime,"{y}-{m}-{d} {h}:{i}")}} 至 {{parseTime(scope.row.validEndTime,"{y}-{m}-{d} {h}:{i}")}}</span>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="120" v-if="tableButtonType">
          <template slot-scope="scope">
            <div class="table-button-box">
              <p class="table-button-null"></p>
              <p class="table-button-p"
                 @click="goInfoPage(scope.row)"
                 v-hasPermiRouter="['laboratory:audit:edit']"
              >审核</p>
              <p class="table-button-null"></p>
            </div>
          </template>
        </el-table-column>
      </el-table>
      <pagination :page-sizes="[20, 30, 40, 50]"
                  v-show="total>0"
                  :total="total"
                  layout="total, prev, pager, next, sizes, jumper"
                  :page.sync="queryParams.page"
                  :limit.sync="queryParams.pageSize"
                  @pagination="getList"
      />
    </div>
  </div>
</template>
<script>
  import { listApproval, getApproval, delApproval, addApproval,
    updateApproval,submitApproval,failedApproval,applyApproval,
    applyList } from "@/api/secureAccess/index";
  //                    V3
  import { laboratoryApplyList } from "@/api/secureAccess/index";

  export default {
    name: "pending",
    data() {
      return {
        tableButtonType:this.hasPermiDom(['laboratory:audit:edit']),
        pageType:1,
        // 遮罩层
        loading: true,
        // 总条数
        total: 0,
        // 审批记录表格数据
        dataList: [],
        // 查询参数
        queryParams: {
          page: 1,
          pageSize:20,
          searchValue: null,
          userMajorId: null,
        },
        audit:[],
        auditId:"",
        //审核状态
        radioAudit:"1",
        //拒绝内容
        inputAudit:"",
        //组件传参
        infoData:{},
      };
    },
    created() {

    },
    mounted(){
      this.getList();
    },
    methods: {
      goInfoPage(row){
        this.$parent.pageClick(true,0,row);
      },
      /** 查询审批记录列表 */
      getList() {
        this.loading = true;
        this.queryParams.auditStatus = 0;
        laboratoryApplyList(this.queryParams).then(response => {
          this.$set(this,'dataList',response.data.records);
          this.$set(this,'total',response.data.total);
          this.loading = false;
        });
      },
    }
  };
</script>
<style scoped lang="scss">
  .pending {
    .button-box{
      width:90px;
      display: flex;
    }
  }
</style>
