| 
					
				 | 
			
			
				@@ -180,7 +180,7 @@ module.exports = app => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     // 如果存在本期计算数据,更新计算清单本期计量数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     if (d.contract_qty || d.qc_qty || d.postil) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         const ps = { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            pid: d.id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            pid: p.id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             lid: d.lid, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             tid: this.ctx.tender.id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             sid: this.ctx.stage.id, 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -191,7 +191,7 @@ module.exports = app => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         if (d.contract_qty) ps.contract_qty = this.round(d.contract_qty, precision.value); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         if (d.qc_qty) ps.qc_qty = this.round(d.qc_qty, precision.value); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         if (d.postil) ps.postil = d.postil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        await transaction.insert(ps); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        await transaction.insert(this.tableName, ps); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         if (d.contract_qty || d.qc_qty) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             calcStageBills.push(ps.lid); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -202,7 +202,7 @@ module.exports = app => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     await this.ctx.service.ledger.calc(this.ctx.tender.id, lid, transaction); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 for (const lid of calcStageBills) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    await this.ctx.service.stageBills.calc(ctx.tender.id, ctx.stage.id, lid, transaction); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    await this.ctx.service.stageBills.calc(this.ctx.tender.id, this.ctx.stage.id, lid, transaction); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 await transaction.commit(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return result; 
			 |