| 
					
				 | 
			
			
				@@ -624,8 +624,8 @@ module.exports = app => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         async loadGatherData(ctx) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 const settle = await this.ctx.service.settle.getLatestCompleteSettle(ctx.tender.id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                const bills = await this.ctx.service.settleBills.getAllDataByCondition({ where: { settle_id: settle.id }}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                const pos = await this.ctx.service.settlePos.getAllDataByCondition({ where: { settle_id: settle.id }}); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                const bills = settle ? await this.ctx.service.settleBills.getAllDataByCondition({ where: { settle_id: settle.id }}) : []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                const pos = settle ? await this.ctx.service.settlePos.getAllDataByCondition({ where: { settle_id: settle.id }}) : []; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 ctx.body = { err: 0, msg: '', data: { bills, pos } }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } catch(err) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 ctx.log(err); 
			 |