eqListTable.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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='50'></el-table-column>
  36. <el-table-column prop='type_name' label='设备名称' show-overflow-tooltip resizable width='160'>
  37. <template slot-scope='{row}'>{{row.type_name || '--'}}</template>
  38. </el-table-column>
  39. <el-table-column prop='sl' label='数量' width='100'>
  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='floorcode' label='楼层' width='100'>
  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. console.log(this.floor)
  129. postParams.floor = this.floor
  130. }
  131. console.log(this.floor)
  132. //输入框搜索
  133. data.keyword = ''
  134. if (this.keyword) {
  135. data.keyword += `${this.keyword}:brand,sbxh;`
  136. }
  137. if (this.sbjc) {
  138. data.keyword += `${this.sbjc}:sbjc;`
  139. }
  140. if (this.manufacturer) {
  141. data.keyword += `${this.manufacturer}:manufacturer;`
  142. }
  143. if (data.keyword == '') {
  144. delete data.keyword
  145. }
  146. queryEquipmentList({ data, postParams }).then(res => {
  147. //console.log(res)
  148. this.tableData = res.data.data
  149. this.total = res.data.count
  150. })
  151. }
  152. },
  153. watch: {
  154. param(newV, oldV) {
  155. console.log(newV, oldV)
  156. if (newV !== oldV) {
  157. this.getList()
  158. }
  159. }
  160. },
  161. mounted() {
  162. this.getList()
  163. console.log(this.param)
  164. }
  165. }
  166. </script>
  167. <style lang="less" scoped>
  168. .eq-list {
  169. .eq-list-top {
  170. display: flex;
  171. margin-bottom: 12px;
  172. }
  173. td {
  174. overflow: hidden;
  175. white-space: nowrap;
  176. text-overflow: ellipsis;
  177. }
  178. .foot {
  179. height: 32px;
  180. display: flex;
  181. justify-content: flex-end;
  182. margin-top: 28px;
  183. }
  184. }
  185. </style>