Pārlūkot izejas kodu

归档批次(删除、校验、页面细节整改)

[user3] 4 gadi atpakaļ
vecāks
revīzija
3a2ec22519

+ 2 - 0
src/main/java/com/jeeplus/modules/projectFilingBatch/dao/ProjectFilingBatchProInfoDao.java

@@ -5,6 +5,7 @@ import com.jeeplus.common.persistence.DataEntity;
 import com.jeeplus.common.persistence.annotation.MyBatisDao;
 import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatch;
 import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatchProInfo;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -14,4 +15,5 @@ public interface ProjectFilingBatchProInfoDao extends CrudDao<ProjectFilingBatch
      Integer proInfoInsert(ProjectFilingBatchProInfo proInfo);
 
      List<ProjectFilingBatchProInfo> getListByFilingBatchId(String filingBatchId);
+     Integer deleteById(@Param("id")String id);
 }

+ 13 - 3
src/main/java/com/jeeplus/modules/projectFilingBatch/service/ProjectFilingBatchService.java

@@ -259,7 +259,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                 treeData.setBoxNum("");
                 treeData.setStatusStr("审批中");
             }else if(5 == filingBatch.getFilingStatus() || 4 == filingBatch.getFilingStatus()){
-                if("1" == filingBatch.getDelFlag()){
+                if(relation.getDelFlag().equals("1")){
                     treeData.setBoxNum("");
                     treeData.setStatusStr("驳回");
                 }else{
@@ -1017,6 +1017,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
             DelProInfo(info);
             proInfoDao.proInfoInsert(info);
         }else{
+            Integer count=0;
             for (int i=0;i<proInfos.length;i++){
                 if (proInfos[i]!=""&& !"".equals(proInfos[i])) {
                     json = JSONObject.fromObject(proInfos[i]);
@@ -1026,7 +1027,7 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
                     info.setProInfofilingBatch(json.get("filingId").toString());
                     info.setProInfoName(json.get("names").toString());
                     info.setProInfoType(json.get("types").toString());
-                    if(i==0){ DelProInfo(info);}
+                    if(count==0){ DelProInfo(info);count++;}
                     proInfoDao.proInfoInsert(info);
                 }
             }
@@ -1034,10 +1035,19 @@ public class ProjectFilingBatchService extends CrudService<ProjectFilingBatchDao
 
     }
     /**
-     * 删除--项目附件info
+     * 删除--项目文件信息info
      * @param proInfo
      */
     public void DelProInfo(ProjectFilingBatchProInfo proInfo){
         proInfoDao.delete(proInfo);
     }
+    /**
+     * 删除--项目文件信息info
+     * 修改页面中的文件信息删除
+     * @param id
+     */
+    @Transactional(readOnly = false)
+    public void deleteById(String id){
+        proInfoDao.deleteById(id);
+    }
 }

+ 15 - 0
src/main/java/com/jeeplus/modules/projectFilingBatch/web/ProjectFilingBatchController.java

@@ -518,4 +518,19 @@ public class ProjectFilingBatchController extends BaseController {
         model.addAttribute("filingId", filingId);
         return "modules/projectFilingBatch/ProjectFilingBatchProInfoForm";
     }
+    /**
+     * 批量归档——文件信息
+     * 删除
+     * @param id
+     * @return
+     */
+    @RequestMapping("deleteById")
+    @ResponseBody
+    public String deleteById(@RequestParam("id") String id) {
+        if (null != id){
+            projectFilingBatchService.deleteById(id);
+        }
+        return "success";
+    }
+
 }

+ 4 - 0
src/main/resources/mappings/modules/projectGuidang/ProjectFilingBatchProInfoDao.xml

@@ -40,5 +40,9 @@
 		delete from project_filingbatch_proinfo
 		where filing_batch=#{proInfofilingBatch} and project_id=#{proId}
 	</delete>
+	<delete id="deleteById">
+		delete from project_filingbatch_proinfo
+		where id=#{id}
+	</delete>
 
 </mapper>

+ 27 - 11
src/main/webapp/webpage/modules/projectFilingBatch/ProjectFilingBatchProInfoForm.jsp

@@ -11,7 +11,13 @@
 		var validateForm;
 		function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
 			if(validateForm.form()){
-				$("#inputForm").submit();
+				var length=$("#file_attachment tr").length
+				for (var i=0;i<length;i++){
+					var type=$("#file_attachment tr").eq(i).find("td").eq(1).find("input").val();
+					if (type==""){
+						return false;
+					}
+				}
 				return true;
 			}
 			return false;
