Browse Source

#活动创客

Q-ABAB 2 years ago
parent
commit
b1c1f64487

+ 80 - 80
src/views/activityManage/components/markeractivityWord.vue

@@ -7,9 +7,9 @@
         </div>
         <table border="1" cellspacing="0" class="table">
             <tr id="one">
-              <td colspan="4" class="bold"><span style="color:red">*</span>关联项目</td>
+              <td colspan="4" class="bold">关联项目</td>
               <td colspan="12">
-                <el-select v-model="wordData['associatedProjects']" @change="getProjectFund()" style="width: 100%;" placeholder="请选择关联项目">
+                <el-select v-model="wordData['associatedProjects']" @change="getProjectFund()" style="width: 100%;" placeholder="请选择关联项目(无关联项目可不选)">
                   <el-option
                     v-for="item in ProjectData"
                     :key="item.courseId"
@@ -195,7 +195,7 @@
                 <td rowspan="4" style="border-left: none;">总经费</td><td rowspan="4" colspan="2" >{{total}}元</td>
             </tr>
             <tr>
-                <td colspan="12" style="border-left: none;">经费月支出计划 (元)<span style="font-weight: bold;margin-left: 40px;">剩余经费:{{ allFund-total }}元</span></td>
+                <td colspan="12" style="border-left: none;">经费月支出计划 (元)</td>
             </tr>
             <tr>
               <td style="border-left: none;">第1个月</td><td>第2个月</td><td>第3个月</td><td>第4个月</td><td>第5个月</td><td>第6个月</td><td>第7个月</td><td>第8个月</td><td>第9个月</td><td>第10个月</td><td>第11个月</td><td>第12个月</td>
@@ -351,11 +351,11 @@
     <script>
     
       export default {
-        props:['wordData','total','allFund','changeFund'],
+        props:['wordData','total'],
         data() {
           return {
             // allFund:0,
-            myselfFund:0,
+            // myselfFund:0,
             DepartmentData:[],
             ProjectData:[],
         
@@ -391,16 +391,16 @@
                 this.$message.error(err.message)
             })
           },
-          checkProjectFund(index){
-            if(this.wordData['associatedProjects']==''){
-              for(let i in this.wordData['fund'])this.wordData['fund'][i]='';
-              return this.$message.error("请先选择关联项目");
-            }
-            if(this.total>this.allFund){
-              this.wordData['fund'][index]=0;
-              return this.$message.error("活动总经费不能超过项目剩余总预算")
-            }
-          },
+          // checkProjectFund(index){
+          //   if(this.wordData['associatedProjects']==''){
+          //     for(let i in this.wordData['fund'])this.wordData['fund'][i]='';
+          //     return this.$message.error("请先选择关联项目");
+          //   }
+          //   if(this.total>this.allFund){
+          //     this.wordData['fund'][index]=0;
+          //     return this.$message.error("活动总经费不能超过项目剩余总预算")
+          //   }
+          // },
           // checkExpenditureMothPlan(index){
           //   let count = 0;
           //   this.wordData['expenditureMothPlan'].forEach(item=>count+=Number(item))
@@ -409,78 +409,78 @@
           //     this.wordData['expenditureMothPlan'][index]=0;
           //   }
           // },
