Browse Source

报销新增隐藏调整

huangguoce 1 week ago
parent
commit
171231f66b

+ 64 - 128
src/main/webapp/WEB-INF/tags/sys/treeselectAccessoryNoParent.tag

@@ -22,143 +22,79 @@
 <%@ attribute name="hideBtn" type="java.lang.Boolean" required="false" description="是否显示按钮"%>
 <%@ 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}"/>
+<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}"/>
 
-    </div>
-	 <label id="${id}Name-error" class="error" for="${id}Name" style="display:none"></label>
+</div>
+<label id="${id}Name-error" class="error" for="${id}Name" style="display:none"></label>
 <script type="text/javascript">
 	$("#${id}Button, #${id}Name").click(function(){
 		// 是否限制选择,如果限制,设置为disabled
 		if ($("#${id}Button").hasClass("disabled")){
 			return true;
 		}
-		var myUrl = "${url}";
-		console.log("${title}")
-		console.log("${id}")
-		if ("${title}" == "报销类别" &&( '${id}' != 'workAccountList1_type' &&  '${id}' != 'workAccountList1type')){
-			myUrl = "/reimbursementType/reimbursementType/treeDataByClCz"
-		}
 		// 正常打开
 		top.layer.open({
-		    type: 2,
-		    area: ['300px', '420px'],
-		    title:"选择${title}",
-		    ajaxData:{selectIds: $("#${id}Id").val()},
-		    content: "${ctx}/tag/treeselect?url="+encodeURIComponent(myUrl)+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}" ,
-		    btn: ['确定', '关闭']
-    	       ,yes: function(index, layero){ //或者使用btn1
-						var tree = layero.find("iframe")[0].contentWindow.tree;//h.find("iframe").contents();
-						var ids = [], names = [], nodes = [];
-						if ("${checked}" == "true"){
-							nodes = tree.getCheckedNodes(true);
-						}else{
-							nodes = tree.getSelectedNodes();
-						}
-
-						for(var i=0; i<nodes.length; i++) {//<c:if test="${checked && notAllowSelectParent}">
-							if (nodes[i].isParent){
-								continue; // 如果为复选框选择,则过滤掉父节点
-							}//</c:if><c:if test="${notAllowSelectRoot}">
-							if (nodes[i].level == 0) {
-								//top.$.jBox.tip("不能选择根节点("+nodes[i].name+")请重新选择。");
-								top.layer.msg("不能选择根节点(" + nodes[i].name + ")请重新选择。", {icon: 0});
-								return false;
-							}//</c:if><c:if test="${notAllowSelectParent}">
-							if (nodes[i].isParent) {
-								//top.$.jBox.tip("不能选择父节点("+nodes[i].name+")请重新选择。");
-								//layer.msg('有表情地提示');
-								top.layer.msg("不能选择父节点(" + nodes[i].name + ")请重新选择。", {icon: 0});
-								return false;
-							}//</c:if><c:if test="${not empty module && selectScopeModule}">
-							if (nodes[i].module == "") {
-								//top.$.jBox.tip("不能选择公共模型("+nodes[i].name+")请重新选择。");
-								top.layer.msg("不能选择公共模型(" + nodes[i].name + ")请重新选择。", {icon: 0});
-								return false;
-							} else if (nodes[i].module != "${module}") {
-								//top.$.jBox.tip("不能选择当前栏目以外的栏目模型,请重新选择。");
-								top.layer.msg("不能选择当前栏目以外的栏目模型,请重新选择。", {icon: 0});
-								return false;
-							}//</c:if>
-							ids.push(nodes[i].id);
-							names.push(nodes[i].name);
-							$("#${id}Pids").val(nodes[i].pIds);
-							//<c:if test="${!checked}">
-							break; // 如果为非复选框选择,则返回第一个选择  </c:if>
-						}
-
-						top.layer.close(index);
-						if ("${title}" == "报销类别" && ('${id}' == 'workAccountList1_type' || '${id}' == 'workAccountList1type')){
-							if(names.join(",") != '业务操作奖' &&  names.join(",") != "业务差旅费"){
-								if($("#${id}Name").val() == '业务操作奖' || $("#${id}Name").val() == "业务差旅费"){
-									top.layer.open({
-										title: '提示',
-										content: '您即将修改报销类别为'+names.join(",")+'。若确定,您本次的报销将仅保留第一张报销单及其下上传的文件。是否调整?',
-										icon: 3,
-										btn: ['确定', '取消'],
-										yes: function(tempIndex, layero){
-											// 关闭弹窗
-											top.layer.close(tempIndex);
-											// 获取所有 td
-											var tds = $('#workAccountList .op-td');
-											for (var i = tds.length - 1; i > 0; i--) {
-												var td = tds.eq(i);
-												var deleteBtn = td.find('.op-btn-delete');
-												deleteBtn.each(function() {
-													if (this.onclick) {
-														this.onclick();
-													} else {
-														$(this).trigger('click');
-													}
-												});
-											}
-											document.querySelector('.add-btn').style.display = 'none';
-											$("#${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);
-										},
-										btn2: function(tempIndex, layero){
-											console.log("用户点击了取消");
-										},
-										cancel: function(tempIndex, layero){
-											console.log("用户关闭了弹窗");
-										}
-									});
-								}else{
-									$("#${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);
-								}
-							}else{
-								document.querySelector('.add-btn').style.display = 'block';
-								$("#${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);
-							}
-						}else{
-							$("#${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);
-						}
-				    	       },
-    	cancel: function(index){ //或者使用btn2
-
-    	       }
+			type: 2,
+			area: ['300px', '420px'],
+			title:"选择${title}",
+			ajaxData:{selectIds: $("#${id}Id").val()},
+			content: "${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}" ,
+			btn: ['确定', '关闭']
+			,yes: function(index, layero){ //或者使用btn1
+				var tree = layero.find("iframe")[0].contentWindow.tree;//h.find("iframe").contents();
+				var ids = [], names = [], nodes = [];
+				if ("${checked}" == "true"){
+					nodes = tree.getCheckedNodes(true);
+				}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; // 如果为复选框选择,则过滤掉父节点
+					}//</c:if><c:if test="${notAllowSelectRoot}">
+					if (nodes[i].level == 0) {
+						//top.$.jBox.tip("不能选择根节点("+nodes[i].name+")请重新选择。");
+						top.layer.msg("不能选择根节点(" + nodes[i].name + ")请重新选择。", {icon: 0});
+						return false;
+					}//</c:if><c:if test="${notAllowSelectParent}">
+					if (nodes[i].isParent) {
+						//top.$.jBox.tip("不能选择父节点("+nodes[i].name+")请重新选择。");
+						//layer.msg('有表情地提示');
+						top.layer.msg("不能选择父节点(" + nodes[i].name + ")请重新选择。", {icon: 0});
+						return false;
+					}//</c:if><c:if test="${not empty module && selectScopeModule}">
+					if (nodes[i].module == "") {
+						//top.$.jBox.tip("不能选择公共模型("+nodes[i].name+")请重新选择。");
+						top.layer.msg("不能选择公共模型(" + nodes[i].name + ")请重新选择。", {icon: 0});
+						return false;
+					} else if (nodes[i].module != "${module}") {
+						//top.$.jBox.tip("不能选择当前栏目以外的栏目模型,请重新选择。");
+						top.layer.msg("不能选择当前栏目以外的栏目模型,请重新选择。", {icon: 0});
+						return false;
+					}//</c:if>
+					ids.push(nodes[i].id);
+					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
+				//按钮【按钮二】的回调
+			}
 		});
 
 	});

File diff suppressed because it is too large
+ 532 - 620
src/main/webapp/webpage/modules/workreimbursement/treeForm/all/workReimbursementAllFormAdd.jsp


+ 70 - 121
src/main/webapp/webpage/modules/workreimbursement/treeForm/all/workReimbursementAllModifyApply.jsp

@@ -196,7 +196,7 @@
 
                             // 3. 替换模板中的所有占位符
                             var accessoryNoParentParsedTagHtml = accessoryNoParentTemplateHtml
-                                .replace(/__INDEX__/g, index + 1) // 替换索引
+                                .replace(/__INDEX__/g, index) // 替换索引
                                 .replace(/__TYPE__/g, typeValue) // 替换type值(处理空值后)
                                 .replace(/__TYPE_NAME__/g, typeNameValue); // 替换typeName值(处理空值后)
 
@@ -210,7 +210,7 @@
 
                             // 3. 替换模板中的所有占位符
                             var reprojectParsedTagHtml = reprojectTemplateHtml
-                                .replace(/__INDEX__/g, index + 1) // 替换行索引
+                                .replace(/__INDEX__/g, index) // 替换行索引
                                 .replace(/__PROJECT_ID__/g, projectId) // 替换项目ID(处理空值后)
                                 .replace(/__PROJECT_NAME__/g, projectName) // 替换项目名称(处理空值后)
                                 .replace(/__PROJECT_RADIO__/g, projectRadio); // 替换projectRadio(处理空值后)
@@ -231,8 +231,8 @@
                             var serialNumber = index + 1
 
                             if(flag) {
-                                index = index + 1
                                 const trId = 'workAccountList' + index;
+
                                 $("#workAccountList").append("<tr id='workAccountList" + index + "' class='rowSize'>" +
                                     "<td class='hide'>" +
                                     "<input id='workAccountList" + index + "_id' name='workAccountList[" + index + "].id' type='hidden' value='" + obj.id + "'/>" +
@@ -391,7 +391,6 @@
             console.log(listStr)
             if(listStr<1){
                 addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,'',true)
-                workAccountListRowIdx = workAccountListRowIdx + 1
             }
         });
 
@@ -669,7 +668,7 @@
                 var $sumInput = $(this);
                 var $currentTr = $sumInput.closest("tr");
                 var isHidden = $currentTr.hasClass("hidden");
-                var $delFlagInput = $currentTr.find("td:first-child input:eq(3)");
+                var $delFlagInput = $currentTr.find("td:first-child input:eq(1)");
                 var isDeleted = $delFlagInput.val() === "1";
 
                 // 1. 获取当前行的第五个td(索引从0开始,第五个td的索引是4)
@@ -864,7 +863,6 @@
         function addRow(list, idx, tpl, row,flag){
             var data;
             if (flag){
-                console.log("进来了")
                 data = ${fns:toJson(workReimbursement.createBy)};
             }
             var idx1 = $("#workAccountList tr[id^='workAccountList']").length + 1;
@@ -1487,120 +1485,76 @@
 
 
         // 数电发票删除 - 隐藏行版本(保留DOM,只隐藏)
-        function delRowParentNew(obj, prefix,isBatch){
-            if (prefix == '#workAccountList1' && !isBatch) {
-                top.layer.open({
-                    title: '提示',
-                    content: '是否确认删除第1张报销单?(所有报销单数据也将同步删除)',
-                    icon: 3,
-                    btn: ['确定', '取消'],
-                    yes: function (tempIndex, layero) {
-                        // 关闭弹窗
-                        top.layer.close(tempIndex);
-                        // 获取所有 td
-                        var tds = $('#workAccountList .op-td');
-                        for (var i = tds.length - 1; i >= 0; i--) {
-                            var td = tds.eq(i); // 当前 td
-                            var deleteBtn = td.find('.op-btn-delete');
-                            deleteBtn.each(function (eleIndex, ele) {
-                                if (i == 0) {
-                                    delRowParentNew(ele, "#workAccountList1", true)
-                                } else {
-                                    if (this.onclick) {
-                                        this.onclick();
-                                    } else {
-                                        $(this).trigger('click');
-                                    }
-                                }
-                            });
-                        }
-                        document.querySelector('.add-btn').style.display = 'none';
-                    },
-                    btn2: function (tempIndex, layero) {
-                        console.log("用户点击了取消");
-                    },
-                    cancel: function (tempIndex, layero) {
-                        console.log("用户关闭了弹窗");
-                    }
-                });
-            } else {
-                var id = $(prefix + "_id");
-
-                var workAccountmoney = $(prefix + "_money").val();
-
-                var money = $("#moneys").val();
+        function delRowParentNew(obj, prefix){
+            var id = $(prefix+"_id");
 
-                if (isNumber(workAccountmoney)) {
-                    if (money == "") {
-                        money = parseFloat(workAccountmoney).toFixed(2);
-                    } else {
-                        money = (parseFloat(money) - parseFloat(workAccountmoney)).toFixed(2);
-                    }
+            var workAccountmoney= $(prefix+"_money").val();
+            var money = $("#moneys").val();
+            if (isNumber(workAccountmoney)){
+                if(money==""){
+                    money = parseFloat(workAccountmoney).toFixed(2);
+                }else {
+                    money = (parseFloat(money) - parseFloat(workAccountmoney)).toFixed(2);
+                }
+            }
+            if(money>=0){
+                count++;
+                $("#moneys").val(money);
+                var delFlag = $(prefix+"_delFlag");
+                if (id.val() == ""){
+                    delFlag.val("1");
+                    $(obj).parent().parent().remove();
+                }else if(delFlag.val() == "0"){
+                    delFlag.val("1");
+                    $(obj).html("&divide;").attr("title", "撤回删除");
+                    $(obj).parent().parent().addClass("error");
+                    $(obj).parent().parent().addClass("hide");
+                }else if(delFlag.val() == "1"){
+                    delFlag.val("0");
+                    $(obj).html("&times;").attr("title", "删除");
+                    $(obj).parent().parent().removeClass("error");
                 }
-
-                if (money >= 0) {
-                    count++;
-                    $("#moneys").val(money);
-                    var delFlag = $(prefix + "_delFlag");
-
-                    if (id.val() == "") {
-                        delFlag.val("1");
-                        $(obj).parent().parent().remove();
-                    } else if (delFlag.val() == "0") {
-                        console.log( delFlag)
-                        console.log( delFlag)
-                        console.log( delFlag)
-                        delFlag.val("1");
-                        $(obj).html("&divide;").attr("title", "撤回删除");
-                        $(obj).parent().parent().addClass("error");
-                        $(obj).parent().parent().addClass("hide");
-                    } else if (delFlag.val() == "1") {
-                        delFlag.val("0");
-                        $(obj).html("&times;").attr("title", "删除");
-                        $(obj).parent().parent().removeClass("error");
-                    }
 
 
-                    // 定位外层tr(class为c7f4ef4720924167b2520f620918e1eb)
-                    var $outerTr = $("tr." + id.val());
+                // 定位外层tr(class为c7f4ef4720924167b2520f620918e1eb)
+                var $outerTr = $("tr." + id.val());
 
-                    // 检查外层tr是否存在
-                    if ($outerTr.length === 0) {
+                // 检查外层tr是否存在
+                if ($outerTr.length === 0) {
 
-                    } else {
-                        // 查找外层tr下的所有子tr(包括嵌套在tbody中的)
-                        $outerTr.find("tr").each(function (index, tr) {
-                            var $tr = $(tr);
-
-                            // 找到当前tr的第一个td(索引0)
-                            var $firstTd = $tr.find("td").eq(0);
-                            if ($firstTd.length === 0) {
-                                return true; // 继续下一个tr
-                            }
+                } else {
+                    // 查找外层tr下的所有子tr(包括嵌套在tbody中的)
+                    $outerTr.find("tr").each(function(index, tr) {
+                        var $tr = $(tr);
+
+                        // 找到当前tr的第一个td(索引0)
+                        var $firstTd = $tr.find("td").eq(0);
+                        if ($firstTd.length === 0) {
+                            return true; // 继续下一个tr
+                        }
 
-                            // 找到第一个td中的第二个input(索引1)
-                            var $targetInput = $firstTd.find("input").eq(1);
-                            if ($targetInput.length === 0) {
-                                return true; // 继续下一个tr
-                            }
+                        // 找到第一个td中的第二个input(索引1)
+                        var $targetInput = $firstTd.find("input").eq(1);
+                        if ($targetInput.length === 0) {
+                            return true; // 继续下一个tr
+                        }
 
-                            // 设置input的值为1
-                            $targetInput.val("1");
-                        });
-                    }
+                        // 设置input的值为1
+                        $targetInput.val("1");
+                    });
+                }
 
-                    // 隐藏外层tr(核心新增逻辑)
-                    $outerTr.hide();
+                // 隐藏外层tr(核心新增逻辑)
+                $outerTr.hide();
 
-                    var $currentRow = $(obj).closest("tr"); // 当前行
-                    var $parentTable = $currentRow.closest("table"); // 父表格
+                var $currentRow = $(obj).closest("tr"); // 当前行
+                var $parentTable = $currentRow.closest("table"); // 父表格
 
-                    // 重新排序行号
-                    reorderParentRowNumbers($parentTable);
+                // 重新排序行号
+                reorderParentRowNumbers($parentTable);
 
-                } else {
-                    parent.layer.msg('删除失败', {icon: 2});
-                }
+            }else{
+                parent.layer.msg('删除失败',{icon:2});
             }
         }
 
@@ -1615,7 +1569,7 @@
             var idValue = $idInput.val() || "";
 
             // 标记删除(通过修改第一个td中第二个input的值为1)
-            var $targetInput = $currentRow.find("td:first-child input:eq(3)");
+            var $targetInput = $currentRow.find("td:first-child input:eq(1)");
             if ($targetInput.length > 0) {
                 $targetInput.val("1");
             }
@@ -2428,9 +2382,9 @@
             </div>
             <div class="form-group layui-row">
                 <div class="form-group-label"><h2>报销详情<span style="color: red;font-size: 14px"> (可在报销单后新增数电发票xml格式的附件获取发票信息)</span></h2></div>
-                <div class="layui-item nav-btns add-btn">
-                    <a class="nav-btn nav-btn-add" onclick="addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,'',true);workAccountListRowIdx = workAccountListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增报销单</a>
-                </div>
+                    <%--<div class="layui-item nav-btns">
+                        <a class="nav-btn nav-btn-add" onclick="addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,'',true);workAccountListRowIdx = workAccountListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增报销单</a>
+                    </div>--%>
                 <div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
                     <table id="contentTable" class="table table-bordered table-condensed can-edit no-bottom-margin details tree_table">
                         <thead>
@@ -2729,12 +2683,6 @@
                         addRow('#reimbursementVATTaxes', reimbursementVATTaxesRowIdx, reimbursementVATTaxesTpl, data[i]);
                         reimbursementVATTaxesRowIdx = reimbursementVATTaxesRowIdx + 1;
                     }*/
-                            var tempData = ${fns:toJson(workReimbursement.workAccountList)};
-                            if (tempData.length > 0 && tempData[0].typeName == '业务差旅费') {
-                                document.querySelector('.add-btn').style.display = 'block';
-                            } else {
-                                document.querySelector('.add-btn').style.display = 'none';
-                            }
                         });
                     </script>
                 </div>
@@ -2775,7 +2723,7 @@
 
             // 2. 排除已删除的行(隐藏或标记删除)
             var isHidden = $row.hasClass("hidden");
-            var $delFlagInput = $row.find("td:first-child input:eq(3)");
+            var $delFlagInput = $row.find("td:first-child input:eq(1)");
             var isDeleted = $delFlagInput.val() === "1";
             if (isHidden || isDeleted) {
                 return true; // 继续下一行
@@ -2894,9 +2842,8 @@
 
             // 2. 排除已删除的行(隐藏或标记删除)
             var isHidden = $row.hasClass("hidden");
-            var $delFlagInput = $row.find("td:first-child input:eq(3)");
+            var $delFlagInput = $row.find("td:first-child input:eq(1)");
             var isDeleted = $delFlagInput.val() === "1";
-
             if (isHidden || isDeleted) {
                 return true; // 继续下一行
             }
@@ -2919,8 +2866,10 @@
                 console.warn("第九个td中的值不是有效的数字:", amountValue, ",行:", $tr);
             }
         });
