zhuguifei
2026-03-10 58402bd5e762361363a0f7d7907153c77dbb819f
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
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html>
<html>
<head>
<title>设备管理模块参数维护界面</title>
<jsp:include page="../../../initlib/initAll.jsp"></jsp:include>
<link href="${pageContext.request.contextPath}/css/toptoolbar.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
    var dataGrid;
    var dialog;
    $(function() {
        dataGrid = $('#dataGrid').datagrid({
            rownumbers :true,
            idField : 'id',
            fit : true,
            singleSelect :true,
            fitColumns : false,
            border : false,
            striped : true,
            nowrap : true,
            singleSelect:true,
            checkOnSelect : false,
            selectOnCheck : false,
            columns : [ [{
                field : 'id',
                title : 'ID',
                width : 40,
                hidden: true
            },{
                field : 'code',
                title : '编码',
                width : 80
            } , {
                field : 'name',
                title : '名称',
                width : 150
            }, {
                field : 'modulu',
                title : '系数',
                width : 150
            }, {
                field : 'remark',
                title : '备注',
                width : 300,
                align:'left',
                
            }  ] ],
            toolbar : '#toolbar',
            onLoadSuccess : function() {
                $(this).datagrid('tooltip');
            },
            onRowContextMenu : function(e, rowIndex, rowData) {
                e.preventDefault();
                $(this).datagrid('unselectAll').datagrid('uncheckAll');
                $(this).datagrid('selectRow', rowIndex);
                $('#menu').menu('show', {
                    left : e.pageX-10,
                    top : e.pageY-5
                }); 
            }
        });
    });
    /**
    *查询残烟丝系数
    */
    function getAllBeans(){
        dataGrid.datagrid({
            url : "${pageContext.request.contextPath}/pms/eqmparam/queryParam.do",
            queryParams : $("#searchForm").form("getData")
        });
    }
    function clearForm(){
        $("#searchForm input").val(null);
    }
    /**
    * 跳转到残烟丝系数添加页面
    */
    function goToBeanAddJsp() {
        dialog = parent.$.modalDialog({
            title : '设备模块参数添加',
            width : 560,
            height : 300,
            href : '${pageContext.request.contextPath}/pms/eqmparam/gotoBean.do',
            buttons : [ {
                text : '保存',
                iconCls:'icon-standard-disk',
                handler : function() {
                    //var f = $("#form");
                    var f = dialog.find('#form');
                    if(f.form("validate")){
                        $.post("${pageContext.request.contextPath}/pms/eqmparam/addOrUpdateParam.do",f.form("getData"),function(json){
                            if (json.success) {
                                $.messager.show('提示', json.msg, 'info');
                                dialog.dialog('destroy');
                                getAllBeans();
                            }else{
                                $.messager.show('提示', json.msg, 'error');
                            }
                        },"JSON");
                    }
                    
                }
            } ]
        });
    }
    /**
    * 跳转到残烟丝系数编辑页面
    */
    function goToBeanEditJsp() {
        dialog = parent.$.modalDialog({
            title : '设备模块参数编辑',
            width : 500,
            height : 300,
            href : '${pageContext.request.contextPath}/pms/eqmparam/gotoEditBean.do?id='+dataGrid.datagrid('getSelected').id,
            buttons : [ {
                text : '保存',
                iconCls:'icon-standard-disk',
                handler : function() {
                    var f = dialog.find("#form");
                    if(f.form("validate")){
                        $.post("${pageContext.request.contextPath}/pms/eqmparam/addOrUpdateParam.do",f.form("getData"),function(json){
                            if (json.success) {
                                $.messager.show('提示', json.msg, 'info');
                                dialog.dialog('destroy');
                                getAllBeans();
                            }else{
                                $.messager.show('提示', json.msg, 'error');
                            }
                        },"JSON");
                    }
                    
                    
                }
            } ]
        });
    }
    
    
    
</script>
</head>
<body class="easyui-layout" data-options="fit : true,border : false">
<div id="toolbar" style="display: none;">
            <div class="topTool">
                <form id="searchForm">
                <fieldset>
                        <span class="label">名称:</span>
                        <span><input type="text" name="name" class="easyui-validatebox "  data-options="prompt: '支持模糊查询',width:120"/></span>
                </fieldset>
                </form>
            </div>        
            <div class="easyui-toolbar">
            <c:if test="${not empty sessionInfo.resourcesMap['/pms/eqmparam/queryParam.do']}">
                <a onclick="getAllBeans();" href="javascript:void(0);" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-standard-zoom'">查询</a>
            </c:if>
            <a onclick="clearForm();" href="javascript:void(0);" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-standard-table-refresh'">重置</a>
            <c:if test="${not empty sessionInfo.resourcesMap['/pms/eqmparam/addOrUpdateParam.do']}">
                <a onclick="goToBeanAddJsp();" href="javascript:void(0);" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-standard-user-add'">添加</a>
            </c:if>
            <c:if test="${not empty sessionInfo.resourcesMap['/pms/eqmparam/gotoEditBean.do']}">
                <a onclick="goToBeanEditJsp();" href="javascript:void(0);" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-standard-user-edit'">编辑</a>
            </c:if>
            </div>
</div>
 
<div data-options="region:'center',border:false">
    <table id="dataGrid"></table>
</div>
    <div id="menu" class="easyui-menu" style="width: 80px; display: none;">
        <c:if test="${not empty sessionInfo.resourcesMap['/pms/eqmparam/addOrUpdateParam.do']}">
            <div onclick="goToBeanAddJsp();"  data-options="iconCls:'icon-standard-user-add'">添加</div>
        </c:if>
        <c:if test="${not empty sessionInfo.resourcesMap['/pms/eqmparam/gotoEditBean.do']}">
            <div onclick="goToBeanEditJsp();" data-options="iconCls:'icon-standard-user-edit'">编辑</div>
        </c:if>
    </div>        
</body>
</html>