luoyb
2021-06-03 36c84173ee2638aff47a3ed42cd22db8092ea133
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<template>
  <div>
    <el-container>
      <el-header :height="headerHeight">
        <el-row>
          <el-col :span="16">
            <h3 class="bu-tian-jia-title">离员工总数</h3>
          </el-col>
          <el-col :span="8">
            <el-input v-model="queryParams.empNumb" placeholder="请输入内容" style="width:200px" />
            <el-button type="primary" @click="search()">查询</el-button>
          </el-col>
        </el-row>
 
      </el-header>
      <el-container>
        <el-main>
          <el-table :data="tableData">
            <el-table-column label="序号" type="index" width="50" align="center" />
            <el-table-column prop="empNumb" label="员工编号" />
            <el-table-column prop="allDeptName" label="护卫点" />
            <el-table-column prop="jobName" label="岗位" />
            <el-table-column prop="empName" label="姓名" />
            <el-table-column prop="certificateNumb" label="身份证号码" width="180" />
            <el-table-column prop="sexName" label="性别" />
            <el-table-column prop="age" label="年龄" />
            <el-table-column prop="educationName" label="学历" />
            <el-table-column prop="nativePlaceName" label="籍贯" />
            <el-table-column prop="urgencyPhone" label="联系电话" />
            <el-table-column prop="entryDate" label="入职日期" />
            <el-table-column prop="delFlag" label="员工状态">
              <template slot-scope="{row}">
                {{ transDelFlag(row.delFlag) }}
              </template>
            </el-table-column>
          </el-table>
          <pagination
            v-show="total>0"
            :total="total"
            :page.sync="pagination.num"
            :limit.sync="pagination.size"
            @pagination="search"
          />
        </el-main>
      </el-container>
    </el-container>
 
  </div>
</template>
<script>
import Pagination from '@/components/Pagination'
export default {
  components: {
    Pagination
  },
  data() {
    return {
      total: 0, // 总数量
      queryParams: {}, // 查询参数
      sort: {}, // 排序
      pagination: { // 分页参数
        size: 5,
        num: 1
      },
      headerHeight: '70px',
      advancedQueryShow: false,
      dialogTableVisible: false,
      tableData: []
    }
  },
  mounted() {
    this.search()
  },
  methods: {
    // 翻页方法
    search() {
      this.queryParams.empName = this.queryParams.empNumb
      this.queryParams.deptName = this.queryParams.empNumb
      this.fetch({
        ...this.queryParams,
        ...this.sort
      })
    },
    fetch(params = {}) {
      var that = this
      params.pageSize = this.pagination.size
      params.pageNum = this.pagination.num
      params.delFlag = 1
      this.$get('hr/empBaseInfo/list', {
        ...params
      }).then((r) => {
        const data = r.data.data
        that.total = data.total
        that.tableData = data.rows
      })
    },
    transDelFlag(delFlag) {
      switch (delFlag) {
        case 0:
          return '正常'
        case 1:
          return '删除'
        case 2:
          return '暂存'
      }
    }
  }
}
</script>
<style lang="scss" scoped>
 
</style>