|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
<!-- 创客创新-活动申请 -->
|
|
|
<div class="core_dialogue">
|
|
|
- <makerActvityApply :data="makerActvityApplyData" :next="next" v-if="status==0" />
|
|
|
- <makerActvityApply2 :data="makerActvityApply2Data" :activityName="makerActvityApplyData.select.activityName" :next="next" :submit="submit" :back="back" v-if="status==1" />
|
|
|
+ <makerActvityApply :data="makerActvityApplyData" :checkPhone="checkPhone" :next="next" v-if="status==0" />
|
|
|
+ <makerActvityApply2 :data="makerActvityApply2Data" :activityName="makerActvityApplyData.select.activityName" :check="check" :submit="submit" :back="back" v-if="status==1" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -18,15 +18,15 @@ import makerActvityApply2 from './makerActvityApply2.vue';
|
|
|
select:{
|
|
|
activityName:'',
|
|
|
pid:"",
|
|
|
- person:'',
|
|
|
+ leader:'',
|
|
|
tel:'',
|
|
|
- date:'',
|
|
|
+ time:'',
|
|
|
fund:0,
|
|
|
people:0,
|
|
|
value:'',
|
|
|
teacher:[],
|
|
|
+ introduce:'',
|
|
|
},
|
|
|
- introduce:'',
|
|
|
class:[],
|
|
|
project:[],
|
|
|
},
|
|
@@ -43,8 +43,9 @@ import makerActvityApply2 from './makerActvityApply2.vue';
|
|
|
this.status--
|
|
|
},
|
|
|
submit(){
|
|
|
- console.log(this.makerActvityApplyData)
|
|
|
- console.log(this.makerActvityApply2Data)
|
|
|
+ let data = {...this.makerActvityApplyData.select,...this.makerActvityApply2Data}
|
|
|
+ console.log(data);
|
|
|
+
|
|
|
},
|
|
|
getAllClass(){
|
|
|
this.ajax.get(this.$store.state.api+"/SelectAllDepartment",{
|
|
@@ -63,6 +64,65 @@ import makerActvityApply2 from './makerActvityApply2.vue';
|
|
|
}).catch(err=>{
|
|
|
this.$message.error(err.message)
|
|
|
})
|
|
|
+ },
|
|
|
+ check(){
|
|
|
+ let checkData = {...this.makerActvityApplyData.select,...this.makerActvityApply2Data}
|
|
|
+ const cEmpty = /^\s*$/g;
|
|
|
+ for(let i in checkData){
|
|
|
+ switch(i){
|
|
|
+ case "0":
|
|
|
+ if(cEmpty.test(checkData[i]))return this.$message.error("活动计划不能为空");
|
|
|
+ break;
|
|
|
+ case "1":
|
|
|
+ if(cEmpty.test(checkData[i]))return this.$message.error("预期目标不能为空");
|
|
|
+ break;
|
|
|
+ case "2":
|
|
|
+ if(cEmpty.test(checkData[i]))return this.$message.error("活动受面不能为空");
|
|
|
+ break;
|
|
|
+ case "3":
|
|
|
+ if(cEmpty.test(checkData[i]))return this.$message.error("经费支出计划不能为空");
|
|
|
+ break;
|
|
|
+ case "activityName":
|
|
|
+ if(cEmpty.test(checkData[i]))return this.$message.error("活动名称不能为空");
|
|
|
+ break;
|
|
|
+ case "teacher":
|
|
|
+ if(checkData[i].length==0)return this.$message.error("请添加至少一名指导老师")
|
|
|
+ break;
|
|
|
+ case "fund":
|
|
|
+ break;
|
|
|
+ case "people":
|
|
|
+ break;
|
|
|
+ case "leader":
|
|
|
+ if(cEmpty.test(checkData[i]))return this.$message.error("负责人不能为空");
|
|
|
+ break;
|
|
|
+ case "pid":
|
|
|
+ if(cEmpty.test(checkData[i]))return this.$message.error("请选择所属项目");
|
|
|
+ break;
|
|
|
+ case "tel":
|
|
|
+ if(cEmpty.test(checkData[i]))return this.$message.error("电话号码不能为空");
|
|
|
+ if(!this.checkPhone(checkData[i]))return;
|
|
|
+ break;
|
|
|
+ case "time":
|
|
|
+ if(cEmpty.test(checkData[i]))return this.$message.error("请选择项目开始时间");
|
|
|
+ break;
|
|
|
+ case "value":
|
|
|
+ if(cEmpty.test(checkData[i]))return this.$message.error("请选择所在部门");
|
|
|
+ break;
|
|
|
+ case "introduce":
|
|
|
+ if(cEmpty.test(checkData[i]))return this.$message.error("活动介绍不能为空");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 1;
|
|
|
+ },
|
|
|
+ checkPhone(val){
|
|
|
+ if(/^\s*$/g.test(val))return;
|
|
|
+ const cPhone = /^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/
|
|
|
+ if(!cPhone.test(val)){
|
|
|
+ this.$message.error("电话号码格式不正确");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|