Sfoglia il codice sorgente

BUG #3678 补漏 -> TASK #4254 / 4253

Tony Kang 1 anno fa
parent
commit
baa9519100
2 ha cambiato i file con 12 aggiunte e 7 eliminazioni
  1. 3 3
      app/controller/report_controller.js
  2. 9 4
      app/public/report/js/rpt_main.js

+ 3 - 3
app/controller/report_controller.js

@@ -1662,7 +1662,7 @@ function mergeTextSignature(isTxtSignature, status, pageData, singleRoleRel, rpt
                         let needTransferText = true;
                         for (const role_rel of roleRelContent) {
                             if (sCell.signature_name === role_rel.signature_name) {
-                                if (!checkAudit || _chkIfAudit(role_rel, stgAudit, stageList)) {
+                                if (!checkAudit || _chkIfAudit(role_rel, stgAudit || [], stageList || [])) {
                                     sCell.Value = role_rel.user_name; // 只有审核通过了才需要文本签名内容
                                     if (role_rel.sign_output && role_rel.sign_output.indexOf(NORMAL_SIGN_STR) < 0) {
                                         // 用户选择不签名,则不迁移
@@ -1720,7 +1720,7 @@ function mergeTextSignature(isTxtSignature, status, pageData, singleRoleRel, rpt
     }
 }
 
-function _chkIfAudit(role_rel, STAGE_AUDIT, STAGE_LIST) {
+function _chkIfAudit(role_rel, STAGE_AUDIT = [], STAGE_LIST = []) {
     let rst = false;
     for (const stg_audit of STAGE_AUDIT) {
         if (role_rel.acc_id === stg_audit.aid) {
@@ -1839,7 +1839,7 @@ async function mergeStampSignature(ctx, status, pageData, singleRoleRel, rpt_ids
                     const sCell = page.signature_cells[scIdx];
                     for (const role_rel of roleRelContent) {
                         if (sCell.signature_name === role_rel.signature_name) {
-                            if (!checkAudit || _chkIfAudit(role_rel, stgAudit, stageList)) {
+                            if (!checkAudit || _chkIfAudit(role_rel, stgAudit || [], stageList || [])) {
                                 if (Array.isArray(role_rel.sign_output) && role_rel.sign_output.length > 0) {
                                     for (const signType of role_rel.sign_output) {
                                         switch (signType) {

+ 9 - 4
app/public/report/js/rpt_main.js

@@ -510,10 +510,15 @@ let zTreeOprObj = {
                 ppType = 1;
             }
             for (let ppItem of prePayArr) {
-                if (ppItem.type === ppType && ppItem.selected) {
-                    rst = ppItem.status;
-                    break;
+                if (ppItem.type === ppType) {
+                    if (current_stage_id > 0 && ppItem.selected || current_stage_id === -1) {
+                        rst = ppItem.status;
+                    }
                 }
+                // if (ppItem.type === ppType && ppItem.selected) {
+                //     rst = ppItem.status;
+                //     break;
+                // }
             }
         }
         return rst;
@@ -1486,7 +1491,7 @@ function downloadReport(urls) {
 }
 
 function getStageStatus() {
-    if (current_stage_id > 0) {
+    if (current_stage_id > 0 || current_stage_id === -1) {
         let ppStatus = zTreeOprObj._chkPrePayStatus();
         if (ppStatus === 3) {
             return ppStatus