Procházet zdrojové kódy

公告创建时间可不填,添加长期公告功能

user5 před 4 roky
rodič
revize
33771a4a46

+ 9 - 0
src/main/java/com/jeeplus/modules/oa/entity/OaNotify.java

@@ -49,6 +49,7 @@ public class OaNotify extends ActEntity<OaNotify> {
     private String readFlagStr;	// 本人阅读状态
     private String state;//是否富文本 1是 2不是
 	private List<Workattachment> workAttachments;//附件
+	private Integer ext;//公告状态:0短期,1长期
 	private Date createStartDate;
 	private Date createEndDate;
 	private Date nowDate;
@@ -403,6 +404,14 @@ public class OaNotify extends ActEntity<OaNotify> {
 	public void setNotifyId(String notifyId) {
 		this.notifyId = notifyId;
 	}
+
+	public Integer getExt() {
+		return ext;
+	}
+
+	public void setExt(Integer ext) {
+		this.ext = ext;
+	}
 	/*	@Override
 	public String toString() {
 		return "OaNotify [type=" + type + ", title=" + title + ", content=" + content + ", files=" + files + ", status="

+ 68 - 18
src/main/java/com/jeeplus/modules/oa/service/OaNotifyService.java

@@ -165,10 +165,14 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
         List<OaNotify> oaNotifyList = dao.findList(oaNotify);
         for (OaNotify notify:oaNotifyList){
             if (StringUtils.isBlank(notify.getRemarks())) {
-                Long endDate = notify.getEndDate().getTime();
-                Long startDate = notify.getStartDate().getTime();
-                Long now = new Date().getTime();
-                if (startDate < now && endDate > now) {
+                if(0 == notify.getExt()){
+                    Long startDate = notify.getStartDate().getTime();
+                    Long endDate = notify.getEndDate().getTime();
+                    Long now = new Date().getTime();
+                    if (startDate < now && endDate > now){
+                        notify.setCandel("yes");
+                    }
+                }else{
                     notify.setCandel("yes");
                 }
             }
@@ -187,7 +191,7 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
     public Page<OaNotify> findUnreadMyself(Page<OaNotify> page, OaNotify oaNotify) {
         User user = UserUtils.getUser();
         oaNotify.setCurrentUser(user);
-
+        oaNotify.setNowDate(new Date());
         if(!user.isAdmin()){
             oaNotify.setCompany(user.getCompany());
         }
@@ -195,10 +199,14 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
         List<OaNotify> oaNotifyList = dao.findUnReadList(oaNotify);
         for (OaNotify notify:oaNotifyList){
             if (StringUtils.isBlank(notify.getRemarks())) {
-                Long endDate = notify.getEndDate().getTime();
-                Long startDate = notify.getStartDate().getTime();
-                Long now = new Date().getTime();
-                if (startDate < now && endDate > now) {
+                if(0 == notify.getExt()){
+                    Long startDate = notify.getStartDate().getTime();
+                    Long endDate = notify.getEndDate().getTime();
+                    Long now = new Date().getTime();
+                    if (startDate < now && endDate > now){
+                        notify.setCandel("yes");
+                    }
+                }else{
                     notify.setCandel("yes");
                 }
             }
@@ -220,10 +228,14 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
         List<OaNotify> oaNotifyList = dao.findReadList(oaNotify);
         for (OaNotify notify:oaNotifyList){
             if (StringUtils.isBlank(notify.getRemarks())) {
-                Long endDate = notify.getEndDate().getTime();
-                Long startDate = notify.getStartDate().getTime();
-                Long now = new Date().getTime();
-                if (startDate < now && endDate > now) {
+                if(0 == notify.getExt()){
+                    Long startDate = notify.getStartDate().getTime();
+                    Long endDate = notify.getEndDate().getTime();
+                    Long now = new Date().getTime();
+                    if (startDate < now && endDate > now){
+                        notify.setCandel("yes");
+                    }
+                }else{
                     notify.setCandel("yes");
                 }
             }
@@ -258,11 +270,17 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
         List<OaNotify> oaNotifyList = dao.findListByPc(oaNotify);
         for (OaNotify notify:oaNotifyList){
             if (StringUtils.isBlank(notify.getRemarks())) {
-                Long startDate = notify.getStartDate().getTime();
-                Long endDate = notify.getEndDate().getTime();
-                Long now = new Date().getTime();
-                if ("5".equals(notify.getStatus()) && startDate<now && endDate>now){
-                    notify.setCandel("yes");
+                if(0 == notify.getExt()){
+                    Long startDate = notify.getStartDate().getTime();
+                    Long endDate = notify.getEndDate().getTime();
+                    Long now = new Date().getTime();
+                    if ("5".equals(notify.getStatus()) && startDate<now && endDate>now){
+                        notify.setCandel("yes");
+                    }
+                }else{
+                    if ("5".equals(notify.getStatus())){
+                        notify.setCandel("yes");
+                    }
                 }
             }
             if (StringUtils.isNotBlank(notify.getContent())){
@@ -1597,4 +1615,36 @@ public class OaNotifyService extends CrudService<OaNotifyDao, OaNotify> {
     public void delete(OaNotify oaNotify){
         super.delete(oaNotify);
     }
+
+
+    @Transactional(readOnly = false)
+    public void cancellation(OaNotify oaNotify) {
+        if(oaNotify.getCompany()==null || StringUtils.isBlank(oaNotify.getCompany().getId())){
+            oaNotify.setCompany(UserUtils.getSelectCompany());
+        }
+        if (oaNotify.getOffice()==null || StringUtils.isBlank(oaNotify.getOffice().getId())){
+            oaNotify.setOffice(UserUtils.getSelectOffice());
+        }
+        String title = StringEscapeUtils.unescapeHtml4(oaNotify.getTitle());
+        String content = StringEscapeUtils.unescapeHtml4(oaNotify.getContent());
+        oaNotify.setTitle(title);
+        oaNotify.setContent(content);
+        String contents = "";
+        if (oaNotify!=null && oaNotify.getContents()!=null){
+            contents = StringEscapeUtils.unescapeHtml4(oaNotify.getContents());
+            oaNotify.setContents(contents);
+        }
+
+        if (StringUtils.isBlank(oaNotify.getNumber())){
+            oaNotify.setNumber(serialNumTplService.genSerialNum(UserUtils.getSelectCompany(), "17"));
+        }
+        super.save(oaNotify);
+        //保存附件
+        this.saveAttachments(oaNotify);
+        // 更新通知人
+        saveDetailList(oaNotify,0);
+        // 更新通知部门
+        saveDetailList(oaNotify,1);
+
+    }
 }

+ 3 - 1
src/main/java/com/jeeplus/modules/oa/web/OaNotifyController.java

@@ -179,6 +179,8 @@ public class OaNotifyController extends BaseController {
 		if (StringUtils.isNotBlank(oaNotify.getId())){
 			oaNotify = oaNotifyService.getRecordList2(oaNotify);
             oaNotifyService.queryDetails(oaNotify);
+		}else{
+			oaNotify.setExt(0);
 		}
 		if (oaNotify.getCreateDate() == null){
 			oaNotify.setCreateDate(new Date());
@@ -342,7 +344,7 @@ public class OaNotifyController extends BaseController {
 		oaNotifyService.deleteByOaNotifyId(oaNotify.getId());
 		oaNotify.setRemarks("关闭");
 		oaNotify.setCloseStatus(1);
-		oaNotifyService.save(oaNotify);
+		oaNotifyService.cancellation(oaNotify);
 		pushinfoService.updateDelflagByPushId(oaNotify.getId(),"1");
 		addMessage(redirectAttributes, "关闭通知成功");
 		return "redirect:" + adminPath + "/oa/oaNotify/list?repage";

+ 14 - 8
src/main/resources/mappings/modules/oa/OaNotifyDao.xml

@@ -26,7 +26,8 @@
 	    b.read_num ,
 	    b.un_read_num,
 	    u.name AS "createBy.name",
-	    o.top_company AS "office.name"
+	    o.top_company AS "office.name",
+	    a.ext as "ext"
 	</sql>
 	
 	<sql id="oaNotifyJoins">
@@ -118,7 +119,7 @@
 			AND a.create_date &lt;= #{createEndDate}
 		</if>
 		<if test="nowDate != null and nowDate != ''">
-			AND a.start_date &lt;= #{nowDate} AND a.end_date &gt;= #{nowDate}
+			AND (a.start_date &lt;= #{nowDate} or a.start_date is null) AND (a.end_date &gt;= #{nowDate} or a.end_date is null)
 		</if>
 
 		ORDER BY wo.id asc, a.update_date DESC
@@ -191,9 +192,8 @@
 			AND a.create_date &lt;= #{createEndDate}
 		</if>
 		<if test="nowDate != null and nowDate != ''">
-			AND a.start_date &lt;= #{nowDate} AND a.end_date &gt;= #{nowDate}
+			AND (a.start_date &lt;= #{nowDate} or a.start_date is null) AND (a.end_date &gt;= #{nowDate} or a.end_date is null)
 		</if>
-		and a.end_date &gt;= now()
 		ORDER BY wo.id asc,a.update_date DESC
 	</select>
 
@@ -267,7 +267,7 @@
 		<if test="nowDate != null and nowDate != ''">
 			AND a.start_date &lt;= #{nowDate} AND a.end_date &gt;= #{nowDate}
 		</if>
-		and a.end_date &lt; now()
+		and a.end_date &lt; now() or a.close_status = 1
 		ORDER BY a.update_date DESC
 	</select>
 
@@ -294,7 +294,8 @@
 		a.end_date AS "endDate",
 		a.number AS "number",
 		a.reference_number AS "referenceNumber",
-        a.process_instance_id AS "processInstanceId"
+        a.process_instance_id AS "processInstanceId",
+        a.ext as "ext"
 		FROM oa_notify a
 		LEFT JOIN sys_office o ON o.id = a.office_id
 		LEFT JOIN sys_office s ON s.id = a.company_id
@@ -394,7 +395,8 @@
 			DEL_FLAG,
 			close_status,
 			reference_number,
-			flag_office
+			flag_office,
+			ext
 		) VALUES (
 			#{id},
 			#{type},
@@ -417,7 +419,8 @@
 			#{delFlag},
 			#{closeStatus},
 			#{referenceNumber},
-			#{flagOffice}
+			#{flagOffice},
+			#{ext}
 		)
 	</insert>
 	
@@ -447,6 +450,9 @@
 			<if test="referenceNumber != null and referenceNumber != ''">
 				,reference_number = #{referenceNumber}
 			</if>
+			<if test="ext != null">
+				,ext = #{ext}
+			</if>
 		WHERE id = #{id}
 	</update>
 	<update id="saveRemarks">

+ 37 - 14
src/main/webapp/webpage/modules/oa/oaNotifyAudit.jsp

@@ -6,6 +6,8 @@
     <meta name="decorator" content="default"/>
     <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
     <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
+    <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
     <style type="text/css">
         img {width: 50px; height: 50px;}
     </style>
@@ -49,6 +51,14 @@
             });
             //只做查看时,禁用掉以下标签
             <%--$('input,textarea,select').attr('disabled',<%=request.getAttribute("disabled")%>);--%>
+                var ext = ${oaNotify.ext};
+                if (ext == 1) {
+                    $("#ext1").attr("checked",true);
+                    $("#divv").hide();
+                }else{
+                    $("#ext").attr("checked",true);
+                    $("#divv").show();
+                }
 
         });
     </script>
@@ -132,7 +142,18 @@
             <form:hidden path="act.procInsId"/>
             <form:hidden path="act.procDefId"/>
             <form:hidden id="flag" path="act.flag"/>
-
+            <div class="form-group layui-row first">
+                <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">公告状态:</label>
+                        <div class="layui-input-block">
+                            <input type="radio" title="短期" lay-filter="ext" checked name="ext" id="ext" value="0" disabled>
+                            <input type="radio" title="长期" lay-filter="ext" name="ext" id="ext1" value="1" disabled>
+                        </div>
+                    </div>
+                </div>
+            </div>
             <div class="form-group layui-row first">
                 <div class="form-group-label"><h2>公告信息</h2></div>
                 <div class="layui-item layui-col-sm6">
@@ -164,20 +185,22 @@
                                value="<fmt:formatDate value="${oaNotify.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
                     </div>
                 </div>
-                <div class="layui-item layui-col-sm6">
-                    <label class="layui-form-label">开始日期:</label>
-                    <div class="layui-input-block">
-                        <input id="startDate" name="startDate" htmlEscape="false" readonly="true"
-                               class="laydate-icondate form-control layer-date layui-input laydate-icon required"
-                               value="<fmt:formatDate value="${oaNotify.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
+                <div id="divv">
+                    <div class="layui-item layui-col-sm6">
+                        <label class="layui-form-label">开始日期:</label>
+                        <div class="layui-input-block">
+                            <input id="startDate" name="startDate" htmlEscape="false" readonly="true"
+                                   class="laydate-icondate form-control layer-date layui-input laydate-icon"
+                                   value="<fmt:formatDate value="${oaNotify.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
+                        </div>
                     </div>
-                </div>
-                <div class="layui-item layui-col-sm6">
-                    <label class="layui-form-label">结束日期:</label>
-                    <div class="layui-input-block">
-                        <input id="endDate" name="endDate" htmlEscape="false" readonly="true"
-                               class="laydate-icondate form-control layer-date layui-input laydate-icon required"
-                               value="<fmt:formatDate value="${oaNotify.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
+                    <div class="layui-item layui-col-sm6">
+                        <label class="layui-form-label">结束日期:</label>
+                        <div class="layui-input-block">
+                            <input id="endDate" name="endDate" htmlEscape="false" readonly="true"
+                                   class="laydate-icondate form-control layer-date layui-input laydate-icon"
+                                   value="<fmt:formatDate value="${oaNotify.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
+                        </div>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6">

+ 63 - 13
src/main/webapp/webpage/modules/oa/oaNotifyForm.jsp

@@ -8,6 +8,8 @@
         img {width: 50px; height: 50px;}
     </style>
     <script type="text/javascript" src="${ctxStatic}/ckeditor/ckeditor.js"></script>
+    <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
     <script type="text/javascript" language="JavaScript" for="window" event="onload">
         var validateForm;
         function doSubmit(i){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
@@ -64,16 +66,26 @@
                 elem: '#startDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                 event: 'focus', //响应事件。如果没有传入event,则按照默认的click
                 type : 'datetime'
+                , trigger: 'click'
             });
             laydate.render({
                 elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                 event: 'focus', //响应事件。如果没有传入event,则按照默认的click
                 type : 'datetime'
+                , trigger: 'click'
             });
             $("#attachment_btn").click(function () {
                 $("#attachment_file").click();
             });
 
+            var ext = ${oaNotify.ext};
+            if (ext == 1) {
+                $("#ext1").attr("checked",true);
+                $("#divv").hide();
+            }else{
+                $("#ext").attr("checked",true);
+                $("#divv").show();
+            }
         });
     </script>
     <script type="text/javascript">
@@ -147,11 +159,22 @@
 <body >
 <div class="single-form">
     <div class="container">
-        <form:form id="inputForm" modelAttribute="oaNotify" enctype="multipart/form-data" action="${ctx}/oa/oaNotify/save" method="post" class="form-horizontal">
+        <form:form id="inputForm" modelAttribute="oaNotify" enctype="multipart/form-data" action="${ctx}/oa/oaNotify/save" method="post" class="form-horizontal layui-form">
             <form:hidden path="id"/>
             <form:hidden path="flagOffice"/>
             <sys:message content="${message}"/>
-
+            <div class="form-group layui-row first">
+                <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">公告状态:</label>
+                        <div class="layui-input-block">
+                            <input type="radio" title="短期" lay-filter="ext" checked name="ext" id="ext" value="0">
+                            <input type="radio" title="长期" lay-filter="ext" name="ext" id="ext1" value="1">
+                        </div>
+                    </div>
+                </div>
+            </div>
             <div class="form-group layui-row first">
                 <div class="form-group-label"><h2>通告信息</h2></div>
                 <div class="layui-item layui-col-sm6">
@@ -174,18 +197,20 @@
                         </form:select>
                     </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="startDate" name="startDate" style="background-color: #ffffff;" readonly="true" htmlEscape="false"  class="laydate-icondate form-control layer-date layui-input laydate-icon required"
-                               value="<fmt:formatDate value="${oaNotify.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
+                <div id="divv">
+                    <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="startDate" name="startDate" style="background-color: #ffffff;" readonly="true" htmlEscape="false"  class="laydate-icondate form-control layer-date layui-input laydate-icon required"
+                                   value="<fmt:formatDate value="${oaNotify.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
+                        </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">
-                        <input id="endDate" name="endDate" style="background-color: #ffffff;" readonly="true" htmlEscape="false"  class="laydate-icondate form-control layer-date layui-input laydate-icon required"
-                               value="<fmt:formatDate value="${oaNotify.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
+                    <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="endDate" name="endDate" style="background-color: #ffffff;" readonly="true" htmlEscape="false"  class="laydate-icondate form-control layer-date layui-input laydate-icon required"
+                                   value="<fmt:formatDate value="${oaNotify.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
+                        </div>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6">
@@ -396,5 +421,30 @@
         </form:form>
     </div>
 </div>
+<script>
+    layui.use(['form', 'layer'], function () {
+        var form = layui.form;
+        //有无合同监听器
+        layui.form.on('radio(ext)', function(data){
+            var span=data.value;
+            if(span==0){
+                $("#divv").show();
+            }else{
+                $("#divv input").val('');
+                $("#divv").hide();
+            }
+        });
+    });
+    $("input[name='ext']").on('ifChecked',function(event){
+        radioVal = $(this).val();
+        if(radioVal == 0){
+            //选择持久状态
+            $("#divv").show();
+        }else{
+            $("#divv input").val('');
+            $("#divv").hide();
+        }
+    });
+</script>
 </body>
 </html>

+ 63 - 13
src/main/webapp/webpage/modules/oa/oaNotifyModifyApply.jsp

@@ -8,6 +8,8 @@
         img {width: 50px; height: 50px;}
     </style>
     <script type="text/javascript" src="${ctxStatic}/ckeditor/ckeditor.js"></script>
+    <script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
+    <link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
     <script type="text/javascript" language="JavaScript" for="window" event="onload">
         var validateForm;
         function doSubmit(){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
@@ -53,17 +55,27 @@
                     }
                 }
             });
+            var ext = ${oaNotify.ext};
+            if (ext == 1) {
+                $("#ext1").attr("checked",true);
+                $("#divv").hide();
+            }else{
+                $("#ext").attr("checked",true);
+                $("#divv").show();
+            }
             //只做查看时,禁用掉以下标签
             $('input,textarea,select').attr('disabled',<%=request.getAttribute("disabled")%>);
             laydate.render({
                 elem: '#startDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                 event: 'focus', //响应事件。如果没有传入event,则按照默认的click
                 type : 'datetime'
+                , trigger: 'click'
             });
             laydate.render({
                 elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                 event: 'focus', //响应事件。如果没有传入event,则按照默认的click
                 type : 'datetime'
+                , trigger: 'click'
             });
             $("#attachment_btn").click(function () {
                 $("#attachment_file").click();
@@ -142,7 +154,7 @@
 <body >
 <div class="single-form">
     <div class="container">
-        <form:form id="inputForm" modelAttribute="oaNotify" enctype="multipart/form-data" action="${ctx}/oa/oaNotify/saveAudit" method="post" class="form-horizontal">
+        <form:form id="inputForm" modelAttribute="oaNotify" enctype="multipart/form-data" action="${ctx}/oa/oaNotify/saveAudit" method="post" class="form-horizontal layui-form">
             <form:hidden path="id"/>
             <form:hidden path="home"/>
             <form:hidden path="act.taskId"/>
@@ -151,7 +163,18 @@
             <form:hidden path="act.procInsId"/>
             <form:hidden path="act.procDefId"/>
             <form:hidden id="flag" path="act.flag"/>
-
+            <div class="form-group layui-row first">
+                <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">公告状态:</label>
+                        <div class="layui-input-block">
+                            <input type="radio" title="短期" lay-filter="ext" checked name="ext" id="ext" value="0" disabled>
+                            <input type="radio" title="长期" lay-filter="ext" name="ext" id="ext1" value="1" disabled>
+                        </div>
+                    </div>
+                </div>
+            </div>
             <div class="form-group layui-row first">
                 <div class="form-group-label"><h2>通告信息</h2></div>
                 <div class="layui-item layui-col-sm6">
@@ -174,18 +197,20 @@
                         </form:select>
                     </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="startDate" name="startDate" style="background-color: #ffffff;" readonly="true" htmlEscape="false"  class="laydate-icondate form-control layer-date layui-input laydate-icon required"
-                               value="<fmt:formatDate value="${oaNotify.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
+                <div id="divv">
+                    <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="startDate" name="startDate" style="background-color: #ffffff;" readonly="true" htmlEscape="false"  class="laydate-icondate form-control layer-date layui-input laydate-icon required"
+                                   value="<fmt:formatDate value="${oaNotify.startDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
+                        </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">
-                        <input id="endDate" name="endDate" style="background-color: #ffffff;" readonly="true" htmlEscape="false"  class="laydate-icondate form-control layer-date layui-input laydate-icon required"
-                               value="<fmt:formatDate value="${oaNotify.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
+                    <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="endDate" name="endDate" style="background-color: #ffffff;" readonly="true" htmlEscape="false"  class="laydate-icondate form-control layer-date layui-input laydate-icon required"
+                                   value="<fmt:formatDate value="${oaNotify.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
+                        </div>
                     </div>
                 </div>
                 <div class="layui-item layui-col-sm6">
@@ -403,5 +428,30 @@
         </form:form>
     </div>
 </div>
+<script>
+    layui.use(['form', 'layer'], function () {
+        var form = layui.form;
+        //有无合同监听器
+        layui.form.on('radio(ext)', function(data){
+            var span=data.value;
+            if(span==0){
+                $("#divv").show();
+            }else{
+                $("#divv input").val('');
+                $("#divv").hide();
+            }
+        });
+    });
+    $("input[name='ext']").on('ifChecked',function(event){
+        radioVal = $(this).val();
+        if(radioVal == 0){
+            //选择持久状态
+            $("#divv").show();
+        }else{
+            $("#divv input").val('');
+            $("#divv").hide();
+        }
+    });
+</script>
 </body>
 </html>

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

@@ -115,7 +115,6 @@
                         $("#divv").show();
                         $("#divv3").show();
                     }else{
-                        var h=$("#d1").html();
                         $("#contractIdId").val("");
                         $("#contractIdName").val("");
                         $("#contractName").val("");