wbTable.vue 11 KB

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