selectOrder.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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="billno"
  16. label="单号">
  17. </el-table-column>
  18. <el-table-column
  19. prop="agentnum"
  20. label="经销商编号">
  21. </el-table-column>
  22. <el-table-column
  23. prop="enterprisename"
  24. label="经销商">
  25. </el-table-column>
  26. <el-table-column
  27. prop="reason"
  28. label="申请原因">
  29. </el-table-column>
  30. <el-table-column
  31. prop="billdate"
  32. label="提交日期">
  33. </el-table-column>
  34. <el-table-column
  35. label="操作"
  36. width="90">
  37. <template slot-scope="scope">
  38. <el-button type="text" size="small" @click="selectRow(scope.row)">选 择</el-button>
  39. </template>
  40. </el-table-column>
  41. </el-table>
  42. <div style="margin-top:16px;text-align:right">
  43. <el-pagination
  44. background
  45. small
  46. @size-change="handleSizeChange"
  47. @current-change="handleCurrentChange"
  48. :current-page="currentPage"
  49. :page-size="param.content.pageSize"
  50. layout="total, prev, pager, next, jumper"
  51. :total="total">
  52. </el-pagination>
  53. </div>
  54. </div>
  55. </el-dialog>
  56. <slot name="input"></slot>
  57. </div>
  58. </template>
  59. <script>
  60. export default {
  61. data () {
  62. return {
  63. visible:false,
  64. param:{
  65. "id": 20230206091703,
  66. "version":1,
  67. "content": {
  68. "where":{
  69. "condition":""
  70. }
  71. }
  72. },
  73. tableData: [],
  74. total:0,
  75. currentPage:0
  76. }
  77. },
  78. methods:{
  79. async listData () {
  80. const res = await this.$api.requested(this.param)
  81. this.tableData = res.data
  82. this.total = res.total
  83. this.currentPage = res.pageNumber
  84. console.log(this.tableData);
  85. },
  86. handleSizeChange(val) {
  87. // console.log(`每页 ${val} 条`);
  88. this.param.content.pageSize = val
  89. this.listData()
  90. },
  91. handleCurrentChange(val) {
  92. // console.log(`当前页: ${val}`);
  93. this.param.content.pageNumber = val
  94. this.listData()
  95. },
  96. selectRow (row) {
  97. this.$emit('selectRow',row)
  98. }
  99. },
  100. created () {
  101. },
  102. }
  103. </script>
  104. <style>
  105. </style>