xiaoyong931011
2021-03-13 626e9811c77cd89182d16d12d3c5890904daea02
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!-- 本框架基本脚本和样式 -->
    <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script>
    <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}">
    <link rel="stylesheet" th:href="@{/plugin/bootstrap-3.3.5/css/bootstrap.min.css}">
    <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/>
 
    <!-- 富文本编辑器 -->
    <script type="text/javascript" charset="utf-8"
            th:src="@{/plugin/beditor/ueditor.config.js}"></script>
    <script type="text/javascript" charset="utf-8"
            th:src="@{/plugin/beditor/ueditor.all.js}">
    </script>
    <script type="text/javascript" charset="utf-8"
            th:src="@{/plugin/beditor/lang/zh-cn/zh-cn.js}"></script>
    <style>
        .paginationStyle{
            background: #ffffff;
            padding: 10px 10px;
            margin: 0px 0px 10px 0px;
            text-align: right;
        }
        .el-aside {
            color: #333;
            line-height: 50px;
        }
        .el-main {
            color: #333;
            line-height: 50px;
        }
    </style>
</head>
 
<body>
<div class="ibox-content" id="app" v-cloak>
    <el-row>
        <p class="el-big-title">个人详情</p>
    </el-row>
    <el-container>
        <el-aside width="200px" style="display:flex;align-items: center;">
            <el-avatar :size="100" :src="basicdetail.avatarUrl" style="display:flex;align-items: center;margin-left: 50px"></el-avatar>
        </el-aside>
        <el-main>
            <el-row style="display:flex;align-items: center;">
                <el-col :span="3" style="display:flex;align-items: center;">
                    <span style="font-size: 20px;">{{basicdetail.nickname}} </span>
                </el-col>
                <el-col :span="3">
                    <el-select v-model="basicdetail.grade" @focus="getDatalist()" placeholder="请选择" filterable allow-create>
                        <el-option v-for="item in salemanGradeList " :key="item.id" :label="item.name" :value="item.id"></el-option>
                    </el-select>
                </el-col>
                <el-col :span="18">
                </el-col>
            </el-row>
            <el-row style="display:flex;">
                <el-col>
                    <span>
                        手机号码:{{basicdetail.phone}}   |
                        加入时间:{{basicdetail.createTime}}   |
                        邀请人:{{basicdetail.parentUser}}   |
                        来源:
                            <span v-if="basicdetail.applyWay == 1">自主申请</span>
                            <span v-if="basicdetail.applyWay == 2">自动添加</span>
                            <span v-if="basicdetail.applyWay == 3">上级邀请</span>
                            <span v-if="basicdetail.applyWay == 4">手动添加</span>   |
                        状态:
                            <span v-if="basicdetail.applyStatus == 1">待审核</span>
                            <span v-if="basicdetail.applyStatus == 2">通过</span>
                            <span v-if="basicdetail.applyStatus == 3">未通过</span>
                    </span>
                </el-col>
            </el-row>
        </el-main>
    </el-container>
    <el-row style="padding: 30px;">
        <el-row :gutter="100">
            <el-col class="line" :span="6" style="text-align: center">
                <el-card class="box-card" style="background-color: #eee;border-radius: 30px;">
                    <div>绑定客户</div>
                    <div style="padding: 5px;font-size: 18px;">{{basicdetail.lowerLevelNum}}人</div>
                </el-card >
            </el-col>
            <el-col class="line" :span="6" style="text-align: center">
                <el-card class="box-card" style="background-color: #eee;border-radius: 30px;">
                    <div>邀请下级</div>
                    <div style="padding: 5px;font-size: 18px;">{{basicdetail.invitedNum}}人</div>
                </el-card >
            </el-col>
            <el-col class="line" :span="6" style="text-align: center">
                <el-card class="box-card" style="background-color: #eee;border-radius: 30px;">
                    <div>累计收益</div>
                    <div style="padding: 5px;font-size: 18px;">{{basicdetail.totalRevenue}}元</div>
                </el-card >
            </el-col>
            <el-col class="line" :span="6" style="text-align: center">
                <el-card class="box-card" style="background-color: #eee;border-radius: 30px;">
                    <div>待结算</div>
                    <div style="padding: 5px;font-size: 18px;">{{basicdetail.balance}}元</div>
                </el-card >
            </el-col>
        </el-row>
    </el-row>
    <el-row>
        <el-tabs v-model="activeName" >
            <el-tab-pane label="分销员管理" name="first">
                <el-row style="display:flex;align-items: center;">
                    <el-form ref="form" :model="form" inline >
                        <el-form-item prop="userName">
                            <el-input v-model="form.userName" placeholder="请输入会员姓名"></el-input>
                        </el-form-item>
 
                        <el-button type="primary" @click="search" >搜索</el-button>
                        <el-button @click="resetForm('form')">重置</el-button>
                    </el-form>
                </el-row>
                <el-row class="table-style" >
                    <el-table id="proj" :data="fxyList.rows"  :height="height" stripe:true  @sort-change="sortChange">
                        <el-table-column
                                type="selection">
                        </el-table-column>
                        <el-table-column
                                label="头像" width="100">
                            <template slot-scope="scope">
                                <img :src="scope.row.avatarUrl" width="40" height="40" class="head_pic"/>
                            </template>
                        </el-table-column>
                        <el-table-column
                                prop="nickname"
                                label="分销员" width="100">
                        </el-table-column>
                        <el-table-column
                                prop="createTime"
                                label="绑定时间">
                        </el-table-column>
                        <el-table-column
                                label="绑定方式">
                            <template slot-scope="scope">
                                <span v-if="scope.row.applyWay == 1">自主申请</span>
                                <span v-if="scope.row.applyWay == 2">自动添加</span>
                                <span v-if="scope.row.applyWay == 3">上级邀请</span>
                                <span v-if="scope.row.applyWay == 4">手动添加</span>
                            </template>
                        </el-table-column>
                        <el-table-column
                                label="客户状态">
                            <template slot-scope="scope">
                            </template>
                        </el-table-column>
                        <el-table-column label="操作" width="240">
                            <template slot-scope="scope">
                                <el-row style="display:flex;">
                                    <el-button type="primary" size="mini" @click="openExamineSsaleManApply(scope.row)">解绑</el-button>
                                </el-row>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-row>
                <el-row class="paginationStyle"  >
                    <el-pagination background
                                   @size-change="changePageSize"
                                   @current-change="changeCurrentPage"
                                   :current-page="fxyList.currentPage"
                                   :page-sizes="[10, 20, 30, 50]"
                                   :page-size="fxyList.pageSize"
                                   layout="total, sizes, prev, pager, next, jumper"
                                   :total="fxyList.total">
                    </el-pagination>
                </el-row>
            </el-tab-pane>
 
            <el-tab-pane label="邀请下级" name="second">
                <el-row style="display:flex;align-items: center;">
                    <el-form ref="formlow" :model="formlow" inline >
                        <el-form-item prop="userName">
                            <el-input v-model="formlow.userName" placeholder="请输入会员姓名"></el-input>
                        </el-form-item>
 
                        <el-button type="primary" @click="searchlow" >搜索</el-button>
                        <el-button @click="resetFormlow('formlow')">重置</el-button>
                    </el-form>
                </el-row>
                <el-row class="table-style" >
                    <el-table id="proj" :data="lowLevelList.rows"  :height="height" stripe:true  @sort-change="sortChange">
                        <el-table-column
                                type="selection">
                        </el-table-column>
                        <el-table-column
                                label="头像" width="100">
                            <template slot-scope="scope">
                                <img :src="scope.row.avatarUrl" width="40" height="40" class="head_pic"/>
                            </template>
                        </el-table-column>
                        <el-table-column
                                prop="nickname"
                                label="分销员" width="100">
                        </el-table-column>
                        <el-table-column
                                prop="createTime"
                                label="绑定时间">
                        </el-table-column>
                        <el-table-column
                                label="绑定方式">
                            <template slot-scope="scope">
                                <span v-if="scope.row.applyWay == 1">自主申请</span>
                                <span v-if="scope.row.applyWay == 2">自动添加</span>
                                <span v-if="scope.row.applyWay == 3">上级邀请</span>
                                <span v-if="scope.row.applyWay == 4">手动添加</span>
                            </template>
                        </el-table-column>
                        <el-table-column
                                label="客户状态">
                            <template slot-scope="scope">
                            </template>
                        </el-table-column>
                        <el-table-column label="操作" width="240">
                            <template slot-scope="scope">
                                <el-row style="display:flex;">
                                    <el-button type="primary" size="mini" @click="openExamineSsaleManApply(scope.row)">解绑</el-button>
                                </el-row>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-row>
                <el-row class="paginationStyle"  >
                    <el-pagination background
                                   @size-change="changePageSizelow"
                                   @current-change="changeCurrentPagelow"
                                   :current-page="lowLevelList.currentPage"
                                   :page-sizes="[10, 20, 30, 50]"
                                   :page-size="lowLevelList.pageSize"
                                   layout="total, sizes, prev, pager, next, jumper"
                                   :total="lowLevelList.total">
                    </el-pagination>
                </el-row>
            </el-tab-pane>
        </el-tabs>
    </el-row>
