* Refactor submit function.

This commit is contained in:
tianshujie
2023-11-13 17:29:52 +08:00
parent 078192c587
commit ea17fc8712
2 changed files with 27 additions and 0 deletions
+26
View File
@@ -376,3 +376,29 @@ $('#teamForm').on('change', '.team-select [name^=team]', function()
$tr.find('[name^=teamConsumed]').val(consumed);
$tr.find('[name^=teamEstimate]').val(estimate);
});
window.clickSubmit = function()
{
if(isMultiple)
{
var multiple = $('#multiple').is(":checked");
if(!multiple)
{
var assignedTo = $('[name=assignedTo]').val();
if(!assignedTo)
{
zui.Modal.alert(teamNotEmpty);
return false;
}
}
var estimate = parseInt($('#left').val());
if(isNaN(estimate) || estimate <= 0)
{
zui.Modal.alert(multiple ? teamLeftEmpty : leftNotEmpty);
return false;
}
$('#assignedTo').val('');
}
}
+1
View File
@@ -320,6 +320,7 @@ for($i; $i <= $rowCount; $i ++)
/* ====== Define the page structure with zin widgets ====== */
formPanel
(
set::ajax(array('beforeSubmit' => jsRaw("clickSubmit"))),
$taskModeBox,
formRow
(