eqDetaileDialog.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <!-- 详情页面 -->
  3. <div class='gdqd-dialog'>
  4. <div class='top'></div>
  5. <div class='gdqd-dialog-top'>
  6. <el-input
  7. placeholder='请输入设备简称、设备编号、品牌、型号、安装位置、生产厂商、服务商搜索'
  8. style='width:490px;margin-right:12px'
  9. size='small'
  10. prefix-icon='el-icon-search'
  11. v-model='input'
  12. ></el-input>
  13. <Select width='120' style='margin-right:12px' tipPlace='top' caption='楼层:' size='small' :selectdata='floorSelect'></Select>
  14. <Select width='224' style='margin-right:12px' tipPlace='top' caption='管理归属' size='small' :selectdata='dataSelect2'></Select>
  15. <Select width='224' tipPlace='top' caption='设备状态' size='small' :selectdata='dataSelect2'></Select>
  16. </div>
  17. <el-table :data='tableData' :border='true' style='width: 100%;amrgin-bottom:30px'>
  18. <el-table-column type='index' label='序号' width='50'></el-table-column>
  19. <el-table-column prop='sbjc' label='设备简称' width='140'></el-table-column>
  20. <el-table-column prop='sbbh' label='设备编号'></el-table-column>
  21. <el-table-column prop='sl' label='数量'></el-table-column>
  22. <el-table-column prop='glgs' label='管理归属'></el-table-column>
  23. <el-table-column prop='sbbh' label='设备状态'></el-table-column>
  24. <el-table-column prop='brand' label='品牌'></el-table-column>
  25. <el-table-column prop='sbxh' label='型号'></el-table-column>
  26. <el-table-column prop='floor' label='楼层'></el-table-column>
  27. <el-table-column prop='azwz' label='安装位置' resizable></el-table-column>
  28. <el-table-column prop='manufacturer' label='生产厂商' width='240'></el-table-column>
  29. <el-table-column prop='fws' label='服务商' width='240'></el-table-column>
  30. </el-table>
  31. <div class='foot'>
  32. <el-pagination
  33. background
  34. layout='prev, pager, next'
  35. :total='total'
  36. :page-size='size'
  37. @prev-click='pageChanged'
  38. @next-click='pageChanged'
  39. @current-change='pageChanged'
  40. ></el-pagination>
  41. </div>
  42. </div>
  43. </template>
  44. <script>
  45. import Select from '@/components/Select/Select.vue'
  46. import { mapGetters } from 'vuex'
  47. import { queryAsset } from '@/api/equipmentList.js'
  48. import { querySelect, queryTab } from '@/api/public.js'
  49. export default {
  50. data() {
  51. return {
  52. tableData: [],
  53. dataSelect2: [
  54. { id: 'test1', name: '选择项' },
  55. { id: 'test2', name: '单平米' },
  56. { id: 'test3', name: '下级分项' },
  57. { id: 'test4', name: '滑动平均滑动平均' }
  58. ],
  59. input: '',
  60. page: 1,
  61. size: 10,
  62. total: 1,
  63. keyword: '',
  64. floorSelect: []
  65. }
  66. },
  67. components: {
  68. Select
  69. },
  70. computed: {
  71. ...mapGetters(['floorsArr'])
  72. },
  73. props: ['row', 'major'],
  74. mounted() {
  75. this.queryTableList()
  76. this.init()
  77. this.tabFind()
  78. },
  79. methods: {
  80. //下拉框查询
  81. tabFind() {
  82. let postParams = [
  83. {
  84. params: {
  85. type_code: this.row.type_code
  86. },
  87. tableName: 'glsms_asset' //视图名称
  88. }
  89. ]
  90. let data = {
  91. major: this.major,
  92. plazaId: this.$store.state.plazaId
  93. }
  94. queryTab({ data, postParams }).then(res => {
  95. console.log(res)
  96. })
  97. },
  98. pageChanged(page) {
  99. this.page = page
  100. this.queryTableList()
  101. },
  102. queryTableList() {
  103. let major
  104. if (this.major.slice(0, 2) == 'GD') {
  105. major = '供电'
  106. } else if (this.major.slice(0, 2) == 'XF') {
  107. major = '消防'
  108. } else if (this.major.slice(0, 2) == 'GPS') {
  109. major = '给排水'
  110. } else if (this.major.slice(0, 2) == 'DT') {
  111. major = '电梯'
  112. } else if (this.major.slice(0, 2) == 'RQ') {
  113. major = '燃气'
  114. } else {
  115. major = this.major
  116. }
  117. let data = {
  118. major: major,
  119. plazaId: this.$store.state.plazaId,
  120. page: this.page,
  121. size: this.size,
  122. keyword: this.keyword
  123. }
  124. let postParams = {
  125. type_code: this.row.type_code,
  126. manufacturer: this.row.manufacturer,
  127. sbxh: this.row.sbxh,
  128. // floor: '--',
  129. brand: '--'
  130. }
  131. queryAsset({ data, postParams }).then(res => {
  132. console.log(res)
  133. this.tableData = res.data.data
  134. this.total = res.data.count
  135. })
  136. },
  137. init() {
  138. this.floorSelect = []
  139. if (this.floorsArr.length > 0) {
  140. this.floorsArr.forEach(e => {
  141. let obj = {
  142. id: e,
  143. name: e
  144. }
  145. this.floorSelect.push(obj)
  146. })
  147. }
  148. }
  149. },
  150. watch: {
  151. 'row.type_code': {
  152. handler(newV, oldV) {
  153. if (newV != oldV) {
  154. this.queryTableList()
  155. this.init()
  156. this.tabFind()
  157. }
  158. },
  159. deep: true
  160. }
  161. }
  162. }
  163. </script>
  164. <style lang="less" scoped>
  165. .gdqd-dialog {
  166. padding: 16px 24px 40px;
  167. .gdqd-dialog-top {
  168. display: flex;
  169. margin-bottom: 20px;
  170. }
  171. .foot {
  172. position: absolute;
  173. height: 32px;
  174. right: 26px;
  175. }
  176. td {
  177. overflow: hidden;
  178. text-overflow: ellipsis;
  179. white-space: nowrap;
  180. }
  181. }
  182. </style>
  183. <style lang="less">
  184. </style>