| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258 |
- <style>
- .el-table th>.cell {
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .table1 .el-table__footer-wrapper,
- .table1 .el-table__header-wrapper {
- border-bottom: 1.4px solid #D6D6D6;
- }
- .user_img{
- position: relative;
- margin-right: 8px;
- /* height: 50px;
- width: 50px; */
- }
- .default-avatar{
- width: 50px;
- height: 50px;
- border-radius: 50%;
- margin-right: 8px;
- }
- .uer-nickname {
- flex: 1;
- }
- </style>
- <div id="app">
- <div class="table-body" style="min-width: 1000px;">
- <div slot="header" class="clearfix" style="height: 20px;">
- <span>区域代理列表</span>
- </div>
- <div slot="header" class="clearfix" style="margin-top: 20px;">
- <div class="demo-input-suffix" style="margin-top: 20px;margin-bottom: 10px;">
- <el-input @keyup.enter.native="toSearchActivity" size="small" style="width:200px;margin-right: 10px;"
- placeholder="请输入会员昵称/手机号" v-model="search.member" clearable>
- </el-input>
- <el-input @keyup.enter.native="toSearchActivity" size="small" style="width:200px;margin-right: 10px;"
- placeholder="请输入会员ID" v-model="search.user_id" clearable>
- </el-input>
- <el-input @keyup.enter.native="toSearchActivity" size="small" style="width:200px;margin-right: 10px;"
- placeholder="请输入商品名称" v-model="search.goods_name" clearable>
- </el-input>
- <el-select clearable size="small" v-model="search.level" @change='toSearch' class="select" style="margin-right: 10px;width: 150px;" placeholder="请选择代理等级">
- <el-option label="全部等级" value=""></el-option>
- <el-option :key="index" :label="item.name" :value="item.level" v-for="(item, index) in levelList"></el-option>
- </el-select>
- <el-select clearable size="small" v-model="search.status" @change='toSearch' class="select" style="margin-right: 10px;width: 150px;" placeholder="请选择佣金状态">
- <el-option label="已结算" :value="1"></el-option>
- <el-option label="未结算" :value="0"></el-option>
- </el-select>
- <el-date-picker
- style="margin-right: 20px;"
- size="small"
- v-model="selectDate"
- type="daterange"
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期">
- </el-date-picker>
- <el-button type="primary" size="small" @click="toSearch">搜索</el-button>
- </div>
- </div>
- <template>
- <el-table :data="list" stripe style="width: 100%" v-loading="listLoading" class="table1">
- <el-table-column prop="user_id" label="用户ID" align="center"></el-table-column>
- <el-table-column label="会员" width="180">
- <template slot-scope="scope">
- <div class="table-info-img-text">
- <el-image class="table-info-img circle" :src="scope.row.user.avatar_url">
- <div slot="error" class="image-slot">
- <com-image src="/resources/img/common/default-avatar.png"></com-image>
- </div>
- </el-image>
- <div class="table-info-text">
- <div style="color:#000; text-align: left">{{scope.row.user.nickname}}</div>
- <div style="font-size: 12px; text-align: left">{{scope.row.user.mobile}}</div>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="区域代理商品" >
- <template slot-scope="scope">
- <div class="user_img" flex="cross:center">
- <el-image class="default-avatar" :src="scope.row.goods.cover_pic">
- <div slot="error" class="image-slot">
- <com-image src="/resources/img/common/default-avatar.png"></com-image>
- </div>
- </el-image>
- <div class="uer-nickname over1" style="color:#000;">{{scope.row.goods.goods_name}}</div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="total_commission" label="区域代理等级" align="center">
- <template slot-scope="scope">
- <div>{{level_map[scope.row.area_level]}}</div>
- </template>
- </el-table-column>
- <el-table-column label="订单编号" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.order_no}}</div>
- </template>
- </el-table-column>
- <el-table-column label="订单状态" align="center">
- <template slot-scope="scope">
- <el-tag size="mini">{{order_status_list[scope.row.order.order_status]}}</el-tag>
- </template>
- </el-table-column>
- <el-table-column label="订单金额" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.order.pay_money}}</div>
- </template>
- </el-table-column>
- <el-table-column label="佣金比例" align="center">
- <template slot-scope="scope">
- <el-tag size="mini" type="success" v-if="scope.row.is_fixed == 0">{{scope.row.commission_rate}}%</el-tag>
- <el-tag size="mini" type="danger" v-else>固定金额</el-tag>
- </template>
- </el-table-column>
- <el-table-column label="佣金金额" align="center">
- <template slot-scope="scope">
- <div>{{scope.row.commission | amount}}</div>
- </template>
- </el-table-column>
- <el-table-column label="佣金状态" align="center">
- <template slot-scope="scope">
- <el-tag :type="commission_status[scope.row.commission_status].type" size="mini">
- {{commission_status[scope.row.commission_status].title}}
- </el-tag>
- </template>
- </el-table-column>
- <el-table-column label="时间" align="center">
- <template slot-scope="scope">
- {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
- </template>
- </el-table-column>
- </el-table>
- <div flex="main:right cross:center" style="margin-top: 20px;">
- <el-pagination v-if="pagination" :page-size="pagination.defaultPageSize"
- style="display: inline-block;float: right;" background @current-change="pageChange"
- layout="prev, pager, next" :total="pagination.totalCount">
- </el-pagination>
- </div>
- </template>
- </div>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- pagination: {
- total: 0
- },
- loading: false,
- listLoading: false,
- search: {
- page: 1,
- limit:10,
- date_start:'',
- date_end:'',
- member: '',
- level: '',
- user_id: '',
- status: ''
- },
- levelList:[
- ],
- list: [],
- show: false,
- selectDate: [],
- commission_status: {
- 0: {
- title: '未发放',
- type: 'danger'
- },
- 1: {
- title: '已发放',
- type: 'success'
- }
- },
- order_status_list: {
- '0': "待付款",
- '1': "待发货",
- '2': "已发货",
- '3': "已收货",
- '4': "已完成",
- '-4': "已关闭",
- '-2': "退款中",
- '-1': "售后申请"
- },
- }
- },
- methods: {
- //状态按钮的点击事件
- toSearch() {
- if(this.selectDate && this.selectDate[0]){
- this.search.date_start = this.selectDate[0];
- this.search.date_end = this.selectDate[1];
- }else{
- this.search.date_start = '';
- this.search.date_end = '';
- }
- this.search.page = 1;
- this.loadData();
- },
- toSearchActivity() {
- this.loadData()
- },
- pageChange(page) {
- this.search.page = page;
- this.loadData();
- },
- // 请求获取数据--获取拼团商品列表
- loadData() {
- this.listLoading = true;
- let params = {
- r: 'area/default/commission'
- };
- params = Object.assign(params, this.search);
- request({
- params: params,
- method: 'get',
- }).then(e => {
- let res = e.data;
- this.listLoading = false;
- if (res.code === 0) {
- this.list = res.data.list;
- this.level_map = res.data.level_map;
- this.pagination = res.data.pagination; //拿到关于页码页容量的数据
- this.levelList = [];
- for(let i in this.level_map){
- this.levelList.push({'name':this.level_map[i],'level':i})
- }
- } else {
- this.$message.error(res.msg);
- }
- }).catch(e => {});
- },
- },
- // 加载的时候获取到列表页
- mounted() {
- // 数据初始化
- this.loadData();
- },
- filters: {
- amount: function(val) {
- return parseFloat(val / 100).toFixed(2)
- }
- }
- })
- </script>
|