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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!-- 数据字典新增 -->
<script type="text/javascript" src="${pageContext.request.contextPath }/pms/pub/combobox/comboboxUtil.js" charset="utf-8"></script>
<script type="text/javascript">
    var zjId =$("#mdEqpTypeBeanId").val();
    //自生成编号
     $(function(){
        var code1=$('#code1');
        if($.trim(code1.val())==""){
        var d = new Date()
        var str="ZB_"+d.getFullYear()+(d.getMonth() + 1)+ d.getDate()+d.getHours()+d.getMinutes()+d.getSeconds();
        code1.attr('value',str);
        }
    }); 
    
 
    //轮保类型
    //润滑油
    //方式
    //单位
    //周期
    //点检类型
    
    //轮保类型
    $("#lxTypeSelect").combobox({
        url:"${pageContext.request.contextPath }/pms/sys/eqptype/queryMdFixCodeBeanByCode.do?code=LBTYPE001",//all是 添加 请选择 
        textField:'name',
        valueField:'code',
        required:false,
        onLoadSuccess: function(data){
            if(data!=null&&data.length>0){
                if(zjId==null||zjId==""){
                    $("#lxTypeSelect").combobox("setValue",data[0].code);
                }
            }
        }
    });
    //点检类型
    $("#djTypeSelect").combobox({
        url:"${pageContext.request.contextPath }/pms/sys/eqptype/queryMdFixCodeBeanByCode.do?code=DJTYPE001",
        textField:'name',
        valueField:'code',
        required:false,
        onLoadSuccess: function(data){
            if(data!=null&&data.length>0){
                if(zjId==null||zjId==""){
                    $("#djTypeSelect").combobox("setValue",data[0].code);
                }
            }
        }
    });
    
    $("#oilId").combobox({
        url:'${pageContext.request.contextPath }/pms/equ/lubricant/queryAllLubricant.do?type=all',//all是 添加 请选择 
        textField:'lubricantName',
        valueField:'id',
        required:false,
        onLoadSuccess: function(data){
            if(data!=null&&data.length>0){
                if(zjId==null||zjId==""){
                    $("#oilId").combobox("setValue",data[0].id);
                }
            }
        }
    });
    //加注量单位
    $("#fillUnit").combobox({
        url:'${pageContext.request.contextPath }/pms/equ/lubricant/queryListById.do?key=JZLUNIT&&type=all',
        textField:'lubricantName',
        valueField:'id',
        required:false,
        onBeforeLoad: function(param){
            //alert("onBeforeLoad:"+param);
        },
        onLoadSuccess: function(data){
            if(data!=null&&data.length>0){
                if(zjId==null||zjId==""){
                    $("#fillUnit").combobox("setValue",data[0].id);
                }
            }
        }
    });
    //润滑方式
    $("#fashion").combobox({
        url:'${pageContext.request.contextPath }/pms/equ/lubricant/queryListById.do?key=RHFS001&&type=all',
        textField:'lubricantName',
        valueField:'id',
        required:false,
        onLoadSuccess: function(data){
            if(data!=null&&data.length>0){
                if(zjId==null||zjId==""){
                    $("#fashion").combobox("setValue",data[0].id);
                }
            }
        }
    });
    //点检方法
    $("#djMethodId").combobox({
        url:'${pageContext.request.contextPath }/pms/equ/lubricant/queryListById.do?key=DJFS001&&type=all',
        textField:'lubricantName',
        valueField:'id',
        multiple:true,//多选
        required:false,
        onLoadSuccess: function(data){
            if(data!=null&&data.length>0){
                if(zjId==null||zjId==""){
                    $("#djMethodId").combobox("setValue",data[0].id);
                }else{//有主键 表示 编辑状态
                    var djMethodIds =$("#djMethodIds").val();
                    $('#djMethodId').combobox('setValues',djMethodIds.split(','));
                }
            }
        }
    });
</script>
    <div style="overflow: hidden;padding:5px">
        <form id="form" method="post">
            <fieldset>
            <c:if test="${mdEqpTypeBean.id==null }">
            <legend>二级数据新增</legend>
            </c:if>
            <c:if test="${mdEqpTypeBean.id!=null }">
            <legend>二级数据修改</legend>
            </c:if>
                <table class="table" style="width: 100%;">
                    <tr>
                        <th>一级名称</th>
                        <td>
                            <c:if test="${mdEqpTypeBean.id==null }">
                            <samp>${mdEqpTypeBean.categoryName }</samp>
                            <input type="hidden" name="categoryId"  value="${mdEqpTypeBean.categoryId }"/>            
                            </c:if>
                            <c:if test="${mdEqpTypeBean.id!=null}">
                                <samp>${mdEqpTypeBean.categoryName }</samp>
                                <input type="hidden" id="mdEquCategoryType" name="categoryId"
                                data-options="panelHeight:'auto',width:176,editable:false,required:true"
                                value="${mdEqpTypeBean.categoryId}" />
                        </c:if>
                        </td>
                        <th>是否启用</th>
                        <td>
                           <select name="enable" class="easyui-combobox fselect"
                                data-options="panelHeight:'auto',width:176,editable:false,required:true"
                                value="${mdEqpTypeBean.enable }">
                                <option value="1" <c:if test="${bean.enable==1 }">selected="selected" </c:if>> 启用</option>
                                <option value="0" <c:if test="${bean.enable==0 }">selected="selected" </c:if>> 禁用</option> 
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>二级编码</th>
                        <td>
                            <input name="id" id="mdEqpTypeBeanId" type="hidden" value="${mdEqpTypeBean.id}"/> 
                            <input type="text" id='code1' name="code" class="easyui-validatebox" data-options="required:true" value="${mdEqpTypeBean.code }" />
                        </td>
                        <th>二级名称</th>
                        <td>
                            <input type="text" name="name" class="easyui-validatebox" data-options="required:true" value="${mdEqpTypeBean.name }"/>
                        </td>
                    </tr>
                    <tr>
                        <th>数据描述</th>
                        <td colspan="3">
                            <textarea style="width:92%;height:20px;resize:none" 
                            name="des"  maxlength="1000" >${mdEqpTypeBean.des}</textarea>
                        </td>
                    </tr>
                    <tr>
                        <th style="text-align:left" colspan="4">针对轮保(保养)</th>
                    </tr>
                    <tr>
                        <th>轮保类型</th>
                        <td colspan="3">
                            <input data-options="panelHeight:80" class="easyui-combobox"  id="lxTypeSelect" name="lxType" value="${mdEqpTypeBean.lxType}"/>
                        </td>
                    </tr>
                    <tr>
                        <th style="text-align:left" colspan="4">针对点检</th>
                    </tr>
                    <tr>
                        <th>点检类型</th><!-- value 值为sys_role表id -->
                        <td>
                            <input data-options="panelHeight:80" class="easyui-combobox"  id="djTypeSelect" name="djType" value="${mdEqpTypeBean.djType}"/>
                        </td>
                        <th>点检方法</th>
                        <td>
                            <input type="text" name="djMethodId" value="${mdEqpTypeBean.djMethodId}"/>
                            <input  id="djMethodIds" type="hidden" value="${mdEqpTypeBean.djMethodId}"/>
                        </td>
                    </tr>
                </table>
            </fieldset>
        </form>
    </div>