This commit is contained in:
孙华伟
2022-03-17 08:45:04 +08:00
parent dd727476ad
commit 9270dbf6fa
4 changed files with 9 additions and 9 deletions
+2 -2
View File
@@ -24,8 +24,8 @@ function setRole(account, roleID)
function addItem(obj)
{
var item = $('#addItem').html().replace(/%i%/g, itemIndex);
$(obj).closest('tr').after('<tr class="addedItem">' + item + '</tr>');
var $accounts = $('#hours' + i).closest('tr').find('select:first')
$('<tr class="addedItem">' + item + '</tr>').insertAfter($(obj).closest('tr'));
var $accounts = $('#hours' + itemIndex).closest('tr').find('select:first')
if($accounts.attr('data-pickertype') != 'remote')
{
+5 -5
View File
@@ -7,15 +7,15 @@
*/
function addItem(obj)
{
var item = $('#addItem').html().replace(/%i%/g, i);
var item = $('#addItem').html().replace(/%i%/g, itemIndex);
$(obj).closest('tr').after('<tr class="addedItem">' + item + '</tr>');
var newItem = $('#names' + i).closest('tr');
var newItem = $('#names' + itemIndex).closest('tr');
newItem.find('.form-date').datepicker();
$("#output" + i).chosen();
$("#output" + itemIndex).chosen();
$("#PM_i__chosen").remove();
$("#PM" + i).chosen();
$("#PM" + itemIndex).chosen();
$("#output_i__chosen").remove();
i ++;
itemIndex ++;
}
/**
+1 -1
View File
@@ -170,7 +170,7 @@
</tfoot>
</table>
</div>
<?php js::set('i', $i);?>
<?php js::set('itemIndex', $i);?>
</form>
</div>
<div>
+1 -1
View File
@@ -132,7 +132,7 @@
<?php $i = '%i%';?>
<table class='hidden'>
<tr id='addItem' class='hidden'>
<td><?php echo html::select("accounts[]", $users, '', "class='form-control' onchange='setRole(this.value, $i)'");?></td>
<td><?php echo html::select("accounts[$i]", $users, '', "class='form-control' onchange='setRole(this.value, $i)'");?></td>
<td><?php echo html::input("roles[$i]", '', "class='form-control'");?></td>
<td><?php echo html::input("days[$i]", $project->days, "class='form-control'");?></td>
<td><?php echo html::input("hours[$i]", $config->execution->defaultWorkhours, "class='form-control'");?></td>