|
|
@ -1,9 +1,9 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<el-form :model="form" size="small" label-width="120" label-position="left" :rules="rules" ref="form"> |
|
|
|
<el-form :model="form" size="small" label-width="120" label-position="left" :rules="rules" ref="form"> |
|
|
|
<el-form-item label="活动名称" style="width: 400px"> |
|
|
|
<el-form-item label="活动名称" prop='name' style="width: 400px"> |
|
|
|
<el-input v-model="form.name" maxlength="10" show-word-limit placeholder="请输入活动名称"></el-input> |
|
|
|
<el-input v-model="form.name" maxlength="10" show-word-limit placeholder="请输入活动名称"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="活动地点"> |
|
|
|
<el-form-item label="活动地点" prop="region"> |
|
|
|
<el-select v-model="form.region" filterable placeholder="请选择活动区域"> |
|
|
|
<el-select v-model="form.region" filterable placeholder="请选择活动区域"> |
|
|
|
<el-option label="北京" value="beijing"></el-option> |
|
|
|
<el-option label="北京" value="beijing"></el-option> |
|
|
|
<el-option label="上海" value="shanghai"></el-option> |
|
|
|
<el-option label="上海" value="shanghai"></el-option> |
|
|
@ -12,20 +12,24 @@ |
|
|
|
<el-form-item label="活动时间"> |
|
|
|
<el-form-item label="活动时间"> |
|
|
|
<el-row style="width: 400px"> |
|
|
|
<el-row style="width: 400px"> |
|
|
|
<el-col :span="11"> |
|
|
|
<el-col :span="11"> |
|
|
|
<el-date-picker v-model="form.date1" type="date" placeholder="选择日期" style="width: 100%"></el-date-picker> |
|
|
|
<el-form-item prop="date1"> |
|
|
|
|
|
|
|
<el-date-picker v-model="form.date1" type="date" placeholder="选择日期" style="width: 100%"></el-date-picker> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="2" class="text-center"> |
|
|
|
<el-col :span="2" class="text-center"> |
|
|
|
<span class="text-gray-500">-</span> |
|
|
|
<span class="text-gray-500">-</span> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="11"> |
|
|
|
<el-col :span="11"> |
|
|
|
<el-time-picker v-model="form.date2" placeholder="选择时间"></el-time-picker> |
|
|
|
<el-form-item prop="date2"> |
|
|
|
|
|
|
|
<el-time-picker v-model="form.date2" placeholder="选择时间"></el-time-picker> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-row> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="是否直播"> |
|
|
|
<el-form-item label="是否直播" prop="delivery"> |
|
|
|
<el-switch v-model="form.delivery"></el-switch> |
|
|
|
<el-switch v-model="form.delivery"></el-switch> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="活动类型"> |
|
|
|
<el-form-item label="活动类型" prop="type"> |
|
|
|
<el-checkbox-group v-model="form.type"> |
|
|
|
<el-checkbox-group v-model="form.type"> |
|
|
|
<el-checkbox label="线上活动" name="type"></el-checkbox> |
|
|
|
<el-checkbox label="线上活动" name="type"></el-checkbox> |
|
|
|
<el-checkbox label="线下活动" name="type"></el-checkbox> |
|
|
|
<el-checkbox label="线下活动" name="type"></el-checkbox> |
|
|
@ -33,23 +37,23 @@ |
|
|
|
<el-checkbox label="新品发布" name="type"></el-checkbox> |
|
|
|
<el-checkbox label="新品发布" name="type"></el-checkbox> |
|
|
|
</el-checkbox-group> |
|
|
|
</el-checkbox-group> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="场地资源"> |
|
|
|
<el-form-item label="场地资源" prop="resource"> |
|
|
|
<el-radio-group v-model="form.resource"> |
|
|
|
<el-radio-group v-model="form.resource"> |
|
|
|
<el-radio label="自助"></el-radio> |
|
|
|
<el-radio label="自助"></el-radio> |
|
|
|
<el-radio label="赞助"></el-radio> |
|
|
|
<el-radio label="赞助"></el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="参与人数"> |
|
|
|
<el-form-item label="参与人数" prop="number"> |
|
|
|
<!-- <el-input-number v-model="form.number" min="0" max="10"></el-input-number>--> |
|
|
|
<!-- <el-input-number v-model="form.number" min="0" max="10"></el-input-number>--> |
|
|
|
<el-input v-model="form.number" type="number" min="0" max="10" placeholder="请输入参与人数" |
|
|
|
<el-input v-model="form.number" type="number" min="0" max="10" placeholder="请输入参与人数" |
|
|
|
style="width: 120px;"></el-input> |
|
|
|
style="width: 120px;"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="备注"> |
|
|
|
<el-form-item label="备注" prop="desc"> |
|
|
|
<el-input v-model="form.desc" type="textarea" maxlength="400" show-word-limit style="width: 400px"></el-input> |
|
|
|
<el-input v-model="form.desc" type="textarea" maxlength="400" show-word-limit style="width: 400px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" @click="submit">创建</el-button> |
|
|
|
<el-button type="primary" @click="formSubmit('form')">创建</el-button> |
|
|
|
<el-button @click="cancel">取消</el-button> |
|
|
|
<el-button @click="formReset('form')">取消</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -93,29 +97,26 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
type: [{required: true, type: 'array', message: '至少选择一个活动类型', trigger: 'change'}], |
|
|
|
type: [{required: true, type: 'array', message: '至少选择一个活动类型', trigger: 'change'}], |
|
|
|
resource: [{required: true, message: '请选择活动资源', trigger: 'change'}] |
|
|
|
resource: [{required: true, message: '请选择活动资源', trigger: 'change'}], |
|
|
|
|
|
|
|
number: [{required: true, message: '请输入参与人数', trigger: 'blur'}], |
|
|
|
|
|
|
|
desc: [{required: true, message: '请填写备注', trigger: 'blur'}] |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
submit() { |
|
|
|
formSubmit(formName){ |
|
|
|
console.log('created') |
|
|
|
this.$refs[formName].validate((valid) => { |
|
|
|
console.log(this.form) |
|
|
|
if (valid) { |
|
|
|
}, |
|
|
|
alert('提交成功!'); |
|
|
|
cancel() { |
|
|
|
}else{ |
|
|
|
console.log('cleared') |
|
|
|
console.log('提交失败'); |
|
|
|
this.form = { |
|
|
|
return false; |
|
|
|
name: "", |
|
|
|
} |
|
|
|
region: "", |
|
|
|
}) |
|
|
|
date1: "", |
|
|
|
|
|
|
|
date2: "", |
|
|
|
|
|
|
|
delivery: false, |
|
|
|
|
|
|
|
type: [], |
|
|
|
|
|
|
|
resource: "", |
|
|
|
|
|
|
|
number: "", |
|
|
|
|
|
|
|
desc: "", |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
formReset(formName){ |
|
|
|
|
|
|
|
this.$refs[formName].resetFields() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|