eqListTable.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <!-- 设备清单的有tab的表格 -->
  2. <template>
  3. <div class='eq-list'>
  4. <div class='eq-list-top'>
  5. <el-input
  6. placeholder='搜索设备名称'
  7. size='small'
  8. @blur='getList'
  9. prefix-icon='el-icon-search'
  10. v-model='sbjc'
  11. clearable
  12. style='width:192px;margin-right:12px'
  13. ></el-input>
  14. <el-input
  15. placeholder='搜索品牌型号'
  16. size='small'
  17. @blur='getList'
  18. clearable
  19. prefix-icon='el-icon-search'
  20. v-model='keyword'
  21. style='width:192px;margin-right:12px'
  22. ></el-input>
  23. <Select @change='getList' v-model='floor' style='margin-right:12px;' width='120' tipPlace='top' caption='楼层 :' :selectdata='floorSelect'></Select>
  24. <el-input
  25. placeholder='搜索生产厂商'
  26. clearable
  27. size='small'
  28. @blur='getList'
  29. prefix-icon='el-icon-search'
  30. v-model='manufacturer'
  31. style='width:192px;'
  32. ></el-input>
  33. </div>
  34. <el-table :data='tableData' style='width: 100%' :border='true' @row-click='rowHandle'>
  35. <el-table-column type='index' label='序号' width='80'></el-table-column>
  36. <el-table-column prop='sbjc' label='设备名称' width='160'>
  37. <template slot-scope='{row}'>{{row.sbjc || '--'}}</template>
  38. </el-table-column>
  39. <el-table-column prop='sl' label='数量'>
  40. <template slot-scope='{row}'>{{row.sl || '--'}}</template>
  41. </el-table-column>
  42. <el-table-column prop='brand' label='品牌'>
  43. <template slot-scope='{row}'>{{row.brand || '--'}}</template>
  44. </el-table-column>
  45. <el-table-column prop='sbxh' label='型号' show-overflow-tooltip resizable>
  46. <template slot-scope='{row}'>{{row.sbxh || '--'}}</template>
  47. </el-table-column>
  48. <el-table-column prop='floor' label='楼层'>
  49. <template slot-scope='{row}'>{{row.floor || '--'}}</template>
  50. </el-table-column>
  51. <el-table-column prop='wzjc' label='安装位置' show-overflow-tooltip resizable>
  52. <template slot-scope='{row}'>{{row.wzjc || '--'}}</template>
  53. </el-table-column>
  54. <el-table-column prop='manufacturer' label='生产厂商' show-overflow-tooltip resizable>
  55. <template slot-scope='{row}'>{{row.manufacturer || '--'}}</template>
  56. </el-table-column>
  57. </el-table>
  58. <div class='foot'>
  59. <el-pagination
  60. background
  61. layout='prev, pager, next'
  62. :total='total'
  63. :page-size='size'
  64. @prev-click='pageChanged'
  65. @next-click='pageChanged'
  66. @current-change='pageChanged'
  67. ></el-pagination>
  68. </div>
  69. <!-- 标准表格详情钻取表 -->
  70. <el-dialog width='1260px' title='标准设备展开清单' style='height:900px!important;overflow: hidden;' :visible.sync='innerVisible' append-to-body>
  71. <eq-detail ref='qdDialog' :row='row' :major='major'></eq-detail>
  72. </el-dialog>
  73. </div>
  74. </template>
  75. <script>
  76. import Select from '@/components/Select/Select.vue'
  77. import EqDetail from './eqDetaileDialog'
  78. import { queryEquipmentList } from '@/api/equipmentList.js'
  79. import { mapGetters } from 'vuex'
  80. export default {
  81. components: { Select, EqDetail },
  82. data() {
  83. return {
  84. dataSelect2: [
  85. { id: 'test1', name: '选择项' },
  86. { id: 'test2', name: '单平米' },
  87. { id: 'test3', name: '下级分项' },
  88. { id: 'test4', name: '滑动平均滑动平均' }
  89. ],
  90. tableData: [],
  91. total: 0,
  92. currentPage: 1,
  93. size: 10,
  94. innerVisible: false, //详情弹框
  95. keyword: '',
  96. manufacturer: '',
  97. sbjc: '',
  98. row: {},
  99. floor: ''
  100. }
  101. },
  102. computed: {
  103. ...mapGetters(['floorSelect'])
  104. },
  105. props: ['param', 'major'],
  106. methods: {
  107. rowHandle(row) {
  108. console.log(row)
  109. this.innerVisible = true
  110. this.row = row
  111. },
  112. pageChanged(page) {
  113. this.currentPage = page
  114. this.getList()
  115. },
  116. getList() {
  117. let postParams = {
  118. tab_code: this.param
  119. }
  120. let data = {
  121. page: this.currentPage,
  122. size: this.size,
  123. plazaId: this.$store.state.plazaId,
  124. major: this.major
  125. }
  126. //下拉
  127. if (this.floor) {
  128. postParams.floor = this.floor
  129. }
  130. //输入框搜索
  131. data.keyword = ''
  132. if (this.keyword) {
  133. data.keyword += `${this.keyword}:brand,sbxh;`
  134. }
  135. if (this.sbjc) {
  136. data.keyword += `${this.sbjc}:sbjc;`
  137. }
  138. if (this.manufacturer) {
  139. data.keyword += `${this.manufacturer}:manufacturer;`
  140. }
  141. if (data.keyword == '') {
  142. delete data.keyword
  143. }
  144. queryEquipmentList({ data, postParams }).then(res => {
  145. console.log(res)
  146. this.tableData = res.data.data
  147. this.total = res.data.count
  148. })
  149. }
  150. },
  151. watch: {
  152. param(newV, oldV) {
  153. if (newV !== oldV) {
  154. this.getList()
  155. }
  156. }
  157. },
  158. mounted() {
  159. this.getList()
  160. }
  161. }
  162. </script>
  163. <style lang="less" scoped>
  164. .eq-list {
  165. .eq-list-top {
  166. display: flex;
  167. margin-bottom: 12px;
  168. }
  169. td {
  170. overflow: hidden;
  171. white-space: nowrap;
  172. text-overflow: ellipsis;
  173. }
  174. .foot {
  175. height: 32px;
  176. display: flex;
  177. justify-content: flex-end;
  178. margin-top: 28px;
  179. }
  180. }
  181. </style>