121f0132 by yangjianbin

Merge branch 'develop' of http://g.28ms.com:8000/yangjianbin/page into develop

2 parents 2d675fd7 74be6b98
...@@ -118,8 +118,11 @@ ...@@ -118,8 +118,11 @@
118 return false; 118 return false;
119 } 119 }
120 var targetUrl = 'department/update/' + treeNode.id; 120 var targetUrl = 'department/update/' + treeNode.id;
121 console.log(treeNode);
122
121 var data = { 123 var data = {
122 name:newName 124 name:newName,
125 parentId:treeNode.id
123 } 126 }
124 $.ajax({ 127 $.ajax({
125 type: 'put', 128 type: 'put',
...@@ -160,6 +163,38 @@ ...@@ -160,6 +163,38 @@
160 if (btn) btn.bind("click", function(){ 163 if (btn) btn.bind("click", function(){
161 var zTree = $.fn.zTree.getZTreeObj("tree"); 164 var zTree = $.fn.zTree.getZTreeObj("tree");
162 zTree.addNodes(treeNode, {id:(100 + newCount), pId:treeNode.id, name:"new node" + (newCount++)}); 165 zTree.addNodes(treeNode, {id:(100 + newCount), pId:treeNode.id, name:"new node" + (newCount++)});
166
167 var data = {
168 name:'new node',
169 parentId:treeNode.id
170 }
171 var targetUrl1 = 'department/add';
172 $.ajax({
173 type: 'post',
174 url: apiBaseUrl + targetUrl1,
175 cache: false,
176 dataType: 'json',
177 data: JSON.stringify(data),
178 contentType: "application/json; charset=UTF-8",
179 success: function (data) {
180 if (data.msg) {
181 layer.alert(data.msg);
182 } else if (data.code != 0) {
183 layer.alert('操作失败');
184 } else {
185 layer.msg('操作成功');
186 }
187 setTimeout(function () {
188 if(!data.code) {
189 layer_close();
190 }
191 },500);
192 },
193 error: function () {
194 layer.alert("操作失败")
195 }
196 })
197
163 return false; 198 return false;
164 }); 199 });
165 }; 200 };
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!