<!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}
|
</style>
|
<script type="text/javascript">
|
var templateId = '${templateId}';
|
var sjbh = '${infofather.categoryid}';
|
$(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=template_weight]").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);
|
}else{
|
$(this).val(0);
|
}
|
|
});
|
|
$("input[name=check]").click(function() {
|
var qxindex = $(this).attr("id").substr(5);
|
var id = $("#id"+qxindex).val();
|
if(!$(this).attr("checked")){
|
$("#zh"+qxindex).val("");
|
$("#delid"+qxindex).val(id);
|
}else{
|
$("#delid"+qxindex).val("");
|
$("#zh"+qxindex).val($("#item_name"+qxindex).val()+"-"+$("#template_weight"+qxindex).val()+"-"+$("#ordernum"+qxindex).val()+"-"+$("#item_note"+qxindex).val());
|
}
|
});
|
});
|
function onDialogBtnClick(btnID, dialogID, config){
|
if(btnID == "btnSure"){
|
var e=true;
|
$("input[name=template_weight]").each(function() {
|
var value = $(this).val();
|
if(value!=""){
|
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;
|
}
|
}
|
|
});
|
if(!e) {
|
popupTips("权重为小于等于100且小数不能超过两位的正数");
|
return;
|
}
|
|
|
$("input[name=check]").parent().parent().css("background-color","");
|
var a= false;
|
var b = false;
|
var c = false;
|
var d = false;
|
var quanz = 0;
|
var $items = $("input:checked");
|
$items.each(function() {
|
var index = $(this).attr("id").substr(5,1);
|
if($.util.isEmpty($.util.trim($("#item_name"+index).val()))||$.util.isEmpty($("#template_weight"+index).val())
|
||$.util.isEmpty($.util.trim($("#ordernum"+index).val()))) {
|
b = true;
|
$(this).parent().parent().css("background-color","#ccc");
|
return;
|
}
|
var str=$("#item_name"+index).val();
|
$("#item_name"+index).val(str.replace('-',""))
|
if(!$.util.isNumber($.util.trim($("#ordernum"+index).val()))||!$.util.isNumber($("#template_weight"+index).val())){
|
a = true;
|
$(this).parent().parent().css("background-color","#ccc");
|
return;
|
}
|
if($.util.trim($("#ordernum"+index).val()) ==0 ){
|
c = true;
|
$(this).parent().parent().css("background-color","#ccc");
|
return;
|
}
|
if($.util.trim($("#item_name"+index).val()).length > 32){
|
d = true;
|
$(this).parent().parent().css("background-color","#ccc");
|
return;
|
}
|
var zhvalues = $("#item_name"+index).val() + "-" + $("#template_weight"+index).val() + "-" + $("#ordernum"+index).val() + "-" +$("#item_note"+index).val();
|
$("#zh"+index).val(zhvalues);
|
var squan = parseFloat($("#template_weight"+index).val());
|
quanz = parseFloat(quanz) + parseFloat(squan) ;
|
});
|
if(b) {
|
popupTips("有未填写的指标项内容");
|
return;
|
}
|
if(c) {
|
popupTips("顺序号应为正数字");
|
return;
|
}
|
if(d) {
|
popupTips("名称超出最大限度");
|
return;
|
}
|
if(a) {
|
popupTips("指标项权重和顺序号应为整数");
|
return;
|
}else{
|
if(quanz != 100){
|
popupTips("指标项权重应为整数,权重之和不等于100");
|
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="cateId" value="${infofather.categoryid}" />
|
<input type="hidden" name="categoryid" id="categoryid" value="${infofather.categoryid}" />
|
<input type="hidden" name="item_level" id="item_level" value="${infofather.item_level}" />
|
<table align="center" width="98%" class="edit_layout">
|
[#if items?? && items?size > 0]
|
[#list items as item]
|
<tr>
|
<th style="text-align:center;width:6%;"><input type="checkbox" class="input-text" name="check" checked id="check${item_index+1}" />
|
<input type="hidden" class="input-text" name="id" id="id${item_index+1}" value="${item.ID}"/>
|
<input type="hidden" class="input-text" name="delid" id="delid${item_index+1}" value=""/>
|
<input type="hidden" class="input-text" name="zh" value="${item.ITEM_NAME}-${item.TEMPLATE_WEIGHT}-${item.ORDERNUM}-${item.ITEM_NOTE}" id="zh${item_index+1}" />
|
</th>
|
<th>名称:</th>
|
<td><input style="width:100px;" type="text" class="general" value="${item.ITEM_NAME}" name="item_name" id="item_name${item_index+1}" />
|
</td>
|
<th>权重:</th>
|
<td><input style="width:50px;" type="text" class="general" value="${item.TEMPLATE_WEIGHT}" name="template_weight" id="template_weight${item_index+1}" />
|
</td>
|
<th align="center" width="10%">顺序号:</th>
|
<td><input style="width:50px;" type="text" class="general" value="${item.ORDERNUM}" name="ordernum" id="ordernum${item_index+1}"/>
|
</td>
|
<th>说明:</th>
|
<td><input style="width:300px;" type="text" class="general" value="${item.ITEM_NOTE}" name="item_note" id="item_note${item_index+1}"/>
|
</td>
|
</tr>
|
[/#list]
|
[/#if]
|
[#if kongList?? && kongList?size > 0]
|
[#list kongList as kong]
|
<tr>
|
<th style="text-align:center;"><input type="checkbox" class="input-text" name="check" id="check${kong}" />
|
<input type="hidden" class="input-text" name="zh" id="zh${kong}" />
|
<input type="hidden" class="input-text" name="id" id="id${kong}" />
|
</th>
|
<th>名称:</th>
|
<td><input style="width:100px;" type="text" class="general" name="item_name" id="item_name${kong}" />
|
</td>
|
<th>权重:</th>
|
<td><input style="width:50px;" type="text" class="general" name="template_weight" id="template_weight${kong}" />
|
</td>
|
<th >顺序号:</th>
|
<td><input style="width:50px;" type="text" class="general" name="ordernum" id="ordernum${kong}" />
|
</td>
|
<th>说明:</th>
|
<td><input style="width:300px;" type="text" class="general" name="item_note" id="item_note${kong}"/>
|
</td>
|
</tr>
|
[/#list]
|
[/#if]
|
|
</table>
|
</form>
|
</div>
|
</div>
|
</div>
|
</body>
|
</html>
|