多单位版国产化地质资料管理系统
zhai
2025-12-18 3c6f6c1e3016e38146a4c46be6e7b625c35591f2
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
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
 
<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>部门管理</title>
    <!--[if !IE]><!-->
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <!--<![endif]-->
    <!--[if gt IE 8]>
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <![endif]-->
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link href="static/styles/initialize.css" rel="stylesheet" type="text/css">
    <link href="static/styles/common.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/plugins/layer/skin/default/layer.css" type="text/css">
    <script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
    <script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
    <script type="text/javascript" src="static/plugins/layer/layer.js"></script>
    <script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
 
    <script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
    <script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
    <script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
 
    <script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
 
    <!--[if lt IE 9]>
    <script type="text/javascript" src="static/plugins/json2.js"></script>
    <![endif]-->
    <script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
 
    <style>
        html, body {
            height: 100%;
            width: 100%;
            overflow: hidden;
        }
    </style>
 
</head>
 
<body class="pt-tree">
<div>
    <div class="pt-main-top clear">
        <div class="pt-nav">
                <span class="pt-title-icon">
                    <i class="fa fa-sitemap"></i>
                </span>
            <div class="pt-title">
                <div>
                    <h4>部门管理</h4>
                </div>
            </div>
        </div>
    </div>
 
    <div class="pt-left-menu">
        <div class="pt-left-tools">
            <%--                 <shiro:hasPermission name="SYS_MANAGE.ORGANIZATION.DEPT.OPERATION.ADDROOT"> --%>
            <!--                     <button class="pt-btn pt-btn-primary" id="btnAddRootDept"> -->
            <!--                         <i class="fa fa-plus-square"></i> -->
            <!--                         新增根部门 -->
            <!--                     </button> -->
            <%--                 </shiro:hasPermission> --%>
            <%--                 <shiro:hasPermission name="SYS_MANAGE.ORGANIZATION.DEPT.OPERATION.ADDSUB"> --%>
            <!--                     <button class="pt-btn pt-btn-purple" id="btnAddSubDept"> -->
            <!--                         <i class="fa fa-plus-square-o"></i> -->
            <!--                         新增子部门 -->
            <!--                     </button> -->
            <%--                 </shiro:hasPermission> --%>
            <%--                 <shiro:hasPermission name="SYS_MANAGE.ORGANIZATION.DEPT.OPERATION.DELETE"> --%>
            <!--                     <button class="pt-btn pt-btn-danger" id="btnDeleteDept"> -->
            <!--                         <i class="fa fa-trash-o"></i> -->
            <!--                         删除 -->
            <!--                     </button> -->
            <%--                 </shiro:hasPermission> --%>
 
            <a class="easyui-menubutton pt-btn-primary" data-options="menu:'#div_MenuAdd'">
                <i class="fa fa-plus-square"></i>
                新增
            </a>
            <shiro:hasPermission name="SYS_MANAGE.ORGANIZATION.DEPT.OPERATION.DELETE">
                <a id="btnDeleteDept" class="pt-btn pt-btn-danger">
                    <i class="fa fa-trash-o"></i>
                    删除
                </a>
            </shiro:hasPermission>
 
            <div id="div_MenuAdd" style="width:150px;">
                <shiro:hasPermission name="SYS_MANAGE.ORGANIZATION.DEPT.OPERATION.ADDROOT">
                    <div id="btnAddRootDept" data-options="iconCls:'fa fa-plus-square'">新增根部门</div>
                </shiro:hasPermission>
                <shiro:hasPermission name="SYS_MANAGE.ORGANIZATION.DEPT.OPERATION.ADDSUB">
                    <div id="btnAddSubDept" data-options="iconCls:'fa fa-plus-square-o'">新增子部门</div>
                </shiro:hasPermission>
            </div>
        </div>
        <div class="easyui-panel">
            <ul id="ul_dept"></ul>
        </div>
    </div>
    <div class="pt-right-main">
        <form class="pt-form" id="formDept" method="post">
            <table style="width: 100%;">
                <tr>
                    <td class="tbtitle" style="width: 140px; ">
                        <em class="pt-color-danger">*</em> 部门名称:
                    </td>
                    <td>
                        <input id="deptName" name="deptName" class="easyui-textbox" type="text" style="width:100%"
                               required="required"/>
                        <input type="hidden" class="easyui-textbox" value="" id="deptId" name="deptId"/>
                    </td>
                </tr>
                <tr>
                    <td class="tbtitle">
                        <em class="pt-color-danger">*</em> 部门编号:
                    </td>
                    <td>
                        <input id="deptNum" name="deptNum" class="easyui-textbox" type="text" style="width:100%"
                               required="required"/>
                    </td>
                </tr>
                <tr>
                    <td class="tbtitle">上级部门:</td>
                    <td>
                        <input id="parentId" name="parentId" class="easyui-combotree"
                               data-options="url:'management/dept/listDeptByComboTree',method:'get',panelHeight: 'auto'"
                               style="width:100%;" required="required"/>
                    </td>
                </tr>
                <tr>
                    <td class="tbtitle">部门类型:</td>
                    <td>
                        <div>
                            <input class="easyui-radiobutton" name="deptType" value="0" checked="true" label="内部部门:">
                            <input class="easyui-radiobutton" name="deptType" value="1" label="外部部门:">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="tbtitle">部门图标:</td>
                    <td>
                        <div>
                            <input id="icon" name="icon" class="easyui-combobox" style="width:100%;"
                                   data-options="showItemIcon: true,
                                    data: [
                                        {value:'fa fa-institution',text:'集团图标',iconCls:'fa fa-institution',selected:true},
                                        {value:'fa fa-home',text:'公司图标',iconCls:'fa fa-home'},
                                        {value:'fa fa-sitemap',text:'子公司图标',iconCls:'fa fa-sitemap'},
                                        {value:'fa fa-address-card',text:'部门图标',iconCls:'fa fa-address-card'},
                                        {value:'fa fa-address-book',text:'科室图标',iconCls:'fa fa-address-book'}
                                    ],
                                    editable: false,
                                    panelHeight: 'auto',
                                    labelPosition: 'top'">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="tbtitle">部门负责人:</td>
                    <td>
                        <input id="deptLeaderName" name="deptLeaderName" class="easyui-textbox" type="text"
                               data-options="editable:false,buttonText:'选',prompt:'请选择部门负责人',onClickButton:function(){selectDeptLeader();}"
                               style="width:100%"/>
                        <input type="hidden" class="easyui-textbox" value="0" id="deptLeaderId" name="deptLeaderId"/>
                    </td>
                </tr>
                <tr>
                    <td class="tbtitle">部门副职领导:</td>
                    <td>
                        <input id="deputyLeaderNames" name="deputyLeaderNames" class="easyui-textbox" type="text"
                               data-options="editable:false,buttonText:'选',prompt:'请选择部门副职领导',onClickButton:function(){selectDeputyLeaders();}"
                               style="width:100%;"/>
                        <input type="hidden" class="easyui-textbox" value="0" id="deputyLeaderIds"
                               name="deputyLeaderIds"/>
                    </td>
                </tr>
                <tr>
                    <td class="tbtitle">部门办事员:</td>
                    <td>
                        <input id=deptClerkNames name="deptClerkNames" class="easyui-textbox" type="text"
                               data-options="editable:false,buttonText:'选',prompt:'请选择部门办事员',onClickButton:function(){selectDeptClerk();}"
                               style="width:100%;"/>
                        <input type="hidden" class="easyui-textbox" value="0" id="deptClerkIds" name="deptClerkIds"/>
                    </td>
                </tr>
                <tr>
                    <td class="tbtitle">上级分管领导:</td>
                    <td>
                        <input id="parentDeptLeaderName" name="parentDeptLeaderName" class="easyui-textbox" type="text"
                               data-options="editable:false,buttonText:'选',prompt:'请选择上级分管领导',onClickButton:function(){selectParentDeptLeader();}"
                               style="width:100%;"/>
                        <input type="hidden" class="easyui-textbox" value="0" id="parentDeptLeaderId"
                               name="parentDeptLeaderId"/>
                    </td>
                </tr>
                <tr>
                    <td class="tbtitle">编制人数:</td>
                    <td>
                        <input id="staffSize" name="staffSize" class="easyui-textbox easyui-validatebox" type="text"
                               style="width:100%" validType="digits"/>
                    </td>
                </tr>
                <tr>
                    <td class="tbtitle">排序号:</td>
                    <td>
                        <input id="sortNum" name="sortNum" class="easyui-numberspinner" style="width:100%"
                               required="required" data-options="min:1,max:1000,editable:true">
                    </td>
                </tr>
                <tr>
                    <td class="tbtitle">部门职责:</td>
                    <td>
                        <input id="deptDuty" name="deptDuty" class="easyui-textbox" name="message"
                               data-options="multiline:true" style="height:120px;width:100%">
                    </td>
                </tr>
                <tr>
                    <td class="tbtitle">部门描述:</td>
                    <td>
                        <input id="description" name="description" class="easyui-textbox" name="message"
                               data-options="multiline:true" style="height:120px;width:100%">
                    </td>
                </tr>
            </table>
        </form>
 
        <div class="pt-form-btn">
            <div class="form-group">
                <shiro:hasPermission name="SYS_MANAGE.ORGANIZATION.DEPT.OPERATION.SAVE">
                    <button id="btnSaveDept" class="pt-btn pt-btn-primary">保存</button>
                </shiro:hasPermission>
                <button id="btnReset" class="pt-btn pt-btn-default">重置</button>
            </div>
        </div>
    </div>
