<!DOCTYPE html>
|
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:layout="http://www.w3.org/1999/xhtml"
|
xmlns:th="http://www.thymeleaf.org" layout:decorator="MasterPage/Layout.Empty">
|
<head>
|
<meta charset="UTF-8"/>
|
<title>资源申请</title>
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
<link rel="stylesheet"
|
th:href="@{${pubzyWebRoot} + 'BootStrap4/assets/plugins/bootstrap-datepicker/old_datepaker/datepicker.css'}"/>
|
<link rel="stylesheet" href="/css/tagsinput.css"/>
|
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
|
<link rel="stylesheet" th:href="@{${pubzyWebRoot} + 'BootStrap4/expand/plugins/portlet/css/portlet.css'}"/>
|
<link th:href="@{${pubzyWebRoot} + 'media/css/uniform.default.css'}"/>
|
<script th:src="@{${pubzyWebRoot} + 'BootStrap4/expand/plugins/portlet/portlet.js'}"></script>
|
<script th:src="@{${pubzyWebRoot} + 'BootStrap4/assets/plugins/bootstrap-datepicker/old_datepaker/bootstrap-datepicker.js'}"></script>
|
<script th:src="@{${pubzyWebRoot} + 'BootStrap4/assets/plugins/bootstrap-datepicker/old_datepaker/bootstrap-datepicker.zh-CN.min.js'}"></script>
|
<script th:src="@{${pubzyWebRoot} + 'media/js/jquery.form-3.51.0.js'}"></script>
|
<script th:src="@{${pubzyWebRoot} + 'media/js/validation/jquery.validate.min.js'}" type="text/javascript"></script>
|
<script th:src="@{${pubzyWebRoot} + 'media/js/validation/messages_zh.js'}" type="text/javascript"></script>
|
<script th:src="@{${pubzyWebRoot} + 'media/js/validation/additional-methods.min.js'}"
|
type="text/javascript"></script>
|
<script th:src="@{${pubzyWebRoot} + 'media/js/yanzhen.js'}" type="text/javascript"></script>
|
<script src="../../js/validator.js"></script>
|
<style>
|
body {
|
background-color: white;
|
box-sizing: border-box;
|
overflow-x: hidden;
|
}
|
|
.form-control {
|
padding: 0.3rem 0.7rem;
|
height: 34px;
|
display: inline-block;
|
}
|
|
.control-label {
|
padding-top: 0 !important;
|
width: 160px;
|
float: left;
|
line-height: 30px;
|
padding-right: 1.5em;
|
}
|
|
.control-group {
|
margin-bottom: 1em;
|
}
|
|
.controls {
|
margin-left: 160px;
|
}
|
|
.col-sm-3,
|
.col-sm-6, .col-sm-12 {
|
padding-left: 0;
|
padding-right: 0;
|
}
|
|
.fade {
|
display: none;
|
}
|
|
.in.fade {
|
display: block;
|
}
|
|
.control-group error {
|
border-color: #b94a48;
|
}
|
|
#button {
|
color: #fff !important;
|
background-color: #039cfd !important;
|
border-color: #039cfd !important;
|
}
|
|
img {
|
cursor: pointer;
|
}
|
|
.nav-tabs > .active > a, .nav-tabs > .active > a:hover, .nav-tabs > .active > a:focus {
|
color: #555;
|
cursor: default;
|
background-color: #fff;
|
border: 1px solid #ddd;
|
border-bottom-color: transparent;
|
}
|
|
. {
|
display: none;
|
}
|
|
.tags-wrapper {
|
width: 75%;
|
display: inline-block;
|
}
|
|
#tagInput {
|
width: 100%;
|
}
|
|
.layer-tags-wrapper {
|
z-index: 9;
|
}
|
|
td {
|
border: 1px solid #ccc;
|
}
|
|
#tbGKList input {
|
text-align: center;
|
width: 100%;
|
min-height: 30px;
|
}
|
</style>
|
</head>
|
<body>
|
<div layout:fragment="content" style="background-color: #fff;">
|
<div id="div_content" style="width: 100%;">
|
<div class="row-fluid">
|
<div class="span12">
|
<form class="form-horizontal" id="ziyuanshenqingform" xmlns:th="http://www.w3.org/1999/xhtml">
|
<div class="portlet box ltblue">
|
<input type="hidden" id="appid" name="appid" th:value="${resApplyRecommend.appid}"/>
|
<div class="portlet-title">
|
资源申请
|
<div class="caption">
|
<i class="fa fa-reorder"></i>
|
</div>
|
<div class="tools">
|
<a class="collapse" onclick="portlet_body_ShowOrHide(this);"></a>
|
</div>
|
</div>
|
<div class="portlet-body">
|
<div class="row">
|
<div class="col-sm-6">
|
<div class="control-group">
|
<label class="control-label">资源名称<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<input type="text" id="title" name="title" class="form-control col-sm-9"
|
th:value="${title}" readonly="readonly"/>
|
<input type="hidden" id="resourceid" name="resourceid"
|
th:value="${resApplyRecommend.resourceid}"/>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="fa-warning-sign" style="display: none;margin-left:30px;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
<div class="col-sm-6">
|
<div class="control-group">
|
<label class="control-label">申请人<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<input type="text" id="appuser" name="appuser" class="form-control col-sm-9"
|
th:value="${appuser}" readonly="readonly"/>
|
<input type="hidden" id="appuserid" name="appuserid"
|
th:value="${resApplyRecommend.appuserid}"/>
|
<input type="hidden" id="appunitid" name="appunitid"
|
th:value="${resApplyRecommend.appunitid}"/>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="fa-warning-sign" style="display: none;margin-left:30px;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
|
</div>
|
<div class="row">
|
<div class="col-sm-6">
|
<div class="control-group">
|
<label class="control-label">申请类型<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<select id="apptype" name="apptype" class="form-control col-sm-9"
|
required="">
|
<option value="">--请选择--</option>
|
<option th:each="item:${AppStatusList}" th:value="${item.key}"
|
th:text="${item.value}"
|
th:selected="(${resApplyRecommend.apptype}==${item.key})?'true':'false'"/>
|
</select>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="fa-warning-sign" style="display: none;margin-left:30px;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
|
<!-- <div class="col-sm-6" id="sysNameBox" style="display: none">
|
<div class="control-group">
|
<label class="control-label">系统申请</label>
|
<input class="form-control col-sm-9" maxchar="20" placeholder="请输入申请内容"
|
id="textbox" name="sysName" type="text" value="">
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="fa-warning-sign" style="display: none;margin-left:30px;"></i>
|
</span>
|
|
</div>
|
</div>-->
|
|
|
<div class="col-sm-6">
|
<div class="control-group">
|
<label class="control-label">申请日期<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<input th:value="${Appdate}" type="text" id="appdate" name="appdate"
|
readonly="true" class="form-control col-sm-9 date-picker"
|
required=""/>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="fa-warning-sign" style="display: none;margin-left:30px;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
<div class="col-sm-6" id="apptypeBox" style="display: none">
|
<div class="control-group">
|
<label class="control-label">系统申请<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<input id="textbox" name="sysName" class="form-control col-sm-9"
|
placeholder="请输入系统名称" type="text" value="">
|
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="fa-warning-sign" style="display: none;margin-left:30px;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="row">
|
<div class="col-sm-6" id="ZiYuanLeiXin" style="display: none;">
|
<div class="control-group">
|
<label class="control-label">申请方式<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<select id="resusetype" name="resusetype" class="form-control col-sm-9"
|
onchange="ChangeType(this);" required="">
|
<option th:each="item:${ResUseTypeList}" th:value="${item.key}"
|
th:text="${item.value}"
|
th:selected="( (${resApplyRecommend.resusetype} == ''? '在线':${item.key})==${item.key})?'true':'false'"/>
|
</select>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="fa-warning-sign" style="display: none;margin-left:30px;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
<!-- <div class="col-sm-6" id="YinYongShenQing">-->
|
<!-- <div class="control-group">-->
|
<!-- <label class="control-label">应用申请<span style="color: red;">*</span></label>-->
|
<!-- <div class="controls input-icon">-->
|
<!-- <select id="sysid" name="sysid" class="form-control col-sm-9" required="">-->
|
<!-- <option value="">--请选择--</option>-->
|
<!-- <option th:each="item:${shenqin}" th:value="${item.key}"-->
|
<!-- th:text="${item.value}"-->
|
<!-- th:selected="(${resApplyRecommend.sysid}==${item.key})?'true':'false'"/>-->
|
<!-- </select>-->
|
<!-- <span class="input-warning tooltips" data-original-title="">-->
|
<!-- <i class="fa-warning-sign" style="display: none;margin-left:30px;"></i>-->
|
<!-- </span>-->
|
<!-- </div>-->
|
<!-- </div>-->
|
<!-- </div>-->
|
|
<!-- <div class="col-sm-6" id="apptypeBox" style="display: none" >-->
|
<!-- <div class="control-group">-->
|
<!-- <div class="controls input-icon">-->
|
<!-- <input class="form-control col-sm-9" maxchar="20" placeholder="请输入申请内容"-->
|
<!-- id="textbox" name="apptype" type="text" value="">-->
|
<!-- <span class="input-warning tooltips" data-original-title="">-->
|
<!-- <i class="fa-warning-sign" style="display: none;margin-left:30px;"></i>-->
|
<!-- </span>-->
|
<!-- </div>-->
|
<!-- </div>-->
|
<!-- </div>-->
|
|
|
<div class="col-sm-6" id="zaixian">
|
<div class="control-group">
|
<label class="control-label">有效时间</label>
|
<div class="controls input-icon">
|
<!--<input th:value="${EffEndtime}" type="text" id="effendtime" name="effendtime" readonly="true" class="form-control col-sm-9 date-picker" />-->
|
<input type="text" id="effendday" name="effendday"
|
th:value="${resApplyRecommend.effendday}"
|
class="form-control col-sm-2" olnynum="true"/>
|
<span style="margin-left: 2px;" id="appDay">天</span>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="fa-warning-sign" style="display: none;margin-left:30px;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="row">
|
<div class="col-sm-12">
|
<div class="control-group">
|
<label class="control-label">申请理由<span style="color: red;">*</span></label>
|
<div class="controls input-icon">
|
<textarea required="" th:text="${resApplyRecommend.appreason}"
|
name="appreason" class="form-control col-sm-11" id="appreason"
|
rows="3" cols="20" style="height: 70px;" maxchar="500" placeholder="请详细填写申请理由"></textarea>
|
<span class="input-warning tooltips" data-original-title="">
|
<i class="fa-warning-sign" style="display: none;margin-left:30px;"></i>
|
</span>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="row" id="lixian">
|
<!-- <div class="col-sm-12">-->
|
<!-- <div class="control-group">-->
|
<!-- <label class="control-label">离线资源路径</label>-->
|
<!-- <div class="controls input-icon">-->
|
<!-- <textarea th:text="${resApplyRecommend.offlineurl}" name="offlineurl"-->
|
<!-- class="form-control col-sm-11" id="offlineurl" rows="3" cols="20"-->
|
<!-- style="height: 70px;" placeholder="请详细填写申请理由"></textarea>-->
|
<!-- </div>-->
|
<!-- </div>-->
|
<!-- </div>-->
|
</div>
|
</div>
|
<div class="form-actions navbar-fixed-bottom" style="z-index: 0;">
|
<div style="float: left;">
|
<button class="btn btn-primary" id="save" type="button">
|
<i class="fa fa-check"></i> 保存
|
</button>
|
<button th:if="${not #lists.isEmpty(resMainInfoId)}" class="btn btn-danger"
|
id="JCDTDelete" type="button">
|
<i class="fa fa-trash-o"></i> 删除
|
</button>
|
<button class="btn btn-warning" id="close" type="button" onclick="window.close()">
|
<i class="fa fa-remove"></i> 关闭
|
</button>
|
</div>
|
</div>
|
</div>
|
<script th:inline="javascript">
|
//判断resusetype 资源类型
|
$("#apptype").change(function () {
|
var leixin = $('#apptype option:selected').val();
|
if (leixin == 3) {
|
//隐藏 ZiYuanLeiXin
|
//$("#ZiYuanLeiXin").hide();
|
$("#YinYongShenQing").show();
|
//移除必填属性
|
$("#resusetype").removeAttr("required");
|
$("#sysid").attr("required", "true");
|
} else {
|
//隐藏 ZiYuanLeiXin
|
$("#YinYongShenQing").hide();
|
//$("#ZiYuanLeiXin").show();
|
//移除必填属性
|
$("#sysid").removeAttr("required");
|
$("#resusetype").attr("required", "true");
|
}
|
})
|
|
|
function ChangeType(obj) {
|
if ($(obj).val() == "1") {
|
$("#lixian").hide();
|
$("#zaixian").show();
|
} else if ($(obj).val() == "0") {
|
$("#lixian").show();
|
$("#zaixian").hide();
|
}
|
}
|
|
|
$(function () {
|
cheackForm("ziyuanshenqingform");
|
|
if ($("#resusetype").val() == "3") {
|
$("#lixian").hide();
|
$("#zaixian").show();
|
} else if ($("#resusetype").val() == "0") {
|
$("#lixian").show();
|
$("#zaixian").hide();
|
}
|
|
jQuery(".date-picker").datepicker({language: 'zh-CN', format: 'yyyy-mm-dd'});
|
var leixin = $('#apptype option:selected').val();
|
if (leixin == 3) {
|
//隐藏 ZiYuanLeiXin
|
//$("#ZiYuanLeiXin").hide();
|
//移除必填属性
|
$("#resusetype").removeAttr("required");
|
} else {
|
//隐藏 ZiYuanLeiXin
|
$("#YinYongShenQing").hide();
|
//移除必填属性
|
$("#sysid").removeAttr("required");
|
}
|
|
})
|
//
|
// //申请类型为系统申请时,应用申请改为文本框输入
|
// $("#apptype").change(function () {
|
// var leixing = $('#apptype option:selected').val();
|
// if (leixing == "系统申请") {
|
// //隐藏 ZiYuanLeiXin
|
// //$("#ZiYuanLeiXin").hide();
|
// $("#YinYongShenQing").show();
|
// //移除必填属性
|
// $("#resusetype").removeAttr("required");
|
// $("#sysid").attr("required", "true");
|
// } else {
|
// //隐藏 ZiYuanLeiXin
|
// $("#YinYongShenQing").hide();
|
// //$("#ZiYuanLeiXin").show();
|
// //移除必填属性
|
// $("#sysid").removeAttr("required");
|
// $("#resusetype").attr("required", "true");
|
// }
|
// })
|
//
|
|
|
$('#save').on('click', function () {
|
if ($('#ziyuanshenqingform').valid()) {
|
var resourceid = $('#resourceid').val();
|
var leixing = $("#apptype option:selected").val();
|
var effendday = $('#effendday').val();
|
var textbox = $('#textbox').val();
|
if(leixing==0&&effendday>90){
|
//个人申请 不能超过90天
|
alert("个人申请不能超过90天,请修改后提交");
|
return;
|
}
|
if(leixing==3&&!(textbox)){
|
//系统申请必须填写系统
|
alert("系统申请必须填写系统,请修改后院提交");
|
return;
|
}
|
$('#ziyuanshenqingform').ajaxSubmit({
|
url: '/res/resApplyRecommend/insertSelectiveAndUpdate?resourceid=' + resourceid,
|
type: 'post',
|
dataType: 'text',
|
data: {},
|
success: function (data) {
|
debugger;
|
var json = eval('(' + data + ')');
|
if (json.result == "1") {
|
alert("保存成功!");
|
window.opener.location.href = window.opener.location.href;
|
window.close();
|
} else {
|
|
alert("保存失败!");
|
}
|
},
|
error: function (e) {
|
alert(e.message);
|
}
|
});
|
} else {
|
// alert("您输入的信息存在错误,请更正后再提交!");
|
}
|
});
|
|
//申请类型为系统申请时,应用申请改为文本框输入
|
$("#apptype").change(function () {
|
// debugger;
|
var leixing = $("#apptype option:selected").val();
|
switch (leixing) {
|
case "0":
|
$("#appDay").text('天(默认30天,最长90天)');
|
break;
|
case "1":
|
$("#appDay").text('天(默认360天)');
|
break;
|
case "3":
|
$("#appDay").text('天(默认永久)');
|
break;
|
}
|
if (leixing == "3") {
|
$("#apptypeBox").show();
|
$("#YinYongShenQing").show();
|
$("#YinYongShenQing").hide();
|
$("#textbox").attr("name", "sysName")
|
} else {
|
$("#apptypeBox").hide();
|
// $("#YinYongShenQing").hide();
|
// $("#textbox").attr("name", "disabled");
|
}
|
});
|
</script>
|
</form>
|
</div>
|
</div>
|
</div>
|
</div>
|
</body>
|
</html>
|