rcwbTable.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. <!-- 维保 -->
  2. <template>
  3. <div class='rcwb-list'>
  4. <div class='eq-list-top'>
  5. <el-input
  6. @keyup.enter.native='getList'
  7. @blur='getList'
  8. clearable
  9. placeholder='搜索设备名称编号'
  10. size='small'
  11. prefix-icon='el-icon-search'
  12. v-model='sbjc'
  13. style='margin-right:12px;width:192px;'
  14. ></el-input>
  15. <el-input
  16. @keyup.enter.native='getList'
  17. @blur='getList'
  18. clearable
  19. placeholder='搜索事项记录描述'
  20. size='small'
  21. prefix-icon='el-icon-search'
  22. v-model='matters'
  23. style='margin-right:12px;width:192px;'
  24. ></el-input>
  25. <el-input
  26. @keyup.enter.native='getList'
  27. @blur='getList'
  28. clearable
  29. placeholder='搜索任务编号'
  30. size='small'
  31. prefix-icon='el-icon-search'
  32. v-model='rwbh'
  33. style='margin-right:12px;width:192px;'
  34. ></el-input>
  35. <Select
  36. @change='getList'
  37. width='160'
  38. tipPlace='top'
  39. v-model='status'
  40. caption='任务状态:'
  41. v-if='status.length>=0'
  42. :selectdata='statusOption'
  43. :placeholder='""'
  44. ></Select>
  45. <Select
  46. @change='getList'
  47. width='160'
  48. tipPlace='top'
  49. v-model='ischange'
  50. caption='是否正常:'
  51. :selectdata='changeOption'
  52. :placeholder='""'
  53. style='margin-right:12px'
  54. ></Select>
  55. <div class='picker-box'>
  56. <span class='picker-span'>任务开始日期:</span>
  57. <el-date-picker
  58. style='width:222px'
  59. v-model='reportdate'
  60. value-format='yyyyMMdd'
  61. type='daterange'
  62. @change='getList'
  63. size='mini'
  64. range-separator='-'
  65. start-placeholder
  66. end-placeholder
  67. ></el-date-picker>
  68. </div>
  69. <input-dialog :type='6' @confirm='confirm'></input-dialog>
  70. </div>
  71. <div ref='tableBox' style='height: calc(100% - 115px);'>
  72. <el-table :data='tableData' :max-height='tableMaxHeight' :border='true' style='width: 100%' @row-click='innerTable'>
  73. <el-table-column type='index' label='序号' width='60' :index='indexMethod'></el-table-column>
  74. <el-table-column prop label='设备名称' show-overflow-tooltip resizable min-width='434'>
  75. <template slot-scope='{row}'>{{row.sbmc||'--'}}</template>
  76. </el-table-column>
  77. <el-table-column prop label='设备内码' :show-overflow-tooltip='true' width='80'>
  78. <template slot-scope='{row}'>{{row.assetnum||'--'}}</template>
  79. </el-table-column>
  80. <el-table-column prop label='核心维保事项记录' :show-overflow-tooltip='true' min-width='225'>
  81. <template slot-scope='{row}'>{{row.matters||'--'}}</template>
  82. </el-table-column>
  83. <el-table-column prop label='现场照片' :show-overflow-tooltip='true' width='80'>
  84. <template slot-scope='{row}'>
  85. <div
  86. v-if='row.glsmsImage'
  87. style='cursor:pointer;color: #0091ff;'
  88. @click.stop='clickPic(row.glsmsImage)'
  89. >{{row.glsmsImage.length+'张'}}</div>
  90. <div v-else>{{'--'}}</div>
  91. </template>
  92. </el-table-column>
  93. <el-table-column prop label='维保任务' align='center'>
  94. <el-table-column prop label='任务编号' :show-overflow-tooltip='true'>
  95. <template slot-scope='{row}'>
  96. <div style='cursor:pointer;color: #0091ff;'>{{row.wb_gzglid||'--'}}</div>
  97. </template>
  98. </el-table-column>
  99. <el-table-column prop label='维保任务名称' :show-overflow-tooltip='true' min-width='360'>
  100. <template slot-scope='{row}'>{{row.wbrwmc || '--'}}</template>
  101. </el-table-column>
  102. <el-table-column prop label='任务状态' :show-overflow-tooltip='true'>
  103. <template slot-scope='{row}'>{{row.status||'--'}}</template>
  104. </el-table-column>
  105. <el-table-column prop label='开始时间' :show-overflow-tooltip='true' width='130'>
  106. <template slot-scope='{row}'>{{row.sjkssj?formatterTime(row.sjkssj):'--'}}</template>
  107. </el-table-column>
  108. <el-table-column prop label='完成时间' :show-overflow-tooltip='true' width='130'>
  109. <template slot-scope='{row}'>{{row.sjwcsj?formatterTime(row.sjwcsj):'--'}}</template>
  110. </el-table-column>
  111. <el-table-column prop label='执行耗时(天)' :show-overflow-tooltip='true' min-width='130' :sortable='true'>
  112. <template slot-scope='{row}'>{{row.sjcxsjt||'--'}}</template>
  113. </el-table-column>
  114. </el-table-column>
  115. <el-table-column prop label='是否正常' :show-overflow-tooltip='true' width='80'>
  116. <template slot-scope='{row}'>{{row.zt||'--'}}</template>
  117. </el-table-column>
  118. <el-table-column prop label='异常工单' align='center'>
  119. <el-table-column prop label='异常工单编号' :show-overflow-tooltip='true' min-width='110'>
  120. <template slot-scope='{row}'>
  121. <div @click='ycgd(row)'>{{row.wonum||'--'}}</div>
  122. </template>
  123. </el-table-column>
  124. <el-table-column prop label='描述' :show-overflow-tooltip='true' width='900'>
  125. <template slot-scope='{row}'>{{row.description||'--'}}</template>
  126. </el-table-column>
  127. <el-table-column prop label='填报时间' :show-overflow-tooltip='true' width='130'>
  128. <template slot-scope='{row}'>{{row.reportdate?formatterTime(row.reportdate):'--'}}</template>
  129. </el-table-column>
  130. <el-table-column prop label='验收时间' :show-overflow-tooltip='true' width='130'>
  131. <template slot-scope='{row}'>{{row.sjjssj?formatterTime(row.sjjssj):'--'}}</template>
  132. </el-table-column>
  133. </el-table-column>
  134. </el-table>
  135. </div>
  136. <div class='foot'>
  137. <el-pagination
  138. background
  139. layout='prev, pager, next'
  140. :total='total'
  141. :page-size='size'
  142. @prev-click='pageChanged'
  143. @next-click='pageChanged'
  144. @current-change='pageChanged'
  145. ></el-pagination>
  146. <pic-large :imgUrl='imgUrl' ref='picLargeOpen'></pic-large>
  147. </div>
  148. </div>
  149. </template>
  150. <script>
  151. import { queryWb } from '@/api/room.js'
  152. import { mapGetters } from 'vuex'
  153. import { Select } from 'meri-design'
  154. import inputDialog from './inputDIalog'
  155. import { formatterTime, number_format } from '@/utils/format.js'
  156. import { querySelect } from '@/api/public.js'
  157. export default {
  158. components: { Select, inputDialog },
  159. data() {
  160. return {
  161. tableData: [],
  162. total: 0,
  163. currentPage: 1,
  164. reportdate: '',
  165. ischange: '全部',
  166. sbjc: '',
  167. formatterTime,
  168. number_format,
  169. changeOption: [
  170. {
  171. id: '2',
  172. name: '全部',
  173. },
  174. {
  175. id: '1',
  176. name: '是',
  177. },
  178. {
  179. id: ' 0',
  180. name: '否',
  181. },
  182. ],
  183. statusOption: [],
  184. status: '全部',
  185. rwbh: '',
  186. imgUrl: [],
  187. allArr: [
  188. {
  189. id: '全部',
  190. name: '全部',
  191. },
  192. ],
  193. matters: '',
  194. bill: '',
  195. ycgdtbsj: '',
  196. complete: '',
  197. ycgdyssj: '',
  198. tableMaxHeight: 0,
  199. }
  200. },
  201. props: ['smsxt', 'diff', 'tabLabel', 'size', 'assetnum'],
  202. computed: {
  203. ...mapGetters(['floorSelect', 'plazaId']),
  204. },
  205. methods: {
  206. //序号的方法
  207. indexMethod(index) {
  208. return (this.currentPage - 1) * this.size + index + 1
  209. },
  210. //工单详情
  211. innerTable(row) {
  212. if (row.apptype == '外委' || row.apptype == '自维') {
  213. if (row.wb_gzglid) {
  214. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.wb_gzglid}`)
  215. }
  216. } else if (row.apptype == '安全维保') {
  217. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=AQ_WB_GZGL&uniqueid=${row.wb_gzglid}`)
  218. }
  219. },
  220. // 工单
  221. ycgd(row) {
  222. if (row.apptype == '外委' || row.apptype == '自维') {
  223. if (row.wb_gzglid) {
  224. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.wb_gzglid}`)
  225. }
  226. } else if (row.apptype == '安全维保') {
  227. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.wb_gzglid}`)
  228. }
  229. },
  230. //多余输入框监听
  231. confirm(complete, bill, ycgdtbsj, ycgdyssj) {
  232. this.complete = complete
  233. this.bill = bill
  234. this.ycgdtbsj = ycgdtbsj
  235. this.ycgdyssj = ycgdyssj
  236. this.getList()
  237. },
  238. pageChanged(page) {
  239. this.currentPage = page
  240. this.getList()
  241. },
  242. // 下拉框数据
  243. changeSelect() {
  244. this.department = []
  245. let postParams = [
  246. {
  247. columnName: { status: 'status', zt: 'zt' },
  248. tableName: 'sms_wbzy',
  249. },
  250. ]
  251. let data = {
  252. plazaId: this.plazaId,
  253. }
  254. querySelect({ data, postParams }).then((res) => {
  255. let status = [],
  256. zt = [],
  257. arr = [],
  258. arr1 = []
  259. status = res.data.data.sms_wbzy.status ? res.data.data.sms_wbzy.status : []
  260. zt = res.data.data.sms_wbzy.zt ? res.data.data.sms_wbzy.zt : []
  261. if (status.length > 0) {
  262. status.forEach((el) => {
  263. let obj = {
  264. id: el.key,
  265. name: el.value,
  266. }
  267. arr.push(obj)
  268. })
  269. this.statusOption = this.allArr.concat(arr)
  270. }
  271. if (zt.length > 0) {
  272. zt.forEach((el) => {
  273. let obj = {
  274. id: el.key,
  275. name: el.value == '正常' ? '是' : '否',
  276. }
  277. arr1.push(obj)
  278. })
  279. this.changeOption = this.allArr.concat(arr1)
  280. }
  281. })
  282. },
  283. getList() {
  284. let data = {
  285. smsxt: this.smsxt,
  286. plazaId: this.plazaId,
  287. page: this.currentPage,
  288. size: this.size,
  289. orderBy: 'wb_gzglid,0;assetnum,1;reportedby,0;',
  290. }
  291. //下拉
  292. if (this.ischange && this.ischange != '全部') {
  293. data.zt = this.ischange
  294. }
  295. if (this.status && this.status != '全部') {
  296. data.status = this.status
  297. }
  298. //工单填报时间
  299. if (this.ycgdtbsj) {
  300. data.reportdateStartDate = this.ycgdtbsj[0] + '000000'
  301. data.reportdateEndDate = this.ycgdtbsj[1] + '000000'
  302. }
  303. //工单验收时间
  304. if (this.ycgdyssj) {
  305. data.sjjssjStartDate = this.ycgdyssj[0] + '000000'
  306. data.sjjssjEndDate = this.ycgdyssj[1] + '000000'
  307. }
  308. //任务开始时间
  309. if (this.reportdate) {
  310. data.sjkssjStartDate = this.reportdate[0] + '000000'
  311. data.sjkssjEndDate = this.reportdate[1] + '000000'
  312. }
  313. //任务完成时间
  314. if (this.complete) {
  315. data.sjwcsjStartDate = this.complete[0] + '000000'
  316. data.sjwcsjEndDate = this.complete[1] + '000000'
  317. }
  318. //输入框
  319. data.keyword = ''
  320. if (this.sbjc) {
  321. data.keyword += `${this.sbjc}:sbmc,assetnum;`
  322. }
  323. if (this.matters) {
  324. data.keyword += `${this.matters}:description,matters;`
  325. }
  326. if (this.rwbh) {
  327. data.keyword += `${this.rwbh}:wb_gzglid;`
  328. }
  329. if (this.bill) {
  330. data.keyword += `${this.bill}:wonum;`
  331. }
  332. if (data.keyword == '') {
  333. delete data.keyword
  334. }
  335. queryWb({ getParams: data }).then((res) => {
  336. this.total = res.count
  337. this.tableData = res.data ? res.data : []
  338. })
  339. },
  340. clickPic(row) {
  341. this.imgUrl = []
  342. if (row) {
  343. row.forEach((el) => {
  344. let obj = {
  345. name: el.description,
  346. url: el.url,
  347. }
  348. this.imgUrl.push(obj)
  349. })
  350. }
  351. this.$refs.picLargeOpen.open(this.imgUrl)
  352. },
  353. startMethods() {
  354. this.changeSelect()
  355. this.getList()
  356. this.$nextTick(() => {
  357. // 页面渲染完成后的回调
  358. this.tableMaxHeight = this.$refs.tableBox.offsetHeight
  359. })
  360. },
  361. },
  362. watch: {
  363. diff(newV, oldV) {
  364. if (newV !== oldV) {
  365. this.getList()
  366. }
  367. },
  368. tabLabel(newV, oldV) {
  369. if (newV !== oldV) {
  370. this.changeSelect()
  371. this.getList()
  372. this.$nextTick(() => {
  373. // 页面渲染完成后的回调
  374. this.tableMaxHeight = this.$refs.tableBox.offsetHeight
  375. })
  376. }
  377. },
  378. ischange() {
  379. this.getList()
  380. },
  381. },
  382. mounted() {
  383. this.startMethods()
  384. },
  385. }
  386. </script>
  387. <style lang="less" scoped>
  388. .rcwb-list {
  389. .eq-list-top {
  390. display: flex;
  391. margin-bottom: 12px;
  392. .picker-box {
  393. display: flex;
  394. align-items: center;
  395. background: #fff;
  396. padding: 0 6px;
  397. border: 1px solid #dcdfe6;
  398. border-radius: 4px;
  399. height: 32px;
  400. box-sizing: border-box;
  401. margin-right: 12px;
  402. .picker-span {
  403. margin-right: 6px;
  404. color: rgba(0, 0, 0, 0.65);
  405. }
  406. }
  407. }
  408. td {
  409. overflow: hidden;
  410. text-overflow: ellipsis;
  411. white-space: nowrap;
  412. }
  413. .foot {
  414. height: 32px;
  415. display: flex;
  416. justify-content: flex-end;
  417. margin-top: 28px;
  418. }
  419. }
  420. </style>
  421. <style lang="less" >
  422. .rcwb-list {
  423. .picker-box {
  424. .el-input__inner {
  425. border: none;
  426. }
  427. .el-range-editor.el-input__inner {
  428. padding: 3px 0px;
  429. }
  430. .el-icon-date {
  431. display: none;
  432. }
  433. .el-range__close-icon {
  434. position: absolute;
  435. right: 0px;
  436. top: 2px;
  437. }
  438. .el-range-editor--mini .el-range-input {
  439. font-size: 14px;
  440. color: rgb(31, 36, 41);
  441. }
  442. }
  443. /deep/.el-table td {
  444. cursor: pointer;
  445. }
  446. }
  447. </style>