Q-ABAB 1 рік тому
батько
коміт
e91fc24bc5

+ 16 - 44
src/views/activityManage/components/markeractivityWord.vue

@@ -423,6 +423,7 @@
               this.wordData['pro_leader'] = result['data'][0][0]['pro_leader'];
               let isUse = 0;
               let myFund = 0;
+              console.log(data)
               // let istrue=false;
               let arr= data.filter(e=>{           //活动未完结
                 return (e.state!=3)
@@ -431,52 +432,23 @@
                 return (e.state==3)
               })
 
-              arr.forEach(e=>{
-                isUse+=e.money*1
+              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(arr,arr2);
-              if (!arr2) {
-                arr2=0
-                isUse+=arr2
-              }else{
-                arr2.filter(e=>{
-                  let JP = JSON.parse(e['actualuse']);
-                  //  isUse+=e.actualuse*1
-                  for(let k in JP){
-                          if (JP[k]!='') {
-                            isUse+=JP[k]*1
-                          }
-                       }
-                })
-              }
-              // console.log(isUse+arr2);
-
-              // console.log(arr,arr2);
-
-
-              // return console.log(arr);
-              // if (arr.length!=0) {
-              //   arr.filter(e=>{
-              //      if (e.actualuse==null) {
-              //           e.actualuse=e.applyfund
-              //      }
-              //   })
-              //    arr.forEach(item=>{
-              //       let JP = JSON.parse(item['actualuse']);
-              //          for(let k in JP){
-              //             if (JP[k]!='') {
-              //               isUse+=JP[k]*1
-              //             }
-              //          }
-              //       })
-                  
-              // }else{
-              //   result['data'][1].forEach(item=>isUse+=Number(item['money']))
-              // }
-              
-
-
 
+              console.log("该活动已经用了:"+isUse)
+              console.log("该活动的关联项目总经费为:"+total)
 
 
               this.changeFund(total-isUse)

+ 1 - 1
src/views/activityManage/makerActvity.vue

@@ -173,7 +173,7 @@
                         <!-- <el-button type="primary"  @click="audi(scope.row,1)" size="mini">管理审核</el-button> -->
                         <el-button type="primary"  v-show="scope.row.state==1&& $store.state.userInfo.type==0" @click="audi(scope.row,1)" size="mini">审核</el-button>
                         <el-button type="primary" disabled v-show="scope.row.state==0&& $store.state.userInfo.type==0" class="disa" size="mini">审核</el-button>
-                        <el-button type="primary" disabled v-show="scope.row.state==2 && scope.row.state!=1&& $store.state.userInfo.type==0" class="disa" size="mini">已审核</el-button>
+                        <el-button type="primary" disabled v-show="(scope.row.state==2 || scope.row.state==3) && scope.row.state!=1&& $store.state.userInfo.type==0" class="disa" size="mini">已审核</el-button>
 
                         
                         <!-- <el-button type="primary"  size="mini" @click="edit(scope.row.acId)">申请表</el-button> -->