123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- <%@page language="java" pageEncoding="UTF-8"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title></title>
- <%@include file="../../../../include.jsp"%>
- <script type="text/javascript">
- var fd_id = "<%=request.getParameter("fd_id")%>";
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- //返回主页面
- function goBack() {
- //获取iframe中的元素值
- var iframe = parent.parent.document.getElementsByName("frmright")[0];
- iframe.src = "/nwyj/page/business/gps/taskManagement/taskManagement.jsp";
- }
- //当前登录用户所属的单位id
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- //var deptId="1";
- //当前等路用户的上一级单位
- var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
- var treeObj;
- var selectNodes = "";
- var setting1 = {
- view : {
- selectedMulti : true
- },
- check : {
- enable : true,
- chkStyle : "checkbox"
- },
- data : {
- simpleData : {
- enable : true
- }
- }/* ,
- callback : {
- onAsyncSuccess : jiaZaiWan
- } */
- }
-
- //选择结果
- function getSelectValue() {
- //获取zTree对象
- var zTree = $.fn.zTree.getZTreeObj("tree-1");
- //得到选中的数据集
- var checkedNodes = zTree.getNodesByFilter(filter3);
- var names = "";
- var ids = "";
- var ids1 = "";
- for (var i = 0; i < checkedNodes.length; i++) {
- //机构名称
- names += checkedNodes[i].name;
- ids += checkedNodes[i].id;
- if(i != checkedNodes.length-1){
- names += ",";
- ids += ",";
- }
- ids1 += "_" + checkedNodes[i].id + "_";
- }
- return names+"----"+ids+"----"+ids1;
- }
- function filter3(node) {//已禁用且未选中的节点
- return (node.checked == true);
- }
- function initComplete() {
- $.ajax({
- url : $.pathname() +"/ws/importGpsUser/BaoGongDianTaskService/getOrgInfoByareaIdAndUnitId",
- type : 'post',
- async : false,
- data : {"fd_id": fd_id ,"unitId":deptId},
- dataType : 'json',
- success : function(data) {
- $.fn.zTree.init($("#tree-1"), setting1,data.treeNodes);
- },
- error : function(e) {
- }
- });
- $(parent.document.body).find("iframe").height($(window.document.body).height());
- $(top.document.body).find("iframe").height($(parent.document.body).height());
- }
-
- function formReset(){
- window.location.href="/nwyj/page/business/gps/taskManagement/gpsTaskMsg/gpsAreaEdit.jsp?fd_id="+fd_id;
- }
- /* function jiaZaiWan() {
- //获取树对象
- treeObj = $.fn.zTree.getZTreeObj("tree-1");
- //父子设置关联关系
- treeObj.setting.check.chkboxType = {
- "Y" : "p",
- "N" : "s"
- }
- //全部展开
- treeObj.expandAll(true);
- var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
- var params = {
- classid : '610',
- objectID : fd_id
- };
- $.request.query(url, params, function(data) {
- var areaIds = data.GPS_AREA_ID_610;
- var areaArr = areaIds.split(",");
- //将范围内单位设置成选中状态
- for ( var i in areaArr) {
- var node = treeObj.getNodeByParam('id', areaArr[i]);
- //4个参数:① 节点 ② 勾选true/取消勾选false ③checkTypeFlag设置父子关联true/设置父子不关联false ④是否回调,调用回调函数true,否则false
- treeObj.checkNode(node, true, true, true);
- }
-
- function filter1(node) {//父节点不是该部门的节点
- return (node.parentId != deptId);
- }
- var nodes = treeObj.getNodesByFilter(filter1);
- for (var i = 0, l = nodes.length; i < l; i++) {
- treeObj.setChkDisabled(nodes[i], true);//设置节点为禁用状态
- }
-
- //最后,将禁用的节点移除
- function filter2(node) {//已禁用且未选中的节点
- return (node.chkDisabled == true && node.checked == false);
- }
- var nodes1 = treeObj.getNodesByFilter(filter2);
- for (var i = 0, l = nodes1.length; i < l; i++) {
- treeObj.removeNode(nodes1[i]);//移除节点
- }
- });
- } */
- $(function() {
- $("#save").live("click", function() {
- var datas = getSelectValue();
- var datasArr = datas.split("----");
- var names = datasArr[0];
- var ids = datasArr[1];
- var ids1 = datasArr[2];
- var params = {
- classid : "610",
- FD_OBJECTID610 : fd_id,
- "GPS_AREA_NAME_610":names,
- "GPS_AREA_ID_610":ids,
- "GPS_AREA_ID_FU_610":ids1
-
- }
- $.ajax({
- url : $.pathname() + '/ws/crud/CRUDService/update/',
- type : 'post',
- timeout : 15000,
- data : params,
- dataType : 'json',
- success : function(data) {
- top.Dialog.alert('修改成功!', null, null, null, -1);
- },
- error : function(e) {
- }
- })
- })
- })
- </script>
- <script type="text/javascript" src="/nwyj/scripts/business/gps/taskManagement/setIframeHeight.js"></script>
-
- </head>
- <body>
- <div class="box1" id="formContent"
- style="border: 1px solid #E4E4E4;background: #F8F8F8;">
- <div style="height: 50px;background: #F8F8F8;" align="center">
- <a href="javascript:;"><img align="left" alt="返回"
- src="/nwyj/images/temp/back.png" onclick="goBack();"></img></a>
- <font style="font-weight: bold;font-size: 20px;line-height: 45px;" id="titleShow">保供电任务责任单位</font>
- </div>
- <form id="editForm" method="post" enctype="multipart/form-data">
- <input name="classid" value="610" type="hidden" />
- <input type="hidden" name="FD_OBJECTID320" id="FD_OBJECTID320" value=""/>
- <input type="hidden" name="GPS_AREA_NAME_610" id="GPS_AREA_NAME_610" />
- <input type="hidden" name="GPS_AREA_ID_610" id="GPS_AREA_ID_610" />
- <input name="GPS_AREA_ID_FU_610" id="GPS_AREA_ID_FU_610" type="hidden">
- <table style="border: none" width="100%">
- <tr>
- <!-- <td width="20%"
- style="font-size: 20px;font-weight: bold;color:#41A6D9;">保供电任务范围</td> -->
- <td width="80%" align="right">
- <input value="保存" type="button" id="save" />
- <input value="重置" type="button" onclick="formReset()" /> </td>
- </tr>
- </table>
- </form>
- <div style="padding:5px 0 0 0;"></div>
- <div id="tree-1" class="ztree" align="center"></div>
- </div>
- </body>
|