MaiXinRong 4 лет назад
Родитель
Сommit
50bb59b311
2 измененных файлов с 7 добавлено и 7 удалено
  1. 7 5
      app/service/stage_jgcl.js
  2. 0 2
      builder_report_index_define.js

+ 7 - 5
app/service/stage_jgcl.js

@@ -236,13 +236,14 @@ module.exports = app => {
                         && x.sorder && x.sorder === order;
                 });
                 if (his) {
+                    his.unit_price = d.unit_price;
                     his.arrive_qty = d.arrive_qty;
                     his.arrive_tp = d.arrive_tp;
                     his.deduct_qty = d.deduct_qty;
                     his.deduct_tp = d.deduct_tp;
                 } else {
                     history.push({
-                        stimes: times, sorder: order,
+                        stimes: times, sorder: order, unit_price: d.unit_price,
                         arrive_qty: d.arrive_qty, arrive_tp: d.arrive_tp,
                         deduct_qty: d.deduct_qty, deduct_tp: d.deduct_tp
                     });
@@ -287,14 +288,15 @@ module.exports = app => {
                 his.sort(function (x, y) {
                     return (x.stimes * 1000 + x.sorder) - (y.stimes * 1000 + y.sorder);
                 });
-                updateDatas.push({
+                const ud = {
                     id: d.id,
                     shistory: JSON.stringify(his),
                     arrive_qty: his.length > 0 ? his[his.length - 1].arrive_qty : null,
-                    arrive_tp: his.length > 0 ? his[his.length - 1].arrive_tp : null,
                     deduct_qty: his.length > 0 ? his[his.length - 1].deduct_qty : null,
-                    deduct_tp: his.length > 0 ? his[his.length - 1].deduct_tp : null,
-                });
+                    arrive_tp: his.length > 0 ? this.ctx.helper.mul(his[his.length - 1].arrive_qty, d.unit_price, this.ctx.tender.info.decimal.tp) : null,
+                    deduct_tp: his.length > 0 ? this.ctx.helper.mul(his[his.length - 1].deduct_qty, d.unit_price, this.ctx.tender.info.decimal.tp) : null,
+                };
+                updateDatas.push(ud);
             }
             await transaction.updateRows(this.tableName, updateDatas);
         }

+ 0 - 2
builder_report_index_define.js

@@ -187,8 +187,6 @@ const change = {
         { name: '金额_8', field: 'tp_8', type: dataType.currency, tag: { type: 'tp' } },
         { name: '金额_9', field: 'tp_9', type: dataType.currency, tag: { type: 'tp' } },
         { name: '附件名称列表', field: 'attNames', type: dataType.currency },
-        { name: '(空) 截止本期-已执行(%)', field: 'used_ratio', type: dataType.currency },
-        { name: '(空) 本期使用', field: 'is_used', type: dataType.int },
     ],
 };
 const change_bills = {