Bläddra i källkod

调整签章对文本签名的影响

Tony Kang 3 år sedan
förälder
incheckning
12103e9ea4
2 ändrade filer med 37 tillägg och 17 borttagningar
  1. 18 13
      app/controller/report_controller.js
  2. 19 4
      app/public/report/js/rpt_signature.js

+ 18 - 13
app/controller/report_controller.js

@@ -1480,25 +1480,30 @@ function mergeTextSignature(isTxtSignature, status, pageData, singleRoleRel, rpt
                         sCell.Value = ''; // 这里要先清除原有信息
                         sCell.path = '';
                         sCell.pic = '';
+                        let needTransferText = true;
                         if (status === 3) {
                             for (const role_rel of roleRelContent) {
                                 if (sCell.signature_name === role_rel.signature_name) {
-                                    sCell.Value = role_rel.user_name; // 只有审核通过了才需要文本签名内容,但不管如何,都不影响迁移
+                                    sCell.Value = role_rel.user_name; // 只有审核通过了才需要文本签名内容
+                                    if (role_rel.sign_output && role_rel.sign_output.indexOf(NORMAL_SIGN_STR) < 0) {
+                                        // 用户选择不签名,则不迁移
+                                        needTransferText = false;
+                                    }
                                     break;
                                 }
                             }
                         }
-                        // 无论怎么处理,都得迁移
-                        const newCell = {
-                            font: 'Footer',
-                            control: sCell.control,
-                            style: sCell.style,
-                            Value: sCell.Value,
-                            area: { Left: sCell.area.Left, Right: sCell.area.Right, Top: sCell.area.Top, Bottom: sCell.area.Bottom },
-                        };
-                        page.cells.push(newCell); // 迁移
-                        // console.log(newCell);
-                        deleteSCellsIdx.push(scIdx);
+                        if (needTransferText) {
+                            const newCell = {
+                                font: 'Footer',
+                                control: sCell.control,
+                                style: sCell.style,
+                                Value: sCell.Value,
+                                area: { Left: sCell.area.Left, Right: sCell.area.Right, Top: sCell.area.Top, Bottom: sCell.area.Bottom },
+                            };
+                            page.cells.push(newCell); // 迁移
+                            deleteSCellsIdx.push(scIdx);
+                        }
                     }
                 }
                 // 删除 page.signature_cells 签名(草图不能删);
@@ -1522,7 +1527,7 @@ function mergeTextSignature(isTxtSignature, status, pageData, singleRoleRel, rpt
                         dftRolRel = roleRel;
                     }
                 }
-                // console.log(rptTpls[rtIdx].id)
+                // console.log(dftRolRel);
                 _mergeSingle(dtlPage, dftRolRel, true);
             });
         } else {

+ 19 - 4
app/public/report/js/rpt_signature.js

@@ -457,16 +457,20 @@ let rptSignatureHelper = {
         params.rel_content = ROLE_REL_LIST;
         params.selectedTenders = selectedTenders;
         rptSignatureHelper.originalRoleRelList = JSON.parse(JSON.stringify(ROLE_REL_LIST));
+        $.bootstrapLoading.start();
         CommonAjax.postXsrfEx("/tender/report_api/updateMultiRoleRelationship", params, 10000, true, getCookie('csrfToken_j'),
             function(result){
-                console.log(result);
+                // console.log(result);
+                $.bootstrapLoading.end();
                 if (result.data && result.data.insertId > 0) {
                     CURRENT_ROLE_REL_ID = result.data.insertId;
                 }
             }, function(err){
                 // hintBox.unWaitBox();
+                $.bootstrapLoading.end();
             }, function(ex){
                 // hintBox.unWaitBox();
+                $.bootstrapLoading.end();
             }
         );
     },
@@ -509,7 +513,7 @@ let rptSignatureHelper = {
             if (PAGE_SHOW.isTextSignature) {
                 resetTextSignature(zTreeOprObj.currentRptPageRst);
             }
-            zTreeOprObj.showPage(zTreeOprObj.currentPage, zTreeOprObj.canvas);
+            // zTreeOprObj.showPage(zTreeOprObj.currentPage, zTreeOprObj.canvas);
         }
         //2. 更新数据
         const params = {};
@@ -521,9 +525,11 @@ let rptSignatureHelper = {
         // rptSignatureHelper.originalRoleRelList = [];
         // rptSignatureHelper.originalRoleRelList = rptSignatureHelper.originalRoleRelList.concat(ROLE_REL_LIST);
         rptSignatureHelper.originalRoleRelList = JSON.parse(JSON.stringify(ROLE_REL_LIST));
+        $.bootstrapLoading.start();
         CommonAjax.postXsrfEx("/tender/report_api/updateRoleRelationship", params, 10000, true, getCookie('csrfToken_j'),
             async function(result){
                 // console.log(result);
+                $.bootstrapLoading.end();
                 if (result.data && result.data.insertId > 0) {
                     CURRENT_ROLE_REL_ID = result.data.insertId;
                 }
@@ -554,8 +560,10 @@ let rptSignatureHelper = {
 
             }, function(err){
                 // hintBox.unWaitBox();
+                $.bootstrapLoading.end();
             }, function(ex){
                 // hintBox.unWaitBox();
+                $.bootstrapLoading.end();
             }
         );
     },
@@ -660,6 +668,8 @@ let rptSignatureHelper = {
                                 role_rel.sign_output = [];
                                 role_rel.sign_output.push(NORMAL_SIGN_STR);
                             }
+                            sCell.path = null;
+                            sCell.pre_path = null;
                             for (const signType of role_rel.sign_output) {
                                 switch (signType) {
                                     case NORMAL_SIGN_STR:
@@ -690,6 +700,7 @@ let rptSignatureHelper = {
                                     break;
                                 }
                             }
+                            break;
                         }
                     }
                 }
@@ -1022,14 +1033,18 @@ function resetTextSignature(pageData) {
                     fitCell.Value = '';
                     for (let role of ROLE_REL_LIST) {
                         if (sCell.signature_name === role.signature_name) {
-                            fitCell.Value = role.user_name;
+                            if (role.sign_output && role.sign_output.indexOf(NORMAL_SIGN_STR) >= 0) {
+                                fitCell.Value = role.user_name;
+                            } else {
+                                fitCell.Value = '';
+                            }
                             break;
                         }
                     }
                 } else {
                     // 要创建新的文本签名cell
                     for (let role of ROLE_REL_LIST) {
-                        if (sCell.signature_name === role.signature_name) {
+                        if (sCell.signature_name === role.signature_name && role.sign_output && role.sign_output.indexOf(NORMAL_SIGN_STR) >= 0) {
                             const newCell = {
                                 font: 'Footer',
                                 control: sCell.control,