</div>
</body>
 
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    //定义页面全局变量
    var NowSelectedNodeId = null;
 
    //页面加载事件
    $(function () {
        //初始化部门树
        $("#ul_dept").tree({
            method: "get",
            url: "management/dept/listDeptByTree",
            animate: true,
            onBeforeLoad: function (node, param) {
                new ResizeScroll({
                    "id": "#ul_dept",
                    fun: function () {
 
                        var wh = $(window).height();
                        //$("#ul_dept").height(wh-79-39);
                        return (wh - 79 - 40 - 20);
 
                    }
                });
 
                wcp.ui.setBusy("#ul_dept");
            },
            onLoadSuccess: function (node, data) {
                wcp.ui.clearBusy("#ul_dept");
                new ResizeScroll({
                    "id": "#ul_dept",
                    fun: function () {
 
                        var wh = $(window).height();
                        //$("#ul_dept").height(wh-79-39);
                        return (wh - 79 - 40 - 20);
 
                    }
                });
 
                //重新加载数据时,选中之前被选中的数据
                if (NowSelectedNodeId != null) {
                    var node = $('#ul_dept').tree('find', NowSelectedNodeId);
                    if (node != null) {
                        $('#ul_dept').tree('select', node.target);
                    }
                }
            },
            onLoadError: function (args) {
                wcp.ui.clearBusy("#ul_dept");
            },
            onClick: function (node) {
                NowSelectedNodeId = node.id;
                $('#formDept').form('load', 'management/dept/getDeptInfo?deptId=' + node.id); // load from URL
            }
        })
 
        //初始化滚动条
        new ResizeScroll({
            "id": ".pt-form",
            fun: function () {
 
                var wh = $(window).height();
                //$(".pt-form").height(wh-79-48);
                return (wh - 79 - 48);
 
            }
        });
 
        $('#formDept').form({
            onBeforeLoad: function (param) {
                wcp.ui.setBusy("#formDept");
            },
            onLoadSuccess: function (data) {
                wcp.ui.clearBusy("#formDept");
            },
            onLoadError: function () {
                wcp.ui.clearBusy("#formDept");
            }
        });
 
        //绑定按钮事件
        //添加根部门按钮事件
        $("#btnAddRootDept").click(function () {
            $("#formDept").form('reset');
 
            $('#parentId').combotree('setValue', 0);
        });
 
        //添加子部门按钮事件
        $("#btnAddSubDept").click(function () {
            var node = $('#ul_dept').tree('getSelected');
            if (node != null) {
                $("#formDept").form('reset');
 
                //设置父部门ID
                $('#parentId').combotree('setValue', node.id);
 
                //获取子部门最大排序号
                if (node.children && node.children.length > 0) {
                    var lastNode = node.children[node.children.length - 1];
                    if (lastNode.attributes && lastNode.attributes.sortNum) {
                        $('#sortNum').numberspinner('setValue', lastNode.attributes.sortNum + 1);
                    }
                } else {
                    $('#sortNum').numberspinner('setValue', 1);
                }
            } else {
                layer.alert('请先选择一个部门!', {
                    icon: 1
                });
            }
        });
 
        //删除部门按钮事件
        $("#btnDeleteDept").click(function () {
            var node = $('#ul_dept').tree('getSelected');
            if (node != null) {
                //判断是否有子部门
                var msg = "";
                if (node.children != null && node.children.length > 0) {
                    msg = '当前部门有子部门,确定要和子部门一起删除吗?';
                } else {
                    msg = '确定要删除当前选中的部门吗?';
                }
 
                layer.confirm(msg, {
                    icon: 3,
                    title: '提示'
                }, function (index) {
                    wcp.ui.setBusy("body", wcp.ajax({
                        url: "management/dept/deleteDept",
                        data: node.id,
                    }).done(function (result) {
                        wcp.notify.success('删除成功!');
 
                        //重置表单数据
                        $('#formDept').form('reset');
 
                        //重置选中的数据
                        NowSelectedNodeId = null;
 
                        //重新加载部门数据
                        $('#ul_dept').tree('reload');
                        $('#parentId').combotree('reload');
                    }));
 
                    layer.close(index);
                });
            } else {
                wcp.message.info('请先选择要删除的部门!');
            }
 
        });
 
        //保存按钮事件
        $("#btnSaveDept").click(function () {
 
            //验证表单信息
            var isValid = $('#formDept').form('validate');
            if (!isValid) {
                wcp.notify.warn('表单验证有误,请检查表单输入项!');
                return;
            }
 
            var obj = $("#formDept").serializeObject();
 
            wcp.ui.setBusy("body", wcp.ajax({
                url: "management/dept/saveDept",
                data: JSON.stringify(obj),
            }).done(function (result) {
                wcp.notify.success('保存成功!');
 
                //重新加载表单数据
                $('#formDept').form('load', result);
 
                //设置选中的数据
                NowSelectedNodeId = result.deptId;
 
                //重新加载部门数据
                $('#ul_dept').tree('reload');
                $('#parentId').combotree('reload');
            }));
        });
 
        //重置部门按钮事件
        $("#btnReset").click(function () {
            $("#formDept").form('reset');
        });
    });
 
    function selectDeptLeader() {
        wcp.picker.selectUser({
            title: "请选择部门负责人",
            multiSelect: false,
            idElement: "deptLeaderId",
            nameElement: "deptLeaderName",
            hasSelectIds: $("#deptLeaderId").val(),
            hasSelectNames: $("#deptLeaderName").textbox("getValue"),
            layerOpener: window
        });
 
        //没有文本框储值的使用方式
        //         wcp.picker.selectUser({
        //             title : "请选择部门负责人",
        //             multiSelect : false,
        //             layerOpener : window
        //         }, function(rows) {
        //             for (var i = 0; i < rows.length; i++) {
        //                 var id = rows[i].id;
        //                 var name = rows[i].name;
        //                 //其他字段
        //                 var deptId = rows[i].srcData.deptId;
        //                 var deptName = rows[i].srcData.deptName;
        //                 //其他用户表的字段都可以读
        //             //处理...
        //             }
        //         });
    }
 
    function selectDeputyLeaders() {
        wcp.picker.selectUser({
            title: "请选择部门副职领导",
            multiSelect: true,
            idElement: "deputyLeaderIds",
            nameElement: "deputyLeaderNames",
            hasSelectIds: $("#deputyLeaderIds").val(),
            hasSelectNames: $("#deputyLeaderNames").textbox("getValue"),
            layerOpener: window
        });
    }
 
    function selectDeptClerk() {
        wcp.picker.selectUser({
            title: "请选择部门办事员",
            multiSelect: true,
            idElement: "deptClerkIds",
            nameElement: "deptClerkNames",
            hasSelectIds: $("#deptClerkIds").val(),
            hasSelectNames: $("#deptClerkNames").textbox("getValue"),
            layerOpener: window
        });
    }
 
    function selectParentDeptLeader() {
        wcp.picker.selectUser({
            title: "请选择上级分管领导",
            multiSelect: false,
            idElement: "parentDeptLeaderId",
            nameElement: "parentDeptLeaderName",
            hasSelectIds: $("#parentDeptLeaderId").val(),
            hasSelectNames: $("#parentDeptLeaderName").textbox("getValue"),
            layerOpener: window
        });
    }
</script>
</html>