|
@@ -0,0 +1,405 @@
|
|
|
+<%@ page contentType="text/html;charset=UTF-8" %>
|
|
|
+<%@ include file="/webpage/include/taglib.jsp"%>
|
|
|
+<html>
|
|
|
+<head>
|
|
|
+ <title>项目管理</title>
|
|
|
+ <meta name="decorator" content="default"/>
|
|
|
+ <script type="text/javascript" src="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.js"></script>
|
|
|
+ <script type="text/javascript" src="${ctxStatic}/iCheck/icheck.min.js"></script>
|
|
|
+ <script type="text/javascript" src="${ctxStatic}/layui/layuidown.js"></script>
|
|
|
+ <script src="${ctxStatic}/common/html/js/script.js"></script>
|
|
|
+ <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/layuidown.css"/>
|
|
|
+ <link rel='stylesheet' type="text/css" href="${ctxStatic}/helloweba_editable-select/jquery.editable-select.min.css"/>
|
|
|
+ <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
|
|
|
+ <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
|
|
|
+ <script src="${ctxStatic}/layer-v2.3/layui/xmSelect.js" charset="utf-8"></script>
|
|
|
+ <style>
|
|
|
+ #projectDesc-error{
|
|
|
+ left:0;
|
|
|
+ top:82px;
|
|
|
+ }
|
|
|
+ .layui-layer-dialog{
|
|
|
+ background: red;
|
|
|
+ }
|
|
|
+ td input{
|
|
|
+ margin-left:-10px !important;
|
|
|
+ height: 42px !important;
|
|
|
+ }
|
|
|
+ .disables {
|
|
|
+ pointer-events: none;
|
|
|
+ }
|
|
|
+ .notDisables {
|
|
|
+ pointer-events: all;
|
|
|
+ }
|
|
|
+ .forbidden{
|
|
|
+ background-color:#c2c2c2;
|
|
|
+ }
|
|
|
+
|
|
|
+ .notForbidden{
|
|
|
+ background-color:#3ca2e0;
|
|
|
+ }
|
|
|
+ .spanzj{
|
|
|
+ color: red;
|
|
|
+ font-size: 12px;
|
|
|
+ padding-left: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ #show2 {
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+ <script type="text/javascript">
|
|
|
+ var validateForm;
|
|
|
+ var isMasterClient = true;//是否是委托方
|
|
|
+ var clientCount = 0;
|
|
|
+ function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
|
|
|
+ if(validateForm.form()){
|
|
|
+ $("#inputForm").submit();
|
|
|
+ return true;
|
|
|
+ }else{
|
|
|
+ parent.layer.msg("信息未填写完整!", {icon: 5});
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $(document).ready(function() {
|
|
|
+ layui.use(['form', 'layer', 'laydate'], function () {
|
|
|
+ var form = layui.form;
|
|
|
+ var laydate = layui.laydate;
|
|
|
+
|
|
|
+ form.on('select(personnelTypeFilter)', function (data) {
|
|
|
+ var span=data.value;
|
|
|
+ if(span==1){;
|
|
|
+ $("#userName").val("");
|
|
|
+ $("#show1").show();
|
|
|
+ $("#show2").hide();
|
|
|
+ }else{
|
|
|
+ $("#ccpmUserId").val("");
|
|
|
+ $("#ccpmUserName").val("");
|
|
|
+ $("#show1").hide();
|
|
|
+ $("#show2").show();
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ var personnelType = $("#personnelType").val()
|
|
|
+ console.log('personnelType',personnelType)
|
|
|
+ if(personnelType==1){;
|
|
|
+ $("#userName").val("");
|
|
|
+ $("#show1").show();
|
|
|
+ $("#show2").hide();
|
|
|
+ }else{
|
|
|
+ $("#ccpmUserId").val("");
|
|
|
+ $("#ccpmUserName").val("");
|
|
|
+ $("#show1").hide();
|
|
|
+ $("#show2").show();
|
|
|
+ }
|
|
|
+
|
|
|
+ var radioVal ;
|
|
|
+ validateForm = $("#inputForm").validate({
|
|
|
+ submitHandler: function(form){
|
|
|
+ loading('正在提交,请稍等...');
|
|
|
+ form.submit();
|
|
|
+ },
|
|
|
+ errorContainer: "#messageBox",
|
|
|
+ errorPlacement: function(error, element) {
|
|
|
+ $("#messageBox").text("输入有误,请先更正。");
|
|
|
+ if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
|
|
|
+ error.appendTo(element.parent().parent());
|
|
|
+ } else {
|
|
|
+ error.insertAfter(element);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ function insertTitle(tValue){
|
|
|
+ $("#flagFile").val(false);
|
|
|
+ var files = $("#attachment_file")[0].files; for(var i = 0;i<files.length;i++) { var file = files[i];
|
|
|
+ var attachmentId = $("#id").val();
|
|
|
+ var attachmentFlag = "82";
|
|
|
+ var timestamp=new Date().getTime();
|
|
|
+
|
|
|
+ var storeAs = "projectRecords";
|
|
|
+ var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
|
|
|
+ var divId = "_attachment";
|
|
|
+ $("#addFile"+divId).show();
|
|
|
+ multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,0);}
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ function addFile() {
|
|
|
+ $("#attachment_file").click();
|
|
|
+ }
|
|
|
+
|
|
|
+ function addRow(list, idx, tpl, row){
|
|
|
+ // var idx1 = $("#workClientLinkmanList tr").length;
|
|
|
+ bornTemplete(list, idx, tpl, row, idx);
|
|
|
+ }
|
|
|
+
|
|
|
+ function bornTemplete(list, idx, tpl, row, idx1){
|
|
|
+ $(list).append(Mustache.render(tpl, {
|
|
|
+ idx: idx, delBtn: true, row: row,
|
|
|
+ order:idx1 + 1
|
|
|
+ }));
|
|
|
+ $(list+idx).find("select").each(function(){
|
|
|
+ $(this).val($(this).attr("data-value"));
|
|
|
+ });
|
|
|
+ $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
|
|
|
+ var ss = $(this).attr("data-value").split(',');
|
|
|
+ for (var i=0; i<ss.length; i++){
|
|
|
+ if($(this).val() == ss[i]){
|
|
|
+ $(this).attr("checked","checked");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ function delRow(obj, prefix){
|
|
|
+ var id = $(prefix+"_id");
|
|
|
+ var delFlag = $(prefix+"_delFlag");
|
|
|
+ $(obj).parent().parent().remove();
|
|
|
+ }
|
|
|
+ function this_upload_file_button(id){
|
|
|
+ $("#"+id).click();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ function changeFileName(obj, index) {
|
|
|
+ var file = obj.files[0];
|
|
|
+ if (!file) return;
|
|
|
+
|
|
|
+ var url = URL.createObjectURL(file);
|
|
|
+
|
|
|
+ // 限制文件大小
|
|
|
+ if (file.size > 100 * 1024 * 1024) {
|
|
|
+ layer.msg("请上传100M以内文件!", { icon: 2 });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ var ext = file.name.split('.').pop().toLowerCase();
|
|
|
+ var isImage = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'].includes(ext);
|
|
|
+
|
|
|
+ var spanId = $(obj).attr("id") + 'Name' + index;
|
|
|
+ var fileStr = "";
|
|
|
+
|
|
|
+ if (isImage) {
|
|
|
+ // 图片展示区域
|
|
|
+ fileStr += '<div style="position:relative; display:inline-block;">' +
|
|
|
+ '<img src="' + url + '" width="50" height="50" style="cursor:pointer;" ' +
|
|
|
+ 'onclick="openLayerPreview(\'' + url + '\')" alt="' + file.name + '">' +
|
|
|
+
|
|
|
+ // 删除按钮
|
|
|
+ '<i class="fa fa-times-circle" style="position:absolute; top:-8px; right:-8px; color:red; cursor:pointer;" ' +
|
|
|
+ 'onclick="deleteImage(\'' + spanId + '\', \'' + obj.id + '\')"></i>' +
|
|
|
+ '</div>';
|
|
|
+ } else {
|
|
|
+ // 非图片文件展示名称
|
|
|
+ fileStr += '<span style="display:inline-block;width:24px;height:24px;"></span>' +
|
|
|
+ '<a href="javascript:void(0);" onclick="preview(\'预览\', \'' + url + '\', \'90%\', \'90%\')" ' +
|
|
|
+ 'title="' + file.name + '" style="text-decoration:none;color:#007bff;">' +
|
|
|
+ shortenFileName(file.name, 20) +
|
|
|
+ '</a>' +
|
|
|
+ '<i class="fa fa-times-circle" style="margin-left:5px;color:red;cursor:pointer;" ' +
|
|
|
+ 'onclick="deleteImage(\'' + spanId + '\', \'' + obj.id + '\')"></i>';
|
|
|
+ }
|
|
|
+
|
|
|
+ // 下载按钮
|
|
|
+ /*fileStr += '<a href="javascript:void(0);" title="下载 ' + file.name + '" ' +
|
|
|
+ 'style="color: #28a745; margin-left: 5px; text-decoration: none;" ' +
|
|
|
+ 'onclick="newDownloadFile(\'' + url + '\', \'' + file.name + '\')">' +
|
|
|
+ '<i class="fa fa-download"></i></a>';*/
|
|
|
+
|
|
|
+ $('#' + spanId).html(fileStr);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ function shortenFileName(name, maxLength) {
|
|
|
+ if (name.length <= maxLength) {
|
|
|
+ return name;
|
|
|
+ }
|
|
|
+ return name.substring(0, maxLength) + '...';
|
|
|
+ }
|
|
|
+
|
|
|
+ function openLayerPreview(imgUrl) {
|
|
|
+ var img = new Image();
|
|
|
+ img.onload = function () {
|
|
|
+ var imgWidth = img.width;
|
|
|
+ var imgHeight = img.height;
|
|
|
+
|
|
|
+ // 最大限制,防止太大撑爆屏幕
|
|
|
+ var maxWidth = window.innerWidth * 0.8;
|
|
|
+ var maxHeight = window.innerHeight * 0.8;
|
|
|
+
|
|
|
+ // 缩放比例
|
|
|
+ var ratio = Math.min(maxWidth / imgWidth, maxHeight / imgHeight, 1);
|
|
|
+
|
|
|
+ var finalWidth = imgWidth * ratio;
|
|
|
+ var finalHeight = imgHeight * ratio;
|
|
|
+
|
|
|
+ layui.use('layer', function () {
|
|
|
+ var layer = layui.layer;
|
|
|
+ layer.open({
|
|
|
+ type: 1,
|
|
|
+ title: '图片预览',
|
|
|
+ shadeClose: true,
|
|
|
+ shade: 0.2,
|
|
|
+ area: [finalWidth + 'px', finalHeight + 'px'],
|
|
|
+ content: '<img src="' + imgUrl + '" style="width:100%;height:100%;object-fit:contain;">'
|
|
|
+ });
|
|
|
+ });
|
|
|
+ };
|
|
|
+ img.src = imgUrl;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ function deleteImage(spanId, inputId) {
|
|
|
+ // 1. 清空图片展示区域
|
|
|
+ $('#' + spanId).html('');
|
|
|
+
|
|
|
+ // 2. 清除上传的文件 input 值
|
|
|
+ $('#' + inputId).val('');
|
|
|
+ document.getElementById(inputId).value = ''; // 双保险
|
|
|
+ // 3. 清除隐藏的路径字段(用于提交给后台)
|
|
|
+ $('#' + inputId + 'Path').val('');
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // 下载函数,利用a标签模拟点击下载blob图片
|
|
|
+ function newDownloadFile(blobUrl, fileName) {
|
|
|
+ console.log(1231231)
|
|
|
+ var a = document.createElement('a');
|
|
|
+ a.href = blobUrl;
|
|
|
+ a.download = fileName || 'download.png';
|
|
|
+ document.body.appendChild(a);
|
|
|
+ a.click();
|
|
|
+ document.body.removeChild(a);
|
|
|
+ }
|
|
|
+
|
|
|
+ </script>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+<div class="single-form">
|
|
|
+ <div class="container">
|
|
|
+ <sys:message content="${message}"/>
|
|
|
+ <form:form id="inputForm" modelAttribute="militaryIndustryConfidentiality" action="${ctx}/militaryIndustryConfidentiality/save" enctype="multipart/form-data" method="post" class="form-horizontal layui-form ">
|
|
|
+ <form:hidden path="id"/>
|
|
|
+
|
|
|
+ <div class="form-group layui-row">
|
|
|
+ <div class="form-group-label"><h2>军工保密证书信息</h2></div>
|
|
|
+ <div class="layui-item layui-col-sm6 lw7">
|
|
|
+ <label class="layui-form-label"><span class="require-item">*</span>所在单位:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <form:select lay-filter="personnelTypeFilter" style="color: #000000;" placeholder="请选择" path="personnelType" disabled="true" class="form-control required editable-select layui-input" value="${militaryIndustryConfidentiality.personnelType}">
|
|
|
+ <form:option value=""/>
|
|
|
+ <form:options items="${fns:getMainDictList('militaryIndustryConfidentiality_personnel_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
|
|
|
+ </form:select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <div class="layui-item layui-col-sm6 lw7" id="show1">
|
|
|
+ <label class="layui-form-label"><span class="require-item">*</span>证书归属人:</label>
|
|
|
+ <div class="layui-input-block with-icon">
|
|
|
+ <input class="form-control required layui-input" readonly="readonly" id="ccpmUserName" name="userName" placeholder="请输入证书归属人" value="${militaryIndustryConfidentiality.user.name}">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="layui-item layui-col-sm6 lw7" id="show2">
|
|
|
+ <label class="layui-form-label"><span class="require-item">*</span>证书归属人:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <form:input path="userName" placeholder="请输入证书归属人" htmlEscape="false" readonly="true" class="form-control layui-input "/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="layui-item layui-col-sm6 lw7">
|
|
|
+ <label class="layui-form-label"><span class="require-item">*</span>证书名称:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <form:input path="name" maxlength="255" htmlEscape="false" placeholder="请输入证书名称" readonly="true" class="form-control layui-input required"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="layui-item layui-col-sm6 lw7">
|
|
|
+ <label class="layui-form-label"><span class="require-item">*</span>证书编号:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <form:input path="num" maxlength="255" htmlEscape="false" readonly="true" placeholder="请输入证书编号" class="form-control layui-input required"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="layui-item layui-col-sm6 lw7">
|
|
|
+ <label class="layui-form-label double-line"><span class="require-item">*</span>证书生效日期:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <input class="laydate-icondate form-control layui-input layer-date laydate-icon required" readonly="readonly" id="effectiveDate" name="effectiveDate" placeholder="请选择证书生效日期" value="<fmt:formatDate value="${militaryIndustryConfidentiality.effectiveDate}" pattern="yyyy-MM-dd"/>">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="layui-item layui-col-sm6 lw7">
|
|
|
+ <label class="layui-form-label double-line"><span class="require-item">*</span>证书有效期(年):</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <form:input path="periodOfValidity" placeholder="请输入证书有效期" htmlEscape="false" readonly="true" oninput="this.value = this.value.replace(/[^0-9]/g, '').replace(/^0+/, '')" maxlength="2" class="form-control layui-input required"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="layui-item layui-col-sm6 lw7">
|
|
|
+ <label class="layui-form-label double-line"><span class="require-item">*</span>证书到期日期:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <input class="laydate-icondate form-control layui-input layer-date laydate-icon required" readonly="readonly" id="endDate" name="endDate" placeholder="请选择证书到期日期" value="<fmt:formatDate value="${militaryIndustryConfidentiality.endDate}" pattern="yyyy-MM-dd"/>">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="layui-item layui-col-sm6 lw7">
|
|
|
+ <label class="layui-form-label double-line"><span class="require-item">*</span>保密证书:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <%-- 文件展示区域 --%>
|
|
|
+ <span id="fileName1">
|
|
|
+ <c:if test="${not empty militaryIndustryConfidentiality.filePathStr}">
|
|
|
+ <c:set var="fileNameArr" value="${fn:split(militaryIndustryConfidentiality.filePath, '/')}" />
|
|
|
+ <c:set var="fileName" value="${fileNameArr[fn:length(fileNameArr) - 1]}" />
|
|
|
+ <c:set var="extArr" value="${fn:split(fileName, '.')}" />
|
|
|
+ <c:set var="ext" value="${fn:toLowerCase(extArr[fn:length(extArr) - 1])}" />
|
|
|
+
|
|
|
+ <c:choose>
|
|
|
+ <%-- 图片类型预览 --%>
|
|
|
+ <c:when test="${ext == 'jpg' || ext == 'jpeg' || ext == 'png' || ext == 'gif' || ext == 'bmp' || ext == 'webp'}">
|
|
|
+ <div style="position:relative; display:inline-block;">
|
|
|
+ <img src="${militaryIndustryConfidentiality.filePathStr}" width="50" height="50"
|
|
|
+ style="cursor:pointer;" onclick="openLayerPreview('${militaryIndustryConfidentiality.filePathStr}')"
|
|
|
+ alt="保密证书预览" />
|
|
|
+ </div>
|
|
|
+ </c:when>
|
|
|
+ <%-- 其他文件类型 --%>
|
|
|
+ <c:otherwise>
|
|
|
+ <a class="attention-info" href="javascript:void(0)"
|
|
|
+ style="color: #007bff;" onclick="preview('预览','${militaryIndustryConfidentiality.filePathStr}','90%','90%')">
|
|
|
+ ${militaryIndustryConfidentiality.fileName}
|
|
|
+ </a>
|
|
|
+ </c:otherwise>
|
|
|
+ </c:choose>
|
|
|
+
|
|
|
+ <%-- 下载按钮 --%>
|
|
|
+ <a href="javascript:void(0);"
|
|
|
+ title="下载 ${militaryIndustryConfidentiality.fileName}"
|
|
|
+ style="color: #28a745; margin-left: 5px; text-decoration: none;"
|
|
|
+ onclick="downloadFile('${ctx}', '${militaryIndustryConfidentiality.filePath}', '${militaryIndustryConfidentiality.fileName}')">
|
|
|
+ <i class="fa fa-download"></i>
|
|
|
+ </a>
|
|
|
+ </c:if>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <div class="layui-item layui-col-sm12 lw6 with-textarea">
|
|
|
+ <label class="layui-form-label ">备注:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <form:textarea placeholder="请输入备注" readonly="true" style="background-color: #f1f1f1" path="remarks" htmlEscape="false" rows="4" maxlength="255" class="form-control "/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="form-group layui-row page-end"></div>
|
|
|
+ </form:form>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+</body>
|
|
|
+</html>
|