standTable.vue 6.5 KB

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