-          getProjectFund(){
-            if(this.wordData['associatedProjects']=='')return;
-            this.ajax.get(this.$store.state.api+"/getProjectFund",{
-              uid:this.$store.state.userInfo.userid,
-              pid:this.wordData['associatedProjects'],
-            }).then(result=>{
-              // console.log(result);
-              let data = result['data'][1]
-              let total = Number(result['data'][0][0]['fund']);
+          // getProjectFund(){
+          //   if(this.wordData['associatedProjects']=='')return;
+          //   this.ajax.get(this.$store.state.api+"/getProjectFund",{
+          //     uid:this.$store.state.userInfo.userid,
+          //     pid:this.wordData['associatedProjects'],
+          //   }).then(result=>{
+          //     // console.log(result);
+          //     let data = result['data'][1]
+          //     let total = Number(result['data'][0][0]['fund']);
  
-              if(!this.wordData['acId']){
-                this.wordData['college'] = result['data'][0][0]['classid'];
-                this.wordData['tel'] = result['data'][0][0]['phone'];
-                this.wordData['pro_leader'] = result['data'][0][0]['pro_leader'];
-              }
+          //     if(!this.wordData['acId']){
+          //       this.wordData['college'] = result['data'][0][0]['classid'];
+          //       this.wordData['tel'] = result['data'][0][0]['phone'];
+          //       this.wordData['pro_leader'] = result['data'][0][0]['pro_leader'];
+          //     }
               
               
-              let isUse = 0;
-              let myFund = 0;
-              // let istrue=false;
-              let arr= data.filter(e=>{           //活动未完结
-                return (e.state!=3)
-              })
-              let arr2=data.filter(e=>{           //活动已完结
-                return (e.state==3)
-              })
+          //     let isUse = 0;
+          //     let myFund = 0;
+          //     // let istrue=false;
+          //     let arr= data.filter(e=>{           //活动未完结
+          //       return (e.state!=3)
+          //     })
+          //     let arr2=data.filter(e=>{           //活动已完结
+          //       return (e.state==3)
+          //     })
 
-              let NoEnd = [];
-              arr.forEach(item=>{
-                let fI=NoEnd.filter(fItem=>fItem.acId==item.acId);
-                if(fI.length==0)NoEnd.push(item);
-              })
-              //加上未完结的预算资金
-              NoEnd.forEach(nItem=>isUse+=Number(nItem.money));
-              //加上已完结的活动实际使用资金
-              arr2.forEach(a2Item=>{
-                let realityMoney = 0;
-                let actualuse = JSON.parse(a2Item['actualuse']);
-                for(let i in actualuse)realityMoney+=Number(actualuse[i]);
-                isUse+=realityMoney;
-              })
+          //     let NoEnd = [];
+          //     arr.forEach(item=>{
+          //       let fI=NoEnd.filter(fItem=>fItem.acId==item.acId);
+          //       if(fI.length==0)NoEnd.push(item);
+          //     })
+          //     //加上未完结的预算资金
+          //     NoEnd.forEach(nItem=>isUse+=Number(nItem.money));
+          //     //加上已完结的活动实际使用资金
+          //     arr2.forEach(a2Item=>{
+          //       let realityMoney = 0;
+          //       let actualuse = JSON.parse(a2Item['actualuse']);
+          //       for(let i in actualuse)realityMoney+=Number(actualuse[i]);
+          //       isUse+=realityMoney;
+          //     })
 
-              console.log("该活动已经用了:"+isUse)
-              console.log("该活动的关联项目总经费为:"+total)
+          //     console.log("该活动已经用了:"+isUse)
+          //     console.log("该活动的关联项目总经费为:"+total)
 
 
-              this.changeFund(total-isUse)
-              // this.allFund = total - isUse;
-              if(this.wordData['acId']){
-                result['data'][1].forEach(item=>item['acId']==this.wordData['acId']?myFund+=Number(item['money']):"");
-                this.myselfFund = myFund;
+          //     this.changeFund(total-isUse)
+          //     // this.allFund = total - isUse;
+          //     if(this.wordData['acId']){
+          //       result['data'][1].forEach(item=>item['acId']==this.wordData['acId']?myFund+=Number(item['money']):"");
+          //       this.myselfFund = myFund;
 
-              }
-              if(this.total>this.allFund+this.myselfFund){
-                this.wordData['expenditureMothPlan'] = ['','','','','','','','','','','',''];
-                  this.wordData['fund'] = {
-                    total:0,
-                    device:"",
-                    Material:"",
-                    processing:"",
-                    Collaboration:"",
-                    APPRAISAL:"",
-                    entery:"",
-                    activities:"",
-                    Transaction:"",
-                  }
-                  this.$message.error("活动总经费不能超过项目剩余总预算")
-              }
-            }).catch(err=>{
-              console.log(err)
-            })
-          },
+          //     }
+          //     if(this.total>this.allFund+this.myselfFund){
+          //       this.wordData['expenditureMothPlan'] = ['','','','','','','','','','','',''];
+          //         this.wordData['fund'] = {
+          //           total:0,
+          //           device:"",
+          //           Material:"",
+          //           processing:"",
+          //           Collaboration:"",
+          //           APPRAISAL:"",
+          //           entery:"",
+          //           activities:"",
+          //           Transaction:"",
+          //         }
+          //         this.$message.error("活动总经费不能超过项目剩余总预算")
+          //     }
+          //   }).catch(err=>{
+          //     console.log(err)
+          //   })
+          // },
           goto(str){
             document.querySelector(str).scrollIntoView({ behavior: "smooth" });
           },
