Browse Source

小数位数相关

MaiXinRong 6 months ago
parent
commit
5c7d150859
2 changed files with 4 additions and 2 deletions
  1. 2 2
      app/lib/analysis_excel.js
  2. 2 0
      app/service/ledger.js

+ 2 - 2
app/lib/analysis_excel.js

@@ -572,8 +572,8 @@ class AnalysisExcelTree {
             node.code = _.trimEnd(this.ctx.helper.replaceReturn(row[this.colsDef.code]));
             node.name = this.ctx.helper.replaceReturn(row[this.colsDef.name]);
             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]);
+            node.dgn_qty1 = this.ctx.helper.round(aeUtils.toNumber(row[this.colsDef.dgn_qty1]), 3);
+            node.dgn_qty2 = this.ctx.helper.round(aeUtils.toNumber(row[this.colsDef.dgn_qty2]), 3);
             node.deal_tp = this.ctx.helper.round(aeUtils.toNumber(row[this.colsDef.deal_tp]), 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]);

+ 2 - 0
app/service/ledger.js

@@ -712,6 +712,8 @@ module.exports = app => {
                 id: 'ledger_id', pid: 'ledger_pid', order: 'order', full_path: 'full_path', level: 'level', rootId: -1,
                 calcFields: [ 'total_price' ],
                 calc(node, helper, decimal) {
+                    node.dgn_qty1 = helper.round(node.dgn_qty1, 3);
+                    node.dgn_qty2 = helper.round(node.dgn_qty2, 3);
                     helper.checkDgnQtyPrecision(node);
                     const precision = helper.findPrecision(tender.info.precision, node.unit);
                     node.quantity = helper.round(node.quantity, precision.value);