wxTable.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  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. <el-table :data='tableData' :border='true' style='width: 100%' @row-click='innerTable'>
  67. <el-table-column type='index' label='序号' width='60' :index='indexMethod'></el-table-column>
  68. <el-table-column prop='sbmc' label='设备名称' show-overflow-tooltip resizable min-width='460'>
  69. <template slot-scope='{row}'>{{row.sbmc || '--'}}</template>
  70. </el-table-column>
  71. <el-table-column prop='assetnum' label='设备编码' show-overflow-tooltip resizable width='80'>
  72. <template slot-scope='{row}'>{{row.assetnum || '--'}}</template>
  73. </el-table-column>
  74. <el-table-column prop='matters' label='重要事项记录' width='180' show-overflow-tooltip resizable>
  75. <template slot-scope='{row}'>{{row.matters || '--'}}</template>
  76. </el-table-column>
  77. <el-table-column prop='description' label='描述' show-overflow-tooltip resizable min-width='340'>
  78. <template slot-scope='{row}'>{{row.description || '--'}}</template>
  79. </el-table-column>
  80. <el-table-column label='更换配件信息' align='center'>
  81. <el-table-column prop='ischangepj' label='是/否更换' width='80'>
  82. <template slot-scope='{row}'>{{row.ismodel==1?'是':(row.ismodel==0?"否" :'--')}}</template>
  83. </el-table-column>
  84. <el-table-column prop='model' label='配件名称型号' width='140' show-overflow-tooltip resizable>
  85. <template slot-scope='{row}'>{{row.model || '--'}}</template>
  86. </el-table-column>
  87. <el-table-column prop='sl' label='数量' width='80'>
  88. <template slot-scope='{row}'>{{row.sl>=0?row.sl:'--'}}</template>
  89. </el-table-column>
  90. <el-table-column prop='cost' label='费用(万元)' width='80' align='right'>
  91. <template slot-scope='{row}'>{{number_format(row.cost,2) || '--'}}</template>
  92. </el-table-column>
  93. <el-table-column prop='source' label='费用出处' show-overflow-tooltip resizable width='100'>
  94. <template slot-scope='{row}'>{{row.source || '--'}}</template>
  95. </el-table-column>
  96. </el-table-column>
  97. <el-table-column prop='brand' label='现场照片' width='80'>
  98. <template slot-scope='{row}'>
  99. <div
  100. v-if='row.glsmsImage'
  101. style='cursor:pointer;color: #0091ff;'
  102. @click.stop='clickPic(row.glsmsImage)'
  103. >{{row.glsmsImage.length+'张'}}</div>
  104. <div v-else>{{'--'}}</div>
  105. </template>
  106. </el-table-column>
  107. <el-table-column prop='reportdate' label='填报时间' width='140'>
  108. <template slot-scope='{row}'>{{row.reportdate?formatter(row.reportdate): '--'}}</template>
  109. </el-table-column>
  110. <el-table-column prop='sjjssj' label='验收时间' width='140'>
  111. <template slot-scope='{row}'>{{row.sjjssj?formatter(row.sjjssj): '--'}}</template>
  112. </el-table-column>
  113. <el-table-column prop='wonum' label='工单编号' show-overflow-tooltip resizable width='80'>
  114. <template slot-scope='{row}'>
  115. <div v-if='row.wonum' @click.stop='staff' style='cursor:pointer;color: #0091ff;'>{{row.wonum}}</div>
  116. <div v-else>{{'--'}}</div>
  117. </template>
  118. </el-table-column>
  119. </el-table>
  120. <div class='foot'>
  121. <el-pagination
  122. background
  123. layout='prev, pager, next'
  124. :total='total'
  125. :page-size='size'
  126. @prev-click='pageChanged'
  127. @next-click='pageChanged'
  128. @current-change='pageChanged'
  129. ></el-pagination>
  130. <pic-large :imgUrl='imgUrl' ref='picLargeOpen'></pic-large>
  131. </div>
  132. </div>
  133. </template>
  134. <script>
  135. import { queryWx } from '@/api/equipmentList.js'
  136. import { mapGetters } from 'vuex'
  137. import inputDialog from './inputDIalog'
  138. import { Select } from 'meri-design'
  139. import { formatter, number_format } from '@/utils/format.js'
  140. export default {
  141. components: { Select, inputDialog },
  142. data() {
  143. return {
  144. tableData: [],
  145. total: 0,
  146. currentPage: 1,
  147. size: 11,
  148. reportdate: '',
  149. sjjssj: '',
  150. ischange: '',
  151. sbjc: '',
  152. matters: '',
  153. wonum: '',
  154. formatter,
  155. number_format,
  156. imgUrl: [],
  157. changeOption: [
  158. {
  159. id: '1',
  160. name: '是'
  161. },
  162. {
  163. id: '0',
  164. name: '否'
  165. }
  166. ],
  167. keyword: ''
  168. }
  169. },
  170. computed: {
  171. ...mapGetters(['floorSelect'])
  172. },
  173. props: ['smsxt', 'major', 'diff', 'tabLabel'],
  174. methods: {
  175. //序号的方法
  176. indexMethod(index) {
  177. return (this.currentPage - 1) * this.size + index + 1
  178. },
  179. innerTable(row) {
  180. if (row.workorderid) {
  181. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=JXWO&uniqueid=${row.workorderid}`, true)
  182. }
  183. },
  184. //跳转工单编号
  185. staff(row) {
  186. window.open(`http://gcgl.wanda.cn/maximo/ui/?event=loadapp&value=JXWO&uniqueid=${row.wonum}`, true)
  187. },
  188. //多余输入框监听
  189. confirm(wonum) {
  190. this.wonum = wonum
  191. this.getList()
  192. },
  193. pageChanged(page) {
  194. this.currentPage = page
  195. this.getList()
  196. },
  197. getList() {
  198. let getParams = {
  199. data: {
  200. smsxt: this.smsxt,
  201. diff: this.diff,
  202. plazaId: this.$store.state.plazaId,
  203. page: this.currentPage,
  204. size: this.size
  205. }
  206. }
  207. //下拉
  208. if (this.ischange) {
  209. getParams.data.ismodel = this.ischange
  210. // getParams.data.ischangepj = this.ischange
  211. }
  212. if (this.sjjssj) {
  213. getParams.data.sjjssjStartDate = this.sjjssj[0] + '000000'
  214. getParams.data.sjjssjEndDate = this.sjjssj[1] + '000000'
  215. }
  216. if (this.reportdate) {
  217. getParams.data.reportdateStartDate = this.reportdate[0] + '000000'
  218. getParams.data.reportdateEndDate = this.reportdate[1] + '000000'
  219. }
  220. //输入框搜索
  221. getParams.data.keyword = ''
  222. if (this.sbjc) {
  223. getParams.data.keyword += `${this.sbjc}:sbmc,assetnum;`
  224. }
  225. if (this.matters) {
  226. getParams.data.keyword += `${this.matters}:description,matters;`
  227. }
  228. if (this.wonum) {
  229. getParams.data.keyword += `${this.wonum}:wonum`
  230. }
  231. if (getParams.data.keyword == '') {
  232. delete getParams.data.keyword
  233. }
  234. queryWx(getParams).then(res => {
  235. this.tableData = res.data || []
  236. this.total = res.count
  237. })
  238. },
  239. clickPic(row) {
  240. this.imgUrl = []
  241. if (row) {
  242. row.forEach(el => {
  243. let obj = {
  244. name: el.description,
  245. url: el.url
  246. }
  247. this.imgUrl.push(obj)
  248. })
  249. }
  250. this.$refs.picLargeOpen.open(this.imgUrl)
  251. }
  252. },
  253. watch: {
  254. diff(newV, oldV) {
  255. if (newV !== oldV) {
  256. this.getList()
  257. }
  258. },
  259. tabLabel(newV, oldV) {
  260. if (newV !== oldV) {
  261. // this.tabFind()
  262. this.getList()
  263. }
  264. },
  265. ischange() {
  266. this.getList()
  267. }
  268. },
  269. mounted() {
  270. this.getList()
  271. }
  272. }
  273. </script>
  274. <style lang="less" scoped>
  275. .wx-list {
  276. min-width: 1366px;
  277. .eq-list-top {
  278. display: flex;
  279. margin-bottom: 12px;
  280. .picker-box {
  281. display: flex;
  282. align-items: center;
  283. background: #fff;
  284. padding: 0 6px;
  285. border: 1px solid #dcdfe6;
  286. border-radius: 4px;
  287. height: 32px;
  288. box-sizing: border-box;
  289. margin-right: 12px;
  290. .picker-span {
  291. margin-right: 6px;
  292. color: rgba(0, 0, 0, 0.65);
  293. }
  294. }
  295. }
  296. td {
  297. overflow: hidden;
  298. text-overflow: ellipsis;
  299. white-space: nowrap;
  300. }
  301. .foot {
  302. height: 32px;
  303. display: flex;
  304. justify-content: flex-end;
  305. margin-top: 28px;
  306. }
  307. }
  308. </style>
  309. <style lang="less" >
  310. .wx-list {
  311. .picker-box {
  312. .el-input__inner {
  313. border: none;
  314. }
  315. .el-range-editor.el-input__inner {
  316. padding: 3px 0px;
  317. }
  318. .el-icon-date {
  319. display: none;
  320. }
  321. .el-range__close-icon {
  322. position: absolute;
  323. right: 0px;
  324. top: 2px;
  325. }
  326. .el-range-editor--mini .el-range-input {
  327. font-size: 14px;
  328. color: rgb(31, 36, 41);
  329. }
  330. }
  331. }
  332. </style>