@@ -492,7 +492,7 @@
         mounted(){
           this.getProjectDepartmentData();
           this.getProjectData();
-          setTimeout(()=>this.getProjectFund(),1000);
+          // setTimeout(()=>this.getProjectFund(),1000);
         }
       };
     </script>

+ 12 - 13
src/views/activityManage/newMarkerActivity.vue

@@ -6,7 +6,7 @@
       </div>
       <hr>
          <!-- 创客专项资金及项目申请表(创客活动) -->
-        <markeractivityWord :wordData="wordData" :total="total" :allFund="wordData['allFund']" :changeFund="changeFund"/>
+        <markeractivityWord :wordData="wordData" :total="total"/>
         <div style="position: fixed;bottom: 5%;right: 2%;">
           <el-button type="primary" @click="test">提交活动</el-button>
         </div>
@@ -38,7 +38,6 @@
         loading:false,
         submitHint:false,
         wordData:{
-          allFund:0,
           applicationDate:getNowDate(1),//申请日期
           associatedProjects:"",//关联项目
           activityName:'',//项目名称
@@ -78,21 +77,21 @@
           }
     },
     methods: {
-      changeFund(newFund){
-        this.wordData['allFund'] = newFund;
-      },
+      // changeFund(newFund){
+      //   this.wordData['allFund'] = newFund;
+      // },
       test(){
           const cEmpty = /^\s*$/g;
           const checkPhone = /^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/; //获取正则表达式 存放到verify变量中
           for(let i in this.wordData){
             switch(i){
-              case "associatedProjects":
-                if(cEmpty.test(this.wordData[i])){
-                  this.$message.error("请选择关联项目")
-                  document.querySelector('#one').scrollIntoView({ behavior: "smooth" });
-                  return false;
-                }
-                break;
+              // case "associatedProjects":
+              //   if(cEmpty.test(this.wordData[i])){
+              //     this.$message.error("请选择关联项目")
+              //     document.querySelector('#one').scrollIntoView({ behavior: "smooth" });
+              //     return false;
+              //   }
+              //   break;
               case "activityName":
                 if(cEmpty.test(this.wordData[i])){
                   this.$message.error("请输入活动名称")
@@ -213,7 +212,7 @@
             f:JSON.stringify(this.wordData['fund']),//预算经费明细
             appltTime:this.wordData['applicationDate'],//申请日期
             mp:JSON.stringify(this.wordData['expenditureMothPlan']),
-            t:0,//活动分类 0 创客活动
+            t:this.wordData['associatedProjects']!=''?0:1,//活动分类 0 创客活动
           }
           this.ajax.post(this.$store.state.api+'/ActivityApply',pram).then(result=>{
             if(result['data']==1){

+ 1 - 1
src/views/home.vue

@@ -58,7 +58,7 @@
             ]},
             {id:2,label:"活动申请",power:false,icon:"el-icon-wind-power",goto:"/makerActvity",group:[
                 {label:"创客活动申请",power:false,goto:"/newMarkerActivity"},
-                {label:"个人创客申请",power:false,goto:"/newNomMarkerActivity"},
+                // {label:"个人创客申请",power:false,goto:"/newNomMarkerActivity"},
             ]},
             {id:2,label:"事后汇总",power:false,goto:"/makerfund",icon:"iconfont icon-zijinguanli",group:[
               {label:"创客活动资金申请",power:false,goto:"/newMarkerfundApply"},