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='pageChanged(1)'
  7. @blur='pageChanged(1)'
  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='pageChanged(1)'
  17. @blur='pageChanged(1)'
  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='pageChanged(1)'
  27. @blur='pageChanged(1)'
  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='pageChanged(1)'
  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='pageChanged(1)'
  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:190px'
  59. v-model='reportdate'
  60. value-format='yyyyMMdd'
  61. type='daterange'
  62. @change='pageChanged(1)'
  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'>
  72. <el-table :data='tableData' :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. statusOption: [],
  176. status: '全部',
  177. rwbh: '',
  178. imgUrl: [],
  179. allArr: [
  180. {
  181. id: '全部',
  182. name: '全部',
  183. },
  184. ],
  185. matters: '',
  186. bill: '',
  187. ycgdtbsj: '',
  188. complete: '',
  189. ycgdyssj: '',
  190. }
  191. },
  192. props: ['smsxt', 'diff', 'tabLabel', 'size', 'assetnum'],
  193. computed: {
  194. ...mapGetters(['floorSelect', 'plazaId']),
  195. },
  196. methods: {
  197. //序号的方法
  198. indexMethod(index) {
  199. return (this.currentPage - 1) * this.size + index + 1
  200. },
  201. //工单详情
  202. innerTable(row) {
  203. if (row.apptype == '外委' || row.apptype == '自维') {
  204. if (row.wb_gzglid) {
  205. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.wb_gzglid}`)
  206. }
  207. } else if (row.apptype == '安全维保') {
  208. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=AQ_WB_GZGL&uniqueid=${row.wb_gzglid}`)
  209. }
  210. },
  211. // 工单
  212. ycgd(row) {
  213. if (row.apptype == '外委' || row.apptype == '自维') {
  214. if (row.wb_gzglid) {
  215. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.wb_gzglid}`)
  216. }
  217. } else if (row.apptype == '安全维保') {
  218. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.wb_gzglid}`)
  219. }
  220. },
  221. //多余输入框监听
  222. confirm(complete, bill, ycgdtbsj, ycgdyssj) {
  223. this.complete = complete
  224. this.bill = bill
  225. this.ycgdtbsj = ycgdtbsj
  226. this.ycgdyssj = ycgdyssj
  227. this.getList()
  228. },
  229. pageChanged(page) {
  230. this.currentPage = page
  231. this.getList()
  232. },
  233. // 下拉框数据
  234. changeSelect() {
  235. this.department = []
  236. let postParams = [
  237. {
  238. columnName: { status: 'status', zt: 'zt' },
  239. tableName: 'sms_wbzy',
  240. },
  241. ]
  242. let data = {
  243. plazaId: this.plazaId,
  244. }
  245. if (this.smsxt != '1008') {
  246. data.onlyMainAsset = true
  247. }
  248. querySelect({ data, postParams }).then((res) => {
  249. let status = [],
  250. zt = [],
  251. arr = [],
  252. arr1 = []
  253. status = res.data.data.sms_wbzy.status ? res.data.data.sms_wbzy.status : []
  254. zt = res.data.data.sms_wbzy.zt ? res.data.data.sms_wbzy.zt : []
  255. if (status.length > 0) {
  256. status.forEach((el) => {
  257. let obj = {
  258. id: el.key,
  259. name: el.value,
  260. }
  261. arr.push(obj)
  262. })
  263. this.statusOption = this.allArr.concat(arr)
  264. }
  265. if (zt.length > 0) {
  266. zt.forEach((el) => {
  267. let obj = {
  268. id: el.key,
  269. name: el.value == '正常' ? '正常' : '异常',
  270. }
  271. arr1.push(obj)
  272. })
  273. this.changeOption = this.allArr.concat(arr1)
  274. }
  275. })
  276. },
  277. getList() {
  278. let data = {
  279. smsxt: this.smsxt,
  280. plazaId: this.plazaId,
  281. page: this.currentPage,
  282. size: this.size,
  283. orderBy: 'wb_gzglid,0;assetnum,1;reportedby,0;',
  284. }
  285. //区分主要设备和全部设备
  286. if (this.smsxt != '1008') {
  287. data.onlyMainAsset = true
  288. }
  289. if (this.assetnum) {
  290. data.assetnum = this.assetnum
  291. }
  292. //下拉
  293. if (this.ischange && this.ischange != '全部') {
  294. data.zt = this.ischange
  295. }
  296. if (this.status && this.status != '全部') {
  297. data.status = this.status
  298. }
  299. //工单填报时间
  300. if (this.ycgdtbsj) {
  301. data.reportdateStartDate = this.ycgdtbsj[0] + '000000'
  302. data.reportdateEndDate = this.ycgdtbsj[1] + '000000'
  303. }
  304. //工单验收时间
  305. if (this.ycgdyssj) {
  306. data.sjjssjStartDate = this.ycgdyssj[0] + '000000'
  307. data.sjjssjEndDate = this.ycgdyssj[1] + '000000'
  308. }
  309. //任务开始时间
  310. if (this.reportdate) {
  311. data.sjkssjStartDate = this.reportdate[0] + '000000'
  312. data.sjkssjEndDate = this.reportdate[1] + '000000'
  313. }
  314. //任务完成时间
  315. if (this.complete) {
  316. data.sjwcsjStartDate = this.complete[0] + '000000'
  317. data.sjwcsjEndDate = this.complete[1] + '000000'
  318. }
  319. //输入框
  320. data.keyword = ''
  321. if (this.sbjc) {
  322. data.keyword += `${this.sbjc}:sbmc,assetnum;`
  323. }
  324. if (this.matters) {
  325. data.keyword += `${this.matters}:description,matters;`
  326. }
  327. if (this.rwbh) {
  328. data.keyword += `${this.rwbh}:wb_gzglid;`
  329. }
  330. if (this.bill) {
  331. data.keyword += `${this.bill}:wonum;`
  332. }
  333. if (data.keyword == '') {
  334. delete data.keyword
  335. }
  336. queryWb({ getParams: data }).then((res) => {
  337. this.total = res.count
  338. this.tableData = res.data ? res.data : []
  339. })
  340. },
  341. clickPic(row) {
  342. this.imgUrl = []
  343. if (row) {
  344. row.forEach((el) => {
  345. let obj = {
  346. name: el.description,
  347. url: el.url,
  348. }
  349. this.imgUrl.push(obj)
  350. })
  351. }
  352. this.$refs.picLargeOpen.open(this.imgUrl)
  353. },
  354. startMethods() {
  355. this.changeSelect()
  356. this.getList()
  357. },
  358. },
  359. watch: {
  360. diff(newV, oldV) {
  361. if (newV !== oldV) {
  362. this.getList()
  363. }
  364. },
  365. assetnum(newV, oldV) {
  366. if (newV !== oldV) {
  367. // this.tabFind()
  368. this.getList()
  369. }
  370. },
  371. tabLabel(newV, oldV) {
  372. if (newV !== oldV) {
  373. this.changeSelect()
  374. this.getList()
  375. }
  376. },
  377. ischange() {
  378. this.getList()
  379. },
  380. },
  381. mounted() {
  382. console.log(this.assetnum)
  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>