Helius
2020-12-23 c554c7ad5405bafa149dbb6429e8245f78b33ffc
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
<!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">
            <!-- 用于套餐的查询 -->
            <input autocomplete="off"   type="hidden" name="vipId" value="${param.vipId }" id="vipId">
            <div class="form-group mt-10 mr-20">
                <label>项目名称</label> <input autocomplete="off"   name="name" type="text"
                                           class="form-control">
            </div>
            <div class="form-group mt-10 mr-20">
                <label for="status">状态</label> <select name="status"
                                                       class="form-control">
                <option value="">--请选择状态--</option>
                <option value="有效">有效</option>
                <option value="无效">无效</option>
                <option value="转让">转让</option>
                <option value="冻结">冻结</option>
                <option value="退款">退款</option>
            </select>
            </div>
 
            <div class="form-group mt-10 mr-20">
                <label >来源</label> <select name="source"
                                                       class="form-control">
                <option value="">--请选择来源--</option>
                <option value="购买">购买</option>
                <option value="赠送">赠送</option>
                <option value="转让">转让</option>
                <option value="数据迁移">数据迁移</option>
            </select>
            </div>
            <div class="form-group">
                <button 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-youxiao"  class="btn btn-info btn-sm " onClick="openActive()">
                <i class="fa fa-hand-o-up"></i> 有效
            </button>
            <button matrix:btn="vipInfo-wuxiao"  class="btn btn-info btn-sm " onClick="openInvalid()">
                <i class="fa fa-hand-o-down"></i> 无效
            </button>
            <button matrix:btn="vipInfo-dongjie"  class="btn btn-info btn-sm " onClick="freezeTc()">
                <i class="fa fa-stop"></i> 冻结
            </button>
            <button matrix:btn="vipInfo-cardEdit"  class="btn btn-info btn-sm " onClick="openEditPro()">
                <i class="fa fa-edit"></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="projName" data-sortable="true">项目名称</th>
                <th data-field="source">来源</th>
                <th data-field="status">状态</th>
                <th data-field="balance">项目余额</th>
                <th data-field="surplusCount">项目余次</th>
                <th data-field="failTime" data-formatter="MGrid.getTimeDD">到期时间</th>
                <th data-field="remark">备注</th>
            </tr>
            </thead>
        </table>
        <!-- 数据表格部分end -->
        <div class="form-group ">
            <div class="col-sm-12 text-center fixed-button">
                <a class="btn btn-danger radius" href="javascript:;"
                   onclick="MTools.closeForm()"><i class="fa fa-close"></i> 关闭</a>
            </div>
        </div>
    </div>
</div>
<div id="tuikuandan" style="display: none">
    <div class="col-sm-12">
        <div class=" form-group mr-20">
            <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="">--请选择门店--</option>
        </select>
        </div>
    </div>
    <div class="col-sm-12">
        <div class=" form-group mr-20">
            <label>备注</label> <input autocomplete="off"   id="remark" type="text"
                                     class="form-control">
        </div>
    </div>
    <div class="form-group ">
        <div class="col-sm-12 text-center">
            <a href="javascript:;" onclick="xjtk()"
               class="btn btn-success radius">确认</a>&nbsp;&nbsp;&nbsp;&nbsp;
        </div>
    </div>
 
</div>
<script type="text/javascript" th:src="@{/js/systools/MJsBase.js}"></script>
<script type="text/javascript">
    //初始化表格
    $(".select2").select2();
    MTools.autoFullSelect();
 
    var myGrid;
    $("#vipId").val($.query.get("vipId"));
 
    myGrid = MGrid.initGrid({
        url : basePath+"/admin/projUser/showList",
    });
 
    //设置有效
    function openActive() {
        var id = myGrid.getSelectItemId();
        $
            .AjaxProxy({
                p : {
                    id : id
                }
            })
            .invoke(
                basePath+"/admin/projUser/activeProj",
                function(loj) {
                    var rs = loj.attr("result");
                    console.log(loj);
                    if (rs.info == '已过期') {
                        layer
                            .open({
                                type : 2,
                                title : "设置过期日期",
                                area : [ "420px", '300px' ],
                                content : [ basePath+'/admin/redirect/vip/select-date-proj?id='
                                + id ]
                            });
                    } else {
                        layer.alert(loj.getValue("info"), {
                            icon : 1
                        });
                        myGrid.serchData();
                    }
                });
    }
    //设置无效
    function openInvalid() {
        var id = myGrid.getSelectItemId();
        $.AjaxProxy({
            p : {
                id : id
            }
        }).invoke(basePath+"/admin/projUser/invalidProj", function(loj) {
            layer.alert(loj.getValue("info"), {
                icon : 1
            });
            myGrid.serchData();
        });
    }
 
 
 
 
    //修改
    function openEditPro() {
        var id = myGrid.getSelectItemId();
        //弹出修改框
        layer.open({
            type : 2,
            title : "编辑",
            area : MUI.SIZE_M,
            maxmin : true,
            content : [ basePath+'/admin/projUser/editForm?id=' + id ]
        });
    }
 
    function openEdit() {
        var id = myGrid.getSelectItemId();
        layer.open({
            type : 2,
            title : "编辑信息",
            area : MUI.SIZE_M,
            content : [ basePath+'/admin/brand/editForm?id=' + id ]
        });
    }
 
 
    //冻结
    function freezeTc() {
        var id = myGrid.getSelectItemId();
        $.AjaxProxy({
            p : {
                id : id
            }
        }).invoke(basePath+"/admin/projUser/freezeProj", function(loj) {
            layer.alert(loj.getValue("info"), {
                icon : 1
            });
            myGrid.serchData();
 
        });
    }
 
    function getYesOrNo(value, row, index) {
        switch (value) {
            case 'Y':
                return "是";
            case 'N':
                return "否";
            default:
                return value;
        }
    }
</script>
 
</body>
</html>