user5 5 лет назад
Родитель
Сommit
09704ce873

+ 1 - 0
src/main/java/com/jeeplus/modules/projectplanweekly/service/ProjectPlanWeeklyService.java

@@ -80,6 +80,7 @@ public class ProjectPlanWeeklyService extends CrudService<ProjectPlanWeeklyDao,
             if (boolResult){
                 weekly = projectPlanWeeklyDao.findWeeklyByStaff(entity);
             }else{
+                entity.getSqlMap().put("userId", "'"+entity.getCurrentUser().getId()+"'");
                 weekly = projectPlanWeeklyDao.findWeekly(entity);
             }
         }else{

+ 6 - 2
src/main/resources/mappings/modules/projectplanweekly/ProjectPlanWeeklyDao.xml

@@ -275,6 +275,7 @@
 				AND a.weekly_status = #{weeklyStatus}
 				and (#{beginDate} between a.begin_date and a.end_date
 				 or #{endDate} between a.begin_date and a.end_date
+				or (a.begin_date >=#{beginDate} and a.end_date &lt;=#{endDate})
 				)
 			</if>
 			 and (wpu.user_id = #{currentUser.id} ${sqlMap.dsf})
@@ -284,7 +285,9 @@
 				ORDER BY ${page.orderBy}
 			</when>
 			<otherwise>
-				ORDER BY a.weekly_status asc,a.begin_date asc,a.end_date asc
+				ORDER BY
+				case when wpu.user_id=${sqlMap.userId} then 1 else 2 end,
+				a.begin_date asc,a.end_date asc
 			</otherwise>
 		</choose>
 	</select>
@@ -339,9 +342,10 @@
                 AND a.weekly_status = #{weeklyStatus}
                 and ((#{beginDate} between a.begin_date and a.end_date
                 or #{endDate} between a.begin_date and a.end_date
+				or (a.begin_date >=#{beginDate} and a.end_date &lt;=#{endDate})
                 )
             </if>
-            ${sqlMap.dsf})
+            )
         </where>
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">

+ 72 - 0
src/main/webapp/webpage/modules/projectrecord/projectRecordsAudit.jsp

@@ -96,6 +96,28 @@
                 }
             });
         }
+        function addPlanRow(list, idx, tpl, row){
+            // var idx1 = $("#workClientLinkmanList tr").length;
+            bornTempletePlan(list, idx, tpl, row, idx);
+        }
+
+        function bornTempletePlan(list, idx, tpl, row, idx1){
+            $(list).append(Mustache.render(tpl, {
+                idx: idx, delBtn: true, row: row,
+                order:idx1 + 1
+            }));
+            $(list+idx).find("select").each(function(){
+                $(this).val($(this).attr("data-value"));
+            });
+            $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
+                var ss = $(this).attr("data-value").split(',');
+                for (var i=0; i<ss.length; i++){
+                    if($(this).val() == ss[i]){
+                        $(this).attr("checked","checked");
+                    }
+                }
+            });
+        }
 	</script>
 </head>
 <body >
@@ -334,6 +356,40 @@
 						<textarea htmlEscape="false" rows="4" readonly="true" maxlength="1000" class="form-control" >${projectRecords.remarks}</textarea>
 					</div>
 				</div>
+				<div class="layui-item layui-col-sm12 lw7">
+					<label class="layui-form-label"><span class="require-item">*</span>项目计划书:</label>
+					<div class="layui-input-block">
+						<table id="bankinfo" class="table table-bordered table-condensed no-bottom-margin details">
+							<thead>
+							<tr>
+								<th width="20%">开始时间</th>
+								<th width="20%">结束时间</th>
+								<th width="60%;">工作内容</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>
+                                    {{row.beginDate}}
+                                </td>
+                                <td>
+                                    {{row.endDate}}
+                                </td>
+                                <td>
+                                    {{row.remarks}}
+                                </td>
+                            </tr>//-->
+						</script>
+					</div>
+				</div>
 			</div>
 
 
@@ -544,5 +600,21 @@
 			</div>
 	</div>
 </div>
+<script type="text/javascript">
+    var workClientLinkmanRowIdx = 0,
+        workClientLinkmanTpl = $("#workClientLinkmanTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
+    var workClientBankRowIdx = 0,
+        workClientBankTpl = $("#workClientBankTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g, "");
+    $(document).ready(function () {
+        var data = ${fns:toJson(projectRecords.projectPlanList)};
+        if (null!=data){
+            for (var i = 0; i < data.length; i++) {
+                addPlanRow('#projectPlanList', workClientBankRowIdx, workClientBankTpl, data[i]);
+                workClientBankRowIdx = workClientBankRowIdx + 1;
+            }
+        }
+    });
+
+</script>
 </body>
 </html>