Ver código fonte

年度预算添加时限制完善

梁世豪 4 meses atrás
pai
commit
7289ba4724

+ 24 - 12
src/main/resources/templates/annualbudget/add_annualbudget.html

@@ -663,10 +663,10 @@
663 663
                 Message.error("请先创建年度预算,然后再填写预算明细", 1500);
664 664
             } else {
665 665
                 var rwsys = $("#rwsys").val();
666
-                if (rwsys == "") {
667
-                    Message.error("任务书预算不能为空,请完善任务书项目预算!", 1500);
668
-                    return false;
669
-                }
666
+                // if (rwsys == "") {
667
+                //     Message.error("任务书预算不能为空,请完善任务书项目预算!", 1500);
668
+                //     return false;
669
+                // }
670 670
                 var ndzys = dataBudget[0].xmzys;
671 671
                 if (ndzys == null) {
672 672
                     return false;
@@ -675,17 +675,29 @@
675 675
                     Message.error("年度总预算不能超过任务书预算!", 1500);
676 676
                     return false;
677 677
                 }
678
-                if (parseFloat(ndzys) > parseFloat(rwsys)) {
679
-                    Message.error("年度总预算不能超过任务书预算!", 1500);
678
+                var ndczje = $("#ndczje").val();
679
+                for (let i = 0; i < dataBudget.length; i++) {
680
+                    if (dataBudget[i].fj==''){
681
+                        var ysje = dataBudget[i].ysje;
682
+                    }
683
+                }
684
+                if (ndczje === "" && ndczje === null){
685
+                    Message.error("年度经费为空,不能申请年度预算,请完善任务书当前年份出资方案!!");
680 686
                     return false;
681 687
                 }
688
+                if (ysje === null){
689
+                    Message.error("预算金额不能为空!!",1500);
690
+                    return false;
682 691
 
683
-                var ndczje = $("#ndczje").val();
684
-                var ysje = dataBudget[0].ysje;
685
-                // if(ndczje != "" && ysje != null && ndczje != ysje) {
686
-                //     Message.error("预算金额与年度预算金额不符,请核对!", 1500);
687
-                //     return false;
688
-                // }
692
+                }
693
+                if ( ysje > ndczje){
694
+                    Message.error("预算金额不能大于年度经费!",1500);
695
+                    return false;
696
+                }
697
+                if ( ysje < ndczje){
698
+                    Message.error("预算金额不能小于年度经费!",1500);
699
+                    return false;
700
+                }
689 701
 
690 702
                 var data = insTb.options.data;
691 703
                 var budgets = new Array();