+
         // 加上所有行的非数电票总金额
         total += parseFloat(invoiceTotal || 0);
+
         // 设置总金额
         $("#moneys").val(total.toFixed(2));
     }

+ 327 - 329
src/main/webapp/webpage/modules/workreimbursement/treeForm/new/workReimbursementNewFormAdd.jsp

@@ -2,8 +2,8 @@
 <%@ include file="/webpage/include/taglib.jsp"%>
 <html>
 <head>
-	<title>报销单管理</title>
-	<meta name="decorator" content="default"/>
+    <title>报销单管理</title>
+    <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"/>
     <link href="${ctxStatic}/layer-v2.3/layui/tableTree/treetable.css" rel="stylesheet" />
@@ -196,7 +196,7 @@
 
                             // 3. 替换模板中的所有占位符
                             var accessoryNoParentParsedTagHtml = accessoryNoParentTemplateHtml
-                                .replace(/__INDEX__/g, index+1) // 替换索引
+                                .replace(/__INDEX__/g, index) // 替换索引
                                 .replace(/__TYPE__/g, typeValue) // 替换type值(处理空值后)
                                 .replace(/__TYPE_NAME__/g, typeNameValue); // 替换typeName值(处理空值后)
 
@@ -211,7 +211,7 @@
 
                             // 3. 替换模板中的所有占位符
                             var reprojectParsedTagHtml = reprojectTemplateHtml
