瀏覽代碼

Merge branch 'dev' into uat

MaiXinRong 3 年之前
父節點
當前提交
e91ce5ef8d
共有 3 個文件被更改,包括 13 次插入9 次删除
  1. 1 1
      app/const/spread.js
  2. 11 7
      app/lib/analysis_excel.js
  3. 1 1
      app/service/stage_stash.js

+ 1 - 1
app/const/spread.js

@@ -472,7 +472,7 @@ const stageGather = {
             {title: '截止本期计量数量|合同', colSpan: '4|1', rowSpan: '1|1', field: 'end_contract_qty', hAlign: 2, width: 60, type: 'Number'},
             {title: '|数量变更', colSpan: '|1', rowSpan: '|1', field: 'end_qc_qty', hAlign: 2, width: 60, type: 'Number'},
             {title: '|完成', colSpan: '|1', rowSpan: '|1', field: 'end_gather_qty', hAlign: 2, width: 60, type: 'Number'},
-            {title: '|完成率(%)', colSpan: '1', rowSpan: '|1', field: 'end_final_1_percent', hAlign: 2, width: 80, type: 'Number'},
+            {title: '|完成率(%)', colSpan: '1', rowSpan: '|1', field: 'end_final_1_percent', hAlign: 2, width: 80, type: 'Number', visible: false},
             {title: '单位工程', colSpan: '1', rowSpan: '2', field: 'dwgc', hAlign: 0, width: 80, formatter: '@'},
             {title: '分部工程', colSpan: '1', rowSpan: '2', field: 'fbgc', hAlign: 0, width: 80, formatter: '@'},
             {title: '分项工程', colSpan: '1', rowSpan: '2', field: 'fxgc', hAlign: 0, width: 80, formatter: '@'},

+ 11 - 7
app/lib/analysis_excel.js

@@ -939,13 +939,17 @@ class AnalysisStageExcelTree extends AnalysisExcelTree {
             node.name = this.ctx.helper.replaceReturn(this.ctx.helper._.trimEnd(row[this.colsDef.name]));
             node.unit = this.ctx.helper.replaceReturn(this.ctx.helper._.trimEnd(row[this.colsDef.unit]));
             const xmj = this.cacheTree.addXmjNode(node);
-            xmj.deal_dgn_qty1 = aeUtils.toNumber(row[this.colsDef.deal_dgn_qty1]);
-            xmj.deal_dgn_qty2 = aeUtils.toNumber(row[this.colsDef.deal_dgn_qty2]);
-            xmj.c_dgn_qty1 = aeUtils.toNumber(row[this.colsDef.c_dgn_qty1]);
-            xmj.c_dgn_qty2 = aeUtils.toNumber(row[this.colsDef.c_dgn_qty2]);
-            xmj.postil = this.ctx.helper.replaceReturn(row[this.colsDef.postil]);
-            this.ctx.helper.checkDgnQtyPrecision(xmj);
-            return xmj;
+            if (xmj) {
+                xmj.deal_dgn_qty1 = aeUtils.toNumber(row[this.colsDef.deal_dgn_qty1]);
+                xmj.deal_dgn_qty2 = aeUtils.toNumber(row[this.colsDef.deal_dgn_qty2]);
+                xmj.c_dgn_qty1 = aeUtils.toNumber(row[this.colsDef.c_dgn_qty1]);
+                xmj.c_dgn_qty2 = aeUtils.toNumber(row[this.colsDef.c_dgn_qty2]);
+                xmj.postil = this.ctx.helper.replaceReturn(row[this.colsDef.postil]);
+                this.ctx.helper.checkDgnQtyPrecision(xmj);
+                return xmj;
+            } else {
+                return null;
+            }
         } catch (error) {
             if (error.stack) {
                 this.ctx.logger.error(error);

+ 1 - 1
app/service/stage_stash.js

@@ -97,7 +97,7 @@ class loadStageExcelTree {
             const contract_qty = source.is_tp ? 0 : node.contract_qty;
             const contract_tp = contract_qty
                 ? this.ctx.helper.mul(contract_qty, source.unit_price, this.decimal.tp)
-                : this.ctx.helper.round(node.contract_tp, this.decimal.tp);
+                : source.is_tp ? this.ctx.helper.round(node.contract_tp, this.decimal.tp) : 0;
 
             if (curStageBills) {
                 this.updateBills.push({ id: curStageBills.id, contract_qty: contract_qty, contract_tp: contract_tp, postil: node.postil || curStageBills.postil || '' });