Jelajahi Sumber

新增安全生产费期,跳转问题

MaiXinRong 1 tahun lalu
induk
melakukan
2768553d99
2 mengubah file dengan 11 tambahan dan 1 penghapusan
  1. 6 0
      app/lib/rm/payment_safe.js
  2. 5 1
      app/public/js/payment_list.js

+ 6 - 0
app/lib/rm/payment_safe.js

@@ -65,17 +65,23 @@ class rptMemPaymentSafe extends RptMemBase {
         };
         for (const d of datas) {
             if (!d.tree_is_leaf) continue;
+            d.his_qty = [];
+            d.his_tp = [];
             d.cur_his.sort((x, y) => { return x.times === y.times ? x.order - y.order : x.times - y.times; });
             for (const r of roles) {
                 if (r.latest) {
                     d[`qty_${r.order}`] = d.cur_qty;
                     d[`tp_${r.order}`] = d.cur_tp;
+                    d.his_qty.push(d.cur_qty);
+                    d.his_tp.push(d.cur_tp);
                 } else {
                     const rHis = findHis(r, d.cur_his);
                     if (rHis) {
                         d[`qty_${r.order}`] = rHis.qty;
                         d[`tp_${r.order}`] = rHis.tp;
                     }
+                    d.his_qty.push(rHis ? rHis.qty : 0);
+                    d.his_tp.push(rHis ? rHis.tp : 0);
                 }
             }
         }

+ 5 - 1
app/public/js/payment_list.js

@@ -155,7 +155,11 @@ $(function () {
         }
         console.log($('#add-detail-time').val());
         postData('/payment/' + tenderId + '/list/' + trId + '/save', { type: 'add-detail', code: _.trim($('#add-detail-code').val()), s_time: $('#add-detail-time').val() }, function (result) {
-            window.location.href = '/payment/' + tenderId + '/detail/' + result.id;
+            if (result.type) {
+                window.location.href = '/payment/' + tenderId + '/safe/' + result.id + '/bills';
+            } else {
+                window.location.href = '/payment/' + tenderId + '/detail/' + result.id;
+            }
         });
     });