-                                .replace(/__INDEX__/g, index+1) // 替换行索引
+                                .replace(/__INDEX__/g, index) // 替换行索引
                                 .replace(/__PROJECT_ID__/g, projectId) // 替换项目ID(处理空值后)
                                 .replace(/__PROJECT_NAME__/g, projectName) // 替换项目名称(处理空值后)
                                 .replace(/__PROJECT_RADIO__/g, projectRadio); // 替换projectRadio(处理空值后)
@@ -232,8 +232,8 @@
                             var serialNumber = index + 1
 
                             if(flag) {
-                                index = index+1
                                 const trId = 'workAccountList' + index;
+
                                 $("#workAccountList").append("<tr id='workAccountList" + index + "' class='rowSize'>" +
                                     "<td class='hide'>" +
                                     "<input id='workAccountList" + index + "_id' name='workAccountList[" + index + "].id' type='hidden' value='" + obj.id + "'/>" +
@@ -242,7 +242,7 @@
                                     "<input id='workAccountList" + index + "_delFlag' name='workAccountList[" + index + "].delFlag' type='hidden' value='0'/>" +
                                     "</td>" +
                                     "<td onclick='listTr(this)' style='text-align: center;position: relative; width:80px; text-align: center; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;'>" +
-                                        "<span class='default_shut ' style=\"padding-right: 15px; \"></span><input type=\"hidden\" name=\"proId\" id='" + tid + "' value=" + obj.id + "><input type=\"hidden\" name=\"projectid\" value=" + obj.id + ">" + serialNumber + "</td>" +
+                                    "<span class='default_shut ' style=\"padding-right: 15px; \"></span><input type=\"hidden\" name=\"proId\" id='" + tid + "' value=" + obj.id + "><input type=\"hidden\" name=\"projectid\" value=" + obj.id + ">" + serialNumber + "</td>" +
                                     "<td>" +
                                     '<div class="project_reimbursement_div" style="width: 150px">' +
                                     parsedTagHtml +  // 插入解析后的标签HTML
@@ -304,8 +304,8 @@
                                     "</td>" +
 
                                     "<td style='vertical-align: middle; text-align:center;' class='op-td'>" +
-                                        "<span class='op-btn op-btn-add' onClick='addRowInfoForm(this, \"#workAccountList" + index + "\")' title='添加'><i class='fa fa-plus'></i>&nbsp;新增</span>" +
-                                        "<span class='op-btn op-btn-delete' onclick='delRowParentNew(this, \"#workAccountList" + index + "\")' title='删除'><i class='glyphicon glyphicon-remove'></i>&nbsp;删除</span>" +
+                                    "<span class='op-btn op-btn-add' onClick='addRowInfoForm(this, \"#workAccountList" + index + "\")' title='添加'><i class='fa fa-plus'></i>&nbsp;新增</span>" +
+                                    "<span class='op-btn op-btn-delete' onclick='delRowParentNew(this, \"#workAccountList" + index + "\")' title='删除'><i class='glyphicon glyphicon-remove'></i>&nbsp;删除</span>" +
                                     "</td>" +
 
                                     "</tr>")
@@ -352,10 +352,8 @@
                                 var $tr = $('#' + trId);
                                 // 2. 模拟点击tr,触发onclick绑定的listTr
                                 var $targetTd = $tr.find('td:eq(1)');
-
                                 // 3. 触发td的click事件(如果找到该td)
                                 if ($targetTd.length > 0) {
-
                                     $targetTd.trigger('click');
                                 }
                             }
@@ -367,9 +365,9 @@
 
             // 1. 获取后端渲染的列表字符串(注意:不要加单引号,直接获取模板渲染结果)
             var listStr = '${workReimbursement.workAccountListCount}';
+            console.log(listStr)
             if(listStr<1){
                 addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,'',true)
-                workAccountListRowIdx = workAccountListRowIdx+1
             }
         });
 
@@ -676,7 +674,7 @@
                     var $sumInput = $(this);
                     var $currentTr = $sumInput.closest("tr");
                     var isHidden = $currentTr.hasClass("hidden");
-                    var $delFlagInput = $currentTr.find("td:first-child input:eq(3)");
+                    var $delFlagInput = $currentTr.find("td:first-child input:eq(1)");
                     var isDeleted = $delFlagInput.val() === "1";
 
                     // 1. 获取当前行的第五个td(索引从0开始,第五个td的索引是4)
@@ -749,7 +747,7 @@
                         }
                     }
                 }
-              $("#inputForm").submit();
+                $("#inputForm").submit();
                 return true;
             }else {
                 parent.layer.msg("信息未填写完整!", {icon: 5});
@@ -806,10 +804,10 @@
         }
         function countMoney(){
             var m = 0;
-           $.each(mon,function (index,item) {
+            $.each(mon,function (index,item) {
                 m += Number(item);
-           });
-           $("#mont").val(m);
+            });
+            $("#mont").val(m);
         }
 
         function getLoan(id){
@@ -863,8 +861,8 @@
             var seperator2 = ":";
             var month = date.getMonth() + 1;
             var strDate = date.getDate();
-                month = (month < 10)?"0"+month:month;
-                strDate = (strDate < 10)?"0"+strDate:strDate;
+            month = (month < 10)?"0"+month:month;
+            strDate = (strDate < 10)?"0"+strDate:strDate;
             var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate;
             return currentdate;
         }
@@ -911,7 +909,6 @@
                 tpl = tpl.replace("workAccountList[0].financialSubjectss","workAccountList["+idx1+"].financialSubjectss");
                 tpl = tpl.replace("not_project_reimbursement_div","not_project_reimbursement_div\" style=\"display:none;\"");
                 tpl = tpl.replace("project_reimbursement_div\" style=\"display:none;\"","project_reimbursement_div");
-
                 bornTemplete(list, idx, tpl, row, idx1,number);
                 //将报销人和部门自动赋值
                 // if (idx==0 && flag){
@@ -1523,9 +1520,11 @@
                         top.layer.close(tempIndex);
                         // 获取所有 td
                         var tds = $('#workAccountList .op-td');
-                        for (var i = tds.length - 1; i >= 0; i--) {
+                        for (var i = tds.length - 1; i >= 0; i--) {  // 注意 i > 0,从倒数第二个开始
                             var td = tds.eq(i); // 当前 td
+                            // 找到 td 内 class="op-btn-delete" 的元素
                             var deleteBtn = td.find('.op-btn-delete');
+                            // 触发 onclick
                             deleteBtn.each(function(eleIndex,ele) {
                                 if (i == 0){
                                     delRowParentNew(ele,"#workAccountList1",true)
@@ -1538,7 +1537,7 @@
                                 }
                             });
                         }
-                        document.querySelector('.add-btn').style.display = 'none';
+                        document.querySelector('.nav-btn-add').style.display = 'none';
                     },
                     btn2: function(tempIndex, layero){
                         console.log("用户点击了取消");
@@ -1634,7 +1633,7 @@
             var idValue = $idInput.val() || "";
 
             // 标记删除(通过修改第一个td中第二个input的值为1)
-            var $targetInput = $currentRow.find("td:first-child input:eq(3)");
+            var $targetInput = $currentRow.find("td:first-child input:eq(1)");
             if ($targetInput.length > 0) {
                 $targetInput.val("1");
             }
@@ -2198,7 +2197,7 @@
                     }
                 }
             }
-                $("#moneys").val(money);
+            $("#moneys").val(money);
         }
         function getMoneyVATT(index){
             var money = "0.00";
@@ -2241,7 +2240,7 @@
                     }
                 }
             }
