rcwbTable.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  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. querySelect({ data, postParams }).then((res) => {
  254. let status = [],
  255. zt = [],
  256. arr = [],
  257. arr1 = []
  258. status = res.data.data.sms_wbzy.status ? res.data.data.sms_wbzy.status : []
  259. zt = res.data.data.sms_wbzy.zt ? res.data.data.sms_wbzy.zt : []
  260. if (status.length > 0) {
  261. status.forEach((el) => {
  262. let obj = {
  263. id: el.key,
  264. name: el.value,
  265. }
  266. arr.push(obj)
  267. })
  268. this.statusOption = this.allArr.concat(arr)
  269. }
  270. if (zt.length > 0) {
  271. zt.forEach((el) => {
  272. let obj = {
  273. id: el.key,
  274. name: el.value == '正常' ? '是' : '否',
  275. }
  276. arr1.push(obj)
  277. })
  278. this.changeOption = this.allArr.concat(arr1)
  279. }
  280. })
  281. },
  282. getList() {
  283. let data = {
  284. smsxt: this.smsxt,
  285. plazaId: this.plazaId,
  286. page: this.currentPage,
  287. size: this.size,
  288. orderBy: 'wb_gzglid,0;assetnum,1;reportedby,0;',
  289. }
  290. if (this.assetnum) {
  291. data.assetnum = this.assetnum
  292. }
  293. //下拉
  294. if (this.ischange && this.ischange != '全部') {
  295. data.zt = this.ischange
  296. }
  297. if (this.status && this.status != '全部') {
  298. data.status = this.status
  299. }
  300. //工单填报时间
  301. if (this.ycgdtbsj) {
  302. data.reportdateStartDate = this.ycgdtbsj[0] + '000000'
  303. data.reportdateEndDate = this.ycgdtbsj[1] + '000000'
  304. }
  305. //工单验收时间
  306. if (this.ycgdyssj) {
  307. data.sjjssjStartDate = this.ycgdyssj[0] + '000000'
  308. data.sjjssjEndDate = this.ycgdyssj[1] + '000000'
  309. }
  310. //任务开始时间
  311. if (this.reportdate) {
  312. data.sjkssjStartDate = this.reportdate[0] + '000000'
  313. data.sjkssjEndDate = this.reportdate[1] + '000000'
  314. }
  315. //任务完成时间
  316. if (this.complete) {
  317. data.sjwcsjStartDate = this.complete[0] + '000000'
  318. data.sjwcsjEndDate = this.complete[1] + '000000'
  319. }
  320. //输入框
  321. data.keyword = ''
  322. if (this.sbjc) {
  323. data.keyword += `${this.sbjc}:sbmc,assetnum;`
  324. }
  325. if (this.matters) {
  326. data.keyword += `${this.matters}:description,matters;`
  327. }
  328. if (this.rwbh) {
  329. data.keyword += `${this.rwbh}:wb_gzglid;`
  330. }
  331. if (this.bill) {
  332. data.keyword += `${this.bill}:wonum;`
  333. }
  334. if (data.keyword == '') {
  335. delete data.keyword
  336. }
  337. queryWb({ getParams: data }).then((res) => {
  338. this.total = res.count
  339. this.tableData = res.data ? res.data : []
  340. })
  341. },
  342. clickPic(row) {
  343. this.imgUrl = []
  344. if (row) {
  345. row.forEach((el) => {
  346. let obj = {
  347. name: el.description,
  348. url: el.url,
  349. }
  350. this.imgUrl.push(obj)
  351. })
  352. }
  353. this.$refs.picLargeOpen.open(this.imgUrl)
  354. },
  355. startMethods() {
  356. this.changeSelect()
  357. this.getList()
  358. },
  359. },
  360. watch: {
  361. diff(newV, oldV) {
  362. if (newV !== oldV) {
  363. this.getList()
  364. }
  365. },
  366. tabLabel(newV, oldV) {
  367. if (newV !== oldV) {
  368. this.changeSelect()
  369. this.getList()
  370. }
  371. },
  372. ischange() {
  373. this.getList()
  374. },
  375. },
  376. mounted() {
  377. console.log(this.assetnum)
  378. this.startMethods()
  379. },
  380. }
  381. </script>
  382. <style lang="less" scoped>
  383. .rcwb-list {
  384. .eq-list-top {
  385. display: flex;
  386. margin-bottom: 12px;
  387. .picker-box {
  388. display: flex;
  389. align-items: center;
  390. background: #fff;
  391. padding: 0 6px;
  392. border: 1px solid #dcdfe6;
  393. border-radius: 4px;
  394. height: 32px;
  395. box-sizing: border-box;
  396. margin-right: 12px;
  397. .picker-span {
  398. margin-right: 6px;
  399. color: rgba(0, 0, 0, 0.65);
  400. }
  401. }
  402. }
  403. td {
  404. overflow: hidden;
  405. text-overflow: ellipsis;
  406. white-space: nowrap;
  407. }
  408. .foot {
  409. height: 32px;
  410. display: flex;
  411. justify-content: flex-end;
  412. margin-top: 28px;
  413. }
  414. }
  415. </style>
  416. <style lang="less" >
  417. .rcwb-list {
  418. .picker-box {
  419. .el-input__inner {
  420. border: none;
  421. }
  422. .el-range-editor.el-input__inner {
  423. padding: 3px 0px;
  424. }
  425. .el-icon-date {
  426. display: none;
  427. }
  428. .el-range__close-icon {
  429. position: absolute;
  430. right: 0px;
  431. top: 2px;
  432. }
  433. .el-range-editor--mini .el-range-input {
  434. font-size: 14px;
  435. color: rgb(31, 36, 41);
  436. }
  437. }
  438. /deep/.el-table td {
  439. cursor: pointer;
  440. }
  441. }
  442. </style>