<?php
use yii\helpers\Url;
use qcbase\assets\DepartmentAsset;

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \qcbase\models\Department */

DepartmentAsset::register($this);

$this->title = '部门管理';

$parent_id = Yii::$app->request->get('parent_id');
//默认值
if ($model->isNewRecord) {
	$model->sort = 0;
	$model->status = 1;
    $model->parent_id = (!empty($parent_id)) ? $parent_id : 0 ;
}
?>

<div class="nav">
	<!--<div class="return"><a href="">返回上一级</a></div>-->
	<ul class="cc">
		<li ><a href="<?= Url::to([$this->context->id.'/index']) ?>">部门管理</a></li>
		<li class="current"><a href="<?= Url::to([$this->context->id.'/create']) ?>">添加部门</a></li>
	</ul>
</div>

<?= $this->render('_form', ['model' => $model, 'action' => $action]);  ?>

<script>
    var getUser = "<?= Url::to(['get-user']) ?>";
</script>
