4d1f4840b64e075ad08e57c28492ce3e6c1f5e51.svn-base 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <%@page language="java" pageEncoding="UTF-8"%>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title></title>
  7. <%@include file="../../../../include.jsp"%>
  8. <script type="text/javascript">
  9. var fd_id = "<%=request.getParameter("fd_id")%>";
  10. var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  11. //返回主页面
  12. function goBack() {
  13. //获取iframe中的元素值
  14. var iframe = parent.parent.document.getElementsByName("frmright")[0];
  15. iframe.src = "/nwyj/page/business/gps/taskManagement/taskManagement.jsp";
  16. }
  17. //当前登录用户所属的单位id
  18. var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  19. //var deptId="1";
  20. //当前等路用户的上一级单位
  21. var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
  22. var treeObj;
  23. var selectNodes = "";
  24. var setting1 = {
  25. view : {
  26. selectedMulti : true
  27. },
  28. check : {
  29. enable : true,
  30. chkStyle : "checkbox"
  31. },
  32. data : {
  33. simpleData : {
  34. enable : true
  35. }
  36. }/* ,
  37. callback : {
  38. onAsyncSuccess : jiaZaiWan
  39. } */
  40. }
  41. //选择结果
  42. function getSelectValue() {
  43. //获取zTree对象
  44. var zTree = $.fn.zTree.getZTreeObj("tree-1");
  45. //得到选中的数据集
  46. var checkedNodes = zTree.getNodesByFilter(filter3);
  47. var names = "";
  48. var ids = "";
  49. var ids1 = "";
  50. for (var i = 0; i < checkedNodes.length; i++) {
  51. //机构名称
  52. names += checkedNodes[i].name;
  53. ids += checkedNodes[i].id;
  54. if(i != checkedNodes.length-1){
  55. names += ",";
  56. ids += ",";
  57. }
  58. ids1 += "_" + checkedNodes[i].id + "_";
  59. }
  60. return names+"----"+ids+"----"+ids1;
  61. }
  62. function filter3(node) {//已禁用且未选中的节点
  63. return (node.checked == true);
  64. }
  65. function initComplete() {
  66. $.ajax({
  67. url : $.pathname() +"/ws/importGpsUser/BaoGongDianTaskService/getOrgInfoByareaIdAndUnitId",
  68. type : 'post',
  69. async : false,
  70. data : {"fd_id": fd_id ,"unitId":deptId},
  71. dataType : 'json',
  72. success : function(data) {
  73. $.fn.zTree.init($("#tree-1"), setting1,data.treeNodes);
  74. },
  75. error : function(e) {
  76. }
  77. });
  78. $(parent.document.body).find("iframe").height($(window.document.body).height());
  79. $(top.document.body).find("iframe").height($(parent.document.body).height());
  80. }
  81. function formReset(){
  82. window.location.href="/nwyj/page/business/gps/taskManagement/gpsTaskMsg/gpsAreaEdit.jsp?fd_id="+fd_id;
  83. }
  84. /* function jiaZaiWan() {
  85. //获取树对象
  86. treeObj = $.fn.zTree.getZTreeObj("tree-1");
  87. //父子设置关联关系
  88. treeObj.setting.check.chkboxType = {
  89. "Y" : "p",
  90. "N" : "s"
  91. }
  92. //全部展开
  93. treeObj.expandAll(true);
  94. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  95. var params = {
  96. classid : '610',
  97. objectID : fd_id
  98. };
  99. $.request.query(url, params, function(data) {
  100. var areaIds = data.GPS_AREA_ID_610;
  101. var areaArr = areaIds.split(",");
  102. //将范围内单位设置成选中状态
  103. for ( var i in areaArr) {
  104. var node = treeObj.getNodeByParam('id', areaArr[i]);
  105. //4个参数:① 节点 ② 勾选true/取消勾选false ③checkTypeFlag设置父子关联true/设置父子不关联false ④是否回调,调用回调函数true,否则false
  106. treeObj.checkNode(node, true, true, true);
  107. }
  108. function filter1(node) {//父节点不是该部门的节点
  109. return (node.parentId != deptId);
  110. }
  111. var nodes = treeObj.getNodesByFilter(filter1);
  112. for (var i = 0, l = nodes.length; i < l; i++) {
  113. treeObj.setChkDisabled(nodes[i], true);//设置节点为禁用状态
  114. }
  115. //最后,将禁用的节点移除
  116. function filter2(node) {//已禁用且未选中的节点
  117. return (node.chkDisabled == true && node.checked == false);
  118. }
  119. var nodes1 = treeObj.getNodesByFilter(filter2);
  120. for (var i = 0, l = nodes1.length; i < l; i++) {
  121. treeObj.removeNode(nodes1[i]);//移除节点
  122. }
  123. });
  124. } */
  125. $(function() {
  126. $("#save").live("click", function() {
  127. var datas = getSelectValue();
  128. var datasArr = datas.split("----");
  129. var names = datasArr[0];
  130. var ids = datasArr[1];
  131. var ids1 = datasArr[2];
  132. var params = {
  133. classid : "610",
  134. FD_OBJECTID610 : fd_id,
  135. "GPS_AREA_NAME_610":names,
  136. "GPS_AREA_ID_610":ids,
  137. "GPS_AREA_ID_FU_610":ids1
  138. }
  139. $.ajax({
  140. url : $.pathname() + '/ws/crud/CRUDService/update/',
  141. type : 'post',
  142. timeout : 15000,
  143. data : params,
  144. dataType : 'json',
  145. success : function(data) {
  146. top.Dialog.alert('修改成功!', null, null, null, -1);
  147. },
  148. error : function(e) {
  149. }
  150. })
  151. })
  152. })
  153. </script>
  154. <script type="text/javascript" src="/nwyj/scripts/business/gps/taskManagement/setIframeHeight.js"></script>
  155. </head>
  156. <body>
  157. <div class="box1" id="formContent"
  158. style="border: 1px solid #E4E4E4;background: #F8F8F8;">
  159. <div style="height: 50px;background: #F8F8F8;" align="center">
  160. <a href="javascript:;"><img align="left" alt="返回"
  161. src="/nwyj/images/temp/back.png" onclick="goBack();"></img></a>
  162. <font style="font-weight: bold;font-size: 20px;line-height: 45px;" id="titleShow">保供电任务责任单位</font>
  163. </div>
  164. <form id="editForm" method="post" enctype="multipart/form-data">
  165. <input name="classid" value="610" type="hidden" />
  166. <input type="hidden" name="FD_OBJECTID320" id="FD_OBJECTID320" value=""/>
  167. <input type="hidden" name="GPS_AREA_NAME_610" id="GPS_AREA_NAME_610" />
  168. <input type="hidden" name="GPS_AREA_ID_610" id="GPS_AREA_ID_610" />
  169. <input name="GPS_AREA_ID_FU_610" id="GPS_AREA_ID_FU_610" type="hidden">
  170. <table style="border: none" width="100%">
  171. <tr>
  172. <!-- <td width="20%"
  173. style="font-size: 20px;font-weight: bold;color:#41A6D9;">保供电任务范围</td> -->
  174. <td width="80%" align="right">
  175. <input value="保存" type="button" id="save" />&nbsp;&nbsp;
  176. <input value="重置" type="button" onclick="formReset()" />&nbsp;&nbsp;&nbsp;&nbsp;</td>
  177. </tr>
  178. </table>
  179. </form>
  180. <div style="padding:5px 0 0 0;"></div>
  181. <div id="tree-1" class="ztree" align="center"></div>
  182. </div>
  183. </body>