<template>
  <div class="app-container">
    <el-page-header content="申请记录" @back="goBack"/>
    <el-table ref="multipleTable" :data="varList" :header-cell-style="{'font-weight': 'bold','color': '#000'}" tooltip-effect="dark" border fit highlight-current-row>
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column type="index" label="序号" width="50" align="center" />
      <el-table-column prop="CREATTIME" label="申请时间" />
      <el-table-column prop="CREATOR" label="申请人员" />
      <el-table-column prop="NAME" label="姓名" />
      <el-table-column prop="DEPARTMENT_NAME" label="部门" />
      <el-table-column prop="COMPANY_NAME" label="服务公司" />
      <el-table-column prop="AUDIT_STATUS" label="申请状态" >
        <template slot-scope="{row}">
          <span v-if="row.AUDIT_STATUS === 0">申请中</span>
          <span v-if="row.AUDIT_STATUS === 1">申请通过</span>
          <span v-if="row.AUDIT_STATUS === -1">申请打回</span>
        </template>
      </el-table-column>
      <el-table-column prop="DESCR" show-overflow-tooltip="true" label="备注信息" />
      <el-table-column prop="AUDIT_DESCR" show-overflow-tooltip="true" label="审核意见" />
    </el-table>
    <div class="page-btn-group">
      <div/>
      <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
    </div>
  </div>
</template>

<script>
import Pagination from '@/components/Pagination' // 通过 el-pagination二次打包
import { requestFN } from '@/utils/request'
import waves from '@/directive/waves' // waves directive
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
  components: { Pagination, Treeselect },
  directives: { waves },
  data() {
    return {
      listQuery: {
        page: 1,
        limit: 10
      },
      total: 0,
      varList: []
    }
  },
  created() {
    this.getList()
    this.getTreeData()
  },
  methods: {
    getList() {
      this.listLoading = true
      requestFN(
        '/stopserverlog/list?showCount=' + this.listQuery.limit + '&currentPage=' + this.listQuery.page,
        {
        }
      ).then((data) => {
        this.listLoading = false
        this.varList = data.varList
        this.total = data.page.totalResult
      })
        .catch((e) => {
          this.listLoading = false
        })
    },

    goBack() {
      this.$parent.activeName = 'List'
    }
  }
}
</script>

