Browse Source

奖罚金,未分类相关

MaiXinRong 2 năm trước cách đây
mục cha
commit
08a0a4b0e8
1 tập tin đã thay đổi với 9 bổ sung0 xóa
  1. 9 0
      app/public/js/se_bonus.js

+ 9 - 0
app/public/js/se_bonus.js

@@ -289,6 +289,7 @@ $(document).ready(() => {
         sum () {
             const result = [];
             const sum = { name: '合计', positive_tp: 0, negative_tp: 0 };
+            const other = { name: '未分类', positive_tp: 0, negative_tp: 0 };
             for (const d of this.displayData) {
                 if (d.b_type) {
                     let type = result.find(x => { return d.b_type === x.name; });
@@ -301,6 +302,13 @@ $(document).ready(() => {
                     } else {
                         type.negative_tp = ZhCalc.add(type.negative_tp, d.tp);
                     }
+                } else {
+                    other.show = true;
+                    if (d.tp >= 0) {
+                        other.positive_tp = ZhCalc.add(other.positive_tp, d.tp);
+                    } else {
+                        other.negative_tp = ZhCalc.add(other.negative_tp, d.tp);
+                    }
                 }
                 if (d.tp >= 0) {
                     sum.positive_tp = ZhCalc.add(sum.positive_tp, d.tp);
@@ -308,6 +316,7 @@ $(document).ready(() => {
                     sum.negative_tp = ZhCalc.add(sum.negative_tp, d.tp);
                 }
             }
+            if (other.show) result.push(other);
             result.push(sum);
             result.forEach(x => { x.tp = ZhCalc.add(x.positive_tp, x.negative_tp); });
             return result;