소스 검색

报销申请-报销详情

[user3] 4 년 전
부모
커밋
f2ca4df31a

+ 2 - 1
src/main/java/com/jeeplus/modules/workreimbursement/web/WorkReimbursementController.java

@@ -780,7 +780,7 @@ public class WorkReimbursementController extends BaseController {
 	 * 选择报销项目
 	 */
 	@RequestMapping(value = "selectReproject")
-	public String selectReproject(String userId,ProjectRecords projectId, String url, String fieldLabels, String fieldKeys, String searchLabel, String searchKey, HttpServletRequest request, HttpServletResponse response, Model model) {
+	public String selectReproject(String userId,ProjectRecords projectId, String url, String fieldLabels, String fieldKeys, String searchLabel, String searchKey, String extid, HttpServletRequest request, HttpServletResponse response, Model model) {
 		projectId.setCompany(UserUtils.getSelectCompany());
 		Page<ProjectRecords> page = projectRecordsService.ruralFindPageByReimbur(new Page<ProjectRecords>(request, response), projectId,userId);
 		try {
@@ -801,6 +801,7 @@ public class WorkReimbursementController extends BaseController {
 		model.addAttribute("obj", projectId);
 		model.addAttribute("allowInput", true);
 		model.addAttribute("page", page);
+		model.addAttribute("extId", extid);
 		return "modules/sys/gridselectcallprojectOnReimbur";
 		//return "modules/sys/gridselect";
 	}

+ 8 - 0
src/main/java/com/jeeplus/modules/workreimbursement/web/WorkReimbursementTypeController.java

@@ -172,4 +172,12 @@ public class WorkReimbursementTypeController extends BaseController {
         }
         return mapList;
     }
+    @ResponseBody
+    @RequestMapping(value = "projectCharge")
+    public String projectCharge(String pids,Model model) {
+        String pid=pids.split(",")[1];
+        model.addAttribute("projectCharge",pid);
+        return pid;
+    }
+
 }

+ 46 - 34
src/main/webapp/WEB-INF/tags/sys/reimburselectReproject.tag

@@ -14,47 +14,59 @@
 <%@ attribute name="cssClass" type="java.lang.String" required="false" description="css样式"%>
 <%@ attribute name="cssStyle" type="java.lang.String" required="false" description="css样式"%>
 <%@ attribute name="disabled" type="java.lang.String" required="false" description="是否限制选择,如果限制,设置为disabled"%>
+<%@ attribute name="extId" type="java.lang.String" required="false" description="项目类型编号"%>
+<%@ attribute name="area" type="java.lang.String" required="false" description="大小"%>
+
 <script type="text/javascript">
 	function searchGrid${id}(){
-var  userId=$("#submitterIdId").val();
-	top.layer.open({
-	    type: 2,
-	    area: ['90%','90%'],
-	    title:"${title}",
-	    name:'friend',
-		skin:"two-btns",
-	    content: encodeURI("${url}?userId="+userId+"&fieldLabels=${fieldLabels}&fieldKeys=${fieldKeys}&url=${url}&searchLabel=${searchLabel}&searchKey=${searchKey}"),
-	    btn: ['确定', '关闭'],
-	    yes: function(index, layero){
-	    	 var iframeWin = layero.find('iframe')[0].contentWindow; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
-	    	 var item = iframeWin.getSelectedItem();
-			console.log(item);
-	    	 if(item == "-1"){
-		    	 return;
-	    	 }
-	    	 var items = item.split('_item_');
-			console.log(items)
-			//判断是否选择报销项目
-			if(items[0] == 1){
-				$("#${id}Radio").val(items[0]);
-				$("#${id}Id").val(items[1]);
-				$("#${id}Name").val(items[2]);
-				$("#${id}ReportNumber").val(items[3]);
-			}else{
-				$("#${id}Radio").val(items[0]);
-				$("#${id}Name").val(items[1]);
-				$("#${id}ReportNumber").val("");
+	var  userId=$("#submitterIdId").val();
+	var extid=$("#${id}extId").val();
+	var area=$("#${id}area").val();
+	if (extid!=null && extid != ''){
+		top.layer.open({
+			type: 2,
+			area: ['80%','80%'],
+			title:"${title}",
+			name:'friend',
+			skin:"two-btns",
+			content: encodeURI("${url}?userId="+userId+"&fieldLabels=${fieldLabels}&fieldKeys=${fieldKeys}&url=${url}&searchLabel=${searchLabel}&searchKey=${searchKey}&extid="+extid),
+			btn: ['确定', '关闭'],
+			yes: function(index, layero){
+				var iframeWin = layero.find('iframe')[0].contentWindow; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
+				var item = iframeWin.getSelectedItem();
+				console.log(item);
+				if(item == "-1"){
+					return;
+				}
+				var items = item.split('_item_');
+				console.log(items)
+				//判断是否选择报销项目
+				if(items[0] == 1){
+					$("#${id}Radio").val(items[0]);
+					$("#${id}Id").val(items[1]);
+					$("#${id}Name").val(items[2]);
+					$("#${id}ReportNumber").val(items[3]);
+				}else{
+					$("#${id}Radio").val(items[0]);
+					$("#${id}Name").val(items[1]);
+					$("#${id}ReportNumber").val("");
+				}
+				top.layer.close(index);//关闭对话框。
+				//setValue(item.split('_item_')[0]);
+			},
+			cancel: function(index){
 			}
-			 top.layer.close(index);//关闭对话框。
-             //setValue(item.split('_item_')[0]);
-		  },
-		  cancel: function(index){ 
-	       }
-	}); 
+		});
+	// }else{
+	// 	top.layer.msg("请先选择报销类型", {icon: 0});
+	}
+
 };
 </script>
 
 	<input id="${id}Id" name="${name}"  type="hidden" value="${value}"/>
+	<input id="${id}extId" name="${extId}"  type="hidden" value="${extId}"/>
+	<input id="${id}area" name="${area}"  type="hidden" value="${area}"/>
 	<div class="input-group">
 		<input id="${id}Name" placeholder="${title}" name="${labelName }" ${allowInput?'':'readonly="readonly"'}  onclick="searchGrid${id}()" type="text" value="${labelValue}" data-msg-required="${dataMsgRequired}"
 		class="${cssClass}" style="background-color: #ffffff; ${cssStyle}"/>

+ 8 - 1
src/main/webapp/WEB-INF/tags/sys/treeselectAccessoryNoParent.tag

@@ -23,6 +23,7 @@
 <%@ attribute name="disabled" type="java.lang.String" required="false" description="是否限制选择,如果限制,设置为disabled"%>
 <%@ attribute name="dataMsgRequired" type="java.lang.String" required="false" description=""%>
 	<input id="${id}Id" name="${name}" class="${cssClass}" type="hidden" value="${value}"/>
+	<input id="${id}Pids" name="pids" class="${cssClass}" type="hidden" value="${value}"/>
 	<div class="input-group">
 		<input id="${id}Name" name="${labelName}" placeholder="${title}" ${allowInput?'':'readonly="true"'}  type="text" value="${labelValue}" data-msg-required="${dataMsgRequired}"
 		class="${cssClass}" style="background-color: #ffffff; ${cssStyle}"/>
@@ -51,6 +52,7 @@
 						}else{
 							nodes = tree.getSelectedNodes();
 						}
+						console.log(nodes)
 						for(var i=0; i<nodes.length; i++) {//<c:if test="${checked && notAllowSelectParent}">
 							if (nodes[i].isParent){
 								continue; // 如果为复选框选择,则过滤掉父节点
@@ -76,13 +78,18 @@
 								return false;
 							}//</c:if>
 							ids.push(nodes[i].id);
-							names.push(nodes[i].name);//<c:if test="${!checked}">
+							names.push(nodes[i].name);
+							$("#${id}Pids").val(nodes[i].pIds);
+							//<c:if test="${!checked}">
 							break; // 如果为非复选框选择,则返回第一个选择  </c:if>
 						}
 						$("#${id}Id").val(ids.join(",").replace(/u_/ig,""));
 						$("#${id}Name").val(names.join(","));
 						$("#${id}Name").focus();
 						setParentInfo($("#${id}Id").val());
+						var id="${id}";
+						setPids($("#${id}Pids").val(),id);
+						console.log(index)
 						top.layer.close(index);
 				    	       },
     	cancel: function(index){ //或者使用btn2

+ 59 - 56
src/main/webapp/webpage/modules/sys/gridselectcallprojectOnReimbur.jsp

@@ -6,41 +6,41 @@
 	<script type="text/javascript">
 		$(document).ready(function() {
 
-            <%--var val = "<%=request.getAttribute("state")%>";--%>
-            <%--if(val!=null){--%>
-                <%--alert("++++++++++");--%>
+			<%--var val = "<%=request.getAttribute("state")%>";--%>
+			<%--if(val!=null){--%>
+			<%--alert("++++++++++");--%>
 			<%--};--%>
 
-            $('#contentTable thead tr th input.i-checks').on('ifChecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
-			    	  $('#contentTable tbody tr td input.i-checks').iCheck('check');
-			    	});
+			$('#contentTable thead tr th input.i-checks').on('ifChecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
+				$('#contentTable tbody tr td input.i-checks').iCheck('check');
+			});
 
-			    $('#contentTable thead tr th input.i-checks').on('ifUnchecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定 
-			    	  $('#contentTable tbody tr td input.i-checks').iCheck('uncheck');
-			    	});
+			$('#contentTable thead tr th input.i-checks').on('ifUnchecked', function(event){ //ifCreated 事件应该在插件初始化之前绑定
+				$('#contentTable tbody tr td input.i-checks').iCheck('uncheck');
+			});
 			$("#td4").addClass("hide");
 
-			 $("input[name='ext']").on('ifChecked', function(event){
-                 var radioVal = $(this).val();
-                 if(radioVal == 1){
-                     $("#td1").removeClass("hide");
-                     $("#td2").removeClass("hide");
-                     $("#td3").removeClass("hide");
-                     $("#td4").addClass("hide");
-                     $("#tr1").show()
-                 }else{
-                     $("#td1").addClass("hide");
-                     $("#td2").addClass("hide");
-                     $("#td3").addClass("hide");
-                     $("#td4").removeClass("hide");
-                     $("#tr1").hide()
-                 }
-             });
-		});
+			// $("input[name='ext']").on('ifChecked', function(event){
+				var radioVal = ${extId};
+				if(radioVal == 1){
+					$("#td1").removeClass("hide");
+					$("#td2").removeClass("hide");
+					$("#td3").removeClass("hide");
+					$("#td4").addClass("hide");
+					$("#tr1").show()
+				}else{
+					$("#td1").addClass("hide");
+					$("#td2").addClass("hide");
+					$("#td3").addClass("hide");
+					$("#td4").removeClass("hide");
+					$("#tr1").hide()
+				}
+			});
+		// });
 
 		function getSelectedItem() {
 			//获取单选框中得值
-			var radio = $("input[type='radio']:checked").val();
+			var radio = ${extId};
 			if (radio == 1){
 				var size = $("#contentTable tbody tr td input.i-checks:checked").size();
 				if (size == 0) {
@@ -58,6 +58,7 @@
 				var number = $("#contentTable tbody tr td input.i-checks:checkbox:checked").parent().parent().parent().find(".codenumber").html();
 				return radio + "_item_" +id + "_item_" + label + "_item_" + number;
 			}else{
+				radio=0;
 				var reimburseRemarks = $("#reimburseRemarks").val();
 				if(reimburseRemarks == undefined || reimburseRemarks == null || reimburseRemarks == ''){
 					top.layer.msg("请输入报销详情")
@@ -70,8 +71,8 @@
 			if(s) $("#pageSize").val(s);
 			$("#searchForm").attr("action","${url}");
 			$("#searchForm").submit();
-	    	return false;
-	    }
+			return false;
+		}
 	</script>
 </head>
 <body>
@@ -91,15 +92,16 @@
 					<div id="td3">
 						<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
 					</div>
-					<div class="commonQuery">
-						<div class="layui-input-block">
-							<input type="radio" class="i-checks" name="ext" checked id="ext" value="1">
-							<label for="ext">项目报销</label>
-							<input type="radio" class="i-checks" name="ext" id="ext1" value="0">
-							<label for="ext1">非项目报销</label>
-						</div>
-					</div>
+<%--					<div class="commonQuery">--%>
+<%--						<div class="layui-input-block">--%>
+<%--							<input type="radio" class="i-checks" name="ext" checked id="ext" value="1">--%>
+<%--							<label for="ext">项目报销</label>--%>
+<%--							<input type="radio" class="i-checks" name="ext" id="ext1" value="0">--%>
+<%--							<label for="ext1">非项目报销</label>--%>
+<%--						</div>--%>
+<%--					</div>--%>
 					<div id="td1" class="commonQuery">
+						<div class="form-group-label"><h2>项目报销</h2></div>
 						<div class="layui-item query athird">
 							<span class="layui-form-label">项目名称:</span>
 							<div class="layui-input-block">
@@ -115,6 +117,7 @@
 						<div style="    clear:both;"></div>
 					</div>
 					<div id="td4" class="commonQuery">
+						<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">
@@ -143,31 +146,31 @@
 					<tbody>
 					<c:choose>
 						<c:when test="${not empty page.list}">
-					<c:forEach items="${page.list}" var="obj">
-						<tr>
-							<td> <input type="checkbox" id="${fns:getValue(obj, 'id')}" class="i-checks"></td>
-							<td class="codelabel">${obj.projectName}</td>
-							<td class="codeprojectId">${obj.projectId}</td>
-							<td class="codeCName">${obj.workContractInfo.name}</td>
-							<td class="codenumber">${obj.reportData.number}</td>
-							<td class="codeCCName">${obj.workContractInfo.client.name}</td>
-						</tr>
-					</c:forEach>
-					</c:when>
-					<c:otherwise>
-						<tr>
-							<td colspan="5" align="center">
-								暂无数据
-							</td>
-						</tr>
-					</c:otherwise>
+							<c:forEach items="${page.list}" var="obj">
+								<tr>
+									<td> <input type="checkbox" id="${fns:getValue(obj, 'id')}" class="i-checks"></td>
+									<td class="codelabel">${obj.projectName}</td>
+									<td class="codeprojectId">${obj.projectId}</td>
+									<td class="codeCName">${obj.workContractInfo.name}</td>
+									<td class="codenumber">${obj.reportData.number}</td>
+									<td class="codeCCName">${obj.workContractInfo.client.name}</td>
+								</tr>
+							</c:forEach>
+						</c:when>
+						<c:otherwise>
+							<tr>
+								<td colspan="5" align="center">
+									暂无数据
+								</td>
+							</tr>
+						</c:otherwise>
 					</c:choose>
 					</tbody>
 				</table>
 				<table:page page="${page}"></table:page>
+			</div>
 		</div>
 	</div>
-	</div>
 </div>
 </body>
 </html>

+ 33 - 16
src/main/webapp/webpage/modules/workreimbursement/workReimbursementAllFormAdd.jsp

@@ -480,6 +480,22 @@
                 }
             })
         }
