yuanyiming 2 anos atrás
pai
commit
383a08ae05

+ 18 - 5
src/views/projectApply/projectApplicationApply3.vue

@@ -311,6 +311,20 @@ import { VueEditor } from "vue2-editor";
           this.setFund=false;
         },
         finish(){    //添加经费明细对话框完成按钮
+          let p=0;
+            if(this.data2.select.fund=='' ||this.data2.select.fund==undefined ){
+              return this.$message.error('请输入项目预算总经费')
+            }
+            for(let key in this.data.dialog){
+              if ([key] == 'fund') {
+                // console.log(this.data.dialog[key]);
+                if (this.data.dialog[key] > (this.data2.select.fund)*10000) {
+                  this.$message.error('金额大于预算总经费')
+                  return
+                }
+              }
+            }
+
             this.addFundDetail()
             this.init();
         },
@@ -323,11 +337,11 @@ import { VueEditor } from "vue2-editor";
         addBtn(){    //经费明细添加按钮
           this.addFundDialog=true;
         },
-        setFundBtn(){    //设置经费按钮
-          console.log(this.data2.value);
+        setFundBtn(){    //经费月支出计划设置经费对话框显示
+          // console.log(this.data2.value);
             this.setFund=true
         },
-        commit(){  //设置经费对话框按钮
+        commit(){  //经费月支出计划设置经费对话框确定按钮
           let p=0
           for(let key in this.data.items){
               if ( this.data.items[key] !== '' && this.data.items[key]!='-') {
@@ -335,8 +349,7 @@ import { VueEditor } from "vue2-editor";
                     console.log(this.data.items[key])
                     p+=Number(this.data.items[key])
                   }
-                 }
-                  
+                }
           }
           // console.log(p);
           console.log(p)

+ 14 - 6
src/views/projectApply/projectApplicationApplyMain.vue

@@ -137,10 +137,10 @@
                 tableData2:[],// 经费明细列表数据
                
                 dialog:{     //经费明细添加对话框
-                  fund:'300000',  //金额
-                  type:'填海',  //支出类别
-                  disburseProject:'改造世界',  //支出项目
-                  textarea:'小同志不利于团结的话可不兴说呀',  //备注
+                  fund:'',  //金额
+                  type:'',  //支出类别
+                  disburseProject:'',  //支出项目
+                  textarea:'',  //备注
                 },
             }
           }
@@ -235,6 +235,7 @@
               },
             addFundDetail(){    //预算经费页面经费添加按钮
               let p=this.projectApplicationApply3;
+
                 let data={
                   Fund:p.dialog.fund,
                   projectName:p.dialog.disburseProject,
@@ -242,11 +243,11 @@
                   remark:p.dialog.textarea
                 }
               p.tableData2.push(data)
+              p.dialog={}
             },
             submitBtn(){   //预算经费页面提交按钮
                 console.log("提交啦");
                 this.submitHint = true;
-
             },
             submitAll(){
               this.submitData()
@@ -262,7 +263,6 @@
               if(a.select.fund=='') return this.$message.error('请输入预算总经费')
               if(a.select.tel=='') return this.$message.error('请输入联系电话')
               if(!a.telVerify) return this.$message.error('请输入正确联系电话格式')
-
               if(a.select.sort=='') return this.$message.error('请选择分类')
               if(a.textarea=='') return this.$message.error('请输入项目简介')
               if(b.contentOne=='') return this.$message.error('请输入项目创新点')
@@ -270,6 +270,14 @@
               if(b.contentThree=='') return this.$message.error('请输入预期取得成果')
               if(b.contentFour=='') return this.$message.error('请输入预期取得成果')
               if(b.contentFive=='') return this.$message.error('请输入项目实施计划')
+              let p=0;
+              c.tableData2.forEach((e,i)=>{
+                // console.log(e);
+                p=p+Number(e.Fund)
+              })
+              if(p>(a.select.fund)*10000) return this.$message.error('经费明细超出预算总金额')
+
+
 
               let d=[]   //按照后端格式传递数据,项目内容,要将经费支出,与项目明细放在一起,
               for(let key in b){