瀏覽代碼

工程量清单汇总调整

MaiXinRong 4 年之前
父節點
當前提交
96e027eade
共有 2 個文件被更改,包括 5 次插入6 次删除
  1. 0 1
      app/extend/helper.js
  2. 5 5
      app/lib/gcl_gather.js

+ 0 - 1
app/extend/helper.js

@@ -549,7 +549,6 @@ module.exports = {
         // 检查文件夹是否存在,不存在则直接创建文件夹
         const pathName = path.dirname(fileName);
         if (!fs.existsSync(pathName)) {
-            console.log('11111');
             await this.recursiveMkdirSync(pathName);
         }
         await fs.writeFileSync(fileName, buffer);

+ 5 - 5
app/lib/gcl_gather.js

@@ -1,7 +1,5 @@
 'use strict';
 
-const { x } = require("pdfkit");
-
 /**
  *
  * 清单汇总
@@ -12,6 +10,7 @@ const { x } = require("pdfkit");
  */
 
 const mergeChar = ';';
+const Ledger = require('./ledger');
 
 const gclGatherModel = class {
 
@@ -101,7 +100,7 @@ const gclGatherModel = class {
                 return node;
             } else {
                 const parent = this.billsTree.getParent(node);
-                return parent ? getPegNode(parent) : null;
+                return parent ? this.getPegNode(parent) : null;
             }
         }
     }
@@ -217,7 +216,7 @@ const gclGatherModel = class {
      * @returns {Object} 最底层项目缓存数据
      */
     getCacheLeafXmj(leafXmj) {
-        const cacheLX = leafXmjs.find(lx => { return lx.id === leafXmj.id; });
+        const cacheLX = this.leafXmjs.find(lx => { return lx.id === leafXmj.id; });
         if (!cacheLX) {
             return this.newCacheLeafXmj(leafXmj);
         } else {
@@ -232,6 +231,7 @@ const gclGatherModel = class {
      * @param {*} leafXmj node所属的最底层项目节
      */
     loadGatherGclNode(node, leafXmj) {
+        const helper = this.ctx.helper;
         const gcl = this.getGclNode(node);
         for (const prop in node) {
             if (prop === 'quantity' || prop === 'total_price' || prop.indexOf('qty') >= 0 || prop.indexOf('tp') >= 0) {
@@ -242,7 +242,7 @@ const gclGatherModel = class {
         const posRange = this.pos.getLedgerPos(node.id);
 
         const loadLeafXmj = function (detail, calcSource) {
-            const dx = _.assign({}, cacheLeafXmj);
+            const dx = helper._.assign({}, cacheLeafXmj);
             dx.gcl_id = gcl.id;
             if (detail.name !== node.name) {
                 dx.bwmx = detail.name;