eqListTable.vue 6.4 KB

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