standTable.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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' :index='indexMethod'></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. tableData: [],
  92. total: 0,
  93. currentPage: 1,
  94. size: 13,
  95. keyword: '',
  96. floor: '',
  97. row: {},
  98. sbjc: '',
  99. manufacturer: ''
  100. }
  101. },
  102. props: ['major', 'param'],
  103. components: { EqDetail, Select },
  104. computed: {
  105. ...mapGetters(['floorSelect'])
  106. },
  107. methods: {
  108. indexMethod(index) {
  109. return (this.currentPage-1) * this.size + index +1
  110. },
  111. rowHandle(row) {
  112. console.log(row)
  113. this.innerVisible = true
  114. this.row = row
  115. },
  116. pageChanged(page, size) {
  117. this.currentPage = page
  118. this.getList()
  119. },
  120. getList() {
  121. let postParams = {
  122. tab_code: this.param
  123. }
  124. let major
  125. if (this.major.slice(0, 2) == 'GD') {
  126. major = '供电'
  127. } else if (this.major.slice(0, 2) == 'XF') {
  128. major = '消防'
  129. } else if (this.major.slice(0, 2) == 'GPS') {
  130. major = '给排水'
  131. } else if (this.major.slice(0, 2) == 'DT') {
  132. major = '电梯'
  133. } else if (this.major.slice(0, 2) == 'RQ') {
  134. major = '燃气'
  135. }
  136. let data = {
  137. page: this.currentPage,
  138. size: this.size,
  139. plazaId: this.$store.state.plazaId,
  140. major: major
  141. // floor:this.floor
  142. }
  143. //下拉
  144. if (this.floor) {
  145. postParams.gname = this.floor
  146. }
  147. //输入框搜索
  148. data.keyword = ''
  149. if (this.keyword) {
  150. data.keyword += `${this.keyword}:brand,sbxh;`
  151. }
  152. if (this.sbjc) {
  153. data.keyword += `${this.sbjc}:sbjc;`
  154. }
  155. if (this.manufacturer) {
  156. data.keyword += `${this.manufacturer}:manufacturer;`
  157. }
  158. if (data.keyword == '') {
  159. delete data.keyword
  160. }
  161. queryEquipmentList({ data, postParams }).then(res => {
  162. this.tableData = res.data.data
  163. this.total = res.data.count
  164. })
  165. }
  166. },
  167. watch: {
  168. param(newV, oldV) {
  169. if (newV !== oldV) {
  170. this.getList()
  171. }
  172. },
  173. floor(newV, oldV) {
  174. console.log(newV, oldV)
  175. this.getList()
  176. }
  177. },
  178. mounted() {
  179. this.floor = this.$cookie.get('floorMapId')
  180. this.getList()
  181. }
  182. }
  183. </script>
  184. <style lang="less" scoped>
  185. .stand-list {
  186. .eq-list-top {
  187. display: flex;
  188. margin-bottom: 12px;
  189. }
  190. td {
  191. overflow: hidden;
  192. text-overflow: ellipsis;
  193. white-space: nowrap;
  194. }
  195. .foot {
  196. height: 32px;
  197. display: flex;
  198. justify-content: flex-end;
  199. margin-top: 28px;
  200. }
  201. }
  202. </style>