Просмотр исходного кода

报销删除按钮恢复,新增报销项时自动添加报销人名称

huangguoce 1 день назад
Родитель
Сommit
781f16b6bd

+ 6 - 5
src/main/webapp/webpage/modules/workreimbursement/treeForm/all/workReimbursementAllFormAdd.jsp

@@ -363,6 +363,7 @@
             console.log(listStr)
             if(listStr<1){
                 addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,'',true)
+                workAccountListRowIdx = workAccountListRowIdx+1
             }
         });
 
@@ -671,7 +672,7 @@
                     var $sumInput = $(this);
                     var $currentTr = $sumInput.closest("tr");
                     var isHidden = $currentTr.hasClass("hidden");
-                    var $delFlagInput = $currentTr.find("td:first-child input:eq(1)");
+                    var $delFlagInput = $currentTr.find("td:first-child input:eq(3)");
                     var isDeleted = $delFlagInput.val() === "1";
 
                     // 1. 获取当前行的第五个td(索引从0开始,第五个td的索引是4)
@@ -1587,7 +1588,7 @@
             var idValue = $idInput.val() || "";
 
             // 标记删除(通过修改第一个td中第二个input的值为1)
-            var $targetInput = $currentRow.find("td:first-child input:eq(1)");
+            var $targetInput = $currentRow.find("td:first-child input:eq(3)");
             if ($targetInput.length > 0) {
                 $targetInput.val("1");
             }
@@ -2601,7 +2602,7 @@
                 </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>
@@ -2740,7 +2741,7 @@
 
             // 2. 排除已删除的行(隐藏或标记删除)
             var isHidden = $row.hasClass("hidden");
-            var $delFlagInput = $row.find("td:first-child input:eq(1)");
+            var $delFlagInput = $row.find("td:first-child input:eq(3)");
             var isDeleted = $delFlagInput.val() === "1";
             if (isHidden || isDeleted) {
                 return true; // 继续下一行
@@ -2860,7 +2861,7 @@
 
             // 2. 排除已删除的行(隐藏或标记删除)
             var isHidden = $row.hasClass("hidden");
-            var $delFlagInput = $row.find("td:first-child input:eq(1)");
+            var $delFlagInput = $row.find("td:first-child input:eq(3)");
             var isDeleted = $delFlagInput.val() === "1";
             if (isHidden || isDeleted) {
                 return true; // 继续下一行

+ 3 - 2
src/main/webapp/webpage/modules/workreimbursement/treeForm/all/workReimbursementAllModifyApply.jsp

@@ -391,6 +391,7 @@
             console.log(listStr)
             if(listStr<1){
                 addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,'',true)
+                workAccountListRowIdx = workAccountListRowIdx+1
             }
         });
 
@@ -2586,8 +2587,8 @@
                 <td style="vertical-align: middle;">
                     <input id="workAccountList{{idx}}_remarks" name="workAccountList[{{idx}}].remarks" type="text" value="{{row.remarks}}"  placeholder="请输入内容" maxlength="32" class="form-control "/>
                 </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>
+新增                <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}}
                 </td>
                 </tr>//-->

+ 8 - 46
src/main/webapp/webpage/modules/workreimbursement/treeForm/new/workReimbursementNewFormAdd.jsp

@@ -367,6 +367,7 @@
             var listStr = '${workReimbursement.workAccountListCount}';
             if(listStr<1){
                 addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,'',true)
+                workAccountListRowIdx = workAccountListRowIdx+1
             }
         });
 
@@ -673,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(1)");
+                    var $delFlagInput = $currentTr.find("td:first-child input:eq(3)");
                     var isDeleted = $delFlagInput.val() === "1";
 
                     // 1. 获取当前行的第五个td(索引从0开始,第五个td的索引是4)
@@ -917,6 +918,7 @@
                 $(id).val(data.id);
                 $(idName).val(data.name);
                 $(idOffice).val(data.office.name);
+
                 // }
             }
             var idx2 = $("#reimbursementVATTaxes tr").length;
