123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086 |
- <%@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>
- <title>组织机构管理</title>
- <meta http-equiv="Content-Type" content="text/html; charset=GBK" />
- <%request.setCharacterEncoding("GBK"); %>
- <!--框架必需start-->
- <%@include file="../.././../../include1.jsp"%>
- <!--引用资源文件,JS CSS-->
- <script type="text/javascript" src="<%=path%>/scripts/jquery/plugins/jquery.extension.util.js"></script>
- <script type="text/javascript" src="<%=path%>/scripts/freamwork/com/sinosoft/common/common.js"></script>
- <script type="text/javascript" src="<%=path%>/scripts/freamwork/com/sinosoft/common/utils/utils.js"></script>
- <script type="text/javascript" src="<%=path%>/scripts/freamwork/com/sinosoft/common/frameWork/frameWork.js"></script>
- <script type="text/javascript" src="<%=path%>/scripts/freamwork/com/sinosoft/common/utils/Request.js"></script>
- <script type="text/javascript" src="<%=path%>/scripts/freamwork/com/sinosoft/common/searchUtil.js"></script>
- <link href="<%=path%>/scripts/freamwork/com/sinosoft/common/searchUtil.css" rel="stylesheet" type="text/css"/>
- <!--基本选项卡start-->
- <!--框架必需end-->
- <!-- 按钮权限start -->
- <script type="text/javascript" src="/nwyj/scripts/freamwork/com/sinosoft/common/common.js"></script>
- <!-- 上移下移公共方法 -->
- <!-- 置顶 -->
- <script type="text/javascript" src="/nwyj/scripts/business/am/public/public.js"></script>
- <!-- 按钮权限end -->
- <script type="text/javascript" src="../../../../../scripts/freamwork/com/sinosoft/system/invoking/invoking.js"></script>
- <script type="text/javascript" src="/nwyj/page/business/em/report/reportCss/tableStyle.js"></script>
- <link href="/nwyj/page/business/em/report/reportCss/warnningreport.css" rel="stylesheet" type="text/css" />
- <style type ="text/css">
- //隐藏layout布局的线条
- .l-layout-center{
- border:none!important;
- _left:320px;
- _width:100%;
- }
- .l-layout-left{
- border:none!important;
- }
- .l-layout-drophandle-left{
- width: 1px;
- }
- body,div,ul,li,p{
- margin:0;
- padding:0;
- font-size: 14px;
- }
- </style>
- <script type="text/javascript">
- //定义grid表格对象
- var LinkGrid;
- //当前点击的机构节点
- var parentClickOrg;
- //登陆人的机构id
- var loginOrgId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- //grid表格的加载参数
- var loadParams;
- //grid表格的condition
- var initCondition;
- //判定是否点击的为虚拟机构还是实体机构
- var isVirtual = false;
- //定义查询sql
- var sql_condition="";
- //取登录人角色,超级管理员才能看见必要按钮 R002105430200
- var role = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();
- //登陆人的id
- var User_ID1 = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- //移动号码正则表达式
- var regex = /^1(3[4-9]|5[012789]|8[23478]|4[7]|7[8])\d{8}$/;
- var disname = "应急角色";
- $searchButt = null;// 查询按钮
- $queryForm = null;
- $(function(){
-
-
- //parent.getSelectTreeNode();
- parentClickOrg = parent.selectedTreeNode;//取父页面的值
-
- if(parentClickOrg.orgtype=="ZHZXYJB"){
- disname = "应急办角色";
- }else if(parentClickOrg.orgtype=="ZHZX"){
- disname = "应急指挥中心角色";
- }
- loadOrgInformation(parentClickOrg,parentClickOrg.id);//加载机构信息的方法
- LinkGridInit(parentClickOrg,parentClickOrg.id);//初始化表格的方法
-
- if(parentClickOrg.orgtype=="ZHZXYJB"){
- $("#zbdh").hide();
- $("#zhjg").hide();
- }else{
- $("#yjdh").hide();
- $("#yjbcy").hide();
- }
- $queryForm = $("#queryForm");
- $searchButt = $("#searchButt");// 查询按钮
- $searchButt.bind('click', function() {
- search();
- });
- $("._toolBar_grid").bind('click',function(){
- parent.resetWindowSize()
- })
- $("._toolBar_singleRecode").bind('click',function(){
- parent.resetWindowSize1200(); //l-layout-center
-
- })
- //绑定查询框事件
- $("#INLINK_NAME_211").focus(function (){
- $("#INLINK_NAME_211").on("keyup", function(event) {
- var e = event||window.event;
- var getValue = $("#INLINK_NAME_211").val().trim();
- if(e&&e.keyCode=="13"){
- search();
- }
-
- });
- })
- });
- function search(){
- var getValue = $("#INLINK_NAME_211").val().trim();
- //去掉水印
- if(getValue=="请输入姓名"){
-
- getValue ="";
- }
- var searchCondition="IS_DEL = 0 AND VIRTUAL_ORG_ID IN (SELECT ORG_ID FROM EMC_DEPARTMENT_IN WHERE ORG_ID='"+parentClickOrg.id+"' AND IS_VIRTUAL = '1' AND IS_DEL='0')";
- var params = {
- "listId" : '211',
- "condition" : searchCondition,
- direction : 'asc', // 排序方式
- sort : 'SORT_NO',
- INLINK_NAME_211 : getValue
- };
- LinkGrid.setOptions( {
- params : params
- });
- LinkGrid.rend();//加载数据
-
- }
- //当前机构的节点取录入人信息 parentClickOrg
-
- //发送请求在机构表里取录入人ID
- function getOrgInfo(id){
- var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
- var params = {
- classid : '236',
- objectID : id
- };
-
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data){
- var userID = data.ENTRY_MAN_ID_236; //录入人ID
- getUserInfo(userID);
- },
- error : function(e){
- top.Dialog.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
- //发送请求在机构表里取录入人ID
- function getUserInfo(userID){
- var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
- var params = {
- classid : '880',
- objectID : userID
- };
-
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data){
- var REAL_NAME_880 = data.REAL_NAME_880;
- var MOBILE = data.MOBILE_880; //手机
- //var COMPANY_ID = data.COMPANY_ID_880_SHOW;//所属单位
- var ORG_ID = data.ORG_ID_880_SHOW;//所属部门
- $("#REAL_NAME_880").html(REAL_NAME_880);
- $("#MOBILE_880").html(MOBILE);
- //$("#COMPANY_ID_880").html(COMPANY_ID);
- $("#ORG_ID_880").html(ORG_ID);
- },
- error : function(e){
- top.Dialog.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
-
- //加载机构信息的方法
- function loadOrgInformation(treeNode,id){
- $.ajax({
- url : $.pathname()+'/ws/InDepartmentService/InDepartmentService/queryOrgInfoById',
- type : 'post',
- timeout : 60000,
- data : {"id":treeNode.id},
- dataType : 'json',
- success : function(data) {
- var json = JSON.stringify(data);
- for(var i in data){
- $("#"+i).html(data[i]);
- }
- $("#CHENGYUAN1").html(data.CHENGYUAN);
- /* $("#COMPANY_ID_880").html(data.ENTRY_MAN_NAME);
- var update = data.UPDATEDATE;
- $("#UPDATEDATE").html(update.substring(0, update.lastIndexOf(".")));
- //显示是否为虚拟机构
- if(data.IS_VIRTUAL=="1"){
- $("#IS_VIRTUAL").html("是");
- }else{
- $("#IS_VIRTUAL").html("否");
- } */
- //修改标题
- $("#titleShow").html(data.ORG_NAME);
- //getUserInfo(data.ENTRY_MAN_ID);
- },
- error : function(e) {
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
- //初始化表格的方法
- function LinkGridInit(treeNode,id){
- //判定机构是否为虚拟机构
- if(treeNode==null){
- isVirtual=false;
- }else{
-
- isVirtual = treeNode.isVirtual=="1"?true:false;
- }
-
- //根据是否为虚拟机构判定能sql条件
- if(isVirtual){
-
- initCondition="IS_DEL=0 AND VIRTUAL_ORG_ID='"+id+"'";
-
- }else{
- initCondition="IS_DEL = 0 AND VIRTUAL_ORG_ID IN (SELECT ORG_ID FROM EMC_DEPARTMENT_IN WHERE CORP_ID='"+id+"' AND IS_VIRTUAL = '1' AND IS_DEL='0')";
- };
- //跟新loadparams
- loadParams={
- "listId" : '211',
- "condition" : initCondition,
- direction : 'asc', // 排序方式
- sort : 'sort_no'
- };
- var roleCons = roleButtonArr();
- var toolBarOpt1 = {
- items : [{
- text : '添加',
- click : 'onAdd1',
- iconClass : 'add1_tem',
- id:"10209",
- disabled : false
- },
- /* {
- text : '添加',
- click : 'onAdd',
- iconClass : 'add1_tem',
- id:"10209",
- disabled : false
- }, */
- {
- text : '删除',
- click : 'onDelete',
- iconClass : 'delete_tem',
- id:"1020b",
- disabled : false
- }, {
- text : '修改',
- click : 'onEdit',
- iconClass : 'update_tem',
- id:"1020a",
- disabled : false
- },
- {
- text : '导出',
- click : 'exportTotalData',
- iconClass : 'export_tem',
- id:"10006",
- disabled : false
- }, {
- text : '短信',
- click : 'sendMessage',
- iconClass : 'sendmsg_tem',
- id:"10204",
- disabled : false
- }/* , {
- text : '邮件',
- click : 'sendEmail',
- iconClass : 'sendemail_tem',
- id:"10006",
- disabled : false
- } */
- /* , {
- text : '汇总',
- click : 'collect',
- iconClass : 'collect_tem',
- id:"10007",
- disabled : false
- } */
- , {
- text : '上移',
- click : 'moveUp',
- iconClass : 'shangyi_tem',
- id:"10209",
- disabled : false
- }
- , {
- text : '下移',
- click : 'moveDown',
- iconClass : 'xiayi_tem',
- id:"10209",
- disabled : false
- }, {
- text : '置顶',
- click : 'moveDownMax1(1)',
- iconClass : 'zhiding_tem',
- id:"10209",
- disabled : false
- }
- ],
- roleCons:roleCons
- };
- var grid_option1 = {
- columns : [ {
- display : disname,
- name : 'EMC_ROLE_211_SHOW',
- align : 'center',
- width : "20%",
- render : function(rowdata, rowindex, value, column) {
- var test = "";
- if(rowdata.PHONE_211==null||rowdata.EMC_ROLE_211==null)
- test = ";background-color:#FF5151";
- return "<a href='javascript:;' style='width:100%;height:100%;color:black;display:block"+test+"' title='" + value + "'>" + value + "</a>";
- }
- },
- {
- display : '姓名',
- name : 'INLINK_NAME_211',
- align : 'center',
- width : "10%",
- isPrimaryKey:true,
- /* render : function(rowdata, value) {
- return '<a href="javascript:void(0)" '
- + 'onclick=clickView("'
- + rowdata.FD_OBJECTID211
- +'")>'+ rowdata.INLINK_NAME_211 +'</a>';
- } */
- render : function(rowdata, rowindex, value, column) {
- var test = "";
- if(rowdata.PHONE_211==null||rowdata.EMC_ROLE_211==null)
- test = ";background-color:#FF5151";
- return "<a href='javascript:;' style='width:100%;height:100%;display:block"+test+"' title='" + value + "' onclick='openDetail(" + rowindex + ")'>" + value + "</a>";
- }
- },
- {
- display : '所属单位',
- name : 'PARENT_ORG_ID_211_SHOW',
- align : 'center',
- width : "20%",
- render : function(rowdata, rowindex, value, column) {
- var test = "";
- if(rowdata.PHONE_211==null||rowdata.EMC_ROLE_211==null)
- test = ";background-color:#FF5151";
- return "<a href='javascript:;' style='width:100%;height:100%;color:black;display:block"+test+"' title='" + value + "'>" + value + "</a>";
- }
- },
- {
- display : '所属部门',
- name : 'PARENT_DEPT_ID_211',
- align : 'center',
- width : "20%",
- render : function(rowdata, rowindex, value, column) {
- var h = "";
- var test = "";
- $.ajax({
- url : $.pathname() + '/ws/InDepartmentService/InDepartmentService/getDeptById/',
- async:false,
- type : 'post',
- timeout : 15000,
- data : { id : value},
- dataType : 'json',
- success : function(data){
- h=data.DEPT_NAME;
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- if(rowdata.PHONE_211==null||rowdata.EMC_ROLE_211==null)
- test = ";background-color:#FF5151";
- return "<a href='javascript:;' style='width:100%;height:100%;color:black;display:block"+test+"' title='" + h + "'>" + h + "</a>";
- }
- },
- {
- display : '手机',
- name : 'PHONE_211',
- align : 'center',
- width : "15%" ,
- render : function(rowdata, rowindex, value, column){
- var phone = "";var phone2 = "";
- var test = "";
- if(regex.test(value)||value==null){
- phone = "1" == rowdata.IS_SHOW_TEL_211 ? "****" : value==null?"":value;
- phone2 = phone;
- }else{
- phone = "1" == rowdata.IS_SHOW_TEL_211 ? "<span style=\"color:blue\"><b>****(非移动号码)</b></span>" : "<span style=\"color:blue\"><b>"+value+"</b></span>";
- phone2 = "1" == rowdata.IS_SHOW_TEL_211 ? "****(非移动号码)" : value;
- }
- if(rowdata.PHONE_211==null||rowdata.EMC_ROLE_211==null)
- test = ";background-color:#FF5151";
- return "<a href='javascript:;' style='width:100%;height:100%;color:black;display:block"+test+"' title='" + phone2 + "'>" + phone + "</a>";
- }
- },
- {
- display : '4A账号',
- name : 'INLINK_INDEX_211',
- align : 'center',
- width : "15%",
- render : function(rowdata, rowindex, value, column) {
- var h = "";
- var test = "";
- $.ajax({
- url : $.pathname() + '/ws/crud/CRUDService/getDataById/',
- async:false,
- type : 'post',
- timeout : 15000,
- data : { classid : '880', objectID : value},
- dataType : 'json',
- success : function(data){
- h=data.LOGIN_NAME_880;
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- if(rowdata.PHONE_211==null||rowdata.EMC_ROLE_211==null)
- test = ";background-color:#FF5151";
- return "<a href='javascript:;' style='width:100%;height:100%;color:black;display:block"+test+"' title='" + h + "'>" + h + "</a>";
- }
- }
- ],
- rownumbers : true,
- checkbox : true,
- pageSize : 10,
- /* rowAttrRender: function(rowdata, rowid){
- return ("" == rowdata.EMC_ROLE_211||"" == PHONE_211) ? "style=\"background-color:#76c3f9;\"" : '';
- }, */
- percentWidthMode : true
- };
-
- var options1={
- url : $.pathname() + '/ws/crud/CRUDService/queryQui',
- params: loadParams,
- //width:"80%",
- gridOptions: grid_option1,
- singleRecodeOptions:{a:"aa"},
- paperOpration:{showInput:"true"},
- toolBarOptions: toolBarOpt1
- };
- LinkGrid = gridAndSingleRecode=$("#InlinkMainGrid").quickgridAndSingleRecode(options1);
- }
- //置顶方法
- function moveDownMax1(max){
- var rows = LinkGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要移动的记录!");
- return;
- }
-
- if (rows.length > 1) {
- top.Dialog.alert("只能选择一条记录");
- return;
- }
-
- /* if(rows[0].__index+1==LinkGrid.getData().length){
- top.Dialog.alert("已经移动到底端!");
- return;
- } */
- var fd_id = rows[0].FD_OBJECTID211;
- //选中人的虚拟机构ID需要根据改ID去查询当前ID下挂着的人最小的序号
- //var xuniId = LinkGrid.getRow(rows[0].__index+1).VIRTUAL_ORG_ID_211;
- var xuniId = rows[0].VIRTUAL_ORG_ID_211;
- moveDownMax("EMC_AM_ORG_INLINK","sort_no",max,xuniId,"VIRTUAL_ORG_ID",fd_id,LinkGrid);
- }
- //加载人员列表的方法 20160520 此方法已经没用,但担心新的方法存在隐患故此保留
- function loadLinkManGrid(treeNode,id){
- //判定机构是否为虚拟机构
- if(treeNode==null){
- isVirtual=false;
- }else{
-
- isVirtual = treeNode.isVirtual=="1"?true:false;
- }
-
- //根据是否为虚拟机构判定能sql条件
- if(isVirtual){
-
- initCondition="IS_DEL=0 AND VIRTUAL_ORG_ID='"+treeNode.id+"'";
-
- }else{
-
- initCondition="IS_DEL = 0 AND VIRTUAL_ORG_ID IN (SELECT ORG_ID FROM EMC_DEPARTMENT_IN WHERE CORP_ID='"+treeNode.id+"' AND IS_VIRTUAL = '1' AND IS_DEL='0')";
-
- };
- //跟新loadparams
- loadParams={
- "listId" : '211',
- "condition" : initCondition,
- "direction":'asc',
- "sort": 'SORT_NO'
- };
-
- LinkGrid.setOptions({//重置加载列表的参数
- params :loadParams
- });
- LinkGrid.rend();
- document.location.reload();
-
- }
- //刷新information界面方法
- function refreshInformation(treeNode,id){
- /* //更新单击的树节点 20160520 唐群胜注
- parentClickOrg = parent.selectedTreeNode
- loadOrgInformation(parentClickOrg,id);
- loadLinkManGrid(parentClickOrg,id);
-
- //录入人 ENTRY_MAN_ID 机构表里存的录入人ID 机构表classId 213
- getOrgInfo(id); */
- document.location.reload();
- }
- //点击新增触发方法
- function onAdd1() {
- if(!checkIsVirtual(parentClickOrg.id)){
- top.Dialog.alert("实体机构不能添加人员");
- return;
- }
- //超级管理员只能维护本机单位的数据
- var corp_id = parentClickOrg.corpId;
- if(loginOrgId!=corp_id){
- top.Dialog.alert("只能维护本级单位的信息");
- return;
- }
- /* //调用父界面的打开tab方法
- parent.addTab("Add_Inlink.jsp","【"+parentClickOrg.name+"】新增人员") */
- var diag = new top.Dialog();// 定义一个窗口对象
- diag.Title = "新增"+parentClickOrg.name+"内部人员";// 窗口标题
- diag.URL = $.pathname() +"/page/business/am/org/query/virtual_add_inside.jsp?id="+parentClickOrg.id+"&name="+parentClickOrg.name+"&adminRoleId="+loginOrgId;// 窗口对应的页面
- diag.Height = 500;
- diag.Width = 1000;
- diag.Top = "30%";
- diag.ShowOkButton=false;// 不显示确认按钮
- diag.ShowCancelButton=false;// 不显示取消按钮
- diag.ButtonAlign="center";// 按钮居中
- diag.CancelEvent = function(){
- diag.close();
- diag=null;
- parent.resetWindowSize();
- };
- diag.show();// 显示窗口
- // 添加关闭按钮
- diag.addButton("close","关闭",function(){
- diag.close();
- diag=null;
- parent.resetWindowSize();
-
- });
- // 添加确定按钮
- diag.addButton("yes","保存",function(){
- var callbackfn = diag.innerFrame.contentWindow.addLinkManFn();
- if(callbackfn=="over"){
-
-
- //切换标签
- //parent.avtiveTab('tab1_index1');
- diag.close();
- diag=null;
-
- document.location.reload();
- //刷新表格
- /* refreshInformation(parentClickOrg,parentClickOrg.id);
- parent.resetWindowSize(); */
-
- }
- });
- }
- // 点击新增触发方法 20160520 方法早已废弃
- function onAdd() {
- if(!checkIsVirtual(parentClickOrg.id)){
- top.Dialog.alert("实体机构不能添加人员");
- return;
- }
- /* //调用父界面的打开tab方法
- parent.addTab("Add_Inlink.jsp","【"+parentClickOrg.name+"】新增人员") */
- var diag = new top.Dialog();// 定义一个窗口对象
- diag.Title = "新增内部人员";// 窗口标题
- diag.URL = $.pathname() +"/page/business/am/org/query/Add_Inlink.jsp?id="+parentClickOrg.id+"&name="+parentClickOrg.name;// 窗口对应的页面
- diag.Height = 500;
- diag.Width = 810;
- diag.ShowOkButton=false;// 不显示确认按钮
- diag.ShowCancelButton=false;// 不显示取消按钮
- diag.ButtonAlign="center";// 按钮居中
- diag.CancelEvent = function(){
- diag.close();
- diag=null;
- parent.resetWindowSize();
- };
- diag.show();// 显示窗口
- // 添加关闭按钮
- diag.addButton("close","关闭",function(){
- diag.close();
- diag=null;
- parent.resetWindowSize();
-
- });
- // 添加确定按钮
- diag.addButton("yes","确定",function(){
- var callbackfn = diag.innerFrame.contentWindow.addLinkManFn();
- if(callbackfn=="over"){
-
-
- //切换标签
- parent.avtiveTab('tab1_index1');
- diag.close();
- diag=null;
-
- //刷新表格
- refreshInformation(parentClickOrg,parentClickOrg.id);
- parent.resetWindowSize();
- }
- });
- }
- // 检查是否应急机构,不能给实体机构添加人员
- function checkIsVirtual(deptId){
- var flag=false;
- $.ajax({
- url : $.pathname() + '/ws/InDepartmentService/InDepartmentService/checkIsVirtual',
- async:false,
- type : 'post',
- timeout : 15000,
- data : deptId,
- dataType : 'json',
- success : function(data){
- if(data == '2'){
- flag=true;
- }
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- return flag;
- }
- // 点击修改按钮触发方法
- function onEdit() {
-
- var rows = LinkGrid.getSelectedRows();
- if (rows.length == 0) {
- top.Dialog.alert("请选择一条记录");
- return;
- }
- if (rows.length > 1) {
- top.Dialog.alert("只能选择一条记录");
- return;
- }
-
- //超级管理员只能维护本机单位的数据
- var corp_id = parentClickOrg.corpId;
- if(loginOrgId!=corp_id){
- top.Dialog.alert("只能维护本级单位的信息");
- return;
- }
-
-
- var fd_id = rows[0].FD_OBJECTID211;
- var user_id = rows[0].INLINK_INDEX_211;
- var name = rows[0].INLINK_NAME_211;
- parent.addTab("Update_Inlink.jsp?fd_id=" + fd_id,"修改【"+name+"】信息")
- // window.location.href="addoutlink.html?"+fd_id;
- }
- // 删除按钮点击事件
- function onDelete() {
- var rows = LinkGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要删除的记录!");
- return;
- }
-
- var corp_id = parentClickOrg.corpId;
- if(loginOrgId!=corp_id){
- top.Dialog.alert("只能维护本级单位的信息");
- return;
- }
- var ids = "";
- var userId = "";
- for (var i = 0; i < rowsLength; i++) {
- ids += rows[i].FD_OBJECTID211 + ",";
- userId += rows[i].INLINK_INDEX_211 +",";
- }
- userId=userId.substring(0, userId.length-1);
- var deptId = rows[0].VIRTUAL_ORG_ID_211;
- top.Dialog.confirm("确定要删除吗?|删除", function() {
- // 删除记录
- $.post($.pathname() + "/ws/crud/CRUDService/delete/", {
- "objectIDs" : ids,
- classid : 211
- }, function(result) {
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("删除成功");
- // 刷新表格数据
- LinkGrid.rend();// 刷新列表
- loadOrgInformation(parentClickOrg,parentClickOrg.id);//删除人员时机构信息中的人数也会进行变动
- //refreshInformation(parentClickOrg,parentClickOrg.id); 20160520 唐群胜注
- } else {
- top.Dialog.alert("删除失败!");
- }
- }, "json");
- });
- }
- // 导出
- function exportTotalData() {
- var rows = LinkGrid.getSelectedRows();
- var rowsLength = rows.length;
-
-
- //根据是否为虚拟机构判定能sql条件
- if(isVirtual){
-
- initCondition="IS_DEL=0 AND VIRTUAL_ORG_ID='"+parentClickOrg.id+"'";
-
- }else{
-
- initCondition="IS_DEL = 0 AND VIRTUAL_ORG_ID IN (SELECT ORG_ID FROM EMC_DEPARTMENT_IN WHERE INSTR(PATH_ID,'_"+parentClickOrg.id+"_')>0 AND IS_VIRTUAL = '1' AND IS_DEL='0')";
-
- };
-
- var sql = {
- "listId" : "211",
- "condition" : initCondition
- };
- if (rowsLength == 0) {
-
- top.Dialog.confirm("是否导出所有人员信息?|是", function() {
- excelExport(211, sql, decodeURI("内部部联系人"), "INLINK_INDEX,IS_DEL,UPDATEDATE,FD_OBJECTID,PARENT_DEPT,PARENT_ORG,MANAGER_DEPT,ENTRY_MAN_ID,SORT_NO,IS_SHOW_TEL");
- return;
- });
- }else{
-
-
- var ids = "";
- for ( var i = 0; i < rowsLength; i++) {
- ids += "'"+rows[i].FD_OBJECTID211+"'" + ",";
- }
- var temp = ids.substring(0,ids.length-1);
-
- var selectCondition = " IS_DEL='0' ";
- selectCondition += " AND FD_OBJECTID IN (" + temp + ") " ; //'%" +name+"%';
-
- var selectSql = {
- "listId" :'211' ,
- "condition" : selectCondition
- };
-
- top.Dialog.confirm("是否导出所选中的人员信息?|是", function() {
- excelExport(211, selectSql, decodeURI("内部部联系人"), "INLINK_INDEX,IS_DEL,UPDATEDATE,FD_OBJECTID,PARENT_DEPT,PARENT_ORG,MANAGER_DEPT,ENTRY_MAN_ID,SORT_NO,IS_SHOW_TEL");
- return;
- });
-
- }
- }
- function clickView(fdObjectId){
- parent.addTab("View_Inlink.jsp?fd_id=" + fdObjectId,"【"+parentClickOrg.name+"】查看人员");
- }
- //点击主键跳转详细信息页面
- this.openDetail = function(rowindex) {
- var row = LinkGrid.getRow(rowindex);
- var fd_id = row.FD_OBJECTID211;
- parent.addTab("View_Inlink.jsp?fd_id=" + fd_id,"【"+parentClickOrg.name+"】查看人员");
- };
- function showPrimaryKey(obj,index){
- var fd_id = obj.FD_OBJECTID211;
- parent.addTab("View_Inlink.jsp?fd_id=" + fd_id,"【"+parentClickOrg.name+"】查看人员");
- }
- function onView(){
- var rows = LinkGrid.getSelectedRows();
- if (rows.length == 0) {
- top.Dialog.alert("请选择一条记录");
- return;
- }
- if (rows.length > 1) {
- top.Dialog.alert("只能选择一条记录");
- return;
- }
- var fd_id = rows[0].FD_OBJECTID211;
- var name = rows[0].INLINK_NAME_211;
- parent.addTab("View_Inlink.jsp?fd_id=" + fd_id,"【"+name+"】详细信息");
-
- }
- function collect(){
-
- parent.addTab("Org_Collection.jsp?statisticId=" + parentClickOrg.id,"【"+parentClickOrg.name+"】统计信息");
- }
- function sendEmail(){
-
- window.location.href = "mailto:example@example.com";
- }
- function sendMessage(){
- var rows = LinkGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要发送的人员信息!");
- return;
- }
-
- var name = "";
- var iphone = "";
- for ( var i = 0; i < rowsLength; i++) {
- name += rows[i].INLINK_NAME_211 + ";";
- iphone += rows[i].PHONE_211 + ";";
- }
- addMsg(name,iphone);
- //g.loadData();
- //LinkGrid.rend();// 刷新列表
-
- }
- //上移组织机构联系人
- function moveUp(){
- var rows = LinkGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要移动的记录!");
- return;
- }
-
- if (rows.length > 1) {
- top.Dialog.alert("只能选择一条记录");
- return;
- }
- if (rows[0].__index == 0) {
- top.Dialog.alert("已经移动到顶端!");
- return;
- }
-
- var up_id = LinkGrid.getRow(rows[0].__index-1).FD_OBJECTID211;
- var fd_id = rows[0].FD_OBJECTID211;
- var up_sort = LinkGrid.getRow(rows[0].__index-1).SORT_NO_211;
- var fd_sort = rows[0].SORT_NO_211;
-
- $.post($.pathname() +"/ws/orgInDeptService/OrgInDeptService/getMove", {
- "up_id" : up_id,
- "fd_id" : fd_id,
- "up_sort" : up_sort,
- "fd_sort" : fd_sort
- }, function(result) {
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("上移成功",null,null,null,1);
- // 刷新表格数据
- LinkGrid.rend();
- //表格刷新成功后需要设置该行数据被选中
- setTimeout(function(){
- LinkGrid.select(rows[0].__index-1);
- },600);
- } else {
- top.Dialog.alert("上移失败!");
- }
- }, "json");
-
- }
- //下移组织机构联系人
- function moveDown(){
- var rows = LinkGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要移动的记录!");
- return;
- }
-
- if (rows.length > 1) {
- top.Dialog.alert("只能选择一条记录");
- return;
- }
-
- if(rows[0].__index+1==LinkGrid.getData().length){
- top.Dialog.alert("已经移动到底端!");
- return;
- }
-
- var up_id = LinkGrid.getRow(rows[0].__index+1).FD_OBJECTID211;
- var fd_id = rows[0].FD_OBJECTID211;
- var up_sort = LinkGrid.getRow(rows[0].__index+1).SORT_NO_211;
- var fd_sort = rows[0].SORT_NO_211;
-
- $.post($.pathname() +"/ws/orgInDeptService/OrgInDeptService/getMove", {
- "up_id" : up_id,
- "fd_id" : fd_id,
- "up_sort" : up_sort,
- "fd_sort" : fd_sort
- }, function(result) {
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("下移成功",null,null,null,1);
- // 刷新表格数据
- LinkGrid.rend();
- //表格刷新成功后需要设置该行数据被选中
- setTimeout(function(){
- LinkGrid.select(rows[0].__index+1);
- },600);
- } else {
- top.Dialog.alert("下移失败!");
- }
- }, "json");
- }
- function addTest(){
- parent.addVirtualOrg();
- }
- function editTest(){
- parent.editOrgInfo();
- }
- function deleteTest(){
- parent.deleteOrg();
- }
- /********显示机构信息**************/
- function showOrg(){
- //显示机构信息的时候需要隐藏掉隐藏机构信息的按钮 ID是hide
- //同时需要隐藏表格信息 id是grid
- $("#org").attr("style","border: 1px solid #cdcaca;margin:0px 3px 10px 3px;");
- $("#lururen").show();//录入人信息
- $("#hide").show();
- $("#show").hide();//隐藏:显示机构信息的按钮
- $("#linkman").hide();//隐藏表格
- $("#queryTd").hide();//隐藏查询框
-
- }
- /********隐藏机构信息***************/
- function hideOrg(){
- //隐藏机构信息的时候需要显示显示机构信息的按钮id是:show
- //同时需要显示表格信息 id是grid
- $("#org").attr("style","display: none; border-color:#999999;");
- $("#lururen").hide();//录入人信息
- $("#hide").hide();
- $("#show").show();//隐藏:显示机构信息的按钮
- $("#linkman").show();//隐藏表格
- $("#queryTd").show();//显示查询框
- }
- //处理高度自适应,每次浏览器尺寸变化时触发
- function customHeightSet(contentHeight){
- $(".layout_content").height(contentHeight-50)
- $("#page").height(contentHeight-50);
- }
- </script>
- </head>
- <body style="height:950px">
- <input type="hidden" id="hideInput" />
- <!-- 外面框架的盒子放组织机构详细信息和人员列表的 -->
- <div id="formContent" style="overflow:auto;border: 1px solid #cdcaca;background: white;">
- <!-- 头部的title -->
- <div style="height: 50px;border-style:solid;border-width:1px;border-right:1px;border-left:1px;border-top:1px;border-color:#cdcaca;" align="center">
- <font style="font-weight: bold;font-size: 20px;line-height: 45px;color:#3e62a0;" id="titleShow"></font>
- </div>
-
- <div class="table_class" style="margin:5px 5px 5px 5px">
-
- <!-- /*****************************机构基本信息*****************************/ -->
- <fieldset id="org" >
- <legend>机构信息</legend>
- <table width="100%" formMode="view">
- <tr id="zbdh">
- <td width="14%" align="right">总值班室电话:</td>
- <td width="19%" id="DUTY_TEL" name="DUTY_TEL"></td>
- <td width="14%" align="right">总值班室传真:</td>
- <td width="19%" id="DUTY_FAX" name="DUTY_FAX"></td>
- <td width="14%" align="right">总值班室邮箱:</td>
- <td width="20%" id="DUTY_EMAIL" name="DUTY_EMAIL"></td>
- </tr>
- <tr id="zhjg">
- <td align="right">总指挥:</td>
- <td id="ZONGZHIHUI" name="ZONGZHIHUI"></td>
- <td align="right">副总指挥:</td>
- <td id="FUZONGZHIHUI" name="FUZONGZHIHUI"></td>
- <td align="right">成员:</td>
- <td id="CHENGYUAN" name="CHENGYUAN"></td>
- </tr>
- <tr id="yjdh">
- <td width="14%" align="right">应急办电话:</td>
- <td width="19%" id="EMERGENCY_TEL" name="EMERGENCY_TEL"></td>
- <td width="14%" align="right">应急办传真:</td>
- <td width="19%" id="EMERGENCY_FAX" name="EMERGENCY_FAX"></td>
- <td width="14%" align="right">应急办邮箱:</td>
- <td width="20%" id="EMERGENCY_EMAIL" name="EMERGENCY_EMAIL"></td>
- </tr>
- <tr id="yjbcy">
- <td align="right">主任:</td>
- <td id="ZHUREN" name="ZHUREN"></td>
- <td align="right">副主任:</td>
- <td id="FUZHUREN" name="FUZHUREN"></td>
- <td align="right">成员:</td>
- <td id="CHENGYUAN1" name="CHENGYUAN1"></td>
- </tr>
- </table>
- </fieldset>
-
- <fieldset>
- <legend>人员信息</legend>
- <table width="100%" >
- <tr>
- <td align="left" width="257px" id="queryTd">
- <input class="validate[length[0,16]]" type="text" name="INLINK_NAME_211" id="INLINK_NAME_211" watermark="请输入姓名" clearable="true" />
- <a id="searchButt"><img src="/nwyj/scripts/qui/libs/icons/toolbar_icons/search_tem.png" alt="" /></a><input style='display:none' />
- </td>
- <!-- <td align="right">
-
- <input id="show" type="button" onclick="showOrg()" value="机构信息"/>
- <input id="hide" type="button" onclick="hideOrg()" value="人员信息"/>
- </td> -->
- </tr>
- </table>
- <!-- /******************************联系人列表*************************************/ -->
- <div id="linkman" style="width:100%;overflover:auto;margin: 5px 5px 10px 3px">
- <div class="padding_right5">
- <div id="InlinkMainGrid"></div>
- </div>
- </div>
- <!-- /******************************联系人列表end*************************************/ -->
- </fieldset>
-
- </div>
- </div>
- </body>
- </html>
|