standTable.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <!-- 设备清单的有select的表格 无tab的标准设备表格 -->
  2. <template>
  3. <div class='stand-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. clearable
  18. @blur='getList'
  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. clearable
  26. placeholder='搜索生产厂商'
  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' :border='true' style='width: 100%' @row-click='rowHandle'>
  35. <el-table-column type='index' label='序号' width='80'></el-table-column>
  36. <el-table-column prop='sbjc' label='设备名称' show-overflow-tooltip resizable>
  37. <template slot-scope='{row}'>{{row.sbjc || '--'}}</template>
  38. </el-table-column>
  39. <!-- sbjc -->
  40. <el-table-column prop='sl' label='数量'>
  41. <template slot-scope='{row}'>{{row.sl || '--'}}</template>
  42. </el-table-column>
  43. <el-table-column prop='brand' label='品牌'>
  44. <template slot-scope='{row}'>{{row.brand || '--'}}</template>
  45. </el-table-column>
  46. <el-table-column prop='sbxh' label='型号' show-overflow-tooltip resizable>
  47. <template slot-scope='{row}'>{{row.sbxh || '--'}}</template>
  48. </el-table-column>
  49. <el-table-column prop='floor' label='楼层'>
  50. <template slot-scope='{row}'>{{row.floor || '--'}}</template>
  51. </el-table-column>
  52. <el-table-column prop='manufacturer' label='生产厂商' show-overflow-tooltip resizable>
  53. <template slot-scope='{row}'>{{row.manufacturer || '--'}}</template>
  54. </el-table-column>
  55. </el-table>
  56. <div class='foot'>
  57. <el-pagination
  58. background
  59. layout='prev, pager, next'
  60. :total='total'
  61. :page-size='size'
  62. @prev-click='pageChanged'
  63. @next-click='pageChanged'
  64. @current-change='pageChanged'
  65. ></el-pagination>
  66. </div>
  67. <!-- 标准表格详情钻取表 -->
  68. <el-dialog width='1260px' style='height:900px;overflow: hidden;' title='标准设备展开清单' :visible.sync='innerVisible' append-to-body>
  69. <eq-detail ref='qdDialog' :row='row' :major='major'></eq-detail>
  70. </el-dialog>
  71. </div>
  72. </template>
  73. <script>
  74. import { queryEquipmentList } from '@/api/equipmentList.js'
  75. import EqDetail from './eqDetaileDialog'
  76. import Select from '@/components/Select/Select.vue'
  77. import { mapGetters } from 'vuex'
  78. export default {
  79. data() {
  80. return {
  81. innerVisible: false,
  82. pageSize: 10,
  83. tableData: [],
  84. total: 0,
  85. currentPage: 1,
  86. size: 11,
  87. keyword: '',
  88. floor: '',
  89. row: {},
  90. sbjc: '',
  91. manufacturer: ''
  92. }
  93. },
  94. props: ['major', 'param'],
  95. components: { EqDetail, Select },
  96. computed: {
  97. ...mapGetters(['floorSelect'])
  98. },
  99. methods: {
  100. rowHandle(row) {
  101. console.log(row)
  102. this.innerVisible = true
  103. this.row = row
  104. },
  105. pageChanged(page, size) {
  106. this.currentPage = page
  107. this.getList()
  108. },
  109. getList() {
  110. let postParams = {
  111. tab_code: this.param
  112. }
  113. let major
  114. if (this.major.slice(0, 2) == 'GD') {
  115. major = '供电'
  116. } else if (this.major.slice(0, 2) == 'XF') {
  117. major = '消防'
  118. } else if (this.major.slice(0, 2) == 'GPS') {
  119. major = '给排水'
  120. } else if (this.major.slice(0, 2) == 'DT') {
  121. major = '电梯'
  122. } else if (this.major.slice(0, 2) == 'RQ') {
  123. major = '燃气'
  124. }
  125. let data = {
  126. page: this.currentPage,
  127. size: this.size,
  128. plazaId: this.$store.state.plazaId,
  129. major: major
  130. // floor:this.floor
  131. }
  132. //下拉
  133. if (this.floor) {
  134. data.floor = 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. this.tableData = res.data.data
  152. this.total = res.data.count
  153. })
  154. }
  155. },
  156. watch: {
  157. param(newV, oldV) {
  158. if (newV !== oldV) {
  159. this.getList()
  160. }
  161. }
  162. },
  163. mounted() {
  164. this.getList()
  165. }
  166. }
  167. </script>
  168. <style lang="less" scoped>
  169. .stand-list {
  170. .eq-list-top {
  171. display: flex;
  172. margin-bottom: 12px;
  173. }
  174. td {
  175. overflow: hidden;
  176. text-overflow: ellipsis;
  177. white-space: nowrap;
  178. }
  179. .foot {
  180. height: 32px;
  181. display: flex;
  182. justify-content: flex-end;
  183. margin-top: 28px;
  184. }
  185. }
  186. </style>