selectOrder.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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="$t('搜索')" @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="$t('订单号')">
  17. </el-table-column>
  18. <el-table-column
  19. prop="type"
  20. :label="$t(`订单类型`)">
  21. </el-table-column>
  22. <el-table-column
  23. prop="tradefield"
  24. :label="$t(`领域`)">
  25. </el-table-column>
  26. <el-table-column
  27. prop="rebate_userate"
  28. :label="$t(`订单使用返利占比`)">
  29. </el-table-column>
  30. <el-table-column
  31. :label="$t('操作')"
  32. width="90">
  33. <template slot-scope="scope">
  34. <el-button type="text" size="small" @click="selectRow(scope.row)">{{$t('选 择')}}</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. "sys_enterpriseid":'',
  65. "pageSize":20,
  66. "pageNumber":1,
  67. "where":{
  68. "condition":""
  69. }
  70. }
  71. },
  72. tableData: [],
  73. total:0,
  74. currentPage:0
  75. }
  76. },
  77. methods:{
  78. async listData () {
  79. const res = await this.$api.requested(this.param)
  80. this.tableData = res.data
  81. this.total = res.total
  82. this.currentPage = res.pageNumber
  83. console.log(this.tableData);
  84. },
  85. handleSizeChange(val) {
  86. // console.log(`每页 ${val} 条`);
  87. this.param.content.pageSize = val
  88. this.listData()
  89. },
  90. handleCurrentChange(val) {
  91. // console.log(`当前页: ${val}`);
  92. this.param.content.pageNumber = val
  93. this.listData()
  94. },
  95. selectRow (row) {
  96. this.$emit('selectRow',row)
  97. }
  98. },
  99. created () {
  100. },
  101. }
  102. </script>
  103. <style scoped>
  104. /deep/ .el-input__validateIcon {
  105. display: none;
  106. }
  107. </style>