<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
|
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
|
<%
|
String path = request.getContextPath();
|
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
|
+ path + "/";
|
%>
|
|
<!DOCTYPE HTML>
|
<html>
|
<head>
|
<base href="<%=basePath%>">
|
<meta name="viewport" charset="width=device-width, initial-scale=1.0">
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
<title>编码块信息</title>
|
<link href="static/plugins/font-awesome/css/font-awesome.css" rel="stylesheet" type="text/css">
|
<link href="static/plugins/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css">
|
<link rel="stylesheet" href="static/styles/initialize.css" type="text/css">
|
<link rel="stylesheet" href="static/styles/common.css" type="text/css">
|
<link rel="stylesheet" href="static/plugins/layer/skin/default/layer.css" type="text/css">
|
<script type="text/javascript" src="static/plugins/jquery/jquery.min.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery-easyui/jquery.easyui.min.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
|
<script type="text/javascript" src="static/scripts/easyuiExtend.js"></script>
|
<script type="text/javascript" src="static/scripts/jquery-extend.js"></script>
|
<script type="text/javascript" src="static/plugins/layer/layer.js"></script>
|
<script type="text/javascript" src="static/plugins/slimScroll/jquery.slimscroll.min.js"></script>
|
|
|
<!-- 弹窗加载组件 -->
|
<script type="text/javascript" src="static/plugins/layer/layer.js"></script>
|
<script type="text/javascript" src="static/plugins/spinjs/spin.js"></script>
|
<script type="text/javascript" src="static/plugins/spinjs/jquery.spin.js"></script>
|
<script type="text/javascript" src="static/plugins/jquery.blockUI.js"></script>
|
<!-- wcp组件 -->
|
<script type="text/javascript" src="static/wcp/scripts/wcp.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.layer.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.blockUI.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.spin.js"></script>
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.jquery.js"></script>
|
|
<!--[if lt IE 9]>
|
<script type="text/javascript" src="static/plugins/json2.js"></script>
|
<![endif]-->
|
<script type="text/javascript" src="static/wcp/scripts/libs/wcp.infoPicker.js"></script>
|
<style>
|
.combobox-group {
|
clear: both;
|
}
|
|
.combobox-gitem {
|
float: left;
|
padding-right: 10px;
|
}
|
</style>
|
|
</head>
|
<body>
|
<div class="margin-lr">
|
<div class="pt-main-top clear">
|
<div class="pt-nav">
|
<span class="pt-title-icon"><i class="fa fa-bars"></i></span>
|
<div class="pt-title">
|
<div>
|
<h4>编码块信息</h4>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="pt-form">
|
<form id="formCoding" method="post">
|
<div class="ptbody">
|
|
<table style="width: 100%;">
|
<tr>
|
<td class="tbtitle" style="width: 140px;">
|
<em class="pt-color-danger">*</em> 编码类型:
|
</td>
|
<td>
|
<input id="sectionType" name="sectionType" class="easyui-combobox" type="text"
|
data-options="required:true,panelHeight:'auto',editable:false" style="width:100%"
|
/>
|
<input type="hidden" id="sectionId" name="sectionId" value="${ codingSection.sectionId}">
|
<input type="hidden" id="codingId" name="codingId" value="${ codingId}">
|
</td>
|
</tr>
|
<!-- 数据字典 -->
|
<tr name = "sectionType1_element" >
|
<td class="tbtitle" style="width: 140px;">
|
<em class="pt-color-danger">*</em> 字典:</td>
|
<td>
|
<input type="hidden" id="sectionRuleKeywordId1" value="${codingSection.sectionRuleKeywordId}">
|
<input id="sectionRule1" value="${codingSection.sectionRule }"
|
class="easyui-textbox" style="width:100%"
|
data-options="editable:false,required:true,buttonText:'选择',prompt:'',onClickButton:function(){selectSectionRule();}"/>
|
</td>
|
</tr>
|
<tr name = "sectionType1_element" >
|
<td class="tbtitle">
|
默认值:
|
</td>
|
<td>
|
<input id="defaultValue1" class="easyui-textbox" style="width:100%;" data-options="panelHeight:'auto'"
|
value="${codingSection.defaultValue}"/>
|
</td>
|
</tr>
|
<tr name = "sectionType1_element" >
|
<td class="tbtitle" style="width: 140px;"> 数据字段:</td>
|
<td>
|
<input id="tableColumnName1" value="${codingSection.tableColumnName }"
|
class="easyui-textbox" style="width:100%"
|
data-options="editable:false,buttonText:'选择',prompt:'',onClickButton:function(){selectTableColumn();}"/>
|
</td>
|
</tr>
|
<tr name = "sectionType1_element" >
|
<td class="tbtitle" style="width: 140px;">前缀:</td>
|
<td>
|
<input id="splitPre1" class="easyui-textbox" type="text" style="width:100%" value="${codingSection.splitPre }"/>
|
</td>
|
</tr>
|
<tr name = "sectionType1_element" >
|
<td class="tbtitle" style="width: 140px;">分隔符:</td>
|
<td>
|
<input id="splitSign1" class="easyui-textbox" type="text" style="width:100%" value="${codingSection.splitSign }"/>
|
</td>
|
</tr>
|
<!-- 数据字典 end -->
|
|
<!-- 日期 -->
|
<tr name = "sectionType2_element" >
|
<td class="tbtitle" style="width: 140px;">
|
<em class="pt-color-danger">*</em> 日期格式:</td>
|
<td>
|
<select id="sectionRule2" style="width:100%" class="easyui-combobox" data-options="panelHeight: 'auto',editable:false" value="${codingSection.sectionRule }" >
|
<option value="yy" ${codingSection.sectionRule == 'yy'?'selected':''} >年【yy】</option>
|
<option value="yyyy" ${codingSection.sectionRule == 'yyyy'?'selected':''} >年【yyyy】</option>
|
<option value="yyyyMM" ${codingSection.sectionRule == 'yyyyMM'?'selected':''} >年月【yyyyMM】</option>
|
<option value="yyyyMMdd" ${codingSection.sectionRule == 'yyyyMMdd'?'selected':''} >年月日【yyyyMMdd】</option>
|
</select>
|
</td>
|
</tr>
|
|
<tr name = "sectionType2_element" >
|
<td class="tbtitle" style="width: 140px;"> 数据字段:</td>
|
<td>
|
<input id="tableColumnName2" value="${codingSection.tableColumnName }"
|
class="easyui-textbox" style="width:100%"
|
data-options="editable:false,buttonText:'选择',prompt:'',onClickButton:function(){selectTableColumn();}"/>
|
</td>
|
</tr>
|
<tr name = "sectionType2_element" >
|
<td class="tbtitle" style="width: 140px;">前缀:</td>
|
<td>
|
<input id="splitPre2" name="splitPre2" class="easyui-textbox" type="text" style="width:100%" value="${codingSection.splitPre }"/>
|
</td>
|
</tr>
|
<tr name = "sectionType2_element" >
|
<td class="tbtitle" style="width: 140px;">后缀(分隔符):</td>
|
<td>
|
<input id="splitSign2" class="easyui-textbox" type="text" style="width:100%" value="${codingSection.splitSign }"/>
|
</td>
|
</tr>
|
<!-- 日期 end -->
|
|
<!-- 流水号 -->
|
<tr name = "sectionType3_element" >
|
<td class="tbtitle" style="width: 140px;">
|
<em class="pt-color-danger">*</em> 流水号长度:</td>
|
<td>
|
<input id="sectionRule3" value="${codingSection.sectionRule }"
|
class="easyui-numberspinner" style="width:100%"
|
data-options="increment:1,min:2"/>
|
</td>
|
</tr>
|
<tr name = "sectionType3_element" >
|
<td class="tbtitle">
|
<em class="pt-color-danger">*</em> 最小值:
|
</td>
|
<td>
|
<input id="minValue3" class="easyui-textbox" type="text" style="width:100%" data-options="validType:'number'" value="${codingSection.minValue }"/>
|
</td>
|
</tr>
|
<tr name = "sectionType3_element" >
|
<td class="tbtitle">
|
<em class="pt-color-danger">*</em> 最大值:
|
</td>
|
<td>
|
<input id="maxValue3" class="easyui-textbox" type="text" style="width:100%" data-options="validType:'number'" value="${codingSection.maxValue }"/>
|
</td>
|
</tr>
|
<tr name = "sectionType3_element" >
|
<td class="tbtitle" style="width: 140px;">前缀:</td>
|
<td>
|
<input id="splitPre3" class="easyui-textbox" type="text" style="width:100%" value="${codingSection.splitPre }"/>
|
</td>
|
</tr>
|
<tr name = "sectionType3_element" >
|
<td class="tbtitle" style="width: 140px;">后缀(分隔符):</td>
|
<td>
|
<input id="splitSign3" class="easyui-textbox" type="text" style="width:100%" value="${codingSection.splitSign }"/>
|
</td>
|
</tr>
|
<!-- 流水号 end -->
|
|
<!-- 取值范围 -->
|
<tr name = "sectionType4_element" >
|
<td class="tbtitle" style="width: 140px;"> <em class="pt-color-danger">*</em> 默认值:</td>
|
<td>
|
<input id="sectionRule4" value="${codingSection.sectionRule }"
|
class="easyui-textbox" style="width:100%"/>
|
</td>
|
</tr>
|
|
<tr name = "sectionType4_element" >
|
<td class="tbtitle" style="width: 140px;"> 数据字段:</td>
|
<td>
|
<input id="tableColumnName4" value="${codingSection.tableColumnName }"
|
class="easyui-textbox" style="width:100%"
|
data-options="editable:false,buttonText:'选择',prompt:'',onClickButton:function(){selectTableColumn();}"/>
|
</td>
|
</tr>
|
<tr name = "sectionType4_element" >
|
<td class="tbtitle" style="width: 140px;">前缀:</td>
|
<td>
|
<input id="splitPre4" class="easyui-textbox" type="text" style="width:100%" value="${codingSection.splitPre }"/>
|
</td>
|
</tr>
|
<tr name = "sectionType4_element" >
|
<td class="tbtitle" style="width: 140px;">后缀(分隔符):</td>
|
<td>
|
<input id="splitSign4" class="easyui-textbox" type="text" style="width:100%" value="${codingSection.splitSign }"/>
|
</td>
|
</tr>
|
<!-- 取值范围 end -->
|
|
<!-- 系统参数 -->
|
<tr name = "sectionType5_element" >
|
<td class="tbtitle" style="width: 140px;"><em class="pt-color-danger">*</em> 编码值:</td>
|
<td>
|
<select id="sectionRule5" style="width: 200px" class="easyui-combobox" data-options="panelHeight: 'auto',editable:false" value="${codingSection.sectionRule }" >
|
<option value="userid" ${codingSection.sectionRule == 'userid'?'selected':''} >登录用户ID</option>
|
<option value="username" ${codingSection.sectionRule == 'username'?'selected':''} >登录用户工号</option>
|
<option value="truename" ${codingSection.sectionRule == 'truename'?'selected':''} >登录用户姓名</option>
|
<option value="deptid" ${codingSection.sectionRule == 'deptid'?'selected':''} >登录用户部门ID</option>
|
<option value="deptname" ${codingSection.sectionRule == 'deptname'?'selected':''} >登录用户部门名称</option>
|
</select>
|
|
</td>
|
</tr>
|
|
<tr name = "sectionType5_element" >
|
<td class="tbtitle" style="width: 140px;">前缀:</td>
|
<td>
|
<input id="splitPre5" class="easyui-textbox" type="text" style="width:100%" value="${codingSection.splitPre }"/>
|
</td>
|
</tr>
|
<tr name = "sectionType5_element" >
|
<td class="tbtitle" style="width: 140px;">后缀(分隔符):</td>
|
<td>
|
<input id="splitSign5" class="easyui-textbox" type="text" style="width:100%" value="${codingSection.splitSign }"/>
|
</td>
|
</tr>
|
<!-- 系统参数 end -->
|
|
</table>
|
|
</div>
|
</form>
|
<div class="pt-form-btn">
|
<div class="form-group">
|
<button id="btnSave" class="pt-btn pt-btn-primary">保存</button>
|
<button id="btnClose" class="pt-btn pt-btn-default">关闭</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
</body>
|
<script type="text/javascript" src="static/scripts/ResizeScroll.js"></script>
|
<script>
|
//窗口参数,用于弹窗传递
|
var params = {
|
callBack: null
|
};
|
|
var _moduleId = '${moduleId}';
|
var sectionTypeList = [
|
{
|
csid : 1,
|
csmc : '数据字典'
|
},
|
{
|
csid : 2,
|
csmc : '日期'
|
},
|
{
|
csid : 3,
|
csmc : '流水号'
|
},
|
{
|
csid : 4,
|
csmc : '取值范围'
|
}
|
,
|
{
|
csid : 5,
|
csmc : '系统参数'
|
}
|
];
|
//默认1
|
var _sectionType='${codingSection.sectionType }';
|
|
$(function () {
|
new ResizeScroll({
|
"id": ".ptbody",
|
fun: function () {
|
var wh = $(window).height();
|
return (wh - 69 - 62);
|
|
}
|
});
|
|
$("#btnSave").click(function () {
|
//验证表单信息
|
// var isValid = $('#formCoding').form('validate');
|
// if (!isValid) {
|
// wcp.notify.warn('表单验证有误,请检查表单输入项!');
|
// return false;
|
// }
|
if ($('#sectionRule'+_sectionType).val() == '') {
|
wcp.notify.warn('编码值不能为空!');
|
return false;
|
}
|
var obj ={}; //$("#formCoding").serializeObject();
|
obj.sectionId = $('#sectionId').val();
|
obj.codingId = $('#codingId').val();
|
obj.sectionType = $('#sectionType').combobox('getValue');
|
if(_sectionType == 1){
|
obj.sectionRuleKeywordId = $('#sectionRuleKeywordId'+_sectionType).val();
|
obj.sectionRule = $('#sectionRule'+_sectionType).val();
|
obj.defaultValue = $('#defaultValue'+_sectionType).val();
|
obj.tableColumnName = $('#tableColumnName'+_sectionType).val();
|
obj.splitPre = $('#splitPre'+_sectionType).val();
|
obj.splitSign = $('#splitSign'+_sectionType).val();
|
}
|
else if(_sectionType == 2){
|
obj.sectionRule = $('#sectionRule'+_sectionType).val();
|
obj.tableColumnName = $('#tableColumnName'+_sectionType).val();
|
obj.splitPre = $('#splitPre'+_sectionType).val();
|
obj.splitSign = $('#splitSign'+_sectionType).val();
|
}
|
else if(_sectionType == 3){
|
if ($('#minValue'+_sectionType).val() == '') {
|
wcp.notify.warn('请输入最小值!');
|
return false;
|
}
|
if ($('#maxValue'+_sectionType).val() == '') {
|
wcp.notify.warn('请输入最小值!');
|
return false;
|
}
|
obj.sectionRule = $('#sectionRule'+_sectionType).val();
|
obj.minValue = $('#minValue'+_sectionType).val();
|
obj.maxValue = $('#maxValue'+_sectionType).val();
|
obj.splitPre = $('#splitPre'+_sectionType).val();
|
obj.splitSign = $('#splitSign'+_sectionType).val();
|
}
|
else if(_sectionType == 4){
|
obj.sectionRule = $('#sectionRule'+_sectionType).val();
|
obj.tableColumnName = $('#tableColumnName'+_sectionType).val();
|
obj.splitPre = $('#splitPre'+_sectionType).val();
|
obj.splitSign = $('#splitSign'+_sectionType).val();
|
}
|
else if(_sectionType == 5){
|
obj.sectionRule = $('#sectionRule'+_sectionType).val();
|
obj.splitPre = $('#splitPre'+_sectionType).val();
|
obj.splitSign = $('#splitSign'+_sectionType).val();
|
}
|
console.log(JSON.stringify(obj));
|
wcp.ui.setBusy("body", wcp.ajax({
|
url: "config/coding/saveCodingSection",
|
data: JSON.stringify(obj),
|
}).done(function (result) {
|
//判断是否需要执行回调函数
|
if (params.callBack) {
|
params.callBack();
|
}
|
|
//关闭窗口
|
closeWindow();
|
|
top.wcp.notify.success("保存成功!");
|
}));
|
});
|
|
$("#btnClose").click(function () {
|
closeWindow();
|
});
|
|
$('#sectionType').combobox({
|
data:sectionTypeList,
|
valueField:'csid',
|
textField:'csmc',
|
value:'${codingSection.sectionType }',
|
onChange: function(newV,oldV){
|
_sectionType=newV;
|
for (var i = 1; i <= sectionTypeList.length; i++) {
|
$("tr[name=sectionType"+i+"_element]").hide();
|
}
|
// $("tr[name=sectionType"+oldV+"_element]").hide();
|
$("tr[name=sectionType"+newV+"_element]").show();
|
},
|
onLoadSuccess:function (){
|
if(_sectionType == ''){
|
$('#sectionType').combobox('setValue', 1);
|
}
|
for (var i = 1; i <= sectionTypeList.length; i++) {
|
$("tr[name=sectionType"+i+"_element]").hide();
|
}
|
$("tr[name=sectionType"+_sectionType+"_element]").show();
|
}
|
|
});
|
|
// bindDefaultValue();
|
|
});
|
|
|
|
|
//选择编码值
|
function selectSectionRule() {
|
if(_sectionType=="1"){
|
wcp.picker.selectKeyword({
|
title : "编码值不能为空",
|
idElement : "sectionRuleKeywordId"+_sectionType,
|
nameElement : "sectionRule"+_sectionType,
|
keywordType:1,
|
layerOpener : window
|
});
|
}
|
}
|
|
function selectTableColumn(){
|
wcp.picker.selectTableColumn({
|
title: "选择字段",
|
multiSelect: false,
|
moduleId: "${moduleId}",
|
separator: ",",
|
layerOpener: window
|
}, function (rows) {
|
var idFromField = "";
|
var nameFromField = "";
|
if (rows != null && rows.length > 0) {
|
for (var i = 0; i < rows.length; i++) {
|
idFromField += rows[i].columnName + ",";
|
nameFromField += rows[i].displayName + ",";
|
}
|
idFromField = idFromField.slice(0, -1);
|
nameFromField = nameFromField.slice(0, -1);
|
}
|
$("#tableColumnName"+_sectionType).textbox("setValue",idFromField);
|
});
|
}
|
|
//绑定默认值
|
// function bindDefaultValue(){
|
// var keywordId=$('#sectionRuleKeywordId').val();
|
// if(keywordId!=0){
|
// var url= 'config/coding/getDefaultValueList?keywordId='+keywordId+'&rnd='+Math.random();
|
// $('#defaultValue').combobox({
|
// url:url,
|
// valueField:'keywordId',
|
// textField:'keywordName',
|
// });
|
// }
|
// }
|
|
// function bindSectionRule(csmc){
|
// $('#sectionRule').combobox('clear');
|
// var url= 'config/coding/getSectionRuleList?sectionType='+csmc+'&rnd='+Math.random();
|
// $('#sectionRule').combobox({
|
// url:url,
|
// valueField:'keywordId',
|
// textField:'keywordName',
|
// onSelect: function(rec){
|
// }
|
// });
|
// }
|
|
function closeWindow() {
|
var index = top.layer.getFrameIndex(window.name); //获取窗口索引
|
top.layer.close(index);
|
}
|
</script>
|
</html>
|