Sfoglia il codice sorgente

项目可查看到项目计划列表、项目计划未填写时,新增报告按钮置灰

user5 4 anni fa
parent
commit
540acd120e

+ 9 - 3
src/main/java/com/jeeplus/modules/projectrecord/web/ProjectPlanController.java

@@ -171,14 +171,20 @@ public class ProjectPlanController extends BaseController {
      */
     @RequestMapping(value = "export")
     public String exportFile(ProjectRecords projectRecords, HttpServletResponse response, RedirectAttributes redirectAttributes) {
+        ProjectRecords ProjectRecord = ruralProjectRecordsService.getProjectRecords(projectRecords.getId());
+        try {
+            MyBeanUtils.copyBeanNotNull2Bean(projectRecords, ProjectRecord);//将编辑表单中的非NULL值覆盖数据库记录中的值
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
         try {
             //文件名称
-            String fileName = projectRecords.getProjectName()+"-项目计划.xlsx";
+            String fileName = ProjectRecord.getProjectName()+"-项目计划.xlsx";
             ProjectPlanInfo projectPlanInfo = new ProjectPlanInfo();
-            projectPlanInfo.setProjectId(projectRecords.getId());
+            projectPlanInfo.setProjectId(ProjectRecord.getId());
             //获取项目计划信息
             List<ProjectPlanInfo> projectPlanList = projectPlanService.getProjectPlanList(projectPlanInfo);
-            new ExportExcel(projectRecords.getProjectName()+"-项目计划", ProjectPlanInfo.class).setDataList(projectPlanList).write(response, fileName).dispose();
+            new ExportExcel(ProjectRecord.getProjectName()+"-项目计划", ProjectPlanInfo.class).setDataList(projectPlanList).write(response, fileName).dispose();
             return null;
         } catch (Exception e) {
             addMessage(redirectAttributes, "导出项目计划记录失败!失败信息:"+e.getMessage());

+ 13 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectMessageController.java

@@ -14,7 +14,9 @@ import com.jeeplus.modules.projectcontentinfo.service.ProjectReportChangeService
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportRecordService;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectcontentinfoService;
+import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
+import com.jeeplus.modules.projectrecord.service.ProjectPlanService;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectcontentinfo;
@@ -73,6 +75,8 @@ public class RuralCostProjectMessageController extends BaseController {
     private ActTaskService actTaskService;
     @Autowired
     private ProjectReportRecordService projectReportRecordService;
+    @Autowired
+    private ProjectPlanService projectPlanService;
 
     @ModelAttribute
     public RuralProjectRecords get(@RequestParam(required=false) String id) {
@@ -111,6 +115,15 @@ public class RuralCostProjectMessageController extends BaseController {
                     records1.setWorkContractInfo(contractInfo);
                 }
             }
+            ProjectPlanInfo projectPlanInfo = new ProjectPlanInfo();
+            projectPlanInfo.setProjectId(records1.getId());
+            //获取项目计划信息
+            List<ProjectPlanInfo> projectPlanList = projectPlanService.getProjectPlanList(projectPlanInfo);
+            if(projectPlanList.size()>0){
+                records1.setView("true");
+            }else{
+                records1.setView("false");
+            }
         }
         model.addAttribute("page", page);
         return "modules/ruralprojectrecords/cost/ruralCostProjectMessageList";

+ 9 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectRecordsController.java

@@ -15,6 +15,8 @@ import com.jeeplus.common.web.BaseController;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
 import com.jeeplus.modules.act.utils.ActUtils;
+import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
+import com.jeeplus.modules.projectrecord.service.ProjectPlanService;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
@@ -68,6 +70,8 @@ public class RuralCostProjectRecordsController extends BaseController {
 	private ActTaskService actTaskService;
 	@Autowired
 	private ActivityService activityService;
+	@Autowired
+	private ProjectPlanService projectPlanService;
 
 	private static String template_path = Global.getProjectTemplatePath()+"咨询工作方案.xlsx";
 	private static String template_name = "咨询工作方案.xlsx";
@@ -173,6 +177,11 @@ public class RuralCostProjectRecordsController extends BaseController {
 				areaName.append("-").append(projectRecords.getCounty());
 			}
 			projectRecords.getArea().setName(areaName.toString());*/
+			ProjectPlanInfo projectPlanInfo = new ProjectPlanInfo();
+			projectPlanInfo.setProjectId(projectRecords.getId());
+			//获取项目计划信息
+			List<ProjectPlanInfo> projectPlanList = projectPlanService.getProjectPlanList(projectPlanInfo);
+			projectRecords.setProjectPlanList(projectPlanList);
 		}
 		model.addAttribute("projectRecords", projectRecords);
 		return "modules/ruralprojectrecords/cost/ruralCostProjectRecordsView";

+ 13 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectMessageController.java

@@ -14,7 +14,9 @@ import com.jeeplus.modules.projectcontentinfo.service.ProjectReportChangeService
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportDataService;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectReportRecordService;
 import com.jeeplus.modules.projectcontentinfo.service.ProjectcontentinfoService;
+import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
 import com.jeeplus.modules.projectrecord.entity.ProjectRecords;
+import com.jeeplus.modules.projectrecord.service.ProjectPlanService;
 import com.jeeplus.modules.projectrecord.service.ProjectRecordsService;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectcontentinfo;
@@ -73,6 +75,8 @@ public class RuralProjectMessageController extends BaseController {
     private ActTaskService actTaskService;
     @Autowired
     private ProjectReportRecordService projectReportRecordService;
+    @Autowired
+    private ProjectPlanService projectPlanService;
 
     @ModelAttribute
     public RuralProjectRecords get(@RequestParam(required=false) String id) {
@@ -111,6 +115,15 @@ public class RuralProjectMessageController extends BaseController {
                     records1.setWorkContractInfo(contractInfo);
                 }
             }
+            ProjectPlanInfo projectPlanInfo = new ProjectPlanInfo();
+            projectPlanInfo.setProjectId(records1.getId());
+            //获取项目计划信息
+            List<ProjectPlanInfo> projectPlanList = projectPlanService.getProjectPlanList(projectPlanInfo);
+            if(projectPlanList.size()>0){
+                records1.setView("true");
+            }else{
+                records1.setView("false");
+            }
         }
         model.addAttribute("page", page);
         return "modules/ruralprojectrecords/ruralporjectmessage/ruralProjectMessageList";

+ 9 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectRecordsController.java

@@ -15,6 +15,8 @@ import com.jeeplus.common.web.BaseController;
 import com.jeeplus.modules.act.entity.Act;
 import com.jeeplus.modules.act.service.ActTaskService;
 import com.jeeplus.modules.act.utils.ActUtils;
+import com.jeeplus.modules.projectrecord.entity.ProjectPlanInfo;
+import com.jeeplus.modules.projectrecord.service.ProjectPlanService;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
 import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsService;
@@ -68,6 +70,8 @@ public class RuralProjectRecordsController extends BaseController {
 	private ActTaskService actTaskService;
 	@Autowired
 	private ActivityService activityService;
+	@Autowired
+	private ProjectPlanService projectPlanService;
 
 	private static String template_path = Global.getProjectTemplatePath()+"咨询工作方案.xlsx";
 	private static String template_name = "咨询工作方案.xlsx";
@@ -149,6 +153,11 @@ public class RuralProjectRecordsController extends BaseController {
 	public String view(RuralProjectRecords projectRecords, Model model) {
 		if (projectRecords!=null&&StringUtils.isNotBlank(projectRecords.getId())) {
 			projectRecordsService.queryProjectDetail(projectRecords);
+			ProjectPlanInfo projectPlanInfo = new ProjectPlanInfo();
+			projectPlanInfo.setProjectId(projectRecords.getId());
+			//获取项目计划信息
+			List<ProjectPlanInfo> projectPlanList = projectPlanService.getProjectPlanList(projectPlanInfo);
+			projectRecords.setProjectPlanList(projectPlanList);
 		}
 		model.addAttribute("projectRecords", projectRecords);
 		return "modules/ruralprojectrecords/ruralProjectRecordsView";

+ 7 - 2
src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectMessageList.jsp

@@ -333,8 +333,12 @@
                         var xml="";
                         if(d.canAdd != undefined && d.canAdd =="1")
                         {
-                            xml+="<a href=\"#\" onclick=\"openDialogre('新增报告', '${ctx}/ruralProject/ruralCostProjectMessage/form?projectId=" + d.id +"','95%', '95%','','送审,暂存,关闭')\" class=\"op-btn layui-bg-green\" ><i class=\"fa fa-plus\"></i> 新增报告</a>";
-                        }
+                        	if(d.view =="true"){
+								xml+="<a href=\"#\" onclick=\"openDialogre('新增报告', '${ctx}/ruralProject/ruralCostProjectMessage/form?projectId=" + d.id +"','95%', '95%','','送审,暂存,关闭')\" class=\"op-btn layui-bg-green\" ><i class=\"fa fa-plus\"></i> 新增报告</a>";
+							}else{
+								xml+="<a href=\"javascript:void(0)\" onclick=\"openDialogre('新增报告', '${ctx}/ruralProject/ruralCostProjectMessage/form?projectId=" + d.id +"','95%', '95%','','送审,暂存,关闭')\" style=\"pointer-events: none;background-color:#c2c2c2;\" class=\"op-btn\" ><i class=\"fa fa-plus\"></i> 新增报告</a>";
+							}
+						}
                         if(d.canedit1 != undefined && d.canedit1 =="1")
                         {
                             xml+="<a href=\"#\" onclick=\"openDialogre('修改报告信息', '${ctx}/ruralProject/ruralCostProjectMessage/form?projectId=" + d.id +"','95%', '95%','','送审,暂存,关闭')\" class=\"op-btn op-btn-edit\" ><i class=\"fa fa-edit\"></i> 修改报告</a>";
@@ -421,6 +425,7 @@
                     ,"procId":"${projectRecords.processInstanceId}"
 					,"projectReportName":"${projectRecords.projectReportName}"
 					,"reportedState":"${projectRecords.reportedState}"
+					,"view":"${projectRecords.view}"
                     <c:choose>
                         <c:when test="${fns:getUser().id == projectRecords.leaderIds || fns:getUser().id eq projectRecords.createBy.id}">
                             ,"canAdd":<c:choose>

+ 64 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/cost/ruralCostProjectRecordsView.jsp

@@ -592,10 +592,74 @@
 					</table>
 				</div>
 			</div>
+			<div class="form-group layui-row">
+			<div class="form-group-label"><h2>项目计划列表</h2></div>
+			<div class="layui-item layui-col-sm12 lw7">
+				<div class="layui-item nav-btns">
+					<table id="bankinfo" class="table table-bordered table-condensed can-edit">
+						<thead>
+						<tr>
+							<th width="80px">任务编码</th>
+							<th >任务阶段</th>
+							<th >计划开始时间</th>
+							<th >计划结束时间</th>
+							<th >提醒人</th>
+							<th >完成人</th>
+						</tr>
+						</thead>
+						<tbody id="projectPlanList">
+
+						</tbody>
+					</table>
+					<script type="text/template" id="workClientBankTpl">//<!--
+                                <tr id="projectPlanList{{idx}}">
+                                    <td class="hide">
+                                        <input id="projectPlanList{{idx}}_id" name="projectPlanList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+                                        <input id="projectPlanList{{idx}}_delFlag" name="projectPlanList[{{idx}}].delFlag" type="hidden" value="0"/>
+                                    </td>
+
+                                    <td width="60px">
+                                        <input id="projectPlanList{{idx}}_costNum" name="projectPlanList[{{idx}}].costNum" readonly="readonly" style="text-align: center"  value="{{idx}}" type="text" class="form-control contentDetail"/>
+                                    </td>
+                                    <td>
+                                       <input id="projectPlanList{{idx}}_projectStage" name="projectPlanList[{{idx}}].projectStage" readonly="readonly" value="{{row.projectStage}}" type="text" class="form-control contentDetail"/>
+                                    </td>
+
+                                    <td>
+                                        <input lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" id="projectPlanList{{idx}}_beginDate" readonly="readonly" name="projectPlanList[{{idx}}].beginDate" type="text" value="{{row.beginDate}}"  class="form-control required datetime"/>
+                                    </td>
+                                    <td>
+                                        <input lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" id="projectPlanList{{idx}}_endDate" readonly="readonly" name="projectPlanList[{{idx}}].endDate" type="text" value="{{row.endDate}}"  class="form-control required datetime"/>
+                                    </td>
+
+                                    <td>
+                                        <input id="projectPlanList{{idx}}_remindName" name="projectPlanList[{{idx}}].remindName" readonly="readonly" style="text-align: center"  value="{{row.remindName}}" type="text" class="form-control contentDetail"/>
+                                    </td>
+
+                                    <td>
+                                        <input id="projectPlanList{{idx}}_finishName" name="projectPlanList[{{idx}}].finishName" readonly="readonly" style="text-align: center"  value="{{row.finishName}}" type="text" class="form-control contentDetail"/>
+                                    </td>
+                                </tr>//-->
+					</script>
+				</div>
+			</div>
+		</div>
 
 			<div class="form-group layui-row page-end"></div>
 		</form:form>
 	</div>
 </div>
+<script type="text/javascript">
+	var workClientBankRowIdx = 0,
+			workClientBankTpl = $("#workClientBankTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
+	$(document).ready(function () {
+		var dataBank = ${fns:toJson(projectRecords.projectPlanList)};
+		for (var i = 0; i < dataBank.length; i++) {
+			addRow('#projectPlanList', workClientBankRowIdx+1, workClientBankTpl, dataBank[i]);
+			workClientBankRowIdx = workClientBankRowIdx + 1;
+		}
+	});
+
+</script>
 </body>
 </html>

+ 4 - 4
src/main/webapp/webpage/modules/ruralprojectrecords/ruralProjectRecordsForm.jsp

@@ -1047,7 +1047,7 @@
                 </div>
             </div>
 
-            <div class="form-group layui-row">
+            <%--<div class="form-group layui-row">
                 <div class="form-group-label"><h2>项目计划附件信息</h2></div>
                 <div class="layui-item nav-btns">
                     <a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"  onclick="addFile()"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
@@ -1067,7 +1067,7 @@
                     <table id="listAttachment" class="table table-bordered table-condensed details">
                         <thead>
                         <tr>
-                                <%-- <th>序号</th>--%>
+                                &lt;%&ndash; <th>序号</th>&ndash;%&gt;
                             <th width="25%">文件</th>
                             <th width="25%">上传人</th>
                             <th width="25%">上传时间</th>
@@ -1077,7 +1077,7 @@
                         <tbody id="file_attachment">
                         <c:forEach items="${ruralProjectRecords.workAttachments}" var = "workClientAttachment" varStatus="status">
                             <tr class="trIdAdds">
-                                    <%-- <td>${status.index + 1}</td>--%>
+                                    &lt;%&ndash; <td>${status.index + 1}</td>&ndash;%&gt;
                                 <c:choose>
                                     <c:when test="${fn:containsIgnoreCase(workClientAttachment.attachmentName,'jpg')
                                                            or fn:containsIgnoreCase(workClientAttachment.attachmentName,'png')
@@ -1110,7 +1110,7 @@
                         </tbody>
                     </table>
                 </div>
-            </div>
+            </div>--%>
 
             <%--<div class="form-group layui-row">
                 <div class="form-group-label"><h2>项目组成员列表</h2></div>

+ 64 - 0
src/main/webapp/webpage/modules/ruralprojectrecords/ruralProjectRecordsView.jsp

@@ -592,10 +592,74 @@
 					</table>
 				</div>
 			</div>
+			<div class="form-group layui-row">
+				<div class="form-group-label"><h2>项目计划列表</h2></div>
+				<div class="layui-item layui-col-sm12 lw7">
+					<div class="layui-item nav-btns">
+						<table id="bankinfo" class="table table-bordered table-condensed can-edit">
+							<thead>
+							<tr>
+								<th width="80px">任务编码</th>
+								<th >任务阶段</th>
+								<th >计划开始时间</th>
+								<th >计划结束时间</th>
+								<th >提醒人</th>
+								<th >完成人</th>
+							</tr>
+							</thead>
+							<tbody id="projectPlanList">
+
+							</tbody>
+						</table>
+						<script type="text/template" id="workClientBankTpl">//<!--
+                                <tr id="projectPlanList{{idx}}">
+                                    <td class="hide">
+                                        <input id="projectPlanList{{idx}}_id" name="projectPlanList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
+                                        <input id="projectPlanList{{idx}}_delFlag" name="projectPlanList[{{idx}}].delFlag" type="hidden" value="0"/>
+                                    </td>
+
+                                    <td width="60px">
+                                        <input id="projectPlanList{{idx}}_costNum" name="projectPlanList[{{idx}}].costNum" readonly="readonly" style="text-align: center"  value="{{idx}}" type="text" class="form-control contentDetail"/>
+                                    </td>
+                                    <td>
+                                       <input id="projectPlanList{{idx}}_projectStage" name="projectPlanList[{{idx}}].projectStage" readonly="readonly" value="{{row.projectStage}}" type="text" class="form-control contentDetail"/>
+                                    </td>
+
+                                    <td>
+                                        <input lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" id="projectPlanList{{idx}}_beginDate" readonly="readonly" name="projectPlanList[{{idx}}].beginDate" type="text" value="{{row.beginDate}}"  class="form-control required datetime"/>
+                                    </td>
+                                    <td>
+                                        <input lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" id="projectPlanList{{idx}}_endDate" readonly="readonly" name="projectPlanList[{{idx}}].endDate" type="text" value="{{row.endDate}}"  class="form-control required datetime"/>
+                                    </td>
+
+                                    <td>
+                                        <input id="projectPlanList{{idx}}_remindName" name="projectPlanList[{{idx}}].remindName" readonly="readonly" style="text-align: center"  value="{{row.remindName}}" type="text" class="form-control contentDetail"/>
+                                    </td>
+
+                                    <td>
+                                        <input id="projectPlanList{{idx}}_finishName" name="projectPlanList[{{idx}}].finishName" readonly="readonly" style="text-align: center"  value="{{row.finishName}}" type="text" class="form-control contentDetail"/>
+                                    </td>
+                                </tr>//-->
+						</script>
+					</div>
+				</div>
+			</div>
 
 			<div class="form-group layui-row page-end"></div>
 		</form:form>
 	</div>
 </div>
+<script type="text/javascript">
+	var workClientBankRowIdx = 0,
+			workClientBankTpl = $("#workClientBankTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
+	$(document).ready(function () {
+		var dataBank = ${fns:toJson(projectRecords.projectPlanList)};
+		for (var i = 0; i < dataBank.length; i++) {
+			addRow('#projectPlanList', workClientBankRowIdx+1, workClientBankTpl, dataBank[i]);
+			workClientBankRowIdx = workClientBankRowIdx + 1;
+		}
+	});
+
+</script>
 </body>
 </html>

+ 6 - 3
src/main/webapp/webpage/modules/ruralprojectrecords/ruralporjectmessage/ruralProjectMessageList.jsp

@@ -334,7 +334,11 @@
                         var xml="";
                         if(d.canAdd != undefined && d.canAdd =="1")
                         {
-                            xml+="<a href=\"#\" onclick=\"openDialogre('新增报告', '${ctx}/ruralProject/ruralProjectMessage/form?projectId=" + d.id +"','95%', '95%','','送审,暂存,关闭')\" class=\"op-btn layui-bg-green\" ><i class=\"fa fa-plus\"></i> 新增报告</a>";
+                        	if(d.view =="true"){
+								xml+="<a href=\"#\" onclick=\"openDialogre('新增报告', '${ctx}/ruralProject/ruralProjectMessage/form?projectId=" + d.id +"','95%', '95%','','送审,暂存,关闭')\" class=\"op-btn layui-bg-green\" ><i class=\"fa fa-plus\"></i> 新增报告</a>";
+							}else{
+								xml+="<a href=\"javascript:void(0)\" onclick=\"openDialogre('新增报告', '${ctx}/ruralProject/ruralProjectMessage/form?projectId=" + d.id +"','95%', '95%','','送审,暂存,关闭')\" style=\"pointer-events: none;background-color:#c2c2c2;\" class=\"op-btn\" ><i class=\"fa fa-plus\"></i> 新增报告</a>";
+							}
                         }
                         if(d.canedit1 != undefined && d.canedit1 =="1")
                         {
@@ -420,8 +424,7 @@
                     ,"procId":"${projectRecords.processInstanceId}"
                     ,"projectReportName":"${projectRecords.projectReportName}"
                     ,"reportedState":"${projectRecords.reportedState}"
-                    ,"createId":"${projectRecords.createBy.id}"
-                    ,"loginId":"${fns:getUser().id}"
+                    ,"view":"${projectRecords.view}"
                     <c:choose>
                         <c:when test="${fns:getUser().id == projectRecords.leaderIds || fns:getUser().id eq projectRecords.createBy.id}">
                             ,"canAdd":<c:choose>