<?php
use yii\helpers\Url;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use qcbase\models\Department;
use yii\db\Query;
use common\models\User;

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

$form = ActiveForm::begin([
	'id' => 'main-form',
	'action' => $action,
	'fieldConfig' => [
		'options' => ['tag' => 'tr'],
		'template' => "<th width='120'>{label}</th><td>{input}{hint}{error}</td>",
	]
]); ?>

	<div class="h_a">基本属性</div>
	<div class="table_full">
		<table width="100%">
			<?= $form->field($model, 'parent_id')->dropDownList(Department::getDropDownList(true)) ?>

			<?= $form->field($model, 'name')->textInput(['class' => 'input length_5']) ?>
            
			<?= ($model->isNewRecord) ? '':$form->field($model, 'lead_user_id')->dropDownList(User::getDropDownList()) ?>

			<?= ($model->isNewRecord) ? '':$form->field($model, 'verify_user_id')->dropDownList(User::getDropDownList('verify')) ?>

			<?= $form->field($model, 'phone')->textInput(['class' => 'input length_5']) ?>

			<?= $form->field($model, 'fax')->textInput(['class' => 'input length_5']) ?>

			<?= $form->field($model, 'address')->textInput(['class' => 'input length_5']) ?>

			<?= $form->field($model, 'remark')->textarea(['class' => 'length_5']) ?>

			<?= $form->field($model, 'sort')->textInput(['class' => 'input length_5']) ?>

			<?= $form->field($model, 'status')->radioList(User::getStatusList(), ['class' => 'switch_list']) ?>
		</table>
	</div>

	<?= ($model->isNewRecord) ? '' :Html::hiddenInput('id', $model->dept_id); ?>

	<div class="btn_wrap">
		<div class="btn_wrap_pd">
			<?= Html::submitButton('提交', ['class' => 'btn btn_submit mr10']) ?>
		</div>
	</div>

<?php ActiveForm::end(); ?>