+        function setPids(pIds,id){
+            $.ajax({
+                url:"${ctx}/reimbursementType/reimbursementType/projectCharge",
+                dataType:"json",
+                data:{pids:pIds},
+                success:function (data) {
+                    var pid=pIds.split(',')[1];
+                    var sid="#"+id+"Name"
+                    if(data==1){
+                        $(sid).parent().parent().parent().parent().find("td").eq(4).find("input").eq(1).val(pid);
+                    }else {
+                        $(sid).parent().parent().parent().parent().find("td").eq(4).find("input").eq(1).val(pid);
+                    }
+                }
+            })
+        }
     </script>
     <style>
         /*超过5个汉字,调整label的长度,以下是配套的*/
@@ -643,9 +659,9 @@
                         <%--<th width="60px">编号</th>--%>
                         <th width="200px"><font color="red">*</font>报销人</th>
                         <th width="200px">报销部门</th>
+                        <th width="200px">报销类型</th>
                         <th width="200px">报销项目</th>
                         <th width="200px">报告号</th>
-                        <th width="200px">报销类型</th>
                         <th width="200px"><font color="red">*</font>费用(元)</th>
                         <th width="200px">收据张数</th>
                         <th width="200px">出差天数</th>
@@ -678,22 +694,22 @@
                                     <input id="workAccountList${index.index}_reimbursementNameofficeId"  name="workAccountList[${index.index}].officeId" maxlength="32" type="text" value="${workAccount.officeId}" readonly="readonly"  class="form-control required"/>
                                 </td>
 
