year-highest-emp-lv.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <div v-loading="loading">
  3. <div class="white-box">
  4. <div class="filter-box">
  5. <filter-user :filter-types="filterTypes" @select-value="handleFilterUser"></filter-user>
  6. </div>
  7. <el-table :data="tableData" stripe style="width: 100%;" :height="tool.getTableHeight()">
  8. <el-table-column v-for="(tableHeader, key) in tableHeaders" :key="key" :label="tableHeader.header" :width="tableHeader.other.width ? tableHeader.other.width : ''">
  9. <template slot-scope="scope">
  10. <template v-if="scope.row[tableHeader.index].other.tag" >
  11. <el-tag :type="scope.row[tableHeader.index].other.tag.type ? scope.row[tableHeader.index].other.tag.type : null" :size="scope.row[tableHeader.index].other.tag.size ? scope.row[tableHeader.index].other.tag.size : null" :class="scope.row[tableHeader.index].other.tag.class ? scope.row[tableHeader.index].other.tag.class : null" >{{scope.row[tableHeader.index].value}}</el-tag>
  12. </template>
  13. <template v-else-if="scope.row[tableHeader.index].other.progress" >
  14. <el-progress type="circle" :percentage="Number.parseInt(percentList['MOVE_PERCENT'][scope.row.ID])"
  15. :width="50"
  16. :stroke-width="3"></el-progress>
  17. </template>
  18. <template v-else>
  19. <div v-html="scope.row[tableHeader.index].value"></div>
  20. </template>
  21. </template>
  22. </el-table-column>
  23. </el-table>
  24. <div class="white-box-footer">
  25. <el-button type="success" size="small" @click="handleExport"
  26. v-show="permission.hasPermission(`user/year-highest-emp-lv-export`)">导出Excel
  27. </el-button>
  28. <pagination :total="totalCount" :page_size="pageSize" @size-change="handleSizeChange" @current-change="handleCurrentChange"></pagination>
  29. </div>
  30. </div>
  31. </div>
  32. </template>
  33. <script>
  34. import Vue from 'vue'
  35. import network from '@/utils/network'
  36. import tool from '@/utils/tool'
  37. import store from '@/utils/vuexStore'
  38. import FilterUser from '@/components/FilterUser'
  39. import permission from '@/utils/permission'
  40. import Pagination from '@/components/Pagination'
  41. import filterHelper from '../../utils/filterHelper'
  42. export default {
  43. name: 'user_year-highest-emp-lv',
  44. components: {FilterUser,Pagination},
  45. created () {
  46. },
  47. mounted () {
  48. this.getData()
  49. },
  50. data () {
  51. return {
  52. tableHeaders: null,
  53. tableData: null,
  54. loading: true,
  55. multipleSelection: [],
  56. currentPage: 1,
  57. totalPages: 1,
  58. totalCount: 1,
  59. pageSize: 20,
  60. tool: tool,
  61. permission: permission,
  62. filterTypes: {},
  63. filterModel: {},
  64. }
  65. },
  66. methods: {
  67. handleSelectionChange (val) {
  68. this.multipleSelection = val
  69. },
  70. handleCurrentChange (page) {
  71. this.getData(page, this.pageSize)
  72. },
  73. handleSizeChange (pageSize) {
  74. this.getData(this.currentPage, pageSize)
  75. },
  76. handleFilterUser(filterData){
  77. filterHelper.handleFilterUser(this, filterData)
  78. },
  79. handleFilter(){
  80. this.getData()
  81. },
  82. getData (page, pageSize, isLoading = true) {
  83. network.getPageData(this, 'user/year-highest-emp-lv', page, pageSize, this.filterModel, response => {
  84. this.filterTypes = response.filterTypes
  85. }, isLoading)
  86. },
  87. handleExport(){
  88. this.$confirm(`确定要导出当前数据吗?`, '提示', {
  89. confirmButtonText: '确定',
  90. cancelButtonText: '取消',
  91. type: 'warning'
  92. }).then(() => {
  93. return network.getData(`user/year-highest-emp-lv-export`, this.filterModel)
  94. }).then(response => {
  95. this.$message({
  96. message: response,
  97. type: 'success'
  98. })
  99. }).catch(response => {
  100. })
  101. },
  102. }
  103. }
  104. </script>
  105. <style scoped>
  106. </style>