Bladeren bron

fix: 报表模板信息,新增 按照当前造价书界面进行排序 选项GLY-7817

lishihao 5 dagen geleden
bovenliggende
commit
1d6aaa13ab
2 gewijzigde bestanden met toevoegingen van 69 en 49 verwijderingen
  1. 4 0
      web/maintain/report/html/rpt_tpl_dtl_info.html
  2. 65 49
      web/maintain/report/js/rpt_tpl_main.js

+ 4 - 0
web/maintain/report/html/rpt_tpl_dtl_info.html

@@ -157,6 +157,10 @@
                         </ul>
                    
                     </div>
+                    
+                </div>
+                <div class="input-group col-4">
+                    <label class="form-check-label"><input type="checkbox" class="form-check-input" id="element_sortByCurrentCostBook" onchange="zTreeOprObj.onChangeFlag('sortByCurrentCostBook', this)">按照当前造价书界面进行排序</label>
                 </div>
             </div>
             <!--

+ 65 - 49
web/maintain/report/js/rpt_tpl_main.js

@@ -58,7 +58,7 @@ let zTreeOprObj = {
         for (let item of result) {
           // if (item.is_release) {
           $("#compilations").append(
-            "<option value='" + item._id + "'>" + item.name + "</option>"
+            "<option value='" + item._id + "'>" + item.name + "</option>",
           );
           // }
         }
@@ -66,7 +66,7 @@ let zTreeOprObj = {
         me.getReportTemplateTreeEx($("#compilations").get(0));
       },
       null,
-      null
+      null,
     );
   },
   refreshNodes: function () {
@@ -106,7 +106,7 @@ let zTreeOprObj = {
       isAsync,
       callback,
       failCallback,
-      null
+      null,
     );
   },
   copyReportTemplate: function (orgID, newID, isAsync, callback, failCallback) {
@@ -120,7 +120,7 @@ let zTreeOprObj = {
       isAsync,
       callback,
       failCallback,
-      null
+      null,
     );
   },
   updateTreeRootNode: function (rawNode, isAsync, callback, failCallback) {
@@ -133,7 +133,7 @@ let zTreeOprObj = {
       isAsync,
       callback,
       failCallback,
-      null
+      null,
     );
   },
   partialUpdateTreeNode: function (
@@ -142,7 +142,7 @@ let zTreeOprObj = {
     nodeArray,
     isAsync,
     callback,
-    failCallback
+    failCallback,
   ) {
     // 这个是局部刷新,原理是根据topNodeId找到后台的topNode,根据路径(有多个路径,可以实现多个子节点同时刷新)来替换(nodeArray里的)后台数据库的相关节点
     // 这里需要一个调整,就是新增目录及模板需要加给后缀(new(Date)).getTime() ,以保证不重叠(真重叠了算倒霉)
@@ -164,7 +164,7 @@ let zTreeOprObj = {
       isAsync,
       callback,
       failCallback,
-      null
+      null,
     );
   },
   updateTopNodeName: function (topNode, isAsync, callback, failCallback) {
@@ -180,7 +180,7 @@ let zTreeOprObj = {
       isAsync,
       callback,
       failCallback,
-      null
+      null,
     );
   },
   updateSubNode: function (topNode, subNode, isAsync, callback, failCallback) {
@@ -196,7 +196,7 @@ let zTreeOprObj = {
       isAsync,
       callback,
       failCallback,
-      null
+      null,
     );
   },
   createIniNode: function () {
@@ -361,7 +361,7 @@ let zTreeOprObj = {
                       treeNode,
                       insertIdx,
                       newNodes,
-                      isSilent
+                      isSilent,
                     );
                   } else {
                     me.treeObj.addNodes(treeNode, 0, newNodes, isSilent);
@@ -370,7 +370,7 @@ let zTreeOprObj = {
                   alert("后台创建失败,请确认是否有重复类型跟节点!");
                 }
               },
-              null
+              null,
             );
           } else {
             alert("有重复编办!");
@@ -410,7 +410,7 @@ let zTreeOprObj = {
               me.treeObj.addNodes(treeNode, insertIdx, newNodes, isSilent);
               let tn = me.getParentNodeByNodeLevel(
                 treeNode,
-                NODE_LEVEL_COMPILATION_NEW
+                NODE_LEVEL_COMPILATION_NEW,
               );
               let newTopNode = me.buildRootNodeDoc(tn);
 
@@ -432,7 +432,7 @@ let zTreeOprObj = {
                   }
                   me.refreshNodes();
                 },
-                null
+                null,
               );
               /*/
                         me.updateTreeRootNode(newTopNode, true, function(rst){
@@ -470,7 +470,7 @@ let zTreeOprObj = {
               me.treeObj.addNodes(treeNode, -1, newNodes, isSilent);
               let tn = me.getParentNodeByNodeLevel(
                 treeNode,
-                NODE_LEVEL_COMPILATION_NEW
+                NODE_LEVEL_COMPILATION_NEW,
               );
               let topNode = me.buildRootNodeDoc(tn);
               //*
@@ -491,7 +491,7 @@ let zTreeOprObj = {
                   }
                   me.refreshNodes();
                 },
-                null
+                null,
               );
               /*/
                         me.updateTreeRootNode(topNode, true, function(rst){
@@ -524,14 +524,14 @@ let zTreeOprObj = {
       true,
       callback,
       failCallback,
-      null
+      null,
     );
   },
   onCheck: function (event, treeId, treeNode) {
     let me = zTreeOprObj;
     let topPNode = me.getParentNodeByNodeLevel(
       treeNode,
-      NODE_LEVEL_COMPILATION_NEW
+      NODE_LEVEL_COMPILATION_NEW,
     );
     let newTopNode = me.buildRootNodeDoc(topPNode);
     me.updateTreeRootNode(newTopNode, true, function (rst) {
@@ -556,11 +556,11 @@ let zTreeOprObj = {
     let srcNode = treeNodes[0];
     let sourceTopNode = me.getParentNodeByNodeLevel(
       srcNode,
-      NODE_LEVEL_COMPILATION_NEW
+      NODE_LEVEL_COMPILATION_NEW,
     );
     let targetTopNode = me.getParentNodeByNodeLevel(
       targetNode,
-      NODE_LEVEL_COMPILATION_NEW
+      NODE_LEVEL_COMPILATION_NEW,
     );
     me.moveSrcTopNode = null;
     if (moveType === "inner") {
@@ -612,7 +612,7 @@ let zTreeOprObj = {
     }
     let targetTopNode = me.getParentNodeByNodeLevel(
       targetNode,
-      NODE_LEVEL_COMPILATION_NEW
+      NODE_LEVEL_COMPILATION_NEW,
     );
     let newTopNode = null;
     let canContinue = false;
@@ -639,7 +639,7 @@ let zTreeOprObj = {
               displayMessage("更新模板节点失败!", "red", 2000);
               // console.log(badRst.toString());
               console.log(badRst);
-            }
+            },
           );
         } else {
           treeNodes[0].refId = newNodeID;
@@ -669,14 +669,14 @@ let zTreeOprObj = {
                   displayMessage("更新模板节点失败!", "red", 2000);
                   // console.log(badRst.toString());
                   console.log(badRst);
-                }
+                },
               );
             },
             function (badResult) {
               displayMessage("Copy请求失败!", "red", 2000);
               // console.log(badResult.toString());
               console.log(badResult);
-            }
+            },
           );
         }
       });
