Helius
2022-05-27 4351e71d782741143a98f86f6648acd16689165f
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
<!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/plugin/jquery-2.1.4.min.js}"></script>
    <script type="text/javascript" th:src="@{/js/systools/MBase.js}"></script>
 
</head>
<body class=" container-fluid">
<div class="pd-10">
    <!-- 搜索框部分start -->
    <div class="row form-head">
        <form class="form-inline" id="serchform">
            <div class="form-group mr-20">
 
                <div class="btn-group search-list mt-10" data-for="search-text">
                    <input autocomplete="off"   id="search-text" name="vipName" placeholder="会员名称"
                           type="text" class="form-control">
                    <input autocomplete="off"   id="search-text" name="phone" placeholder="手机号码"
                           type="text" class="form-control">
                    <input autocomplete="off"   id="search-text" name="vipNo" placeholder="会员编号"
                           type="text" class="form-control">
                </div>
            </div>
            <div class="form-group mr-20 mt-10">
                <label >会员类型</label>
                <select class="form-control autoFull"
                        th:data-url="@{/admin/dataDictionary/showDataDictionary}"
                        data-param="{type:'会员类型'}"
                        data-value="name"
                        name="vipType"
                        id="vipType"   >
                    <option value="">--请选择会员类型--</option>
                </select>
            </div>
 
            <div class="form-group mr-20 mt-10">
                <label >到店途径</label>
                <select class="form-control autoFull select2"  style="width: 200px;height:34px;"
                        th:data-url="@{/admin/customerDictionary/getListByParentCode/DDTJ}"
                        data-value="value"
                        name="arrivalWay"
                        id="arrivalWay" >
                    <option value="">--请选择到店途径--</option>
                </select>
            </div>
            <div class="form-group mr-20 mt-10">
                <label >会员活跃度</label>
                <select class="form-control autoFull"
                        th:data-url="@{/admin/dataDictionary/showDataDictionary}"
                        data-param="{type:'会员活跃度'}"
                        data-value="name"
                        name="vipState"
                        id="vipState">
                    <option value="" >--请选择会员活跃度--</option>
                </select>
            </div>
            <div class="form-group mr-20 mt-10">
                <label >健康顾问</label>
                <select id="staffId" class="form-control autoFull select2"
                        th:data-url="@{/admin/all}"
                        data-value="suId"
                        data-filed="suName"
                        name="staffId"
                       >
                    <option value="">--请选择健康顾问--</option>
                </select>
            </div>
            <div class="form-group mr-20 mt-10">
                <label >是否新客户</label>
                <select class="form-control "
                        name="isDeal" >
                    <option value="" >--请选择--</option>
                    <option value="1" >是</option>
                    <option value="2" >否</option>
                </select>
            </div>
