Browse Source

材差报表相关

MaiXinRong 1 năm trước cách đây
mục cha
commit
d566e8cd56
1 tập tin đã thay đổi với 16 bổ sung0 xóa
  1. 16 0
      app/lib/rm/material.js

+ 16 - 0
app/lib/rm/material.js

@@ -305,6 +305,8 @@ class rptMemChange extends RptMemBase {
                 return [this.ctx.tender.data];
             case 'mem_tender_info':
                 return [this.ctx.tender.info];
+            case 'mem_deal_bills':
+                return this.ctx.service.dealBills.getAllDataByCondition({ where: { tender_id: this.ctx.tender.id } });
             case 'mem_material':
                 return [this.ctx.material];
             case 'mem_material_audit':
@@ -326,6 +328,20 @@ class rptMemChange extends RptMemBase {
         }
     }
 
+    getMaterialCalcQty(qtySource, info, is_join) {
+        let qty = 0;
+        switch(qtySource) {
+            case materialConst.qty_source_value.gather_qty: qty = info.gather_qty; break;
+            case materialConst.qty_source_value.contract_qty: qty = info.contract_qty; break;
+            case materialConst.qty_source_value.gather_minus_qty: qty = info.gather_minus_qty; break;
+            default: throw '未配置计量来源';
+        }
+        if (qtySource !== materialConst.qty_source_value.contract_qty && is_join === 2) {
+            qty = info.contract_qty;
+        }
+        return qty;
+    }
+
     async _getMaterialStageGatherBills(tender_id, stage_id, stage_order, stageSelf, stageIndex = 0) {
         const decimal = this.materialGatherBase.decimal;
         const billsData = this.materialGatherBase.billsData;