@@ -696,7 +696,7 @@ let zTreeOprObj = {
           displayMessage("移动请求失败!", "red", 2000);
           console.log(badResult.toString());
           canContinue = false;
-        }
+        },
       );
       if (canContinue && !isCopy && me.moveSrcTopNode) {
         let newSrcTopNode = me.buildRootNodeDoc(me.moveSrcTopNode);
@@ -709,7 +709,7 @@ let zTreeOprObj = {
           function (badResult) {
             displayMessage("移动请求失败!", "red", 2000);
             canContinue = true;
-          }
+          },
         );
       }
       me.moveSrcTopNode = null;
@@ -743,8 +743,8 @@ let zTreeOprObj = {
               item1.engineerId > item2.engineerId
                 ? 1
                 : item1.engineerId < item2.engineerId
-                ? -1
-                : 0;
+                  ? -1
+                  : 0;
           } else {
             if (item1.userId === "-100") {
               rst = 1;
@@ -813,7 +813,7 @@ let zTreeOprObj = {
         }
       },
       null,
-      null
+      null,
     );
   },
   chkAndSetDupRefTplIds: function (tplNodes, selectedRefId) {
@@ -928,7 +928,7 @@ let zTreeOprObj = {
                   refId: "",
                 });
                 allTopTplNodes[allTopTplNodes.length - 1].items.push(
-                  result[itemIdx]
+                  result[itemIdx],
                 );
                 break;
               }
