多单位版国产化地质资料管理系统
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
514
515
516
517
518
519
520
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
 
<!DOCTYPE html>
<html>
<head>
    <base href="<%=basePath%>">
    <title>人工添加实物利用</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
    <link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="static/styles/material-teal.css" type="text/css">
    <link rel="stylesheet" type="text/css" href="static/plugins/webuploader/webuploader.css">
    <link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
    <link rel="stylesheet" href="static/styles/archives.css" type="text/css">
    <link rel="stylesheet" href="static/styles/common.css" type="text/css">
    <link rel="stylesheet" href="static/plugins/icheck/skins/all.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/jquery-easyui-edatagrid/jquery.edatagrid.js"></script>
    <script type="text/javascript" src="static/plugins/jquery-afterresize/jquery.afterresize.min.js"></script>
 
    <!-- 弹窗加载组件 -->
    <script type="text/javascript" src="static/plugins/layer/layer.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/plugins/ace/src-noconflict/ace.js"></script>
    <!-- wcp组件 -->
    <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>
    <script type="text/javascript" src="static/plugins/webuploader/webuploader.js"></script>
    <script src="static/plugins/webuploader/webuploader.min.js"></script>
    <script src="static/plugins/ptfileupload/pt.fileupload.js"></script>
    <style>
        body {
            background: #f3f5fa;
            width: 1020px;
            margin: 0 auto;
        }
 
        .pt-form table {
            margin: 20px auto 0px auto;
        }
 
        .webuploader-pick {
            background-color: #d81b60;
            border: 1px solid #c40a4e;
            border-radius: 4px;
            color: #fff;
            padding: 5px 10px;
            float: right;
            margin: -10px 32px 0 0;
        }
 
        .webuploader-pick i.fa-upload {
            padding-right: 0.3em;
            color: #fff;
        }
    </style>
 
