|  | @@ -31,7 +31,7 @@ const indexDbOprObj = {
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -    batchAdd: function (tbName, datas, cb) {
 | 
	
		
			
				|  |  | +    batchAdd: function (tbName, datas, signatureRelArr, cb) {
 | 
	
		
			
				|  |  |          let db =  indexDbOprObj.currentDb;
 | 
	
		
			
				|  |  |          let ttlAmt = datas.length;
 | 
	
		
			
				|  |  |          // console.log(`已选报表数量:${ttlAmt}`);
 | 
	
	
		
			
				|  | @@ -43,7 +43,7 @@ const indexDbOprObj = {
 | 
	
		
			
				|  |  |                  cnt++;
 | 
	
		
			
				|  |  |                  // console.log(`已选加数量:${cnt}`);
 | 
	
		
			
				|  |  |                  if (cnt === ttlAmt && cb) {
 | 
	
		
			
				|  |  | -                    cb(datas);
 | 
	
		
			
				|  |  | +                    cb(datas, signatureRelArr);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |              };
 | 
	
		
			
				|  |  |          }
 | 
	
	
		
			
				|  | @@ -93,7 +93,7 @@ const indexDbOprObj = {
 | 
	
		
			
				|  |  |                      let data = {id: keyStr, name: node.name, rpt_id: node.refId, stage_id, gather_select, stage_select, pageSize: rptControlObj.getCurrentPageSize(), CFG: CUST_CFG};
 | 
	
		
			
				|  |  |                      datas.push(data);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -                indexDbOprObj.batchAdd(this.tb_name_request, datas, (rstArr)=>{
 | 
	
		
			
				|  |  | +                indexDbOprObj.batchAdd(this.tb_name_request, datas, [], (rstArr)=>{
 | 
	
		
			
				|  |  |                      console.log('batch add succeeded!');
 | 
	
		
			
				|  |  |                      console.log(rstArr);
 | 
	
		
			
				|  |  |                      //其他操作
 | 
	
	
		
			
				|  | @@ -141,10 +141,10 @@ const indexDbOprObj = {
 | 
	
		
			
				|  |  |              await rptCustomObj.getCustomSelect(params);
 | 
	
		
			
				|  |  |              // params.customSelect = [];
 | 
	
		
			
				|  |  |              params.needWaterMark = needWaterMark;
 | 
	
		
			
				|  |  | -            indexDbOprObj._getRptDataForDb(params, rpt_names, stage_id, (records)=>{
 | 
	
		
			
				|  |  | +            indexDbOprObj._getRptDataForDb(params, rpt_names, stage_id, (records, rstRoleRel)=>{
 | 
	
		
			
				|  |  |                  console.log('the normal type page results have been saved!');
 | 
	
		
			
				|  |  |                  // console.log(records);
 | 
	
		
			
				|  |  | -                _createPDF(0, records, rptNodes, ()=>{
 | 
	
		
			
				|  |  | +                _createPDF(0, records, rptNodes, rstRoleRel, ()=>{
 | 
	
		
			
				|  |  |                      console.log('the normal type archive PDFs have been created!');
 | 
	
		
			
				|  |  |                      let ids = [];
 | 
	
		
			
				|  |  |                      for (let rec of records) {
 | 
	
	
		
			
				|  | @@ -156,7 +156,7 @@ const indexDbOprObj = {
 | 
	
		
			
				|  |  |                  });
 | 
	
		
			
				|  |  |              });
 | 
	
		
			
				|  |  |          };
 | 
	
		
			
				|  |  | -        const _requestGatherReport = function() {
 | 
	
		
			
				|  |  | +        const _requestGatherReport = function(rstRoleRel) {
 | 
	
		
			
				|  |  |              if (gather_request.length > 0) {
 | 
	
		
			
				|  |  |                  let refRptTplIds = [], rpt_names = [];
 | 
	
		
			
				|  |  |                  for (let req of gather_request) {
 | 
	
	
		
			
				|  | @@ -167,10 +167,10 @@ const indexDbOprObj = {
 | 
	
		
			
				|  |  |                  let params = rptControlObj.creatCommonExportParam(refRptTplIds);
 | 
	
		
			
				|  |  |                  params.customSelect = [];
 | 
	
		
			
				|  |  |                  params.needWaterMark = needWaterMark;
 | 
	
		
			
				|  |  | -                indexDbOprObj._getRptDataForDb(params, rpt_names, stage_id, (records)=>{
 | 
	
		
			
				|  |  | +                indexDbOprObj._getRptDataForDb(params, rpt_names, stage_id, (records, rstRoleRel)=>{
 | 
	
		
			
				|  |  |                      console.log('the normal type page results have been saved!');
 | 
	
		
			
				|  |  |                      // console.log(records);
 | 
	
		
			
				|  |  | -                    _createPDF(0, records, rptNodes, ()=>{
 | 
	
		
			
				|  |  | +                    _createPDF(0, records, rptNodes, rstRoleRel, ()=>{
 | 
	
		
			
				|  |  |                          console.log('the normal type archive PDFs have been created!');
 | 
	
		
			
				|  |  |                          let ids = [];
 | 
	
		
			
				|  |  |                          for (let rec of records) {
 | 
	
	
		
			
				|  | @@ -287,8 +287,8 @@ const indexDbOprObj = {
 | 
	
		
			
				|  |  |                      let data = {id: keyStr, rpt_id: params.rpt_ids[idx], rpt_name: rpt_names[idx], stage_id, pageData: multiRptData[idx]};
 | 
	
		
			
				|  |  |                      datas.push(data);
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  | -                indexDbOprObj.batchAdd(indexDbOprObj.tb_name_page, datas, (rstArr)=>{
 | 
	
		
			
				|  |  | -                    cb(rstArr);
 | 
	
		
			
				|  |  | +                indexDbOprObj.batchAdd(indexDbOprObj.tb_name_page, datas, signatureRelArr, (rstArr, rstRoleRel)=>{
 | 
	
		
			
				|  |  | +                    cb(rstArr, rstRoleRel);
 | 
	
		
			
				|  |  |                  });
 | 
	
		
			
				|  |  |              },
 | 
	
		
			
				|  |  |              function(failRst){
 | 
	
	
		
			
				|  | @@ -306,19 +306,21 @@ const indexDbOprObj = {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -function _createPDF(currentIdx, records, rptNodes, cb) {
 | 
	
		
			
				|  |  | +function _createPDF(currentIdx, records, rptNodes, rstRoleRel, cb) {
 | 
	
		
			
				|  |  |      if (currentIdx === records.length) {
 | 
	
		
			
				|  |  |          if (cb) {
 | 
	
		
			
				|  |  |              cb();
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |      } else {
 | 
	
		
			
				|  |  |          let rec = records[currentIdx];
 | 
	
		
			
				|  |  | +        let curRoleRel = rstRoleRel[currentIdx];
 | 
	
		
			
				|  |  |          let nextIdx = currentIdx + 1;
 | 
	
		
			
				|  |  |          indexDbOprObj.getOne(indexDbOprObj.tb_name_page, rec.id, (record)=>{
 | 
	
		
			
				|  |  |              for (let node of rptNodes) {
 | 
	
		
			
				|  |  |                  if (node.refId === record.rpt_id) {
 | 
	
		
			
				|  |  | -                    rptArchiveObj.archiveCurrentReport(record.pageData, node, (err, msg, uuid)=>{
 | 
	
		
			
				|  |  | -                        _createPDF(nextIdx, records, rptNodes, cb);
 | 
	
		
			
				|  |  | +                    // curRoleRel
 | 
	
		
			
				|  |  | +                    rptArchiveObj.archiveCurrentReport(record.pageData, node, curRoleRel, (err, msg, uuid)=>{
 | 
	
		
			
				|  |  | +                        _createPDF(nextIdx, records, rptNodes, rstRoleRel, cb);
 | 
	
		
			
				|  |  |                      });
 | 
	
		
			
				|  |  |                      break;
 | 
	
		
			
				|  |  |                  }
 |