index.php 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ?>
  4. <style>
  5. .el-table th>.cell {
  6. color: #333;
  7. font-weight: bold;
  8. font-size: 14px;
  9. }
  10. .table1 .el-table__footer-wrapper,
  11. .table1 .el-table__header-wrapper {
  12. border-bottom: 1.4px solid #D6D6D6;
  13. }
  14. .user_img{
  15. position: relative;
  16. margin-right: 8px;
  17. /* height: 50px;
  18. width: 50px; */
  19. }
  20. .default-avatar{
  21. width: 50px;
  22. height: 50px;
  23. border-radius: 50%;
  24. margin-right: 8px;
  25. }
  26. .uer-nickname {
  27. flex: 1;
  28. }
  29. .name-box {
  30. display: flex;
  31. flex-direction: column;
  32. }
  33. </style>
  34. <div id="app">
  35. <div class="table-body" style="min-width: 1000px;">
  36. <div slot="header" class="clearfix" style="height: 20px;">
  37. <span>数据概况</span>
  38. </div>
  39. <div slot="header" class="clearfix" style="margin-top: 20px;">
  40. <div class="demo-input-suffix" style="margin-top: 20px;margin-bottom: 10px;">
  41. <el-input @keyup.enter.native="toSearchActivity" size="small" style="width:300px;margin-right: 20px;" placeholder="请输入会员昵称/ID/手机号" v-model="search.keyword" clearable>
  42. </el-input>
  43. <el-select size="small" v-model="search.level" @change='toSearch' class="select" style="margin-right: 20px;width: 150px;" placeholder="请选择代理等级">
  44. <el-option label="全部等级" value=""></el-option>
  45. <el-option :key="index" :label="item.name" :value="item.level" v-for="(item, index) in levelList"></el-option>
  46. </el-select>
  47. <el-date-picker
  48. style="margin-right: 20px;"
  49. size="small"
  50. v-model="selectDate"
  51. type="daterange"
  52. value-format="yyyy-MM-dd"
  53. range-separator="至"
  54. start-placeholder="开始日期"
  55. end-placeholder="结束日期">
  56. </el-date-picker>
  57. <el-button type="primary" size="small" @click="toSearch">搜索</el-button>
  58. </div>
  59. </div>
  60. <template>
  61. <el-table :data="list" stripe style="width: 100%" v-loading="listLoading" class="table1">
  62. <el-table-column prop="user_id" label="用户ID" align="center"></el-table-column>
  63. <el-table-column label="基本信息" >
  64. <template slot-scope="scope">
  65. <div class="user_img" flex="cross:center">
  66. <el-image class="default-avatar" :src="scope.row.user.avatar_url">
  67. <div slot="error" class="image-slot">
  68. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  69. </div>
  70. </el-image>
  71. <div class="name-box">
  72. <div class="uer-nickname over1" style="color:#000;">{{scope.row.user.nickname}}</div>
  73. <div class="user-realname">{{scope.row.mobile == null || scope.row.mobile == '' ? scope.row.user.mobile : scope.row.mobile}}</div>
  74. </div>
  75. </div>
  76. </template>
  77. </el-table-column>
  78. <el-table-column prop="total_commission" label="区域代理等级" align="center">
  79. <template slot-scope="scope">
  80. <div>{{level_map[scope.row.level]}}</div>
  81. </template>
  82. </el-table-column>
  83. <el-table-column prop="address" label="代理区域" align="center"></el-table-column>
  84. <el-table-column prop="order_num" label="订单量" align="center"></el-table-column>
  85. <el-table-column prop="order_amount" label="订单总金额" align="center"></el-table-column>
  86. <el-table-column prop="order_pay_amount" label="实付总金额" align="center"></el-table-column>
  87. <el-table-column prop="refund_amount" label="退款总金额" align="center"></el-table-column>
  88. <el-table-column prop="date" label="统计日期" align="center"></el-table-column>
  89. <el-table-column label="操作" align="center">
  90. <template slot-scope="scope">
  91. <el-button @click="$navigate({r:'area/data/list', user_id:scope.row.user_id})" type="text" size="mini">明细</el-button>
  92. </template>
  93. </el-table-column>
  94. </el-table>
  95. <div flex="main:right cross:center" style="margin-top: 20px;">
  96. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
  97. style="display: inline-block;float: right;" background @current-change="pageChange"
  98. layout="prev, pager, next" :total="pagination.totalCount">
  99. </el-pagination>
  100. </div>
  101. </template>
  102. </div>
  103. </div>
  104. <script>
  105. const app = new Vue({
  106. el: '#app',
  107. data() {
  108. return {
  109. listLoading: false,
  110. list: [],
  111. pagination: {
  112. total: 0
  113. },
  114. loading: false,
  115. LoadDataType: -1, //默认显示全部数据
  116. dialogFormVisible: false, //默认不显示弹窗
  117. group_buy_attr_list: [],
  118. goodsDetail: {},
  119. dialogLoading:false,
  120. commander_level_limit_text:'',
  121. user_level_limit_text:'',
  122. level_map:null,
  123. selectDate:'',
  124. search: {
  125. page: 1,
  126. limit:10,
  127. start:'',
  128. end:'',
  129. keyword: '',
  130. level: '',
  131. },
  132. levelList:[
  133. ],
  134. show: false,
  135. level: {
  136. show: false,
  137. area: null,
  138. },
  139. current_area:null,
  140. }
  141. },
  142. methods: {
  143. //状态按钮的点击事件
  144. toSearch() {
  145. if(this.selectDate && this.selectDate[0]){
  146. this.search.start = this.selectDate[0];
  147. this.search.end = this.selectDate[1];
  148. }else{
  149. this.search.start = '';
  150. this.search.end = '';
  151. }
  152. this.search.page = 1;
  153. this.loadData();
  154. },
  155. toSearchActivity() {
  156. this.loadData()
  157. },
  158. pageChange(page) {
  159. this.search.page = page;
  160. this.loadData();
  161. },
  162. // 请求获取数据--获取拼团商品列表
  163. loadData() {
  164. this.listLoading = true;
  165. let params = {
  166. r: 'area/data/index'
  167. };
  168. params = Object.assign(params, this.search);
  169. request({
  170. params: params,
  171. method: 'get',
  172. }).then(e => {
  173. let res = e.data;
  174. this.listLoading = false;
  175. if (res.code === 0) {
  176. try {
  177. this.list = res.data.list;
  178. this.level_map = res.data.level_map;
  179. this.pagination = res.data.pagination; //拿到关于页码页容量的数据
  180. this.levelList = [];
  181. for(var i in this.level_map){
  182. if (i == 6){
  183. this.levelList.splice(1, 0, {'name':this.level_map[i],'level':i})
  184. }else{
  185. this.levelList.push({'name':this.level_map[i],'level':i})
  186. }
  187. }
  188. } catch (e) {
  189. console.error(e)
  190. }
  191. } else {
  192. this.$message.error(res.msg);
  193. }
  194. }).catch(e => {});
  195. },
  196. editClick() {
  197. this.show = true;
  198. },
  199. levelSuccess() {
  200. this.loadData();
  201. },
  202. editLevel(row) {
  203. this.level.show = true;
  204. this.current_area = row;
  205. },
  206. },
  207. // 加载的时候获取到列表页
  208. mounted() {
  209. // 数据初始化
  210. this.LoadDataType = -1;
  211. this.loadData();
  212. }
  213. })
  214. </script>