user.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-export-dialog');
  4. ?>
  5. <style>
  6. .item-box .label{
  7. margin-right:5px;
  8. }
  9. .item-box .search-btn{
  10. margin-left:10px;
  11. }
  12. </style>
  13. <div id="app" v-cloak>
  14. <el-card shadow="never" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  15. <div slot="header">
  16. <div>
  17. <span>用户种子金</span>
  18. </div>
  19. </template>
  20. </div>
  21. <div class="table-body el-input--small">
  22. <!-- <el-form size="small" :inline="true" flex="dir:left cross:center" style="margin-bottom: 12px;">
  23. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
  24. <div class="label">用户编号</div>
  25. <el-input style="width: 80px" v-model="search.user_id" placeholder="订单号"></el-input>
  26. </div>
  27. <div class="item-box" flex="dir:left cross:center" style="margin-right: 20px">
  28. <div class="label">用户手机号</div>
  29. <el-input style="width: 80px" v-model="search.user_id" placeholder="订单号"></el-input>
  30. </div>
  31. <div class="item-box" flex="dir:left cross:center">
  32. <el-button type="primary" class="search-btn" style="padding: 12px 34px !important;" @click="searchs">搜索
  33. </el-button>
  34. <el-button type="primary" class="search-btn" style="padding: 12px 34px !important;" @click="searchs">导出
  35. </el-button>
  36. </div>
  37. </el-form> -->
  38. <el-form :model="search" ref="searchForm" label-width="100px">
  39. <el-row>
  40. <el-col :span="5">
  41. <el-form-item label="用户编号" prop="user_id">
  42. <el-input v-model="search.user_id" placeholder="用户ID"></el-input>
  43. </el-form-item>
  44. </el-col>
  45. <el-col :span="5">
  46. <el-form-item label="用户手机号" prop="mobile">
  47. <el-input v-model="search.mobile" placeholder="用户手机号"></el-input>
  48. </el-form-item>
  49. </el-col>
  50. <el-col :span="5">
  51. <div class="item-box" flex="dir:left cross:center">
  52. <el-button type="primary" size="small" class="search-btn" @click="searchs">搜索</el-button>
  53. <com-export-dialog style="margin-left: 10px;" :field_list='export_list' :action_url="export_url" :params="search">
  54. </com-export-dialog>
  55. </div>
  56. </el-col>
  57. </el-row>
  58. </el-form>
  59. <el-table v-loading="listLoading" :data="list" stripe style="width: 100%">
  60. <el-table-column prop="user_id" label="用户ID" align="center"></el-table-column>
  61. <el-table-column prop="scope" label="用户" align="center">
  62. <template slot-scope="scope" >
  63. <div style="display:flex;justify-content: space-evenly;">
  64. <div style="font-size: 13px;" >{{scope.row.user.nickname}}</div>
  65. <div style="font-size: 13px;" >{{scope.row.user.mobile}}</div>
  66. </div>
  67. </template>
  68. </el-table-column>
  69. <el-table-column prop="total_seed_num" label="种子金数量" align="center"></el-table-column>
  70. <el-table-column prop="total_seed_cost" label="种子金总价值" align="center"></el-table-column>
  71. <el-table-column
  72. label="操作"
  73. min-width="180"
  74. align="center">
  75. <template slot-scope="scope">
  76. <el-button circle size="mini" type="text" @click="toOrder(scope.row.user_id)">
  77. 数据详情
  78. </el-button>
  79. </template>
  80. </el-table-column>
  81. </el-table>
  82. <div style="text-align: right;margin: 20px 0;">
  83. <el-pagination v-if="pagination" :page-size="pagination.pageSize"
  84. style="display: inline-block;float: right;" background @current-change="pageChange"
  85. layout="prev, pager, next" :total="pagination.total_count">
  86. </el-pagination>
  87. </div>
  88. </div>
  89. </el-card>
  90. </div>
  91. <script>
  92. const app = new Vue({
  93. el: '#app',
  94. data: {
  95. search:{
  96. user_id:'',
  97. mobile:'',
  98. },
  99. page:1,
  100. limit:20,
  101. list:[],
  102. listLoading: false,
  103. pagination:null,
  104. export_url: 'seed/index/user',
  105. export_list: {},
  106. },
  107. mounted() {
  108. this.getList();
  109. },
  110. methods: {
  111. getList() { //种子金用户记录
  112. let self = this;
  113. self.listLoading = true;
  114. request({
  115. method: 'get',
  116. params: {
  117. r: 'seed/index/user',
  118. page: self.page,
  119. limit:self.limit,
  120. user_id: self.search.user_id,
  121. mobile: self.search.mobile,
  122. },
  123. data: {},
  124. }).then(e => {
  125. self.listLoading = false;
  126. self.list = e.data.data.list;
  127. self.pagination = e.data.data.pagination;
  128. self.pagination.pageSize = e.data.data.page_size;
  129. self.pagination.total_count = e.data.data.count;
  130. self.export_list = e.data.data.export_list;
  131. }).catch(e => {
  132. console.log(e);
  133. });
  134. },
  135. toOrder(user_id){
  136. //this.$router.replace({name:'/seed/index/user',query:{user_id:user_id}})
  137. this.$navigate({
  138. r: 'seed/index/order',
  139. user_id: user_id
  140. })
  141. },
  142. pageChange(currentPage) {
  143. let self = this;
  144. self.page = currentPage;
  145. self.getList();
  146. },
  147. searchs(){
  148. this.page = 1;
  149. this.getList();
  150. }
  151. }
  152. });
  153. </script>