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

  1. <?php
  2. use yii\helpers\Html;
  3. use yii\bootstrap4\ActiveForm;
  4. use antgoods\models\ars\Category;
  5. use antgoods\models\ars\Brand;
  6. use antgoods\models\ars\ShopCategory;
  7. use antgoods\models\ars\Supplier;
  8. use yii\helpers\Url;
  9. /* @var $this yii\web\View */
  10. /* @var $model antgoods\models\ars\Goods */
  11. /* @var $form yii\widgets\ActiveForm */
  12. ?>
  13. <div class="goods-form">
  14. <?php $form = ActiveForm::begin(); ?>
  15. <?= $form->field($model, 'cat_id')->dropDownList(Category::modelColumn(), ['prompt' => '请选择']) ?>
  16. <?= $form->field($model, 'brand_id')->dropDownList(Brand::modelColumn(), ['prompt' => '请选择']) ?>
  17. <?= $form->field($model, 'shop_cat_id')->dropDownList(ShopCategory::modelColumn(), ['prompt' => '请选择']) ?>
  18. <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
  19. <?= $form->field($model, 'sn')->textInput(['maxlength' => true]) ?>
  20. <?= $form->field($model, 'code')->textInput(['maxlength' => true]) ?>
  21. <?= $form->field($model, 'supplier_id')->dropDownList(Supplier::modelColumn(), ['prompt' => '请选择']) ?>
  22. <?= $form->field($model, 'weight')->textInput() ?>
  23. <?= $form->field($model, 'length')->textInput() ?>
  24. <?= $form->field($model, 'width')->textInput() ?>
  25. <?= $form->field($model, 'height')->textInput() ?>
  26. <?= $form->field($model, 'diameter')->textInput() ?>
  27. <?= $form->field($model, 'unit')->textInput(['maxlength' => true]) ?>
  28. <?= $form->field($model, 'limit_count')->textInput() ?>
  29. <?= $form->field($model, 'stock')->textInput() ?>
  30. <?= $form->field($model, 'stock_warn')->textInput() ?>
  31. <?= $form->field($model, 'market_price')->textInput() ?>
  32. <?= $form->field($model, 'price')->textInput() ?>
  33. <?= $form->field($model, 'brief')->textInput(['maxlength' => true]) ?>
  34. <?= $form->field($model, 'description')->textarea(['rows' => 6]) ?>
  35. <?= $form->field($model, 'model_id')->textInput() ?>
  36. <?= $form->field($model, 'is_sale')->radioList($model::$isSale) ?>
  37. <?= $form->field($model, 'sort_order')->textInput() ?>
  38. <?= $form->field($model, 'bouns_points')->textInput() ?>
  39. <?= $form->field($model, 'experience_points')->textInput() ?>
  40. <?= $form->field($model, 'express_template')->textInput() ?>
  41. <?= $form->field($model, 'coverImageId')->hiddenInput()->label('') ?>
  42. <?= $form->field($model, 'coverImagePath')->widget(\iron\widgets\Upload::className(), [
  43. 'url' => 'upload',
  44. 'deleteUrl' => 'img-id-del',
  45. 'dragdropWidth'=> 800,
  46. 'afterSave' => 'save-file',
  47. 'maxCount' => 1,
  48. 'fillInAttribute' => 'coverImageId',
  49. 'model' => $model,
  50. 'previewConfig' => [
  51. 'url' => Url::to(['image-file', 'fileidstr' => $model->coverImageId]),
  52. ],
  53. ])->label('商品封面图') ?>
  54. <?= $form->field($model, 'detailImageId')->hiddenInput()->label('') ?>
  55. <?= $form->field($model, 'detailImagePath')->widget(\iron\widgets\Upload::className(), [
  56. 'url' => 'upload',
  57. 'deleteUrl' => 'img-id-del',
  58. 'dragdropWidth'=> 800,
  59. 'afterSave' => 'save-file',
  60. 'maxCount' => 5,
  61. 'fillInAttribute' => 'detailImageId',
  62. 'model' => $model,
  63. 'previewConfig' => [
  64. 'url' => Url::to(['image-file', 'fileidstr' => $model->detailImageId]),
  65. ],
  66. ])->label('商品详情图') ?>
  67. <div class="form-group">
  68. <?= Html::submitButton('保存', ['class' => 'btn btn-success']) ?>
  69. <?= Html::a('返回', ['index'], ['class' => 'btn btn-info']) ?>
  70. </div>
  71. <?php ActiveForm::end(); ?>
  72. </div>