wxTable.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <!-- 维修-->
  2. <template>
  3. <div class='wb-list'>
  4. <div class='eq-list-top'>
  5. <a-input-search
  6. placeholder='按照设备名称、设备编号、重要事项记录、描述、任务编号等搜索'
  7. style='width: 192px;margin-bottom:12px;height:32px;margin-right:12px'
  8. @search='onSearch'
  9. />
  10. <el-date-picker size='small' v-model='startDate' type='date' placeholder='选择填报时间' @change='getList' style='margin-right:12px'></el-date-picker>
  11. <el-date-picker size='small' v-model='endDate' type='date' placeholder='选择验收时间' @change='getList' style='margin-right:12px'></el-date-picker>
  12. <Select @change='getList' width='120' tipPlace='top' caption='是否更换配件信息 :' :selectdata='floorSelect'></Select>
  13. <Select @change='getList' width='120' tipPlace='top' caption='楼层 :' :selectdata='floorSelect'></Select>
  14. </div>
  15. <el-table :data='tableData' style='width: 100%'>
  16. <el-table-column type='index' label='序号' width='80'></el-table-column>
  17. <el-table-column prop='sbjc' label='设备名称' width='160'></el-table-column>
  18. <el-table-column prop='sbjbm' label='设备编码'></el-table-column>
  19. <el-table-column prop='matters' label='重要事项记录'></el-table-column>
  20. <el-table-column prop='description' label='描述'></el-table-column>
  21. <el-table-column label='更换配件信息'>
  22. <el-table-column prop='ischangepj' label='是/否更换' width='120'></el-table-column>
  23. <el-table-column prop='model' label='配件名称型号' width='120'></el-table-column>
  24. <el-table-column prop='address' label='数量' width='300'></el-table-column>
  25. <el-table-column prop='cost' label='费用(万元)' width='120'></el-table-column>
  26. <el-table-column prop='source' label='费用出处' width='120'></el-table-column>
  27. </el-table-column>
  28. <el-table-column prop='brand' label='现场照片'></el-table-column>
  29. <el-table-column prop='startDate' label='填报时间'></el-table-column>
  30. <el-table-column prop='enddate' label='验收时间'></el-table-column>
  31. <el-table-column prop='wonum' label='工单编号'></el-table-column>
  32. </el-table>
  33. <div class='foot'>
  34. <el-pagination
  35. background
  36. layout='prev, pager, next'
  37. :total='total'
  38. :page-size='size'
  39. @prev-click='pageChanged'
  40. @next-click='pageChanged'
  41. @current-change='pageChanged'
  42. ></el-pagination>
  43. </div>
  44. </div>
  45. </template>
  46. <script>
  47. import { queryWx } from '@/api/equipmentList.js'
  48. import { mapGetters } from 'vuex'
  49. export default {
  50. data() {
  51. return {
  52. pageSize: 10,
  53. tableData: [],
  54. total: 0,
  55. currentPage: 1,
  56. size: 10,
  57. floorSelect: [],
  58. startDate: '',
  59. endDate: ''
  60. }
  61. },
  62. computed: {
  63. ...mapGetters(['floorsArr'])
  64. },
  65. props: ['smsxt', 'major'],
  66. methods: {
  67. onSearch() {},
  68. pageChanged(page, size) {
  69. this.currentPage = page
  70. this.size = size
  71. this.getList()
  72. },
  73. getList() {
  74. let getParams = {
  75. data: {
  76. smsxt: this.smsxt,
  77. tab: this.major,
  78. // plazaId: this.$store.state.plazaId,
  79. plazaId: '1000303',
  80. page: this.currentPage,
  81. size: this.size
  82. }
  83. }
  84. queryWx(getParams).then(res => {
  85. this.tableData = res.data || []
  86. this.total = res.count
  87. })
  88. },
  89. init() {
  90. this.floorSelect = []
  91. if (this.floorsArr.length > 0) {
  92. this.floorsArr.forEach(e => {
  93. let obj = {
  94. id: e,
  95. name: e
  96. }
  97. this.floorSelect.push(obj)
  98. })
  99. }
  100. }
  101. },
  102. watch: {
  103. smsxt(newV, oldV) {
  104. if (newV !== oldV) {
  105. this.init()
  106. this.getList()
  107. }
  108. }
  109. },
  110. mounted() {
  111. this.init()
  112. this.getList()
  113. }
  114. }
  115. </script>
  116. <style lang="less" scoped>
  117. .wb-list {
  118. .eq-list-top {
  119. display: flex;
  120. }
  121. .foot {
  122. position: absolute;
  123. height: 32px;
  124. right: 26px;
  125. }
  126. td {
  127. overflow: hidden;
  128. text-overflow: ellipsis;
  129. white-space: nowrap;
  130. }
  131. }
  132. </style>