cy
2022-06-21 129904537f66509f97b285e7eb4f42b3dc349dd0
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
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>增加/修改配置分类</title>
[#include "/business/pages/include/static.html" /]
</head>
<body class="end_task_body widthauto">
 
<script type="text/javascript">
$(function() {
    $.formValidator.initConfig({formID:"myform",onError:function(msg){popupTips(msg)},onSuccess:function(){
        [#if !info.ID??]
        if(!window.top.openConfirm("提交后分类编码将不能进行修改,请谨慎!\n确定要提交吗?")) return false;
        [/#if]
        document.getElementById("myform").target = window.top.openDialog("1","操作",
        {},
        {"width":40,"height":40},[{btnId:"tipBtnSure", btnName:"确定", btnStyle:"bluebtn"}]);
        return true;
    }});
        
       $("#name").formValidator({empty:false,onShow:"请填写分类名称",onFocus:"分类名称不能为空!"})
           .inputValidator({min:1,max:50,onError:"分类名称长度不能超过50个字符!"})
           .ajaxValidator({
        dataType : "html",   
        async : true,     
        data:"id=${info.ID}",
        url : "checkCateName.html",
        success : function(data){    
                  if( data == 1 ) return true;
                  if( data == 0 ) return false;
            return false;
        },
        buttons: $("#dosubmit"),
        error: function(jqXHR, textStatus, errorThrown){alert("服务器没有返回数据,可能服务器忙,请重试"+errorThrown);},
        onError : "该分类名称已存在,请更换",
        onWait : "正在对分类名称进行校验,请稍候..."  
    });
            
    $("#code").formValidator({empty:false,onShow:"请输入分类编码!",onFocus:"分类编码不能为空!"})
        .inputValidator({min:2,max:8,onError:"分类编码必须为2-8个数字字母!"})
        .regexValidator({
            regExp : "isZmSz",
            dataType : "enum",
            onError : "分类编码必须为2-8个数字字母"
        }).ajaxValidator({
            dataType : "html",   
            async : true,     
            data:"id=${info.ID}&lv=${RequestParameters.lv}",
            url : "checkCateCode.html",
            success : function(data){    
                   if( data == 1 ) return true;
                   if( data == 0 ) return false;
                return false;
        },
        buttons: $("#dosubmit"),
        error: function(jqXHR, textStatus, errorThrown){alert("服务器没有返回数据,可能服务器忙,请重试"+errorThrown);},
        onError : "该分类编码已存在,请更换",
        onWait : "正在对分类编码进行校验,请稍候..."  
    });
            
    $("#serial").formValidator({empty:false,onShow:"请输入顺序号!",onFocus:"请输入顺序号"}).inputValidator({min:1,max:5,onError:"顺序号必须为1到5位数字"})
        .regexValidator({regExp:"intege1", dataType:"enum", onError:"顺序号必须为1到5位正整数"});
})
</script>
 
<form action="editCfgcate.html" method="post" id="myform" name="myform">
    <input type="hidden" name="id" value="${RequestParameters.id}"/>
    <input type="hidden" name="lv" value="${RequestParameters.lv}"/>
    <input type="hidden" name="pid" value="${RequestParameters.pid}"/>
    <input type="hidden" name="cateType" value="${RequestParameters.cateType}"/>
    <table class="edit_layout2">
        <tr><th ><label class="required" >分类名称:</label></th>
             <td><input class="general" type="text"  value="${info.NAME}" name="name" id="name"/>
             <div id="nameTip" style="display:inline-block;width:220px;"></div>
            </td>
        </tr>
        <tr><th ><label class="required">分类编码:</label></th>
            <td>
                [#if info.ID??]
                    ${info.code}
                    <input class="general" type="hidden" value="${info.code}" name="code" id="code"/>
                [#else]
                    <input class="general" type="text" value="${info.code}" name="code" id="code" onblur="upper(this.value)"/>
                    <div id="codeTip" style="display:inline-block;width:220px;"></div>
                [/#if]
            </td>
        </tr>
        <tr><th ><label class="required" >顺序号:</label></th>
            <td><input class="general" type="text" value="${info.serial}" name="serial" id="serial"/>
            <div id="serialTip" style="display:inline-block;width:220px;"></div>
            </td>
        </tr>
        <tr><th><label >分类说明:</label></th>
            <td ><textarea class="general" style="width:360px;" name="note" id="note"/>${info.NOTE}</textarea>
            </td>
        </tr>
    </table>
</form>
 
 
<script type="text/javascript">
    $(function () {
        [#if info.ID??]
            $("#code").attr("disabled",true).unFormValidator(true); //解除校验
        [/#if]
    })
    function upper(val) {
        if(!$.util.isEmpty(val)){
            $("#code").val(val.toUpperCase());
        }
    }
 
function onDialogBtnClick(btnID, dialogID, config){
    if(btnID == "btnSure"){
        $("#myform").submit();
    }
}
</script>
</body>
</html>