-
+                                <td style="text-align:center;">
+                                    <div class="project_reimbursement_div"  style="width: 200px">
+                                        <sys:treeselectAccessoryNoParent id="workAccountList${index.index}_type" name="workAccountList[${index.index}].type" value="${workAccount.type}" labelName="workAccountList[${index.index}].typeName" labelValue="${workAccount.typeName}"
+                                                                         title="报销类别" url="/reimbursementType/reimbursementType/treeData" extId=""  cssClass="form-control  layui-input" allowClear="true" notAllowSelectParent="true"/>
+                                    </div>
+                                </td>
                                 <td>
                                     <div class="not_project_reimbursement_div"  style="width: 200px">
                                         <sys:reimburselectReproject url="${ctx}/workreimbursement/workReimbursementAll/selectReproject" id="workAccountList${index.index}_project" name="workAccountList[${index.index}].project.id"  value="${workAccount.project.id}"  title="选择报销项目" labelName="workAccountList[${index.index}].project.projectName"
-                                                                    labelValue="${workAccount.project.projectName}" cssClass="form-control layui-input" fieldLabels="工程" fieldKeys="projectName" searchLabel="工程名称" searchKey="projectName" />
+                                                                    labelValue="${workAccount.project.projectName}" extId="${workAccount.projectRadio}" cssClass="form-control layui-input" fieldLabels="工程" fieldKeys="projectName" searchLabel="工程名称" searchKey="projectName" />
                                     </div>
                                 </td>
                                 <td>
                                     <input id="workAccountList${index.index}_projectReportNumber"  name="workAccountList[${index.index}].projectReportNumber" type="text" value="${workAccount.projectReportNumber}" maxlength="32" readonly="readonly"  class="form-control"/>
                                 </td>
