eqDetaileDialog.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  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:192px;margin-right:12px'
  9. size='small'
  10. prefix-icon='el-icon-search'
  11. v-model='sbjc'
  12. clearable
  13. @keyup.enter.native='queryTableList'
  14. @blur='queryTableList'
  15. ></el-input>
  16. <Select v-model='sbglgs' width='180' tipPlace='top' caption='管理归属:' size='small' :selectdata='sbglgsOption' @change='queryTableList'></Select>
  17. <Select
  18. width='160'
  19. style='margin: 0 12px;'
  20. v-model='status'
  21. tipPlace='top'
  22. caption='设备状态:'
  23. size='small'
  24. :selectdata='statusOption'
  25. @change='queryTableList'
  26. ></Select>
  27. <el-input
  28. placeholder='搜索品牌、型号'
  29. style='width:180px;margin-right:12px'
  30. size='small'
  31. clearable
  32. prefix-icon='el-icon-search'
  33. v-model='brand'
  34. @keyup.enter.native='queryTableList'
  35. @blur='queryTableList'
  36. ></el-input>
  37. <Select
  38. width='150'
  39. style='margin-right:12px;'
  40. v-model='floor'
  41. tipPlace='top'
  42. caption='楼层:'
  43. size='small'
  44. :selectdata='floorAllSelect'
  45. @change='queryTableList'
  46. ></Select>
  47. <el-input
  48. placeholder='搜索安装位置'
  49. @keyup.enter.native='queryTableList'
  50. @blur='queryTableList'
  51. clearable
  52. style='width:180px;margin-right:12px'
  53. size='small'
  54. prefix-icon='el-icon-search'
  55. v-model='wzjc'
  56. ></el-input>
  57. <!-- 多余的筛选 -->
  58. <input-dialog :type='1' @confirm='confirm'></input-dialog>
  59. </div>
  60. <el-table @row-click='innerTable' :data='tableData' :border='true' style='width: 100%;amrgin-bottom:30px'>
  61. <el-table-column type='index' label='序号' width='60' :index='indexMethod'></el-table-column>
  62. <el-table-column prop='sbjc' label='设备名称' show-overflow-tooltip resizable width='230'>
  63. <template slot-scope='{row}'>{{row.sbjc || '--'}}</template>
  64. </el-table-column>
  65. <el-table-column prop='assetnum' label='设备内码' show-overflow-tooltip resizable width='80'>
  66. <template slot-scope='{row}'>{{row.assetnum || '--'}}</template>
  67. </el-table-column>
  68. <el-table-column prop='sl' label='数量' width='80'>
  69. <template slot-scope='{row}'>{{row.sl>=0?row.sl:'--'}}</template>
  70. </el-table-column>
  71. <el-table-column prop='sbglgs' label='管理归属' show-overflow-tooltip resizable>
  72. <template slot-scope='{row}'>{{row.sbglgs || '--'}}</template>
  73. </el-table-column>
  74. <el-table-column prop='sb_status' label='设备状态' width='80'>
  75. <template slot-scope='{row}'>{{row.sb_status || '--'}}</template>
  76. </el-table-column>
  77. <el-table-column prop='brand' label='品牌' show-overflow-tooltip resizable width='80'>
  78. <template slot-scope='{row}'>{{row.brand || '--'}}</template>
  79. </el-table-column>
  80. <el-table-column prop='sbxh' label='型号' show-overflow-tooltip resizable width='80'>
  81. <template slot-scope='{row}'>{{row.sbxh || '--'}}</template>
  82. </el-table-column>
  83. <el-table-column prop='floor' sortable label='楼层' width='80'>
  84. <template slot-scope='{row}'>{{row.floorcode || '--'}}</template>
  85. </el-table-column>
  86. <el-table-column prop='wzjc' label='安装位置' show-overflow-tooltip resizable min-width='150'>
  87. <template slot-scope='{row}'>{{row.wzjc || '--'}}</template>
  88. </el-table-column>
  89. <el-table-column prop='manufacturer' label='生产厂商' show-overflow-tooltip resizable min-width='150'>
  90. <template slot-scope='{row}'>{{row.manufacturer || '--'}}</template>
  91. </el-table-column>
  92. <el-table-column prop='fws' label='服务商' show-overflow-tooltip resizable width='200'>
  93. <template slot-scope='{row}'>{{row.fws || '--'}}</template>
  94. </el-table-column>
  95. <el-table-column prop label='相关资料' show-overflow-tooltip resizable width='100'>
  96. <template slot-scope='{row}'>{{'--'}}</template>
  97. </el-table-column>
  98. </el-table>
  99. <div class='foot'>
  100. <el-pagination
  101. background
  102. layout='prev, pager, next'
  103. :total='total'
  104. :page-size='size'
  105. @prev-click='pageChanged'
  106. @next-click='pageChanged'
  107. @current-change='pageChanged'
  108. ></el-pagination>
  109. </div>
  110. </div>
  111. </template>
  112. <script>
  113. import { Select } from 'meri-design'
  114. import { mapGetters } from 'vuex'
  115. import { queryAsset } from '@/api/equipmentList.js'
  116. import { querySelect } from '@/api/public.js'
  117. import inputDialog from './inputDIalog'
  118. export default {
  119. data() {
  120. return {
  121. tableData: [],
  122. dataSelect2: [
  123. { id: 'test1', name: '选择项' },
  124. { id: 'test2', name: '单平米' },
  125. { id: 'test3', name: '下级分项' },
  126. { id: 'test4', name: '滑动平均滑动平均' }
  127. ],
  128. page: 1,
  129. size: 10,
  130. total: 1,
  131. sbjc: '',
  132. brand: '',
  133. wzjc: '',
  134. floor: '1',
  135. status: '1',
  136. manufacturer: '',
  137. fws: '',
  138. sbglgs: '1',
  139. sbglgsOption: [],
  140. statusOption: [],
  141. floorAllSelect: []
  142. }
  143. },
  144. components: {
  145. Select,
  146. inputDialog
  147. },
  148. computed: {
  149. ...mapGetters(['floorSelect'])
  150. },
  151. props: ['row', 'major'],
  152. mounted() {
  153. this.queryTableList()
  154. this.tabFind()
  155. this.getFloorAllSelect()
  156. },
  157. methods: {
  158. innerTable(row) {
  159. console.log(row)
  160. if (row.assetuid) {
  161. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=assetdevic&uniqueid=${row.assetuid}`)
  162. }
  163. },
  164. //序号的方法
  165. indexMethod(index) {
  166. return (this.page - 1) * this.size + index + 1
  167. },
  168. //多余输入框监听
  169. confirm(fws, manufacturer) {
  170. //console.log(fws, manufacturer, '------')
  171. this.fws = fws
  172. this.manufacturer = manufacturer
  173. this.queryTableList()
  174. },
  175. //下拉框查询
  176. tabFind() {
  177. let postParams = [
  178. {
  179. columnName: { sbglgs: 'sbglgs', sb_status: 'sb_status' },
  180. params: {
  181. type_code: this.row.type_code
  182. },
  183. tableName: 'sms_asset' //视图名称
  184. }
  185. ]
  186. let major
  187. if (this.major.slice(0, 2) == 'GD') {
  188. major = '供电'
  189. } else if (this.major.slice(0, 2) == 'XF') {
  190. major = '消防'
  191. } else if (this.major.slice(0, 2) == 'GPS') {
  192. major = '给排水'
  193. } else if (this.major.slice(0, 2) == 'DT') {
  194. major = '电梯'
  195. } else if (this.major.slice(0, 2) == 'RQ') {
  196. major = '燃气'
  197. } else {
  198. major = this.major
  199. }
  200. let data = {
  201. major: major,
  202. plazaId: this.$store.state.plazaId
  203. }
  204. querySelect({ data, postParams }).then(res => {
  205. //console.log(res)
  206. let sb_status = res.data.data.sms_asset.sb_status
  207. let sbglgs = res.data.data.sms_asset.sbglgs
  208. this.sbglgsOption = []
  209. this.sbglgsOption.push({
  210. name: '全部',
  211. id: '1'
  212. })
  213. this.statusOption = []
  214. this.statusOption.push({
  215. name: '全部',
  216. id: '1'
  217. })
  218. sb_status.forEach(el => {
  219. this.statusOption.push({
  220. name: el.value,
  221. id: el.key
  222. })
  223. })
  224. sbglgs.forEach(el => {
  225. this.sbglgsOption.push({
  226. name: el.value,
  227. id: el.key
  228. })
  229. })
  230. })
  231. },
  232. pageChanged(page) {
  233. this.page = page
  234. this.queryTableList()
  235. },
  236. queryTableList() {
  237. let major
  238. if (this.major.slice(0, 2) == 'GD') {
  239. major = '供电'
  240. } else if (this.major.slice(0, 2) == 'XF') {
  241. major = '消防'
  242. } else if (this.major.slice(0, 2) == 'GPS') {
  243. major = '给排水'
  244. } else if (this.major.slice(0, 2) == 'DT') {
  245. major = '电梯'
  246. } else if (this.major.slice(0, 2) == 'RQ') {
  247. major = '燃气'
  248. } else {
  249. major = this.major
  250. }
  251. let data = {
  252. major: major,
  253. plazaId: this.$store.state.plazaId,
  254. page: this.page,
  255. size: this.size
  256. }
  257. //输入框搜索
  258. data.keyword = ''
  259. if (this.sbjc) {
  260. data.keyword += `${this.sbjc}:sbjc,assetnum;`
  261. }
  262. if (this.brand) {
  263. data.keyword += `${this.brand}:brand,sbxh;`
  264. }
  265. if (this.wzjc) {
  266. data.keyword += `${this.wzjc}:wzjc;`
  267. }
  268. if (this.manufacturer) {
  269. data.keyword += `${this.manufacturer}:manufacturer;`
  270. }
  271. if (this.fws) {
  272. data.keyword += `${this.fws}:fws;`
  273. }
  274. if (data.keyword == '') {
  275. delete data.keyword
  276. }
  277. let postParams = {
  278. classstructureid: this.row.classstructureid,
  279. type_code: this.row.type_code,
  280. manufacturer: this.row.manufacturer || '--',
  281. sbxh: this.row.sbxh || '--',
  282. brand: this.row.brand || '--'
  283. }
  284. //下拉筛选
  285. if (this.floor && this.floor != 1) {
  286. postParams.gname = this.floor
  287. }
  288. if (this.sbglgs && this.sbglgs != 1) {
  289. postParams.sbglgs = this.sbglgs
  290. }
  291. if (this.status && this.status != 1) {
  292. postParams.status = this.status
  293. }
  294. queryAsset({ data, postParams }).then(res => {
  295. //console.log(res)
  296. this.tableData = res.data.data
  297. this.total = res.data.count
  298. })
  299. },
  300. getFloorAllSelect() {
  301. this.floorAllSelect = []
  302. this.floorAllSelect.push({
  303. id: '1',
  304. name: '全部'
  305. })
  306. this.floorSelect.forEach(el => {
  307. this.floorAllSelect.push(el)
  308. })
  309. console.log(this.floorAllSelect)
  310. }
  311. },
  312. watch: {
  313. row: {
  314. handler(newV, oldV) {
  315. this.queryTableList()
  316. this.getFloorAllSelect()
  317. this.tabFind()
  318. },
  319. deep: true
  320. },
  321. sbglgs() {
  322. this.queryTableList()
  323. },
  324. status() {
  325. this.queryTableList()
  326. },
  327. floor() {
  328. this.queryTableList()
  329. }
  330. }
  331. }
  332. </script>
  333. <style lang="less" scoped>
  334. .gdqd-dialog {
  335. // padding: 16px 24px 40px;
  336. // height: 610px;
  337. .gdqd-dialog-top {
  338. display: flex;
  339. margin-bottom: 12px;
  340. }
  341. td {
  342. overflow: hidden;
  343. text-overflow: ellipsis;
  344. white-space: nowrap;
  345. }
  346. .foot {
  347. height: 32px;
  348. display: flex;
  349. justify-content: flex-end;
  350. margin-top: 28px;
  351. }
  352. }
  353. @media screen and (max-width: 1600px) {
  354. .gdqd-dialog td {
  355. padding: 4px 0;
  356. }
  357. }
  358. </style>
  359. <style lang="less">
  360. .gdqd-dialog {
  361. /deep/.el-table tr {
  362. cursor: pointer;
  363. }
  364. }
  365. </style>