@@ -1508,44 +1510,7 @@
 
         // 数电发票删除 - 隐藏行版本(保留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--) {  // 注意 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)
-                                }else{
-                                    if (this.onclick) {
-                                        this.onclick();
-                                    } else {
-                                        $(this).trigger('click');
-                                    }
-                                }
-                            });
-                        }
-                        document.querySelector('.nav-btn-add').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();
@@ -1616,9 +1581,6 @@
                 }else{
                     parent.layer.msg('删除失败',{icon:2});
                 }
-            }
-
-
         }
 
         // 数电发票删除 - 隐藏行版本(保留DOM,只隐藏)
@@ -1632,7 +1594,7 @@
             var idValue = $idInput.val() || "";
 
             // 标记删除(通过修改第一个td中第二个input的值为1)
-            var $targetInput = $currentRow.find("td:first-child input:eq(1)");
+            var $targetInput = $currentRow.find("td:first-child input:eq(3)");
             if ($targetInput.length > 0) {
                 $targetInput.val("1");
             }
@@ -2647,7 +2609,7 @@
                 </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>
@@ -2787,7 +2749,7 @@
 
             // 2. 排除已删除的行(隐藏或标记删除)
             var isHidden = $row.hasClass("hidden");
-            var $delFlagInput = $row.find("td:first-child input:eq(1)");
+            var $delFlagInput = $row.find("td:first-child input:eq(3)");
             var isDeleted = $delFlagInput.val() === "1";
             if (isHidden || isDeleted) {
                 return true; // 继续下一行
@@ -2906,7 +2868,7 @@
 
             // 2. 排除已删除的行(隐藏或标记删除)
             var isHidden = $row.hasClass("hidden");
-            var $delFlagInput = $row.find("td:first-child input:eq(1)");
+            var $delFlagInput = $row.find("td:first-child input:eq(3)");
             var isDeleted = $delFlagInput.val() === "1";
             if (isHidden || isDeleted) {
                 return true; // 继续下一行

+ 5 - 5
src/main/webapp/webpage/modules/workreimbursement/treeForm/new/workReimbursementNewModifyApply.jsp

@@ -392,6 +392,7 @@
             console.log(listStr)
             if(listStr<1){
                 addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,'',true)
+                workAccountListRowIdx = workAccountListRowIdx+1
             }
         });
 
@@ -669,7 +670,7 @@
                 var $sumInput = $(this);
                 var $currentTr = $sumInput.closest("tr");
                 var isHidden = $currentTr.hasClass("hidden");
-                var $delFlagInput = $currentTr.find("td:first-child input:eq(1)");
+                var $delFlagInput = $currentTr.find("td:first-child input:eq(3)");
                 var isDeleted = $delFlagInput.val() === "1";
 
                 // 1. 获取当前行的第五个td(索引从0开始,第五个td的索引是4)
