|
|
|
@ -18,7 +18,7 @@ |
|
|
|
|
<a-select |
|
|
|
|
placeholder="请选择会员身份" |
|
|
|
|
v-decorator="['user_type', { rules: [{ required: true }] }]" |
|
|
|
|
> |
|
|
|
|
@change="setUserType"> |
|
|
|
|
<a-select-option :value="0">无身份</a-select-option> |
|
|
|
|
<a-select-option |
|
|
|
|
v-for="(item, index) in userTypeList" |
|
|
|
@ -27,6 +27,9 @@ |
|
|
|
|
>{{ item.name }}</a-select-option> |
|
|
|
|
</a-select> |
|
|
|
|
</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-select |
|
|
|
|
placeholder="请选择会员等级" |
|
|
|
@ -68,6 +71,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
show_date: false, |
|
|
|
|
// 对话框标题 |
|
|
|
|
title: '设置会员等级', |
|
|
|
|
// 标签布局属性 |
|
|
|
@ -111,16 +115,31 @@ export default { |
|
|
|
|
this.visible = true |
|
|
|
|
// 当前记录 |
|
|
|
|
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() |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setUserType (val) { |
|
|
|
|
console.log(val) |
|
|
|
|
if (val === 20 || val === 30 || val === 40) { |
|
|
|
|
this.show_date = true |
|
|
|
|
} else { |
|
|
|
|
this.show_date = false |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 设置默认值 |
|
|
|
|
setFieldsValue () { |
|
|
|
|
const { record, form: { setFieldsValue } } = this |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
// 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 }) |
|
|
|
|