@@ -99,12 +105,12 @@
 			var sa=ss[1];
 			$(id).parent().parent().parent().show();
 			$(id).append(
-					"<tr class='listInfo'>"+
-					"<td style=\"text-align: center;position: relative;\" width=\"20%\"><span style='color: red;float: left;position: absolute;left: 15px;top: 15px;'>*</span><input name='ProInfoType' style='text-align: center'  class=\"form-control required\"></input></td>"+
+					"<tr class='listInfo' align='center'>"+
+					"<td style=\"text-align: center;position: relative;\" width=\"20%\"><span style='color: red;float: left;position: absolute;left: 15px;top: 15px;'>*</span><input name='ProInfoType' style='text-align: center;width: 100%;'  class=\"form-control required\"/></td>"+
 					"<td style=\"text-align: center\" width=\"20%\"><input name='ProInfoName' style='text-align: center' class=\"form-control\"></input></td>"+
-					"<td width=\"20%\">" +
+					"<td width=\"10%\" align='center'>" +
 					// "<span href=javascript:void(0); onclick=\"accordingBtn(this)\"   class=\"op-btn op-btn-edit\" title=\"上传附件\"><i class=\"glyphicon glyphicon-edit\"></i>&nbsp;编辑</span>" +
-					"<div class=\"op-btn-box\" ><span class=\"op-btn op-btn-delete\" onclick=\"delListInfoRow(this)\" title=\"删除\"><i class=\"glyphicon glyphicon-remove\"></i>&nbsp;删除</span></div>" +
+					"<div class=\"op-btn-box\" style='margin-top: 8px;'><span class=\"op-btn op-btn-delete\" onclick=\"delListInfoRow(this)\" title=\"删除\"><i class=\"glyphicon glyphicon-remove\"></i>&nbsp;删除</span></div>" +
 					"</td>"+
 					"</tr>"
 			)
