Browse Source

TASK #5043 依测试修改

Tony Kang 7 months ago
parent
commit
72fed834da
1 changed files with 18 additions and 8 deletions
  1. 18 8
      app/public/report/js/rpt_signature.js

+ 18 - 8
app/public/report/js/rpt_signature.js

@@ -473,8 +473,8 @@ let rptSignatureHelper = {
             '</small></span><a onclick="rptSignatureHelper.removeSignature(this)" class="text-danger"><i class="fa fa-remove" title="移除签名"></i></a></p>');
     },
     pushDomElementByFlow: function (elementsStrArr, flowName, signature_name) {
-        elementsStrArr.push(`<p class=" d-flex justify-content-between m-0"><span><a href="#add-liucheng" data-toggle="modal" data-target="#add-liucheng" 
-            onclick="rptSignatureHelper.iniAssFlowDialog(rptSignatureHelper.getFlowRoleRel('${signature_name}'))">${flowName}</a>
+        elementsStrArr.push(`<p class=" d-flex justify-content-between m-0"><span>${flowName}<a href="#add-liucheng" data-toggle="modal" data-target="#add-liucheng" 
+            onclick="rptSignatureHelper.iniAssFlowDialog(rptSignatureHelper.getFlowRoleRel('${signature_name}'))">(设置签字签章)</a>
             </span><a onclick="rptSignatureHelper.removeSignature(this)" class="text-danger"><i class="fa fa-remove" title="移除签名"></i></a></p>`);
     },
     pushDatePickerDom: function (elementsStrArr, userAcc, role_rel, seq = 0) {
@@ -1389,6 +1389,20 @@ function prepareRightFlowRoles(pageData, roleRelList = [], stg_audit = [], ledge
                 auditCache[`_${audit.aid}`] = `${audit.audit_ledger_id}`; // 统一用string类型来判断
             }
         });
+        const _chkMultiAuditFlow = (assFlowRole, page) => {
+            let rst = false;
+            const idStr = `${auditCache[`_${assFlowRole.acc_id}`]}`;
+            const idStrs = idStr.split(',');
+            for (const key of idStrs) {
+                const rootLedgerPath = ledgerCache[`_${key}`].full_path || '';
+                const thisLedgerPath = ledgerCache[page.extend_flow_options].full_path || '';
+                if (thisLedgerPath.indexOf(rootLedgerPath) === 0) {
+                    rst = true;
+                    break;
+                }
+            }
+            return rst;
+        };
         pageData.items.forEach((page, index) => {
             if (page.extend_flow_options && page.extend_flow_options !== '') {
                 for (const role of roleRelList) {
@@ -1398,13 +1412,9 @@ function prepareRightFlowRoles(pageData, roleRelList = [], stg_audit = [], ledge
                         for (let assIdx = 0; assIdx < role.assFlowInfos.length; assIdx++) {
                             const assRole = role.assFlowInfos[assIdx];
                             if (auditCache[`_${assRole.acc_id}`]) {
-                                const ledgerIdStr = `_${auditCache[`_${assRole.acc_id}`]}`;
-                                const rootLedgerPath = ledgerCache[ledgerIdStr].full_path;
-                                const thisLedgerPath = ledgerCache[page.extend_flow_options].full_path || '';
-                                // 这里用了一个取巧的判断,就是子项的code一定完整包括父项的code,且父项code是在最前。
-                                // 万一以后设计有所变化或台账改了,那么得换判断逻辑,目前先让逻辑跑通
-                                if (thisLedgerPath.indexOf(rootLedgerPath) === 0) {
+                                if (_chkMultiAuditFlow(assRole, page)) {
                                     role.flowAccList[role.flowAccList.length - 1] = assIdx;
+                                    const thisLedgerPath = ledgerCache[page.extend_flow_options].full_path || '';
                                     if (thisLedgerPath.length > preLen) {
                                         preLen = thisLedgerPath.length; // 还要考虑到嵌套的情况
                                     } else break;