feature/0423
wanghousheng 8 months ago
parent 0222749975
commit 21cad22e06
  1. 25
      src/views/user/modules/GradeForm.vue

@ -18,7 +18,7 @@
<a-select <a-select
placeholder="请选择会员身份" placeholder="请选择会员身份"
v-decorator="['user_type', { rules: [{ required: true }] }]" v-decorator="['user_type', { rules: [{ required: true }] }]"
> @change="setUserType">
<a-select-option :value="0">无身份</a-select-option> <a-select-option :value="0">无身份</a-select-option>
<a-select-option <a-select-option
v-for="(item, index) in userTypeList" v-for="(item, index) in userTypeList"
@ -27,6 +27,9 @@
>{{ item.name }}</a-select-option> >{{ item.name }}</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="有效时间" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="show_date">
<a-date-picker valueFormat="YYYY-MM-DD" v-decorator="['effective_time', { rules: [{message: '请输入有效时间',required: true }] }]"/>
</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,6 +71,7 @@ export default {
}, },
data () { data () {
return { return {
show_date: false,
// //
title: '设置会员等级', title: '设置会员等级',
// //
@ -111,16 +115,31 @@ export default {
this.visible = true this.visible = true
// //
this.record = record this.record = record
if (record.user_type === 30) {
record.effective_time = record.fx_effective_time
}
if (record.user_type !== 10 && record.effective_time || record.fx_effective_time) {
this.show_date = true
} else {
this.show_date = false
}
// //
this.setFieldsValue() this.setFieldsValue()
}, },
setUserType (val) {
console.log(val)
if (val === 20 || val === 30 || val === 40) {
this.show_date = true
} else {
this.show_date = false
}
},
// //
setFieldsValue () { setFieldsValue () {
const { record, form: { setFieldsValue } } = this const { record, form: { setFieldsValue } } = this
this.$nextTick(() => { this.$nextTick(() => {
// setFieldsValue(pick(record, ['grade_id', 'user_type'])) // setFieldsValue(pick(record, ['grade_id', 'user_type']))
setFieldsValue(pick(record, ['user_type'])) setFieldsValue(pick(record, ['user_type', 'effective_time']))
}) })
this.form.getFieldDecorator('grade_id', { initialValue: 0, preserve: true }) this.form.getFieldDecorator('grade_id', { initialValue: 0, preserve: true })

Loading…
Cancel
Save