|
@@ -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>
|