</head>
<body>
<div class="margin-lr">
    <div class="pt-title-theme3"><i class="fa fa-file-text"></i><h4>实物利用单</h4></div>
    <div class="ptbody">
        <div class="pt-application-row">
            <div class="pt-subtitle"><i></i><span>实物利用单</span></div>
            <div class="pt-form">
                <form id="form1">
                    <table style="width: 100%;">
                        <tr>
                            <td class="tbtitle">实物利用单编号:</td>
                            <td colspan="3">[自动生成]</td>
                        </tr>
                        <tr>
                            <td class="tbtitle"><em class="pt-color-danger">*</em> 申请人:</td>
                            <td style="width: 35%;">
                                <input class="easyui-textbox" id="applyUser" name="applyUser"
                                       type="text" style="width:300px;" value="${curUserName}"
                                       data-options="required:true,tipPosition:'bottom',buttonText:'选',prompt:'请选择加工人...',onClickButton:function(){selectPhysicalName(); }"/>
                                <input id="applyUserId" class="easyui-textbox" name="applyUserId"
                                       type="hidden"
                                       value="${curUserId}"/>
                            </td>
                            <td class="tbtitle"><em class="pt-color-danger">*</em>工作单位:</td>
                            <td style="width: 35%;">
                                <input class="easyui-textbox" id="deptName"
                                       name="deptName" type="text" style="width:300px"
                                       data-options="required:true"
                                       value=""/>
                                <input id="deptId" class="easyui-textbox" name="deptId"
                                       type="hidden"
                                       value="${curDeptId}"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle"><em class="pt-color-danger">*</em>单位地址:</td>
                            <td style="width: 30%;">
                                <input class="easyui-textbox" id="deptAddress"
                                       name="deptAddress" type="text" style="width:300px"
                                       value="" data-options="required:true"/>
                            </td>
                            <td class="tbtitle"><em class="pt-color-danger">*</em>身份证号码:</td>
                            <td style="width: 30%;">
                                <input class="easyui-textbox" id="cardId"
                                       name="cardId" type="text" style="width:300px"
                                       value="" data-options="required:true"/>
                            </td>
                        </tr>
 
 
                        <tr>
                            <td class="tbtitle"><em class="pt-color-danger">*</em>联系电话:</td>
                            <td style="width: 30%;">
                                <input class="easyui-textbox" id="telNumber"
                                       name="telNumber" type="text" style="width:300px"
                                       value="" data-options="required:true"/>
                            </td>
                            <td class="tbtitle"><em class="pt-color-danger">*</em>邮箱:</td>
                            <td style="width: 30%;">
                                <input class="easyui-textbox" id="email"
                                       name="email" type="text" style="width:300px"
                                       value="" data-options="required:true"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle">职称:</td>
                            <td style="width: 30%;">
                                <input class="easyui-textbox" id="jobTitle"
                                       name="jobTitle" type="text" style="width:300px"
                                       value="" data-options="required:false"/>
                            </td>
 
                        </tr>
                        <tr>
                            <td class="tbtitle"><em class="pt-color-danger">*</em>观察取样时间:</td>
                            <td style="width: 30%;">
                                <input class="easyui-textbox" id="observationTime"
                                       name="observationTime" type="date" style="width:300px"
                                       value="" data-options="required:true"/>
                            </td>
                            <td class="tbtitle"><em class="pt-color-danger">*</em>取样数量:</td>
                            <td style="width: 30%;">
                                <input class="easyui-textbox" id="sampleNum"
                                       name="sampleNum" type="text" style="width:300px"
                                       value="" data-options="required:true"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle"><em class="pt-color-danger">*</em>项目名称及来源:</td>
                            <td colspan="3">
                                <input class="easyui-textbox" name="projectName"
                                       data-options="required:true,multiline:true"
                                       style="height:60px;width:850px" value="" />
                            </td>
                        </tr>
 
                        <tr>
                            <td class="tbtitle"><em class="pt-color-danger">*</em>取样方式:</td>
                            <td colspan="3">
                                <input class="easyui-textbox" name="sampleMethod"
                                       data-options="required:true,multiline:true"
                                       style="height:60px;width:850px" value=""/>
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle"><em class="pt-color-danger">*</em>测试项目及样品量需求:</td>
                            <td colspan="3">
                                <input class="easyui-textbox" name="testProject"
                                       data-options="required:true,multiline:true"
                                       style="height:60px;width:850px" value=""/>
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle"><em class="pt-color-danger">*</em>送检机构:</td>
                            <td colspan="3">
                                <input class="easyui-textbox" name="sendInstitution"
                                       data-options="required:true,multiline:true"
                                       style="height:60px;width:850px" value=""/>
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle"><em class="pt-color-danger">*</em>研究目的:</td>
                            <td colspan="3">
                                <input class="easyui-textbox" name="researchPurpose"
                                       data-options="required:true,multiline:true"
                                       style="height:60px;width:850px" value=""/>
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle"><em class="pt-color-danger">*</em>研究内容:</td>
                            <td colspan="3">
                                <input class="easyui-textbox" name="researchContent"
                                       data-options="required:true,multiline:true"
                                       style="height:60px;width:850px" value=""/>
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle"><em class="pt-color-danger">*</em>预期成果:</td>
                            <td colspan="3">
                                <input class="easyui-textbox" name="expectedResult"
                                       data-options="required:true,multiline:true"
                                       style="height:60px;width:850px" value=""/>
                            </td>
                        </tr>
                        <tr>
                            <td class="tbtitle"><em class="pt-color-danger">*</em>申请单位意见:</td>
                            <td colspan="3">
                                <input class="easyui-textbox" name="applyDeptOpinion"
                                       data-options="required:true,multiline:true"
                                       style="height:60px;width:850px" value=""/>
                            </td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
        <div class="pt-application-row">
            <div class="pt-subtitle"><i></i><span>实物利用明细</span></div>
            <div class="pt-spacing">
                <div>
                    <div id="toolbar" style="height: auto">
                        <div>
                            <a onclick="addRow();" class="pt-btn pt-btn-success">
                                <i class="fa fa-plus"></i> 新增
                            </a>
 
                            <a onclick="$('#tb_physicalDetail').edatagrid('saveRow');" class="pt-btn pt-btn-info">
                                <i class="fa fa-save"></i>
                                确认修改
                            </a>
 
                            <a onclick="$('#tb_physicalDetail').edatagrid('cancelRow');"
                               class="pt-btn pt-btn-warning">
                                <i class="fa fa-scissors"></i>
                                撤销
                            </a>
                            <a onclick="saveData();" class="pt-btn pt-btn-info">
                                <i class="fa fa-save"></i>
                                保存
                            </a>
                            <a onclick="$('#tb_physicalDetail').edatagrid('destroyRow');"
                               class="pt-btn pt-btn-danger">
                                <i class="fa fa-trash-o"></i>
                                删除
                            </a>
                        </div>
                    </div>
                    <div>
 
                        <table id="tb_physicalDetail" singleselect="true" idfield="detailId" style="width: 100%;"
                               toolbar="#toolbar">
                            <thead>
                            <tr>
                                <th field="archivalCode" width="15%" align="center"
                                    editor="{type:'validatebox',options:{required:true}}">档号
                                </th>
                                <th field="itemNumber" width="15%" align="center"
                                    editor="{type:'validatebox',options:{required:true}}">件号
                                </th>
                                <th field="itemTitle" width="40%" align="center"
                                    editor="{type:'validatebox',options:{required:true}}">题名
                                </th>
                                <th field="utilizationType" width="100" align="center"
                                    editor="{type:'combobox',options:{valueField:'csmc',textField:'csmc',
                            data:uniqueList,multiple:false,editable:false,panelHeight:'auto'}}">利用类型
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
 
                </div>
            </div>
        </div>
        <div class="pt-application-btn">
            <button class="pt-btn pt-btn-purple" onclick="savePhysicalForm()">提交</button>
            <button class="pt-btn pt-btn-default" onclick="closeWindow()">关闭</button>
        </div>
    </div>
