From 74a7c386d31cf97df755d21fdfbc4053ba7aa9e4 Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 14 May 2025 13:31:06 +0800 Subject: [PATCH] * [refac bug #62306] Adjust checkBatchEstStartedAndDeadline for child. --- module/task/js/batchedit.ui.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/module/task/js/batchedit.ui.js b/module/task/js/batchedit.ui.js index 8125bed055..8c08ad6d95 100644 --- a/module/task/js/batchedit.ui.js +++ b/module/task/js/batchedit.ui.js @@ -196,7 +196,14 @@ function checkBatchEstStartedAndDeadline(event) $estStartedTd.find('.date-tip').remove(); const $childrenEstStarted = $(event.target).closest('tbody').find('tr[data-parent="' + taskID + '"]').find('[name^=estStarted]'); - $childrenEstStarted.each(function(){$(this).zui('datePicker').render({disabled: estStarted.length == 0});}); + $childrenEstStarted.each(function() + { + let $childDatePicker = $(this).zui('datePicker'); + $childDatePicker.render({disabled: estStarted.length == 0}); + if(estStarted.length == 0) $childDatePicker.$.setValue(''); + + checkBatchEstStartedAndDeadline({target: this}); + }); if(estStarted.length > 0) { let $datetip = $('
'); @@ -223,7 +230,14 @@ function checkBatchEstStartedAndDeadline(event) $deadlineTd.find('.date-tip').remove(); const $childrenDeadline = $(event.target).closest('tbody').find('tr[data-parent="' + taskID + '"]').find('[name^=deadline]'); - $childrenDeadline.each(function(){$(this).zui('datePicker').render({disabled: deadline.length == 0});}); + $childrenDeadline.each(function() + { + let $childDatePicker = $(this).zui('datePicker'); + $childDatePicker.render({disabled: deadline.length == 0}); + if(deadline.length == 0) $childDatePicker.$.setValue(''); + + checkBatchEstStartedAndDeadline({target: this}); + }); if(deadline.length > 0) { let $datetip = $('
');