rcwxTable.vue 13 KB

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