-                $("#backmoney").val(money);
+            $("#backmoney").val(money);
         }
 
         function isNumber(val){
@@ -2326,7 +2325,7 @@
 </head>
 <body>
 <div class="single-form">
-<div class="container">
+    <div class="container">
 
         <%-- JSP模板:用占位符代替动态变量 --%>
         <div id="reimburseTemplate" style="display: none;">
@@ -2334,14 +2333,14 @@
                     id="workAccountList__INDEX___reimbursementName"
                     name="workAccountList[__INDEX__].reimbursementName"
                     value="__LEADER_IDS__"
-            labelName="reimbursementNameName"
-            labelValue="__REIMBURSEMENT_NAME__"
-            title="用户"
-            url="/sys/office/treeDataAll?type=3"
-            cssClass="form-control layui-input"
-            checked="true"
-            allowClear="true"
-            notAllowSelectParent="true"/>
+                    labelName="reimbursementNameName"
+                    labelValue="__REIMBURSEMENT_NAME__"
+                    title="用户"
+                    url="/sys/office/treeDataAll?type=3"
+                    cssClass="form-control layui-input"
+                    checked="true"
+                    allowClear="true"
+                    notAllowSelectParent="true"/>
         </div>
         <%-- 隐藏的treeselectAccessoryNoParent标签模板 --%>
         <div id="treeselectAccessoryTemplate" style="display: none;">
@@ -2349,14 +2348,14 @@
                     id="workAccountList__INDEX__type"
                     name="workAccountList[__INDEX__].type"
                     value="__TYPE__"
-            labelName="workAccountList[__INDEX__].typeName"
-            labelValue="__TYPE_NAME__"
-            title="报销类别"
-            url="/reimbursementType/reimbursementType/treeData"
-            extId=""
-            cssClass="form-control judgment layui-input"
-            allowClear="true"
-            notAllowSelectParent="true"/>
+                    labelName="workAccountList[__INDEX__].typeName"
+                    labelValue="__TYPE_NAME__"
+                    title="报销类别"
+                    url="/reimbursementType/reimbursementType/treeData"
+                    extId=""
+                    cssClass="form-control judgment layui-input"
+                    allowClear="true"
+                    notAllowSelectParent="true"/>
         </div>
         <%-- 隐藏的reimburselectReproject标签模板 --%>
         <div id="reimburselectReprojectTemplate" style="display: none;">
@@ -2365,217 +2364,217 @@
                     id="workAccountList__INDEX__project"
                     name="workAccountList[__INDEX__].project.id"
                     value="__PROJECT_ID__"
-            title="选择报销项目"
-            labelName="workAccountList[__INDEX__].project.projectName"
-            labelValue="__PROJECT_NAME__"
-            extId="__PROJECT_RADIO__"
-            cssClass="form-control judgment layui-input"
-            fieldLabels="工程"
-            fieldKeys="projectName"
-            searchLabel="工程名称"
-            searchKey="projectName"/>
+                    title="选择报销项目"
+                    labelName="workAccountList[__INDEX__].project.projectName"
+                    labelValue="__PROJECT_NAME__"
+                    extId="__PROJECT_RADIO__"
+                    cssClass="form-control judgment layui-input"
+                    fieldLabels="工程"
+                    fieldKeys="projectName"
+                    searchLabel="工程名称"
+                    searchKey="projectName"/>
         </div>
 
-    <form:form id="inputForm" modelAttribute="workReimbursement" action="${ctx}/workReimbursementNew/workReimbursementNew/save" method="post" class="form-horizontal" >
-        <form:hidden path="id"/>
-        <form:hidden path="achivesId"/>
-        <form:hidden path="submitterId"/>
-        <input type="hidden" id="numberFlag" value="${workReimbursement.number}" />
-        <input id="wId" type="hidden" value="${workReimbursement.id}">
-        <input id="reimbursementType" name="reimbursementType" type="hidden" value="${workReimbursement.reimbursementType}">
-        <div class="form-group layui-row first">
-            <div class="form-group-label">
-                <div style="float: right">
-                    <c:if test="${not empty historyShow}">
-                        <a href="javascript:void(0)" style='background-color: #FFB800' onclick="openDialogView('历史调整信息', '${ctx}/workReimbursementNew/workReimbursementNew/historyReimbursementInfo?id=${workReimbursement.id}','1100px', '35%','','关闭')" class="layui-btn layui-btn-sm" >历史调整信息</a>
-                    </c:if>
-                </div>
-                <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 layui-form">
-                    <input type="radio" name="reimbursementType" lay-filter="reimbursementTypeRadio" title="普通报销" value="0">
-                    <input type="radio" name="reimbursementType" lay-filter="reimbursementTypeRadio" title="数电发票报销" value="1">
+        <form:form id="inputForm" modelAttribute="workReimbursement" action="${ctx}/workReimbursementNew/workReimbursementNew/save" method="post" class="form-horizontal" >
+            <form:hidden path="id"/>
+            <form:hidden path="achivesId"/>
+            <form:hidden path="submitterId"/>
+            <input type="hidden" id="numberFlag" value="${workReimbursement.number}" />
+            <input id="wId" type="hidden" value="${workReimbursement.id}">
+            <input id="reimbursementType" name="reimbursementType" type="hidden" value="${workReimbursement.reimbursementType}">
+            <div class="form-group layui-row first">
+                <div class="form-group-label">
+                    <div style="float: right">
+                        <c:if test="${not empty historyShow}">
+                            <a href="javascript:void(0)" style='background-color: #FFB800' onclick="openDialogView('历史调整信息', '${ctx}/workReimbursementNew/workReimbursementNew/historyReimbursementInfo?id=${workReimbursement.id}','1100px', '35%','','关闭')" class="layui-btn layui-btn-sm" >历史调整信息</a>
+                        </c:if>
+                    </div>
+                    <h2>基础信息</h2>
                 </div>
-            </div>--%>
-            <div class="layui-item layui-col-sm6">
-                <label class="layui-form-label">报销编号:</label>
-                <div class="layui-input-block">
-                    <div class="input-group">
-                        <form:input path="number" id="number" htmlEscape="false"  readonly="true"  class="form-control layui-input"/>
-                        <span class="input-group-btn">
+                    <%--<div class="layui-item layui-col-sm6">
+                        <label class="layui-form-label"><span class="require-item">*</span>报销类型:</label>
+                        <div class="layui-input-block layui-form">
+                            <input type="radio" name="reimbursementType" lay-filter="reimbursementTypeRadio" title="普通报销" value="0">
+                            <input type="radio" name="reimbursementType" lay-filter="reimbursementTypeRadio" title="数电发票报销" value="1">
+                        </div>
+                    </div>--%>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">报销编号:</label>
+                    <div class="layui-input-block">
+                        <div class="input-group">
+                            <form:input path="number" id="number" htmlEscape="false"  readonly="true"  class="form-control layui-input"/>
+                            <span class="input-group-btn">
                             <label class="form-status"><c:choose><c:when test="${not empty workReimbursement.status}">${fns:getDictLabel(workReimbursement.status, 'audit_state', '')}</c:when><c:otherwise>新添</c:otherwise></c:choose></label>
                          </span>
+                        </div>
                     </div>
                 </div>
-            </div>
-            <div class="layui-item layui-col-sm6">
-                <label class="layui-form-label">经办人:</label>
-                <div class="layui-input-block with-icon">
-                    <div class="input-group">
-                        <form:input path="submitterName" htmlEscape="false" readonly="true" class="form-control layui-input" value = "${workReimbursement.submitterName}"/>
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">经办人:</label>
+                    <div class="layui-input-block with-icon">
+                        <div class="input-group">
+                            <form:input path="submitterName" htmlEscape="false" readonly="true" class="form-control layui-input" value = "${workReimbursement.submitterName}"/>
+                        </div>
                     </div>
                 </div>
-            </div>
 
-            <div class="layui-item layui-col-sm6">
-                <label class="layui-form-label">所属部门:</label>
-                <div class="layui-input-block">
-                    <form:input path="officeName" htmlEscape="false"  readonly="true" id="officeName"  class="form-control judgment layui-input" value = "${workReimbursement.officeName}"/>
-                    <input type="hidden" id="officeId" name="officeId" value="${workReimbursement.officeId}">
+                <div class="layui-item layui-col-sm6">
+                    <label class="layui-form-label">所属部门:</label>
+                    <div class="layui-input-block">
+                        <form:input path="officeName" htmlEscape="false"  readonly="true" id="officeName"  class="form-control judgment layui-input" value = "${workReimbursement.officeName}"/>
+                        <input type="hidden" id="officeId" name="officeId" value="${workReimbursement.officeId}">
+                    </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="submitterDate" name="submitterDate" type="text" readonly="true" maxlength="20" class="laydate-icondate form-control layer-date judgment layui-input laydate-icon"
-                           style="background-color: #fff" placeholder="请选择报销日期" value="<fmt:formatDate value="${submitterDate.submitterDate}" pattern="yyyy-MM-dd"/>"/>
+                <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="submitterDate" name="submitterDate" type="text" readonly="true" maxlength="20" class="laydate-icondate form-control layer-date judgment layui-input laydate-icon"
+                               style="background-color: #fff" placeholder="请选择报销日期" value="<fmt:formatDate value="${submitterDate.submitterDate}" pattern="yyyy-MM-dd"/>"/>
+                    </div>
                 </div>
-            </div>
-            <div class="layui-item layui-col-sm6 with-textarea">
-                <label class="layui-form-label ">备注:</label>
-                <div class="layui-input-block">
-                    <form:textarea path="remarks" placeholder="请输入内容" htmlEscape="false" rows="4"  maxlength="255" value="${workReimbursement.remarks}"  class="form-control "/>
+                <div class="layui-item layui-col-sm6 with-textarea">
+                    <label class="layui-form-label ">备注:</label>
+                    <div class="layui-input-block">
+                        <form:textarea path="remarks" placeholder="请输入内容" htmlEscape="false" rows="4"  maxlength="255" value="${workReimbursement.remarks}"  class="form-control "/>
+                    </div>
                 </div>
             </div>
-        </div>
-        <div class="form-group layui-row">
-            <div class="form-group-label"><h2>报销详情<span style="color: red;font-size: 14px"> (可在报销单后新增数电发票xml格式的附件获取发票信息)</span></h2></div>
-            <div class="layui-item nav-btns add-btn">
-                <a class="nav-btn nav-btn-add" onclick="addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,'',true);workAccountListRowIdx = workAccountListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增报销单</a>
-            </div>
-            <div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
-                <table id="contentTable" class="table table-bordered table-condensed can-edit no-bottom-margin details tree_table">
-                    <thead>
-                    <tr>
-                        <th style="width: 50px;padding: 0px" rowspan="2">报销单</th>
-                        <th style="width:150px" rowspan="2"><font color="red">*</font>报销人</th>
-                        <th style="width:150px" rowspan="2">报销部门</th>
-                        <th style="width:180px" rowspan="2"><font color="red">*</font>报销类型</th>
-                        <th style="width:200px" rowspan="2"><font color="red">*</font>报销项目</th>
-                        <th style="width:200px" rowspan="2">报告号</th>
-                        <!-- 多表头1:费用(元) -->
-                        <th style="width:400px" colspan="4"><font color="red">*</font>费用(元)</th>
-                        <!-- 多表头2:收据张数 -->
-                        <th style="width:300px" colspan="3">收据张数</th>
-                        <th style="width:100px" rowspan="2">出差天数</th>
-                        <th style="width:200px" rowspan="2">内容</th>
-                        <th style="width:200px" rowspan="2">操作</th>
-                    </tr>
-                    <tr>
-                        <!-- 费用子表头 -->
-                        <th style="width:100px">数电发票</th>
-                        <th style="width:100px">非数电票</th>
-                        <th style="width:100px">补贴</th>
-                        <th style="width:100px"><font color="red">*</font>汇总</th>
-                        <!-- 收据张数子表头 -->
-                        <th style="width:100px">数电发票</th>
-                        <th style="width:100px">非数电票</th>
-                        <th style="width:100px">汇总</th>
-                    </tr>
-                    </thead>
-                    <tbody id="workAccountList">
-                    <%--<c:if test="${not empty workReimbursement.workAccountList}">
-                        <c:forEach items="${workReimbursement.workAccountList}" var="workAccount" varStatus="index">
-                            <tr id="workAccountList${index.index}">
-                                <td class="hide">
-                                    <input id="workAccountList${index.index}_id" name="workAccountList[${index.index}].id" type="hidden" value="${workAccount.id}"/>
-                                    <input id="workAccountList${index.index}_projectRadio" name="workAccountList[${index.index}].projectRadio" type="hidden" value="${workAccount.projectRadio}"/>
-                                    <input id="workAccountList${index.index}_delFlag" name="workAccountList[${index.index}].delFlag" type="hidden" value="0"/>
-                                </td>
-                                <td  onclick='listTr(this)' style="vertical-align: middle;">
-                                    <span class='default_shut' name="workAccountList${index.index}.serialNumber" style="padding-right: 15px; "></span>${index.index+1}
-                                </td>
-                                <td style="vertical-align: middle;">
-                                    <div class="project_reimbursement_div"  style="width: 200px">
-                                        <sys:reimburtreeselectUser id="workAccountList${index.index}_reimbursementName" name="workAccountList[${index.index}].reimbursementName" value="${projectRecords.leaderIds}" labelName="reimbursementNameName" labelValue="${workAccount.reimbursementName}"
-                                                                   title="用户" url="/sys/office/treeDataAll?type=3" checked="true" cssClass="form-control  layui-input" allowClear="true" notAllowSelectParent="true"/>
-                                    </div>
-                                </td>
-                                <td style="vertical-align: middle;">
-                                    <input id="workAccountList${index.index}_reimbursementNameofficeId"  name="workAccountList[${index.index}].officeId" maxlength="32" type="text" value="${workAccount.officeId}" readonly="readonly"  class="form-control judgment"/>
-                                </td>
-                                <td style="vertical-align: middle; 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 judgment  layui-input" allowClear="true" notAllowSelectParent="true"/>
-                                    </div>
-                                </td>
-                                <td style="vertical-align: middle;">
-                                    <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}" extId="${workAccount.projectRadio}" cssClass="form-control judgment layui-input" fieldLabels="工程" fieldKeys="projectName" searchLabel="工程名称" searchKey="projectName" />
-                                    </div>
-                                </td>
-                                <td style="vertical-align: middle;">
-                                    <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>
-                                    <input id="workAccountList${index.index}_eInvoiceMoney" onchange="calculateSum(${index.index})" name="workAccountList[${index.index}].eInvoiceMoney" type="text" value="${workAccount.eInvoiceMoney}"  placeholder="数电发票金额" maxlength="10"  class="form-control number "/>
-                                </td>
-                                <td>
-                                    <input id="workAccountList${index.index}_invoiceMoney" onchange="calculateSum(${index.index})" name="workAccountList[${index.index}].invoiceMoney" type="text" value="${workAccount.invoiceMoney}"  placeholder="非数电票金额" maxlength="10"  class="form-control number"/>
-                                </td>
-                                <td>
-                                    <input id="workAccountList${index.index}_subsidyMoney" onchange="calculateSum(${index.index})" name="workAccountList[${index.index}].subsidyMoney" type="text" value="${workAccount.subsidyMoney}"  placeholder="补贴金额" maxlength="10"  class="form-control number"/>
-                                </td>
-                                <td>
-                                    <input id="workAccountList${index.index}_money" name="workAccountList[${index.index}].money" type="text" value="${workAccount.money}"  readonly="readonly"  class="form-control number judgment" style="background-color: #f5f5f5;"/>
-                                </td>
-
-                                <!-- 收据张数三列 -->
-                                <td>
-                                    <input id="workAccountList${index.index}_eInvoiceBills" onchange="billSum(${index.index})" style="background-color: #f5f5f5" readonly name="workAccountList[${index.index}].eInvoiceBills" type="text" value="${workAccount.eInvoiceBills}"  placeholder="数电发票张数" maxlength="5"  class="form-control number"/>
-                                </td>
-                                <td>
-                                    <input id="workAccountList${index.index}_invoiceBills" onchange="billSum(${index.index})" name="workAccountList[${index.index}].invoiceBills" type="text" value="${workAccount.invoiceBills}"  placeholder="非数电票张数" maxlength="5"  class="form-control number"/>
-                                </td>
-                                <td>
-                                    <input id="workAccountList${index.index}_bills" name="workAccountList[${index.index}].bills" type="text" value="${workAccount.bills}"  readonly="readonly"  class="form-control number" style="background-color: #f5f5f5;"/>
-                                </td>
-
-                                <td style="vertical-align: middle; text-align:center;">
-                                    <input id="workAccountList${index.index}_evectionNumber"  name="workAccountList[${index.index}].evectionNumber" type="text" value="${workAccount.evectionNumber}" maxlength="32" placeholder="请输入出差天数"  class="form-control number"/>
-                                </td>
-                                <td style="vertical-align: middle;">
-                                    <input id="workAccountList${index.index}_remarks" name="workAccountList[${index.index}].remarks" type="text" value="${workAccount.remarks}" maxlength="32" placeholder="请输入备注"  class="form-control"/>
-                                </td>
-                                <td style="vertical-align: middle; text-align:center;" class="op-td" >
-                                    <span class="op-btn op-btn-delete" onclick="delRowParentNew(this, '#workAccountList${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
-                                </td>
-                            </tr>
-                        </c:forEach>
-                    </c:if>--%>
-                    </tbody>
-                </table>
-
-                <!-- 总报销费用和总收据张数 -->
-                <table id="contentMoneys" class="table table-bordered table-condensed can-edit no-bottom-margin details">
-                    <thead>
-                    <tr style="border: 0px">
-                        <td></td>
-                        <td style="width:200px" style="vertical-align:middle;text-align: center;"><label><font color="red">*</font>总报销费用(元):</label></td>
-                        <td style="width:150px"></td>
-                        <td style="width:180px"></td>
-                        <td style="width:200px"></td>
-                        <td style="width:200px"></td>
-                        <td style="width:400px" style="border: 0px">
-                            <input htmlEscape="false" style="border: 0px; font-weight: bold;" id="moneys" name="money" readonly="true" class="form-control layui-input" value="${workReimbursement.money}"/>
-                        </td>
-                        <td style="width:300px"></td>
-                        <td style="width:100px"></td>
-                        <td style="width:200px"></td>
-                        <td style="width:200px"></td>
-                    </tr>
-                    </thead>
-                </table>
-
-                <!-- 新增行模板 -->
-                <script type="text/template" id="workAccountListTpl">//<!--
+            <div class="form-group layui-row">
+                <div class="form-group-label"><h2>报销详情<span style="color: red;font-size: 14px"> (可在报销单后新增数电发票xml格式的附件获取发票信息)</span></h2></div>
+                    <%--<div class="layui-item nav-btns">
+                        <a class="nav-btn nav-btn-add" onclick="addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,'',true);workAccountListRowIdx = workAccountListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增报销单</a>
+                    </div>--%>
+                <div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
+                    <table id="contentTable" class="table table-bordered table-condensed can-edit no-bottom-margin details tree_table">
+                        <thead>
+                        <tr>
+                            <th style="width: 50px;padding: 0px" rowspan="2">报销单</th>
+                            <th style="width:150px" rowspan="2"><font color="red">*</font>报销人</th>
+                            <th style="width:150px" rowspan="2">报销部门</th>
+                            <th style="width:180px" rowspan="2"><font color="red">*</font>报销类型</th>
+                            <th style="width:200px" rowspan="2"><font color="red">*</font>报销项目</th>
+                            <th style="width:200px" rowspan="2">报告号</th>
+                            <!-- 多表头1:费用(元) -->
+                            <th style="width:400px" colspan="4"><font color="red">*</font>费用(元)</th>
+                            <!-- 多表头2:收据张数 -->
+                            <th style="width:300px" colspan="3">收据张数</th>
+                            <th style="width:100px" rowspan="2">出差天数</th>
+                            <th style="width:200px" rowspan="2">内容</th>
+                            <th style="width:200px" rowspan="2">操作</th>
+                        </tr>
+                        <tr>
+                            <!-- 费用子表头 -->
+                            <th style="width:100px">数电发票</th>
+                            <th style="width:100px">非数电票</th>
+                            <th style="width:100px">补贴</th>
+                            <th style="width:100px"><font color="red">*</font>汇总</th>
+                            <!-- 收据张数子表头 -->
+                            <th style="width:100px">数电发票</th>
+                            <th style="width:100px">非数电票</th>
+                            <th style="width:100px">汇总</th>
+                        </tr>
+                        </thead>
+                        <tbody id="workAccountList">
+                            <%--<c:if test="${not empty workReimbursement.workAccountList}">
+                                <c:forEach items="${workReimbursement.workAccountList}" var="workAccount" varStatus="index">
+                                    <tr id="workAccountList${index.index}">
+                                        <td class="hide">
+                                            <input id="workAccountList${index.index}_id" name="workAccountList[${index.index}].id" type="hidden" value="${workAccount.id}"/>
+                                            <input id="workAccountList${index.index}_projectRadio" name="workAccountList[${index.index}].projectRadio" type="hidden" value="${workAccount.projectRadio}"/>
+                                            <input id="workAccountList${index.index}_delFlag" name="workAccountList[${index.index}].delFlag" type="hidden" value="0"/>
+                                        </td>
+                                        <td  onclick='listTr(this)' style="vertical-align: middle;">
+                                            <span class='default_shut' name="workAccountList${index.index}.serialNumber" style="padding-right: 15px; "></span>${index.index+1}
+                                        </td>
+                                        <td style="vertical-align: middle;">
+                                            <div class="project_reimbursement_div"  style="width: 200px">
+                                                <sys:reimburtreeselectUser id="workAccountList${index.index}_reimbursementName" name="workAccountList[${index.index}].reimbursementName" value="${projectRecords.leaderIds}" labelName="reimbursementNameName" labelValue="${workAccount.reimbursementName}"
+                                                                           title="用户" url="/sys/office/treeDataAll?type=3" checked="true" cssClass="form-control  layui-input" allowClear="true" notAllowSelectParent="true"/>
+                                            </div>
+                                        </td>
+                                        <td style="vertical-align: middle;">
+                                            <input id="workAccountList${index.index}_reimbursementNameofficeId"  name="workAccountList[${index.index}].officeId" maxlength="32" type="text" value="${workAccount.officeId}" readonly="readonly"  class="form-control judgment"/>
+                                        </td>
+                                        <td style="vertical-align: middle; 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 judgment  layui-input" allowClear="true" notAllowSelectParent="true"/>
+                                            </div>
+                                        </td>
+                                        <td style="vertical-align: middle;">
+                                            <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}" extId="${workAccount.projectRadio}" cssClass="form-control judgment layui-input" fieldLabels="工程" fieldKeys="projectName" searchLabel="工程名称" searchKey="projectName" />
+                                            </div>
+                                        </td>
+                                        <td style="vertical-align: middle;">
+                                            <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>
+                                            <input id="workAccountList${index.index}_eInvoiceMoney" onchange="calculateSum(${index.index})" name="workAccountList[${index.index}].eInvoiceMoney" type="text" value="${workAccount.eInvoiceMoney}"  placeholder="数电发票金额" maxlength="10"  class="form-control number "/>
+                                        </td>
+                                        <td>
+                                            <input id="workAccountList${index.index}_invoiceMoney" onchange="calculateSum(${index.index})" name="workAccountList[${index.index}].invoiceMoney" type="text" value="${workAccount.invoiceMoney}"  placeholder="非数电票金额" maxlength="10"  class="form-control number"/>
+                                        </td>
+                                        <td>
+                                            <input id="workAccountList${index.index}_subsidyMoney" onchange="calculateSum(${index.index})" name="workAccountList[${index.index}].subsidyMoney" type="text" value="${workAccount.subsidyMoney}"  placeholder="补贴金额" maxlength="10"  class="form-control number"/>
+                                        </td>
+                                        <td>
+                                            <input id="workAccountList${index.index}_money" name="workAccountList[${index.index}].money" type="text" value="${workAccount.money}"  readonly="readonly"  class="form-control number judgment" style="background-color: #f5f5f5;"/>
+                                        </td>
+
+                                        <!-- 收据张数三列 -->
+                                        <td>
+                                            <input id="workAccountList${index.index}_eInvoiceBills" onchange="billSum(${index.index})" style="background-color: #f5f5f5" readonly name="workAccountList[${index.index}].eInvoiceBills" type="text" value="${workAccount.eInvoiceBills}"  placeholder="数电发票张数" maxlength="5"  class="form-control number"/>
+                                        </td>
+                                        <td>
+                                            <input id="workAccountList${index.index}_invoiceBills" onchange="billSum(${index.index})" name="workAccountList[${index.index}].invoiceBills" type="text" value="${workAccount.invoiceBills}"  placeholder="非数电票张数" maxlength="5"  class="form-control number"/>
+                                        </td>
+                                        <td>
+                                            <input id="workAccountList${index.index}_bills" name="workAccountList[${index.index}].bills" type="text" value="${workAccount.bills}"  readonly="readonly"  class="form-control number" style="background-color: #f5f5f5;"/>
+                                        </td>
+
+                                        <td style="vertical-align: middle; text-align:center;">
+                                            <input id="workAccountList${index.index}_evectionNumber"  name="workAccountList[${index.index}].evectionNumber" type="text" value="${workAccount.evectionNumber}" maxlength="32" placeholder="请输入出差天数"  class="form-control number"/>
+                                        </td>
+                                        <td style="vertical-align: middle;">
+                                            <input id="workAccountList${index.index}_remarks" name="workAccountList[${index.index}].remarks" type="text" value="${workAccount.remarks}" maxlength="32" placeholder="请输入备注"  class="form-control"/>
+                                        </td>
+                                        <td style="vertical-align: middle; text-align:center;" class="op-td" >
+                                            <span class="op-btn op-btn-delete" onclick="delRowParentNew(this, '#workAccountList${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
+                                        </td>
+                                    </tr>
+                                </c:forEach>
+                            </c:if>--%>
+                        </tbody>
+                    </table>
+
+                    <!-- 总报销费用和总收据张数 -->
+                    <table id="contentMoneys" class="table table-bordered table-condensed can-edit no-bottom-margin details">
+                        <thead>
+                        <tr style="border: 0px">
+                            <td></td>
+                            <td style="width:200px" style="vertical-align:middle;text-align: center;"><label><font color="red">*</font>总报销费用(元):</label></td>
+                            <td style="width:150px"></td>
+                            <td style="width:180px"></td>
+                            <td style="width:200px"></td>
+                            <td style="width:200px"></td>
+                            <td style="width:400px" style="border: 0px">
+                                <input htmlEscape="false" style="border: 0px; font-weight: bold;" id="moneys" name="money" readonly="true" class="form-control layui-input" value="${workReimbursement.money}"/>
+                            </td>
+                            <td style="width:300px"></td>
+                            <td style="width:100px"></td>
+                            <td style="width:200px"></td>
+                            <td style="width:200px"></td>
+                        </tr>
+                        </thead>
+                    </table>
+
+                    <!-- 新增行模板 -->
+                    <script type="text/template" id="workAccountListTpl">//<!--
         <tr id="workAccountList{{idx}}">
             <td class="hide">
                 <input id="workAccountList{{idx}}_id" name="workAccountList[{{idx}}].id" type="hidden" value="{{row.id}}" />
