list.vue 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <div class="container normal-panel">
  3. <p class="normal-title normal-margin">业务员信息</p>
  4. <div class="flex-align-center flex-between normal-margin">
  5. <div class="flex-align-center search-panel">
  6. <p>搜索:</p>
  7. <el-input style="width:200px" size="small" placeholder="业务员名称,编号,手机号" @keyup.native.enter="query_saler(param.content.sa_saleareaid)" @clear="(param.content.where.condition = '',query_saler(param.content.sa_saleareaid))" v-model="param.content.where.condition" prefix-icon="el-icon-search" clearable></el-input>
  8. </div>
  9. <div>
  10. <slot name="agent_type"></slot>
  11. <slot name="add"></slot>
  12. </div>
  13. </div>
  14. <tableLayout :layout="tablecols" :data="list" :custom="false" height="calc(100vh - 495px)">
  15. <template v-slot:opreation="scope">
  16. <slot name="detail" :data="scope.data"></slot>
  17. <slot name="del" :data="scope.data"></slot>
  18. </template>
  19. </tableLayout>
  20. <div style="margin-top:16px;text-align:right">
  21. <el-pagination
  22. background
  23. small
  24. @size-change="handleSizeChange"
  25. @current-change="handleCurrentChange"
  26. :current-page="currentPage"
  27. :page-size="param.content.pageSize"
  28. layout="total, prev, pager, next, jumper"
  29. :total="total">
  30. </el-pagination>
  31. </div>
  32. </div>
  33. </template>
  34. <script>
  35. import { log } from '@antv/g2plot/lib/utils'
  36. export default {
  37. props:['data'],
  38. data () {
  39. return {
  40. tablecols:[],
  41. list:[],
  42. total:0,
  43. currentPage:1,
  44. param:{
  45. "classname": "webmanage.sale.salearea.salearea",
  46. "method": "query_saler",
  47. "content": {
  48. "pageSize":20,
  49. "pageNumber":1,
  50. "sa_saleareaid":'',
  51. "where":{}
  52. }
  53. }
  54. }
  55. },
  56. methods:{
  57. async query_saler (sa_saleareaid) {
  58. this.param.content.sa_saleareaid = sa_saleareaid
  59. const res = await this.$api.requested(this.param)
  60. this.list = res.data
  61. this.total = res.total
  62. this.currentPage = res.pageNumber
  63. console.log(this.list);
  64. },
  65. handleSizeChange(val) {
  66. // console.log(`每页 ${val} 条`);
  67. this.param.content.pageSize = val
  68. this.query_saler(this.param.content.sa_saleareaid)
  69. },
  70. handleCurrentChange(val) {
  71. // console.log(`当前页: ${val}`);
  72. this.param.content.pageNumber = val
  73. this.query_saler(this.param.content.sa_saleareaid)
  74. }
  75. },
  76. mounted () {
  77. // this.query_saler()
  78. },
  79. created () {
  80. // 获取角色表结构
  81. this.tablecols = this.tool.tabelCol(this.$route.name)['salerTable'].tablecols
  82. }
  83. }
  84. </script>
  85. <style>
  86. </style>
  87. <style scoped>
  88. .search-panel p{
  89. width:40px;
  90. font-size:14px
  91. }
  92. </style>