Browse Source

Merge branch 'master' of http://smartcost.f3322.net:3000/SmartCost/ConstructionOperation

TonyKang 7 years ago
parent
commit
13f1cab4de

+ 3 - 15
web/maintain/bills_lib/scripts/db_controller.js

@@ -102,12 +102,6 @@ var dbController = {
                         nextSectionInfo[nullNextSectionInfo] = lastSelNode.getID();
                     }
                     getNextSibling(lastSelNode);
-                    let updateC = {
-                        ID: nextSiblingIds,
-                        ParentID: node.getID(),
-                        sectionInfo: nextSectionInfo,
-                        type: 'nextSiblingNode'
-                    };
                     updateData.push({
                         ID: nextSiblingIds,
                         ParentID: lastSelNode.getID(),
@@ -147,20 +141,14 @@ var dbController = {
                     }
                 }
                 //更新选中节点
+                console.log(selNodes);
                 for(let i = 0; i < selNodes.length; i++){
                     let selNode = selNodes[i];
                     let oprSectionInfo = tools.getSectionInfo(firstParent);
-                    let updateA = {
-                        ID: node.getID(),
-                        ParentID: node.parent.getParentID(),
-                        NextSiblingID: node.parent.getNextSiblingID(),
-                        sectionInfo: oprSectionInfo,
-                        type: 'oprNode'
-                    };
                     updateData.push({
                         ID: selNode.getID(),
                         ParentID: firstParent.getParentID(),
-                        NextSiblingID: firstParent.getNextSiblingID(),
+                        NextSiblingID: i === selNodes.length - 1 ? firstParent.getNextSiblingID() : selNode.getNextSiblingID(),
                         sectionInfo: oprSectionInfo,
                         type: 'oprNode'
                     });
@@ -186,7 +174,7 @@ var dbController = {
                             }
                         }
                         if(oprChildIds.length > 0){
-                            updateData.push({ID: oprChildIds, ParentID: node.getID(), sectionInfo: oprChildSectionInfo, type: 'nextSiblingNode'});
+                            updateData.push({ID: oprChildIds, ParentID: selNode.getID(), sectionInfo: oprChildSectionInfo, type: 'nextSiblingNode'});
                         }
                     }
                 }

+ 2 - 1
web/maintain/ration_repository/js/section_tree.js

@@ -402,7 +402,8 @@ let sectionTreeObj = {
         //更新选中节点
         for(let i = 0; i < selNodes.length; i++){
             let selNode = selNodes[i];
-            postData.push(me.getUpdateObj(me.updateType.update, selNode.getID(), firstParent.getNextSiblingID(), firstParent.getParentID(), null, null));
+            let nid = i === selNodes.length - 1 ? firstParent.getNextSiblingID() : selNode.getNextSiblingID();
+            postData.push(me.getUpdateObj(me.updateType.update, selNode.getID(), nid, firstParent.getParentID(), null, null));
         }
         if(postData.length > 0){
             //ajax