wxTable.vue 11 KB

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