多单位版国产化地质资料管理系统
zs
2025-12-18 4f0d9bde31a80f6279e26466250da7716eec627f
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
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" trimDirectiveWhitespaces="true" %>
<%@ 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" charset="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 gte 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 rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link rel="stylesheet" href="static/styles/common.css" 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]-->
</head>
<body class="pt-tree">
<div class="margin-lr">
    <div class="pt-main-top clear">
        <div class="pt-nav">
            <span class="pt-title-icon"><i class="fa fa-users"></i></span>
            <div class="pt-title">
                <div>
                    <h4>用户注册</h4>
                </div>
            </div>
        </div>
    </div>
    <div class="pt-form">
        <form id="formRegister" method="post">
            <div class="ptbody">
 
                <table style="width: 100%;">
                    <tr class="firstRow">
                        <td valign="middle" align="center"
                            style="word-break: break-all; border-color: rgb(221, 221, 221); width:15%;"><span style="">真实姓名</span><span
                                style="color: rgb(255, 0, 0); font-size: 14px; text-align: -webkit-center; background-color: rgb(255, 255, 255);">*</span>
                        </td>
                        <td valign="top" style="word-break: break-all; border-color: rgb(221, 221, 221);" width="41">
                            <input name="USER_NAME" type="text" title="用户姓名" value="" id="USER_NAME"
                                   class="easyui-textbox" placeholder="用户姓名" leipiplugins="text" saveselecttype="0"
                                   style="height:28px;width:98%;text-align: left; width: 98%;"
                                   data-options="editable:true,required:true,validType:['length[0,50]']"
                                   textAlign="left"></td>
                    </tr>
                    <tr>
                        <td valign="middle" align="center"
                            style="word-break: break-all; border-color: rgb(221, 221, 221); width:15%;"><span style="">身份证号</span><span
                                style="color: rgb(255, 0, 0); font-family: SimSun; font-size: 14px; text-align: -webkit-center; background-color: rgb(255, 255, 255);">*</span>
                        </td>
                        <td valign="top" style="word-break: break-all; border-color: rgb(221, 221, 221);" width="41">
                            <input name="CARD_ID" type="text" title="身份证号" value="" id="CARD_ID"
                                   class="easyui-textbox" placeholder="身份证号" leipiplugins="text" saveselecttype="0"
                                   style="height:28px;width:98%;text-align: left; width: 98%;"
                                   data-options="editable:true,required:true,validType:['idCard[\'CARD_ID\']','length[0,50]']"
                                   textAlign="left"><span leipiplugins="select"></span></td>
                    </tr>
                    <tr>
                        <td valign="middle" align="center"
                            style="word-break: break-all; border-color: rgb(221, 221, 221);"><span
                                style="">手机号码</span><span
                                style="color: rgb(255, 0, 0); font-family: SimSun; font-size: 14px; text-align: -webkit-center; background-color: rgb(255, 255, 255);">*</span>
                        </td>
                        <td valign="top" style="word-break: break-all; border-color: rgb(221, 221, 221);" width="41">
                            <input name="TEL" type="text" title="电话" value="" id="TEL" class="easyui-textbox"
                                   placeholder="电话" leipiplugins="text" saveselecttype="0"
                                   style="height:28px;width:98%;text-align: left; width: 98%;"
                                   data-options="editable:true,required:true,validType:['mobilephone[\'TEL\']','length[0,50]']"
                                   textAlign="left"></td>
                    </tr>
                    <tr>
                        <td valign="middle" align="center"
                            style="word-break: break-all; border-color: rgb(221, 221, 221);" width="85"><span style="">用户性质</span><span
                                style="color: rgb(255, 0, 0); font-family: SimSun; font-size: 14px; text-align: -webkit-center; background-color: rgb(255, 255, 255);">*</span>
                        </td>
                        <td valign="top" style="border-color: rgb(221, 221, 221); word-break: break-all;" width="312"
                            _msttexthash="12329863" _msthash="34">
                    <span leipiplugins="radios" name="USER_NATURE" title="用户性质" dataoptions=""
                          style="diaplay:block">
                    <input type="radio" name="USER_NATURE" value="0" title="个人" checked="">个人
                    <input type="radio" name="USER_NATURE" value="1" title="部门">单位
                    </span>
                        </td>
                    </tr>
                    <tr class="dept_name_tr">
                        <td valign="middle" align="center"
                            style="word-break: break-all; border-color: rgb(221, 221, 221);"><span
                                style="">单位名称</span><span
                                style="color: rgb(255, 0, 0); font-family: SimSun; font-size: 14px; text-align: -webkit-center; background-color: rgb(255, 255, 255);">*</span>
                        </td>
                        <td valign="top" style="border-color: rgb(221, 221, 221); word-break: break-all;" rowspan="1"
                            colspan="3"><input id="dept_name" name="DEPT_NAME" type="text" title="单位名称" value=""
                                               id="DEPT_NAME" class="easyui-textbox" placeholder="单位名称"
                                               leipiplugins="text" saveselecttype="0"
                                               style="height:28px;width:98%;text-align: left; width: 98%;"
                                               data-options="editable:true,validType:['length[0,50]']" textAlign="left">
                        </td>
                    </tr>
                    <tr class="dept_nature_tr">
                        <td valign="middle" align="center"
                            style="word-break: break-all; border-color: rgb(221, 221, 221);">单位性质
                        </td>
                        <td valign="top" style="border-color: rgb(221, 221, 221); word-break: break-all;" width="41">
                            <input name="DEPT_NATURE" type="text" title="单位性质" value="" id="DEPT_NATURE"
                                   class="easyui-textbox" placeholder="单位性质" leipiplugins="text" saveselecttype="0"
                                   style="height:28px;width:98%;text-align: left; width: 98%;"
                                   data-options="editable:true,validType:['length[0,50]']" textAlign="left"></td>
                    </tr>
                    <tr>
                        <td valign="middle" align="center"
                            style="word-break: break-all; border-color: rgb(221, 221, 221);" width="85"
                            _msttexthash="11429600" _msthash="39">所属行业
                        </td>
                        <td valign="top" style="border-color: rgb(221, 221, 221); word-break: break-all;" width="312">
                            <input name="TRADE" type="text" title="所属行业" value="" id="TRADE" class="easyui-textbox"
                                   placeholder="所属行业" leipiplugins="text" saveselecttype="0"
                                   style="height:28px;width:98%;text-align: left; width: 98%;"
                                   data-options="editable:true,required:false,validType:['length[0,50]']"
                                   textAlign="left"></td>
                    </tr>
                    <tr>
                        <td valign="top" colspan="1" rowspan="1"
                            style="border-left-color: rgb(221, 221, 221); border-top-color: rgb(221, 221, 221); word-break: break-all;"
                            align="center"><span style="">地址</span><br></td>
                        <td valign="top" colspan="3" rowspan="1"
                            style="border-left-color: rgb(221, 221, 221); border-top-color: rgb(221, 221, 221); word-break: break-all;">
                            <input name="AREA" type="text" title="所属地区" value="" id="AREA" class="easyui-textbox"
                                   placeholder="所属地区" leipiplugins="text" saveselecttype="0"
                                   style="height:28px;width:98%;text-align: left; width: 98%;"
                                   data-options="editable:true,required:false,validType:['length[0,50]']"
                                   textAlign="left"></td>
                    </tr>
                    <tr>
                        <td valign="top" colspan="1" rowspan="1" style="word-break: break-all;" align="center"><span
                                style="">使用目的</span><br></td>
                        <td valign="top" colspan="3" rowspan="1"><input id="PURPOSE" name="PURPOSE"
                                                                        class="easyui-textbox"
                                                                        data-options="editable:true,required:false,multiline:true,validType:['length[0,1000]']"
                                                                        style="height:80px;width:99%" value=""></td>
                    </tr>
                </table>
 
            </div>
        </form>
        <div class="pt-form-btn">
            <div class="form-group">
                <submit id="btnSave" class="pt-btn pt-btn-primary">注册</submit>
                <button id="btnClose" class="pt-btn pt-btn-default">关闭</button>
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
    //窗口参数,用于弹窗传递
    var params = {
        callBack: null
    };
 
    $(function () {
 
        new ResizeScroll({
            "id": ".ptbody",
            fun: function () {
                var wh = $(window).height();
                return (wh - 69 - 62);
            }
        });
 
        $("tr.dept_name_tr").hide();
        $("tr.dept_nature_tr").hide();
 
        //绑定按钮事件
        $("#btnSave").click(function () {
            //验证表单信息
            var isValid = $('#formRegister').form('validate');
            if (!isValid) {
                wcp.notify.warn('表单验证有误,请检查表单输入项!');
                return false;
            }
 
 
            var obj = $("#formRegister").serializeObject();
 
            wcp.ui.setBusy("body", wcp.ajax({
                url: "archives/borrowUser/saveRegister",
                data: JSON.stringify(obj),
            }).done(function (result) {
                //判断是否需要执行回调函数
                if (params.callBack) {
                    params.callBack();
                }
 
                //关闭窗口
                closeWindow();
 
                top.wcp.notify.success("保存成功!");
            }));
        });
 
        $("#btnClose").click(function () {
            closeWindow();
        });
    })
 
    $('input[type=radio][name=USER_NATURE]').change(function () {
        console.log(this.value)
        if (this.value == 0) {
            $("tr.dept_name_tr").hide();
            $("tr.dept_nature_tr").hide();
        } else if (this.value == 1) {
            /*debugger;
            var element = document.getElementById("dept_name");
            // y.setAttribute("data-options","editable:true,required:true,validType:['length[0,50]']");
            // y.required(true);
            element.setAttribute("")*/
            const deptNameInput = document.querySelector('#dept_name');
            // 添加必填验证
            deptNameInput.setAttribute('required', true);
            // 添加事件监听器
            deptNameInput.addEventListener('blur', event => {
                const value = event.target.value.trim();
                if (value === '') {
                    event.target.style.borderColor = 'red';
                    alert('请输入单位名称!');
                } else {
                    event.target.style.borderColor = '';
                }
            });
 
            $("tr.dept_name_tr").show();
            $("tr.dept_nature_tr").show();
 
            // document.getElementById("dept_name").attr("data-options","editable:true,required:false,validType:['length[0,50]']");
            // var y = document.getElementById("dept_name").required;
            // consloe.log(y);
        }
    });
 
    //添加表单自定义JS脚本
    //标识验证
    $.extend($.fn.validatebox.defaults.rules, {
        mobilephone: {
            validator: function (value) {
                var reg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
                return reg.test(value);
            },
            message: '手机号码不正确'
        }
    });
 
    $.extend($.fn.validatebox.defaults.rules, {
        idCard: {
            validator: function (val) {
                var p = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
                var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
                var parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2];
                var code = val.substring(17);
                if (p.test(val)) {
                    var sum = 0;
                    for (var i = 0; i < 17; i++) {
                        sum += val[i] * factor[i];
                    }
                    if (parity[sum % 11] == code.toUpperCase()) {
                        return true;
                    }
                }
                return false;
            },
            message: '身份证格式不合法!'
        }
    });
 
 
    function closeWindow() {
        var index = top.layer.getFrameIndex(window.name); //获取窗口索引
        top.layer.close(index);
    }
</script>
</html>