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
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
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>修改</title>
 
[#include "/business/pages/include/static.html" /]
<style type="text/css">
    html{_overflow-y:scroll}
    .edit_layout th{
        border-right:solid 1px #ccc;border-bottom:solid 1px #ccc;
    }
    
</style>
 <script type="text/javascript">
    $(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;
    }});
//     $("input[name=score]").change(function() {
//        var value = $(this).val();
//        if($.util.isNumber(value)){
//         if(!/(^[0-9]{1,3}$)|(^[0-9]{1,2}[\.]{1}[0-9]{1,2}$)/.test(value)){
//             popupTips("分数为小于等于100且小数不能超过两位的正数");
//             if(value<0){
//                 $(this).val(0);
//             }else{
//                  value = Math.round(value);
//                   $(this).val(value);
//             }
//         }else{
//             if(value>100){
//                 popupTips("分数为小于等于100且小数不能超过两位的正数");
//                 $(this).val(100);
//             }
//         }
//        }else{
//            popupTips("分数为小于等于100且小数不能超过两位的正数");
//           $(this).val(0);
//        }
//     });
    $("input[name=ordernum]").change(function() {
       var value = $(this).val();
       if($.util.isNumber(value)){
          value = Math.round(value);
          $(this).val(value);
       }
    
    });
    $("input[name=is_default]").click(function() {
       if($(this).attr("checked")){
          $("input[name=is_default]").attr("checked",false);
          $(this).attr("checked",true);
       }
    });
    
});
 
function onDialogBtnClick(btnID, dialogID, config){
  if(btnID == "btnSure"){
      var e=true;
      $("input[name=score]").each(function() {
       var value = $(this).val();
       if($.util.isNumber(value)){
        if(!/(^[0-9]{1,3}$)|(^[0-9]{1,2}[\.]{1}[0-9]{1,2}$)/.test(value)){
            e=false;
        }else{
            if(value>100){
                e=false;
            }
        }
       }else{
           e=false;
       }
    });
      
      
      
    var d = false;
    var c = false;
    var b = false;
    var a = false;
    
     $("input[name=evaluation]").each(function() {
     var index = $(this).attr("id").substr(10,1);
     
         if(!$.util.isEmpty($.util.trim($(this).val()))&&$.util.isEmpty($("#score"+index).val())) {
             b = true;
             return;
         }
         if(!$.util.isEmpty($.util.trim($(this).val()))&&!$.util.isNumber($("#score"+index).val())) {
             a = true;
             return;
         }
         if(!$.util.isEmpty($.util.trim($(this).val()))&&($("#score"+index).val()<0 ||$("#score"+index).val()>100 )) {
             c = true;
             return;
         }
         if(!$.util.isEmpty($.util.trim($(this).val()))&&!$.util.isNumber($("#ordernum"+index).val())) {
             d = true;
             return;
         }
         
     });
     if(!e) {
         popupTips("分数为小于等于100且小数不能超过两位的正数");
         return;
     }
     if(d) {
         popupTips("顺序号为整数");
         return;
     }
     if(c) {
         popupTips("分数为0到100");
         return;
     }
     if(b) {
         popupTips("有未填写的分数");
         return;
     }
     if(a) {
         popupTips("分数为整数");
         return;
     }
    $("#myform").submit();
   }
}
    </script>
  </head>
  <body>
   <div class="pad_10" style="margin-top: 10px;">
<div class="col-tab">
<div id="div_setting_1" class="contentList pad_10">
  <form method="post" action="" id="myform" name="myform" >
  <input type="hidden" name="id" id="id" value="${info.ID}" />
  <table class="edit_layout edit_layout3" style="border:solid 1px #ccc;border-width:1px 0 0 1px;width:98%;text-align:cente;margin-left:10px;">
    <tr>
       <th>指标项名称:</th>
          <td>${info.ITEM_NAME}
          </td>
    </tr> 
    
    <tr>
       <th>评价项:</th>
          <td style="padding:0;margin:0;border-bottom:0;"> 
          <table class="td-table" >
          <tr>
          <th style="width:35%">评价项名称</th>
          <th style="width:35%;">分数</th>
          <th style="width:10%;;">顺序号</th>
          <th style="border-right:0;">是否默认选中</th>
          </tr>
          [#if list?? && list?size>0]
            [#list list as score]
          <tr>
          <td><input type="text" class="general general2"  value="${score.EVA_NAME}" name="evaluation" id="evaluation${score_index+1}" />[#if score_index == 0]例:优[/#if]</td>
          <td><input type="text" class="general"  value="${score.SCORE}" name="score" id="score${score_index+1}" />(分)[#if score_index == 0]例:100[/#if]</td>
          <td><input type="text" class="general"  value="${score.ORDERNUM}" name="ordernum" id="ordernum${score_index+1}" /></td>
          <td style="text-align:center;border-right:0;"><input type="checkbox"  value="${score_index+1}" name="is_default" id="is_default${score_index+1}" [#if score.IS_DEFAULT == 1]checked[/#if]/></td>
          </tr>
          [/#list]
          [/#if]
           [#list info.list1 as score1]
          <tr>
          <td><input type="text" class="general general2"  name="evaluation" id="evaluation${score1}" />[#if info.list1?size == 4 && score1_index == 0]例:优[/#if]</td>
          <td><input type="text" class="general"  name="score" id="score${score1}" />(分)[#if info.list1?size == 4 && score1_index == 0]例:100[/#if]</td>
          <td><input type="text" class="general"  name="ordernum" id="ordernum${score1}" /></td>
          <td style="text-align:center;border-right:0;"><input type="checkbox" value="${score1}" name="is_default" id="is_default${score1}" /></td>
          </tr>
          [/#list] 
          </table>
          </td>
    </tr>
  </table>
  </form>
    </div>
</div>
</div>
  </body>
</html>