rcwbTable.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  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:190px'
  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'>
  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. 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. }
  199. },
  200. props: ['smsxt', 'diff', 'tabLabel', 'size', 'assetnum'],
  201. computed: {
  202. ...mapGetters(['floorSelect', 'plazaId']),
  203. },
  204. methods: {
  205. //序号的方法
  206. indexMethod(index) {
  207. return (this.currentPage - 1) * this.size + index + 1
  208. },
  209. //工单详情
  210. innerTable(row) {
  211. if (row.apptype == '外委' || row.apptype == '自维') {
  212. if (row.wb_gzglid) {
  213. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.wb_gzglid}`)
  214. }
  215. } else if (row.apptype == '安全维保') {
  216. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=AQ_WB_GZGL&uniqueid=${row.wb_gzglid}`)
  217. }
  218. },
  219. // 工单
  220. ycgd(row) {
  221. if (row.apptype == '外委' || row.apptype == '自维') {
  222. if (row.wb_gzglid) {
  223. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.wb_gzglid}`)
  224. }
  225. } else if (row.apptype == '安全维保') {
  226. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.wb_gzglid}`)
  227. }
  228. },
  229. //多余输入框监听
  230. confirm(complete, bill, ycgdtbsj, ycgdyssj) {
  231. this.complete = complete
  232. this.bill = bill
  233. this.ycgdtbsj = ycgdtbsj
  234. this.ycgdyssj = ycgdyssj
  235. this.getList()
  236. },
  237. pageChanged(page) {
  238. this.currentPage = page
  239. this.getList()
  240. },
  241. // 下拉框数据
  242. changeSelect() {
  243. this.department = []
  244. let postParams = [
  245. {
  246. columnName: { status: 'status', zt: 'zt' },
  247. tableName: 'sms_wbzy',
  248. },
  249. ]
  250. let data = {
  251. plazaId: this.plazaId,
  252. }
  253. if(this.smsxt!='1008'){
  254. data.onlyMainAsset = true
  255. }
  256. querySelect({ data, postParams }).then((res) => {
  257. let status = [],
  258. zt = [],
  259. arr = [],
  260. arr1 = []
  261. status = res.data.data.sms_wbzy.status ? res.data.data.sms_wbzy.status : []
  262. zt = res.data.data.sms_wbzy.zt ? res.data.data.sms_wbzy.zt : []
  263. if (status.length > 0) {
  264. status.forEach((el) => {
  265. let obj = {
  266. id: el.key,
  267. name: el.value,
  268. }
  269. arr.push(obj)
  270. })
  271. this.statusOption = this.allArr.concat(arr)
  272. }
  273. if (zt.length > 0) {
  274. zt.forEach((el) => {
  275. let obj = {
  276. id: el.key,
  277. name: el.value == '正常' ? '是' : '否',
  278. }
  279. arr1.push(obj)
  280. })
  281. this.changeOption = this.allArr.concat(arr1)
  282. }
  283. })
  284. },
  285. getList() {
  286. let data = {
  287. smsxt: this.smsxt,
  288. plazaId: this.plazaId,
  289. page: this.currentPage,
  290. size: this.size,
  291. orderBy: 'wb_gzglid,0;assetnum,1;reportedby,0;',
  292. }
  293. //区分主要设备和全部设备
  294. if(this.smsxt != '1008'){
  295. data.onlyMainAsset = true
  296. }
  297. if (this.assetnum) {
  298. data.assetnum = this.assetnum
  299. }
  300. //下拉
  301. if (this.ischange && this.ischange != '全部') {
  302. data.zt = this.ischange
  303. }
  304. if (this.status && this.status != '全部') {
  305. data.status = this.status
  306. }
  307. //工单填报时间
  308. if (this.ycgdtbsj) {
  309. data.reportdateStartDate = this.ycgdtbsj[0] + '000000'
  310. data.reportdateEndDate = this.ycgdtbsj[1] + '000000'
  311. }
  312. //工单验收时间
  313. if (this.ycgdyssj) {
  314. data.sjjssjStartDate = this.ycgdyssj[0] + '000000'
  315. data.sjjssjEndDate = this.ycgdyssj[1] + '000000'
  316. }
  317. //任务开始时间
  318. if (this.reportdate) {
  319. data.sjkssjStartDate = this.reportdate[0] + '000000'
  320. data.sjkssjEndDate = this.reportdate[1] + '000000'
  321. }
  322. //任务完成时间
  323. if (this.complete) {
  324. data.sjwcsjStartDate = this.complete[0] + '000000'
  325. data.sjwcsjEndDate = this.complete[1] + '000000'
  326. }
  327. //输入框
  328. data.keyword = ''
  329. if (this.sbjc) {
  330. data.keyword += `${this.sbjc}:sbmc,assetnum;`
  331. }
  332. if (this.matters) {
  333. data.keyword += `${this.matters}:description,matters;`
  334. }
  335. if (this.rwbh) {
  336. data.keyword += `${this.rwbh}:wb_gzglid;`
  337. }
  338. if (this.bill) {
  339. data.keyword += `${this.bill}:wonum;`
  340. }
  341. if (data.keyword == '') {
  342. delete data.keyword
  343. }
  344. queryWb({ getParams: data }).then((res) => {
  345. this.total = res.count
  346. this.tableData = res.data ? res.data : []
  347. })
  348. },
  349. clickPic(row) {
  350. this.imgUrl = []
  351. if (row) {
  352. row.forEach((el) => {
  353. let obj = {
  354. name: el.description,
  355. url: el.url,
  356. }
  357. this.imgUrl.push(obj)
  358. })
  359. }
  360. this.$refs.picLargeOpen.open(this.imgUrl)
  361. },
  362. startMethods() {
  363. this.changeSelect()
  364. this.getList()
  365. },
  366. },
  367. watch: {
  368. diff(newV, oldV) {
  369. if (newV !== oldV) {
  370. this.getList()
  371. }
  372. },
  373. tabLabel(newV, oldV) {
  374. if (newV !== oldV) {
  375. this.changeSelect()
  376. this.getList()
  377. }
  378. },
  379. ischange() {
  380. this.getList()
  381. },
  382. },
  383. mounted() {
  384. console.log(this.assetnum)
  385. this.startMethods()
  386. },
  387. }
  388. </script>
  389. <style lang="less" scoped>
  390. .rcwb-list {
  391. .eq-list-top {
  392. display: flex;
  393. margin-bottom: 12px;
  394. .picker-box {
  395. display: flex;
  396. align-items: center;
  397. background: #fff;
  398. padding: 0 6px;
  399. border: 1px solid #dcdfe6;
  400. border-radius: 4px;
  401. height: 32px;
  402. box-sizing: border-box;
  403. margin-right: 12px;
  404. .picker-span {
  405. margin-right: 6px;
  406. color: rgba(0, 0, 0, 0.65);
  407. }
  408. }
  409. }
  410. td {
  411. overflow: hidden;
  412. text-overflow: ellipsis;
  413. white-space: nowrap;
  414. }
  415. .foot {
  416. height: 32px;
  417. display: flex;
  418. justify-content: flex-end;
  419. margin-top: 28px;
  420. }
  421. }
  422. </style>
  423. <style lang="less" >
  424. .rcwb-list {
  425. .picker-box {
  426. .el-input__inner {
  427. border: none;
  428. }
  429. .el-range-editor.el-input__inner {
  430. padding: 3px 0px;
  431. }
  432. .el-icon-date {
  433. display: none;
  434. }
  435. .el-range__close-icon {
  436. position: absolute;
  437. right: 0px;
  438. top: 2px;
  439. }
  440. .el-range-editor--mini .el-range-input {
  441. font-size: 14px;
  442. color: rgb(31, 36, 41);
  443. }
  444. }
  445. /deep/.el-table td {
  446. cursor: pointer;
  447. }
  448. }
  449. </style>