wbTable.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <!-- 维保 -->
  2. <template>
  3. <div class='wb-list'>
  4. <div class='eq-list-top'>
  5. <el-input
  6. placeholder='搜索设备名称或内码'
  7. size='small'
  8. @keyup.enter.native='pageChanged(1)'
  9. @blur='pageChanged(1)'
  10. prefix-icon='el-icon-search'
  11. v-model='sbjc'
  12. clearable
  13. style='width:192px;margin-right:12px'
  14. ></el-input>
  15. <el-input
  16. placeholder='搜索事项类型事项描述'
  17. size='small'
  18. @keyup.enter.native='pageChanged(1)'
  19. @blur='pageChanged(1)'
  20. clearable
  21. prefix-icon='el-icon-search'
  22. v-model='matters'
  23. style='width:192px;margin-right:12px'
  24. ></el-input>
  25. <Select
  26. @change='pageChanged(1)'
  27. v-model='ischange'
  28. style='margin-right:12px'
  29. width='220'
  30. tipPlace='top'
  31. caption='是否更换:'
  32. :selectdata='changeOption'
  33. ></Select>
  34. <!-- placeholder='选择填报时间' -->
  35. <div class='picker-box'>
  36. <span class='picker-span'>填报日期:</span>
  37. <el-date-picker
  38. style='width:190px'
  39. v-model='reportdate'
  40. value-format='yyyyMMdd'
  41. type='daterange'
  42. @change='pageChanged(1)'
  43. size='mini'
  44. range-separator='-'
  45. start-placeholder
  46. end-placeholder
  47. ></el-date-picker>
  48. </div>
  49. <!-- placeholder='选择验收时间' -->
  50. <div class='picker-box'>
  51. <span class='picker-span'>验收日期:</span>
  52. <el-date-picker
  53. style='width:190px'
  54. v-model='sjjssj'
  55. value-format='yyyyMMdd'
  56. type='daterange'
  57. @change='pageChanged(1)'
  58. size='mini'
  59. range-separator='-'
  60. start-placeholder
  61. end-placeholder
  62. ></el-date-picker>
  63. </div>
  64. <input-dialog :type='2' @confirm='confirm'></input-dialog>
  65. </div>
  66. <div ref='tableBox'>
  67. <el-table :data='tableData' :border='true' style='width: 100%' @row-click='innerTable'>
  68. <el-table-column type='index' label='序号' width='60' :index='indexMethod'></el-table-column>
  69. <el-table-column prop='sbmc' label='设备名称' show-overflow-tooltip resizable width='460'>
  70. <template slot-scope='{row}'>{{row.sbmc || '--'}}</template>
  71. </el-table-column>
  72. <el-table-column prop='assetnum' label='设备内码' show-overflow-tooltip resizable width='80'>
  73. <template slot-scope='{row}'>{{row.assetnum || '--'}}</template>
  74. </el-table-column>
  75. <el-table-column prop='matters' label='事项类型' width='180' show-overflow-tooltip resizable>
  76. <template slot-scope='{row}'>{{row.matters || '--'}}</template>
  77. </el-table-column>
  78. <el-table-column prop='description' label='事项描述' show-overflow-tooltip resizable min-width='340'>
  79. <template slot-scope='{row}'>{{row.description || '--'}}</template>
  80. </el-table-column>
  81. <el-table-column label='更换配件信息' align='center'>
  82. <el-table-column prop='ischangepj' label='是/否更换' width='80'>
  83. <template slot-scope='{row}'>{{row.ismodel==1?'是':(row.ismodel==0?"否" :'--')}}</template>
  84. </el-table-column>
  85. <el-table-column prop='model' label='配件名称型号' width='140' show-overflow-tooltip resizable>
  86. <template slot-scope='{row}'>{{row.model || '--'}}</template>
  87. </el-table-column>
  88. <el-table-column prop='sl' label='数量' width='80' show-overflow-tooltip resizable>
  89. <template slot-scope='{row}'>{{row.sl>=0?row.sl:'--'}}</template>
  90. </el-table-column>
  91. <el-table-column prop='cost' label='费用(万元)' show-overflow-tooltip resizable width='80' align='right'>
  92. <template slot-scope='{row}'>{{row.cost || '--'}}</template>
  93. </el-table-column>
  94. <el-table-column prop='source' label='费用出处' show-overflow-tooltip resizable width='100'>
  95. <template slot-scope='{row}'>{{row.source|| '--'}}</template>
  96. </el-table-column>
  97. </el-table-column>
  98. <el-table-column prop='brand' label='现场照片' width='70'>
  99. <template slot-scope='{row}'>
  100. <div
  101. v-if='row.glsmsImage'
  102. style='cursor:pointer;color: #0091ff;'
  103. @click.stop='clickPic(row.glsmsImage)'
  104. >{{row.glsmsImage.length+'张'}}</div>
  105. <div v-else>{{'--'}}</div>
  106. </template>
  107. </el-table-column>
  108. <el-table-column prop='reportdate' label='填报时间' width='140'>
  109. <template slot-scope='{row}'>{{row.reportdate?formatterTime(row.reportdate):'--'}}</template>
  110. </el-table-column>
  111. <el-table-column prop='sjjssj' label='验收时间' width='140'>
  112. <template slot-scope='{row}'>{{row.sjjssj?formatterTime(row.sjjssj): '--'}}</template>
  113. </el-table-column>
  114. <el-table-column prop='wonum' label='任务编号' show-overflow-tooltip resizable width='90'>
  115. <template slot-scope='{row}'>
  116. <div v-if='row.wb_gzglid' @click.stop='ycgd(row)' style='cursor:pointer;color: #0091ff;'>{{row.wb_gzglid}}</div>
  117. <div v-else>{{'--'}}</div>
  118. </template>
  119. </el-table-column>
  120. </el-table>
  121. </div>
  122. <div class='foot'>
  123. <el-pagination
  124. background
  125. layout='prev, pager, next'
  126. :total='total'
  127. :page-size='size'
  128. :current-page='currentPage'
  129. @prev-click='pageChanged'
  130. @next-click='pageChanged'
  131. @current-change='pageChanged'
  132. ></el-pagination>
  133. <pic-large :imgUrl='imgUrl' ref='picLargeOpen'></pic-large>
  134. </div>
  135. </div>
  136. </template>
  137. <script>
  138. import moment from 'moment'
  139. import { queryWbsms } from '@/api/equipmentList.js'
  140. import { mapGetters } from 'vuex'
  141. import { Select } from 'meri-design'
  142. import inputDialog from './inputDIalog'
  143. import { formatterTime, number_format } from '@/utils/format.js'
  144. export default {
  145. components: { Select, inputDialog },
  146. data() {
  147. return {
  148. tableData: [],
  149. total: 0,
  150. currentPage: 1,
  151. sjjssj: '',
  152. reportdate: '',
  153. ischange: '2',
  154. sbjc: '',
  155. formatterTime,
  156. number_format,
  157. changeOption: [
  158. {
  159. id: '2',
  160. name: '全部',
  161. },
  162. {
  163. id: '1',
  164. name: '是',
  165. },
  166. {
  167. id: ' 0',
  168. name: '否',
  169. },
  170. ],
  171. imgUrl: [],
  172. shjc: '',
  173. gzglid: '',
  174. matters: '',
  175. }
  176. },
  177. props: ['smsxt', 'diff', 'tabLabel', 'size', 'assetnum'],
  178. computed: {
  179. ...mapGetters(['floorSelect']),
  180. },
  181. methods: {
  182. //序号的方法
  183. indexMethod(index) {
  184. return (this.currentPage - 1) * this.size + index + 1
  185. },
  186. //工单详情
  187. innerTable(row) {
  188. console.log(row)
  189. if (row.apptype == '外委' || row.apptype == '自维') {
  190. if (row.wb_gzglid) {
  191. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.wb_gzglid}`)
  192. }
  193. } else if (row.apptype == '安全维保') {
  194. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=AQ_WB_GZGL&uniqueid=${row.wb_gzglid}`)
  195. }
  196. },
  197. // 工单
  198. ycgd(row) {
  199. if (row.apptype == '外委' || row.apptype == '自维') {
  200. if (row.wb_gzglid) {
  201. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.wb_gzglid}`)
  202. }
  203. } else if (row.apptype == '安全维保') {
  204. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.wb_gzglid}`)
  205. }
  206. },
  207. //多余输入框监听
  208. confirm(gzglid) {
  209. this.gzglid = gzglid
  210. this.pageChanged(1)
  211. },
  212. pageChanged(page) {
  213. this.currentPage = page
  214. this.getList()
  215. },
  216. getList() {
  217. let getParams = {
  218. data: {
  219. smsxt: this.smsxt,
  220. plazaId: this.$store.state.plazaId,
  221. page: this.currentPage,
  222. size: this.size,
  223. },
  224. }
  225. //区分主要设备和全部设备
  226. if (this.smsxt != '1008') {
  227. getParams.data.onlyMainAsset = true
  228. }
  229. if (this.diff) {
  230. getParams.data.diff = this.diff
  231. }
  232. if (this.assetnum) {
  233. getParams.data.assetnum = this.assetnum
  234. }
  235. //下拉
  236. if (this.ischange && this.ischange != 2) {
  237. // getParams.data.ischangepj = this.ischange
  238. getParams.data.ismodel = this.ischange
  239. }
  240. // 验收日期
  241. if (this.sjjssj) {
  242. getParams.data.sjjssjStartDate = this.sjjssj[0] + '000000'
  243. // getParams.data.sjjssjEndDate = this.sjjssj[1] + '000000'
  244. getParams.data.sjjssjEndDate = moment(this.sjjssj[1]).format('YYYYMMDD235959')
  245. }
  246. // 填报时间
  247. if (this.reportdate) {
  248. getParams.data.reportdateStartDate = this.reportdate[0] + '000000'
  249. // getParams.data.reportdateEndDate = this.reportdate[1] + '000000'
  250. getParams.data.reportdateEndDate = moment(this.reportdate[1]).format('YYYYMMDD235959')
  251. }
  252. //输入框
  253. getParams.data.keyword = ''
  254. if (this.sbjc) {
  255. console.log(this.sbjc)
  256. getParams.data.keyword += `${this.sbjc}:sbmc,assetnum;`
  257. }
  258. if (this.matters) {
  259. getParams.data.keyword += `${this.matters}:description,matters;`
  260. }
  261. if (this.gzglid) {
  262. getParams.data.keyword += `${this.gzglid}:wb_gzglid;`
  263. }
  264. if (getParams.data.keyword == '') {
  265. delete getParams.data.keyword
  266. }
  267. queryWbsms(getParams).then((res) => {
  268. this.tableData = res.data || []
  269. this.total = res.count
  270. })
  271. },
  272. clickPic(row) {
  273. this.imgUrl = []
  274. if (row) {
  275. row.forEach((el) => {
  276. let obj = {
  277. name: el.description,
  278. url: el.url,
  279. }
  280. this.imgUrl.push(obj)
  281. })
  282. }
  283. this.$refs.picLargeOpen.open(this.imgUrl)
  284. },
  285. startMethods() {
  286. this.getList()
  287. },
  288. },
  289. watch: {
  290. diff(newV, oldV) {
  291. if (newV !== oldV) {
  292. this.getList()
  293. }
  294. },
  295. tabLabel(newV, oldV) {
  296. if (newV !== oldV) {
  297. // this.tabFind()
  298. this.getList()
  299. }
  300. },
  301. assetnum(newV, oldV) {
  302. if (newV !== oldV) {
  303. // this.tabFind()
  304. this.getList()
  305. }
  306. },
  307. ischange() {
  308. this.getList()
  309. },
  310. },
  311. mounted() {
  312. this.startMethods()
  313. },
  314. }
  315. </script>
  316. <style lang="less" scoped>
  317. .wb-list {
  318. .eq-list-top {
  319. display: flex;
  320. margin-bottom: 12px;
  321. .picker-box {
  322. display: flex;
  323. align-items: center;
  324. background: #fff;
  325. padding: 0 6px;
  326. border: 1px solid #dcdfe6;
  327. border-radius: 4px;
  328. height: 32px;
  329. box-sizing: border-box;
  330. margin-right: 12px;
  331. .picker-span {
  332. margin-right: 6px;
  333. color: rgba(0, 0, 0, 0.65);
  334. }
  335. }
  336. }
  337. td {
  338. overflow: hidden;
  339. text-overflow: ellipsis;
  340. white-space: nowrap;
  341. }
  342. .foot {
  343. height: 32px;
  344. display: flex;
  345. justify-content: flex-end;
  346. margin-top: 28px;
  347. }
  348. }
  349. </style>
  350. <style lang="less" >
  351. .wb-list {
  352. .picker-box {
  353. .el-input__inner {
  354. border: none;
  355. }
  356. .el-range-editor.el-input__inner {
  357. padding: 3px 0px;
  358. }
  359. .el-icon-date {
  360. display: none;
  361. }
  362. .el-range__close-icon {
  363. position: absolute;
  364. right: 0px;
  365. top: 2px;
  366. }
  367. .el-range-editor--mini .el-range-input {
  368. font-size: 14px;
  369. color: rgb(31, 36, 41);
  370. }
  371. }
  372. /deep/.el-table td {
  373. cursor: pointer;
  374. }
  375. }
  376. </style>