eqDetaileDialog.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  1. <template>
  2. <!-- 详情页面 -->
  3. <div class='gdqd-dialog'>
  4. <div class='top'></div>
  5. <div class='gdqd-top'>
  6. <div class='gdqd-dialog-top'>
  7. <el-input
  8. placeholder='搜索设备简称编号'
  9. style='width:192px;margin-right:12px'
  10. size='small'
  11. prefix-icon='el-icon-search'
  12. v-model='sbjc'
  13. clearable
  14. @keyup.enter.native='queryTableList'
  15. @blur='queryTableList'
  16. ></el-input>
  17. <Select v-model='sbglgs' width='180' tipPlace='top' caption='管理归属:' size='small' :selectdata='sbglgsOption' @change='queryTableList'></Select>
  18. <Select
  19. width='160'
  20. style='margin: 0 12px;'
  21. v-model='status'
  22. tipPlace='top'
  23. caption='设备状态:'
  24. size='small'
  25. :selectdata='statusOption'
  26. @change='queryTableList'
  27. ></Select>
  28. <el-input
  29. placeholder='搜索品牌、型号'
  30. style='width:180px;margin-right:12px'
  31. size='small'
  32. clearable
  33. prefix-icon='el-icon-search'
  34. v-model='brand'
  35. @keyup.enter.native='queryTableList'
  36. @blur='queryTableList'
  37. ></el-input>
  38. <Select
  39. width='150'
  40. style='margin-right:12px;'
  41. v-model='floor'
  42. tipPlace='top'
  43. caption='楼层:'
  44. size='small'
  45. :selectdata='floorAllSelect'
  46. @change='queryTableList'
  47. ></Select>
  48. <el-input
  49. placeholder='搜索安装位置'
  50. @keyup.enter.native='queryTableList'
  51. @blur='queryTableList'
  52. clearable
  53. style='width:180px;margin-right:12px'
  54. size='small'
  55. prefix-icon='el-icon-search'
  56. v-model='wzjc'
  57. ></el-input>
  58. <!-- 多余的筛选 -->
  59. <input-dialog :type='1' @confirm='confirm'></input-dialog>
  60. </div>
  61. <div class='gdqd-dialog-bottom'>
  62. <el-table @row-click='innerTable' :data='tableData' :key='key' :border='true' style='width: 100%' :highlight-current-row='true'>
  63. <el-table-column type='index' label='序号' width='60'></el-table-column>
  64. <el-table-column prop='sbjc' label='设备名称' show-overflow-tooltip resizable min-width='150'>
  65. <template slot-scope='{row}'>{{row.sbjc || '--'}}</template>
  66. </el-table-column>
  67. <el-table-column prop='assetnum' label='设备内码' show-overflow-tooltip resizable width='80'>
  68. <template slot-scope='{row}'>{{row.assetnum || '--'}}</template>
  69. </el-table-column>
  70. <el-table-column prop='sbglgs' label='管理归属' show-overflow-tooltip resizable>
  71. <template slot-scope='{row}'>{{row.sbglgs || '--'}}</template>
  72. </el-table-column>
  73. <el-table-column prop='sb_status' label='设备状态' width='80' show-overflow-tooltip resizable>
  74. <template slot-scope='{row}'>{{row.sb_status || '--'}}</template>
  75. </el-table-column>
  76. <el-table-column prop='brand' label='品牌' show-overflow-tooltip resizable width='80'>
  77. <template slot-scope='{row}'>{{row.brand || '--'}}</template>
  78. </el-table-column>
  79. <el-table-column prop='sbxh' label='型号' show-overflow-tooltip resizable width='80'>
  80. <template slot-scope='{row}'>{{row.sbxh || '--'}}</template>
  81. </el-table-column>
  82. <el-table-column prop='floor' sortable label='楼层' width='70' show-overflow-tooltip resizable>
  83. <template slot-scope='{row}'>{{row.floorcode || '--'}}</template>
  84. </el-table-column>
  85. <el-table-column prop='wzjc' label='安装位置' show-overflow-tooltip resizable min-width='150'>
  86. <template slot-scope='{row}'>{{row.wzjc || '--'}}</template>
  87. </el-table-column>
  88. <el-table-column prop='manufacturer' label='生产厂商' show-overflow-tooltip resizable min-width='150'>
  89. <template slot-scope='{row}'>{{row.manufacturer || '--'}}</template>
  90. </el-table-column>
  91. <el-table-column prop='fws' label='服务商' show-overflow-tooltip resizable min-width='150'>
  92. <template slot-scope='{row}'>{{row.fws || '--'}}</template>
  93. </el-table-column>
  94. <el-table-column prop label='相关资料' show-overflow-tooltip resizable min-width='150'>
  95. <template slot-scope='{row}'>{{'--'}}</template>
  96. </el-table-column>
  97. </el-table>
  98. </div>
  99. </div>
  100. <!-- 底部表格 -->
  101. <div class='table-bottom'>
  102. <!-- 页签切换 -->
  103. <div class='title'>
  104. <div class='text'>维保:</div>
  105. <div class='d-tab d-tab-left' :class='{active:currentTab === 0}' @click='changeTab(0)'>重要维保</div>
  106. <div class='d-tab d-tab-right' :class='{active:currentTab === 1}' @click='changeTab(1)'>日常维保</div>
  107. <div class='text text-r'>维修:</div>
  108. <div class='d-tab d-tab-left' :class='{active:currentTab === 2}' @click='changeTab(2)'>重要维修</div>
  109. <div class='d-tab d-tab-right' :class='{active:currentTab === 3}' @click='changeTab(3)'>日常维修</div>
  110. </div>
  111. <!-- 动态显示各个表格组件 : 'wbTable', 'rcwbTable', 'wxTable', 'rcwxTable' -->
  112. <div class='table2-container'>
  113. <component
  114. v-if='Object.keys(this.row).length>0'
  115. :is='currentComponent'
  116. :ref='currentComponent'
  117. :smsxt='smsxt'
  118. :tabLabel='tabLabel[currentComponent]'
  119. :diff='diff'
  120. :assetnum='assetnum'
  121. :size='5'
  122. ></component>
  123. </div>
  124. </div>
  125. </div>
  126. </template>
  127. <script>
  128. import { Select } from 'meri-design'
  129. import { mapGetters } from 'vuex'
  130. import { queryAsset } from '@/api/equipmentList.js'
  131. import { querySelect } from '@/api/public.js'
  132. import inputDialog from './inputDIalog'
  133. import rcwbTable from './rcwbTable'
  134. import wbTable from './wbTable'
  135. import rcwxTable from './rcwxTable'
  136. import wxTable from './wxTable'
  137. export default {
  138. data() {
  139. return {
  140. tableData: [],
  141. sbjc: '',
  142. brand: '',
  143. wzjc: '',
  144. floor: '1',
  145. status: '1',
  146. manufacturer: '',
  147. fws: '',
  148. sbglgs: '1',
  149. sbglgsOption: [],
  150. statusOption: [],
  151. floorAllSelect: [],
  152. activeId: '1',
  153. activeName1: 'wb1',
  154. activeName2: '',
  155. visible: false,
  156. key: 0,
  157. assetnum: '', //区分设备的维修和维保关键
  158. currentTab: 0, //选中页签,默认重要维保
  159. currentComponent: 'wbTable', //选中的组件,默认 重要维保
  160. componentArr: ['wbTable', 'rcwbTable', 'wxTable', 'rcwxTable'], //下部表格组件列表
  161. tabLabel: {
  162. //下部表格组件列表使用label
  163. wbTable: '重要维保',
  164. rcwbTable: '日常维保',
  165. wxTable: '重要维修',
  166. rcwxTable: '日常维保',
  167. },
  168. }
  169. },
  170. components: {
  171. Select,
  172. inputDialog,
  173. rcwbTable,
  174. wbTable,
  175. rcwxTable,
  176. wxTable,
  177. },
  178. computed: {
  179. ...mapGetters(['floorSelect']),
  180. },
  181. props: ['row', 'major', 'sign', 'smsxt', 'diff'],
  182. mounted() {
  183. this.assetnum = this.row.assetnum
  184. this.changeTab(0)
  185. this.queryTableList()
  186. this.tabFind()
  187. this.getFloorAllSelect()
  188. },
  189. methods: {
  190. tabClick(item) {
  191. this.activeId = item
  192. },
  193. innerTable(row) {
  194. this.assetnum = row.assetnum
  195. this.changeTab(0)
  196. // this.$refs.wbTable.startMethods()
  197. if (row.assetuid) {
  198. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=assetdevic&uniqueid=${row.assetuid}`)
  199. }
  200. },
  201. //多余输入框监听
  202. confirm(fws, manufacturer) {
  203. //console.log(fws, manufacturer, '------')
  204. this.fws = fws
  205. this.manufacturer = manufacturer
  206. this.queryTableList()
  207. },
  208. //下拉框查询
  209. tabFind() {
  210. let postParams = [
  211. {
  212. columnName: { sbglgs: 'sbglgs', sb_status: 'sb_status' },
  213. params: {
  214. type_code: this.row.type_code,
  215. },
  216. tableName: 'sms_asset', //视图名称
  217. },
  218. ]
  219. let major
  220. if (this.major.slice(0, 2) == 'GD') {
  221. major = '供电'
  222. } else if (this.major.slice(0, 2) == 'XF') {
  223. major = '消防'
  224. } else if (this.major.slice(0, 2) == 'GPS') {
  225. major = '给排水'
  226. } else if (this.major.slice(0, 2) == 'DT') {
  227. major = '电梯'
  228. } else if (this.major.slice(0, 2) == 'RQ') {
  229. major = '燃气'
  230. } else {
  231. major = this.major
  232. }
  233. let data = {
  234. major: major,
  235. plazaId: this.$store.state.plazaId,
  236. }
  237. if (major != '土建') {
  238. data.onlyMainAsset = true
  239. }
  240. querySelect({ data, postParams }).then((res) => {
  241. //console.log(res)
  242. let sb_status = res.data.data.sms_asset.sb_status
  243. let sbglgs = res.data.data.sms_asset.sbglgs
  244. this.sbglgsOption = []
  245. this.sbglgsOption.push({
  246. name: '全部',
  247. id: '1',
  248. })
  249. this.statusOption = []
  250. this.statusOption.push({
  251. name: '全部',
  252. id: '1',
  253. })
  254. sb_status.forEach((el) => {
  255. this.statusOption.push({
  256. name: el.value,
  257. id: el.key,
  258. })
  259. })
  260. sbglgs.forEach((el) => {
  261. this.sbglgsOption.push({
  262. name: el.value,
  263. id: el.key,
  264. })
  265. })
  266. })
  267. },
  268. queryTableList() {
  269. let major
  270. if (this.major.slice(0, 2) == 'GD') {
  271. major = '供电'
  272. } else if (this.major.slice(0, 2) == 'XF') {
  273. major = '消防'
  274. } else if (this.major.slice(0, 2) == 'GPS') {
  275. major = '给排水'
  276. } else if (this.major.slice(0, 2) == 'DT') {
  277. major = '电梯'
  278. } else if (this.major.slice(0, 2) == 'RQ') {
  279. major = '燃气'
  280. } else {
  281. major = this.major
  282. }
  283. let data = {
  284. major: major,
  285. plazaId: this.$store.state.plazaId,
  286. }
  287. //区分主要设备
  288. if (this.major != '土建') {
  289. data.onlyMainAsset = true
  290. }
  291. //输入框搜索
  292. data.keyword = ''
  293. if (this.sbjc) {
  294. data.keyword += `${this.sbjc}:sbjc,assetnum;`
  295. }
  296. if (this.brand) {
  297. data.keyword += `${this.brand}:brand,sbxh;`
  298. }
  299. if (this.wzjc) {
  300. data.keyword += `${this.wzjc}:wzjc;`
  301. }
  302. if (this.manufacturer) {
  303. data.keyword += `${this.manufacturer}:manufacturer;`
  304. }
  305. if (this.fws) {
  306. data.keyword += `${this.fws}:fws;`
  307. }
  308. if (data.keyword == '') {
  309. delete data.keyword
  310. }
  311. let postParams = {
  312. classstructureid: this.row.classstructureid,
  313. type_code: this.row.type_code,
  314. manufacturer: this.row.manufacturer || '--',
  315. sbxh: this.row.sbxh || '--',
  316. brand: this.row.brand || '--',
  317. }
  318. //下拉筛选
  319. if (this.floor && this.floor != 1) {
  320. postParams.gname = this.floor
  321. }
  322. if (this.sbglgs && this.sbglgs != 1) {
  323. postParams.sbglgs = this.sbglgs
  324. }
  325. if (this.status && this.status != 1) {
  326. postParams.status = this.status
  327. }
  328. queryAsset({ data, postParams }).then((res) => {
  329. console.log(res)
  330. this.tableData = res.data.data
  331. this.total = res.data.count
  332. this.key++
  333. })
  334. },
  335. getFloorAllSelect() {
  336. this.floorAllSelect = []
  337. this.floorAllSelect.push({
  338. id: '1',
  339. name: '全部',
  340. })
  341. this.floorSelect.forEach((el) => {
  342. this.floorAllSelect.push(el)
  343. })
  344. console.log(this.floorAllSelect)
  345. },
  346. changePageEvent() {
  347. if (this.sign == 1) {
  348. this.page = 1
  349. }
  350. },
  351. // 更改tab页签,切换组件
  352. changeTab(index) {
  353. this.currentTab = index
  354. this.currentComponent = this.componentArr[index]
  355. // --- 不需要执行,动态组件会自动执行
  356. //如果有组件,执行表格组件的内部方法
  357. // this.$nextTick(() => {
  358. // this.$refs[this.currentComponent] && this.$refs[this.currentComponent].startMethods()
  359. // })
  360. },
  361. },
  362. watch: {
  363. row: {
  364. handler(newV, oldV) {
  365. this.changePageEvent()
  366. this.queryTableList()
  367. this.getFloorAllSelect()
  368. this.tabFind()
  369. },
  370. deep: true,
  371. },
  372. sbglgs() {
  373. this.changePageEvent()
  374. this.queryTableList()
  375. },
  376. status() {
  377. this.changePageEvent()
  378. this.queryTableList()
  379. },
  380. floor() {
  381. this.changePageEvent()
  382. this.queryTableList()
  383. },
  384. },
  385. }
  386. </script>
  387. <style lang="less" scoped>
  388. .gdqd-dialog {
  389. display: flex;
  390. flex-direction: column;
  391. height: 90vh;
  392. .gdqd-top {
  393. .gdqd-dialog-bottom {
  394. overflow: auto;
  395. max-height: 20vh;
  396. margin-top: 20px;
  397. }
  398. }
  399. .qdxq-bottom {
  400. flex: 1;
  401. .wb-title {
  402. display: flex;
  403. height: 48px;
  404. line-height: 48px;
  405. background: #f5f6f7;
  406. margin: 20px 0;
  407. padding-left: 20px;
  408. }
  409. }
  410. }
  411. @media screen and (max-width: 1600px) {
  412. .gdqd-dialog td {
  413. padding: 4px 0;
  414. }
  415. }
  416. </style>
  417. <style lang="less">
  418. .gdqd-dialog {
  419. /deep/.el-table td {
  420. cursor: pointer;
  421. }
  422. .el-dialog__header {
  423. padding: 16px 24px;
  424. color: #fff;
  425. background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
  426. }
  427. .el-dialog__headerbtn .el-dialog__close {
  428. color: #fff;
  429. }
  430. .el-dialog__title {
  431. font-size: 16px;
  432. font-family: PingFangSC-Medium, PingFang SC;
  433. font-weight: 500;
  434. color: #fff;
  435. line-height: 24px;
  436. }
  437. .qdxq-bottom {
  438. .el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),
  439. .el-tabs--bottom .el-tabs__item.is-top:nth-child(2),
  440. .el-tabs--top .el-tabs__item.is-bottom:nth-child(2),
  441. .el-tabs--top .el-tabs__item.is-top:nth-child(2) {
  442. padding-left: 16px;
  443. }
  444. .el-tabs--bottom .el-tabs__item.is-bottom:last-child,
  445. .el-tabs--bottom .el-tabs__item.is-top:last-child,
  446. .el-tabs--top .el-tabs__item.is-bottom:last-child,
  447. .el-tabs--top .el-tabs__item.is-top:last-child {
  448. padding-right: 16px;
  449. }
  450. .el-tabs__nav-wrap::after {
  451. height: 0;
  452. }
  453. .el-tabs {
  454. // height: 95vh;
  455. }
  456. .el-tabs__content {
  457. /deep/ .el-tab-pane > div {
  458. height: 100% !important;
  459. }
  460. }
  461. .is-active {
  462. color: #025baa !important;
  463. border-color: #025baa !important;
  464. }
  465. .el-tabs__item {
  466. padding: 5px 16px;
  467. height: 30px;
  468. line-height: 22px;
  469. font-size: 14px;
  470. font-family: MicrosoftYaHei;
  471. color: rgba(31, 36, 41, 1);
  472. border: 1px solid rgba(195, 199, 203, 1);
  473. }
  474. /deep/ .el-tabs__item:last-child {
  475. border-radius: 0px 4px 4px 0px;
  476. }
  477. /deep/ .el-tabs__item:nth-child(2) {
  478. border-radius: 4px 0px 0px 4px;
  479. }
  480. .el-tab-pane {
  481. height: 100% !important;
  482. }
  483. .el-tabs__active-bar {
  484. background-color: transparent !important;
  485. }
  486. }
  487. // 底部表格
  488. .table-bottom {
  489. width: 100%;
  490. flex: 1;
  491. display: flex;
  492. flex-direction: column;
  493. // tab 样式
  494. .title {
  495. display: flex;
  496. height: 70px;
  497. line-height: 30px;
  498. align-items: center;
  499. padding: 15px 0;
  500. // 维修维保文本
  501. .text {
  502. width: 50px;
  503. }
  504. .text-r {
  505. margin-left: 100px;
  506. }
  507. // tab页签
  508. .d-tab {
  509. padding: 5px 16px;
  510. height: 30px;
  511. line-height: 22px;
  512. font-size: 14px;
  513. font-family: MicrosoftYaHei;
  514. font-weight: 500;
  515. color: #1f2429;
  516. text-align: center;
  517. border: 1px solid #c3c7cb;
  518. cursor: pointer;
  519. }
  520. .d-tab-left {
  521. border-radius: 4px 0 0 4px;
  522. }
  523. .d-tab-right {
  524. border-radius: 0 4px 4px 0;
  525. }
  526. // 当前选中页签
  527. .active {
  528. color: #025baa !important;
  529. border-color: #025baa !important;
  530. }
  531. }
  532. //筛选+表格
  533. .table2-container {
  534. width: 100%;
  535. flex: 1;
  536. position: relative;
  537. }
  538. }
  539. }
  540. </style>