</div>
</body>
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
<script>
 
    var selectId = '0';
    var params = {
        callBack: null,
        callBackParams: null
    };
    var createUserId = '${curUserId}';
    var uniqueList = [
        {
            "csid": "观察",
            "csmc": "观察",
            "selected": "true"
        },
        {
            "csid": "取样",
            "csmc": "取样"
        }
    ];
 
    $(function () {
        new ResizeScroll({
            "id": ".ptbody", fun: function () {
                var wh = $(window).height();
                return (wh - 36 - 28 - 10);
            }
        });
 
        //人员变换时事件
        $('#applyUser').textbox({
            onChange: function (value) {
                setTimeout(function () {
                    getPhysicalUserInfo(value);
                }, 500);
            }
        });
        getPhysicalDetailList();
        // loadCategories();
    })
 
 
    //提交
    function savePhysicalForm() {
        var physicalDetailList = $('#tb_physicalDetail').datagrid("getRows");
        if (physicalDetailList.length == 0) {
            wcp.notify.error('实物利用目录为空,不能提交!');
            return;
        }
 
        var state = {'state': 0};
        var flowState = {'flowState': 0};
 
        //验证表单信息
        var isValid = $('#form1').form('validate');
        if (!isValid) {
            wcp.notify.error('表单验证有误,请检查表单输入项!');
            return false;
        }
 
        var formData = $.extend({}, $("#form1").serializeObject(), state, flowState);
        wcp.ui.setBusy("body", wcp.ajax({
            url: "physical/savePhysicalForm",
            data: JSON.stringify(formData),
        }).done(function (result) {
            wcp.notify.info('提交成功!');
            params.parent.refreshData();//刷新父亲
            closeWindow();
        }));
    }
 
    function closeWindow() {
        var title = top.$('#tt').tabs('getSelected').panel("options").title;
        top.$("#tt").tabs("close", title);
    }
 
 
    //绑定字段列表 这个命名改一下
    function getPhysicalDetailList() {
        var wh = $(window).height();// 移除所有 change 事件监听器
        $('#tb_physicalDetail').edatagrid({
            rownumbers: true,
            pagination: false,
            fitColumns: true,
            method: "get",
            url: "physical/getPhysicalDetailListByPeople",
            saveUrl: "",
            updateUrl: "",
            onDestroy: function (index, row) {
                $.ajax({
                    type: 'POST',
                    contentType: "application/json; charset=utf-8",
                    url: "physical/deletePhysicalDetailById?detailId=" + row.detailId,
                    success: function (data) {
                    }
                });
            },
            onLoadSuccess: function (data) {
                for (var i = 0; i < data.rows.length; i++) {
                    var row = data.rows[i];
                    var value = ""
 
                    if (row.survey == 1) {
                        value = "观察";
                    }
                    if (row.sampling == 1) {
                        value = "取样";
                    }
                    $('#tb_physicalDetail').datagrid('beginEdit', i);
                    // 获取编辑器对象
                    var editors = $('#tb_physicalDetail').datagrid('getEditors', i);
 
                    $(editors[4].target[0]).combobox("setValue", value);
                    $(editors[4].target[0]).combobox("setText", value);
                    $('#tb_physicalDetail').datagrid('endEdit', i);
                }
            }
        });
    }
 
    function saveData() {
        var editIndex = $('#tb_physicalDetail').datagrid('getRows').length;
        for (var i = 0; i < editIndex; i++) {
            $('#tb_physicalDetail').datagrid("endEdit", i);
        }
        var physicalDetailList = $('#tb_physicalDetail').datagrid("getRows");
        for (i = 0; i < physicalDetailList.length; i++) {
            if (physicalDetailList[i].hasOwnProperty('isNewRecord')) {
                var isNewRecord = physicalDetailList[i].isNewRecord;
                if (isNewRecord) {
                    layer.alert("请先确认字段!");
                    return false;
                }
                //删除isNewRecord属性
                delete physicalDetailList[i].isNewRecord;
            }
 
            physicalDetailList[i]["createUserId"] = createUserId;
            physicalDetailList[i]["formId"] = 0;
            physicalDetailList[i]["fileTitle"] = "人工添加";
            physicalDetailList[i]["fileId"] = 0;
            if (physicalDetailList[i]["utilizationType"] == "观察") {
                physicalDetailList[i]["survey"] = 1;
                physicalDetailList[i]["sampling"] = 0;
            }
            if (physicalDetailList[i]["utilizationType"] == "取样") {
                physicalDetailList[i]["survey"] = 0;
                physicalDetailList[i]["sampling"] = 1;
            }
 
            physicalDetailList[i]["agree"] = 1;
            delete physicalDetailList[i].utilizationType;
        }
        $.ajax({
            type: 'POST',
            contentType: "application/json; charset=utf-8",
            url: "physical/savePhysicalDetail",
            dataType: 'json',
            data: JSON.stringify(physicalDetailList),
            success: function (data) {
                $('#tb_physicalDetail').datagrid("reload");
            }
        });
 
 
    }
 
    function addRow() {
        var rows = $("#tb_physicalDetail").datagrid("getRows");
 
        var index = rows.length;
        $('#tb_physicalDetail').edatagrid('addRow', {
            index: index,
            row: {
                "archivalCode": "",
                "itemNumber": "",
                "itemTitle": "",
                "utilizationType": "",
            }
        });
    }
 
 
    //选择利用人
    function selectPhysicalName() {
        wcp.picker.selectUser({
            title: "请选择利用人",
            multiSelect: false,
            idElement: "applyUserId",
            nameElement: "applyUser",
            deptNameElement: "deptName",
            deptIdElement: "deptId",
            layerOpener: window
        });
    }
 
 
    //添加信息
    function getPhysicalUserInfo() {
        var deptName = $("#deptName").textbox('getValue');
        var applyUserId = $("#applyUserId").textbox('getValue');
 
        if (deptName != null && deptName == "外部用户") {
            wcp.ui.setBusy("body", wcp.ajax({
                url: "physical/getPhysicalUserInfo?userId=" + applyUserId,
            }).done(function (result) {
                $("#deptName").textbox('setValue', result.deptName);
                $("#deptAddress").textbox('setValue', result.deptAddress);
                $("#telNumber").textbox('setValue', result.telNumber);
 
            }));
        }
    }
 
 
</script>
</html>