eqListTable.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <!-- 设备清单的有tab的表格 -->
  2. <template>
  3. <div class='eq-list'>
  4. <div class='eq-list-top'>
  5. <el-input
  6. placeholder='请输入设备简称、品牌、型号、生产厂商搜索'
  7. size='small'
  8. @change='getList'
  9. prefix-icon='el-icon-search'
  10. v-model='keyword'
  11. style='width:310px;margin-right:12px'
  12. ></el-input>
  13. <Select @change='getList' width='120' tipPlace='top' caption='楼层 :' :selectdata='floorSelect'></Select>
  14. </div>
  15. <el-table :data='tableData' style='width: 100%' @row-click='innerVisible = true'>
  16. <el-table-column prop='sbxh' label='序号' width='120'></el-table-column>
  17. <el-table-column prop='sbjbm' label='设备编号' width='160'></el-table-column>
  18. <el-table-column prop='sl' label='数量'></el-table-column>
  19. <el-table-column prop='brand' label='品牌'></el-table-column>
  20. <el-table-column prop='sbxh' label='型号'></el-table-column>
  21. <el-table-column prop='floor' label='楼层'></el-table-column>
  22. <el-table-column prop='wzjc' label='安装位置' width='240'></el-table-column>
  23. <el-table-column prop='manufacturer' label='生产厂商' width='240'></el-table-column>
  24. </el-table>
  25. <div class='foot'>
  26. <el-pagination
  27. background
  28. layout='prev, pager, next'
  29. :total='total'
  30. :page-size='size'
  31. @prev-click='pageChanged'
  32. @next-click='pageChanged'
  33. @current-change='pageChanged'
  34. ></el-pagination>
  35. </div>
  36. <el-dialog width='1200px' style='height:80%' title='设备清单' :visible.sync='innerVisible' append-to-body>
  37. <eq-detail ref='qdDialog'></eq-detail>
  38. </el-dialog>
  39. </div>
  40. </template>
  41. <script>
  42. import Select from '@/components/Select/Select.vue'
  43. import EqDetail from './eqDetaileDialog'
  44. import { queryEquipmentList } from '@/api/equipmentList.js'
  45. import { mapGetters } from 'vuex'
  46. export default {
  47. components: { Select, EqDetail },
  48. data() {
  49. return {
  50. dataSelect2: [
  51. { id: 'test1', name: '选择项' },
  52. { id: 'test2', name: '单平米' },
  53. { id: 'test3', name: '下级分项' },
  54. { id: 'test4', name: '滑动平均滑动平均' }
  55. ],
  56. tableData: [],
  57. total: 0,
  58. currentPage: 1,
  59. size: 10,
  60. floorSelect: [],
  61. innerVisible: false, //详情弹框
  62. keyword: ''
  63. }
  64. },
  65. computed: {
  66. ...mapGetters(['floorsArr'])
  67. },
  68. props: ['param', 'major'],
  69. methods: {
  70. pageChanged(page) {
  71. this.currentPage = page
  72. this.getList()
  73. },
  74. init() {
  75. this.floorSelect = []
  76. if (this.floorsArr.length > 0) {
  77. this.floorsArr.forEach(e => {
  78. let obj = {
  79. id: e,
  80. name: e
  81. }
  82. this.floorSelect.push(obj)
  83. })
  84. }
  85. },
  86. getList() {
  87. let postParams = {
  88. tab_code: this.param
  89. }
  90. let data = {
  91. page: this.currentPage,
  92. size: this.size,
  93. plazaId: this.$store.state.plazaId,
  94. major: this.major,
  95. keyword: this.keyword
  96. }
  97. queryEquipmentList({ data, postParams }).then(res => {
  98. console.log(res)
  99. this.tableData = res.data.data
  100. this.total = res.data.count
  101. })
  102. }
  103. },
  104. watch: {
  105. param(newV, oldV) {
  106. if (newV !== oldV) {
  107. this.getList()
  108. }
  109. }
  110. },
  111. mounted() {
  112. this.init()
  113. this.getList()
  114. }
  115. }
  116. </script>
  117. <style lang="less" scoped>
  118. .eq-list {
  119. .eq-list-top {
  120. display: flex;
  121. }
  122. .foot {
  123. position: absolute;
  124. height: 32px;
  125. right: 26px;
  126. bottom: 20px;
  127. }
  128. td {
  129. overflow: hidden;
  130. text-overflow: ellipsis;
  131. white-space: nowrap;
  132. }
  133. }
  134. </style>