|
|
@@ -0,0 +1,598 @@
|
|
|
1
|
+<!DOCTYPE html>
|
|
|
2
|
+<html>
|
|
|
3
|
+<head>
|
|
|
4
|
+ <meta charset="UTF-8">
|
|
|
5
|
+ <script src="../Script/Common/huayi.load.js"></script>
|
|
|
6
|
+ <script src="../Script/Common/huayi.config.js"></script>
|
|
|
7
|
+ <link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
|
|
|
8
|
+ <link rel="stylesheet" href="../css/init.css" />
|
|
|
9
|
+ <link href="./css/buMenManger.css" rel="stylesheet" />
|
|
|
10
|
+ <title>系统管理-->菜单设置</title>
|
|
|
11
|
+ <style>
|
|
|
12
|
+ .boxCon table th {
|
|
|
13
|
+ width: 42%;
|
|
|
14
|
+}
|
|
|
15
|
+ </style>
|
|
|
16
|
+</head>
|
|
|
17
|
+<body>
|
|
|
18
|
+ <div class="container-fluid">
|
|
|
19
|
+ <div class="daoHang clearfix">
|
|
|
20
|
+ <div class="dhLeft">
|
|
|
21
|
+ <sapn><i class="syIcon"></i>位置:<a id="ReIndex" href="javaScript:;">首页</a>><a href="javaScript:;">系统管理</a>><a href="javaScript:;">权限管理</a>><a href="" style="color: #000;">菜单设置</a></sapn>
|
|
|
22
|
+ </div>
|
|
|
23
|
+ </div>
|
|
|
24
|
+ <div class="toolBar">
|
|
|
25
|
+ <button class="btns add">添加</button>
|
|
|
26
|
+ <button class="btns change">修改</button>
|
|
|
27
|
+ <button class="btns del">删除</button>
|
|
|
28
|
+ </div>
|
|
|
29
|
+ <div class="tree">
|
|
|
30
|
+ <ul id="treeDemo" class="ztree">
|
|
|
31
|
+ <!--类名为ztree是必须的-->
|
|
|
32
|
+ </ul>
|
|
|
33
|
+ </div>
|
|
|
34
|
+
|
|
|
35
|
+ </div>
|
|
|
36
|
+ <!--添加弹出内容-->
|
|
|
37
|
+ <div class="model addModel">
|
|
|
38
|
+ <div class="box">
|
|
|
39
|
+ <div class="btop clearfix">
|
|
|
40
|
+ <p class="btl"><span>添加</span> ⌊ <span class="tps" style="color: red;"></span> ⌉ 部门</p>
|
|
|
41
|
+ <p class="btr addBtr" title="关闭">X</p>
|
|
|
42
|
+ </div>
|
|
|
43
|
+ <div class="boxCon">
|
|
|
44
|
+ <table>
|
|
|
45
|
+ <tbody>
|
|
|
46
|
+ <tr>
|
|
|
47
|
+ <th>父级分类:</th>
|
|
|
48
|
+ <td>
|
|
|
49
|
+ <div class="inpBox">
|
|
|
50
|
+ <input type="text" class="inps inps1" />
|
|
|
51
|
+ <i class="xl xl_one"></i>
|
|
|
52
|
+ <div class="addTree xlAdd">
|
|
|
53
|
+ <ul id="addTreeDemo" class="ztree"></ul>
|
|
|
54
|
+ </div>
|
|
|
55
|
+ </div>
|
|
|
56
|
+ </td>
|
|
|
57
|
+ </tr>
|
|
|
58
|
+ <!--<tr>
|
|
|
59
|
+ <th>添加类型:</th>
|
|
|
60
|
+ <td>
|
|
|
61
|
+ <select class="inpBox inps2" id="selecttype">
|
|
|
62
|
+ <option value="0">菜单</option>
|
|
|
63
|
+ <option value="1">页面</option>
|
|
|
64
|
+ <option value="2">权限</option>
|
|
|
65
|
+ </select>
|
|
|
66
|
+ </td>
|
|
|
67
|
+ </tr>-->
|
|
|
68
|
+ <tr>
|
|
|
69
|
+ <th>名 称:</th>
|
|
|
70
|
+ <td>
|
|
|
71
|
+ <input class="inps inps3" type="text" />
|
|
|
72
|
+ </td>
|
|
|
73
|
+ </tr>
|
|
|
74
|
+ <tr>
|
|
|
75
|
+ <th>代 码:</th>
|
|
|
76
|
+ <td>
|
|
|
77
|
+ <input class="inps inps4" type="text" />
|
|
|
78
|
+ </td>
|
|
|
79
|
+ </tr>
|
|
|
80
|
+ <tr>
|
|
|
81
|
+ <th>菜单链接:</th>
|
|
|
82
|
+ <td>
|
|
|
83
|
+ <input class="inps inps5" type="text" />
|
|
|
84
|
+ </td>
|
|
|
85
|
+ </tr>
|
|
|
86
|
+ <tr>
|
|
|
87
|
+ <th>是否启用:</th>
|
|
|
88
|
+ <td>
|
|
|
89
|
+ <input class="inps7" type="checkbox" />
|
|
|
90
|
+ </td>
|
|
|
91
|
+ </tr>
|
|
|
92
|
+ <tr>
|
|
|
93
|
+ <th>备 注:</th>
|
|
|
94
|
+ <td>
|
|
|
95
|
+ <input class="inps inps8" type="text" />
|
|
|
96
|
+ </td>
|
|
|
97
|
+ </tr>
|
|
|
98
|
+ <tr>
|
|
|
99
|
+ <th>排序编码:</th>
|
|
|
100
|
+ <td>
|
|
|
101
|
+ <input class="inps inps9" type="text" />
|
|
|
102
|
+ </td>
|
|
|
103
|
+ </tr>
|
|
|
104
|
+ <tr>
|
|
|
105
|
+ <!--<th>排序编码:</th>-->
|
|
|
106
|
+ <td colspan="2" style="text-align: center;">
|
|
|
107
|
+ <button class="btns addCun">保存</button>
|
|
|
108
|
+ </td>
|
|
|
109
|
+ </tr>
|
|
|
110
|
+ </tbody>
|
|
|
111
|
+ </table>
|
|
|
112
|
+ </div>
|
|
|
113
|
+ </div>
|
|
|
114
|
+
|
|
|
115
|
+ </div>
|
|
|
116
|
+ <!--删除弹出内容-->
|
|
|
117
|
+ <div class="model delModel">
|
|
|
118
|
+ <div class="box">
|
|
|
119
|
+ <div class="btop clearfix">
|
|
|
120
|
+ <p class="btl"><span>删除提示</span></p>
|
|
|
121
|
+ <p class="btr delBtr" title="关闭">X</p>
|
|
|
122
|
+ </div>
|
|
|
123
|
+ <div class="boxCon" style="height: 150px;">
|
|
|
124
|
+ 您确定删除 ⌊ <span class="delName" style="color: red;"></span> ⌉ ?
|
|
|
125
|
+
|
|
|
126
|
+ <p style="margin-top: 30px;">
|
|
|
127
|
+ <button class="btns sure">确定</button>
|
|
|
128
|
+ <button class="btns return">取消</button>
|
|
|
129
|
+ </p>
|
|
|
130
|
+ <!--<p style="color: red;">注:若该分类下包含知识库内容会一并删除</p>-->
|
|
|
131
|
+ </div>
|
|
|
132
|
+
|
|
|
133
|
+ </div>
|
|
|
134
|
+
|
|
|
135
|
+ </div>
|
|
|
136
|
+ <!--修改弹出内容-->
|
|
|
137
|
+ <div class="model changeModel">
|
|
|
138
|
+ <div class="box">
|
|
|
139
|
+ <div class="btop clearfix">
|
|
|
140
|
+ <p class="btl"><span>修改</span> ⌊ <span class="tps chtps" style="color: red;"></span> ⌉ 栏目</p>
|
|
|
141
|
+ <p class="btr changeBtr" title="关闭">X</p>
|
|
|
142
|
+ </div>
|
|
|
143
|
+ <div class="boxCon">
|
|
|
144
|
+ <table>
|
|
|
145
|
+ <tbody>
|
|
|
146
|
+ <tr>
|
|
|
147
|
+ <th> 父级分类:</th>
|
|
|
148
|
+ <td>
|
|
|
149
|
+ <div class="inpBox">
|
|
|
150
|
+ <input type="text" class="inps inps1_chg" />
|
|
|
151
|
+ <i class="xl xl_one"></i>
|
|
|
152
|
+ <div class="addTree xlAdd">
|
|
|
153
|
+ <ul id="changeTreeDemo" class="ztree"></ul>
|
|
|
154
|
+ </div>
|
|
|
155
|
+ </div></td>
|
|
|
156
|
+ </tr>
|
|
|
157
|
+ <!--<tr>
|
|
|
158
|
+ <th>
|
|
|
159
|
+ 修改类型:
|
|
|
160
|
+ </th>
|
|
|
161
|
+ <td>
|
|
|
162
|
+ <select class="inpBox inps2_chg" id="selecttype">
|
|
|
163
|
+ <option value="0">菜单</option>
|
|
|
164
|
+ <option value="1">页面</option>
|
|
|
165
|
+ <option value="2">权限</option>
|
|
|
166
|
+ </select>
|
|
|
167
|
+ </td>
|
|
|
168
|
+ </tr>-->
|
|
|
169
|
+ <tr>
|
|
|
170
|
+ <th>
|
|
|
171
|
+ 名 称:
|
|
|
172
|
+ </th>
|
|
|
173
|
+ <td>
|
|
|
174
|
+ <input class="inps inps3_chg" type="text" />
|
|
|
175
|
+ </td>
|
|
|
176
|
+ </tr>
|
|
|
177
|
+ <tr>
|
|
|
178
|
+ <th>
|
|
|
179
|
+ 代 码:
|
|
|
180
|
+ </th>
|
|
|
181
|
+ <td>
|
|
|
182
|
+ <input class="inps inps4_chg" type="text" />
|
|
|
183
|
+ </td>
|
|
|
184
|
+ </tr>
|
|
|
185
|
+ <tr>
|
|
|
186
|
+ <th>
|
|
|
187
|
+ 菜单链接:
|
|
|
188
|
+ </th>
|
|
|
189
|
+ <td>
|
|
|
190
|
+ <input class="inps inps5_chg" type="text" />
|
|
|
191
|
+ </td>
|
|
|
192
|
+ </tr>
|
|
|
193
|
+ <tr>
|
|
|
194
|
+ <th>
|
|
|
195
|
+ 是否启用:
|
|
|
196
|
+ </th>
|
|
|
197
|
+ <td>
|
|
|
198
|
+ <input class="inps7_chg" type="checkbox" />
|
|
|
199
|
+ </td>
|
|
|
200
|
+ </tr>
|
|
|
201
|
+ <tr>
|
|
|
202
|
+ <th>
|
|
|
203
|
+ 备 注:
|
|
|
204
|
+ </th>
|
|
|
205
|
+ <td>
|
|
|
206
|
+ <input class="inps inps8_chg" type="text" />
|
|
|
207
|
+ </td>
|
|
|
208
|
+ </tr>
|
|
|
209
|
+ <tr>
|
|
|
210
|
+ <th>
|
|
|
211
|
+ 排序编码:
|
|
|
212
|
+ </th>
|
|
|
213
|
+ <td>
|
|
|
214
|
+ <input class="inps inps9_chg" type="text" />
|
|
|
215
|
+ </td>
|
|
|
216
|
+ </tr>
|
|
|
217
|
+ <tr>
|
|
|
218
|
+ <td colspan="2" style="text-align: center;">
|
|
|
219
|
+ <button class="btns changeCun">保存</button>
|
|
|
220
|
+ </td>
|
|
|
221
|
+ </tr>
|
|
|
222
|
+ </tbody>
|
|
|
223
|
+ </table>
|
|
|
224
|
+
|
|
|
225
|
+ </div>
|
|
|
226
|
+ </div>
|
|
|
227
|
+
|
|
|
228
|
+ </div>
|
|
|
229
|
+
|
|
|
230
|
+ <script src="../js/jquery.min.js?v=2.1.4"></script>
|
|
|
231
|
+ <script src="../js/bootstrap.min.js"></script>
|
|
|
232
|
+ <script src="../js/zTree/jquery.ztree.core.js"></script>
|
|
|
233
|
+ <script src="../js/jquery.cookie.js"></script>
|
|
|
234
|
+ <script>
|
|
|
235
|
+ var tps = $('.tps');
|
|
|
236
|
+ var id = ''; //当前节点id
|
|
|
237
|
+ var name; //当前节点name
|
|
|
238
|
+ var pid; //当前节点父ID
|
|
|
239
|
+ var pidName;//
|
|
|
240
|
+ var xlName; //添加弹出框内下拉框内节点name
|
|
|
241
|
+ var token = $.cookie("token");
|
|
|
242
|
+ tree();
|
|
|
243
|
+
|
|
|
244
|
+ function tree() {
|
|
|
245
|
+ $.get(huayi.config.callcenter_url + 'ModuleInfo/GetTreeList', {
|
|
|
246
|
+ "token": $.cookie("token")
|
|
|
247
|
+ }, function (result) {
|
|
|
248
|
+ result = $.parseJSON(result);
|
|
|
249
|
+ $.fn.zTree.init($("#treeDemo"), setting1, result.data); //实例化树形图
|
|
|
250
|
+ });
|
|
|
251
|
+ }
|
|
|
252
|
+
|
|
|
253
|
+ var setting1 = {
|
|
|
254
|
+ data: {
|
|
|
255
|
+ key: {
|
|
|
256
|
+ name: "text"
|
|
|
257
|
+ },
|
|
|
258
|
+ simpleData: {
|
|
|
259
|
+ enable: true,
|
|
|
260
|
+ idKey: "id",
|
|
|
261
|
+ rootPId: 0
|
|
|
262
|
+ }
|
|
|
263
|
+ },
|
|
|
264
|
+ callback: {
|
|
|
265
|
+ onClick: zTreeOnClick
|
|
|
266
|
+ }
|
|
|
267
|
+ };
|
|
|
268
|
+
|
|
|
269
|
+ function zTreeOnClick(event, treeId, treeNode) {
|
|
|
270
|
+ id = treeNode.id;
|
|
|
271
|
+ name = treeNode.text;
|
|
|
272
|
+ var parent = treeNode.getParentNode();
|
|
|
273
|
+ if (parent) {
|
|
|
274
|
+ pidName = parent.text;
|
|
|
275
|
+ pid = parent.id;
|
|
|
276
|
+ } else {
|
|
|
277
|
+ pidName = "顶级分类";
|
|
|
278
|
+ pid = 0;
|
|
|
279
|
+ }
|
|
|
280
|
+ };
|
|
|
281
|
+ var setting2 = {
|
|
|
282
|
+ data: {
|
|
|
283
|
+ key: {
|
|
|
284
|
+ name: "text"
|
|
|
285
|
+ },
|
|
|
286
|
+ simpleData: {
|
|
|
287
|
+ enable: true,
|
|
|
288
|
+ idKey: "id",
|
|
|
289
|
+ rootPId: 0
|
|
|
290
|
+ }
|
|
|
291
|
+ },
|
|
|
292
|
+ callback: {
|
|
|
293
|
+ onClick: addTreeClick
|
|
|
294
|
+ }
|
|
|
295
|
+ }
|
|
|
296
|
+
|
|
|
297
|
+ function addTreeClick(event, treeId, treeNode) {
|
|
|
298
|
+ addPid = treeNode.id;
|
|
|
299
|
+ console.log(addPid);
|
|
|
300
|
+ xlName = treeNode.text;
|
|
|
301
|
+ $('.inps1').val(xlName);
|
|
|
302
|
+
|
|
|
303
|
+ };
|
|
|
304
|
+ //删除按钮
|
|
|
305
|
+ $('.del').click(function () {
|
|
|
306
|
+ if (id == 'null' || id == '') {
|
|
|
307
|
+ layer.confirm('没有要删除的分类!', {
|
|
|
308
|
+ btn: ['确定']
|
|
|
309
|
+ });
|
|
|
310
|
+ return
|
|
|
311
|
+ } else {
|
|
|
312
|
+ $('.delModel').css('display', 'block');
|
|
|
313
|
+ $('.delName').html(name);
|
|
|
314
|
+ }
|
|
|
315
|
+ })
|
|
|
316
|
+ //关闭按钮
|
|
|
317
|
+ $('.delBtr').click(function () {
|
|
|
318
|
+ $('.delModel').css('display', 'none');
|
|
|
319
|
+ })
|
|
|
320
|
+ //确定删除按钮
|
|
|
321
|
+ $('.sure').click(function () {
|
|
|
322
|
+ $.ajax({
|
|
|
323
|
+ type: "post",
|
|
|
324
|
+ url: huayi.config.callcenter_url + "ModuleInfo/DelModule",
|
|
|
325
|
+ async: true,
|
|
|
326
|
+ dataType: 'json',
|
|
|
327
|
+ data: {
|
|
|
328
|
+ ids: id,
|
|
|
329
|
+ token: token
|
|
|
330
|
+ },
|
|
|
331
|
+ success: function (data) {
|
|
|
332
|
+ if (data.state == "success") {
|
|
|
333
|
+ layer.msg("删除成功!");
|
|
|
334
|
+ tree();
|
|
|
335
|
+ }
|
|
|
336
|
+ }
|
|
|
337
|
+ });
|
|
|
338
|
+ $('.delModel').css('display', 'none');
|
|
|
339
|
+
|
|
|
340
|
+ })
|
|
|
341
|
+ //取消删除按钮
|
|
|
342
|
+ $('.return').click(function () {
|
|
|
343
|
+ $('.delModel').css('display', 'none');
|
|
|
344
|
+ })
|
|
|
345
|
+
|
|
|
346
|
+ //添加按钮
|
|
|
347
|
+ $('.add').click(function () {
|
|
|
348
|
+ $('.addModel').css('display', 'block');
|
|
|
349
|
+ if (pidName) {
|
|
|
350
|
+ tps.html(name);
|
|
|
351
|
+ $('.inps1').val(name);
|
|
|
352
|
+ addPid = id;
|
|
|
353
|
+ } else {
|
|
|
354
|
+ tps.html('顶级分类');
|
|
|
355
|
+ $('.inps1').val('顶级分类');
|
|
|
356
|
+ addPid = 0;
|
|
|
357
|
+ }
|
|
|
358
|
+ treeCont();
|
|
|
359
|
+
|
|
|
360
|
+ })
|
|
|
361
|
+ //添加关闭按钮
|
|
|
362
|
+ $('.addBtr').click(function () {
|
|
|
363
|
+ $('.addModel').css('display', 'none');
|
|
|
364
|
+ })
|
|
|
365
|
+ //添加内容下拉
|
|
|
366
|
+ $('.inps1').focus(function () {
|
|
|
367
|
+ $('.xlAdd').css('display', 'block')
|
|
|
368
|
+ })
|
|
|
369
|
+ $('.xl_one').click(function () {
|
|
|
370
|
+ if ($('.xlAdd').css('display') == 'block') {
|
|
|
371
|
+ $('.xlAdd').css('display', 'none')
|
|
|
372
|
+ } else {
|
|
|
373
|
+ $('.xlAdd').css('display', 'block')
|
|
|
374
|
+ }
|
|
|
375
|
+ })
|
|
|
376
|
+ $('.addTree').mouseleave(function () {
|
|
|
377
|
+ $(this).css('display', 'none')
|
|
|
378
|
+ })
|
|
|
379
|
+ //保存添加按钮
|
|
|
380
|
+ var addPid, addDeptname, addSort;
|
|
|
381
|
+ //添加弹出框内 所属部门下拉框内数据
|
|
|
382
|
+ function treeCont() {
|
|
|
383
|
+ $.get(huayi.config.callcenter_url + 'ModuleInfo/GetTreeList', {
|
|
|
384
|
+ "token": $.cookie("token")
|
|
|
385
|
+ }, function (result) {
|
|
|
386
|
+ result = $.parseJSON(result);
|
|
|
387
|
+ $.fn.zTree.init($("#addTreeDemo"), setting2, result.data); //实例化树形图
|
|
|
388
|
+ });
|
|
|
389
|
+
|
|
|
390
|
+ }
|
|
|
391
|
+ $('.addCun').click(function () {
|
|
|
392
|
+ // console.log(addPid);
|
|
|
393
|
+ //if ($('.inps2').val() == "" || $('.inps3').val() == "") {
|
|
|
394
|
+ // if (did.length <= 0) {
|
|
|
395
|
+ // layer.confirm('所添加内容不能为空!', {
|
|
|
396
|
+ // btn: ['确定']
|
|
|
397
|
+ // });
|
|
|
398
|
+ // return;
|
|
|
399
|
+ // }
|
|
|
400
|
+ //} else {
|
|
|
401
|
+
|
|
|
402
|
+ addName = $('.inps3').val();
|
|
|
403
|
+ addCode = $('.inps4').val();
|
|
|
404
|
+ addUrl = $(".inps5").val();
|
|
|
405
|
+ addState = $('.inps7').prop('checked');
|
|
|
406
|
+ addRemark = $('.inps8').val();
|
|
|
407
|
+ addSort = $('.inps9').val();
|
|
|
408
|
+ $('.addModel').css('display', 'none');
|
|
|
409
|
+ $.ajax({
|
|
|
410
|
+ type: "post",
|
|
|
411
|
+ url: huayi.config.callcenter_url + "ModuleInfo/AddModule",
|
|
|
412
|
+ dataType: 'json',
|
|
|
413
|
+ async: true,
|
|
|
414
|
+ data: {
|
|
|
415
|
+ parentid: id,//当前选择节点ID
|
|
|
416
|
+ code: addCode,
|
|
|
417
|
+ name: addName,//部门名称
|
|
|
418
|
+ url: addUrl,
|
|
|
419
|
+ flag: addState,
|
|
|
420
|
+ remark: addRemark,
|
|
|
421
|
+ sort: addSort,//排列序号
|
|
|
422
|
+ token: token
|
|
|
423
|
+ },
|
|
|
424
|
+ success: function (data) {
|
|
|
425
|
+ // console.log(data)
|
|
|
426
|
+ // console.log(data.state);
|
|
|
427
|
+ if (data.state == "success") {
|
|
|
428
|
+ layer.msg("添加成功!");
|
|
|
429
|
+ tree();
|
|
|
430
|
+
|
|
|
431
|
+ }
|
|
|
432
|
+ }
|
|
|
433
|
+
|
|
|
434
|
+ });
|
|
|
435
|
+
|
|
|
436
|
+ //}
|
|
|
437
|
+ })
|
|
|
438
|
+
|
|
|
439
|
+ //修改按钮
|
|
|
440
|
+ var chanPid, //修改弹出框内 下拉框父节点ID
|
|
|
441
|
+ chanId, //修改弹出框内 下拉框当前节点ID
|
|
|
442
|
+ changeName, //修改弹出框内 下拉框当前节点name
|
|
|
443
|
+ chbcName, //保存的部门名称
|
|
|
444
|
+ chbcSort, //保存的排序号
|
|
|
445
|
+ chbcPid; //保存的所属部门ID
|
|
|
446
|
+ $('.change').click(function () {
|
|
|
447
|
+ if (id == 'null' || id == '') {
|
|
|
448
|
+ layer.confirm('没有选择要修改的部门!', {
|
|
|
449
|
+ btn: ['确定']
|
|
|
450
|
+ })
|
|
|
451
|
+ return
|
|
|
452
|
+ } else {
|
|
|
453
|
+ changeAjax(id);
|
|
|
454
|
+ $('.changeModel').css('display', 'block');
|
|
|
455
|
+ $('.chtps').html(name);
|
|
|
456
|
+ changeTreeCont();
|
|
|
457
|
+ }
|
|
|
458
|
+
|
|
|
459
|
+ });
|
|
|
460
|
+ //关闭按钮
|
|
|
461
|
+ $('.changeBtr').click(function () {
|
|
|
462
|
+ $('.changeModel').css('display', 'none');
|
|
|
463
|
+ });
|
|
|
464
|
+ $('.inps4').focus(function () {
|
|
|
465
|
+ $('.xlChange').css('display', 'block')
|
|
|
466
|
+ })
|
|
|
467
|
+ //下拉按钮功能
|
|
|
468
|
+ $('.xl_two').click(function () {
|
|
|
469
|
+ if ($('.xlChange').css('display') == 'block') {
|
|
|
470
|
+ $('.xlChange').css('display', 'none')
|
|
|
471
|
+ } else {
|
|
|
472
|
+ $('.xlChange').css('display', 'block')
|
|
|
473
|
+ }
|
|
|
474
|
+ })
|
|
|
475
|
+ //修改弹出框内 下拉树形图参数配置项
|
|
|
476
|
+ var setting3 = {
|
|
|
477
|
+ data: {
|
|
|
478
|
+ key: {
|
|
|
479
|
+ name: "text"
|
|
|
480
|
+ },
|
|
|
481
|
+ simpleData: {
|
|
|
482
|
+ enable: true,
|
|
|
483
|
+ idKey: "id",
|
|
|
484
|
+ rootPId: 0
|
|
|
485
|
+ }
|
|
|
486
|
+ },
|
|
|
487
|
+ callback: {
|
|
|
488
|
+ onClick: changeTreeClick
|
|
|
489
|
+ }
|
|
|
490
|
+ }
|
|
|
491
|
+
|
|
|
492
|
+ function changeTreeClick(event, treeId, treeNode) {
|
|
|
493
|
+ // chanPid = treeNode.pId;
|
|
|
494
|
+ chanId = treeNode.id;
|
|
|
495
|
+ changeName = treeNode.text;
|
|
|
496
|
+ $('.inps1_chg').val(changeName);
|
|
|
497
|
+ var pidnode = treeNode.getParentNode();
|
|
|
498
|
+ if (pidnode) {
|
|
|
499
|
+ chanPid = pidnode.id;
|
|
|
500
|
+ $('.inps1_chg').val(changeName);
|
|
|
501
|
+ } else {
|
|
|
502
|
+ chanPid = 0;
|
|
|
503
|
+ }
|
|
|
504
|
+ };
|
|
|
505
|
+
|
|
|
506
|
+ //修改弹出框内 所属部门下拉框内数据
|
|
|
507
|
+ function changeTreeCont() {
|
|
|
508
|
+ $.get(huayi.config.callcenter_url + 'ModuleInfo/GetTreeList', {
|
|
|
509
|
+ token: token
|
|
|
510
|
+ }, function (result) {
|
|
|
511
|
+ result = $.parseJSON(result);
|
|
|
512
|
+ $.fn.zTree.init($("#changeTreeDemo"), setting3, result.data); //实例化树形图
|
|
|
513
|
+ });
|
|
|
514
|
+ }
|
|
|
515
|
+
|
|
|
516
|
+ function changeAjax(id) {
|
|
|
517
|
+ $.ajax({
|
|
|
518
|
+ type: "get",
|
|
|
519
|
+ url: huayi.config.callcenter_url + "ModuleInfo/GetModule",
|
|
|
520
|
+ dataType: 'json',
|
|
|
521
|
+ async: true,
|
|
|
522
|
+ data: {
|
|
|
523
|
+ mId: id,
|
|
|
524
|
+ token: token
|
|
|
525
|
+ },
|
|
|
526
|
+ success: function (res) {
|
|
|
527
|
+ var data = res.data;
|
|
|
528
|
+ if (pid == null) {
|
|
|
529
|
+ pid == 0;
|
|
|
530
|
+ $('.inps1_chg').val('顶级分类');
|
|
|
531
|
+ chbcPid == 0;
|
|
|
532
|
+ } else {
|
|
|
533
|
+ $('.inps1_chg').val(pidName);
|
|
|
534
|
+ chbcPid = pid;
|
|
|
535
|
+ }
|
|
|
536
|
+ $('.inps3_chg').val(data.name);
|
|
|
537
|
+ $('.inps4_chg').val(data.code);
|
|
|
538
|
+ $('.inps5_chg').val(data.url);
|
|
|
539
|
+ if (data.enable == 1) { $('.inps7_chg').prop("checked", "checked"); }
|
|
|
540
|
+ $('.inps8_chg').val(data.remark);
|
|
|
541
|
+ $('.inps9_chg').val(data.sort);
|
|
|
542
|
+ }
|
|
|
543
|
+ });
|
|
|
544
|
+ }
|
|
|
545
|
+ //修改的保存按钮功能
|
|
|
546
|
+ function changeBaoCunAjax() {
|
|
|
547
|
+ var chgName = $('.inps3_chg').val();
|
|
|
548
|
+ var chgCode = $('.inps4_chg').val();
|
|
|
549
|
+ var chgUrl = $(".inps5_chg").val();
|
|
|
550
|
+ var chgState = $('.inps7_chg').prop('checked');
|
|
|
551
|
+ var chgRemark = $('.inps8_chg').val();
|
|
|
552
|
+ var chgSort = $('.inps9_chg').val();
|
|
|
553
|
+ $.ajax({
|
|
|
554
|
+ type: "post",
|
|
|
555
|
+ url: huayi.config.callcenter_url + "ModuleInfo/EditModule",
|
|
|
556
|
+ async: true,
|
|
|
557
|
+ dataType: 'json',
|
|
|
558
|
+ data: {
|
|
|
559
|
+ id: id,
|
|
|
560
|
+ parentid: chanId,//当前选择节点ID
|
|
|
561
|
+ code: chgCode,
|
|
|
562
|
+ name: chgName,//部门名称
|
|
|
563
|
+ url: chgUrl,
|
|
|
564
|
+ flag: chgState,
|
|
|
565
|
+ remark: chgRemark,
|
|
|
566
|
+ sort: chgSort,//排列序号
|
|
|
567
|
+ token: token
|
|
|
568
|
+ },
|
|
|
569
|
+ success: function (data) {
|
|
|
570
|
+ if (data.state == "success") {
|
|
|
571
|
+ layer.msg("修改成功!");
|
|
|
572
|
+ tree();
|
|
|
573
|
+ }
|
|
|
574
|
+ }
|
|
|
575
|
+ });
|
|
|
576
|
+ }
|
|
|
577
|
+
|
|
|
578
|
+ $('.changeCun').click(function () {
|
|
|
579
|
+ //if ($('.inps4').val() == "" || $('.inps5').val() == "" || $('.inps6').val() == "") {
|
|
|
580
|
+ // layer.confirm('所修改内容不允许为空!', {
|
|
|
581
|
+ // btn: ['确定']
|
|
|
582
|
+ // });
|
|
|
583
|
+ // return;
|
|
|
584
|
+ //} else {
|
|
|
585
|
+ $('.changeModel').css('display', 'none');
|
|
|
586
|
+ console.log('部门id' + id + '所属部门id' + chbcPid + '部门名称' + chbcName + '排序' + chbcSort);
|
|
|
587
|
+ chbcPid;
|
|
|
588
|
+ chbcName = $('.inps5').val();
|
|
|
589
|
+ chbcSort = $('.inps6').val();
|
|
|
590
|
+ changeBaoCunAjax(id, chbcPid, chbcName, chbcSort);
|
|
|
591
|
+ //}
|
|
|
592
|
+
|
|
|
593
|
+ })
|
|
|
594
|
+
|
|
|
595
|
+ </script>
|
|
|
596
|
+</body>
|
|
|
597
|
+
|
|
|
598
|
+</html>
|