Browse Source

年度预算-本年度已申请金额 和 本年度已申请金额 总和计算

lgl 6 months ago
parent
commit
7b383e570a
1 changed files with 16 additions and 1 deletions
  1. 16 1
      src/main/resources/templates/annualbudget/view_annualbudget.html

+ 16 - 1
src/main/resources/templates/annualbudget/view_annualbudget.html

@@ -315,7 +315,7 @@
315
         //父级预算
315
         //父级预算
316
         function setFjBudget(fj) {
316
         function setFjBudget(fj) {
317
             if (fj != null && fj != '') {
317
             if (fj != null && fj != '') {
318
-                var xmzys = 0, xmz = 0, byj = 0, xtjsyzx = 0, sjyzx = 0;
318
+                var xmzys = 0, xmz = 0, byj = 0, xtjsyzx = 0, sjyzx = 0, bndsqje = 0, bndbzje = 0;
319
                 //子节点的值相加
319
                 //子节点的值相加
320
                 for (var j = 0; j < dataBudget1.length; j++) {
320
                 for (var j = 0; j < dataBudget1.length; j++) {
321
                     if (fj == dataBudget1[j].fj) {
321
                     if (fj == dataBudget1[j].fj) {
@@ -331,6 +331,12 @@
331
                         var t4 = parseFloat(dataBudget1[j].sjyzx);
331
                         var t4 = parseFloat(dataBudget1[j].sjyzx);
332
                         if (!isNaN(t4))
332
                         if (!isNaN(t4))
333
                             sjyzx += t4;
333
                             sjyzx += t4;
334
+                        var t5 = parseFloat(dataBudget1[j].bndsqje);
335
+                        if (!isNaN(t5))
336
+                            bndsqje += t5;
337
+                        var t6 = parseFloat(dataBudget1[j].bndbzje);
338
+                        if (!isNaN(t6))
339
+                            bndbzje += t6;
334
                     }
340
                     }
335
                 }
341
                 }
336
                 //更新父节点的值
342
                 //更新父节点的值
@@ -355,6 +361,15 @@
355
                         else
361
                         else
356
                             dataBudget1[j].ysje = ysje.toFixed(2);
362
                             dataBudget1[j].ysje = ysje.toFixed(2);
357
 
363
 
364
+                        if (bndsqje == 0)
365
+                            dataBudget1[j].bndsqje = "";
366
+                        else
367
+                            dataBudget1[j].bndsqje = bndsqje.toFixed(2);
368
+
369
+                        if (bndbzje == 0)
370
+                            dataBudget1[j].bndbzje = "";
371
+                        else
372
+                            dataBudget1[j].bndbzje = bndbzje.toFixed(2);
358
                         setFjBudget(dataBudget1[j].fj);
373
                         setFjBudget(dataBudget1[j].fj);
359
                         break;
374
                         break;
360
                     }
375
                     }