386 lines
16 KiB
Plaintext
386 lines
16 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
|||
|
|
|
|||
|
|
<%@page import="com.sipai.entity.report.RptInfoSet" %>
|
|||
|
|
<% request.setAttribute("RptType_Day", RptInfoSet.RptType_Day); %>
|
|||
|
|
<% request.setAttribute("RptType_Week", RptInfoSet.RptType_Week); %>
|
|||
|
|
<% request.setAttribute("RptType_Tenday", RptInfoSet.RptType_Tenday); %>
|
|||
|
|
<% request.setAttribute("RptType_Month", RptInfoSet.RptType_Month); %>
|
|||
|
|
<% request.setAttribute("RptType_Quarterly", RptInfoSet.RptType_Quarterly); %>
|
|||
|
|
<% request.setAttribute("RptType_HalfYear", RptInfoSet.RptType_HalfYear); %>
|
|||
|
|
<% request.setAttribute("RptType_Year", RptInfoSet.RptType_Year); %>
|
|||
|
|
|
|||
|
|
<%request.setAttribute("TYPE_CATALOGUE", RptInfoSet.TYPE_CATALOGUE);%>
|
|||
|
|
<%request.setAttribute("TYPE_SETTING", RptInfoSet.TYPE_SETTING);%>
|
|||
|
|
|
|||
|
|
<style type="text/css">
|
|||
|
|
.select2-container .select2-selection--single {
|
|||
|
|
height: 34px;
|
|||
|
|
line-height: 34px;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.select2-selection__arrow {
|
|||
|
|
margin-top: 3px;
|
|||
|
|
}
|
|||
|
|
</style>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
var masterId_process = '${id}';//业务Id
|
|||
|
|
var tbName_process = 'TB_Report_RptInfoSetFile'; //数据表
|
|||
|
|
var nameSpace_process = 'Report';//保存文件夹
|
|||
|
|
var status = 'delete';//有删除权限
|
|||
|
|
|
|||
|
|
//弹出目录
|
|||
|
|
var showTree4SelectFun = function () {
|
|||
|
|
$.post(ext.contextPath + '/report/rptInfoSet/showTree4Select.do', {
|
|||
|
|
formId: "subForm",
|
|||
|
|
hiddenId: "pid",
|
|||
|
|
textId: "pname"
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#menu4SelectDiv").html(data);
|
|||
|
|
openModal("menu4SelectModal")
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
var showUser4SelectsFun1 = function () {
|
|||
|
|
var userIds = $("#checkuser").val();
|
|||
|
|
$.post(ext.contextPath + '/user/userForSelect.do', {
|
|||
|
|
formId: "subForm",
|
|||
|
|
hiddenId: "checkuser",
|
|||
|
|
textId: "auditMan1",
|
|||
|
|
userIds: userIds
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#user4SelectDiv").html(data);
|
|||
|
|
openModal("user4SelectModal");
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
//选择可生成报表用户
|
|||
|
|
var showUser4SelectsFun2 = function () {
|
|||
|
|
var userIds = $("#createusers").val();
|
|||
|
|
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {
|
|||
|
|
formId: "subForm",
|
|||
|
|
hiddenId: "createusers",
|
|||
|
|
textId: "auditMan2",
|
|||
|
|
userIds: userIds
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#user4SelectDiv").html(data);
|
|||
|
|
openModal("user4SelectModal");
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
//选择可浏览报表用户
|
|||
|
|
var showUser4SelectsFun3 = function () {
|
|||
|
|
var userIds = $("#browseusers").val();
|
|||
|
|
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {
|
|||
|
|
formId: "subForm",
|
|||
|
|
hiddenId: "browseusers",
|
|||
|
|
textId: "auditMan3",
|
|||
|
|
userIds: userIds
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#user4SelectDiv").html(data);
|
|||
|
|
openModal("user4SelectModal");
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
function dosave() {
|
|||
|
|
$('#subForm').data('bootstrapValidator').updateStatus('pname', 'NOT_VALIDATED', null).validateField('pname');
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
|||
|
|
var value = $("#generateJurisdiction").val();
|
|||
|
|
userOrJob(value, 'createusers', 'generatePosition');
|
|||
|
|
value = $("#browseJurisdiction").val();
|
|||
|
|
userOrJob(value, 'browseusers', 'browsePosition');
|
|||
|
|
$.post(ext.contextPath + "/report/rptInfoSet/dosave.do", $("#subForm").serialize(), function (result) {
|
|||
|
|
if (result.code == 1) {
|
|||
|
|
initTreeView();
|
|||
|
|
//showAlert('s','保存成功');
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', '保存失败');
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$("#subForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
name: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '名称不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
pname: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '上级菜单不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
morder: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '顺序不能为空'
|
|||
|
|
},
|
|||
|
|
regexp: {
|
|||
|
|
regexp: /^[0-9]*$/,
|
|||
|
|
message: '顺序必须为数字'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
var userOrJob = function (value, id1, id2) {
|
|||
|
|
if (value == 0) {
|
|||
|
|
$("#" + id2).val('');
|
|||
|
|
} else if (value == 1) {
|
|||
|
|
$("#" + id1).val('');
|
|||
|
|
} else {
|
|||
|
|
$("#" + id1).val('');
|
|||
|
|
$("#" + id2).val('');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var selectChange = function (value, id1, id2) {
|
|||
|
|
if (value == 0) {
|
|||
|
|
$("#" + id1).show();
|
|||
|
|
$("#" + id2).hide();
|
|||
|
|
} else if (value == 1) {
|
|||
|
|
$("#" + id1).hide();
|
|||
|
|
$("#" + id2).show();
|
|||
|
|
} else {
|
|||
|
|
$("#" + id1).hide();
|
|||
|
|
$("#" + id2).hide();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var showJob4SelectsFun = function (hiddenId, textId) {
|
|||
|
|
var jobIds = $("#" + hiddenId).val();
|
|||
|
|
$.post(ext.contextPath + '/user/jobForSelectByStructure.do', {
|
|||
|
|
formId: "subForm",
|
|||
|
|
hiddenId: hiddenId,
|
|||
|
|
textId: textId,
|
|||
|
|
jobIds: jobIds,
|
|||
|
|
companyId: unitId
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#user4SelectDiv").html(data);
|
|||
|
|
openModal("job4SelectModal");
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
$(function () {
|
|||
|
|
//初始化文件显示
|
|||
|
|
getFileList_process();
|
|||
|
|
|
|||
|
|
//默认不审核
|
|||
|
|
$('#checkDivId').hide();
|
|||
|
|
selectChange('0', 'generate', 'generate_position');
|
|||
|
|
selectChange('0', 'browse', 'browse_position');
|
|||
|
|
$.post(ext.contextPath + "/report/rptInfoSet/getRoleType4Select.do", {}, function (data) {
|
|||
|
|
var select = $("#generateJurisdiction").select2({
|
|||
|
|
data: data,
|
|||
|
|
placeholder: '请选择',//默认文字提示
|
|||
|
|
allowClear: false,//允许清空
|
|||
|
|
escapeMarkup: function (markup) {
|
|||
|
|
return markup;
|
|||
|
|
}, // 自定义格式化防止xss注入
|
|||
|
|
language: "zh-CN",
|
|||
|
|
minimumInputLength: 0,
|
|||
|
|
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
|||
|
|
formatResult: function formatRepo(repo) {
|
|||
|
|
return repo.text;
|
|||
|
|
}, // 函数用来渲染结果
|
|||
|
|
formatSelection: function formatRepoSelection(repo) {
|
|||
|
|
return repo.text;
|
|||
|
|
} // 函数用于呈现当前的选择
|
|||
|
|
});
|
|||
|
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
|||
|
|
select.val('0').trigger("change");
|
|||
|
|
select.on("change", function (e) {
|
|||
|
|
selectChange($("#generateJurisdiction").val(), 'generate', 'generate_position');
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
var select_browse = $("#browseJurisdiction").select2({
|
|||
|
|
data: data,
|
|||
|
|
placeholder: '请选择',//默认文字提示
|
|||
|
|
allowClear: false,//允许清空
|
|||
|
|
escapeMarkup: function (markup) {
|
|||
|
|
return markup;
|
|||
|
|
}, // 自定义格式化防止xss注入
|
|||
|
|
language: "zh-CN",
|
|||
|
|
minimumInputLength: 0,
|
|||
|
|
minimumResultsForSearch: 10,//数据大于10个启用搜索框
|
|||
|
|
formatResult: function formatRepo(repo) {
|
|||
|
|
return repo.text;
|
|||
|
|
}, // 函数用来渲染结果
|
|||
|
|
formatSelection: function formatRepoSelection(repo) {
|
|||
|
|
return repo.text;
|
|||
|
|
} // 函数用于呈现当前的选择
|
|||
|
|
});
|
|||
|
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
|||
|
|
select_browse.val('0').trigger("change");
|
|||
|
|
select_browse.on("change", function (e) {
|
|||
|
|
selectChange($("#browseJurisdiction").val(), 'browse', 'browse_position');
|
|||
|
|
});
|
|||
|
|
}, 'json');
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
//是否审核 不审核则不显示 “可审核报表用户” 框
|
|||
|
|
$('#checkst').on('change', function () {
|
|||
|
|
var val = $(this).val();
|
|||
|
|
if (val == '是') {
|
|||
|
|
$('#checkDivId').show();
|
|||
|
|
}
|
|||
|
|
if (val == '否') {
|
|||
|
|
$('#checkDivId').hide();
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
</script>
|
|||
|
|
<div class="box box-primary">
|
|||
|
|
<div class="box-header with-border">
|
|||
|
|
<h3 class="box-title">新增</h3>
|
|||
|
|
|
|||
|
|
<div class="box-tools pull-right">
|
|||
|
|
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i
|
|||
|
|
class="glyphicon glyphicon-floppy-disk"></i></a>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.box-header -->
|
|||
|
|
<div class="box-body ">
|
|||
|
|
<form class="form-horizontal " id="subForm">
|
|||
|
|
<input id="id" name="id" type="hidden" value="${id}"/>
|
|||
|
|
<input id="unitId" name="unitId" type="hidden" value="${param.unitId}"/>
|
|||
|
|
<input type="hidden" id="type" name="type" value="${TYPE_SETTING}">
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<div id="menu4SelectDiv"></div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">报表名称</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="name" name="name" placeholder="报表名称"
|
|||
|
|
value="${rptInfoSet.name }">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">上级菜单</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="pname" name="pname" placeholder="上级菜单"
|
|||
|
|
onclick="showTree4SelectFun()" value="${pname}">
|
|||
|
|
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">类别</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select id="rpttype" name="rpttype" class="form-control select2">
|
|||
|
|
<option value="${RptType_Day}" selected>日报</option>
|
|||
|
|
<%-- <option value="${RptType_Week}">周报</option>--%>
|
|||
|
|
<%-- <option value="${RptType_Tenday}">旬报</option>--%>
|
|||
|
|
<option value="${RptType_Month}">月报</option>
|
|||
|
|
<option value="${RptType_Quarterly}">季报</option>
|
|||
|
|
<option value="${RptType_HalfYear}">半年报</option>
|
|||
|
|
<option value="${RptType_Year}">年报</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">顺序</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="morder" name="morder" placeholder="顺序"
|
|||
|
|
value="${rptInfoSet.morder}">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">审核</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select id="checkst" name="checkst" class="form-control select2">
|
|||
|
|
<option value="是">是</option>
|
|||
|
|
<option value="否" selected>否</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">自动生成</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select id="createauto" name="createauto" class="form-control select2">
|
|||
|
|
<option value="是" selected>是</option>
|
|||
|
|
<option value="否">否</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group" id="checkDivId">
|
|||
|
|
<label class="col-sm-2 control-label">可审核报表用户</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea class="form-control" rows="2" id="auditMan1" name="auditMan1" placeholder="点击选择" readonly
|
|||
|
|
onclick="showUser4SelectsFun1();" value="${examPlan.memo}"></textarea>
|
|||
|
|
<input id="checkuser" name="checkuser" type="hidden"/>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">生成权限</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select id="generateJurisdiction" name="generateJurisdiction" class="form-control select2"></select>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">浏览权限</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select id="browseJurisdiction" name="browseJurisdiction" class="form-control select2"></select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group" id="generate">
|
|||
|
|
<label class="col-sm-2 control-label">可生成报表用户</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea class="form-control" rows="2" id="auditMan2" name="auditMan2" placeholder="点击选择" readonly
|
|||
|
|
onclick="showUser4SelectsFun2();">${rptInfoSet.createuserName}</textarea>
|
|||
|
|
<input id="createusers" name="createusers" type="hidden" value="${rptInfoSet.createusers}"/>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group" id="generate_position">
|
|||
|
|
<label class="col-sm-2 control-label">可生成报表岗位</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea class="form-control" rows="2" id="generatePositionName" name="generatePositionName"
|
|||
|
|
placeholder="点击选择" readonly
|
|||
|
|
onclick="showJob4SelectsFun('generatePosition','generatePositionName');">${rptInfoSet.generatePositionName}</textarea>
|
|||
|
|
<input id="generatePosition" name="generatePosition" type="hidden"
|
|||
|
|
value="${rptInfoSet.generatePosition}"/>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group" id="browse">
|
|||
|
|
<label class="col-sm-2 control-label">可浏览报表用户</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea class="form-control" rows="2" id="auditMan3" name="auditMan3" placeholder="点击选择" readonly
|
|||
|
|
onclick="showUser4SelectsFun3();">${rptInfoSet.browseuserName}</textarea>
|
|||
|
|
<input id="browseusers" name="browseusers" type="hidden" value="${rptInfoSet.browseusers}"/>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group" id="browse_position">
|
|||
|
|
<label class="col-sm-2 control-label">可浏览报表岗位</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea class="form-control" rows="2" id="browsePositionName" name="browsePositionName" placeholder="点击选择"
|
|||
|
|
readonly
|
|||
|
|
onclick="showJob4SelectsFun('browsePosition','browsePositionName');">${rptInfoSet.browsePositionName}</textarea>
|
|||
|
|
<input id="browsePosition" name="browsePosition" type="hidden"
|
|||
|
|
value="${rptInfoSet.browsePosition}"/>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">备注</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea class="form-control" rows="3" id="memo" name="memo"
|
|||
|
|
placeholder="请输入">${rptInfoSet.memo}</textarea>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
<!-- 文件上传,显示 -->
|
|||
|
|
<%--<div class="form-group" style="margin:8px">
|
|||
|
|
<label class="col-sm-2 control-label"></label>
|
|||
|
|
<button type="button" class="btn btn-default btn-file" onclick="fileinput_process()" id="btn_save"><i
|
|||
|
|
class="fa fa-paperclip"></i>上传文件
|
|||
|
|
</button>
|
|||
|
|
</div>
|
|||
|
|
<div id="fileArea">
|
|||
|
|
|
|||
|
|
</div>--%>
|
|||
|
|
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
</div>
|