| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268 |
- <div id="app" v-cloak>
- <el-card shadow="never" style="border:0" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <span>客户列表</span>
- </div>
- <div class="search-box">
- <!-- 搜索 -->
- <el-form :inline="true" :model="searchForm" size="small" class="demo-form-inline">
- <el-form-item label="会员ID">
- <el-input placeholder="请输入会员ID" v-model="searchForm.id"></el-input>
- </el-form-item>
- <el-form-item label="手机号码">
- <el-input placeholder="请输入手机号码" v-model="searchForm.mobile"></el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="search">搜索</el-button>
- <el-button type="danger" @click="resetSearch" v-if="show_clear_search_btn">清除条件</el-button>
- </el-form-item>
- </el-form>
- </div>
- <div class="table-body">
- <el-tabs>
- <el-table :data="list" stripe v-loading="loading" size="small" style="margin-bottom: 15px;">
- <el-table-column prop="id" min-width="30" label="会员ID" align="center"></el-table-column>
- <el-table-column label="用户信息" align="center" width="180">
- <template slot-scope="scope">
- <com-image style="float: left;margin-right: 5px;" class="avatar_url" mode="aspectFill" :src="scope.row.avatar_url ? scope.row.avatar_url : '/resources/img/common/default-avatar.png'"></com-image>
- <div>{{scope.row.nickname}}<br/>{{scope.row.mobile}}</div>
- </template>
- </el-table-column>
- <el-table-column label="上级" align="center" width="180">
- <template slot-scope="scope">
- <div v-if="scope.row.parent_id">
- <com-image style="float: left;margin-right: 5px;" class="avatar_url" mode="aspectFill" :src="scope.row.parent ? scope.row.parent.avatar_url : '/resources/img/common/default-avatar.png'"></com-image>
- <div>{{scope.row.parent.id}}<br/>{{scope.row.parent.mobile}}</div>
- </div>
- <div v-else>
- 平台
- </div>
- </template>
- </el-table-column>
- <el-table-column label="累计消费金额" min-width="50" align="center">
- <template slot-scope="scope">
- {{ total_pay_arr[scope.row.id] || 0 }}
- </template>
- </el-table-column>
- <el-table-column label="团队人数" min-width="50" align="center">
- <template slot-scope="scope">
- {{ scope.row.userTeamStatistics.user_team_total || 0 }}
- </template>
- </el-table-column>
- <el-table-column label="佣金" min-width="50" align="center">
- <template slot-scope="scope">
- {{ scope.row.userWallet.commission || 0 }}
- </template>
- </el-table-column>
- <el-table-column label="待结算" min-width="50" align="center">
- <template slot-scope="scope">
- {{ Math.floor(frozen_money_arr[scope.row.id] * 100) / 100 || 0 }}
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center">
- <template slot-scope="scope">
- <el-button type="text" @click="handle('edit',scope.row)">查看详情</el-button>
- </template>
- </el-table-column>
- </el-table>
- <div style="text-align: right;margin: 20px 0;">
- <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount"></el-pagination>
- </div>
- </el-tabs>
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data: {
- loading: false,
- delLoading: false,
- page: 1,
- pageCount: 0,
- list: [],
- total_pay_arr: {},
- frozen_money_arr: {},
- searchForm:{
- id:null,
- mobile:null,
- },
- },
- mounted() {
- this.getList();
- },
- computed: {
- show_clear_search_btn: function() {
- return this.searchForm.id != null ||
- this.searchForm.mobile != null;
- },
- },
- methods: {
- pagination(currentPage) {
- let self = this;
- self.page = currentPage;
- self.getList();
- },
- handle(type, data = null) {
- let id = data ? parseInt(data.id) : '';
- switch (type) {
- case 'edit':
- let params = {
- r: 'team-data/default/my-customer'
- };
- if (id) params = Object.assign(params, {
- user_id: id
- });
- navigateTo(params);
- break;
- }
- },
- send(url, params, callback = null) {
- let self = this;
- request({
- params: {
- r: url,
- },
- method: 'post',
- data: params
- }).then(e => {
- if (e.data.code == 0) {
- self.$message.success(e.data.msg);
- self.getList();
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- console.log(e);
- });
- if(callback) return e.data;
- },
- search() {// 清空查询条件
- this.page = 1;
- this.getList(this.searchForm);
- },
- resetSearch() {// 清空查询条件
- this.searchForm = {
- id: null,
- mobile: null,
- };
- this.page = 1;
- this.getList();
- },
- getList(search = {}) {
- let self = this;
- self.loading = true;
- let basic_params = {
- r: 'team-data/default/index',
- page: self.page,
- };
- params = Object.assign(basic_params, search);
- request({
- params: params
- }).then(e => {
- this.loading = false;
- if (e.data.code == 0) {
- self.list = e.data.data.list.list;
- self.total_pay_arr = e.data.data.total_pay_arr;
- self.frozen_money_arr = e.data.data.frozen_money_arr;
- self.pageCount = e.data.data.list.page_count;
- } else {
- self.$message.error(e.data.msg);
- }
- }).catch(e => {
- self.loading = false;
- });
- },
- }
- });
- </script>
- <style>
- .el-tabs__header {
- font-size: 16px;
- }
- .table-body {
- padding: 20px;
- background-color: #fff;
- }
- .table-body .el-button {
- padding: 0 !important;
- border: 0;
- margin: 0 5px;
- }
- .input-item {
- width: 250px;
- margin: 0 0 20px;
- display: inline-block;
- }
- .input-item .el-input__inner {
- border-right: 0;
- }
- .input-item .el-input__inner:hover {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input__inner:focus {
- border: 1px solid #dcdfe6;
- border-right: 0;
- outline: 0;
- }
- .input-item .el-input-group__append {
- background-color: #fff;
- border-left: 0;
- width: 10%;
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- padding: 0;
- }
- .input-item .el-input-group__append .el-button {
- margin: 0;
- }
- .batch {
- margin: 0 0 20px;
- display: inline-block;
- }
- .batch .el-button {
- padding: 9px 15px !important;
- }
- .el-table th>.cell{
- color: #333;
- font-weight: bold;
- font-size: 14px;
- }
- .el-table__footer-wrapper, .el-table__header-wrapper{
- border-bottom: 1.4px solid #D6D6D6;
- }
- .search-box {
- padding: 10px 0 0 10px;
- background-color: #fff;
- margin-bottom: 10px;
- }
- </style>
|