|
@@ -259,7 +259,7 @@
|
|
|
"</td>" +
|
|
|
|
|
|
"<td>" +
|
|
|
- "<input id='workAccountList" + index + "_eInvoiceMoney' onchange='calculateSum(" + index + ")' style='background-color: #f5f5f5' readonly name='workAccountList[" + index + "].eInvoiceMoney' type='text' value='" + (obj.eInvoiceMoney === null || obj.eInvoiceMoney === undefined ? "" : obj.eInvoiceMoney) + "' placeholder='数电发票金额' maxlength='10' class='form-control number'/>" +
|
|
|
+ "<input id='workAccountList" + index + "_eInvoiceMoney' onchange='calculateSum(" + index + ")' name='workAccountList[" + index + "].eInvoiceMoney' type='text' value='" + (obj.eInvoiceMoney === null || obj.eInvoiceMoney === undefined ? "" : obj.eInvoiceMoney) + "' placeholder='数电发票金额' maxlength='10' class='form-control number'/>" +
|
|
|
"</td>" +
|
|
|
|
|
|
"<td>" +
|
|
@@ -311,7 +311,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
- console.log("parentIndex",index)
|
|
|
$.ajax({
|
|
|
type : "POST",
|
|
|
url:"${ctx}/workReimbursementNew/workReimbursementNew/formByAccount",
|
|
@@ -329,7 +328,10 @@
|
|
|
//遍历 添加数据
|
|
|
$.each(result,function(index,obj){
|
|
|
insertReadyData(tbodyId,obj,parentIndex)
|
|
|
+ // 新增行后更新汇总行
|
|
|
+ updateSummaryRow(tbodyId);
|
|
|
})
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -368,7 +370,7 @@
|
|
|
const $tbody = $(tbodyId);
|
|
|
|
|
|
// 获取tbody下的所有直接子tr元素
|
|
|
- var $trs = $tbody.children('tr');
|
|
|
+ var $trs = $tbody.children('tr:not(.summary-row)');
|
|
|
const trLength = $trs.length;
|
|
|
//获取子节点有多少行信息
|
|
|
|
|
@@ -508,7 +510,6 @@
|
|
|
"reimbursementId": $("#wId").val()
|
|
|
},
|
|
|
success:function(data){
|
|
|
- console.log(data)
|
|
|
if(!data.success){
|
|
|
decideFlag = true
|
|
|
parent.layer.msg(data.message, {icon: 5});
|
|
@@ -691,7 +692,6 @@
|
|
|
}
|
|
|
var idx1 = $("#workAccountList tr[id^='workAccountList']").length + 1;
|
|
|
|
|
|
- console.log("添加行下标:",idx1)
|
|
|
if(list == '#workAccountList'){
|
|
|
|
|
|
tpl = tpl.replace("workAccountList[0].financialSubjects","workAccountList["+idx1+"].financialSubjects");
|
|
@@ -871,7 +871,7 @@
|
|
|
const $tbody = $(tbodyId);
|
|
|
|
|
|
// 获取tbody下的所有直接子tr元素
|
|
|
- var $trs = $tbody.children('tr');
|
|
|
+ var $trs = $tbody.children('tr:not(.summary-row)');
|
|
|
//获取行号
|
|
|
const trLength = $trs.length;
|
|
|
//获取子节点有多少行信息
|
|
@@ -935,6 +935,69 @@
|
|
|
"</tr>";
|
|
|
$tbody.append(dataHtml);
|
|
|
}
|
|
|
+
|
|
|
+ // 整合后的汇总行处理方法(使用传统字符串拼接)
|
|
|
+ function updateSummaryRow(tbodyId) {
|
|
|
+ const $tbody = $(tbodyId);
|
|
|
+
|
|
|
+ // 先移除已存在的汇总行(避免重复)
|
|
|
+ $tbody.find('tr.summary-row').remove();
|
|
|
+
|
|
|
+ // 计算价税合计总金额
|
|
|
+ var total = 0; // 价税合计总金额
|
|
|
+ var validRowCount = 0; // 有效行数计数器
|
|
|
+
|
|
|
+ $tbody.find('tr').each(function(index, tr) {
|
|
|
+ // 1. 获取第一个td中的第二个input(判断是否为有效行)
|
|
|
+ var $firstTd = $(tr).find('td').eq(0);
|
|
|
+ var $secondInputInFirstTd = $firstTd.find('input').eq(1);
|
|
|
+ var secondInputValue = $secondInputInFirstTd.val() || '';
|
|
|
+
|
|
|
+ // 2. 判断是否为有效行(仅处理delFlag为0的行)
|
|
|
+ if (secondInputValue.trim() !== '0') {
|
|
|
+ return true; // 跳过无效行
|
|
|
+ }
|
|
|
+
|
|
|
+ // 3. 有效行:累加行数和金额
|
|
|
+ validRowCount++;
|
|
|
+
|
|
|
+ // 4. 汇总第八个td中第一个input的值(价税合计)
|
|
|
+ var $eighthTd = $(tr).find('td').eq(8);
|
|
|
+ var $targetInput = $eighthTd.find('input:first');
|
|
|
+ var value = $targetInput.val() || '0';
|
|
|
+ var num = parseFloat(value);
|
|
|
+ total += isNaN(num) ? 0 : num;
|
|
|
+ });
|
|
|
+
|
|
|
+ // 格式化总金额为两位小数
|
|
|
+ var totalFormatted = total.toFixed(2);
|
|
|
+
|
|
|
+ // 5. 使用传统字符串拼接创建汇总行HTML(在第7个td中显示汇总值)
|
|
|
+ var summaryHtml = "";
|
|
|
+ summaryHtml += "<tr class='listInfo summary-row' style='background-color: #f5f5f5; font-weight: bold;'>";
|
|
|
+ summaryHtml += " <td class='hide'></td>";
|
|
|
+ summaryHtml += " <td style='text-align: center;'></td>";
|
|
|
+ summaryHtml += " <td style='text-align: center;' colspan='2'>汇总</td>";
|
|
|
+ summaryHtml += " <td style='text-align: center;'></td>";
|
|
|
+ summaryHtml += " <td style='text-align: center;'></td>";
|
|
|
+ summaryHtml += " <td style='text-align: center;'></td>";
|
|
|
+ summaryHtml += " <td style='text-align: center;'></td>";
|
|
|
+ summaryHtml += " <td style='font-weight: bold; color: black;'>" + totalFormatted + "</td>"; // 第8个td显示汇总值
|
|
|
+ summaryHtml += " <td style='text-align: center;'></td>";
|
|
|
+ summaryHtml += " <td style='text-align: center;'></td>";
|
|
|
+ summaryHtml += " <td style='text-align: center;'></td>";
|
|
|
+ summaryHtml += " <td style='text-align: center;'></td>";
|
|
|
+ summaryHtml += " <td style='text-align: center;'></td>";
|
|
|
+ summaryHtml += " <td style='text-align: center;'></td>";
|
|
|
+ summaryHtml += "</tr>";
|
|
|
+
|
|
|
+ // 6. 将汇总行添加到tbody末尾(确保在最底部)
|
|
|
+ $tbody.append(summaryHtml);
|
|
|
+
|
|
|
+ return total; // 返回总金额,方便后续使用
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
async function newInsertTitleInvoiceReimbursement(idValue,fileValue) {
|
|
|
// 将原生DOM元素转换为jQuery对象(关键修复)
|
|
|
var $idElement = $(idValue);
|
|
@@ -1005,10 +1068,14 @@
|
|
|
insertData("#workAccountList_" + idValue.value,data,trlen,parentIndex)
|
|
|
// 检查文件是否已上传
|
|
|
await handleFileNewUpload(file, size, trlen,"#workAccountList_" + idValue.value,parentIndex);
|
|
|
+
|
|
|
+ // 新增行后更新汇总行
|
|
|
+ updateSummaryRow("#workAccountList_" + idValue.value);
|
|
|
}
|
|
|
//reimbursementElectronicInvoiceVATTaxesRowIdx++;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error('文件上传失败', error);
|
|
@@ -1066,8 +1133,6 @@
|
|
|
|
|
|
// 处理文件上传
|
|
|
async function handleFileNewUpload(file, size, trlen,inputId,parentIndex) {
|
|
|
- console.log("inputId",inputId)
|
|
|
- console.log("parentIndex",parentIndex)
|
|
|
|
|
|
const $tbody = $(inputId);
|
|
|
|
|
@@ -1323,39 +1388,32 @@
|
|
|
var $targetInput = $currentRow.find("td:first-child input:eq(1)");
|
|
|
if ($targetInput.length > 0) {
|
|
|
$targetInput.val("1");
|
|
|
- console.log("已将删除标记设为1");
|
|
|
}
|
|
|
|
|
|
// 隐藏当前行
|
|
|
$currentRow.addClass("hidden");
|
|
|
- console.log("已隐藏当前行");
|
|
|
|
|
|
// 处理父表格显示状态(根据可见行数量)
|
|
|
if ($parentTable.length > 0) {
|
|
|
// 筛选非空且未隐藏的行
|
|
|
var visibleRows = $parentTable.find("tr:not(:empty):not(.hidden)");
|
|
|
- console.log("父表格可见行数:", visibleRows.length);
|
|
|
|
|
|
// 控制表格显示/隐藏
|
|
|
if (visibleRows.length === 0) {
|
|
|
$parentTable.hide();
|
|
|
- console.log("父表格已隐藏(无可见行)");
|
|
|
} else {
|
|
|
$parentTable.show();
|
|
|
- console.log("父表格已显示");
|
|
|
}
|
|
|
|
|
|
// 隐藏关联行(如果有idValue)
|
|
|
if (idValue) {
|
|
|
var targetTrClass = idValue;
|
|
|
$parentTable.find("tr." + targetTrClass).addClass("hidden");
|
|
|
- console.log("已隐藏关联行(class: " + targetTrClass + ")");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 重新排序行号
|
|
|
reorderRowNumbers($parentTable);
|
|
|
- console.log("已重新排序行号");
|
|
|
|
|
|
// 查找当前行所在的tbody并获取其id
|
|
|
const td = obj.closest('td');
|
|
@@ -1363,24 +1421,23 @@
|
|
|
const tbody = tr ? tr.closest('tbody') : null;
|
|
|
const tbodyId = tbody ? tbody.getAttribute('id') : null;
|
|
|
|
|
|
- console.log("查找的tbodyId:", tbodyId);
|
|
|
+ //对数据进行重新处理
|
|
|
+ updateSummaryRow("#" + tbodyId)
|
|
|
+
|
|
|
if (!tbodyId) {
|
|
|
console.error("未找到有效的tbody,终止金额汇总");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
// 汇总金额和有效行数(核心修复:选择器添加#前缀)
|
|
|
- console.log("开始汇总金额,目标tbody选择器: #", tbodyId);
|
|
|
var total = 0;
|
|
|
var validRowCount = 0;
|
|
|
|
|
|
// 修复选择器:通过# + tbodyId定位元素
|
|
|
$("#" + tbodyId).find('tr').each(function(index, tr) {
|
|
|
- console.log("正在处理第", index + 1, "行");
|
|
|
|
|
|
// 验证行是否可见(非隐藏)
|
|
|
if ($(tr).hasClass("hidden")) {
|
|
|
- console.log("第", index + 1, "行是隐藏行,跳过");
|
|
|
return true; // 继续下一行
|
|
|
}
|
|
|
|
|
@@ -1388,30 +1445,25 @@
|
|
|
var $firstTd = $(tr).find('td').eq(0);
|
|
|
var $secondInput = $firstTd.find('input').eq(1);
|
|
|
var secondInputValue = $secondInput.val() || '';
|
|
|
- console.log("第", index + 1, "行的删除标记值:", secondInputValue.trim());
|
|
|
|
|
|
if (secondInputValue.trim() !== '0') {
|
|
|
- console.log("第", index + 1, "行不符合条件,跳过");
|
|
|
return true; // 继续下一行
|
|
|
}
|
|
|
|
|
|
// 累加有效行数
|
|
|
validRowCount++;
|
|
|
- console.log("第", index + 1, "行有效,累计有效行数:", validRowCount);
|
|
|
|
|
|
// 汇总第八个td中第一个input的值
|
|
|
- var $eighthTd = $(tr).find('td').eq(7);
|
|
|
+ var $eighthTd = $(tr).find('td').eq(8);
|
|
|
var $targetInput = $eighthTd.find('input:first');
|
|
|
var value = $targetInput.val() || '0';
|
|
|
var num = parseFloat(value);
|
|
|
var addAmount = isNaN(num) ? 0 : num;
|
|
|
total += addAmount;
|
|
|
- console.log("第", index + 1, "行金额:", addAmount, "当前累计总金额:", total);
|
|
|
});
|
|
|
|
|
|
// 处理汇总结果(保留两位小数)
|
|
|
total = total.toFixed(2) * 1;
|
|
|
- console.log("最终汇总金额:", total, "有效行数:", validRowCount);
|
|
|
|
|
|
// 更新数电发票金额和数量输入框
|
|
|
var $eInvoiceMoney = $("#workAccountList" + parentIndex + "_eInvoiceMoney");
|
|
@@ -1419,15 +1471,12 @@
|
|
|
|
|
|
$eInvoiceMoney.val(total);
|
|
|
$eInvoiceBills.val(validRowCount);
|
|
|
- console.log("已更新金额输入框:", $eInvoiceMoney.val(), "数量输入框:", $eInvoiceBills.val());
|
|
|
|
|
|
// 调用汇总方法(修复变量重复声明问题)
|
|
|
var sumResult = calculateSum(parentIndex);
|
|
|
var billResult = billSum(parentIndex);
|
|
|
- console.log("calculateSum结果:", sumResult);
|
|
|
- console.log("billSum结果:", billResult);
|
|
|
|
|
|
- console.log("===== delRowNew函数执行结束 =====");
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// 重新排序行号的函数(只处理未隐藏的行,行号在第二个td中)
|
|
@@ -1458,11 +1507,11 @@
|
|
|
|
|
|
// 重新排序行号的函数(只处理未隐藏的行,行号在第二个td中)
|
|
|
function reorderRowNumbers($table) {
|
|
|
- // 只选择可见行(排除隐藏行)
|
|
|
- $table.find("tbody tr:not(.hidden)").each(function(index) {
|
|
|
+ // 选择可见行且排除汇总行(.summary-row)
|
|
|
+ $table.find("tbody tr:not(.hidden):not(.summary-row)").each(function(index) {
|
|
|
var rowNumber = index; // 行号从1开始计数
|
|
|
- // 更新第二个td中的行号
|
|
|
- $(this).find("td:nth-child(2)").text(rowNumber);
|
|
|
+ // 更新第二个td中的行号(根据你的需求确认是否是nth-child(3))
|
|
|
+ $(this).find("td:nth-child(3)").text(rowNumber);
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -2207,7 +2256,7 @@
|
|
|
|
|
|
<!-- 费用三列 -->
|
|
|
<td>
|
|
|
- <input id="workAccountList${index.index}_eInvoiceMoney" onchange="calculateSum(${index.index})" style="background-color: #f5f5f5" readonly="readonly" name="workAccountList[${index.index}].eInvoiceMoney" type="text" value="${workAccount.eInvoiceMoney}" placeholder="数电发票金额" maxlength="10" class="form-control number "/>
|
|
|
+ <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"/>
|
|
@@ -2304,7 +2353,7 @@
|
|
|
|
|
|
|
|
|
<td>
|
|
|
- <input id="workAccountList{{idx}}_eInvoiceMoney" onchange="calculateSum({{idx}})" readonly="readonly" name="workAccountList[{{idx}}].eInvoiceMoney" type="text" value="{{row.eInvoiceMoney}}" style="background-color: #f5f5f5;" placeholder="数电发票金额" maxlength="10" class="form-control number"/>
|
|
|
+ <input id="workAccountList{{idx}}_eInvoiceMoney" onchange="calculateSum({{idx}})" name="workAccountList[{{idx}}].eInvoiceMoney" type="text" value="{{row.eInvoiceMoney}}" placeholder="数电发票金额" maxlength="10" class="form-control number"/>
|
|
|
</td>
|
|
|
<td>
|
|
|
<input id="workAccountList{{idx}}_invoiceMoney" onchange="calculateSum({{idx}})" name="workAccountList[{{idx}}].invoiceMoney" type="text" value="{{row.invoiceMoney}}" placeholder="非数电票金额" maxlength="10" class="form-control number"/>
|
|
@@ -2472,7 +2521,6 @@
|
|
|
var $delFlagInput = $row.find("td:first-child input:eq(1)");
|
|
|
var isDeleted = $delFlagInput.val() === "1";
|
|
|
if (isHidden || isDeleted) {
|
|
|
- console.log("跳过已删除行,id:", $row.attr("id"));
|
|
|
return true; // 继续下一行
|
|
|
}
|
|
|
|
|
@@ -2480,12 +2528,76 @@
|
|
|
var rowId = $row.attr("id");
|
|
|
var rowIndex = rowId.replace("workAccountList", ""); // 提取数字部分
|
|
|
if (!rowIndex) {
|
|
|
- console.log("无法解析行索引,跳过行:", rowId);
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ var idc = $("#workAccountList" + rowIndex + "_id").val();
|
|
|
+ console.log("idc", idc);
|
|
|
+
|
|
|
+ // 1. 校验idc有效性,避免查找无效元素
|
|
|
+ if (!idc || idc.trim() === "") {
|
|
|
+ console.error("idc为空或无效,无法继续计算");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 1. 查找class包含idc的目标tr(这一步不变)
|
|
|
+ const $targetTr = $('tr.' + idc);
|
|
|
+
|
|
|
+ // 2. 按「tr → 第一个td → table → tbody」的路径查找,补充table层级
|
|
|
+ // 关键变化:增加 .find('table'),匹配td下的表格
|
|
|
+ const $targetTbody = $targetTr
|
|
|
+ .find('td:first') // 第一步:找到tr下的第一个td
|
|
|
+ .find('table') // 第二步:找到这个td下的table
|
|
|
+ .find('tbody#workAccountList_' + idc); // 第三步:找到table下的目标tbody
|
|
|
+
|
|
|
+ // 2. 校验tr和tbody是否存在
|
|
|
+ if ($targetTr.length === 0) {
|
|
|
+ console.error("未找到class为" + idc + "的tr元素");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // (后续的有效性校验、遍历计算逻辑不变,可参考之前优化后的代码)
|
|
|
+ // 新增:校验tbody是否找到(避免后续逻辑报错)
|
|
|
+ if ($targetTbody.length === 0) {
|
|
|
+ console.error("在tr." + idc + "的第一个td中,未找到class为workAccountList_" + idc + "的tbody");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ //数电票可报销的最大额度
|
|
|
+ let maxMoney = 0;
|
|
|
+ // 3. 遍历tr时排除汇总行,避免重复计算
|
|
|
+ $targetTbody.find('tr:not(.summary-row)').each(function() {
|
|
|
+ const $tr = $(this);
|
|
|
+ const $secondInput = $tr.find('td:first input:eq(1)');
|
|
|
+ const inputValue = $secondInput.val() || '';
|
|
|
+
|
|
|
+ if (inputValue.trim() === '0') {
|
|
|
+ const $eighthTd = $tr.find('td:eq(8)');
|
|
|
+ // 4. 校验第九个td是否存在,避免空元素处理
|
|
|
+ if ($eighthTd.length === 0) {
|
|
|
+ console.warn("当前tr缺少第九个td,跳过", $tr);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ const eighthValue = $eighthTd.find('input').val() || '0';
|
|
|
+ const num = parseFloat(eighthValue);
|
|
|
+ if (!isNaN(num)) {
|
|
|
+ maxMoney += num;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ console.log('数电票可报销的最大额度:', maxMoney.toFixed(2));
|
|
|
+
|
|
|
+
|
|
|
// 4. 计算当前行的金额(单行汇总)
|
|
|
var eInvoice = parseFloat($("#workAccountList" + rowIndex + "_eInvoiceMoney").val() || 0);
|
|
|
+
|
|
|
+ if(eInvoice>parseFloat(maxMoney.toFixed(2))){
|
|
|
+ $("#workAccountList" + rowIndex + "_eInvoiceMoney").val(maxMoney)
|
|
|
+ eInvoice = maxMoney
|
|
|
+ parent.layer.msg("该报销单数电票报销最大额度为:" + maxMoney.toFixed(2) + "!", {icon: 5});
|
|
|
+ }
|
|
|
+
|
|
|
var invoice = parseFloat($("#workAccountList" + rowIndex + "_invoiceMoney").val() || 0);
|
|
|
var rowSum = eInvoice + invoice;
|
|
|
|
|
@@ -2496,7 +2608,8 @@
|
|
|
totalAllEInvoice += eInvoice;
|
|
|
totalAllInvoice += invoice;
|
|
|
totalAllSum += rowSum;
|
|
|
- console.log("行" + rowIndex + "汇总:", rowSum, "累计总金额:", totalAllSum);
|
|
|
+
|
|
|
+ console.log("计算汇总金额",eInvoice)
|
|
|
});
|
|
|
|
|
|
// 7. 重新计算总报销费用(传入所有行的非数电票总金额)
|
|
@@ -2508,17 +2621,43 @@
|
|
|
|
|
|
// (保留原calculateTotalMoney函数,确保它能处理所有行的总金额)
|
|
|
function calculateTotalMoney(invoiceTotal) {
|
|
|
- var total = 0;
|
|
|
- // 遍历所有数电发票行的汇总金额(已排除删除行)
|
|
|
- $("input[name$='.sumMoney']").each(function() {
|
|
|
- var $sumInput = $(this);
|
|
|
- var $currentTr = $sumInput.closest("tr");
|
|
|
- var isHidden = $currentTr.hasClass("hidden");
|
|
|
- var $delFlagInput = $currentTr.find("td:first-child input:eq(1)");
|
|
|
+ var total = 0; // 用于存储总和
|
|
|
+ // 找到id为workAccountList的tbody
|
|
|
+ const $targetTbody = $('tbody#workAccountList');
|
|
|
+ // 检查tbody是否存在
|
|
|
+ if ($targetTbody.length === 0) {
|
|
|
+ console.error("未找到id为workAccountList的tbody");
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ let totalSum = 0; // 用于存储总和
|
|
|
+ // 遍历tbody下的所有行
|
|
|
+ $("tr[id^='workAccountList']").each(function() {
|
|
|
+ var $row = $(this);
|
|
|
+
|
|
|
+ // 2. 排除已删除的行(隐藏或标记删除)
|
|
|
+ var isHidden = $row.hasClass("hidden");
|
|
|
+ var $delFlagInput = $row.find("td:first-child input:eq(1)");
|
|
|
var isDeleted = $delFlagInput.val() === "1";
|
|
|
+ if (isHidden || isDeleted) {
|
|
|
+ return true; // 继续下一行
|
|
|
+ }
|
|
|
+
|
|
|
+ // 3. 提取当前行的索引(从行id中解析,如"workAccountList2" → 2)
|
|
|
+ var rowId = $row.attr("id");
|
|
|
+ var rowIndex = rowId.replace("workAccountList", ""); // 提取数字部分
|
|
|
+ if (!rowIndex) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- if (!isHidden && !isDeleted) {
|
|
|
- total += parseFloat($sumInput.val() || 0);
|
|
|
+ // 4. 计算当前行的金额(单行汇总)
|
|
|
+ var eInvoice = parseFloat($("#workAccountList" + rowIndex + "_eInvoiceMoney").val() || 0);
|
|
|
+
|
|
|
+ // 累加金额(排除非数字值)
|
|
|
+ if (!isNaN(eInvoice)) {
|
|
|
+ total += eInvoice;
|
|
|
+ } else {
|
|
|
+ console.warn("第九个td中的值不是有效的数字:", amountValue, ",行:", $tr);
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -2528,6 +2667,7 @@
|
|
|
// 设置总金额
|
|
|
$("#moneys").val(total.toFixed(2));
|
|
|
}
|
|
|
+
|
|
|
// 计算每行的汇总金额
|
|
|
function billSum(rowIndex) {
|
|
|
// 获取数电发票金额
|