|
@@ -64,7 +64,7 @@
|
|
|
rules: {
|
|
|
title: [{ required: true, message: '请输入名称', trigger: 'blur' }],
|
|
|
service: [{ required: true, message: '请输入服务', trigger: 'blur' }],
|
|
|
- image: [{ required: true }],
|
|
|
+ image: [{ required: true, message: '请上传图片', trigger: 'blur'}],
|
|
|
contact: [{ required: true, message: '请输入联系人', trigger: 'blur' }],
|
|
|
phone: [{ required: true, message: '请输入联系电话'},
|
|
|
{ min: 11, max: 11, message: '请输入11位联系电话', trigger: 'blur' },
|
|
@@ -76,7 +76,23 @@
|
|
|
computed: {},
|
|
|
methods: {
|
|
|
submitForm() {
|
|
|
- this.$emit('submitForm', { data: this.ruleForm });
|
|
|
+ if(!this.ruleForm.image){
|
|
|
+ this.$message.error('请上传图片');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if(!this.ruleForm.description){
|
|
|
+ this.$message.error('请输入机构介绍');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ this.$refs['ruleForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ this.$emit('submitForm', { data: this.ruleForm });
|
|
|
+ } else {
|
|
|
+ console.log('error submit!!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ /*this.$emit('submitForm', { data: this.ruleForm });*/
|
|
|
},
|
|
|
resetForm() {
|
|
|
this.$emit('resetForm');
|