|
@@ -415,15 +415,70 @@
|
|
|
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']);
|
|
|
- console.log(result['data'][0][0])
|
|
|
- console.log(this.wordData)
|
|
|
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;
|
|
|
- result['data'][1].forEach(item=>isUse+=Number(item['money']))
|
|
|
+ // let istrue=false;
|
|
|
+ let arr= data.filter(e=>{ //活动未完结
|
|
|
+ return (e.state!=3)
|
|
|
+ })
|
|
|
+ let arr2=data.filter(e=>{ //活动已完结
|
|
|
+ return (e.state==3)
|
|
|
+ })
|
|
|
+
|
|
|
+ arr.forEach(e=>{
|
|
|
+ isUse+=e.money*1
|
|
|
+ })
|
|
|
+ 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']))
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
this.changeFund(total-isUse)
|
|
|
// this.allFund = total - isUse;
|
|
|
if(this.wordData['acId']){
|