</div>
</body>
<script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script>
<script type="text/javascript" th:src="@{/plugin/bootstrap-3.3.5/js/bootstrap.min.js}"></script>
<script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script>
<script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script>
<script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script>
<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script>
<script type="text/javascript" th:src="@{/plugin/layer/layer.js}"></script>
<script type="text/javascript" th:src="@{/plugin/moment.min.js}"></script>
 
<script>
    //获取传输的USERID对象
    var userId = $.query.get("userId");
 
    var app = new Vue({
        el: '#app',
        data: {
            activeName: 'first',
            shenheAgreeType : 2,
            shenheDisagreeType : 3,
            //条件查询审核状态
            shenheStateList:[
                {value:'',label:'全部'},
                {value:1,label:'未审核'},
                {value:2,label:'通过'},
                {value:3,label:'未通过'}
            ],
            basicdetail:{},
            //条件查询分销员等级
            form:{
                userName:'',
                order:'',
                sort:''
            },
            salemanGradeList:[],
            fxyList:{
                rows:[],
                total:0,
                pageSize:10,
                currentPage:1,
            },
 
            formlow:{
                userName:'',
                order:'',
                sort:''
            },
            lowLevelList:{
                rows:[],
                total:0,
                pageSize:10,
                currentPage:1,
            },
            height:'calc(100vh - 240px)',
        },
 
        created: function () {
            this.loadInfo();
        },
        mounted: function () {
        },
        methods: {
            //加载分类
            loadInfo() {
                let _this = this;
                _this.loadParamSetting();
                _this.loadParamSettinglow();
                _this.getDatalist();
            },
            //绑定客户
            loadParamSetting() {
                let _this = this;
                let data=_this.getRequestParam();
                data.pageSize=_this.fxyList.pageSize;
                data.pageNum=_this.fxyList.currentPage;
                AjaxProxy.requst({
                    app: _this,
                    data:data,
                    url: basePath + '/fenXiao/fenXiaoUser/findShopSalesmanDetail',
                    callback: function (data) {
                        _this.basicdetail = data.mapInfo.basicdetail;
                        _this.fxyList.rows = data.mapInfo.customDetailRecords;
                        _this.fxyList.total = data.mapInfo.customDetailTotal;
                    }
                });
            },
            //查询参数
            getRequestParam(){
                let _this = this;
                return   {
                    userName:_this.form.userName,
                    order:_this.form.order,
                    sort:_this.form.sort,
                    userId:userId,
                }
            },
            //查询
            search:function(){
                this.fxyList.currentPage=1;
                this.loadInfo();
            },
            //重置
            resetForm(formName) {
                this.$refs[formName].resetFields();
            },
            changePageSize(val) {
                this.fxyList.pageSize = val;
                this.loadInfo();
            },
            changeCurrentPage(val) {
                this.fxyList.currentPage = val;
                this.loadInfo();
            },
            //邀请下级
            loadParamSettinglow() {
                let _this = this;
                let data=_this.getRequestParamlow();
                data.pageSize=_this.lowLevelList.pageSize;
                data.pageNum=_this.lowLevelList.currentPage;
                AjaxProxy.requst({
                    app: _this,
                    data:data,
                    url: basePath + '/fenXiao/fenXiaoUser/findShopSalesmanDetail',
                    callback: function (data) {
                        _this.basicdetail = data.mapInfo.basicdetail;
                        _this.lowLevelList.rows = data.mapInfo.customLowRecords;
                        _this.lowLevelList.total = data.mapInfo.customLowTotal;
                    }
                });
            },
            //查询参数
            getRequestParamlow(){
                let _this = this;
                return   {
                    userName:_this.formlow.userName,
                    order:_this.formlow.order,
                    sort:_this.formlow.sort,
                    userId:userId,
                }
            },
            //查询
            searchlow:function(){
                this.lowLevelList.currentPage=1;
                this.loadInfo();
            },
            //重置
            resetFormlow(formName) {
                this.$refs[formName].resetFields();
            },
            changePageSizelow(val) {
                this.lowLevelList.pageSize = val;
                this.loadInfo();
            },
            changeCurrentPagelow(val) {
                this.lowLevelList.currentPage = val;
                this.loadInfo();
            },
 
            // select下拉框获取焦点的时候下拉框数据源---分销员等级
            getDatalist() {
                let _this = this;
                AjaxProxy.requst({
                    app: _this,
                    data:[],
                    url: basePath + '/fenXiao/fenXiaoUser/getShopSalesmanGrade',
                    callback: function (data) {
                        _this.salemanGradeList = data.mapInfo.salesGrade;
                    }
                });
            },
            sortChange:function (column){
                if(column.order){
                    if(column.order.indexOf("desc")){
                        this.form.order="desc";
                    }else{
                        this.form.order="asc";
                    }
                    this.form.sort=column.prop;
                    this.loadInfo();
                }
            },
            //新增分销员页面
            addSaleMan(){
                layer.full(layer.open({
                    type: 2,
                    title: "选择会员",
                    maxmin: true,
                    area: [MUI.SIZE_L, '500px'],
                    content : [ basePath + '/admin/redirect/fenxiao/fenxiao-apply']
                }));
            },
            //修改等级
            openUpdateSaleManGrade(){
                layer.full(layer.open({
                    type: 2,
                    title: "修改等级",
                    maxmin: true,
                    area: [MUI.SIZE_L, '500px'],
                    content : [ basePath + '/admin/redirect/fenxiao/fenxiao-update']
                }));
            },
            //审核
            openExamineSaleManApply(row) {
                this.$confirm('是否通过?', '审核', {
                    distinguishCancelAndClose: true,//设置关闭按钮和不通过按钮的区别
                    confirmButtonText: '通过',
                    cancelButtonText: '不通过',
                    type: 'info'
                }).then(() => {
                    //通过
                    this.examineSaleManApply(row,this.shenheAgreeType);
                }).catch(action => {
                    //不通过
                    if(action === 'cancel'){
                        this.examineSaleManApply(row,this.shenheDisagreeType);
                    }else{
                        //关闭按钮
                        console.log("close");
                        //this.$message({type: 'info',message: ''})
                    }
                });
            },
            examineSaleManApply(row,type){
                let _this = this;
                let userId = row.userId;
                let obj = {
                    userId: userId,
                    applyState: type,
                }
                AjaxProxy.requst({
                    app: _this,
                    data:obj,
                    url: basePath + '/fenXiao/fenXiaoUser/examineSaleManApply',
                    callback: function (data) {
                        _this.$message.success(data.info);
                        this.loadData();
                    }
                });
            },
 
            submit() {
            }
        }
    })
</script>
 
</body>
</html>