|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<!-- 创客创新-活动申请 -->
|
|
|
<div class="core_dialogue">
|
|
|
- <makerActvityApply :data="makerActvityApplyData" :checkPhone="checkPhone" :next="next" v-if="status==0" />
|
|
|
+ <makerActvityApply :data="makerActvityApplyData" :checkProjectMoney="checkProjectMoney" :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>
|
|
@@ -94,18 +94,18 @@ import makerActvityApply2 from './makerActvityApply2.vue';
|
|
|
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 "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;
|
|
@@ -132,9 +132,9 @@ import makerActvityApply2 from './makerActvityApply2.vue';
|
|
|
case "value":
|
|
|
if(cEmpty.test(checkData[i]))return this.$message.error("请选择所在部门");
|
|
|
break;
|
|
|
- case "introduce":
|
|
|
- if(cEmpty.test(checkData[i]))return this.$message.error("活动介绍不能为空");
|
|
|
- break;
|
|
|
+ // case "introduce":
|
|
|
+ // if(cEmpty.test(checkData[i]))return this.$message.error("活动介绍不能为空");
|
|
|
+ // break;
|
|
|
}
|
|
|
}
|
|
|
return 1;
|
|
@@ -147,7 +147,32 @@ import makerActvityApply2 from './makerActvityApply2.vue';
|
|
|
return false;
|
|
|
}
|
|
|
return true;
|
|
|
+ },
|
|
|
+ checkProjectMoney(pid,aMoney){
|
|
|
+ console.log(1111)
|
|
|
+ if(aMoney==0){
|
|
|
+ return 1;
|
|
|
+ }else if(/^\s*$/g.test(pid) && aMoney!=0){
|
|
|
+ this.makerActvityApplyData.select.fund = 0;
|
|
|
+ return this.$message.info("请先选择所属项目");
|
|
|
+ } else if(!/^\s*$/g.test(pid) && aMoney!=0){
|
|
|
+ this.ajax.get(this.$store.state.api+"/GetAllActivityMoneyByProjectId",{
|
|
|
+ uid:this.$store.state.userInfo.userid,
|
|
|
+ projectid:pid
|
|
|
+ }).then(res=>{
|
|
|
+ let PMoney = res.data[0][0]['PMoney'];
|
|
|
+ let AMoney = res.data[1][0]["AMoney"];
|
|
|
+ if(PMoney<(AMoney+aMoney)){
|
|
|
+ this.makerActvityApplyData.select.fund = PMoney-AMoney;
|
|
|
+ return this.$message.warning(`项目预算不足,项目预算只剩:${PMoney-AMoney}`);
|
|
|
+ }else{
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ }).catch(err=>{
|
|
|
+ console.log(err)
|
|
|
+ })
|
|
|
}
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
//获取部门
|