* Set default program.

This commit is contained in:
zhujinyong
2021-03-18 09:21:46 +08:00
parent 9978164907
commit 7fc2b74a53
4 changed files with 16 additions and 3 deletions
+1
View File
@@ -343,6 +343,7 @@ class product extends control
$this->view->title = $this->lang->product->create;
$this->view->position[] = $this->view->title;
$this->view->groups = $this->loadModel('group')->getPairs();
$this->view->programID = $programID;
$this->view->poUsers = $poUsers;
$this->view->qdUsers = $qdUsers;
$this->view->rdUsers = $rdUsers;
+12
View File
@@ -14,6 +14,18 @@ function loadProductLines(rootID)
});
}
/**
* Set parent program.
*
* @param $parentProgram
* @access public
* @return void
*/
function setParentProgram(parentProgram)
{
location.href = createLink('product', 'create', 'programID=' + parentProgram);
}
$('#program').change(function()
{
var programID = $(this).val();
+1 -1
View File
@@ -24,7 +24,7 @@
<?php if($this->config->systemMode == 'new'):?>
<tr>
<th class='w-140px'><?php echo $lang->program->common;?></th>
<td><?php echo html::select('program', $programs, '', "class='form-control chosen' required");?></td><td></td>
<td><?php echo html::select('program', $programs, $programID, "class='form-control chosen' required onchange='setParentProgram(this.value)'");?></td><td></td>
</tr>
<?php endif;?>
<tr>
+2 -2
View File
@@ -27,12 +27,12 @@ $(function()
/**
* Set parent program.
*
* @param $parentProgram
* @access public
* @return void
*/
function setParentProgram()
function setParentProgram(parentProgram)
{
var parentProgram = $("#parent").val();
location.href = createLink('project', 'create', 'model=' + model + '&programID=' + parentProgram);
}