更新字段

feature/0423
Wayne 11 months ago
parent d8be5ff1f6
commit f4fd329cea
  1. 26
      src/views/goods/Create.vue
  2. 10
      src/views/goods/Update.vue
  3. 9
      src/views/goods/category/modules/AddForm.vue
  4. 10
      src/views/goods/category/modules/EditForm.vue

@ -21,7 +21,7 @@
<a-form-item label="商品名称" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input
placeholder="请输入商品名称"
v-decorator="['goods_name', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]"
v-decorator="['goods_name', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]"
/>
</a-form-item>
<a-form-item label="商品分类" :labelCol="labelCol" :wrapperCol="wrapperCol">
@ -32,7 +32,7 @@
treeCheckable
treeCheckStrictly
allowClear
v-decorator="['categorys', { rules: [{ required: true, message: '请至少选择1个商品分类' }] }]"
v-decorator="['categorys', { rules: [{ required: true, message: '请至少选择1个商品分类' }] }]"
></a-tree-select>
<div class="form-item-help">
<router-link target="_blank" :to="{ path: '/goods/category/index' }">去新增</router-link>
@ -48,13 +48,13 @@
<SelectImage
multiple
:maxNum="10"
v-decorator="['imagesIds', { rules: [{ required: true, message: '请至少上传1张商品图片' }] }]"
v-decorator="['imagesIds', { rules: [{ required: true, message: '请至少上传1张商品图片' }] }]"
/>
</a-form-item>
<a-form-item label="是否大牌正品" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group
v-decorator="['is_brand', { initialValue: 0, rules: [{ required: true }] }]"
v-decorator="['is_brand', { initialValue: 0, rules: [{ required: true }] }]"
>
<a-radio :value="0"></a-radio>
<a-radio :value="1"></a-radio>
@ -63,7 +63,15 @@
<a-form-item label="是否新品首发" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group
v-decorator="['is_new', { initialValue: 0, rules: [{ required: true }] }]"
v-decorator="['is_new', { initialValue: 0, rules: [{ required: true }] }]"
>
<a-radio :value="0"></a-radio>
<a-radio :value="1"></a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="是否店内" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group
v-decorator="['is_in_store', { initialValue: 0, rules: [{ required: true }] }]"
>
<a-radio :value="0"></a-radio>
<a-radio :value="1"></a-radio>
@ -112,7 +120,7 @@
>
<a-select
style="width: 300px"
v-decorator="['delivery_id', { rules: [{ required: true, message: '请选择运费模板' }] }]"
v-decorator="['delivery_id', { rules: [{ required: true, message: '请选择运费模板' }] }]"
placeholder="请选择运费模板"
>
<a-select-option
@ -258,7 +266,7 @@
<div class="tab-pane" v-show="tabKey == 2">
<a-form-item label="商品详情" :labelCol="labelCol" :wrapperCol="{span: 16}">
<Ueditor
v-decorator="['content', { rules: [{ required: true, message: '商品详情不能为空' }] }]"
v-decorator="['content', { rules: [{ required: true, message: '商品详情不能为空' }] }]"
/>
</a-form-item>
</div>
@ -383,8 +391,8 @@
addonAfter="折"
:inputProps="{ min: 0, max: 9.9 }"
v-decorator="[`alone_grade_equity[grade_id:${item.grade_id}]`, {
initialValue: formData.defaultUserGradeValue[item.grade_id], rules: [{ required: true, message: '折扣率不能为空' }]
}]"
initialValue: formData.defaultUserGradeValue[item.grade_id], rules: [{ required: true, message: '折扣率不能为空' }]
}]"
/>
</a-form-item>
</div>

@ -71,6 +71,14 @@
<a-radio :value="1"></a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="是否店内" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group
v-decorator="['is_in_store', { initialValue: 0, rules: [{ required: true }] }]"
>
<a-radio :value="0"></a-radio>
<a-radio :value="1"></a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="商品编码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入商品编码" v-decorator="['goods_no']" />
@ -602,7 +610,7 @@ export default {
// tabKey
//
const tabsFieldsMap = [
['goods_type', 'goods_name', 'categorys', 'imagesIds', 'delivery_id', 'is_ind_delivery_type', 'delivery_type','is_brand'],
['goods_type', 'goods_name', 'categorys', 'imagesIds', 'delivery_id', 'is_ind_delivery_type', 'delivery_type','is_brand', 'is_in_store'],
['spec_type', 'goods_price', 'is_restrict', 'restrict_total', 'restrict_single'],
['content'],
['alone_grade_equity', 'first_money', 'second_money', 'third_money']

@ -40,7 +40,14 @@
<a-radio :value="1"></a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="是否店内" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group
v-decorator="['is_in_store', { initialValue: 0, rules: [{ required: true }] }]"
>
<a-radio :value="0"></a-radio>
<a-radio :value="1"></a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" extra="用户端是否展示">
<a-radio-group v-decorator="['status', { initialValue: 1, rules: [{ required: true }] }]">

@ -43,6 +43,14 @@
<a-radio :value="1"></a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="是否店内" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group
v-decorator="['is_in_store', { initialValue: 0, rules: [{ required: true }] }]"
>
<a-radio :value="0"></a-radio>
<a-radio :value="1"></a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" extra="用户端是否展示">
<a-radio-group v-decorator="['status', { initialValue: 1, rules: [{ required: true }] }]">
@ -119,7 +127,7 @@ export default {
const { record, form: { setFieldsValue } } = this
//
this.$nextTick(() => {
setFieldsValue(_.pick(record, ['name', 'parent_id', 'image_id', 'status', 'sort','is_paihang','is_hot']))
setFieldsValue(_.pick(record, ['name', 'parent_id', 'image_id', 'status', 'sort','is_paihang','is_hot', 'is_in_store']))
})
},

Loading…
Cancel
Save