-                                <td style="text-align:center;">
-                                    <div class="project_reimbursement_div"  style="width: 200px">
-                                        <sys:treeselectAccessoryNoParent id="workAccountList${index.index}_type" name="workAccountList[${index.index}].type" value="${workAccount.type}" labelName="workAccountList[${index.index}].typeName" labelValue="${workAccount.typeName}"
-                                                                         title="报销类别" url="/reimbursementType/reimbursementType/treeData" extId=""  cssClass="form-control  layui-input" allowClear="true" notAllowSelectParent="true"/>
-                                    </div>
-                                </td>
+
 
                                 <td>
                                     <input id="workAccountList${index.index}_money" onchange="getMoney(this.value)" name="workAccountList[${index.index}].money" type="text" value="${workAccount.money}"  placeholder="请输入金额" maxlength="10"  class="form-control number required"/>
@@ -757,21 +773,22 @@
                                 <input id="workAccountList{{idx}}_reimbursementNameofficeId"  type="text" value="{{row.officeId}}" maxlength="32" readonly="readonly"  class="form-control"/>
                             </div>
                         </td>
+                        <td style="text-align:center;">
+                            <div class="project_reimbursement_div"  style="width: 200px">
+                                <sys:treeselectAccessoryNoParent id="workAccountList{{idx}}_type" name="workAccountList[{{idx}}].type" value="${workReimbursement.workReimbursementTypeInfo.id}" labelName="workAccountList[{{idx}}].typeName" labelValue="${workReimbursement.workReimbursementTypeInfo.standardDetail}"
+                                     title="报销类别" url="/reimbursementType/reimbursementType/treeData" extId=""  cssClass="form-control  layui-input" allowClear="true" notAllowSelectParent="true"/>
+                            </div>
+                        </td>
                         <td>
                             <div class="not_project_reimbursement_div"  style="width: 200px">
                                 <sys:reimburselectReproject url="${ctx}/workreimbursement/workReimbursementAll/selectReproject" id="workAccountList{{idx}}_project" name="workAccountList[{{idx}}].project.id"  value="${workReimbursement.project.id}"  title="选择报销项目" labelName="workAccountList[{{idx}}].project.projectName"
-                                               labelValue="{{row.projectName}}" cssClass="form-control layui-input" fieldLabels="工程" fieldKeys="projectName" searchLabel="工程名称" searchKey="projectName" ></sys:reimburselectReproject>
+                                               labelValue="{{row.projectName}}" extId="" cssClass="form-control layui-input" fieldLabels="工程" fieldKeys="projectName" searchLabel="工程名称" searchKey="projectName" ></sys:reimburselectReproject>
                             </div>
                         </td>
                         <td>
                             <input id="workAccountList{{idx}}_projectReportNumber"  name="workAccountList[{{idx}}].projectReportNumber" type="text" value="{{row.projectReportNumber}}" maxlength="32" readonly="readonly"  class="form-control"/>
                         </td>
