소스 검색

导入问题

MaiXinRong 3 년 전
부모
커밋
d3a48b8f15
2개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 2
      app/lib/analysis_excel.js
  2. 4 2
      app/service/ledger.js

+ 1 - 2
app/lib/analysis_excel.js

@@ -548,8 +548,7 @@ class AnalysisExcelTree {
             node.unit = this.ctx.helper.replaceReturn(row[this.colsDef.unit]);
             node.dgn_qty1 = aeUtils.toNumber(row[this.colsDef.dgn_qty1]);
             node.dgn_qty2 = aeUtils.toNumber(row[this.colsDef.dgn_qty2]);
-            // 2022-6-9 曾沛文要求不导入金额
-            //node.total_price = this.ctx.helper.round(aeUtils.toNumber(row[this.colsDef.total_price]), this.decimal.tp);
+            node.total_price = this.ctx.helper.round(aeUtils.toNumber(row[this.colsDef.total_price]), this.decimal.tp);
             node.drawing_code = this.ctx.helper.replaceReturn(row[this.colsDef.drawing_code]);
             node.memo = this.ctx.helper.replaceReturn(row[this.colsDef.memo]);
             return this.cacheTree.addXmjNode(node);

+ 4 - 2
app/service/ledger.js

@@ -712,14 +712,16 @@ module.exports = app => {
                         drawing_code: node.drawing_code,
                         node_type: node.node_type,
                     };
+                    // 项目节不导入金额
+                    // todo 最底层项目节其实应该导入,但是由于目前项目节不能输入金额,也不能计量,导入金额就会有矛盾,故暂时不导入
                     if (this.ctx.tender.data.measure_type === measureType.tz.value) {
                         data.sgfh_qty = node.quantity;
                         data.sgfh_tp = node.total_price;
                         data.quantity = node.quantity;
-                        data.total_price = node.total_price;
+                        data.total_price = node.b_code ? node.total_price : 0;
                     } else if (this.ctx.tender.data.measure_type === measureType.gcl.value) {
                         data.deal_qty = node.quantity;
-                        data.deal_tp = node.total_price;
+                        data.deal_tp = node.b_code ? node.total_price : 0;
                     }
                     datas.push(data);
                 }