selectOrder.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <div>
  3. <el-dialog :visible.sync="visible" append-to-body width="50%">
  4. <div class="flex-align-center flex-between mt-10">
  5. <el-input style="width:200px" size="small" suffix-icon="el-icon-search" v-model="param.content.where.condition" placeholder="搜索" @keyup.enter.native="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)" clearable></el-input>
  6. </div>
  7. <div>
  8. <el-table
  9. ref="multipleTable"
  10. :data="tableData"
  11. style="width: 100%"
  12. size="mini"
  13. border>
  14. <el-table-column
  15. prop="sonum"
  16. label="订单号">
  17. </el-table-column>
  18. <el-table-column
  19. prop="type"
  20. label="订单类型">
  21. </el-table-column>
  22. <el-table-column
  23. prop="tradefield"
  24. label="领域">
  25. </el-table-column>
  26. <el-table-column
  27. prop="rebate_userate"
  28. label="订单使用返利占比">
  29. </el-table-column>
  30. <el-table-column
  31. label="操作"
  32. width="90">
  33. <template slot-scope="scope">
  34. <el-button type="text" size="small" @click="selectRow(scope.row)">选 择</el-button>
  35. </template>
  36. </el-table-column>
  37. </el-table>
  38. <div style="margin-top:16px;text-align:right">
  39. <el-pagination
  40. background
  41. small
  42. @size-change="handleSizeChange"
  43. @current-change="handleCurrentChange"
  44. :current-page="currentPage"
  45. :page-size="param.content.pageSize"
  46. layout="total, prev, pager, next, jumper"
  47. :total="total">
  48. </el-pagination>
  49. </div>
  50. </div>
  51. </el-dialog>
  52. <slot name="input"></slot>
  53. </div>
  54. </template>
  55. <script>
  56. export default {
  57. data () {
  58. return {
  59. visible:false,
  60. param:{
  61. "id": 20230105110003,
  62. "version":1,
  63. "content": {
  64. "where":{
  65. "condition":""
  66. }
  67. }
  68. },
  69. tableData: [],
  70. total:0,
  71. currentPage:0
  72. }
  73. },
  74. methods:{
  75. async listData () {
  76. this.param.content.istool = 1
  77. const res = await this.$api.requested(this.param)
  78. this.tableData = res.data
  79. this.total = res.total
  80. this.currentPage = res.pageNumber
  81. console.log(this.tableData);
  82. },
  83. handleSizeChange(val) {
  84. // console.log(`每页 ${val} 条`);
  85. this.param.content.pageSize = val
  86. this.listData()
  87. },
  88. handleCurrentChange(val) {
  89. // console.log(`当前页: ${val}`);
  90. this.param.content.pageNumber = val
  91. this.listData()
  92. },
  93. selectRow (row) {
  94. this.$emit('selectRow',row)
  95. }
  96. },
  97. created () {
  98. this.listData()
  99. },
  100. }
  101. </script>
  102. <style>
  103. </style>