<!--            <div class="form-group mr-20 mt-10">-->
<!--                <label >所属门店</label>-->
<!--                <select class="form-control autoFull"-->
<!--                        th:data-url="@{/hiveErp/shopInfo/findShopByRole}"-->
<!--                        data-value="id"-->
<!--                        data-filed="shopName"-->
<!--                        name="shopId"-->
<!--                        id="shopId" >-->
<!--                    <option value="">&#45;&#45;请选择门店&#45;&#45;</option>-->
<!--                </select>-->
<!--            </div>-->
            <div class="form-group">
                <button matrix:btn="vipInfo-add"  onclick="myGrid.serchData(1)" type="button"
                        class="btn btn-sm btn-info">
                    <i class="fa fa-search "></i> 搜索
                </button>
                <button type="reset" class="btn btn-sm btn-info ">
                    <i class="fa fa-refresh "></i> 重置
                </button>
            </div>
        </form>
    </div>
    <div class="row mt-10">
 
            <!-- 功能按钮部分 -->
            <div id="option-bar" >
                    <button matrix:btn="vipInfo-edit"  onclick="openEdit()" type="button" class="btn btn-info btn-sm"><i class="fa fa-edit" ></i> 编辑</button>
                    <button matrix:fn="servicefollow"  onclick="openFollow()" type="button" class="btn btn-info btn-sm"><i class="fa fa-edit" ></i> 跟进记录</button>
                    <button matrix:fn="servicefollow"  onclick="openArchieves()" type="button" class="btn btn-info btn-sm"><i class="fa fa-edit" ></i> 客户档案</button>
                    <button matrix:btn="vipInfo-projTaocan"  onclick="openProj()" type="button" class="btn btn-info btn-sm"><i class="fa fa-cube"></i> 项目管理</button>
                    <button matrix:btn="vipInfo-projTaocan"  onclick="openTc()" type="button" class="btn btn-info btn-sm"><i class="fa fa-cubes"></i> 套餐管理</button>
                    <button matrix:btn="vipInfo-projTaocan"  onclick="openMoneyCard()" type="button" class="btn btn-info btn-sm"><i class="fa fa-credit-card"></i> 充值卡管理</button>
 
                    <button   onclick="importProjUse()" type="button" class="btn btn-info btn-sm"><i class="fa fa-history"></i> 导入项目</button>
 
                    <button matrix:fn="orderClub"  onclick="openOrder()" type="button" class="btn btn-info btn-sm"><i class="fa fa-history"></i> 消费订单</button>
                    <button matrix:fn="serviceClub"  onclick="openServiceOrder()" type="button" class="btn btn-info btn-sm"><i class="fa fa-history"></i> 服务单</button>
                    <button matrix:btn="vipInfo-add"  onclick="openAdd()" type="button" class="btn btn-info btn-sm"><i class="fa fa-plus" ></i>  新增</button>
                    <button matrix:btn="vipInfo-exportExcel"  onclick="exportExcel()" type="button" class="btn btn-info btn-sm"><i class="fa fa-download" ></i> 导出</button>
                    <button matrix:btn="vipInfo-allot"  onclick="updateVipInfos()" type="button" class="btn btn-info btn-sm"><i class="" ></i>批量设置健康顾问</button>
                    <button onclick="skinCheck()" type="button" class="btn btn-info btn-sm"><i class="" ></i>皮肤检测管理</button>
                    <button onclick="importVipInfo()" type="button" class="btn btn-info btn-sm"><i class="" ></i>导入会员</button>
                <button matrix:btn="vipInfo-dels"  onclick="myGrid.delItems()" type="button" class="btn btn-danger btn-sm"><i class="fa fa-trash" ></i>批量删除</button>
            </div>
 
        <!-- 数据表格部分 -->
        <table id="mgrid">
            <thead>
            <tr>
                <th data-checkbox="true"  ></th>
                <th data-formatter="MGrid.indexfn" data-align="center"  data-width="30px" >序号</th>
                <th data-field="vipNo" >会员编号</th>
                <th data-field="vipName"  data-formatter="getVipName">姓名</th>
                <th data-field="sex">性别</th>
                <th data-field="phone">手机号码</th>
                <th data-field="vipType">会员类型</th>
                <th data-field="vipState">会员活跃度</th>
                <th data-field="arrivalWay">到店途径</th>
                <th data-field="staffName">健康顾问</th>
                <th data-field="validFlag" data-formatter="miniQuery">小程序查询权限</th>
                <th data-field="staffName" data-formatter="buildOperation">操作</th>
            </tr>
            </thead>
        </table>
        <!-- 数据表格部分end -->
    </div>
</div>
 
