rcwbTable.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  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:180px'
  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='150'>
  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='150'>
  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='340'>
  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?formatter(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?formatter(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?formatter(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?formatter(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 { queryWbsms } from '@/api/equipmentList.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. export default {
  157. components: { Select, inputDialog },
  158. data() {
  159. return {
  160. tableData: [],
  161. total: 0,
  162. currentPage: 1,
  163. size: 10,
  164. // sjjssj: '',
  165. reportdate: '',
  166. ischange: '2',
  167. sbjc: '',
  168. formatterTime,
  169. number_format,
  170. changeOption: [
  171. {
  172. id: '2',
  173. name: '全部',
  174. },
  175. {
  176. id: '1',
  177. name: '是',
  178. },
  179. {
  180. id: ' 0',
  181. name: '否',
  182. },
  183. ],
  184. statusOption: [],
  185. status: '',
  186. rwbh: '',
  187. imgUrl: [],
  188. matters: '',
  189. bill: '',
  190. ycgdtbsj: '',
  191. complete: '',
  192. ycgdyssj: '',
  193. tableMaxHeight: 0,
  194. }
  195. },
  196. props: ['smsxt', 'major', 'diff', 'tabLabel'],
  197. computed: {
  198. ...mapGetters(['floorSelect']),
  199. },
  200. methods: {
  201. //序号的方法
  202. indexMethod(index) {
  203. return (this.currentPage - 1) * this.size + index + 1
  204. },
  205. //工单详情
  206. innerTable(row) {
  207. console.log(row)
  208. if (row.apptype == '外委' || row.apptype == '自维') {
  209. if (row.wb_gzglid) {
  210. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.wb_gzglid}`)
  211. }
  212. } else if (row.apptype == '安全维保') {
  213. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=AQ_WB_GZGL&uniqueid=${row.wb_gzglid}`)
  214. }
  215. },
  216. // 工单
  217. ycgd(row) {
  218. if (row.apptype == '外委' || row.apptype == '自维') {
  219. if (row.wb_gzglid) {
  220. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.wb_gzglid}`)
  221. }
  222. } else if (row.apptype == '安全维保') {
  223. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.wb_gzglid}`)
  224. }
  225. },
  226. //多余输入框监听
  227. confirm(complete, bill, ycgdtbsj, ycgdyssj) {
  228. this.complete = complete
  229. this.bill = bill
  230. this.ycgdtbsj = ycgdtbsj
  231. this.ycgdyssj = ycgdyssj
  232. this.getList()
  233. },
  234. pageChanged(page) {
  235. this.currentPage = page
  236. this.getList()
  237. },
  238. getList() {
  239. let getParams = {
  240. data: {
  241. smsxt: this.smsxt,
  242. diff: this.diff,
  243. plazaId: this.$store.state.plazaId,
  244. page: this.currentPage,
  245. size: this.size,
  246. },
  247. }
  248. //下拉
  249. if (this.ischange && this.ischange != 2) {
  250. // getParams.data.ischangepj = this.ischange
  251. getParams.data.ismodel = this.ischange
  252. }
  253. //工单填报时间
  254. if (this.ycgdtbsj) {
  255. getParams.data.sjjssjStartDate = this.ycgdtbsj[0] + '000000'
  256. getParams.data.sjjssjEndDate = this.ycgdtbsj[1] + '000000'
  257. }
  258. //工单验收时间
  259. if (this.ycgdyssj) {
  260. getParams.data.reportdateStartDate = this.ycgdyssj[0] + '000000'
  261. getParams.data.reportdateEndDate = this.ycgdyssj[1] + '000000'
  262. }
  263. //任务开始时间
  264. if (this.reportdate) {
  265. getParams.data.reportdate = this.reportdate[0] + '000000'
  266. getParams.data.reportdate = this.reportdate[1] + '000000'
  267. }
  268. //任务完成时间
  269. if (this.complete) {
  270. getParams.data.reportdateStartDate = this.complete[0] + '000000'
  271. getParams.data.reportdateEndDate = this.complete[1] + '000000'
  272. }
  273. //输入框
  274. getParams.data.keyword = ''
  275. if (this.sbjc) {
  276. getParams.data.keyword += `${this.sbjc}:sbmc,assetnum;`
  277. }
  278. if (this.matters) {
  279. getParams.data.keyword += `${this.matters}:description,matters;`
  280. }
  281. if (this.gzglid) {
  282. getParams.data.keyword += `${this.gzglid}:wb_gzglid;`
  283. }
  284. if (getParams.data.keyword == '') {
  285. delete getParams.data.keyword
  286. }
  287. queryWbsms(getParams).then((res) => {
  288. this.tableData = res.data || []
  289. this.total = res.count
  290. })
  291. },
  292. clickPic(row) {
  293. this.imgUrl = []
  294. if (row) {
  295. row.forEach((el) => {
  296. let obj = {
  297. name: el.description,
  298. url: el.url,
  299. }
  300. this.imgUrl.push(obj)
  301. })
  302. }
  303. this.$refs.picLargeOpen.open(this.imgUrl)
  304. },
  305. },
  306. watch: {
  307. diff(newV, oldV) {
  308. if (newV !== oldV) {
  309. this.getList()
  310. }
  311. },
  312. tabLabel(newV, oldV) {
  313. if (newV !== oldV) {
  314. // this.tabFind()
  315. this.getList()
  316. this.$nextTick(() => {
  317. // 页面渲染完成后的回调
  318. this.tableMaxHeight = this.$refs.tableBox.offsetHeight
  319. })
  320. }
  321. },
  322. ischange() {
  323. this.getList()
  324. },
  325. },
  326. mounted() {
  327. this.getList()
  328. this.$nextTick(() => {
  329. // 页面渲染完成后的回调
  330. this.tableMaxHeight = this.$refs.tableBox.offsetHeight
  331. })
  332. },
  333. }
  334. </script>
  335. <style lang="less" scoped>
  336. .rcwb-list {
  337. .eq-list-top {
  338. display: flex;
  339. margin-bottom: 12px;
  340. .picker-box {
  341. display: flex;
  342. align-items: center;
  343. background: #fff;
  344. padding: 0 6px;
  345. border: 1px solid #dcdfe6;
  346. border-radius: 4px;
  347. height: 32px;
  348. box-sizing: border-box;
  349. margin-right: 12px;
  350. .picker-span {
  351. margin-right: 6px;
  352. color: rgba(0, 0, 0, 0.65);
  353. }
  354. }
  355. }
  356. td {
  357. overflow: hidden;
  358. text-overflow: ellipsis;
  359. white-space: nowrap;
  360. }
  361. .foot {
  362. height: 32px;
  363. display: flex;
  364. justify-content: flex-end;
  365. margin-top: 28px;
  366. }
  367. }
  368. </style>
  369. <style lang="less" >
  370. .rcwb-list {
  371. .picker-box {
  372. .el-input__inner {
  373. border: none;
  374. }
  375. .el-range-editor.el-input__inner {
  376. padding: 3px 0px;
  377. }
  378. .el-icon-date {
  379. display: none;
  380. }
  381. .el-range__close-icon {
  382. position: absolute;
  383. right: 0px;
  384. top: 2px;
  385. }
  386. .el-range-editor--mini .el-range-input {
  387. font-size: 14px;
  388. color: rgb(31, 36, 41);
  389. }
  390. }
  391. /deep/.el-table td {
  392. cursor: pointer;
  393. }
  394. }
  395. </style>