switch product fix

This commit is contained in:
lanzongjun
2022-11-03 10:41:21 +08:00
parent 0b25f89725
commit 9f93db829a
2 changed files with 11 additions and 4 deletions
+1
View File
@@ -383,6 +383,7 @@ foreach(explode(',', $config->story->create->requiredFields) as $field)
<?php js::set('storyModule', $lang->story->module);?>
<?php js::set('storyPlan', $lang->story->plan);?>
<?php js::set('storyType', $type);?>
<?php js::set('originProductType', !empty($branches) ? 'normal' : 'branch');?>
<script>
$(function(){parent.$('body.hide-modal-close').removeClass('hide-modal-close');})
+10 -4
View File
@@ -98,8 +98,14 @@ function loadProductBranches(productID)
{
if(storyType == 'story')
{
$('.switchBranch').toggleClass('hidden');
$('.switchBranch').toggleClass('disable');
var newProductType = data ? 'normal' : 'branch';
if(originProductType != newProductType)
{
$('.switchBranch').toggleClass('hidden');
$('.switchBranch').toggleClass('disable');
}
originProductType = newProductType;
$('tr[class^="addBranchesBox"]').remove();
if(data)
@@ -119,7 +125,7 @@ function loadProductBranches(productID)
$('#branches0').next('.picker').remove();
$('#branches0').chosen();
$.get(createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=0' + '&rootModuleID=0&returnType=html&fieldID=0' + '&needManage=true&extra=&currentModuleID=0'), function(moduleData)
$.get(createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=story&branch=0' + '&rootModuleID=0&returnType=html&fieldID=0' + '&needManage=false&extra=&currentModuleID=0'), function(moduleData)
{
if(moduleData)
{
@@ -131,7 +137,7 @@ function loadProductBranches(productID)
});
var expired = config.currentMethod == 'create' ? 'unexpired' : '';
$.get(createLink('product', 'ajaxGetPlans', 'productID=' + productID + '&branch=0' + '&planID=' + $('#plan').val() + '&fieldID=0' + '&needCreate=true&expired='+ expired +'&param=skipParent,' + config.currentMethod), function(planData)
$.get(createLink('product', 'ajaxGetPlans', 'productID=' + productID + '&branch=0' + '&planID=' + $('#plan').val() + '&fieldID=0' + '&needCreate=false&expired='+ expired +'&param=skipParent,' + config.currentMethod), function(planData)
{
if(planData)
{