|
@@ -263,12 +263,12 @@ class StageIm {
|
|
|
const memo = [];
|
|
|
for (const [i, b] of im.gclBills.entries()) {
|
|
|
if (b.pos && b.pos.length > 0) {
|
|
|
- memo.push('清单' + (i+1) + b.b_code + ' ' + b.name);
|
|
|
+ memo.push('清单' + (i+1) + ':' + b.b_code + ' ' + b.name);
|
|
|
for (const p of b.pos) {
|
|
|
memo.push(p.name + ':' + p.jl + ' ' + b.unit);
|
|
|
}
|
|
|
} else {
|
|
|
- memo.push('清单' + (i+1) + b.b_code + ' ' + b.name + ':' + b.jl + ' ' + b.unit);
|
|
|
+ memo.push('清单' + (i+1) + ':' + b.b_code + ' ' + b.name + ':' + b.jl + ' ' + b.unit);
|
|
|
}
|
|
|
}
|
|
|
im.calc_memo = memo.join('\n');
|
|
@@ -303,37 +303,43 @@ class StageIm {
|
|
|
lp.qc_jl = this.ctx.helper.add(lp.qc_jl, p.qc_qty);
|
|
|
}
|
|
|
}
|
|
|
+ _recursiveGenerateTzGclBills(node, im) {
|
|
|
+ for (const p of node.children) {
|
|
|
+ if (p.children && p.children.length > 0) {
|
|
|
+ this._recursiveGenerateTzGclBills(p, im);
|
|
|
+ } else {
|
|
|
+ if ((!p.b_code || p.b_code === '') || (p.children && p.children.length > 0)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if ((!p.contract_tp || p.contract_tp === 0) && (!p.qc_tp || p.qc_tp === 0)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ let b = this._.find(im.gclBills, {bid: p.id});
|
|
|
+ if (!b) {
|
|
|
+ b = {imid: im.id, bid: p.id, b_code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price};
|
|
|
+ im.gclBills.push(b);
|
|
|
+ this.ImBillsData.push(b);
|
|
|
+ }
|
|
|
+ b.jl = this.ctx.helper.add(b.jl, p.gather_qty);
|
|
|
+ b.contract_jl = this.ctx.helper.add(b.contract_jl, p.contract_qty);
|
|
|
+ b.qc_jl = this.ctx.helper.add(b.qc_jl, p.qc_qty);
|
|
|
+
|
|
|
+ b.pre_jl = this.ctx.helper.add(b.pre_jl, p.pre_gather_qty);
|
|
|
+ b.pre_contract_jl = this.ctx.helper.add(b.pre_contract_jl, p.pre_contract_qty);
|
|
|
+ b.pre_qc_jl = this.ctx.helper.add(b.pre_qc_jl, p.pre_qc_qty);
|
|
|
+
|
|
|
+ b.end_jl = this.ctx.helper.add(b.end_jl, p.end_gather_qty);
|
|
|
+ b.end_contract_jl = this.ctx.helper.add(b.end_contract_jl, p.end_contract_qty);
|
|
|
+ b.end_qc_jl = this.ctx.helper.add(b.end_qc_jl, p.end_qc_qty);
|
|
|
+ this._generateTzPosData(p, b);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
_generateTzGclBillsData(node, im) {
|
|
|
if (!im.gclBills) {
|
|
|
im.gclBills = [];
|
|
|
}
|
|
|
- const posterity = this.billsTree.getPosterity(node);
|
|
|
- for (const p of posterity) {
|
|
|
- if ((!p.b_code || p.b_code === '') || (p.children && p.children.length > 0)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- if ((!p.contract_tp || p.contract_tp === 0) && (!p.qc_tp || p.qc_tp === 0)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- let b = this._.find(im.gclBills, {bid: p.id});
|
|
|
- if (!b) {
|
|
|
- b = {imid: im.id, bid: p.id, b_code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price};
|
|
|
- im.gclBills.push(b);
|
|
|
- this.ImBillsData.push(b);
|
|
|
- }
|
|
|
- b.jl = this.ctx.helper.add(b.jl, p.gather_qty);
|
|
|
- b.contract_jl = this.ctx.helper.add(b.contract_jl, p.contract_qty);
|
|
|
- b.qc_jl = this.ctx.helper.add(b.qc_jl, p.qc_qty);
|
|
|
-
|
|
|
- b.pre_jl = this.ctx.helper.add(b.pre_jl, p.pre_gather_qty);
|
|
|
- b.pre_contract_jl = this.ctx.helper.add(b.pre_contract_jl, p.pre_contract_qty);
|
|
|
- b.pre_qc_jl = this.ctx.helper.add(b.pre_qc_jl, p.pre_qc_qty);
|
|
|
-
|
|
|
- b.end_jl = this.ctx.helper.add(b.end_jl, p.end_gather_qty);
|
|
|
- b.end_contract_jl = this.ctx.helper.add(b.end_contract_jl, p.end_contract_qty);
|
|
|
- b.end_qc_jl = this.ctx.helper.add(b.end_qc_jl, p.end_qc_qty);
|
|
|
- this._generateTzPosData(p, b);
|
|
|
- }
|
|
|
+ this._recursiveGenerateTzGclBills(node, im);
|
|
|
}
|
|
|
_generateTzChangeData(node, im) {
|
|
|
if (!im.changes) {
|