-                        <td style="text-align:center;">
-                            <div class="project_reimbursement_div"  style="width: 200px">
-                                <sys:treeselectAccessoryNoParent id="workAccountList{{idx}}_type" name="workAccountList[{{idx}}].type" value="${workReimbursement.workReimbursementTypeInfo.id}" labelName="workAccountList[{{idx}}].typeName" labelValue="${workReimbursement.workReimbursementTypeInfo.standardDetail}"
-                                     title="报销类别" url="/reimbursementType/reimbursementType/treeData" extId=""  cssClass="form-control  layui-input" allowClear="true" notAllowSelectParent="true"/>
-                            </div>
-                        </td>
+
                         <td>
                             <input id="workAccountList{{idx}}_money" onchange="getMoney(this.value)" name="workAccountList[{{idx}}].money" type="text" value="{{row.money}}"  placeholder="请输入费用" maxlength="10" class="form-control number"/>
                         </td>

+ 5 - 4
src/main/webapp/webpage/modules/workreimbursement/workReimbursementAudit.jsp

@@ -267,9 +267,9 @@
 					<tr>
 						<th width="200px">报销人</th>
 						<th width="200px">报销部门</th>
+						<th width="200px">报销类型</th>
 						<th width="200px">报销项目</th>
 						<th width="200px">报告号</th>
-						<th width="200px">报销类型</th>
 						<th width="200px">费用(元)</th>
 						<th width="200px">收据张数</th>
 						<th width="200px">出差天数</th>
@@ -288,15 +288,16 @@
 								<td style="text-align: center; vertical-align: middle">
 										${workAccount.officeId}
 								</td>
+								<td style="text-align: center; vertical-align: middle" title="${workAccount.typeName}">
+										${workAccount.typeName}
+								</td>
 								<td style="text-align: center; vertical-align: middle" title="${workAccount.project.projectName}">
 										${workAccount.project.projectName}
 								</td>
 								<td style="text-align: center; vertical-align: middle" title="${workAccount.projectReportNumber}">
 										${workAccount.projectReportNumber}
 								</td>
-								<td style="text-align: center; vertical-align: middle" title="${workAccount.typeName}">
-										${workAccount.typeName}
-								</td>
+
 								<td style="text-align: center; vertical-align: middle">
 									<fmt:formatNumber value="${workAccount.money}" pattern="#,#00.00"/>
 								</td>

+ 67 - 34
src/main/webapp/webpage/modules/workreimbursement/workReimbursementFormAdd.jsp

@@ -7,9 +7,9 @@
     <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">
-		var validateForm;
-		var count = 0;
-		$(document).ready(function() {
+        var validateForm;
+        var count = 0;
+        $(document).ready(function() {
             layui.use(['form', 'layer'], function () {
                 var form = layui.form;
             })
@@ -60,29 +60,29 @@
                 $(".isPublic").addClass("hide");
             }
             validateForm = $("#inputForm").validate({
-				submitHandler: function(form){
-					loading('正在提交,请稍等...');
-					form.submit();
-				},
+                submitHandler: function(form){
+                    loading('正在提交,请稍等...');
+                    form.submit();
+                },
                 rules:{
                 },
                 messages:{
                 },
-				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);
-					}
-				}
-			});
+                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);
+                    }
+                }
+            });
             laydate.render({
                 elem: '#submitterDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                 event: 'focus', //响应事件。如果没有传入event,则按照默认的click
                 type : 'date'
-, trigger: 'click'
+                , trigger: 'click'
             });
             $("#attachment_btn").click(function () {
                 $("#attachment_file").click();
@@ -90,6 +90,20 @@
             // getRandom();
 
         });
+            <%--$.ajax({--%>
+            <%--    url:"${ctx}/reimbursementType/reimbursementType/projectCharge",--%>
+            <%--    dataType:"json",--%>
+            <%--    data:{pids:pIds},--%>
+            <%--    success:function (data) {--%>
+            <%--        var pid=pIds.split(',')[1];--%>
+            <%--        var sid="#"+id+"Name"--%>
+            <%--        if(data==1){--%>
+            <%--            $(sid).parent().parent().parent().parent().find("td").eq(4).find("input").eq(1).val(pid);--%>
+            <%--        }else {--%>
+            <%--            $(sid).parent().parent().parent().parent().find("td").eq(4).find("input").eq(1).val(pid);--%>
+            <%--        }--%>
+            <%--    }--%>
+            <%--})--%>
         function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
             var idArr = $("#workAccountList tr:visible");
             if(idArr.length<1){
@@ -485,6 +499,24 @@
                 }
             })
         }
+        function setPids(pIds,id){
+            $.ajax({
+                url:"${ctx}/reimbursementType/reimbursementType/projectCharge",
+                dataType:"json",
+                data:{pids:pIds},
+                success:function (data) {
+                    var pid=pIds.split(',')[1];
+                    var sid="#"+id+"Name"
+                    if(data==1){
+                        $(sid).parent().parent().parent().parent().find("td").eq(4).find("input").eq(1).val(pid);
+                        $(sid).parent().parent().parent().parent().find("td").eq(4).find("input").eq(2).val("'90%','90%'");
+                    }else {
+                        $(sid).parent().parent().parent().parent().find("td").eq(4).find("input").eq(1).val(pid);
+                        $(sid).parent().parent().parent().parent().find("td").eq(4).find("input").eq(2).val("'50%','50%'");
+                    }
+                }
+            })
+        }
     </script>
     <style>
         /*超过5个汉字,调整label的长度,以下是配套的*/
