eqDetaileDialog.vue 21 KB

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