zwTable.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <!-- 设备清单的有select的表格 -->
  2. <template>
  3. <div class='zw-list'>
  4. <div class='eq-list-top'>
  5. <Select width='146' tipPlace='top' caption='类别:' :selectdata='dataSelect2' :placeholder='"请选择"' @change='getList'></Select>
  6. <Select width='120' tipPlace='top' caption='楼层 :' :selectdata='dataSelect2' style='margin:0 12px' @change='getList'></Select>
  7. <Select width='224' tipPlace='top' caption='生产厂商:' :selectdata='dataSelect2' :placeholder='"请选择"' @change='getList'></Select>
  8. <a-input-search placeholder style='width: 192px;margin-left:12px;height:32px;' @search='getList' />
  9. </div>
  10. <el-table :data='tableData' :border='true' style='width: 100%'>
  11. <el-table-column type='index' label='序号' width='80'></el-table-column>
  12. <el-table-column prop='sbjbm' label='类别' width='160'></el-table-column>
  13. <el-table-column prop='sl' label='项目'></el-table-column>
  14. <el-table-column prop='brand' label='金额'></el-table-column>
  15. <el-table-column prop='sbxh' label='费用说明'></el-table-column>
  16. <el-table-column prop='floor' label='项目说明'></el-table-column>
  17. <el-table-column prop='wzjc' label='当前阶段' show-overflow-tooltip resizable width='140'></el-table-column>
  18. <el-table-column prop='manufacturer' label='开始日期'></el-table-column>
  19. <el-table-column prop='manufacturer' label='验收日期'></el-table-column>
  20. </el-table>
  21. <div class='foot'>
  22. <el-pagination
  23. background
  24. layout='prev, pager, next'
  25. :total='total/size'
  26. :page-size='size'
  27. @prev-click='pageChanged'
  28. @next-click='pageChanged'
  29. @current-change='pageChanged'
  30. ></el-pagination>
  31. </div>
  32. </div>
  33. </template>
  34. <script>
  35. import Select from '@/components/Select/Select.vue'
  36. import { queryEquipmentList } from '@/api/equipmentList.js'
  37. export default {
  38. components: { Select },
  39. data() {
  40. return {
  41. dataSelect2: [
  42. { id: 'test1', name: '选择项' },
  43. { id: 'test2', name: '单平米' },
  44. { id: 'test3', name: '下级分项' },
  45. { id: 'test4', name: '滑动平均滑动平均' }
  46. ],
  47. tableData: [],
  48. total: 0,
  49. currentPage: 1,
  50. size: 10
  51. }
  52. },
  53. props: ['param', 'major'],
  54. methods: {
  55. pageChanged(page, size) {
  56. this.currentPage = page
  57. this.size = size
  58. this.getList()
  59. },
  60. getList() {
  61. let postParams = {
  62. CLASSSTRUCTUREID: this.param
  63. }
  64. let data = {
  65. page: this.currentPage,
  66. size: this.size,
  67. plazaId: this.$store.state.plazaId,
  68. major: this.major
  69. }
  70. queryEquipmentList({ data, postParams }).then(res => {
  71. console.log(res)
  72. this.tableData = res.data.data
  73. this.total = res.data.count
  74. })
  75. }
  76. },
  77. watch: {
  78. param(newV, oldV) {
  79. if (newV !== oldV) {
  80. this.getList()
  81. }
  82. }
  83. },
  84. mounted() {
  85. this.getList()
  86. }
  87. }
  88. </script>
  89. <style lang="less" scoped>
  90. .zw-list {
  91. .eq-list-top {
  92. display: flex;
  93. }
  94. .foot {
  95. position: absolute;
  96. height: 32px;
  97. right: 26px;
  98. bottom: 20px;
  99. }
  100. td {
  101. overflow: hidden;
  102. text-overflow: ellipsis;
  103. white-space: nowrap;
  104. }
  105. }
  106. </style>