@@ -648,9 +680,9 @@
                         <%--<th width="60px">编号</th>--%>
                         <th width="200px"><font color="red">*</font>报销人</th>
                         <th width="200px">报销部门</th>
+                        <th width="200px">报销类型</th>
                         <th width="200px">报销项目</th>
                         <th width="200px">报告号</th>
-                        <th width="200px">报销类型</th>
                         <th width="200px"><font color="red">*</font>费用(元)</th>
                         <th width="200px">收据张数</th>
                         <th width="200px">出差天数</th>
@@ -682,23 +714,23 @@
                                 <td>
                                     <input id="workAccountList${index.index}_reimbursementNameofficeId"  name="workAccountList[${index.index}].officeId" maxlength="32" type="text" value="${workAccount.officeId}" readonly="readonly"  class="form-control required"/>
                                 </td>
-
+                                <td style="text-align:center;">
+                                    <div class="project_reimbursement_div"  style="width: 200px">
+                                        <sys:treeselectAccessoryNoParent id="workAccountList${index.index}_type" name="workAccountList[${index.index}].type" value="${workAccount.type}" labelName="workAccountList[${index.index}].typeName" labelValue="${workAccount.typeName}"
+                                                                         title="报销类别" url="/reimbursementType/reimbursementType/treeData" extId=""  cssClass="form-control  layui-input" allowClear="true" notAllowSelectParent="true"/>
+                                    </div>
+                                </td>
 
                                 <td>
                                     <div class="not_project_reimbursement_div"  style="width: 200px">
                                         <sys:reimburselectReproject url="${ctx}/workreimbursement/workReimbursement/selectReproject" id="workAccountList${index.index}_project" name="workAccountList[${index.index}].project.id"  value="${workAccount.project.id}"  title="选择报销项目" labelName="workAccountList[${index.index}].project.projectName"
-                                                                    labelValue="${workAccount.project.projectName}" cssClass="form-control layui-input" fieldLabels="工程" fieldKeys="projectName" searchLabel="工程名称" searchKey="projectName" />
+                                                                    labelValue="${workAccount.project.projectName}" extId="${workAccount.projectRadio}" cssClass="form-control layui-input" fieldLabels="工程" fieldKeys="projectName" searchLabel="工程名称" searchKey="projectName" />
                                     </div>
                                 </td>
                                 <td>
                                     <input id="workAccountList${index.index}_projectReportNumber"  name="workAccountList[${index.index}].projectReportNumber" type="text" value="${workAccount.projectReportNumber}" maxlength="32" readonly="readonly"  class="form-control"/>
                                 </td>
-                                <td style="text-align:center;">
-                                    <div class="project_reimbursement_div"  style="width: 200px">
-                                        <sys:treeselectAccessoryNoParent id="workAccountList${index.index}_type" name="workAccountList[${index.index}].type" value="${workAccount.type}" labelName="workAccountList[${index.index}].typeName" labelValue="${workAccount.typeName}"
-                                                                         title="报销类别" url="/reimbursementType/reimbursementType/treeData" extId=""  cssClass="form-control  layui-input" allowClear="true" notAllowSelectParent="true"/>
-                                    </div>
-                                </td>
+
 
                                 <td>
                                     <input id="workAccountList${index.index}_money" onchange="getMoney(this.value)" name="workAccountList[${index.index}].money" type="text" value="${workAccount.money}"  placeholder="请输入金额" maxlength="10"  class="form-control number required"/>
@@ -762,21 +794,22 @@
                                 <input id="workAccountList{{idx}}_reimbursementNameofficeId"  type="text" value="{{row.officeId}}" maxlength="32" readonly="readonly"  class="form-control"/>
                             </div>
                         </td>
+                        <td style="text-align:center;">
+                            <div class="project_reimbursement_div"  style="width: 200px">
+                                <sys:treeselectAccessoryNoParent id="workAccountList{{idx}}_type" name="workAccountList[{{idx}}].type" value="${workReimbursement.workReimbursementTypeInfo.id}" labelName="workAccountList[{{idx}}].typeName" labelValue="${workReimbursement.workReimbursementTypeInfo.standardDetail}"
+                                     title="报销类别" url="/reimbursementType/reimbursementType/treeData" extId=""  cssClass="form-control  layui-input" allowClear="true" notAllowSelectParent="true"/>
+                            </div>
+                        </td>
                         <td>
                             <div class="not_project_reimbursement_div"  style="width: 200px">
                                 <sys:reimburselectReproject url="${ctx}/workreimbursement/workReimbursement/selectReproject" id="workAccountList{{idx}}_project" name="workAccountList[{{idx}}].project.id"  value="${workReimbursement.project.id}"  title="选择报销项目" labelName="workAccountList[{{idx}}].project.projectName"
-                                               labelValue="{{row.projectName}}" cssClass="form-control layui-input" fieldLabels="工程" fieldKeys="projectName" searchLabel="工程名称" searchKey="projectName" ></sys:reimburselectReproject>
+                                       labelValue="{{row.projectName}}" extId="" area="" cssClass="form-control layui-input"  fieldLabels="工程" fieldKeys="projectName" searchLabel="工程名称" searchKey="projectName" ></sys:reimburselectReproject>
                             </div>
                         </td>
                         <td>
                             <input id="workAccountList{{idx}}_projectReportNumber"  name="workAccountList[{{idx}}].projectReportNumber" type="text" value="{{row.projectReportNumber}}" maxlength="32" readonly="readonly"  class="form-control"/>
                         </td>