@@ -938,7 +938,7 @@ let zTreeOprObj = {
             allTopTplNodes,
             setting,
             "rptTplTree",
-            me
+            me,
           );
           let topNodes = me.treeObj.getNodes();
           me.chkAndSetDupRefTplIds(topNodes, null);
@@ -970,7 +970,7 @@ let zTreeOprObj = {
         });
       },
       null,
-      null
+      null,
     );
   },
   getNewNodeID: function (scope, callback) {
@@ -983,7 +983,7 @@ let zTreeOprObj = {
       true,
       callback,
       null,
-      null
+      null,
     );
   },
   chkIfDupCompilationNode: function (rawNode, parentUserNode) {
@@ -1033,7 +1033,7 @@ let zTreeOprObj = {
       let me = zTreeOprObj,
         topPNode = me.getParentNodeByNodeLevel(
           treeNode,
-          NODE_LEVEL_COMPILATION_NEW
+          NODE_LEVEL_COMPILATION_NEW,
         );
       let rawNode = me.buildRootNodeDoc(topPNode, treeNode);
       if (treeNode.level === NODE_LEVEL_COMPILATION_NEW) {
@@ -1064,7 +1064,7 @@ let zTreeOprObj = {
               alert("删除模板失败!");
             }
           },
-          null
+          null,
         );
       }
       me.refreshNodes();
@@ -1107,7 +1107,7 @@ let zTreeOprObj = {
       } else {
         let subTopNode = me.getParentNodeByNodeLevel(
           treeNode,
-          NODE_LEVEL_COMPILATION_NEW + 1
+          NODE_LEVEL_COMPILATION_NEW + 1,
         );
         let topPNode = subTopNode.getParentNode();
         let rawNode = me.buildSubRootNodeDoc(subTopNode);
@@ -1125,13 +1125,17 @@ let zTreeOprObj = {
       if (!me.currentNode.hasOwnProperty("flags")) {
         me.currentNode.flags = {};
       }
-      me.currentNode.flags[flagProp] =
-        flagDom.selectedOptions[0].value === "NA"
-          ? null
-          : flagDom.selectedOptions[0].value;
+      if (flagDom.type === "checkbox") {
+        me.currentNode.flags[flagProp] = flagDom.checked;
+      } else {
+        me.currentNode.flags[flagProp] =
+          flagDom.selectedOptions[0].value === "NA"
+            ? null
+            : flagDom.selectedOptions[0].value;
+      }
       let subTopNode = me.getParentNodeByNodeLevel(
         me.currentNode,
-        NODE_LEVEL_COMPILATION_NEW + 1
+        NODE_LEVEL_COMPILATION_NEW + 1,
       );
       let topPNode = subTopNode.getParentNode();
       let rawNode = me.buildSubRootNodeDoc(subTopNode);
@@ -1151,7 +1155,7 @@ let zTreeOprObj = {
       me.currentNode.flags[flagProp] = flagDom[0].value.split(",");
       let subTopNode = me.getParentNodeByNodeLevel(
         me.currentNode,
-        NODE_LEVEL_COMPILATION_NEW + 1
+        NODE_LEVEL_COMPILATION_NEW + 1,
       );
       let topPNode = subTopNode.getParentNode();
       let rawNode = me.buildSubRootNodeDoc(subTopNode);
@@ -1176,11 +1180,11 @@ let zTreeOprObj = {
       me.currentNode.refId = me.currentNode.ID;
       let subTopNode = me.getParentNodeByNodeLevel(
         me.currentNode,
-        NODE_LEVEL_COMPILATION_NEW + 1
+        NODE_LEVEL_COMPILATION_NEW + 1,
       );
       let topPNode = me.getParentNodeByNodeLevel(
         subTopNode,
-        NODE_LEVEL_COMPILATION_NEW
+        NODE_LEVEL_COMPILATION_NEW,
       );
       let rawNode = me.buildSubRootNodeDoc(subTopNode);
       params.compilationId = topPNode.compilationId;
@@ -1201,7 +1205,7 @@ let zTreeOprObj = {
           }
         },
         null,
-        null
+        null,
       );
     }
   },
