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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!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(){
                        document.getElementById("myform").target = window.top.openDialog("1","操作",
                         {},
                         {"width":40,"height":40},[{btnId:"tipBtnSure", btnName:"确定", btnStyle:"bluebtn"}]);
                         return true;
        }});
        
        
        $("#category_name").formValidator({empty: false, onShow:"请输入分类名称!",onFocus: "请输入分类名称"}).inputValidator({min: 3,max:32, onError: "分类名称至少2个汉字或3个英文字符"})
                .ajaxValidator({
                      type:"POST",
                     url:"${base}/business/pages/servicelist/slapartner/check.html?sjbh=${RequestParameters.categoryid}&id=${RequestParameters.id}",
                     datatype:"json",
                     data:{
                         "category_name" : function(){return $("#category_name").val();}
                     },
                     success:function(data){
                         if(data == "1"){
                             return true;
                         } else {
                             return false;
                         }
                     },
                     buttons: $("#btnOK"),
                     error: function(){popupTips("分类名称已存在,请重新输入!");},
                    onError:"分类名称已存在,请重新输入!",
                    onWait : "正在进行合法性校验,请稍候..."
            });
            
            
        $("#category_code").formValidator({empty: false, onShow:"请输入分类编码!",onFocus: "请输入分类编码"}).inputValidator({min: 2,max:32, onError: "编码至少为2到32个字符"}).regexValidator({regExp:"isZmSz",dataType:"enum",onError:"编号由数字和字母组成"})
                .ajaxValidator({
                      type:"POST",
                     url:"${base}/business/pages/servicelist/slapartner/checkcode.html?id=${RequestParameters.id}&pId=${categoryid}",
                     datatype:"json",
                     data:{
                         "category_code" : function(){return $("#category_code").val();}
                     },
                     success:function(data){
                         if(data == "1"){
                             return true;
                         } else {
                             return false;
                         }
                     },
                     buttons: $("#btnOK"),
                     error: function(){popupTips("分类编码已存在,请重新输入!");},
                    onError:"分类编码已存在,请重新输入!",
                    onWait : "正在进行合法性校验,请稍候..."
            });
            
            
        $("#serial").formValidator({empty:false,onShow:"请输入顺序号!",onFocus:"请输入顺序号!"})
         .regexValidator({regExp:"intege1", dataType:"enum", onError:"顺序号格式不正确"});
         $("#photopath").formValidator({empty:true}).regexValidator({
                    regExp : "picture1",
                    dataType : "enum",
                    onError : "请上传图片,格式如:jpg,jpeg,png,gif"
                });
        
})
function upper(val) {
    if(!$.util.isEmpty(val)){
        $("#category_code").val(val.toUpperCase());
    }
}
</script>
 
<div class="edit_txt">
    <form action="${base}/business/pages/servicelist/slapartner/servicecategoryAdd.html" method="post" id="myform" name="myform" enctype="multipart/form-data">
          <input type="hidden" name="id" value="${RequestParameters.id}"/>
           <input type="hidden" name="categoryid" id="categoryid" value="${categoryid}" />
         <table class="edit_layout2">
                <tr><th ><label class="required" >分类名称:</label></th>
                    <td><input class="general" type="text"  value="${info.category_name}" name="category_name" id="category_name"/>
                    <div id="category_nameTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                <tr><th ><label class="required" >分类编码:</label></th>
                    <td><input class="general" type="text"  value="${info.category_code}" name="category_code" id="category_code" onblur="upper(this.value)"/>
                    <div id="category_codeTip" style="display:inline-block;"></div>
                    </td>
                </tr>
                <tr><th ><label>分类图片:</label></th>
                    <td>
                      [#if info.ID??&&info.ID?length>0]
                        <input type="file" name="photopathurl" id="photopath" />
                        <input type="hidden" name="photopath" value="${info.photopath}"/>
                      [#else]
                      <input type="file" name="photopathurl" id="photopath" />
                      [/#if]
                      <div id="photopathTip" style="width: 500px;"></div>
                    </td>
                </tr>
                
                [#if info.photopath??&&info.photopath?length>0]
                    <tr><th ></th>
                    <td>
                        <img  src="${base}${info.photopath}" width="80px;" height="80px;"/>
                    </td>
                </tr>
                [/#if]
                
                <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;"></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>
</div>
 
 
 
<script type="text/javascript">
function onDialogBtnClick(btnID, dialogID, config){
        if(btnID == "btnSure"){
            $("#myform").submit();
        }
    }
 
</script>
 
 
</body>
</html>