wxTable.vue 13 KB

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