* Fix bug#45287.

This commit is contained in:
xieqiyu
2024-01-29 14:40:34 +08:00
parent 4b1aa3653c
commit 8b8d26cad1
2 changed files with 18 additions and 2 deletions
+17 -1
View File
@@ -1,4 +1,4 @@
window.setModuleByBranch = function(e)
window.setModuleAndPlanByBranch = function(e)
{
const $branch = $(e.target);
const branchID = $branch.val();
@@ -19,4 +19,20 @@ window.setModuleByBranch = function(e)
$row = $row.next('tr');
if(!$row.find('td[data-name="module"][data-ditto="on"]').length) break;
}
var planLink = $.createLink('productPlan', 'ajaxGetProductPlans', 'productID=' + productID + '&branch=' + branchID);
let $rows = $branch.closest('tr');
while($rows.length)
{
const $planPicker = $rows.find('[name^=plan]').zui('picker');
const planID = $rows.find('[name^=plan]').val();
$.getJSON(planLink, function(data)
{
$planPicker.render({items: data})
$planPicker.$.setValue(planID);
});
$rows = $rows.next('tr');
if(!$rows.find('td[data-name="plan"][data-ditto="on"]').length) break;
}
}
+1 -1
View File
@@ -59,7 +59,7 @@ $fnGenerateFields = function() use ($lang, $fields, $stories, $customFields, $sh
formBatchPanel
(
setID('dataform'),
on::change('[data-name="branch"]', 'setModuleByBranch'),
on::change('[data-name="branch"]', 'setModuleAndPlanByBranch'),
$stories ? set::data($stories) : null,
set::ajax(array('beforeSubmit' => jsRaw('clickSubmit'))),
set::title($storyID ? $storyTitle . $lang->colon . $this->lang->story->subdivide : $this->lang->story->batchCreate),