<!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>
|