@@ -1387,7 +1391,7 @@ let zTreeOprObj = {
                   for (let i = 0; i < vType.length; i++) {
                     $("#valuationSelector_" + vType[i]).addClass("checked");
                     valuationTypeStrList.push(
-                      valuationSelectorMap["valuationSelector_" + vType[i]]
+                      valuationSelectorMap["valuationSelector_" + vType[i]],
                     );
                   }
                   valuationTypeStr = valuationTypeStrList.join(",");
@@ -1508,6 +1512,17 @@ let zTreeOprObj = {
               } else {
                 $("#element_summaryRule_select")[0].selectedIndex = 0;
               }
+              if (
+                me.currentNode.flags.hasOwnProperty("sortByCurrentCostBook")
+              ) {
+                let sortByCurrentCostBook =
+                  me.currentNode.flags["sortByCurrentCostBook"];
+                $("#element_sortByCurrentCostBook")[0].checked =
+                  sortByCurrentCostBook === true ||
+                  sortByCurrentCostBook === "true";
+              } else {
+                $("#element_sortByCurrentCostBook")[0].checked = false;
+              }
             } else {
               $("#element_flags_select")[0].selectedIndex = 0;
               $("#element_constructSumFlags_select")[0].selectedIndex = 0;
@@ -1526,6 +1541,7 @@ let zTreeOprObj = {
               $("#element_prjFlags_selectStr")[0].value = "";
               $("#valuationSelector .mutiSelector li").removeClass("checked");
               $("#element_sumLv_flags")[0].selectedIndex = 0;
+              $("#element_sortByCurrentCostBook")[0].checked = false;
             }
 
             if (
@@ -1538,7 +1554,7 @@ let zTreeOprObj = {
             }
           },
           null,
-          null
+          null,
         );
       } else {
         me.currentNode.rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MAIN_INFO_RPT_NAME] =
@@ -1591,7 +1607,7 @@ let zTreeOprObj = {
     }
     if (rptTpl[JV.NODE_FLOW_INFO]) {
       rptTpl[JV.NODE_FLOW_INFO][JV.PROP_MULTI_COLUMN] = parseInt(
-        $("#rptTplMultiCols")[0].value
+        $("#rptTplMultiCols")[0].value,
       );
     }
     //考虑到页边距必然跟用户设置走,所以这里没必要特意去设置了,全部下架
@@ -1666,7 +1682,7 @@ let userListObj = {
         }
       },
       null,
-      null
+      null,
     );
   },
 };
@@ -1714,7 +1730,7 @@ $(".mutiSelector")
     $("#element_prjFlags_select").val(resultIDList);
     zTreeOprObj.onMutiChangeFlag(
       "valuationType",
-      $("#element_prjFlags_select")
+      $("#element_prjFlags_select"),
     );
     return false;
   });