@@ -882,7 +883,6 @@
             var number = validTrs.length + 1;
 
             if(list == '#workAccountList'){
-
                 tpl = tpl.replace("workAccountList[0].financialSubjects","workAccountList["+idx1+"].financialSubjects");
                 tpl = tpl.replace("workAccountList[0].financialSubjectss","workAccountList["+idx1+"].financialSubjectss");
                 tpl = tpl.replace("not_project_reimbursement_div","not_project_reimbursement_div\" style=\"display:none;\"");
@@ -1567,7 +1567,7 @@
             var idValue = $idInput.val() || "";
 
             // 标记删除(通过修改第一个td中第二个input的值为1)
-            var $targetInput = $currentRow.find("td:first-child input:eq(1)");
+            var $targetInput = $currentRow.find("td:first-child input:eq(3)");
             if ($targetInput.length > 0) {
                 $targetInput.val("1");
             }
@@ -2724,7 +2724,7 @@
 
             // 2. 排除已删除的行(隐藏或标记删除)
             var isHidden = $row.hasClass("hidden");
-            var $delFlagInput = $row.find("td:first-child input:eq(1)");
+            var $delFlagInput = $row.find("td:first-child input:eq(3)");
             var isDeleted = $delFlagInput.val() === "1";
             if (isHidden || isDeleted) {
                 return true; // 继续下一行
@@ -2843,7 +2843,7 @@
 
             // 2. 排除已删除的行(隐藏或标记删除)
             var isHidden = $row.hasClass("hidden");
-            var $delFlagInput = $row.find("td:first-child input:eq(1)");
+            var $delFlagInput = $row.find("td:first-child input:eq(3)");
             var isDeleted = $delFlagInput.val() === "1";
             if (isHidden || isDeleted) {
                 return true; // 继续下一行

+ 4 - 4
src/main/webapp/webpage/modules/workreimbursement/treeForm/replenish/workReimbursementReplenishAudit.jsp

@@ -723,7 +723,7 @@
 				var $sumInput = $(this);
 				var $currentTr = $sumInput.closest("tr");
 				var isHidden = $currentTr.hasClass("hidden");
-				var $delFlagInput = $currentTr.find("td:first-child input:eq(1)");
+				var $delFlagInput = $currentTr.find("td:first-child input:eq(3)");
 				var isDeleted = $delFlagInput.val() === "1";
 
 				// 1. 获取当前行的第五个td(索引从0开始,第五个td的索引是4)
@@ -1560,7 +1560,7 @@
 			var idValue = $idInput.val() || "";
 
 			// 标记删除(通过修改第一个td中第二个input的值为1)
-			var $targetInput = $currentRow.find("td:first-child input:eq(1)");
+			var $targetInput = $currentRow.find("td:first-child input:eq(3)");
 			if ($targetInput.length > 0) {
 				$targetInput.val("1");
 			}
@@ -2723,7 +2723,7 @@
 
 			// 2. 排除已删除的行(隐藏或标记删除)
 			var isHidden = $row.hasClass("hidden");
-			var $delFlagInput = $row.find("td:first-child input:eq(1)");
+			var $delFlagInput = $row.find("td:first-child input:eq(3)");
 			var isDeleted = $delFlagInput.val() === "1";
 			if (isHidden || isDeleted) {
 				return true; // 继续下一行
@@ -2842,7 +2842,7 @@
 
 			// 2. 排除已删除的行(隐藏或标记删除)
 			var isHidden = $row.hasClass("hidden");
-			var $delFlagInput = $row.find("td:first-child input:eq(1)");
+			var $delFlagInput = $row.find("td:first-child input:eq(3)");
 			var isDeleted = $delFlagInput.val() === "1";
 			if (isHidden || isDeleted) {
 				return true; // 继续下一行

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

@@ -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(1)");
+                var $delFlagInput = $currentTr.find("td:first-child input:eq(3)");
                 var isDeleted = $delFlagInput.val() === "1";
 
                 // 1. 获取当前行的第五个td(索引从0开始,第五个td的索引是4)
@@ -1573,7 +1573,7 @@
             var idValue = $idInput.val() || "";
 
             // 标记删除(通过修改第一个td中第二个input的值为1)
-            var $targetInput = $currentRow.find("td:first-child input:eq(1)");
+            var $targetInput = $currentRow.find("td:first-child input:eq(3)");
             if ($targetInput.length > 0) {
                 $targetInput.val("1");
             }
@@ -2730,7 +2730,7 @@
 
             // 2. 排除已删除的行(隐藏或标记删除)
             var isHidden = $row.hasClass("hidden");
-            var $delFlagInput = $row.find("td:first-child input:eq(1)");
+            var $delFlagInput = $row.find("td:first-child input:eq(3)");
             var isDeleted = $delFlagInput.val() === "1";
             if (isHidden || isDeleted) {
                 return true; // 继续下一行
@@ -2849,7 +2849,7 @@
 
             // 2. 排除已删除的行(隐藏或标记删除)
             var isHidden = $row.hasClass("hidden");
-            var $delFlagInput = $row.find("td:first-child input:eq(1)");
+            var $delFlagInput = $row.find("td:first-child input:eq(3)");
             var isDeleted = $delFlagInput.val() === "1";
             if (isHidden || isDeleted) {
                 return true; // 继续下一行