From 6562d6b8b6d5ef0e731859ee2ee97897ee7bf1da Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Mon, 11 Dec 2023 16:25:42 +0800 Subject: [PATCH] * Finish task #107899. --- module/execution/js/common.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/module/execution/js/common.js b/module/execution/js/common.js index 36ac507b47..546f2cfb22 100644 --- a/module/execution/js/common.js +++ b/module/execution/js/common.js @@ -60,17 +60,19 @@ function computeDaysDelta(date1, date2) */ function computeWorkDays(currentID) { - isBactchEdit = false; + isBatchEdit = false; + var beginDate = ''; + var endDate = ''; if(currentID) { - index = currentID.replace(/\w*\[|\]/g, ''); - if(!isNaN(index)) isBactchEdit = true; + index = currentID.replace(/[a-zA-Z]*/g, ''); + if(!isNaN(index)) isBatchEdit = true; } - if(isBactchEdit) + if(isBatchEdit) { - beginDate = $('#begins\\[' + index + '\\]').val(); - endDate = $('#ends\\[' + index + '\\]').val(); + beginDate = $("input[name=begins\\[" + index + "\\]]").val(); + endDate = $("input[name=ends\\[" + index + "\\]]").val(); } else { @@ -80,8 +82,8 @@ function computeWorkDays(currentID) if(beginDate && endDate) { - if(isBactchEdit) $('#dayses\\[' + index + '\\]').val(computeDaysDelta(beginDate, endDate)); - if(!isBactchEdit) $('#days').val(computeDaysDelta(beginDate, endDate)); + if(isBatchEdit) $("input[name=dayses\\[" + index + "\\]]").val(computeDaysDelta(beginDate, endDate)); + if(!isBatchEdit) $('#days').val(computeDaysDelta(beginDate, endDate)); } else if($('input[checked="true"]').val()) {