Browse Source

清单模板插入多行功能

zhangweicheng 6 years ago
parent
commit
91d5163901

+ 3 - 2
public/web/id_tree.js

@@ -525,7 +525,7 @@ var idTree = {
             var nextSibling = nextSiblingID == -1 ? null: this.nodes[this.prefix + nextSiblingID];
             let preInsertNode = null,nodes = [];
             for(let d of datas){
-                let node = new Node(this,d);
+                let node = new Node(this,d.data);
                 if(preInsertNode == null){
                     if (nextSibling) {
                         tools.addNodes(this, parent, [node], nextSibling.siblingIndex());
@@ -535,7 +535,8 @@ var idTree = {
                 }else {
                     tools.addNodes(this, parent, [node], preInsertNode.siblingIndex());
                 }
-                this.nodes[this.prefix + d.ID] = node;
+                this.nodes[this.prefix + d.data.ID] = node;
+                if(preInsertNode) node.setNextSibling(preInsertNode);
                 preInsertNode = node;
                 nodes.push(node);
             }

+ 0 - 3
public/web/tree_sheet/tree_sheet_controller.js

@@ -61,9 +61,6 @@ var TREE_SHEET_CONTROLLER = {
                     //that.sheet.showRow(newNode.serialNo(), GC.Spread.Sheets.VerticalPosition.center);
                 });
             }
-
-
-
         };
 
 

+ 4 - 2
web/maintain/bill_template_lib/js/bills_template_edit.js

@@ -459,8 +459,10 @@ $(document).ready(function () {
             CommonAjax.post(updateUrl, updateData, function (data) {
                 data = _.filter(data,{'type':'new'});
                 console.log(data);
-                //controller.insert();
-                //controller.showTreeData();
+                controller.m_insert(data);
+                controller.showTreeData();
+                $("#insertInputDiv").modal('hide');
+                $("#insertError").hide();
                 $(me).removeClass('disabled');
             });
         } else {