index.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-list-page');
  4. ComponentHelper::loadComponentView('com-list-table');
  5. ComponentHelper::loadComponentView('com-export-dialog');
  6. ComponentHelper::loadComponentView('com-user-info');
  7. ?>
  8. <com-list-page :crumbs="crumbs" id="application">
  9. <com-list-table
  10. ref="table"
  11. @selection-change="handleSelectionChange"
  12. :search-list="searchList"
  13. @search="handleSearch"
  14. @set-action-name="setActionName"
  15. :active-name="activeName"
  16. :api-params="apiParams"
  17. @get-api-data="getApiData"
  18. >
  19. <el-table-column prop="user_id" label="用户ID" align="center"></el-table-column>
  20. <el-table-column prop="user" align="center" min-width="180" label="用户信息">
  21. <template slot-scope="scope">
  22. <com-user-info :user="scope.row.user"></com-user-info>
  23. </template>
  24. </el-table-column>
  25. <el-table-column prop="equal_award_price" label="已结算平级奖" align="center"></el-table-column>
  26. <el-table-column prop="equal_award_frozen_price" label="待结算平级奖" align="center"></el-table-column>
  27. <el-table-column prop="difference_profit" label="差价利润" align="center"></el-table-column>
  28. <el-table-column prop="loss_amount" label="流失金额" align="center"></el-table-column>
  29. <template slot="header-left">
  30. <com-export-dialog
  31. style="margin-left: 20px "
  32. :field_list='exportList'
  33. :action_url='export_url'
  34. :params="searchInfo">
  35. </com-export-dialog>
  36. </template>
  37. </com-list-table>
  38. </com-list-page>
  39. <script>
  40. const application = new Vue({
  41. el: '#application',
  42. data: {
  43. crumbs: [
  44. {
  45. title: '数据统计',
  46. router: '',
  47. }
  48. ],
  49. searchList: [
  50. {
  51. key: 'keyword',
  52. title: '请输入用户昵称/手机号搜索',
  53. type: 'text',
  54. },
  55. {
  56. key: 'date',
  57. title: '日期',
  58. type: 'date-picker',
  59. valueFormat: 'yyyy-MM-dd',
  60. },
  61. ],
  62. btnLoad: false,
  63. apply_edit: false,
  64. id: 0,
  65. remark: '',
  66. check_remark: '',
  67. check_status: '1',
  68. export_url: 'cloud-stock/statistics/index', // 导出路径
  69. exportList: {},
  70. searchInfo: {
  71. active_name: 'settlement',
  72. },
  73. activeName: 'settlement',
  74. apiParams: {
  75. r: 'cloud-stock/statistics/index',
  76. active_name: 'settlement',
  77. },
  78. multipleSelection: []
  79. },
  80. mounted() {
  81. this.getExportList();
  82. },
  83. methods: {
  84. getExportList() {
  85. this.listLoading = true;
  86. let params = {
  87. r: 'cloud-stock/statistics/get-export-list',
  88. };
  89. request({
  90. params: params,
  91. method: 'get',
  92. }).then(e => {
  93. if (e.data.code == 0) {
  94. this.exportList = e.data.data;
  95. } else {
  96. this.$message.error(e.data.msg);
  97. }
  98. }).catch(e => {
  99. this.loading = false;
  100. });
  101. },
  102. handleSelectionChange(val) {
  103. this.multipleSelection = val;
  104. },
  105. handleSearch(keyword) {
  106. this.searchInfo = keyword;
  107. this.searchInfo.active_name = this.activeName;
  108. },
  109. setActionName(val) {
  110. this.searchInfo.active_name = val;
  111. this.activeName = val
  112. this.$set(this.apiParams, "active_name", val)
  113. this.$refs.table.handleSearch();
  114. },
  115. getApiData(data) {
  116. },
  117. }
  118. })
  119. </script>