Q-ABAB 2 年之前
父节点
当前提交
04fd1dd3df

+ 5 - 0
src/App.vue

@@ -13,6 +13,7 @@
 </template>
 
 <script>
+import { getToken } from '@/utils/auth'
 export default {
   data() {
     return {};
@@ -23,6 +24,10 @@ export default {
       // this.$router.push("/login");
     },
   },
+  mounted(){
+    // console.log(getToken())
+    // getToken()
+  }
 };
 </script>
 

+ 5 - 6
src/views/activityManage/components/markeractivityWord.vue

@@ -351,13 +351,14 @@
     <script>
     
       export default {
-        props:['wordData','total'],
+        props:['wordData','total','allFund','changeFund'],
         data() {
           return {
-            allFund:0,
+            // allFund:0,
             myselfFund:0,
             DepartmentData:[],
             ProjectData:[],
+        
             }
         },
         methods: {
@@ -395,9 +396,6 @@
               for(let i in this.wordData['fund'])this.wordData['fund'][i]='';
               return this.$message.error("请先选择关联项目");
             }
-            // if(this.myselfFund>this.total){
-            //   this.allFund+=this.myselfFund - this.total;
-            // }
             if(this.total>this.allFund){
               this.wordData['fund'][index]=0;
               return this.$message.error("活动总经费不能超过项目剩余总预算")
@@ -426,7 +424,8 @@
               let isUse = 0;
               let myFund = 0;
               result['data'][1].forEach(item=>isUse+=Number(item['money']))
-              this.allFund = total - isUse;
+              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;

+ 6 - 1
src/views/activityManage/makerActivityWordDetail.vue

@@ -7,7 +7,7 @@
             </div>
             <hr>
         </div>
-        <markeractivityWord v-if="wordData['type']==0 && wordData['state']==0" :wordData="wordData" :total="total"/>
+        <markeractivityWord v-if="wordData['type']==0 && wordData['state']==0" :wordData="wordData" :total="total" :changeFund="changeFund" :allFund="wordData['allFund']"/>
         <NomMarkerWord v-if="wordData['type']==1 && wordData['state']==0" :wordData="wordData" :total="total"/>
         <markeractivityWordShow v-if="wordData['state']!=0" :wordData="wordData" :total="total"/>
         <div>
@@ -41,6 +41,7 @@
                 loading:false,
                 submitHint:false,
                 wordData:{
+                  allFund:0,
                   acId:"",//活动ID
                   applicationDate:'',//申请日期
                   associatedProjects:"",//关联项目
@@ -80,6 +81,9 @@
               }
           },
           methods:{
+              changeFund(newFund){
+                this.wordData['allFund'] = newFund;
+              },
               back(){
                   this.$router.push('/makerActvity')
               },
@@ -107,6 +111,7 @@
                     this.wordData['collegeName'] = data['CName'];
                     this.wordData['acId'] = data['acId']
                     this.wordData['state'] = data['state']
+                    // console.log(this.wordData)
                     this.wordData = {...this.wordData,...JSON.parse(data['chapters'])}
                     this.loading = false;
                 }).catch(err=>{

+ 5 - 1
src/views/activityManage/newMarkerActivity.vue

@@ -6,7 +6,7 @@
       </div>
       <hr>
          <!-- 创客专项资金及项目申请表(创客活动) -->
-        <markeractivityWord :wordData="wordData" :total="total"/>
+        <markeractivityWord :wordData="wordData" :total="total" :allFund="wordData['allFund']" :changeFund="changeFund"/>
         <div style="position: fixed;bottom: 5%;right: 2%;">
           <el-button type="primary" @click="test">提交活动</el-button>
         </div>
@@ -38,6 +38,7 @@
         loading:false,
         submitHint:false,
         wordData:{
+          allFund:0,
           applicationDate:getNowDate(1),//申请日期
           associatedProjects:"",//关联项目
           activityName:'',//项目名称
@@ -77,6 +78,9 @@
           }
     },
     methods: {
+      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变量中