+ [task#130251,doing,0.5h] add beforeSubmit for batchEdit.

This commit is contained in:
liumengyi
2024-10-23 09:18:10 +08:00
committed by 刘刚
parent 3afe3f0b21
commit d007690aa1
+20
View File
@@ -24,6 +24,26 @@ $nonStoryChildTasks = json_encode($nonStoryChildTasks);
$tasksJsVar = json_encode($tasks);
if(!empty($nonStoryChildTasks))
{
$beforeSubmit = jsRaw("() =>
{
const \$taskBatchForm = $('#taskBatchEditForm{$executionID}');
const childTasks = $childTasks;
const nonStoryChildTasks = $nonStoryChildTasks;
const \$taskBatchFormTrs = \$taskBatchForm.find('tbody tr');
const tasks = $tasksJsVar;
var confirmID = '';
var tipAll = true;
for(let i = 0; i < \$taskBatchFormTrs.length; i++)
{
const \$currentTr = $(\$taskBatchFormTrs[i]);
const taskID = \$currentTr.find('.form-batch-control[data-name=id]').find('input[name^=id]').val();
const storyID = \$currentTr.find('.form-batch-control[data-name=story]').find('input[name^=story]').val();
if(tasks[taskID].story == storyID) continue;
if(!storyID && tasks[taskID].parent <= 0) continue;
}
return false;
}");
}
/* ====== Define the page structure with zin widgets ====== */