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
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>增加/修改服务目录</title>
 
[#include "/business/pages/include/static.html" /]
</head>
 
 <script type="text/javascript">
  var id = '${id}';
        $(document).ready(function() {    
                $.formValidator.initConfig({formID:"myform",onError:function(msg){alert(msg)},onSuccess:function(){
                        document.getElementById("myform").target = window.top.openDialog("1","操作",
                         {},
                         {"width":40,"height":40,"noclose":true},[{btnId:"tipBtnSure", btnName:"确定", btnStyle:"bluebtn"}]);
                         return true;
                }});
                $("#template_name").formValidator({empty:false,onShow:"模板名称不能为空!",onFocus:"模板名称不能为空!"}).inputValidator({min:1,max:32,onError:"模板名称为1到32个字符!"});
                $("#version").formValidator({empty:false,onShow:"唯一的版本号",onFocus:"唯一的版本号"}).inputValidator({min:1,max:20,onCorrect:"123",onError:"输入唯一的版本号"})
                .ajaxValidator({
                    dataType : "html",
                    async : true,
                    url : "checkVersion.html",
                    data :{"type":function(){return $("#template_type").val();},"version":function(){return $("#version").val();},"id":'${map.ID}'},
                    success : function(data){
                        if( data == 0 ) return true;
                        if( data == 1 ) return false;
                        return false;
                    },
                    buttons: $("#dosubmit"),
                    error: function(jqXHR, textStatus, errorThrown){alert("服务器没有返回数据,可能服务器忙,请重试"+errorThrown);},
                    onError : "该版本号已存在,请更换版本号",
                    onWait : "正在对版本号进行合法性校验,请稍候..."
                });
                $("#template_type").change(function(){
                   var type = $("#template_type").val();
                   var version = $("#version").val();
                   $.post("${base}/business/pages/satisfactionconfig/checkVersion.html",{"id":id,"type":type,"version":version},function(data,textStatus){
                      if(data == 1){
                        alert("此模板类型存在相同的版本号");
                        $("#version").val("");
                      }else{
                          $("#version").val("");
                      }
                   })
                 });
                 $("#defaultscore").formValidator({empty:false,onShow:"默认分数不能为空!",onFocus:"默认分数不能为空!"});
                
        });
    </script>
  <body>
   <div class="pad_10" style="margin-top: 10px;">
<div class="col-tab">
<div id="div_setting_1" class="contentList pad_10">
  <form action="" method="post"  id="myform" name="myform" enctype="multipart/form-data">
  <table align="center" width="98%"  class="edit_layout2">
      <tr>
          <th width="20%" align="right"><label class="required" >模板名称:</label></th>
          <td>
              <input type="text" class="general" value="${map.TEMPLATE_NAME}" name="template_name" id="template_name" />
              <div id="template_nameTip" style="display:inline-block;width: 200px;"></div>
          </td>    
    </tr>
    <tr>
        <th width="20%" align="right">模板类型:</th>
          <td>
              <select id="template_type" name="template_type" class="mysel">
              <option value="1" [#if map.TEMPLATE_TYPE == 1]selected[/#if]>响应支持类</option>
              <option value="3" [#if map.TEMPLATE_TYPE == 3]selected[/#if]>驻场服务类</option>
              </select>
          </td>    
    </tr>
    <tr>
          <th width="20%" align="right"><label class="required" >版本号:</label></th>
          <td>
              <input type="text" class="general" value="${map.VERSION}" name="version" id="version" />
              <div id="versionTip" style="display:inline-block;width: 200px;"></div>
          </td>    
    </tr>
    <tr>
          <th width="20%" align="right"><label class="required" >调查项的默认分数:</label></th>
          <td>
              <input type="text" class="general" value="${map.DEFAULTSCORE}" name="defaultscore" id="defaultscore" />
              <div id="defaultscoreTip" style="display:inline-block;width: 200px;"></div>
          </td>    
    </tr>
    <tr>
          <th width="20%" align="right">备注:</th>
          <td>
              <textarea id="note" name="note" style="width:400px;" class="general">${map.NOTE}</textarea>
              
          </td>    
    </tr>
  </table>
  </form>
    </div>
</div>
</div>
  </body>
<script type="text/javascript">
function onDialogBtnClick(btnID, dialogID, config){
        if(btnID == "btnSure"){
        var defaultscore = $("#defaultscore").val();
           if(!/(^[0-9]{1,3}$)|(^[0-9]{1,2}[\.]{1}[0-9]{1,2}$)/.test(defaultscore)){
              popupTips("默认分数为小于等于100且小数不能超过两位的正数");
              return;
           }
           if(defaultscore>100){
                popupTips("默认分数为小于等于100且小数不能超过两位的正数");
              return;
           }
           if(defaultscore<0){
                popupTips("默认分数为小于等于100且小数不能超过两位的正数");
              return;
           }
           var type = $("#template_type").val();
           var version = $("#version").val();
           $.post("${base}/business/pages/satisfactionconfig/checkVersion.html",{"id":id,"type":type,"version":version},function(data,textStatus){
              if(data == 1){
                popupTips("此模板类型存在相同的版本号");
                return;
              }else{
                $("#myform").submit();
              }
           })
            
        }
    }
 
</script>
</html>