@@ -2647,62 +2646,62 @@
                 </td>
                 <td style="vertical-align: middle; text-align:center;" class="op-td" >
                     <span class="op-btn op-btn-add" onclick="addRowInfoForm(this, '#workAccountList{{idx}}')" title="添加"><i class="fa fa-plus"></i>&nbsp;新增</span>
-                    {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRowParentNew(this, '#workAccountList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
+                    <%--{{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRowParentNew(this, '#workAccountList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}--%>
                 </td>
                 </tr>//-->
-                </script>
-            </div>
-        </div>
-        <div class="form-group layui-row count1">
-            <div class="form-group-label"><h2>专用发票信息</h2></div>
-            <div class="layui-item nav-btns ">
-                <a class="nav-btn nav-btn-add" onclick="addRow('#reimbursementVATTaxes', reimbursementVATTaxesRowIdx, reimbursementVATTaxesTpl);reimbursementVATTaxesRowIdx = reimbursementVATTaxesRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
+                    </script>
+                </div>
             </div>
-            <div class="layui-item layui-col-xs12 form-table-container">
-                <table id="contentTable2" class="table table-bordered table-condensed can-edit">
-                    <thead>
-                    <tr>
-                        <th width="300px"><font color="red">*</font>发票代码</th>
-                        <th width="200px"><font color="red">*</font>发票号</th>
-                        <th width="200px"><font color="red">*</font>金额</th>
-                        <th width="200px"><font color="red">*</font>税额</th>
-                        <th width="200px"><font color="red">*</font>价税合计</th>
-                        <th width="150px">操作</th>
-                    </tr>
-                    </thead>
-                    <tbody id="reimbursementVATTaxes">
-                    <c:if test="${not empty workReimbursement.reimbursementVATTaxes}">
-                        <c:forEach items="${workReimbursement.reimbursementVATTaxes}" var="reimbursementVATTaxes" varStatus="index">
-                            <tr id="reimbursementVATTaxes${index.index}">
-                                <td class="hide">
-                                    <input id="reimbursementVATTaxes${index.index}_id" name="reimbursementVATTaxes[${index.index}].id" type="hidden" value="${reimbursementVATTaxes.id}"/>
-                                    <input id="reimbursementVATTaxes${index.index}_delFlag" name="reimbursementVATTaxes[${index.index}].delFlag" type="hidden" value="0"/>
-                                </td>
-                                <td>
-                                    <input id="reimbursementVATTaxes${index.index}_invoiceCode" maxlength="30" name="reimbursementVATTaxes[${index.index}].invoiceCode" type="text" maxlength="32" value="${reimbursementVATTaxes.invoiceCode}"  placeholder="请输入发票代码"  class="form-control judgment number"/>
-                                </td>
-
-                                <td>
-                                    <input id="reimbursementVATTaxes${index.index}_invoiceNumber" maxlength="30" name="reimbursementVATTaxes[${index.index}].invoiceNumber" type="text" maxlength="32" value="${reimbursementVATTaxes.invoiceNumber}"  placeholder="请输入发票号"  class="form-control judgment number "/>
-                                </td>
-                                <td>
-                                    <input id="reimbursementVATTaxes${index.index}_money" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].money" type="text" maxlength="32" value="${reimbursementVATTaxes.money}"  placeholder="请输入金额"  class="form-control judgment number "/>
-                                </td>
-                                <td>
-                                    <input id="reimbursementVATTaxes${index.index}_taxAmount" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].taxAmount" type="text" maxlength="32" value="${reimbursementVATTaxes.taxAmount}"  placeholder="请输入税额"  class="form-control judgment number "/>
-                                </td>
-                                <td>
-                                    <input id="reimbursementVATTaxes${index.index}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[${index.index}].sumMoney" type="text" maxlength="32" value="${reimbursementVATTaxes.sumMoney}"    class="form-control number judgment sumMoney"/>
-                                </td>
-                                <td class="text-center op-td">
-                                    <span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementVATTaxes${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
-                                </td>
-                            </tr>
-                        </c:forEach>
-                    </c:if>
-                    </tbody>
-                </table>
-                <script type="text/template" id="reimbursementVATTaxesTpl">//<!--
+            <div class="form-group layui-row count1">
+                <div class="form-group-label"><h2>专用发票信息</h2></div>
+                <div class="layui-item nav-btns">
+                    <a class="nav-btn nav-btn-add" onclick="addRow('#reimbursementVATTaxes', reimbursementVATTaxesRowIdx, reimbursementVATTaxesTpl);reimbursementVATTaxesRowIdx = reimbursementVATTaxesRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
+                </div>
+                <div class="layui-item layui-col-xs12 form-table-container">
+                    <table id="contentTable2" class="table table-bordered table-condensed can-edit">
+                        <thead>
+                        <tr>
+                            <th width="300px"><font color="red">*</font>发票代码</th>
+                            <th width="200px"><font color="red">*</font>发票号</th>
+                            <th width="200px"><font color="red">*</font>金额</th>
+                            <th width="200px"><font color="red">*</font>税额</th>
+                            <th width="200px"><font color="red">*</font>价税合计</th>
+                            <th width="150px">操作</th>
+                        </tr>
+                        </thead>
+                        <tbody id="reimbursementVATTaxes">
+                        <c:if test="${not empty workReimbursement.reimbursementVATTaxes}">
+                            <c:forEach items="${workReimbursement.reimbursementVATTaxes}" var="reimbursementVATTaxes" varStatus="index">
+                                <tr id="reimbursementVATTaxes${index.index}">
+                                    <td class="hide">
+                                        <input id="reimbursementVATTaxes${index.index}_id" name="reimbursementVATTaxes[${index.index}].id" type="hidden" value="${reimbursementVATTaxes.id}"/>
+                                        <input id="reimbursementVATTaxes${index.index}_delFlag" name="reimbursementVATTaxes[${index.index}].delFlag" type="hidden" value="0"/>
+                                    </td>
+                                    <td>
+                                        <input id="reimbursementVATTaxes${index.index}_invoiceCode" maxlength="30" name="reimbursementVATTaxes[${index.index}].invoiceCode" type="text" maxlength="32" value="${reimbursementVATTaxes.invoiceCode}"  placeholder="请输入发票代码"  class="form-control judgment number"/>
+                                    </td>
+
+                                    <td>
+                                        <input id="reimbursementVATTaxes${index.index}_invoiceNumber" maxlength="30" name="reimbursementVATTaxes[${index.index}].invoiceNumber" type="text" maxlength="32" value="${reimbursementVATTaxes.invoiceNumber}"  placeholder="请输入发票号"  class="form-control judgment number "/>
+                                    </td>
+                                    <td>
+                                        <input id="reimbursementVATTaxes${index.index}_money" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].money" type="text" maxlength="32" value="${reimbursementVATTaxes.money}"  placeholder="请输入金额"  class="form-control judgment number "/>
+                                    </td>
+                                    <td>
+                                        <input id="reimbursementVATTaxes${index.index}_taxAmount" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].taxAmount" type="text" maxlength="32" value="${reimbursementVATTaxes.taxAmount}"  placeholder="请输入税额"  class="form-control judgment number "/>
+                                    </td>
+                                    <td>
+                                        <input id="reimbursementVATTaxes${index.index}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[${index.index}].sumMoney" type="text" maxlength="32" value="${reimbursementVATTaxes.sumMoney}"    class="form-control number judgment sumMoney"/>
+                                    </td>
+                                    <td class="text-center op-td">
+                                        <span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementVATTaxes${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
+                                    </td>
+                                </tr>
+                            </c:forEach>
+                        </c:if>
+                        </tbody>
+                    </table>
+                    <script type="text/template" id="reimbursementVATTaxesTpl">//<!--
                                     <tr id="reimbursementVATTaxes{{idx}}">
                                         <td class="hide">
                                             <input id="reimbursementVATTaxes{{idx}}_id" name="reimbursementVATTaxes[{{idx}}].id" type="hidden" value="{{row.id}}"/>
@@ -2728,50 +2727,49 @@
                                             {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementVATTaxes{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
                                         </td>
                                     </tr>//-->
-                </script>
-                <script type="text/javascript">
-                    var workAccountListRowIdx = 0, workAccountListTpl = $("#workAccountListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
-                    var reimbursementVATTaxesRowIdx = 0, reimbursementVATTaxesTpl = $("#reimbursementVATTaxesTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
-                    if($("#id").val()){
-                        workAccountListRowIdx = ${fn:length(workReimbursement.workAccountList)};
-                        reimbursementVATTaxesRowIdx = ${fn:length(workReimbursement.reimbursementVATTaxes)};
-                    }
-                    $(document).ready(function() {
-                        <%--var data = ${fns:toJson(workReimbursement.createBy)};--%>
-                        <%--addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,data,true );--%>
-                        <%--workAccountListRowIdx = workAccountListRowIdx + 1;--%>
-                        var tempData = ${fns:toJson(workReimbursement.workAccountList)};
-                        if(tempData.length > 0 &&tempData[0].typeName == '业务差旅费'  ){
-                            document.querySelector('.add-btn').style.display = 'block';
-                        }else{
-                            document.querySelector('.add-btn').style.display = 'none';
+                    </script>
+                    <script type="text/javascript">
+                        var workAccountListRowIdx = 0, workAccountListTpl = $("#workAccountListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                        var reimbursementVATTaxesRowIdx = 0, reimbursementVATTaxesTpl = $("#reimbursementVATTaxesTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
+                        if($("#id").val()){
+                            workAccountListRowIdx = ${fn:length(workReimbursement.workAccountList)};
+                            reimbursementVATTaxesRowIdx = ${fn:length(workReimbursement.reimbursementVATTaxes)};
                         }
-
-                    });
-                </script>
+                        $(document).ready(function() {
+                            <%--var data = ${fns:toJson(workReimbursement.createBy)};--%>
+                            <%--addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,data,true );--%>
+                            <%--workAccountListRowIdx = workAccountListRowIdx + 1;--%>
+                            <%--document.querySelector('.nav-btn-add').style.display = 'none';--%>
+                            <%--    var data = ${fns:toJson(workReimbursement.reimbursementVATTaxes)};--%>
+                            <%--for (var i=0; i<data.length; i++){--%>
+                            <%--    addRow('#reimbursementVATTaxes', reimbursementVATTaxesRowIdx, reimbursementVATTaxesTpl, data[i]);--%>
+                            <%--    reimbursementVATTaxesRowIdx = reimbursementVATTaxesRowIdx + 1;--%>
+                            <%--}--%>
+                        });
+                    </script>
+                </div>
             </div>
-        </div>
 
 
 
 
 
-        <!-- fileHandlerFuncName="myCustomHandler" 自定义函数名 -->
-        <!-- attachmentFlag="6" 附件标识 -->
-        <!-- storeAs="wrkReimbursement" 存储路径标识 -->
-        <!-- showOperateArea="false" 是否展示新增按钮,默认true -->
-        <table:attachmentManager
-                title="附件信息"
-                addBtnText="添加附件"
-                baseId="attachment"
-                attachments="${workReimbursement.workAttachments}"
-                fileHandlerFuncName="insertTitle"
-                attachmentFlag="6"
-                storeAs="wrkReimbursement"
-        />
-        <div class="form-group layui-row page-end"></div>
-    </form:form>
-</div>
+            <!-- fileHandlerFuncName="myCustomHandler" 自定义函数名 -->
+            <!-- attachmentFlag="6" 附件标识 -->
+            <!-- storeAs="wrkReimbursement" 存储路径标识 -->
+            <!-- showOperateArea="false" 是否展示新增按钮,默认true -->
+            <table:attachmentManager
+                    title="附件信息"
+                    addBtnText="添加附件"
+                    baseId="attachment"
+                    attachments="${workReimbursement.workAttachments}"
+                    fileHandlerFuncName="insertTitle"
+                    attachmentFlag="6"
+                    storeAs="wrkReimbursement"
+            />
+            <div class="form-group layui-row page-end"></div>
+        </form:form>
+    </div>
 </div>
 
 <script>
@@ -2787,7 +2785,7 @@
 
             // 2. 排除已删除的行(隐藏或标记删除)
             var isHidden = $row.hasClass("hidden");
-            var $delFlagInput = $row.find("td:first-child input:eq(3)");
+            var $delFlagInput = $row.find("td:first-child input:eq(1)");
             var isDeleted = $delFlagInput.val() === "1";
             if (isHidden || isDeleted) {
                 return true; // 继续下一行
@@ -2906,7 +2904,7 @@
 
             // 2. 排除已删除的行(隐藏或标记删除)
             var isHidden = $row.hasClass("hidden");
-            var $delFlagInput = $row.find("td:first-child input:eq(3)");
+            var $delFlagInput = $row.find("td:first-child input:eq(1)");
             var isDeleted = $delFlagInput.val() === "1";
             if (isHidden || isDeleted) {
                 return true; // 继续下一行

File diff suppressed because it is too large
+ 518 - 606
src/main/webapp/webpage/modules/workreimbursement/treeForm/new/workReimbursementNewModifyApply.jsp


+ 67 - 110
src/main/webapp/webpage/modules/workreimbursement/treeForm/specific/workReimbursementSpecificModifyApply.jsp

@@ -196,7 +196,7 @@
 
                             // 3. 替换模板中的所有占位符
                             var accessoryNoParentParsedTagHtml = accessoryNoParentTemplateHtml
-                                .replace(/__INDEX__/g, index+1) // 替换索引
+                                .replace(/__INDEX__/g, index) // 替换索引
                                 .replace(/__TYPE__/g, typeValue) // 替换type值(处理空值后)
                                 .replace(/__TYPE_NAME__/g, typeNameValue); // 替换typeName值(处理空值后)
 
@@ -210,7 +210,7 @@
 
                             // 3. 替换模板中的所有占位符
                             var reprojectParsedTagHtml = reprojectTemplateHtml
-                                .replace(/__INDEX__/g, index+1) // 替换行索引
+                                .replace(/__INDEX__/g, index) // 替换行索引
                                 .replace(/__PROJECT_ID__/g, projectId) // 替换项目ID(处理空值后)
                                 .replace(/__PROJECT_NAME__/g, projectName) // 替换项目名称(处理空值后)
                                 .replace(/__PROJECT_RADIO__/g, projectRadio); // 替换projectRadio(处理空值后)
@@ -231,8 +231,8 @@
                             var serialNumber = index + 1
 
                             if(flag) {
-                                index = index+1
                                 const trId = 'workAccountList' + index;
+
                                 $("#workAccountList").append("<tr id='workAccountList" + index + "' class='rowSize'>" +
                                     "<td class='hide'>" +
                                     "<input id='workAccountList" + index + "_id' name='workAccountList[" + index + "].id' type='hidden' value='" + obj.id + "'/>" +
@@ -661,7 +661,7 @@
                 var $sumInput = $(this);
                 var $currentTr = $sumInput.closest("tr");
                 var isHidden = $currentTr.hasClass("hidden");
-                var $delFlagInput = $currentTr.find("td:first-child input:eq(3)");
+                var $delFlagInput = $currentTr.find("td:first-child input:eq(1)");
                 var isDeleted = $delFlagInput.val() === "1";
 
                 // 1. 获取当前行的第五个td(索引从0开始,第五个td的索引是4)
@@ -1490,112 +1490,75 @@
 
         // 数电发票删除 - 隐藏行版本(保留DOM,只隐藏)
         function delRowParentNew(obj, prefix){
-            if (prefix == '#workAccountList1' && !isBatch) {
-                top.layer.open({
-                    title: '提示',
-                    content: '是否确认删除第1张报销单?(所有报销单数据也将同步删除)',
-                    icon: 3,
-                    btn: ['确定', '取消'],
-                    yes: function (tempIndex, layero) {
-                        // 关闭弹窗
-                        top.layer.close(tempIndex);
-                        // 获取所有 td
-                        var tds = $('#workAccountList .op-td');
-                        for (var i = tds.length - 1; i >= 0; i--) {
-                            var td = tds.eq(i); // 当前 td
-                            var deleteBtn = td.find('.op-btn-delete');
-                            deleteBtn.each(function (eleIndex, ele) {
-                                if (i == 0) {
-                                    delRowParentNew(ele, "#workAccountList1", true)
-                                } else {
-                                    if (this.onclick) {
-                                        this.onclick();
-                                    } else {
-                                        $(this).trigger('click');
-                                    }
-                                }
-                            });
-                        }
-                        document.querySelector('.add-btn').style.display = 'none';
-                    },
-                    btn2: function (tempIndex, layero) {
-                        console.log("用户点击了取消");
-                    },
-                    cancel: function (tempIndex, layero) {
-                        console.log("用户关闭了弹窗");
-                    }
-                });
-            } else {
-                var id = $(prefix + "_id");
+            var id = $(prefix+"_id");
 
-                var workAccountmoney = $(prefix + "_money").val();
-                var money = $("#moneys").val();
-                if (isNumber(workAccountmoney)) {
-                    if (money == "") {
-                        money = parseFloat(workAccountmoney).toFixed(2);
-                    } else {
-                        money = (parseFloat(money) - parseFloat(workAccountmoney)).toFixed(2);
-                    }
+            var workAccountmoney= $(prefix+"_money").val();
+            var money = $("#moneys").val();
+            if (isNumber(workAccountmoney)){
+                if(money==""){
+                    money = parseFloat(workAccountmoney).toFixed(2);
+                }else {
+                    money = (parseFloat(money) - parseFloat(workAccountmoney)).toFixed(2);
+                }
+            }
+            if(money>=0){
+                count++;
+                $("#moneys").val(money);
+                var delFlag = $(prefix+"_delFlag");
+                if (id.val() == ""){
+                    delFlag.val("1");
+                    $(obj).parent().parent().remove();
+                }else if(delFlag.val() == "0"){
+                    delFlag.val("1");
+                    $(obj).html("&divide;").attr("title", "撤回删除");
+                    $(obj).parent().parent().addClass("error");
+                    $(obj).parent().parent().addClass("hide");
+                }else if(delFlag.val() == "1"){
+                    delFlag.val("0");
+                    $(obj).html("&times;").attr("title", "删除");
+                    $(obj).parent().parent().removeClass("error");
                 }
-                if (money >= 0) {
-                    count++;
-                    $("#moneys").val(money);
-                    var delFlag = $(prefix + "_delFlag");
-                    if (id.val() == "") {
-                        delFlag.val("1");
-                        $(obj).parent().parent().remove();
-                    } else if (delFlag.val() == "0") {
-                        delFlag.val("1");
-                        $(obj).html("&divide;").attr("title", "撤回删除");
-                        $(obj).parent().parent().addClass("error");
-                        $(obj).parent().parent().addClass("hide");
-                    } else if (delFlag.val() == "1") {
-                        delFlag.val("0");
-                        $(obj).html("&times;").attr("title", "删除");
-                        $(obj).parent().parent().removeClass("error");
-                    }
 
 
-                    // 定位外层tr(class为c7f4ef4720924167b2520f620918e1eb)
-                    var $outerTr = $("tr." + id.val());
+                // 定位外层tr(class为c7f4ef4720924167b2520f620918e1eb)
+                var $outerTr = $("tr." + id.val());
 
-                    // 检查外层tr是否存在
-                    if ($outerTr.length === 0) {
+                // 检查外层tr是否存在
+                if ($outerTr.length === 0) {
 
-                    } else {
-                        // 查找外层tr下的所有子tr(包括嵌套在tbody中的)
-                        $outerTr.find("tr").each(function (index, tr) {
-                            var $tr = $(tr);
-
-                            // 找到当前tr的第一个td(索引0)
-                            var $firstTd = $tr.find("td").eq(0);
-                            if ($firstTd.length === 0) {
-                                return true; // 继续下一个tr
-                            }
+                } else {
+                    // 查找外层tr下的所有子tr(包括嵌套在tbody中的)
+                    $outerTr.find("tr").each(function(index, tr) {
+                        var $tr = $(tr);
+
+                        // 找到当前tr的第一个td(索引0)
+                        var $firstTd = $tr.find("td").eq(0);
+                        if ($firstTd.length === 0) {
+                            return true; // 继续下一个tr
+                        }
 
-                            // 找到第一个td中的第二个input(索引1)
-                            var $targetInput = $firstTd.find("input").eq(1);
-                            if ($targetInput.length === 0) {
-                                return true; // 继续下一个tr
-                            }
+                        // 找到第一个td中的第二个input(索引1)
+                        var $targetInput = $firstTd.find("input").eq(1);
+                        if ($targetInput.length === 0) {
+                            return true; // 继续下一个tr
+                        }
 
-                            // 设置input的值为1
-                            $targetInput.val("1");
-                        });
-                    }
+                        // 设置input的值为1
+                        $targetInput.val("1");
+                    });
+                }
 
-                    // 隐藏外层tr(核心新增逻辑)
-                    $outerTr.hide();
+                // 隐藏外层tr(核心新增逻辑)
+                $outerTr.hide();
 
-                    var $currentRow = $(obj).closest("tr"); // 当前行
-                    var $parentTable = $currentRow.closest("table"); // 父表格
+                var $currentRow = $(obj).closest("tr"); // 当前行
+                var $parentTable = $currentRow.closest("table"); // 父表格
 
-                    // 重新排序行号
-                    reorderParentRowNumbers($parentTable);
+                // 重新排序行号
+                reorderParentRowNumbers($parentTable);
 
-                } else {
-                    parent.layer.msg('删除失败', {icon: 2});
-                }
+            }else{
+                parent.layer.msg('删除失败',{icon:2});
             }
         }
 
@@ -1610,7 +1573,7 @@
             var idValue = $idInput.val() || "";
 
             // 标记删除(通过修改第一个td中第二个input的值为1)
-            var $targetInput = $currentRow.find("td:first-child input:eq(3)");
+            var $targetInput = $currentRow.find("td:first-child input:eq(1)");
             if ($targetInput.length > 0) {
                 $targetInput.val("1");
             }
@@ -2423,9 +2386,9 @@
             </div>
             <div class="form-group layui-row">
                 <div class="form-group-label"><h2>报销详情<span style="color: red;font-size: 14px"> (可在报销单后新增数电发票xml格式的附件获取发票信息)</span></h2></div>
-                <div class="layui-item nav-btns add-btn">
-                    <a class="nav-btn nav-btn-add" onclick="addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,'',true);workAccountListRowIdx = workAccountListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增报销单</a>
-                </div>
+<%--                <div class="layui-item nav-btns">--%>
+<%--                    <a class="nav-btn nav-btn-add" onclick="addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,'',true);workAccountListRowIdx = workAccountListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增报销单</a>--%>
+<%--                </div>--%>
                 <div class="layui-table-body layui-item layui-col-xs12 form-table-container"  style="padding:0px">
                     <table id="contentTable" class="table table-bordered table-condensed can-edit no-bottom-margin details tree_table">
                         <thead>
@@ -2724,12 +2687,6 @@
                         addRow('#reimbursementVATTaxes', reimbursementVATTaxesRowIdx, reimbursementVATTaxesTpl, data[i]);
                         reimbursementVATTaxesRowIdx = reimbursementVATTaxesRowIdx + 1;
                     }*/
-                            var tempData = ${fns:toJson(workReimbursement.workAccountList)};
-                            if (tempData.length > 0 && tempData[0].typeName == '业务差旅费') {
-                                document.querySelector('.add-btn').style.display = 'block';
-                            } else {
-                                document.querySelector('.add-btn').style.display = 'none';
-                            }
                         });
                     </script>
                 </div>
@@ -2770,7 +2727,7 @@
 
             // 2. 排除已删除的行(隐藏或标记删除)
             var isHidden = $row.hasClass("hidden");
-            var $delFlagInput = $row.find("td:first-child input:eq(3)");
+            var $delFlagInput = $row.find("td:first-child input:eq(1)");
             var isDeleted = $delFlagInput.val() === "1";
             if (isHidden || isDeleted) {
                 return true; // 继续下一行
@@ -2889,7 +2846,7 @@
 
             // 2. 排除已删除的行(隐藏或标记删除)
             var isHidden = $row.hasClass("hidden");
-            var $delFlagInput = $row.find("td:first-child input:eq(3)");
+            var $delFlagInput = $row.find("td:first-child input:eq(1)");
             var isDeleted = $delFlagInput.val() === "1";
             if (isHidden || isDeleted) {
                 return true; // 继续下一行