|
|
@@ -107,7 +107,11 @@ module.exports = app => {
|
|
|
rootId: -1,
|
|
|
keys: ['id', 'tender_id', 'ledger_id'],
|
|
|
stageId: 'id',
|
|
|
- calcFields: calcFields || ['deal_tp', 'total_price', 'contract_tp', 'qc_tp', 'contract_pc_tp', 'qc_pc_tp', 'pc_tp', 'gather_tp', 'pre_contract_tp', 'pre_qc_tp', 'pre_gather_tp', 'final_1_tp'],
|
|
|
+ calcFields: calcFields || ['deal_tp', 'total_price',
|
|
|
+ 'contract_tp', 'qc_tp', 'contract_pc_tp', 'qc_pc_tp', 'pc_tp', 'gather_tp',
|
|
|
+ 'pre_contract_tp', 'pre_qc_tp', 'pre_gather_tp', 'final_1_tp',
|
|
|
+ 'end_contract_pc_tp', 'end_qc_pc_tp', 'end_pc_tp',
|
|
|
+ ],
|
|
|
calc: function (node, helper, decimal) {
|
|
|
if (node.children && node.children.length === 0) {
|
|
|
node.pre_gather_qty = helper.add(node.pre_contract_qty, node.pre_qc_qty);
|
|
|
@@ -410,9 +414,18 @@ module.exports = app => {
|
|
|
this.ctx.helper.assignRelaData(billsData, [
|
|
|
{ data: curStage, fields: ['contract_qty', 'contract_tp', 'contract_expr', 'qc_qty', 'qc_tp', 'qc_minus_qty', 'postil'], prefix: '', relaId: 'lid' },
|
|
|
{ data: preStage, fields: ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'qc_minus_qty'], prefix: 'pre_', relaId: 'lid' },
|
|
|
- { data: bpcStage, fields: ['contract_pc_tp', 'qc_pc_tp', 'pc_tp'], prefix: '', relaId: 'lid' },
|
|
|
- { data: endBpcStage, fields: ['end_contract_pc_tp', 'end_qc_pc_tp', 'end_pc_tp'], prefix: '', relaId: 'lid' },
|
|
|
+ { data: bpcStage, fields: ['contract_pc_tp', 'qc_pc_tp', 'pc_tp', 'org_price'], prefix: '', relaId: 'lid' },
|
|
|
+ { data: endBpcStage, fields: ['end_contract_pc_tp', 'end_qc_pc_tp', 'end_pc_tp', 'org_price_his'], prefix: '', relaId: 'lid' },
|
|
|
]);
|
|
|
+ billsData.forEach(x => {
|
|
|
+ if (x.org_price_his && x.org_price_his.length > 0) {
|
|
|
+ for (const prop of x.org_price_his) {
|
|
|
+ x[`org_price_${prop}`] = x.org_price_his[prop];
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ x.org_price_0 = x.unit_price;
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
const billsTree = this._getNewBillsTree();
|
|
|
billsTree.loadDatas(billsData);
|
|
|
@@ -561,9 +574,18 @@ module.exports = app => {
|
|
|
|
|
|
this.ctx.helper.assignRelaData(billsData, [
|
|
|
{data: preStage, fields: ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'qc_minus_qty'], prefix: 'pre_', relaId: 'lid'},
|
|
|
- { data: bpcStage, fields: ['contract_pc_tp', 'qc_pc_tp', 'pc_tp'], prefix: '', relaId: 'lid' },
|
|
|
- { data: endBpcStage, fields: ['end_contract_pc_tp', 'end_qc_pc_tp', 'end_pc_tp'], prefix: '', relaId: 'lid' },
|
|
|
+ { data: bpcStage, fields: ['contract_pc_tp', 'qc_pc_tp', 'pc_tp', 'org_price'], prefix: '', relaId: 'lid' },
|
|
|
+ { data: endBpcStage, fields: ['end_contract_pc_tp', 'end_qc_pc_tp', 'end_pc_tp', 'org_price_his'], prefix: '', relaId: 'lid' },
|
|
|
]);
|
|
|
+ billsData.forEach(x => {
|
|
|
+ if (x.org_price_his && x.org_price_his.length > 0) {
|
|
|
+ for (const prop of x.org_price_his) {
|
|
|
+ x[`org_price_${prop}`] = x.org_price_his[prop];
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ x.org_price_0 = x.unit_price;
|
|
|
+ }
|
|
|
+ });
|
|
|
const billsTree = this._getNewBillsTree();
|
|
|
billsTree.loadDatas(billsData);
|
|
|
|