commission.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <style>
  2. .el-table th>.cell {
  3. color: #333;
  4. font-weight: bold;
  5. font-size: 14px;
  6. }
  7. .table1 .el-table__footer-wrapper,
  8. .table1 .el-table__header-wrapper {
  9. border-bottom: 1.4px solid #D6D6D6;
  10. }
  11. .user_img{
  12. position: relative;
  13. margin-right: 8px;
  14. /* height: 50px;
  15. width: 50px; */
  16. }
  17. .default-avatar{
  18. width: 50px;
  19. height: 50px;
  20. border-radius: 50%;
  21. margin-right: 8px;
  22. }
  23. .uer-nickname {
  24. flex: 1;
  25. }
  26. </style>
  27. <div id="app">
  28. <div class="table-body" style="min-width: 1000px;">
  29. <div slot="header" class="clearfix" style="height: 20px;">
  30. <span>区域代理列表</span>
  31. </div>
  32. <div slot="header" class="clearfix" style="margin-top: 20px;">
  33. <div class="demo-input-suffix" style="margin-top: 20px;margin-bottom: 10px;">
  34. <el-input @keyup.enter.native="toSearchActivity" size="small" style="width:200px;margin-right: 10px;"
  35. placeholder="请输入会员昵称/手机号" v-model="search.member" clearable>
  36. </el-input>
  37. <el-input @keyup.enter.native="toSearchActivity" size="small" style="width:200px;margin-right: 10px;"
  38. placeholder="请输入会员ID" v-model="search.user_id" clearable>
  39. </el-input>
  40. <el-input @keyup.enter.native="toSearchActivity" size="small" style="width:200px;margin-right: 10px;"
  41. placeholder="请输入商品名称" v-model="search.goods_name" clearable>
  42. </el-input>
  43. <el-select clearable size="small" v-model="search.level" @change='toSearch' class="select" style="margin-right: 10px;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-select clearable size="small" v-model="search.status" @change='toSearch' class="select" style="margin-right: 10px;width: 150px;" placeholder="请选择佣金状态">
  48. <el-option label="已结算" :value="1"></el-option>
  49. <el-option label="未结算" :value="0"></el-option>
  50. </el-select>
  51. <el-date-picker
  52. style="margin-right: 20px;"
  53. size="small"
  54. v-model="selectDate"
  55. type="daterange"
  56. value-format="yyyy-MM-dd"
  57. range-separator="至"
  58. start-placeholder="开始日期"
  59. end-placeholder="结束日期">
  60. </el-date-picker>
  61. <el-button type="primary" size="small" @click="toSearch">搜索</el-button>
  62. </div>
  63. </div>
  64. <template>
  65. <el-table :data="list" stripe style="width: 100%" v-loading="listLoading" class="table1">
  66. <el-table-column prop="user_id" label="用户ID" align="center"></el-table-column>
  67. <el-table-column label="会员" width="180">
  68. <template slot-scope="scope">
  69. <div class="table-info-img-text">
  70. <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
  71. <div slot="error" class="image-slot">
  72. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  73. </div>
  74. </el-image>
  75. <div class="table-info-text">
  76. <div style="color:#000; text-align: left">{{scope.row.user.nickname}}</div>
  77. <div style="font-size: 12px; text-align: left">{{scope.row.user.mobile}}</div>
  78. </div>
  79. </div>
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="区域代理商品" >
  83. <template slot-scope="scope">
  84. <div class="user_img" flex="cross:center">
  85. <el-image class="default-avatar" :src="scope.row.goods.cover_pic">
  86. <div slot="error" class="image-slot">
  87. <com-image src="/resources/img/common/default-avatar.png"></com-image>
  88. </div>
  89. </el-image>
  90. <div class="uer-nickname over1" style="color:#000;">{{scope.row.goods.goods_name}}</div>
  91. </div>
  92. </template>
  93. </el-table-column>
  94. <el-table-column prop="total_commission" label="区域代理等级" align="center">
  95. <template slot-scope="scope">
  96. <div>{{level_map[scope.row.area_level]}}</div>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="订单编号" align="center">
  100. <template slot-scope="scope">
  101. <div>{{scope.row.order_no}}</div>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="订单状态" align="center">
  105. <template slot-scope="scope">
  106. <el-tag size="mini">{{order_status_list[scope.row.order.order_status]}}</el-tag>
  107. </template>
  108. </el-table-column>
  109. <el-table-column label="订单金额" align="center">
  110. <template slot-scope="scope">
  111. <div>{{scope.row.order.pay_money}}</div>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="佣金比例" align="center">
  115. <template slot-scope="scope">
  116. <el-tag size="mini" type="success" v-if="scope.row.is_fixed == 0">{{scope.row.commission_rate}}%</el-tag>
  117. <el-tag size="mini" type="danger" v-else>固定金额</el-tag>
  118. </template>
  119. </el-table-column>
  120. <el-table-column label="佣金金额" align="center">
  121. <template slot-scope="scope">
  122. <div>{{scope.row.commission | amount}}</div>
  123. </template>
  124. </el-table-column>
  125. <el-table-column label="佣金状态" align="center">
  126. <template slot-scope="scope">
  127. <el-tag :type="commission_status[scope.row.commission_status].type" size="mini">
  128. {{commission_status[scope.row.commission_status].title}}
  129. </el-tag>
  130. </template>
  131. </el-table-column>
  132. <el-table-column label="时间" align="center">
  133. <template slot-scope="scope">
  134. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  135. </template>
  136. </el-table-column>
  137. </el-table>
  138. <div flex="main:right cross:center" style="margin-top: 20px;">
  139. <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
  140. style="display: inline-block;float: right;" background @current-change="pageChange"
  141. layout="prev, pager, next" :total="pagination.totalCount">
  142. </el-pagination>
  143. </div>
  144. </template>
  145. </div>
  146. </div>
  147. <script>
  148. const app = new Vue({
  149. el: '#app',
  150. data() {
  151. return {
  152. pagination: {
  153. total: 0
  154. },
  155. loading: false,
  156. listLoading: false,
  157. search: {
  158. page: 1,
  159. limit:10,
  160. date_start:'',
  161. date_end:'',
  162. member: '',
  163. level: '',
  164. user_id: '',
  165. status: ''
  166. },
  167. levelList:[
  168. ],
  169. list: [],
  170. show: false,
  171. selectDate: [],
  172. commission_status: {
  173. 0: {
  174. title: '未发放',
  175. type: 'danger'
  176. },
  177. 1: {
  178. title: '已发放',
  179. type: 'success'
  180. }
  181. },
  182. order_status_list: {
  183. '0': "待付款",
  184. '1': "待发货",
  185. '2': "已发货",
  186. '3': "已收货",
  187. '4': "已完成",
  188. '-4': "已关闭",
  189. '-2': "退款中",
  190. '-1': "售后申请"
  191. },
  192. }
  193. },
  194. methods: {
  195. //状态按钮的点击事件
  196. toSearch() {
  197. if(this.selectDate && this.selectDate[0]){
  198. this.search.date_start = this.selectDate[0];
  199. this.search.date_end = this.selectDate[1];
  200. }else{
  201. this.search.date_start = '';
  202. this.search.date_end = '';
  203. }
  204. this.search.page = 1;
  205. this.loadData();
  206. },
  207. toSearchActivity() {
  208. this.loadData()
  209. },
  210. pageChange(page) {
  211. this.search.page = page;
  212. this.loadData();
  213. },
  214. // 请求获取数据--获取拼团商品列表
  215. loadData() {
  216. this.listLoading = true;
  217. let params = {
  218. r: 'area/default/commission'
  219. };
  220. params = Object.assign(params, this.search);
  221. request({
  222. params: params,
  223. method: 'get',
  224. }).then(e => {
  225. let res = e.data;
  226. this.listLoading = false;
  227. if (res.code === 0) {
  228. this.list = res.data.list;
  229. this.level_map = res.data.level_map;
  230. this.pagination = res.data.pagination; //拿到关于页码页容量的数据
  231. this.levelList = [];
  232. for(let i in this.level_map){
  233. this.levelList.push({'name':this.level_map[i],'level':i})
  234. }
  235. } else {
  236. this.$message.error(res.msg);
  237. }
  238. }).catch(e => {});
  239. },
  240. },
  241. // 加载的时候获取到列表页
  242. mounted() {
  243. // 数据初始化
  244. this.loadData();
  245. },
  246. filters: {
  247. amount: function(val) {
  248. return parseFloat(val / 100).toFixed(2)
  249. }
  250. }
  251. })
  252. </script>