You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

107 lines
3.5 KiB

<?php
use yii\helpers\Html;
use yii\bootstrap4\ActiveForm;
use antgoods\models\ars\Category;
use antgoods\models\ars\Brand;
use antgoods\models\ars\ShopCategory;
use antgoods\models\ars\Supplier;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $model antgoods\models\ars\Goods */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="goods-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'cat_id')->dropDownList(Category::modelColumn(), ['prompt' => '请选择']) ?>
<?= $form->field($model, 'brand_id')->dropDownList(Brand::modelColumn(), ['prompt' => '请选择']) ?>
<?= $form->field($model, 'shop_cat_id')->dropDownList(ShopCategory::modelColumn(), ['prompt' => '请选择']) ?>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'sn')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'code')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'supplier_id')->dropDownList(Supplier::modelColumn(), ['prompt' => '请选择']) ?>
<?= $form->field($model, 'weight')->textInput() ?>
<?= $form->field($model, 'length')->textInput() ?>
<?= $form->field($model, 'width')->textInput() ?>
<?= $form->field($model, 'height')->textInput() ?>
<?= $form->field($model, 'diameter')->textInput() ?>
<?= $form->field($model, 'unit')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'limit_count')->textInput() ?>
<?= $form->field($model, 'stock')->textInput() ?>
<?= $form->field($model, 'stock_warn')->textInput() ?>
<?= $form->field($model, 'market_price')->textInput() ?>
<?= $form->field($model, 'price')->textInput() ?>
<?= $form->field($model, 'brief')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'description')->textarea(['rows' => 6]) ?>
<?= $form->field($model, 'model_id')->textInput() ?>
<?= $form->field($model, 'is_sale')->radioList($model::$isSale) ?>
<?= $form->field($model, 'sort_order')->textInput() ?>
<?= $form->field($model, 'bouns_points')->textInput() ?>
<?= $form->field($model, 'experience_points')->textInput() ?>
<?= $form->field($model, 'express_template')->textInput() ?>
<?= $form->field($model, 'coverImageId')->hiddenInput()->label('') ?>
<?= $form->field($model, 'coverImagePath')->widget(\iron\widgets\Upload::className(), [
'url' => 'upload',
'deleteUrl' => 'img-id-del',
'dragdropWidth'=> 800,
'afterSave' => 'save-file',
'maxCount' => 1,
'fillInAttribute' => 'coverImageId',
'model' => $model,
'previewConfig' => [
'url' => Url::to(['image-file', 'fileidstr' => $model->coverImageId]),
],
])->label('商品封面图') ?>
<?= $form->field($model, 'detailImageId')->hiddenInput()->label('') ?>
<?= $form->field($model, 'detailImagePath')->widget(\iron\widgets\Upload::className(), [
'url' => 'upload',
'deleteUrl' => 'img-id-del',
'dragdropWidth'=> 800,
'afterSave' => 'save-file',
'maxCount' => 5,
'fillInAttribute' => 'detailImageId',
'model' => $model,
'previewConfig' => [
'url' => Url::to(['image-file', 'fileidstr' => $model->detailImageId]),
],
])->label('商品详情图') ?>
<div class="form-group">
<?= Html::submitButton('保存', ['class' => 'btn btn-success']) ?>
<?= Html::a('返回', ['index'], ['class' => 'btn btn-info']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>