<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script>
<script type="text/javascript">
    var myGrid;
    $(function(){
        $(".select2").select2({height:'34px'});
        //createDateDictionary();
        MTools.autoFullSelect();
        //有删除权限
        var delUrl="";
        delUrl=basePath+"/admin/vipInfo/del";
 
 
        myGrid=
            MGrid.initGrid({
                url : basePath+"/admin/vipInfo/showVipInfoList",
                delUrl : delUrl,
 
            });
    });
 
    var btns=[];
    btns[0]="";
    function buildOperation(value, row, index) {
        var html = "";
        var desc;
        if (row.validFlag == 1) {
            desc = "关闭小程序查询权益";
        } else {
            desc = "开启小程序查询权益";
        }
        html += '<a class="text-info" href="javascript:void(0)" onClick="openVipDetail(\''+row.phone+'\')">查看详情</a>&nbsp;&nbsp;'
        + btns[0].replace("VALUE", row.id).replace("FLAG", row.validFlag).replace("DESC", desc);
        return html;
    }
 
    function openVipDetail(value) {
        layer.full(layer.open({
            type : 2,
            title : "会员详情",
            area : [ MUI.SIZE_L, '450px' ],
            maxmin : true,
            content : [ basePath+'/admin/redirect/hive/beautySalon/vip?vipPhone=' + value ]
        }));
    }
 
    function openVipDetail2(value) {
        layer.full(layer.open({
            type : 2,
            title : "会员详情",
            area : [ MUI.SIZE_L, '450px' ],
            maxmin : true,
            content : [ basePath+'/admin/redirect/hive/beautySalon/vip_detail?vipPhone=' + value ]
        }));
    }
        function updateVipInfos() {
            if(myGrid.getSelectItemsIds()==""){
                layer.msg("请至少选择一名会员!", {
                    icon : 2
                });
 
            }else{
                layer.open({
                    type : 2,
                    title : "批量设置健康顾问",
                    area: ['450px', '400px'],
                    maxmin : true,
                    shadeClose:false,
                    content : [ basePath+'/admin/redirect/hive/vip/vipInfo-list-setStaff' ]
                });
            }
        }
 
    /**
     * 构建会员名称
     */
    function getVipName(value, row, index){
            if(row.isDeal==2){
                return value+" &nbsp;<span class='label-danger'>新</span>"
            }else{
                return value;
            }
    }
 
    function miniQuery(value, row, index) {
        if(row.validFlag==1){
            return "已开启"
        }else{
            return "已关闭";
        }
    }
 
 
        function loodFlow(){
            var id=myGrid.getSelectItemId();
            layer.full(layer.open({
                type : 2,
                title : "操作流水",
                area : [ MUI.SIZE_L, '450px' ],
                maxmin : true,
                content : [ basePath+'/admin/redirect/hive/vip/moneyCardUseFlow-list?vipId=' + id ]
            }));
        }
        function openOrder(){
            var vipName=myGrid.getSelectItemId("vipName");
            layer.full(layer.open({
                type : 2,
                title : "消费记录",
                area : [ MUI.SIZE_L, '450px' ],
                maxmin : true,
                content : [ basePath+'/admin/redirect/hive/operate/sysOrder-list?vipName=' + vipName ]
            }));
        }
 
    function openServiceOrder(){
        var vipName=myGrid.getSelectItemId("vipName");
        layer.full(layer.open({
            type : 2,
            title : "服务单",
            area : [ MUI.SIZE_L, '450px' ],
            maxmin : true,
            content : [ basePath+'/admin/redirect/hive/store/projService-list?vipName=' + vipName ]
        }));
    }
 
        function openArchieves(){
            var id=myGrid.getSelectItemId();
            layer.full(layer.open({
                type : 2,
                title : "客户档案",
                area : [ MUI.SIZE_L, '450px' ],
                maxmin : true,
                content : [ basePath+'/admin/redirect/hive/vip/vip-archives-pc?id=' + id ]
            }));
        }
        //打开添加界面
        function openAdd() {
            layer.full(layer.open({
                type : 2,
                title : "添加会员信息",
                area : [ MUI.SIZE_L, '450px' ],
                content : [ basePath+'/admin/vipInfo/editForm' ]
            }));
        }
 
    //打开编辑界面
        function openEdit() {
            var id=myGrid.getSelectItemId();
            layer.full(layer.open({
                type : 2,
                title : "编辑会员信息",
                area : [ MUI.SIZE_L, '450px' ],
                maxmin : true,
                content : [ basePath+'/admin/vipInfo/editForm?id=' + id ]
            }));
        }
 
 
    function openFollow(){
        var id=myGrid.getSelectItemId();
        layer.open({
            type : 2,
            title : "会员跟进记录",
            area :  MUI.SIZE_M,
            maxmin : true,
            content : [ basePath+'/admin/redirect/hive/vip/followu-list?vipId=' + id ]
        });
    }
    function createDateDictionary() {
        $(".dds").each(
            function() {
                var type = $(this).attr("cc");
                var _this = $(this);
                //取服务器请求数据
                $.AjaxProxy({
                    p : {
                        type : type
                    }
                })
                    .invoke(
                        basePath+"/admin/dds/showDataDictionary",
                        function(loj) {
                            var html = '';
                            console.log(loj.getRowCount());
                            for (var i = 0; i < loj
                                .getRowCount(); i++) {
                                html += '<option value="'
                                    + loj
                                        .getString(i,
                                            "id")
                                    + '">'
                                    + loj.getString(i,
                                        "name")
                                    + "</option>";
                            }
                            _this.html(html);
                        });
 
            });
    }
        function openTc() {
            var id=myGrid.getSelectItemId();
            layer.open({
                type: 2,
                title: "会员套餐管理",
                area: MUI.SIZE_M,
                content : [ basePath+'/admin/redirect/hive/vip/viptc-list?vipId=' + id]
            });
        }
 
        function openProj() {
            var id=myGrid.getSelectItemId();
            layer.open({
                type: 2,
                title: "会员项目管理",
                area: MUI.SIZE_M,
                content : [ basePath+'/admin/redirect/hive/vip/projUse-list?vipId=' + id]
            });
        }
        function openMoneyCard() {
            var id=myGrid.getSelectItemId();
            layer.open({
                type: 2,
                title: "会员充值卡管理",
                area: MUI.SIZE_M,
                content : [ basePath+'/admin/redirect/hive/vip/moneyCardUse-list?vipId=' + id]
            });
        }
 
    function openZongheCard() {
        var id=myGrid.getSelectItemId();
        layer.open({
            type: 2,
            title: "会员综合卡管理",
            area: MUI.SIZE_M,
            content : [ basePath+'/admin/redirect/hive/vip/zongheCardUse-list?vipId=' + id]
        });
    }
 
    function skinCheck() {
        var id=myGrid.getSelectItemId();
        layer.open({
            type: 2,
            title: "皮肤检测管理",
            area: MUI.SIZE_M,
            content : [ basePath+'/admin/redirect/hive/vip/sysSkinCheckRecord-list?vipId=' + id]
        });
    }
 
    function importProjUse() {
        layer.open({
            type: 2,
            title: "导入项目",
            area: [MUI.SIZE_L, '400px'],
            content : [ basePath+'/admin/redirect/hive/vip/projUseImport-form']
        });
    }
 
    function importVipInfo() {
        layer.open({
            type: 2,
            title: "导入会员",
            area: [MUI.SIZE_L, '400px'],
            content : [ basePath+'/admin/vipInfo/toImportForm']
        });
    }
 
    //导出
    function exportExcel() {
        var param=MForm.toUrlParam("#serchform");
        window.location.href=basePath+"/admin/vipInfo/exportExcel?"+param;
    }
 
    function vipInfoValid(id, validFlag) {
        var desc;
        if (validFlag == 1) {
            desc = "确认要关闭小程序查询权益?";
        } else {
            desc = "确认要开启小程序查询权益?";
        }
        MTools.handleItem(
            basePath + '/admin/vipInfo/validFlagChange?id=' + id, desc, function () {
                myGrid.serchData();
            });
    }
 
</script>
<script matrix:btn="vipInfo-miniQuery">
    btns[0]='<a class="text-info" href="javascript:void(0)" onClick="vipInfoValid(\'VALUE\', \'FLAG\')" >DESC</a>&nbsp;&nbsp;'
</script>
</body>
</html>