remain-pv.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 class="table-box" ref="multipleTable" :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 : ''" :prop="tableHeader.other.prop ? tableHeader.other.prop : null">
  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>
  14. <div v-html="scope.row[tableHeader.index].value"></div>
  15. </template>
  16. </template>
  17. </el-table-column>
  18. </el-table>
  19. <div class="white-box-footer">
  20. <pagination :total="totalCount" :page_size="pageSize" @size-change="handleSizeChange" @current-change="handleCurrentChange"></pagination>
  21. </div>
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. import network from '@/utils/network'
  27. import tool from '@/utils/tool'
  28. import baseInfo from '@/utils/baseInfo'
  29. import FilterUser from '../../components/FilterUser'
  30. import permission from '@/utils/permission'
  31. import Pagination from '@/components/Pagination'
  32. import filterHelper from '@/utils/filterHelper'
  33. export default {
  34. name: 'shop_remain-pv',
  35. components: {FilterUser, Pagination},
  36. mounted () {
  37. this.getData()
  38. },
  39. data () {
  40. return {
  41. tableHeaders: null,
  42. tableData: null,
  43. loading: true,
  44. multipleSelection: [],
  45. currentPage: 1,
  46. totalPages: 1,
  47. totalCount: 1,
  48. pageSize: 20,
  49. tool: tool,
  50. permission: permission,
  51. baseDecLevels: baseInfo.decLevels(),
  52. baseEmpLevels: baseInfo.empLevels(),
  53. filterTypes: null,
  54. filterModel: {}
  55. }
  56. },
  57. methods: {
  58. handleCurrentChange (page) {
  59. this.getData(page, this.pageSize)
  60. },
  61. handleSizeChange (pageSize) {
  62. this.getData(this.currentPage, pageSize)
  63. },
  64. handleFilterUser (filterData) {
  65. filterHelper.handleFilterUser(this, filterData)
  66. },
  67. getData (page, pageSize) {
  68. network.getPageData(this, 'shop/remain-pv', page, pageSize, this.filterModel, response => {
  69. this.filterTypes = response.filterTypes
  70. })
  71. }
  72. }
  73. }
  74. </script>
  75. <style scoped>
  76. .table-box .el-form-item__label {
  77. width: 100px;
  78. color: #99a9bf;
  79. }
  80. .table-box .el-form-item {
  81. width: 30%;
  82. margin-right: 0;
  83. margin-bottom: 0;
  84. }
  85. </style>