wbTable.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  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='getList'
  9. @blur='getList'
  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='getList'
  19. @blur='getList'
  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='getList'
  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='getList'
  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='getList'
  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}'>{{number_format(row.cost,2) || '--'}}</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. @prev-click='pageChanged'
  129. @next-click='pageChanged'
  130. @current-change='pageChanged'
  131. ></el-pagination>
  132. <pic-large :imgUrl='imgUrl' ref='picLargeOpen'></pic-large>
  133. </div>
  134. </div>
  135. </template>
  136. <script>
  137. import { queryWbsms } from '@/api/equipmentList.js'
  138. import { mapGetters } from 'vuex'
  139. import { Select } from 'meri-design'
  140. import inputDialog from './inputDIalog'
  141. import { formatterTime, number_format } from '@/utils/format.js'
  142. export default {
  143. components: { Select, inputDialog },
  144. data() {
  145. return {
  146. tableData: [],
  147. total: 0,
  148. currentPage: 1,
  149. sjjssj: '',
  150. reportdate: '',
  151. ischange: '2',
  152. sbjc: '',
  153. formatterTime,
  154. number_format,
  155. changeOption: [
  156. {
  157. id: '2',
  158. name: '全部',
  159. },
  160. {
  161. id: '1',
  162. name: '是',
  163. },
  164. {
  165. id: ' 0',
  166. name: '否',
  167. },
  168. ],
  169. imgUrl: [],
  170. shjc: '',
  171. gzglid: '',
  172. matters: ''
  173. }
  174. },
  175. props: ['smsxt', 'diff', 'tabLabel', 'size', 'assetnum'],
  176. computed: {
  177. ...mapGetters(['floorSelect']),
  178. },
  179. methods: {
  180. //序号的方法
  181. indexMethod(index) {
  182. return (this.currentPage - 1) * this.size + index + 1
  183. },
  184. //工单详情
  185. innerTable(row) {
  186. console.log(row)
  187. if (row.apptype == '外委' || row.apptype == '自维') {
  188. if (row.wb_gzglid) {
  189. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.wb_gzglid}`)
  190. }
  191. } else if (row.apptype == '安全维保') {
  192. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=AQ_WB_GZGL&uniqueid=${row.wb_gzglid}`)
  193. }
  194. },
  195. // 工单
  196. ycgd(row) {
  197. if (row.apptype == '外委' || row.apptype == '自维') {
  198. if (row.wb_gzglid) {
  199. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.wb_gzglid}`)
  200. }
  201. } else if (row.apptype == '安全维保') {
  202. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=WB_GZGL&uniqueid=${row.wb_gzglid}`)
  203. }
  204. },
  205. //多余输入框监听
  206. confirm(gzglid) {
  207. this.gzglid = gzglid
  208. this.getList()
  209. },
  210. pageChanged(page) {
  211. this.currentPage = page
  212. this.getList()
  213. },
  214. getList() {
  215. let getParams = {
  216. data: {
  217. smsxt: this.smsxt,
  218. diff: this.diff,
  219. plazaId: this.$store.state.plazaId,
  220. page: this.currentPage,
  221. size: this.size,
  222. },
  223. }
  224. if (this.assetnum) {
  225. getParams.data.assetnum = this.assetnum
  226. }
  227. //下拉
  228. if (this.ischange && this.ischange != 2) {
  229. // getParams.data.ischangepj = this.ischange
  230. getParams.data.ismodel = this.ischange
  231. }
  232. if (this.sjjssj) {
  233. getParams.data.sjjssjStartDate = this.sjjssj[0] + '000000'
  234. getParams.data.sjjssjEndDate = this.sjjssj[1] + '000000'
  235. }
  236. if (this.reportdate) {
  237. getParams.data.reportdateStartDate = this.reportdate[0] + '000000'
  238. getParams.data.reportdateEndDate = this.reportdate[1] + '000000'
  239. }
  240. //输入框
  241. getParams.data.keyword = ''
  242. if (this.sbjc) {
  243. console.log(this.sbjc)
  244. getParams.data.keyword += `${this.sbjc}:sbmc,assetnum;`
  245. }
  246. if (this.matters) {
  247. getParams.data.keyword += `${this.matters}:description,matters;`
  248. }
  249. if (this.gzglid) {
  250. getParams.data.keyword += `${this.gzglid}:wb_gzglid;`
  251. }
  252. if (getParams.data.keyword == '') {
  253. delete getParams.data.keyword
  254. }
  255. queryWbsms(getParams).then((res) => {
  256. this.tableData = res.data || []
  257. this.total = res.count
  258. })
  259. },
  260. clickPic(row) {
  261. this.imgUrl = []
  262. if (row) {
  263. row.forEach((el) => {
  264. let obj = {
  265. name: el.description,
  266. url: el.url,
  267. }
  268. this.imgUrl.push(obj)
  269. })
  270. }
  271. this.$refs.picLargeOpen.open(this.imgUrl)
  272. },
  273. startMethods() {
  274. this.getList()
  275. },
  276. },
  277. watch: {
  278. diff(newV, oldV) {
  279. if (newV !== oldV) {
  280. this.getList()
  281. }
  282. },
  283. tabLabel(newV, oldV) {
  284. if (newV !== oldV) {
  285. // this.tabFind()
  286. this.getList()
  287. }
  288. },
  289. ischange() {
  290. this.getList()
  291. },
  292. },
  293. mounted() {
  294. this.startMethods()
  295. },
  296. }
  297. </script>
  298. <style lang="less" scoped>
  299. .wb-list {
  300. .eq-list-top {
  301. display: flex;
  302. margin-bottom: 12px;
  303. .picker-box {
  304. display: flex;
  305. align-items: center;
  306. background: #fff;
  307. padding: 0 6px;
  308. border: 1px solid #dcdfe6;
  309. border-radius: 4px;
  310. height: 32px;
  311. box-sizing: border-box;
  312. margin-right: 12px;
  313. .picker-span {
  314. margin-right: 6px;
  315. color: rgba(0, 0, 0, 0.65);
  316. }
  317. }
  318. }
  319. td {
  320. overflow: hidden;
  321. text-overflow: ellipsis;
  322. white-space: nowrap;
  323. }
  324. .foot {
  325. height: 32px;
  326. display: flex;
  327. justify-content: flex-end;
  328. margin-top: 28px;
  329. }
  330. }
  331. </style>
  332. <style lang="less" >
  333. .wb-list {
  334. .picker-box {
  335. .el-input__inner {
  336. border: none;
  337. }
  338. .el-range-editor.el-input__inner {
  339. padding: 3px 0px;
  340. }
  341. .el-icon-date {
  342. display: none;
  343. }
  344. .el-range__close-icon {
  345. position: absolute;
  346. right: 0px;
  347. top: 2px;
  348. }
  349. .el-range-editor--mini .el-range-input {
  350. font-size: 14px;
  351. color: rgb(31, 36, 41);
  352. }
  353. }
  354. /deep/.el-table td {
  355. cursor: pointer;
  356. }
  357. }
  358. </style>