|
@@ -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;
|