@@ -115,10 +121,19 @@
 		function proInfoType() {
 			var length=$("#file_attachment tr").length;
 			var types=new Array();
+			var flag=true;
 			for (var i=0;i<length;i++){
 				types[i]=$("#file_attachment tr").eq(i).find("td").eq(0).find("input").eq(0).val();
+				if (types[i]==""){
+					flag=false;
+				}
 			}
-			return types;
+			if (flag){
+				return types;
+			}else{
+				top.layer.msg("文件类型不能为空", {icon: 0});
+			}
+
 		}
 		function proInfoValue() {
 			var length=$("#file_attachment tr").length;
@@ -126,6 +141,7 @@
 			for (var i=0;i<length;i++){
 				names[i]=$("#file_attachment tr").eq(i).find("td").eq(1).find("input").eq(0).val();
 			}
+
 			return names;
 		}
 		function delListInfoRow(obj, prefix){
@@ -152,7 +168,7 @@
 <body>
 <div class="single-form">
 	<div class="container">
-<%--		<form:form id="inputForm" modelAttribute="projectFilingBatchProInfo" action="${ctx}/projectAccessory/projectAccessory/saveWorkAttachment" method="post" class="form-horizontal">--%>
+		<form:form id="inputForm" method="post" class="form-horizontal">
 <%--			<form:hidden path="id"/>--%>
 <%--			<form:hidden path="proId"/>--%>
 <%--			<form:hidden path="proInfofilingBatch"/>--%>
@@ -174,20 +190,20 @@
 				<div class="layui-item layui-col-xs12" style="padding:0 16px;">
 					<input type="hidden" id="proId" value="${proid}">
 					<input type="hidden" id="filingId" value="${filingId}">
-					<table id="upTable" cellpadding="0" cellspacing="0" class="table table-bordered table-condensed details">
+					<table id="upTable"  class="table table-bordered table-condensed can-edit">
 						<thead>
 						<tr>
 								<%-- <th>序号</th>--%>
 							<th>文件类型</th>
 							<th>文件描述</th>
-							<th width="150px">操作</th>
+							<th width="15%">操作</th>
 						</tr>
 						</thead>
 						<tbody id="file_attachment">
 <%--						<c:choose>--%>
 <%--							<c:when test="${types != '' and names != ''}">--%>
 								<c:forEach items="${proInfo}" var = "info" varStatus="status">
-									<tr>
+									<tr align="center">
 										<td><input name="proInfoType" style="text-align: center;" class="form-control required" value='${info.type}'/></td>
 										<td><input name="proInfoName" style="text-align: center" class="form-control required" value='${info.name}'/></td>
 										<td class="op-td">
@@ -207,7 +223,7 @@
 					</table>
 				</div>
 			</div>
-<%--		</form:form>--%>
+		</form:form>
 	</div>
 </div>
 </body>

+ 27 - 10
src/main/webapp/webpage/modules/projectFilingBatch/projectFilingBatchApply.jsp

@@ -77,7 +77,7 @@
 									"<input  readonly='true' name='ProInfoType' style='text-align: center'  class=\"form-control required\" value='"+type+"'></td>"+
 									"<td style=\"text-align: center\" width=\"20%\"><input  readonly='true' name='ProInfoName' style='text-align: center' class=\"form-control\" value='"+name+"'></input></td>"+
 									"<td style=\"text-align: center\" width=\"20%\"></td>"+
-									"<td width=\"20%\">" +
+									"<td width=\"20%\" style='padding-top: 8px;'>" +
 									"<span href=javascript:void(0); onclick=\"addRowInfoForm("+edit+","+editId+")\"   class=\"op-btn op-btn-edit\" title=\"上传附件\"><i class=\"glyphicon glyphicon-edit\"></i>&nbsp;编辑</span>" +
 									"<span class=\"op-btn op-btn-delete\" onclick=\"delListInfoRow(this)\" title=\"删除\"><i class=\"glyphicon glyphicon-remove\"></i>&nbsp;删除</span>" +
 									"<input type='text' class='" + jsonInput + "'  name='proInfos' style='display: none;' value='"+proJson+"' />"+
@@ -128,16 +128,16 @@
 							}
 							if(flag) {
 								$("#projectList").append("<tr class='rowSize' onclick='listTr(this)'>" +
-										"<td><input type=\"hidden\" name=\"proId\" id='" + tid + "' value=" + obj.id + "><input type=\"hidden\" name=\"projectid\" value=" + obj.id + "><span><i class=\"layui-icon layui-icon-triangle-d\"></i></span>" + obj.projectId + "</td>" +
-										"<td>" + obj.projectName + "</td>" +
-										"<td>" + obj.projectReportNumber + "</td>" +
+										"<td ><input type=\"hidden\" name=\"proId\" id='" + tid + "' value=" + obj.id + "><input type=\"hidden\" name=\"projectid\" value=" + obj.id + "/><span><i class=\"layui-icon layui-icon-triangle-d\"></i></span>" + obj.projectId + "</td>" +
+										"<td >" + obj.projectName + "</td>" +
+										"<td >" + obj.projectReportNumber + "</td>" +
 										"<td class=\"text-center op-td\" >" +
 										"<span class=\"op-btn op-btn-add\" onclick=\"addRowInfoForm("+tid+","+id+")\" title=\"添加\"><i class=\"fa fa-plus\"></i>&nbsp;添加</span>" +
 										"<span class=\"op-btn op-btn-delete\" onclick=\"delListRow(this," + id + ")\" title=\"删除\"><i class=\"glyphicon glyphicon-remove\"></i>&nbsp;删除</span>" +
 										"</td>" +
 										"</tr>")
 								$("#projectList").append("<tr class='"+obj.id+"' style='display: none;'> <td colspan='4' style='padding: 0px;'>" +
-										"<table style=\"width: 100%;padding: 0px;margin: 0px;\" class=\"table table-bordered table-condensed details\">" +
+										"<table style=\"width: 100%;padding: 0px;margin: 0px;\" class=\"table table-bordered table-condensed can-edit\">" +
 										"<tbody id='" + id + "'>" +
 										"<input type='text' id='" + id + "_len' style='display: none;' name='flags' />"+
 										"</tbody>" +
@@ -159,20 +159,21 @@
 										$(iid).parent().parent().parent().show();
 										$.each(result.data,function(index,value){
 											$(iid).append(
-													"<tr class='listInfo' style='position: relative'>"+
+													"<tr class='listInfo'>"+
 													// "<td class=\"hide\">"+
 													// "<input type='file' multiple='multiple' style='display: none;' onChange='if(this.value)insertAccording(this.value,"+obj.id+",this);'/>"+
 													// "<input type='hidden' style='display: none;' id='attId' value='"+value.id+"'/>"+
 													// "<input type='hidden' style='display: none;' id='fileUrl' value='"+value.url+"'/>"+
 													// "</td>"+
 													"<td style=\"text-align: center;position: relative;\" width=\"20%\">" +
-													"<input name='proInfoType' onChange='upwType(this)' style='text-align: center' readonly='true' class=\"form-control required\" value='"+value.proInfoType+"'/></td>"+
+													"<input name='proInfoType' style='text-align: center' readonly='true' class=\"form-control\" value='"+value.proInfoType+"'/></td>"+
 													"<td style=\"text-align: center\" width=\"20%\"><input  readonly='true' name='proInfoName' style='text-align: center' class=\"form-control required\" value='"+value.proInfoName+"'/></td>"+
 													"<td style=\"text-align: center\" width=\"20%\"></td>"+
-													"<td width=\"20%\">" +
+													"<td width=\"20%\" style='padding-top : 8px;'>" +
 													"<span href=javascript:void(0); onclick=\"addRowInfoForm("+tid+","+id+")\"   class=\"op-btn op-btn-edit\" title=\"上传附件\"><i class=\"glyphicon glyphicon-edit\"></i>&nbsp;编辑</span>" +
 													"<span class=\"op-btn op-btn-delete\" onclick=\"delListInfoRow(this)\" title=\"删除\"><i class=\"glyphicon glyphicon-remove\"></i>&nbsp;删除</span>" +
 													"<input type='text' class='" + id + "_json' style='display: none;' name='proInfos' />"+
+													"<input type='text' style='display: none;' class='typeId' value='"+value.id+"' />"+
 													"</td>"+
 													"</tr>"
 											)
@@ -210,7 +211,21 @@
 				},100);
 			}
 		});