-                        <td style="text-align:center;">
-                            <div class="project_reimbursement_div"  style="width: 200px">
-                                <sys:treeselectAccessoryNoParent id="workAccountList{{idx}}_type" name="workAccountList[{{idx}}].type" value="${workReimbursement.workReimbursementTypeInfo.id}" labelName="workAccountList[{{idx}}].typeName" labelValue="${workReimbursement.workReimbursementTypeInfo.standardDetail}"
-                                     title="报销类别" url="/reimbursementType/reimbursementType/treeData" extId=""  cssClass="form-control  layui-input" allowClear="true" notAllowSelectParent="true"/>
-                            </div>
-                        </td>
+
                         <td>
                             <input id="workAccountList{{idx}}_money" onchange="getMoney(this.value)" name="workAccountList[{{idx}}].money" type="text" value="{{row.money}}"  placeholder="请输入费用" maxlength="10" class="form-control number"/>
                         </td>

+ 8 - 7
src/main/webapp/webpage/modules/workreimbursement/workReimbursementFormDetail.jsp

@@ -262,9 +262,9 @@
                 <tr>
                     <th width="200px">报销人</th>
                     <th width="200px">报销部门</th>
+                    <th width="200px">报销类型</th>
                     <th width="200px">报销项目</th>
                     <th width="200px">报告号</th>
-                    <th width="200px">报销类型</th>
                     <th width="200px">费用(元)</th>
                     <th width="200px">收据张数</th>
                     <th width="200px">出差天数</th>
@@ -286,15 +286,15 @@
                                         <td style="text-align: center; vertical-align: middle">
                                                     ${workAccount.officeId}
                                         </td>
+                                        <td style="text-align: center; vertical-align: middle" title="${workAccount.typeName}">
+                                                ${workAccount.typeName}
+                                        </td>
                                         <td style="text-align: center; vertical-align: middle" title="${workAccount.project.projectName}">
                                                 ${workAccount.project.projectName}
                                         </td>
                                         <td style="text-align: center; vertical-align: middle" title="${workAccount.projectReportNumber}">
                                                 ${workAccount.projectReportNumber}
                                         </td>
-                                        <td style="text-align: center; vertical-align: middle" title="${workAccount.typeName}">
-                                                ${workAccount.typeName}
-                                        </td>
                                         <td style="text-align: center; vertical-align: middle">
                                             <fmt:formatNumber value="${workAccount.money}" pattern="#,#00.00"/>
                                         </td>
@@ -348,15 +348,16 @@
                                 <td style="text-align: center; vertical-align: middle">
                                             ${workAccount.officeId}
                                 </td>
+                                <td style="text-align: center; vertical-align: middle" title="${workAccount.typeName}">
+                                        ${workAccount.typeName}
+                                </td>
                                 <td style="text-align: center; vertical-align: middle" title="${workAccount.project.projectName}">
                                         ${workAccount.project.projectName}
                                 </td>
                                 <td style="text-align: center; vertical-align: middle" title="${workAccount.projectReportNumber}">
                                         ${workAccount.projectReportNumber}
                                 </td>
-                                <td style="text-align: center; vertical-align: middle" title="${workAccount.typeName}">
-                                        ${workAccount.typeName}
-                                </td>
+
                                 <td style="text-align: center; vertical-align: middle">
                                     <fmt:formatNumber value="${workAccount.money}" pattern="#,#00.00"/>
                                 </td>

+ 34 - 16
src/main/webapp/webpage/modules/workreimbursement/workReimbursementModifyApply.jsp

@@ -489,6 +489,22 @@
                 }
             })
         }
+        function setPids(pIds,id){
+            $.ajax({
+                url:"${ctx}/reimbursementType/reimbursementType/projectCharge",
+                dataType:"json",
+                data:{pids:pIds},
+                success:function (data) {
+                    var pid=pIds.split(',')[1];
+                    var sid="#"+id+"Name"
+                    if(data==1){
+                        $(sid).parent().parent().parent().parent().find("td").eq(4).find("input").eq(1).val(pid);
+                    }else {
+                        $(sid).parent().parent().parent().parent().find("td").eq(4).find("input").eq(1).val(pid);
+                    }
+                }
+            })
+        }
     </script>
     <style>
         /*超过5个汉字,调整label的长度,以下是配套的*/
@@ -768,9 +784,9 @@
                 <tr>
                     <th width="200px"><font color="red">*</font>报销人</th>
                     <th width="200px">报销部门</th>
+                    <th width="200px">报销类型</th>
                     <th width="200px">报销项目</th>
                     <th width="200px">报告号</th>
-                    <th width="200px">报销类型</th>
                     <th width="200px"><font color="red">*</font>费用(元)</th>
                     <th width="200px">收据张数</th>
                     <th width="200px">出差天数</th>
@@ -797,22 +813,23 @@
                                 <input id="workAccountList${index.index}_reimbursementNameofficeId"  name="workAccountList[${index.index}].officeId" maxlength="32" type="text" value="${workAccount.officeId}" readonly="readonly"  class="form-control required"/>
                             </td>
 
