|  | @@ -36,13 +36,29 @@ module.exports = app => {
 | 
	
		
			
				|  |  |          constructor(ctx) {
 | 
	
		
			
				|  |  |              super(ctx);
 | 
	
		
			
				|  |  |              this.tableName = 'filing';
 | 
	
		
			
				|  |  | -            this.filingType = filingType;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          get allFilingType () {
 | 
	
		
			
				|  |  |              return filingType.map(x => { return x.value });
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        analysisFilingType(filing) {
 | 
	
		
			
				|  |  | +            const curFilingType = filing.filter(f => {
 | 
	
		
			
				|  |  | +                return f.tree_level === 1;
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  | +            curFilingType.sort((x, y) => {
 | 
	
		
			
				|  |  | +                return x.tree_order - y.tree_order;
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  | +            return curFilingType.map(f => {
 | 
	
		
			
				|  |  | +                return { value: f.filing_type, name: f.name }
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        async getFilingType(spid) {
 | 
	
		
			
				|  |  | +            const filing = await ctx.service.filing.getValidFiling(ctx.params.id, ctx.subProject.permission.filing_type);
 | 
	
		
			
				|  |  | +            return this.analysisFilingType(filing);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          async initFiling(spid, templateId, transaction) {
 | 
	
		
			
				|  |  |              const count = await this.count({ spid });
 | 
	
		
			
				|  |  |              if (count > 0) return;
 | 
	
	
		
			
				|  | @@ -76,7 +92,6 @@ module.exports = app => {
 | 
	
		
			
				|  |  |              return await this.getAllDataByCondition({ where: condition });
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |          async getPosterityData(id){
 | 
	
		
			
				|  |  |              const result = [];
 | 
	
		
			
				|  |  |              let cur = await this.getAllDataByCondition({ where: { tree_pid: id } });
 |