|  | @@ -1528,7 +1528,6 @@ const loadCooperationData = {
 | 
	
		
			
				|  |  |          return auditor.sign_path ? 'public/upload/sign/' + auditor.sign_path : '';
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      _loadImCooperationData(ctx, data, options, csRela) {
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |          let coSignOrder = [];
 | 
	
		
			
				|  |  |          if (csRela && csRela.tplDefine && csRela.tplDefine.audit_select && csRela.cDefine && csRela.cDefine.audit_select) {
 | 
	
		
			
				|  |  |              if (csRela.cDefine.audit_select) {
 | 
	
	
		
			
				|  | @@ -1569,14 +1568,71 @@ const loadCooperationData = {
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | +    _findStageAuditAss(relaId, stageAuditAss, auditor) {
 | 
	
		
			
				|  |  | +        if (!stageAuditAss || stageAuditAss.length === 0) return null;
 | 
	
		
			
				|  |  | +        if (relaId.length > 0) {
 | 
	
		
			
				|  |  | +            for (const id of relaId) {
 | 
	
		
			
				|  |  | +                const c = stageCooperation.find(x => { return x.ass_ledger_id.indexOf(id) >= 0; });
 | 
	
		
			
				|  |  | +                if (c) return c;
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            return null;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        return null;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    _loadImAssistData(ctx, data, options, csRela) {
 | 
	
		
			
				|  |  | +        let coSignOrder = [];
 | 
	
		
			
				|  |  | +        if (csRela && csRela.tplDefine && csRela.tplDefine.audit_select && csRela.cDefine && csRela.cDefine.audit_select) {
 | 
	
		
			
				|  |  | +            if (csRela.cDefine.audit_select) {
 | 
	
		
			
				|  |  | +                for (const asc of csRela.cDefine.audit_select) {
 | 
	
		
			
				|  |  | +                    coSignOrder.push(asc.order);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +            coSignOrder = options.co_sign || [];
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        const stageAuditAss = [];
 | 
	
		
			
				|  |  | +        let finish = true;
 | 
	
		
			
				|  |  | +        for (const sa of data.stage_audit) {
 | 
	
		
			
				|  |  | +            if (sa.end_time) stageAuditAss.push(data.mem_stage_audit_ass.filter(x => { return x.user_id === sa.aid; }));
 | 
	
		
			
				|  |  | +            if (finish && !sa.end_time) finish = false;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        for (const d of data[options.table]) {
 | 
	
		
			
				|  |  | +            const bills = data.mem_stage_bills.find(x => { return x.id === d.lid; });
 | 
	
		
			
				|  |  | +            const relaId = bills ? bills.full_path.split('-').reverse() : [];
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            d.ass = [];
 | 
	
		
			
				|  |  | +            for (const [i, sa] of data.stage_audit.entries()) {
 | 
	
		
			
				|  |  | +                const co = this._findStageAuditAss(relaId, stageAuditAss[i], sa);
 | 
	
		
			
				|  |  | +                d.ass.push(co);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            for (const [i, cs] of coSignOrder.entries()) {
 | 
	
		
			
				|  |  | +                if (data.stage_audit[cs] && data.stage_audit[cs].end_time) {
 | 
	
		
			
				|  |  | +                    d['co_sign' + (i + 1)] = this._completeSign(d.ass[cs] || data.stage_audit[cs]);
 | 
	
		
			
				|  |  | +                    d['co_opinion' + (i + 1)] = data.stage_audit[cs].opinion || '';
 | 
	
		
			
				|  |  | +                    d['co_time' + (i + 1)] = data.stage_audit[cs].end_time;
 | 
	
		
			
				|  |  | +                    d['co_name' + (i + 1)] = d.ass[cs] ? d.ass[cs].name : data.stage_audit[cs].name;
 | 
	
		
			
				|  |  | +                    d['co_company' + (i + 1)] = d.ass[cs] ? d.ass[cs].company : data.stage_audit[cs].company;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      fun(ctx, data, fieldsKey, options, csRela) {
 | 
	
		
			
				|  |  |          if (!options || !options.table) return;
 | 
	
		
			
				|  |  |          if (!data[options.table]) return;
 | 
	
		
			
				|  |  |          if (!data.mem_stage_bills) return;
 | 
	
		
			
				|  |  |          if (!data.stage_audit) return;
 | 
	
		
			
				|  |  | -        if (!data.ledger_cooperation) return;
 | 
	
		
			
				|  |  | +        if (!data.ledger_cooperation && !data.mem_stage_audit_ass) return;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        if (['mem_stage_im_zl', 'mem_stage_im_tz'].indexOf(options.table) >= 0) { this._loadImCooperationData(ctx, data, options, csRela); }
 | 
	
		
			
				|  |  | +        if (['mem_stage_im_zl', 'mem_stage_im_tz'].indexOf(options.table) >= 0) {
 | 
	
		
			
				|  |  | +            if (data.mem_stage_audit_ass) {
 | 
	
		
			
				|  |  | +                this._loadImAssistData(ctx, data, options, csRela);
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  | +                this._loadImCooperationData(ctx, data, options, csRela);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |  };
 | 
	
		
			
				|  |  |  const signSelect = {
 |