eqDetaileDialog.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  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. methods: {
  183. tabClick(item) {
  184. this.activeId = item
  185. },
  186. innerTable(row) {
  187. this.assetnum = row.assetnum
  188. this.changeTab(0)
  189. // this.$refs.wbTable.startMethods()
  190. if (row.assetuid) {
  191. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=assetdevic&uniqueid=${row.assetuid}`)
  192. }
  193. },
  194. //多余输入框监听
  195. confirm(fws, manufacturer) {
  196. //console.log(fws, manufacturer, '------')
  197. this.fws = fws
  198. this.manufacturer = manufacturer
  199. this.queryTableList()
  200. },
  201. //下拉框查询
  202. tabFind() {
  203. let postParams = [
  204. {
  205. columnName: { sbglgs: 'sbglgs', sb_status: 'sb_status' },
  206. params: {
  207. type_code: this.row.type_code,
  208. },
  209. tableName: 'sms_asset', //视图名称
  210. },
  211. ]
  212. let major
  213. if (this.major.slice(0, 2) == 'GD') {
  214. major = '供电'
  215. } else if (this.major.slice(0, 2) == 'XF') {
  216. major = '消防'
  217. } else if (this.major.slice(0, 2) == 'GPS') {
  218. major = '给排水'
  219. } else if (this.major.slice(0, 2) == 'DT') {
  220. major = '电梯'
  221. } else if (this.major.slice(0, 2) == 'RQ') {
  222. major = '燃气'
  223. } else {
  224. major = this.major
  225. }
  226. let data = {
  227. major: major,
  228. plazaId: this.$store.state.plazaId,
  229. }
  230. if (major != '土建') {
  231. data.onlyMainAsset = true
  232. }
  233. querySelect({ data, postParams }).then((res) => {
  234. //console.log(res)
  235. let sb_status = res.data.data.sms_asset.sb_status
  236. let sbglgs = res.data.data.sms_asset.sbglgs
  237. this.sbglgsOption = []
  238. this.sbglgsOption.push({
  239. name: '全部',
  240. id: '1',
  241. })
  242. this.statusOption = []
  243. this.statusOption.push({
  244. name: '全部',
  245. id: '1',
  246. })
  247. sb_status.forEach((el) => {
  248. this.statusOption.push({
  249. name: el.value,
  250. id: el.key,
  251. })
  252. })
  253. sbglgs.forEach((el) => {
  254. this.sbglgsOption.push({
  255. name: el.value,
  256. id: el.key,
  257. })
  258. })
  259. })
  260. },
  261. queryTableList() {
  262. let major
  263. if (this.major.slice(0, 2) == 'GD') {
  264. major = '供电'
  265. } else if (this.major.slice(0, 2) == 'XF') {
  266. major = '消防'
  267. } else if (this.major.slice(0, 2) == 'GPS') {
  268. major = '给排水'
  269. } else if (this.major.slice(0, 2) == 'DT') {
  270. major = '电梯'
  271. } else if (this.major.slice(0, 2) == 'RQ') {
  272. major = '燃气'
  273. } else {
  274. major = this.major
  275. }
  276. let data = {
  277. major: major,
  278. plazaId: this.$store.state.plazaId,
  279. }
  280. //区分主要设备
  281. if (this.major != '土建') {
  282. data.onlyMainAsset = true
  283. }
  284. //输入框搜索
  285. data.keyword = ''
  286. if (this.sbjc) {
  287. data.keyword += `${this.sbjc}:sbjc,assetnum;`
  288. }
  289. if (this.brand) {
  290. data.keyword += `${this.brand}:brand,sbxh;`
  291. }
  292. if (this.wzjc) {
  293. data.keyword += `${this.wzjc}:wzjc;`
  294. }
  295. if (this.manufacturer) {
  296. data.keyword += `${this.manufacturer}:manufacturer;`
  297. }
  298. if (this.fws) {
  299. data.keyword += `${this.fws}:fws;`
  300. }
  301. if (data.keyword == '') {
  302. delete data.keyword
  303. }
  304. let postParams = {
  305. classstructureid: this.row.classstructureid,
  306. type_code: this.row.type_code,
  307. manufacturer: this.row.manufacturer || '--',
  308. sbxh: this.row.sbxh || '--',
  309. brand: this.row.brand || '--',
  310. }
  311. //下拉筛选
  312. if (this.floor && this.floor != 1) {
  313. postParams.gname = this.floor
  314. }
  315. if (this.sbglgs && this.sbglgs != 1) {
  316. postParams.sbglgs = this.sbglgs
  317. }
  318. if (this.status && this.status != 1) {
  319. postParams.status = this.status
  320. }
  321. queryAsset({ data, postParams }).then((res) => {
  322. console.log(res)
  323. this.tableData = res.data.data
  324. this.total = res.data.count
  325. this.key++
  326. this.assetnum = this.tableData[0].assetnum
  327. this.changeTab(0)
  328. })
  329. },
  330. getFloorAllSelect() {
  331. this.floorAllSelect = []
  332. this.floorAllSelect.push({
  333. id: '1',
  334. name: '全部',
  335. })
  336. this.floorSelect.forEach((el) => {
  337. this.floorAllSelect.push(el)
  338. })
  339. console.log(this.floorAllSelect)
  340. },
  341. // 更改tab页签,切换组件
  342. changeTab(index) {
  343. this.currentTab = index
  344. this.currentComponent = this.componentArr[index]
  345. // --- 不需要执行,动态组件会自动执行
  346. //如果有组件,执行表格组件的内部方法
  347. // this.$nextTick(() => {
  348. // this.$refs[this.currentComponent] && this.$refs[this.currentComponent].startMethods()
  349. // })
  350. },
  351. },
  352. watch: {
  353. row: {
  354. handler(newV, oldV) {
  355. this.queryTableList()
  356. this.getFloorAllSelect()
  357. this.tabFind()
  358. },
  359. deep: true,
  360. },
  361. sbglgs() {
  362. this.queryTableList()
  363. },
  364. status() {
  365. this.queryTableList()
  366. },
  367. floor() {
  368. this.queryTableList()
  369. },
  370. },
  371. }
  372. </script>
  373. <style lang="less" scoped>
  374. .gdqd-dialog {
  375. display: flex;
  376. flex-direction: column;
  377. height: 90vh;
  378. .gdqd-top {
  379. .gdqd-dialog-bottom {
  380. overflow: auto;
  381. max-height: 20vh;
  382. margin-top: 20px;
  383. }
  384. }
  385. .qdxq-bottom {
  386. flex: 1;
  387. .wb-title {
  388. display: flex;
  389. height: 48px;
  390. line-height: 48px;
  391. background: #f5f6f7;
  392. margin: 20px 0;
  393. padding-left: 20px;
  394. }
  395. }
  396. }
  397. @media screen and (max-width: 1600px) {
  398. .gdqd-dialog td {
  399. padding: 4px 0;
  400. }
  401. }
  402. </style>
  403. <style lang="less">
  404. .gdqd-dialog {
  405. /deep/.el-table td {
  406. cursor: pointer;
  407. }
  408. .el-dialog__header {
  409. padding: 16px 24px;
  410. color: #fff;
  411. background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
  412. }
  413. .el-dialog__headerbtn .el-dialog__close {
  414. color: #fff;
  415. }
  416. .el-dialog__title {
  417. font-size: 16px;
  418. font-family: PingFangSC-Medium, PingFang SC;
  419. font-weight: 500;
  420. color: #fff;
  421. line-height: 24px;
  422. }
  423. .qdxq-bottom {
  424. .el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),
  425. .el-tabs--bottom .el-tabs__item.is-top:nth-child(2),
  426. .el-tabs--top .el-tabs__item.is-bottom:nth-child(2),
  427. .el-tabs--top .el-tabs__item.is-top:nth-child(2) {
  428. padding-left: 16px;
  429. }
  430. .el-tabs--bottom .el-tabs__item.is-bottom:last-child,
  431. .el-tabs--bottom .el-tabs__item.is-top:last-child,
  432. .el-tabs--top .el-tabs__item.is-bottom:last-child,
  433. .el-tabs--top .el-tabs__item.is-top:last-child {
  434. padding-right: 16px;
  435. }
  436. .el-tabs__nav-wrap::after {
  437. height: 0;
  438. }
  439. .el-tabs {
  440. // height: 95vh;
  441. }
  442. .el-tabs__content {
  443. /deep/ .el-tab-pane > div {
  444. height: 100% !important;
  445. }
  446. }
  447. .is-active {
  448. color: #025baa !important;
  449. border-color: #025baa !important;
  450. }
  451. .el-tabs__item {
  452. padding: 5px 16px;
  453. height: 30px;
  454. line-height: 22px;
  455. font-size: 14px;
  456. font-family: MicrosoftYaHei;
  457. color: rgba(31, 36, 41, 1);
  458. border: 1px solid rgba(195, 199, 203, 1);
  459. }
  460. /deep/ .el-tabs__item:last-child {
  461. border-radius: 0px 4px 4px 0px;
  462. }
  463. /deep/ .el-tabs__item:nth-child(2) {
  464. border-radius: 4px 0px 0px 4px;
  465. }
  466. .el-tab-pane {
  467. height: 100% !important;
  468. }
  469. .el-tabs__active-bar {
  470. background-color: transparent !important;
  471. }
  472. }
  473. // 底部表格
  474. .table-bottom {
  475. width: 100%;
  476. flex: 1;
  477. display: flex;
  478. flex-direction: column;
  479. // tab 样式
  480. .title {
  481. display: flex;
  482. height: 70px;
  483. line-height: 30px;
  484. align-items: center;
  485. padding: 15px 0;
  486. // 维修维保文本
  487. .text {
  488. width: 50px;
  489. }
  490. .text-r {
  491. margin-left: 100px;
  492. }
  493. // tab页签
  494. .d-tab {
  495. padding: 5px 16px;
  496. height: 30px;
  497. line-height: 22px;
  498. font-size: 14px;
  499. font-family: MicrosoftYaHei;
  500. font-weight: 500;
  501. color: #1f2429;
  502. text-align: center;
  503. border: 1px solid #c3c7cb;
  504. cursor: pointer;
  505. }
  506. .d-tab-left {
  507. border-radius: 4px 0 0 4px;
  508. }
  509. .d-tab-right {
  510. border-radius: 0 4px 4px 0;
  511. }
  512. // 当前选中页签
  513. .active {
  514. color: #025baa !important;
  515. border-color: #025baa !important;
  516. }
  517. }
  518. //筛选+表格
  519. .table2-container {
  520. width: 100%;
  521. flex: 1;
  522. position: relative;
  523. }
  524. }
  525. }
  526. </style>