|
@@ -0,0 +1,835 @@
|
|
|
+<%@ page contentType="text/html;charset=UTF-8" %>
|
|
|
+<%@ include file="/webpage/include/taglib.jsp"%>
|
|
|
+<html>
|
|
|
+<head>
|
|
|
+ <title>合同归档管理</title>
|
|
|
+ <meta name="decorator" content="default"/>
|
|
|
+ <link href="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.css" rel="stylesheet" />
|
|
|
+ <style>
|
|
|
+ label.error:nth-child(2){
|
|
|
+ top:40px;
|
|
|
+ left:0;
|
|
|
+ }
|
|
|
+ .layui-table th{
|
|
|
+ font-size: 14px;
|
|
|
+ /*表头内容居中显示*/
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .layui-table td{
|
|
|
+ /*表头内容居中显示*/
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+ span{
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+ <script type="text/javascript">
|
|
|
+ var validateForm;
|
|
|
+ function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
|
|
|
+ if(validateForm.form()){
|
|
|
+ var projectId = '${project.id}';
|
|
|
+ var leng = $("#file_attachment tr").length;
|
|
|
+ var boolFlag = true;
|
|
|
+ for(var i=0; i<leng; i++) {
|
|
|
+ var numberStr = $("#file_attachment tr").eq(i).find("td:first").html();
|
|
|
+ var second = $("#file_attachment tr").eq(i).find("td:eq(1)").html();
|
|
|
+ if(second == 1){
|
|
|
+ if(numberStr != undefined && numberStr !=null && numberStr !=''){
|
|
|
+ $.ajax({
|
|
|
+ type: 'post',
|
|
|
+ url:'${ctx}/projectAccessoryRelation/projectAccessoryRelation/getAttachmentCount',
|
|
|
+ data: {"attachmentId":numberStr,"projectId":projectId},
|
|
|
+ dataType: "json",
|
|
|
+ async: false
|
|
|
+ }).success(function (result) {
|
|
|
+ if(result == 0){
|
|
|
+ boolFlag = false;
|
|
|
+ top.layer.msg("请上传成果文件!", {icon: 0});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }).error(function () {
|
|
|
+ top.layer.msg("文件载入失败!");
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(boolFlag){
|
|
|
+ var gistdata = $("#file_gistdata tr").length;
|
|
|
+ for(var i=0; i<gistdata; i++) {
|
|
|
+ var numberStr = $("#file_gistdata tr").eq(i).find("td:first").html();
|
|
|
+ var second = $("#file_gistdata tr").eq(i).find("td:eq(1)").html();
|
|
|
+ if(second == 1){
|
|
|
+ if(numberStr != undefined && numberStr !=null && numberStr !=''){
|
|
|
+ $.ajax({
|
|
|
+ type: 'post',
|
|
|
+ url:'${ctx}/projectAccessoryRelation/projectAccessoryRelation/getAttachmentCount',
|
|
|
+ data: {"attachmentId":numberStr,"projectId":projectId},
|
|
|
+ dataType: "json",
|
|
|
+ async: false
|
|
|
+ }).success(function (result) {
|
|
|
+ if(result == 0){
|
|
|
+ boolFlag = false;
|
|
|
+ top.layer.msg("请上传依据性文件!", {icon: 0});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }).error(function () {
|
|
|
+ top.layer.msg("文件载入失败!");
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(boolFlag){
|
|
|
+ var other = $("#file_other tr").length;
|
|
|
+ for(var i=0; i<other; i++) {
|
|
|
+ var numberStr = $("#file_other tr").eq(i).find("td:first").html();
|
|
|
+ var second = $("#file_other tr").eq(i).find("td:eq(1)").html();
|
|
|
+ if(second == 1){
|
|
|
+ if(numberStr != undefined && numberStr !=null && numberStr !=''){
|
|
|
+ $.ajax({
|
|
|
+ type: 'post',
|
|
|
+ url:'${ctx}/projectAccessoryRelation/projectAccessoryRelation/getAttachmentCount',
|
|
|
+ data: {"attachmentId":numberStr,"projectId":projectId},
|
|
|
+ dataType: "json",
|
|
|
+ async: false
|
|
|
+ }).success(function (result) {
|
|
|
+ if(result == 0){
|
|
|
+ boolFlag = false;
|
|
|
+ top.layer.msg("请上传其他文件!", {icon: 0});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }).error(function () {
|
|
|
+ top.layer.msg("文件载入失败!");
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(boolFlag){
|
|
|
+ if(obj == 2){
|
|
|
+ //$("#inputForm").attr("action","${ctx}/projectcontentinfo/projectReportRecord/store");
|
|
|
+ $("#inputForm").attr("action","${ctx}/ruralProject/ruralProjectMessage/holdSaveRecord");
|
|
|
+ }else{
|
|
|
+ $("#inputForm").attr("action","${ctx}/ruralProject/ruralProjectMessage/saveRecord");
|
|
|
+ }
|
|
|
+ $("#inputForm").submit();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ parent.layer.msg("信息未填写完整!", {icon: 5});
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+
|
|
|
+ }
|
|
|
+ $(document).ready(function() {
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $("#attachment_btn").click(function () {
|
|
|
+ $("#attachment_file").click();
|
|
|
+ });
|
|
|
+
|
|
|
+ });
|
|
|
+ <%--function insertTitle(tValue){--%>
|
|
|
+ <%-- var list = "${projectReportRecord.workAttachments}";--%>
|
|
|
+ <%-- var size = (list.split('url')).length-1;--%>
|
|
|
+ <%-- var files = $("#attachment_file")[0].files; for(var i = 0;i<files.length;i++) { var file = files[i];--%>
|
|
|
+ <%-- var attachmentId = "";--%>
|
|
|
+ <%-- var attachmentFlag = "99";--%>
|
|
|
+ <%-- console.log(file);--%>
|
|
|
+ <%-- 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,size);}--%>
|
|
|
+ <%--}--%>
|
|
|
+
|
|
|
+ function setValuee(obj){
|
|
|
+ $("#reportId").val(obj.id);
|
|
|
+ $("#reportnumber").val(obj.number);
|
|
|
+ $("#reportName").val(obj.name);
|
|
|
+ $("#reportDate").val(obj.reportDate);
|
|
|
+ $("#contractNum").val(obj.contractNum);
|
|
|
+ $("#contractName").val(obj.contractName);
|
|
|
+ $("#clientName").val(obj.clientName);
|
|
|
+ $("#projectName").val(obj.projectName);
|
|
|
+ $("#projectNum").val(obj.projectNum);
|
|
|
+ $.ajax({
|
|
|
+ type:'post',
|
|
|
+ url:'${ctx}/projectcontentinfo/projectReportRecord/getNumber',
|
|
|
+ data:{
|
|
|
+ "reportId":obj.id
|
|
|
+ },
|
|
|
+ success:function(data){
|
|
|
+ var numberCount = data.numberCount;
|
|
|
+ $("#recordNum").val(obj.number+"-"+numberCount);
|
|
|
+ $("#numberCount").val(numberCount);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+<div class="single-form">
|
|
|
+ <div class="tapfixed">
|
|
|
+ <div class="list-form-tab contentShadow shadowLTR" id="tabDiv">
|
|
|
+ <ul class="list-tabs" >
|
|
|
+ <li><a href="${ctx}/ruralProject/ruralProjectView/view?id=${projectRecords.id}">项目详情</a></li>
|
|
|
+ <li><a href="${ctx}/ruralProject/ruralProjectView/list?parentProId=${projectRecords.id}&projectType=${projectRecords.projectType}">子项目列表</a></li>
|
|
|
+ <%-- <c:if test="${projectRecords.workContractInfo.id!=''}">--%>
|
|
|
+ <li ><a href="${ctx}/ruralProject/ruralProjectView/workContractView?id=${projectRecords.workContractInfo.id}&projectId=${projectRecords.id}">客户合同详情</a></li>
|
|
|
+ <%-- </c:if>--%>
|
|
|
+ <li><a href="${ctx}/ruralProject/ruralProjectView/planView?id=${projectRecords.id}">项目计划信息</a></li>
|
|
|
+ <%-- <c:if test="${reportedId!=null}">--%>
|
|
|
+ <li><a href="${ctx}/ruralProject/ruralProjectView/getReportedView?projectId=${projectRecords.id}&id=${reportedId}">上报信息</a></li>
|
|
|
+ <%-- </c:if>--%>
|
|
|
+ <%-- <c:if test="${flagProjectReportData.id!=null}">--%>
|
|
|
+ <li><a href="${ctx}/ruralProject/ruralProjectView/modify?projectId=${projectRecords.id}">报告信息</a></li>
|
|
|
+ <%-- </c:if>--%>
|
|
|
+ <li><a href="${ctx}/ruralProject/ruralProjectView/getAccessoryView?id=${projectRecords.id}">档案信息</a></li>
|
|
|
+ <li class="active"><a href="${ctx}/ruralProject/ruralProjectView/formRecordModify?id=${projectRecords.id}">线上归档信息</a></li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <c:if test="${projectReportRecord.id==null}">
|
|
|
+ <div class="topMar">
|
|
|
+ <h2>暂无归档信息</h2>
|
|
|
+ </div>
|
|
|
+ </c:if>
|
|
|
+ <c:if test="${projectReportRecord.id!=null}">
|
|
|
+ <div class="container">
|
|
|
+ <form:form id="inputForm" modelAttribute="projectReportRecord" method="post" class="form-horizontal">
|
|
|
+ <form:hidden path="id"/>
|
|
|
+ <form:hidden path="view"/>
|
|
|
+ <form:hidden path="numberCount"/>
|
|
|
+ <form:hidden id="reportId" path="report.id"/>
|
|
|
+ <form:hidden path="report.name"/>
|
|
|
+ <form:hidden path="report.project.id"/>
|
|
|
+ <input type="hidden" name="saveAuditFlag" value="1">
|
|
|
+ <div class="form-group layui-row first lw12">
|
|
|
+ <div class="form-group-label"><h2>基本信息</h2></div>
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
+ <label class="layui-form-label"><span class="require-item">*</span>报告号:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <form:input id="reportNumber" path="report.number" htmlEscape="false" readonly="true" class="form-control layui-input required"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <%--<div class="layui-item layui-col-sm6">
|
|
|
+ <label class="layui-form-label"><span class="require-item">*</span>归档申请编号:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <div class="input-group">
|
|
|
+ <form:input id="recordNum" path="recordNum" htmlEscape="false" readonly="true" class="form-control layui-input required"/>
|
|
|
+ <span class="input-group-btn">
|
|
|
+ <label class="form-status">
|
|
|
+ <c:choose>
|
|
|
+ <c:when test="${not empty projectReportRecord.status}">${fns:getDictLabel(projectReportRecord.status, 'audit_record_state', '')}
|
|
|
+ </c:when>
|
|
|
+ <c:otherwise>新添</c:otherwise>
|
|
|
+ </c:choose></label>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>--%>
|
|
|
+ <%--<div class="layui-item layui-col-sm6">
|
|
|
+ <label class="layui-form-label"><span class="require-item">*</span>签字造价师一:</label>
|
|
|
+ <div class="layui-input-block with-icon">
|
|
|
+ <sys:treeselect id="signCostOne" name="signCostOne.id" value="${projectReportRecord.signCostOne.id}" labelName="signCostOne.name" labelValue="${projectReportRecord.signCostOne.name}"
|
|
|
+ title="签字造价师一" url="/sys/office/treeDataAll?type=3" cssClass="form-control layui-input required" allowClear="true" notAllowSelectParent="true"/></div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
+ <label class="layui-form-label"><span class="require-item">*</span>签字造价师二:</label>
|
|
|
+ <div class="layui-input-block with-icon">
|
|
|
+ <sys:treeselect id="signCostTwo" name="signCostTwo.id" value="${projectReportRecord.signCostTwo.id}" labelName="signCostTwo.name" labelValue="${projectReportRecord.signCostTwo.name}"
|
|
|
+ title="签字造价师二" url="/sys/office/treeDataAll?type=3" cssClass="form-control layui-input required" allowClear="true" notAllowSelectParent="true"/>
|
|
|
+ </div>
|
|
|
+ </div>--%>
|
|
|
+ <%--<div class="layui-item layui-col-sm6">
|
|
|
+ <label class="layui-form-label"><span class="require-item">*</span>报告名称:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <form:input id="reportName" path="report.name" htmlEscape="false" readonly="true" class="form-control layui-input required"/>
|
|
|
+ </div>
|
|
|
+ </div>--%>
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
+ <label class="layui-form-label"><span class="require-item">*</span>报告日期:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <input id="reportDate" name="report.reportDate" htmlEscape="false" readonly="true" class="form-control layui-input required" value="<fmt:formatDate value="${projectReportRecord.report.reportDate}" pattern="yyyy-MM-dd"/>"/>
|
|
|
+ <%--<input class="laydate-icondate form-control layui-input layer-date laydate-icon" id="createDate" name="createDate" value="<fmt:formatDate value="${projectReportRecord.createDate}" pattern="yyyy-MM-dd"/>">--%>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
+ <label class="layui-form-label">合同编号:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <form:input id="contractNum" path="contractNum" htmlEscape="false" readonly="true" class="form-control layui-input"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
+ <label class="layui-form-label">合同名称:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <form:input id="contractName" path="contractName" htmlEscape="false" readonly="true" class="form-control layui-input"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
+ <label class="layui-form-label">委托方:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <form:input id="clientName" path="clientName" htmlEscape="false" readonly="true" class="form-control layui-input"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
+ <label class="layui-form-label">项目编号:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <form:input id="projectNum" path="projectNum" htmlEscape="false" readonly="true" class="form-control layui-input"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
+ <label class="layui-form-label"><span class="require-item">*</span>项目名称:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <form:input id="projectName" path="projectName" htmlEscape="false" readonly="true" class="form-control layui-input required"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
+ <label class="layui-form-label"><span class="require-item">*</span>归档申请人:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <form:input id="cBName" path="createBy.name" htmlEscape="false" readonly="true" class="form-control layui-input required"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <%--<div class="layui-item layui-col-sm6">
|
|
|
+ <label class="layui-form-label"><span class="require-item">*</span>申请日期:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <input id="createDate" name="createDate" htmlEscape="false" readonly="true" class="laydate-icondate form-control layer-date required layui-input laydate-icon"
|
|
|
+ value="<fmt:formatDate value="${projectReportRecord.createDate}" pattern="yyyy-MM-dd"/>"/>
|
|
|
+ </div>
|
|
|
+ </div>--%>
|
|
|
+ <%--<div class="layui-item layui-col-sm6">
|
|
|
+ <label class="layui-form-label">档案号:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <form:input path="fileNum" htmlEscape="false" class="form-control layui-input"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
+ <label class="layui-form-label">档案名称:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <form:input path="name" htmlEscape="false" class="form-control layui-input"/>
|
|
|
+ </div>
|
|
|
+ </div>--%>
|
|
|
+ <div class="layui-item layui-col-sm6">
|
|
|
+ <label class="layui-form-label">归档时间:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <input id="recordDate" name="recordDate" htmlEscape="false" readonly="true" class="form-control layui-input" value="<fmt:formatDate value="${projectReportRecord.createDate}" pattern="yyyy-MM-dd"/>"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <%--<div class="layui-item layui-col-sm6">
|
|
|
+ <label class="layui-form-label">归档完成日期:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <input id="accomplishDate" name="accomplishDate" htmlEscape="false" readonly="true" class="form-control layui-input"
|
|
|
+ value="<fmt:formatDate value="${projectReportRecord.accomplishDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
|
|
|
+ </div>
|
|
|
+ </div>--%>
|
|
|
+ <div class="layui-item layui-col-sm12 with-textarea">
|
|
|
+ <label class="layui-form-label">说明:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <form:textarea readonly="true" path="remarks" htmlEscape="false" rows="4" maxLength="255" class="form-control "/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-group layui-row">
|
|
|
+ <div class="form-group-label"><h2>审批流程</h2></div>
|
|
|
+ <div class="layui-item layui-col-xs12 form-table-container" >
|
|
|
+ <act:flowChart procInsId="${projectReportRecord.processInstanceId}"/>
|
|
|
+ <act:histoicFlow procInsId="${projectReportRecord.processInstanceId}"/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="form-group layui-row page-end"></div>
|
|
|
+ </form:form>
|
|
|
+ </div>
|
|
|
+ </c:if>
|
|
|
+</div>
|
|
|
+<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
|
|
|
+<script src="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.js" charset="utf-8"></script>
|
|
|
+<script>
|
|
|
+ function openBill2(title,url,width,height,target,formId,tableId,obj){
|
|
|
+ var rows = $(this).parent().prevAll().length + 1;
|
|
|
+ var tbody="#"+$(obj).parent().parent().parent().parent().attr("id");
|
|
|
+ var trname=$(obj).parent().parent().parent().attr("id");
|
|
|
+ var filetr="."+$(obj).parent().parent().parent().attr("id");
|
|
|
+ var frameIndex = parent.layer.getFrameIndex(window.name);
|
|
|
+ var urls = url+"&index="+frameIndex;
|
|
|
+ if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
|
|
|
+ width='auto';
|
|
|
+ height='auto';
|
|
|
+ }else{//如果是PC端,根据用户设置的width和height显示。
|
|
|
+
|
|
|
+ }
|
|
|
+ top.layer.open({
|
|
|
+ type: 2,
|
|
|
+ area: [width, height],
|
|
|
+ title: title,
|
|
|
+ skin:"two-btns",
|
|
|
+ maxmin: false, //开启最大化最小化按钮
|
|
|
+ content: urls ,
|
|
|
+ btn: ['确定','关闭'],
|
|
|
+ yes: function(index, layero){
|
|
|
+ var body = top.layer.getChildFrame('body', index);
|
|
|
+ var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
|
|
|
+ var inputForm = body.find('#inputForm');
|
|
|
+ var top_iframe;
|
|
|
+ if(target){
|
|
|
+ top_iframe = target;//如果指定了iframe,则在改frame中跳转
|
|
|
+ }else{
|
|
|
+ top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
|
|
|
+ }
|
|
|
+ inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
|
|
|
+ inputForm.attr("action","${ctx}/projectAccessory/projectAccessory/saveWorkAttachment");//表单提交成功后,从服务器返回的url在当前tab中展示
|
|
|
+ var $document = iframeWin.contentWindow.document;
|
|
|
+ var files=iframeWin.contentWindow.showfile()
|
|
|
+ var xias=iframeWin.contentWindow.showfileXia()
|
|
|
+ // if(files.length!=0){
|
|
|
+ // // var name=filetr
|
|
|
+ // $(filetr).remove();
|
|
|
+ // for (var i=0;i<files.length;i++){
|
|
|
+ // $(tbody).append(
|
|
|
+ // "<tr class='"+trname+"'>" +
|
|
|
+ // "<td></td>" +
|
|
|
+ // "<td>" +
|
|
|
+ // files[i]+
|
|
|
+ // "</td>" +
|
|
|
+ // "<td>" +
|
|
|
+ // "</td>" +
|
|
|
+ // "</tr>"
|
|
|
+ // )
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ formSubmit2($document,formId,index,tableId);
|
|
|
+
|
|
|
+ },
|
|
|
+ cancel: function(index){
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ function formSubmit2($document,inputForm,index,tableId){
|
|
|
+
|
|
|
+ var validateForm = $($document.getElementById(inputForm)).validate({
|
|
|
+ submitHandler: function(form){
|
|
|
+ loading('正在提交,请稍等...');
|
|
|
+ form.submit();
|
|
|
+ },
|
|
|
+ errorContainer: "#messageBox",
|
|
|
+ errorPlacement: function(error, element) {
|
|
|
+ $($document.getElementById("#messageBox")).text("输入有误,请先更正。");
|
|
|
+ if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
|
|
|
+ error.appendTo(element.parent().parent());
|
|
|
+ } else {
|
|
|
+ error.insertAfter(element);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if(validateForm.form()){
|
|
|
+ $($document.getElementById(inputForm)).ajaxSubmit({
|
|
|
+ success:function(data) {
|
|
|
+ var d = data;
|
|
|
+ //输出提示信息
|
|
|
+ if(d.str.length>0){
|
|
|
+ parent.layer.msg(d.str,{icon:1});
|
|
|
+ }
|
|
|
+ $("#"+tableId).load(location.href + " #"+tableId);
|
|
|
+ //关闭当前页
|
|
|
+ top.layer.close(index)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //新增行方法
|
|
|
+ var fileAttachmentTpl = $("#fileAttachmentTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
|
|
|
+ var gistdataTpl = $("#gistdataTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
|
|
|
+ var otherTpl = $("#otherTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
|
|
|
+
|
|
|
+ function formAttachment(title,url,width,height,target,formId,divId){
|
|
|
+ var rows = $(this).parent().prevAll().length + 1;
|
|
|
+ var frameIndex = parent.layer.getFrameIndex(window.name);
|
|
|
+ var urls = url;
|
|
|
+ if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
|
|
|
+ width='auto';
|
|
|
+ height='auto';
|
|
|
+ }else{//如果是PC端,根据用户设置的width和height显示。
|
|
|
+
|
|
|
+ }
|
|
|
+ top.layer.open({
|
|
|
+ type: 2,
|
|
|
+ area: [width, height],
|
|
|
+ title: title,
|
|
|
+ skin:"two-btns",
|
|
|
+ maxmin: false, //开启最大化最小化按钮
|
|
|
+ content: urls ,
|
|
|
+ btn: ['确定','关闭'],
|
|
|
+ yes: function(index, layero){
|
|
|
+ var body = top.layer.getChildFrame('body', index);
|
|
|
+ var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
|
|
|
+ var inputForm = body.find('#inputForm');
|
|
|
+ var top_iframe;
|
|
|
+ inputForm.attr("action","${ctx}/projectTemplate/projectTemplate/getProjectTemplateInfo");//表单提交成功后,从服务器返回的url在当前tab中展示
|
|
|
+ var $document = iframeWin.contentWindow.document;
|
|
|
+ formSubmitAjax($document,formId,index,divId);
|
|
|
+
|
|
|
+ },
|
|
|
+ cancel: function(index){
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ function formSubmitAjax($document,inputForm,index,divId){
|
|
|
+ var validateForm = $($document.getElementById(inputForm)).validate({
|
|
|
+ submitHandler: function(form){
|
|
|
+ loading('正在提交,请稍等...');
|
|
|
+ form.submit();
|
|
|
+ },
|
|
|
+ errorContainer: "#messageBox",
|
|
|
+ errorPlacement: function(error, element) {
|
|
|
+ $($document.getElementById("#messageBox")).text("输入有误,请先更正。");
|
|
|
+ if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
|
|
|
+ error.appendTo(element.parent().parent());
|
|
|
+ } else {
|
|
|
+ error.insertAfter(element);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if(validateForm.form()){
|
|
|
+ $($document.getElementById(inputForm)).ajaxSubmit({
|
|
|
+ success:function(data) {
|
|
|
+ if(!data.success){
|
|
|
+ top.layer.msg("保存依据资料信息异常!",{icon:2});
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var idx = ''
|
|
|
+ if(divId == 'file_attachment'){
|
|
|
+ idx = $("#file_attachment tr").length;
|
|
|
+ addRowBaseData("#file_attachment",idx,fileAttachmentTpl,data.body.projectAccessoryInfo);
|
|
|
+ }else if(divId == 'file_gistdata'){
|
|
|
+ idx = $("#file_gistdata tr").length;
|
|
|
+ addRowBaseData("#file_gistdata",idx,gistdataTpl,data.body.projectAccessoryInfo);
|
|
|
+ }else if(divId == 'file_other'){
|
|
|
+ idx = $("#file_other tr").length;
|
|
|
+ addRowBaseData("#file_other",idx,otherTpl,data.body.projectAccessoryInfo);
|
|
|
+ }
|
|
|
+ parent.layer.msg(data.msg,{icon:1});
|
|
|
+ top.layer.close(index)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ function hasInArr(id,idArr) {
|
|
|
+ for(var i=0;i<idArr.length;i++){
|
|
|
+ if(id==$(idArr[i]).val()){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ function existBaseData(id,length) {
|
|
|
+ for (var i=0;i<length;i++) {
|
|
|
+ var val = $('#file_attachment'+i+'_id').val();
|
|
|
+ if(id==val){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ function addRowBaseData(list, idx, tpl, row){
|
|
|
+ bornTemplete(list, idx, tpl, row, idx);
|
|
|
+ }
|
|
|
+
|
|
|
+ function bornTemplete(list, idx, tpl, row, idx1){
|
|
|
+ var idx1 = '';
|
|
|
+ if(list == 'file_attachment'){
|
|
|
+ idx1 = $("#file_attachment tr").length +1;
|
|
|
+ }else if(list == 'file_gistdata'){
|
|
|
+ idx1 = $("#file_gistdata tr").length +1;
|
|
|
+ }else if(list == 'file_other'){
|
|
|
+ idx1 = $("#file_other tr").length +1;
|
|
|
+ }
|
|
|
+
|
|
|
+ $(list).append(Mustache.render(tpl, {
|
|
|
+ idx: idx, delBtn: true, row: row,
|
|
|
+ order:idx1 + 1, idx1:idx1
|
|
|
+ }));
|
|
|
+ $(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 delRowBaseData(obj, prefix,userId){
|
|
|
+ var id = $(prefix+"_id").val();
|
|
|
+ var currentUser = '${fns:getUser().id}';
|
|
|
+ var contentId = '${projectcontentinfo.projectContentData.id}';
|
|
|
+ console.log(contentId);
|
|
|
+ var condition = "${flag}";
|
|
|
+ $.ajax({
|
|
|
+ type:"post",
|
|
|
+ url:'${ctx}/projectcontentinfo/projectContentData/ajaxdelete',
|
|
|
+ data:{"contentId":contentId,"basedId":id,"condition":condition},
|
|
|
+ dataType:"json",
|
|
|
+ success:function(data){
|
|
|
+ if(data.success) {
|
|
|
+ if("according" == condition || "completion" == condition || "early" == condition || "claim" == condition || "design" == condition || "visa" == condition || "interim" == condition || "distribution" == condition || "material" == condition || "armor" == condition ){
|
|
|
+ $(obj).parent().parent().remove();
|
|
|
+ }else{
|
|
|
+ $(obj).parent().parent().remove();
|
|
|
+ }
|
|
|
+ if(data.body.inuse){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (currentUser == userId) {
|
|
|
+ confirmDelete('是否同步删除资料库的文件?','${ctx}/projectcontentinfo/projectcontentinfo/delete?infoId='+id+'&id=${projectcontentinfo.id}&type=1');
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ top.layer.msg("删除依据资料失败!", {icon: 0});
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ function delBaseData(obj, prefix,userId){
|
|
|
+ var id = $(prefix+"_id").val();
|
|
|
+ var currentUser = '${fns:getUser().id}';
|
|
|
+ var contentId = '${projectcontentinfo.projectContentData.id}';
|
|
|
+ console.log(contentId);
|
|
|
+ var condition = "${flag}";
|
|
|
+ $.ajax({
|
|
|
+ type:"post",
|
|
|
+ url:'${ctx}/projectcontentinfo/projectContentData/ajaxdelete',
|
|
|
+ data:{"contentId":contentId,"basedId":id,"condition":condition},
|
|
|
+ dataType:"json",
|
|
|
+ success:function(data){
|
|
|
+ if(data.success) {
|
|
|
+ if("according" == condition || "completion" == condition || "early" == condition || "claim" == condition || "design" == condition || "visa" == condition || "interim" == condition || "distribution" == condition || "material" == condition || "armor" == condition ){
|
|
|
+ $(obj).parent().parent().parent().remove();
|
|
|
+ }else{
|
|
|
+ $(obj).parent().parent().remove();
|
|
|
+ }
|
|
|
+ if(data.body.inuse){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (currentUser == userId) {
|
|
|
+ confirmDelete('是否同步删除资料库的文件?','${ctx}/projectcontentinfo/projectcontentinfo/delete?infoId='+id+'&id=${projectcontentinfo.id}&type=1');
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ top.layer.msg("删除依据资料失败!", {icon: 0});
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ function listTr(obj){
|
|
|
+ var name=$(obj).attr("id");
|
|
|
+ var tiao="."+name;
|
|
|
+ var span=$(obj).find("td").eq(2);
|
|
|
+ // var ss=$(span).val().split(" ")[4];
|
|
|
+ $(span).toggle(function () {
|
|
|
+ $(tiao).hide();
|
|
|
+ $(span).find("span").attr("class","treeTable-icon")
|
|
|
+ },function () {
|
|
|
+ $(tiao).show();
|
|
|
+ $(span).find("span").attr("class","treeTable-icon open")
|
|
|
+ });
|
|
|
+ }
|
|
|
+ function confirmDelete(mess, href){
|
|
|
+ top.layer.confirm(mess, {icon: 3, title:'系统提示'}, function(index){
|
|
|
+ //do something
|
|
|
+ if (typeof href == 'function') {
|
|
|
+ href();
|
|
|
+ }else{
|
|
|
+ $.ajax({
|
|
|
+ url:href,
|
|
|
+ type:"post",
|
|
|
+ success:function(data){
|
|
|
+ if(data.success){
|
|
|
+ top.layer.msg("删除依据资料成功!", {icon: 0});
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ top.layer.close(index);
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+</script>
|
|
|
+<%--<script>
|
|
|
+ /*使用模块加载的方式 加载文件*/
|
|
|
+ layui.config({
|
|
|
+ base: '${ctx}/resoueces/css/layui/module/'
|
|
|
+ }).extend({
|
|
|
+ treetable: 'treetable-lay/treetable'
|
|
|
+ }).use(['layer', 'table', 'treetable'], function () {
|
|
|
+ var $ = layui.jquery;
|
|
|
+ var table = layui.table;
|
|
|
+ var layer = layui.layer;
|
|
|
+ var treetable = layui.treetable;
|
|
|
+
|
|
|
+ // 渲染表格
|
|
|
+ window.renderTable = function () {//树桩表格参考文档:https://gitee.com/whvse/treetable-lay
|
|
|
+ layer.load(2);
|
|
|
+ treetable.render({
|
|
|
+ treeColIndex: 1,//树形图标显示在第几列
|
|
|
+ treeSpid: 0,//最上级的父级id
|
|
|
+ treeIdName: 'permissionId',//id字段的名称
|
|
|
+ treePidName: 'pid',//pid字段的名称
|
|
|
+ treeDefaultClose: false,//是否默认折叠
|
|
|
+ treeLinkage: true,//父级展开时是否自动展开所有子级
|
|
|
+ elem: '#permissionTable',
|
|
|
+ url: '${ctx}/projectAccessory/projectAccessory/getProjectAccessoryTreeData?projectId=${project.id}',
|
|
|
+ page: false,
|
|
|
+ cols: [[
|
|
|
+ {type: 'numbers', title: '编号' ,width:80},
|
|
|
+ {field: 'type', title: '电子件名称'},
|
|
|
+ {field: 'workAttachments',title: '附件',templet:function(d){
|
|
|
+ if(d.pid !='0'){
|
|
|
+ if(null == d.workAttachments || '' == d.workAttachments){
|
|
|
+ return "<span style=\"color:red\" title='无附件'>无附件</span>";
|
|
|
+ }else{
|
|
|
+ var html = '';
|
|
|
+ for (var x in d.workAttachments) {
|
|
|
+ html += "<div style='display:inline;float:left;'><a style='width:100px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;' class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"preview('预览','"+d.workAttachments[x].url+"','90%','90%')\" title='"+d.workAttachments[x].attachmentName+"'>"+d.workAttachments[x].attachmentName+"</a></div>"
|
|
|
+ if(x != d.workAttachments.length-1){
|
|
|
+ html += "<div style='display:inline;float:left;'> ; </div>";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return html;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ }},
|
|
|
+ {templet: complain, title: '附件管理',width:80}
|
|
|
+ ]],
|
|
|
+ done: function () {
|
|
|
+ layer.closeAll('loading');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ renderTable();
|
|
|
+
|
|
|
+ //触发三个button按钮
|
|
|
+ $('#btn-expand').click(function () {
|
|
|
+ treetable.expandAll('#permissionTable');
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#btn-fold').click(function () {
|
|
|
+ treetable.foldAll('#permissionTable');
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#btn-refresh').click(function () {
|
|
|
+ renderTable();
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ function complain(d){//操作中显示的内容
|
|
|
+ if(d.pid !=0){
|
|
|
+ return [
|
|
|
+ '<a href="javascript:void(0)" onclick="openBill2(\'编辑附件\', \'${ctx}/projectAccessory/projectAccessory/workAttachmentForm?attachmentId='+d.id+'&projectId='+d.projectId+'\',\'70%\',\'80%\',false,\'inputForm\')" class="op-btn op-btn-edit" ><i class="fa fa-edit"></i> 编辑</a>',
|
|
|
+ ].join('');
|
|
|
+ }else{
|
|
|
+ return[''].join('');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ function openBill2(title,url,width,height,target,formId){
|
|
|
+ var rows = $(this).parent().prevAll().length + 1;
|
|
|
+ var frameIndex = parent.layer.getFrameIndex(window.name);
|
|
|
+ var urls = url+"&index="+frameIndex;
|
|
|
+ if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端,就使用自适应大小弹窗
|
|
|
+ width='auto';
|
|
|
+ height='auto';
|
|
|
+ }else{//如果是PC端,根据用户设置的width和height显示。
|
|
|
+
|
|
|
+ }
|
|
|
+ top.layer.open({
|
|
|
+ type: 2,
|
|
|
+ area: [width, height],
|
|
|
+ title: title,
|
|
|
+ skin:"two-btns",
|
|
|
+ maxmin: false, //开启最大化最小化按钮
|
|
|
+ content: urls ,
|
|
|
+ btn: ['确定','关闭'],
|
|
|
+ yes: function(index, layero){
|
|
|
+ var body = top.layer.getChildFrame('body', index);
|
|
|
+ var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
|
|
|
+ var inputForm = body.find('#inputForm');
|
|
|
+ var top_iframe;
|
|
|
+ if(target){
|
|
|
+ top_iframe = target;//如果指定了iframe,则在改frame中跳转
|
|
|
+ }else{
|
|
|
+ top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
|
|
|
+ }
|
|
|
+ inputForm.attr("target",top_iframe);//表单提交成功后,从服务器返回的url在当前tab中展示
|
|
|
+ inputForm.attr("action","${ctx}/projectAccessory/projectAccessory/saveWorkAttachment");//表单提交成功后,从服务器返回的url在当前tab中展示
|
|
|
+ var $document = iframeWin.contentWindow.document;
|
|
|
+
|
|
|
+ formSubmit2($document,formId,index);
|
|
|
+
|
|
|
+ },
|
|
|
+ cancel: function(index){
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ function formSubmit2($document,inputForm,index){
|
|
|
+
|
|
|
+ var validateForm = $($document.getElementById(inputForm)).validate({
|
|
|
+ submitHandler: function(form){
|
|
|
+ loading('正在提交,请稍等...');
|
|
|
+ form.submit();
|
|
|
+ },
|
|
|
+ errorContainer: "#messageBox",
|
|
|
+ errorPlacement: function(error, element) {
|
|
|
+ $($document.getElementById("#messageBox")).text("输入有误,请先更正。");
|
|
|
+ if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
|
|
|
+ error.appendTo(element.parent().parent());
|
|
|
+ } else {
|
|
|
+ error.insertAfter(element);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if(validateForm.form()){
|
|
|
+ $($document.getElementById(inputForm)).ajaxSubmit({
|
|
|
+ success:function(data) {
|
|
|
+ var d = data;
|
|
|
+ //调用layui.use中的renderTable()方法刷新列表
|
|
|
+ renderTable()
|
|
|
+ //输出提示信息
|
|
|
+ if(d.str.length>0){
|
|
|
+ parent.layer.msg(d.str,{icon:1});
|
|
|
+ }
|
|
|
+ //关闭当前页
|
|
|
+ top.layer.close(index)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>--%>
|
|
|
+</body>
|
|
|
+</html>
|