eqListTable.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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='60'></el-table-column>
  36. <el-table-column prop='type_name' label='设备名称' show-overflow-tooltip resizable width="250">
  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>=0?row.sl:'--'}}</template>
  41. </el-table-column>
  42. <el-table-column prop='brand' label='品牌' width="120">
  43. <template slot-scope='{row}'>{{row.brand || '--'}}</template>
  44. </el-table-column>
  45. <el-table-column prop='sbxh' label='型号' show-overflow-tooltip resizable width="150">
  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.floorcode || '--'}}</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. tableData: [],
  85. total: 0,
  86. currentPage: 1,
  87. size: 11,
  88. innerVisible: false, //详情弹框
  89. keyword: '',
  90. manufacturer: '',
  91. sbjc: '',
  92. row: {},
  93. floor: ''
  94. }
  95. },
  96. computed: {
  97. ...mapGetters(['floorSelect'])
  98. },
  99. props: ['param', 'major'],
  100. methods: {
  101. rowHandle(row) {
  102. //console.log(row)
  103. this.innerVisible = true
  104. this.row = row
  105. },
  106. pageChanged(page) {
  107. this.currentPage = page
  108. this.getList()
  109. },
  110. getList() {
  111. let postParams = {
  112. tab_code: this.param
  113. }
  114. let data = {
  115. page: this.currentPage,
  116. size: this.size,
  117. plazaId: this.$store.state.plazaId,
  118. major: this.major
  119. }
  120. //下拉
  121. if (this.floor) {
  122. console.log(this.floor)
  123. postParams.gname = this.floor
  124. }
  125. console.log(this.floor)
  126. //输入框搜索
  127. data.keyword = ''
  128. if (this.keyword) {
  129. data.keyword += `${this.keyword}:brand,sbxh;`
  130. }
  131. if (this.sbjc) {
  132. data.keyword += `${this.sbjc}:sbjc;`
  133. }
  134. if (this.manufacturer) {
  135. data.keyword += `${this.manufacturer}:manufacturer;`
  136. }
  137. if (data.keyword == '') {
  138. delete data.keyword
  139. }
  140. queryEquipmentList({ data, postParams }).then(res => {
  141. //console.log(res)
  142. this.tableData = res.data.data
  143. this.total = res.data.count
  144. })
  145. }
  146. },
  147. watch: {
  148. param(newV, oldV) {
  149. console.log(newV, oldV)
  150. if (newV !== oldV) {
  151. this.getList()
  152. }
  153. }
  154. },
  155. mounted() {
  156. this.getList()
  157. console.log(this.param)
  158. }
  159. }
  160. </script>
  161. <style lang="less" scoped>
  162. .eq-list {
  163. .eq-list-top {
  164. display: flex;
  165. margin-bottom: 12px;
  166. }
  167. td {
  168. overflow: hidden;
  169. white-space: nowrap;
  170. text-overflow: ellipsis;
  171. }
  172. .foot {
  173. height: 32px;
  174. display: flex;
  175. justify-content: flex-end;
  176. margin-top: 28px;
  177. }
  178. }
  179. </style>