Переглянути джерело

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

lgl 6 місяців тому
батько
коміт
7b383e570a

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

@@ -315,7 +315,7 @@
315 315
         //父级预算
316 316
         function setFjBudget(fj) {
317 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 320
                 for (var j = 0; j < dataBudget1.length; j++) {
321 321
                     if (fj == dataBudget1[j].fj) {
@@ -331,6 +331,12 @@
331 331
                         var t4 = parseFloat(dataBudget1[j].sjyzx);
332 332
                         if (!isNaN(t4))
333 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 361
                         else
356 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 373
                         setFjBudget(dataBudget1[j].fj);
359 374
                         break;
360 375
                     }