+		function delListInfoRow(obj, prefix){
+			var tr=$(obj).parent().parent();
+			var id=$(tr).find("td").eq(3).find(".typeId").val();
+			$(obj).parent().parent().remove();
+			// $(obj).parent().parent().parent().parent().parent().parent().remove();
+			$.ajax({
+				type:"post",
+				url:"${ctx}/projectFilingBatch/projectFilingBatchInfo/deleteById",
+				data:{"id":id},
+				dataType:"json",
+				success:function (d) {
 
+				}
+			});
+		}
         function insertTitle(tValue){
             var files = $("#attachment_file")[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
             var attachmentId = $("#id").val();
@@ -295,12 +310,13 @@
 					</div>
 				</div>
 			</div>
-			<div class="form-group layui-row first">
+			<div class="form-group layui-row  first">
 				<div class="form-group-label"><h2>项目基础信息</h2></div>
+				<div class="layui-item layui-col-xs12 form-table-container" style="padding:0px">
 				<table id="contentTable2" class="table table-bordered table-condensed details">
 					<thead>
 					<tr>
-						<th class="hide"></th>
+<%--						<th class="hide"></th>--%>
 						<th style="text-align: center" width="20%">归档项目编号</th>
 						<th style="text-align: center" width="20%">归档项目名称</th>
 						<th style="text-align: center" width="20%">报告号</th>
@@ -352,6 +368,7 @@
 <%--					</c:choose>--%>
 					</tbody>
 				</table>
+				</div>
 			</div>
 	</form:form>
 			<div class="form-group layui-row">

+ 10 - 7
src/main/webapp/webpage/modules/projectFilingBatch/projectFilingBatchForm.jsp

@@ -148,6 +148,7 @@
                                                 "<span href=javascript:void(0); onclick=\"addRowInfoForm("+tid+","+id+")\"   class=\"op-btn op-btn-edit\" title=\"上传附件\"><i class=\"glyphicon glyphicon-edit\"></i>&nbsp;编辑</span>" +
                                                 "<span class=\"op-btn op-btn-delete\" onclick=\"delListInfoRow(this)\" title=\"删除\"><i class=\"glyphicon glyphicon-remove\"></i>&nbsp;删除</span>" +
                                                 "<input type='text' class='" + id + "_json' style='display: none;' name='proInfos' />"+
+                                                "<input type='text' style='display: none;' class='typeId' value='"+value.id+"' />"+
                                                 "</td>"+
                                                 "</tr>"
                                             )
@@ -744,11 +745,13 @@
             });
         }
         function delListRow(o,obj){
-            var tr=obj.id+" tr"
-            var html=$(tr).html()
-            if(html!="undefined"){
+            var tr="#"+obj.id+" tr"
+            var html=$(tr).length
+            if(0 == html){
                 $(o).parent().parent().remove();
                 $(obj).parent().parent().parent().remove();
+            }else{
+                parent.layer.msg("该项目下有文件信息!", {icon: 5});
             }
 
 
@@ -758,13 +761,13 @@
         }
         function delListInfoRow(obj, prefix){
             var tr=$(obj).parent().parent();
-            var id=$(tr).find("td").eq(0).find("#attId").val();
-            var url=$(tr).find("td").eq(0).find("#fileUrl").val();
+            var id=$(tr).find("td").eq(3).find(".typeId").val();
             $(obj).parent().parent().remove();
-            $(obj).parent().parent().parent().parent().parent().parent().remove();
+            // $(obj).parent().parent().parent().parent().parent().parent().remove();
             $.ajax({
                 type:"post",
-                url:"${ctx}/sys/workattachment/deleteFileFromAliyun?url="+url+"&id="+id,
+                url:"${ctx}/projectFilingBatch/projectFilingBatchInfo/deleteById",
+                data:{"id":id},
                 dataType:"json",
                 success:function (d) {