-
+                            <td style="text-align:center;">
+                                <div class="project_reimbursement_div"  style="width: 200px">
+                                    <sys:treeselectAccessoryNoParent id="workAccountList${index.index}_type" name="workAccountList[${index.index}].type" value="${workAccount.type}" labelName="workAccountList[${index.index}].typeName" labelValue="${workAccount.typeName}"
+                                                                     title="报销类别" url="/reimbursementType/reimbursementType/treeData" extId=""  cssClass="form-control  layui-input" allowClear="true" notAllowSelectParent="true"/>
+                                </div>
+                            </td>
                             <td>
                                 <div class="not_project_reimbursement_div"  style="width: 200px">
                                     <sys:reimburselectReproject url="${ctx}/workreimbursement/workReimbursement/selectReproject" id="workAccountList${index.index}_project" name="workAccountList[${index.index}].project.id"  value="${workAccount.project.id}"  title="选择报销项目" labelName="workAccountList[${index.index}].project.projectName"
-                                                                labelValue="${workAccount.project.projectName}" cssClass="form-control required layui-input" fieldLabels="工程" fieldKeys="projectName" searchLabel="工程名称" searchKey="projectName" />
+                                                                labelValue="${workAccount.project.projectName}" extId="${workAccount.projectRadio}" cssClass="form-control required layui-input" fieldLabels="工程" fieldKeys="projectName" searchLabel="工程名称" searchKey="projectName" />
                                 </div>
                             </td>
+
                             <td>
                                 <input id="workAccountList${index.index}_projectReportNumber"  name="workAccountList[${index.index}].projectReportNumber" type="text" value="${workAccount.projectReportNumber}" maxlength="32" readonly="readonly"  class="form-control"/>
                             </td>
-                            <td style="text-align:center;">
-                                <div class="project_reimbursement_div"  style="width: 200px">
-                                    <sys:treeselectAccessoryNoParent id="workAccountList${index.index}_type" name="workAccountList[${index.index}].type" value="${workAccount.type}" labelName="workAccountList[${index.index}].typeName" labelValue="${workAccount.typeName}"
-                                                                     title="报销类别" url="/reimbursementType/reimbursementType/treeData" extId=""  cssClass="form-control  layui-input" allowClear="true" notAllowSelectParent="true"/>
-                                </div>
-                            </td>
+
 
                             <td>
                                 <input id="workAccountList${index.index}_money" onchange="getMoney(this.value)" name="workAccountList[${index.index}].money" type="text" value="${workAccount.money}"  placeholder="请输入金额" maxlength="10"  class="form-control number required"/>
@@ -875,21 +892,22 @@
                                 <input id="workAccountList{{idx}}_reimbursementNameofficeId"  type="text" value="{{row.officeId}}" maxlength="32" readonly="readonly"  class="form-control"/>
                             </div>
                         </td>
+                        <td style="text-align:center;">
+                            <div class="project_reimbursement_div"  style="width: 200px">
+                                <sys:treeselectAccessoryNoParent id="workAccountList{{idx}}_type" name="workAccountList[{{idx}}].type" value="${workReimbursement.workReimbursementTypeInfo.id}" labelName="workAccountList[{{idx}}].typeName" labelValue="${workReimbursement.workReimbursementTypeInfo.standardDetail}"
+                                     title="报销类别" url="/reimbursementType/reimbursementType/treeData" extId=""  cssClass="form-control  layui-input" allowClear="true" notAllowSelectParent="true"/>
+                            </div>
+                        </td>
                         <td>
                             <div class="not_project_reimbursement_div"  style="width: 200px">
                                 <sys:reimburselectReproject url="${ctx}/workreimbursement/workReimbursement/selectReproject" id="workAccountList{{idx}}_project" name="workAccountList[{{idx}}].project.id"  value="${workReimbursement.project.id}"  title="选择报销项目" labelName="workAccountList[{{idx}}].project.projectName"
-                                               labelValue="{{row.projectName}}" cssClass="form-control required layui-input" fieldLabels="工程" fieldKeys="projectName" searchLabel="工程名称" searchKey="projectName" ></sys:reimburselectReproject>
+                                               labelValue="{{row.projectName}}" extId="" cssClass="form-control required layui-input" fieldLabels="工程" fieldKeys="projectName" searchLabel="工程名称" searchKey="projectName" ></sys:reimburselectReproject>
                             </div>
                         </td>
                         <td>
                             <input id="workAccountList{{idx}}_projectReportNumber"  name="workAccountList[{{idx}}].projectReportNumber" type="text" value="{{row.projectReportNumber}}" maxlength="32" readonly="readonly"  class="form-control"/>
                         </td>
-                        <td style="text-align:center;">
-                            <div class="project_reimbursement_div"  style="width: 200px">
-                                <sys:treeselectAccessoryNoParent id="workAccountList{{idx}}_type" name="workAccountList[{{idx}}].type" value="${workReimbursement.workReimbursementTypeInfo.id}" labelName="workAccountList[{{idx}}].typeName" labelValue="${workReimbursement.workReimbursementTypeInfo.standardDetail}"
-                                     title="报销类别" url="/reimbursementType/reimbursementType/treeData" extId=""  cssClass="form-control  layui-input" allowClear="true" notAllowSelectParent="true"/>
-                            </div>
-                        </td>
+
                         <td>
                             <input id="workAccountList{{idx}}_money" onchange="getMoney(this.value)" name="workAccountList[{{idx}}].money" type="text" value="{{row.money}}"  placeholder="请输入费用" maxlength="10" class="form-control number"/>
                         </td>