添加字段

feature/0423
Wayne 9 months ago
parent e5d2a2cb80
commit 0b3f7ef409
  1. 36
      src/views/user/modules/GradeForm.vue

@ -14,6 +14,19 @@
<a-form-item label="会员ID" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="会员ID" :labelCol="labelCol" :wrapperCol="wrapperCol">
<span>{{ record.user_id }}</span> <span>{{ record.user_id }}</span>
</a-form-item> </a-form-item>
<a-form-item label="会员身份" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
placeholder="请选择会员身份"
v-decorator="['user_type', { rules: [{ required: true }] }]"
>
<a-select-option :value="0">无身份</a-select-option>
<a-select-option
v-for="(item, index) in userTypeList"
:key="index"
:value="item.id"
>{{ item.name }}</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="会员等级" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="会员等级" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select <a-select
placeholder="请选择会员等级" placeholder="请选择会员等级"
@ -68,7 +81,26 @@ export default {
// //
form: this.$form.createForm(this), form: this.$form.createForm(this),
// //
record: {} record: {},
userTypeList: [
{
id: 10,
name: '游客'
},
{
id: 20,
name: 'PLUS会员'
},
{
id: 30,
name: '分销商'
},
{
id: 40,
name: '店长'
}
]
} }
}, },
methods: { methods: {
@ -87,7 +119,7 @@ export default {
setFieldsValue () { setFieldsValue () {
const { record, form: { setFieldsValue } } = this const { record, form: { setFieldsValue } } = this
this.$nextTick(() => { this.$nextTick(() => {
setFieldsValue(pick(record, ['grade_id'])) setFieldsValue(pick(record, ['grade_id', 'user_type']))
}) })
}, },

Loading…
Cancel
Save