950a627ceccaea9130879356a1d2a14c525e077d.svn-base 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086
  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. <title>组织机构管理</title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=GBK" />
  7. <%request.setCharacterEncoding("GBK"); %>
  8. <!--框架必需start-->
  9. <%@include file="../.././../../include1.jsp"%>
  10. <!--引用资源文件,JS CSS-->
  11. <script type="text/javascript" src="<%=path%>/scripts/jquery/plugins/jquery.extension.util.js"></script>
  12. <script type="text/javascript" src="<%=path%>/scripts/freamwork/com/sinosoft/common/common.js"></script>
  13. <script type="text/javascript" src="<%=path%>/scripts/freamwork/com/sinosoft/common/utils/utils.js"></script>
  14. <script type="text/javascript" src="<%=path%>/scripts/freamwork/com/sinosoft/common/frameWork/frameWork.js"></script>
  15. <script type="text/javascript" src="<%=path%>/scripts/freamwork/com/sinosoft/common/utils/Request.js"></script>
  16. <script type="text/javascript" src="<%=path%>/scripts/freamwork/com/sinosoft/common/searchUtil.js"></script>
  17. <link href="<%=path%>/scripts/freamwork/com/sinosoft/common/searchUtil.css" rel="stylesheet" type="text/css"/>
  18. <!--基本选项卡start-->
  19. <!--框架必需end-->
  20. <!-- 按钮权限start -->
  21. <script type="text/javascript" src="/nwyj/scripts/freamwork/com/sinosoft/common/common.js"></script>
  22. <!-- 上移下移公共方法 -->
  23. <!-- 置顶 -->
  24. <script type="text/javascript" src="/nwyj/scripts/business/am/public/public.js"></script>
  25. <!-- 按钮权限end -->
  26. <script type="text/javascript" src="../../../../../scripts/freamwork/com/sinosoft/system/invoking/invoking.js"></script>
  27. <script type="text/javascript" src="/nwyj/page/business/em/report/reportCss/tableStyle.js"></script>
  28. <link href="/nwyj/page/business/em/report/reportCss/warnningreport.css" rel="stylesheet" type="text/css" />
  29. <style type ="text/css">
  30. //隐藏layout布局的线条
  31. .l-layout-center{
  32. border:none!important;
  33. _left:320px;
  34. _width:100%;
  35. }
  36. .l-layout-left{
  37. border:none!important;
  38. }
  39. .l-layout-drophandle-left{
  40. width: 1px;
  41. }
  42. body,div,ul,li,p{
  43. margin:0;
  44. padding:0;
  45. font-size: 14px;
  46. }
  47. </style>
  48. <script type="text/javascript">
  49. //定义grid表格对象
  50. var LinkGrid;
  51. //当前点击的机构节点
  52. var parentClickOrg;
  53. //登陆人的机构id
  54. var loginOrgId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  55. //grid表格的加载参数
  56. var loadParams;
  57. //grid表格的condition
  58. var initCondition;
  59. //判定是否点击的为虚拟机构还是实体机构
  60. var isVirtual = false;
  61. //定义查询sql
  62. var sql_condition="";
  63. //取登录人角色,超级管理员才能看见必要按钮 R002105430200
  64. var role = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();
  65. //登陆人的id
  66. var User_ID1 = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  67. //移动号码正则表达式
  68. var regex = /^1(3[4-9]|5[012789]|8[23478]|4[7]|7[8])\d{8}$/;
  69. var disname = "应急角色";
  70. $searchButt = null;// 查询按钮
  71. $queryForm = null;
  72. $(function(){
  73. //parent.getSelectTreeNode();
  74. parentClickOrg = parent.selectedTreeNode;//取父页面的值
  75. if(parentClickOrg.orgtype=="ZHZXYJB"){
  76. disname = "应急办角色";
  77. }else if(parentClickOrg.orgtype=="ZHZX"){
  78. disname = "应急指挥中心角色";
  79. }
  80. loadOrgInformation(parentClickOrg,parentClickOrg.id);//加载机构信息的方法
  81. LinkGridInit(parentClickOrg,parentClickOrg.id);//初始化表格的方法
  82. if(parentClickOrg.orgtype=="ZHZXYJB"){
  83. $("#zbdh").hide();
  84. $("#zhjg").hide();
  85. }else{
  86. $("#yjdh").hide();
  87. $("#yjbcy").hide();
  88. }
  89. $queryForm = $("#queryForm");
  90. $searchButt = $("#searchButt");// 查询按钮
  91. $searchButt.bind('click', function() {
  92. search();
  93. });
  94. $("._toolBar_grid").bind('click',function(){
  95. parent.resetWindowSize()
  96. })
  97. $("._toolBar_singleRecode").bind('click',function(){
  98. parent.resetWindowSize1200(); //l-layout-center
  99. })
  100. //绑定查询框事件
  101. $("#INLINK_NAME_211").focus(function (){
  102. $("#INLINK_NAME_211").on("keyup", function(event) {
  103. var e = event||window.event;
  104. var getValue = $("#INLINK_NAME_211").val().trim();
  105. if(e&&e.keyCode=="13"){
  106. search();
  107. }
  108. });
  109. })
  110. });
  111. function search(){
  112. var getValue = $("#INLINK_NAME_211").val().trim();
  113. //去掉水印
  114. if(getValue=="请输入姓名"){
  115. getValue ="";
  116. }
  117. 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')";
  118. var params = {
  119. "listId" : '211',
  120. "condition" : searchCondition,
  121. direction : 'asc', // 排序方式
  122. sort : 'SORT_NO',
  123. INLINK_NAME_211 : getValue
  124. };
  125. LinkGrid.setOptions( {
  126. params : params
  127. });
  128. LinkGrid.rend();//加载数据
  129. }
  130. //当前机构的节点取录入人信息 parentClickOrg
  131. //发送请求在机构表里取录入人ID
  132. function getOrgInfo(id){
  133. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  134. var params = {
  135. classid : '236',
  136. objectID : id
  137. };
  138. $.ajax({
  139. url : url,
  140. type : 'post',
  141. timeout : 60000,
  142. data : params,
  143. dataType : 'json',
  144. success : function(data){
  145. var userID = data.ENTRY_MAN_ID_236; //录入人ID
  146. getUserInfo(userID);
  147. },
  148. error : function(e){
  149. top.Dialog.alert('系统提示信息', '访问服务失败!', 'error');
  150. }
  151. });
  152. }
  153. //发送请求在机构表里取录入人ID
  154. function getUserInfo(userID){
  155. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  156. var params = {
  157. classid : '880',
  158. objectID : userID
  159. };
  160. $.ajax({
  161. url : url,
  162. type : 'post',
  163. timeout : 60000,
  164. data : params,
  165. dataType : 'json',
  166. success : function(data){
  167. var REAL_NAME_880 = data.REAL_NAME_880;
  168. var MOBILE = data.MOBILE_880; //手机
  169. //var COMPANY_ID = data.COMPANY_ID_880_SHOW;//所属单位
  170. var ORG_ID = data.ORG_ID_880_SHOW;//所属部门
  171. $("#REAL_NAME_880").html(REAL_NAME_880);
  172. $("#MOBILE_880").html(MOBILE);
  173. //$("#COMPANY_ID_880").html(COMPANY_ID);
  174. $("#ORG_ID_880").html(ORG_ID);
  175. },
  176. error : function(e){
  177. top.Dialog.alert('系统提示信息', '访问服务失败!', 'error');
  178. }
  179. });
  180. }
  181. //加载机构信息的方法
  182. function loadOrgInformation(treeNode,id){
  183. $.ajax({
  184. url : $.pathname()+'/ws/InDepartmentService/InDepartmentService/queryOrgInfoById',
  185. type : 'post',
  186. timeout : 60000,
  187. data : {"id":treeNode.id},
  188. dataType : 'json',
  189. success : function(data) {
  190. var json = JSON.stringify(data);
  191. for(var i in data){
  192. $("#"+i).html(data[i]);
  193. }
  194. $("#CHENGYUAN1").html(data.CHENGYUAN);
  195. /* $("#COMPANY_ID_880").html(data.ENTRY_MAN_NAME);
  196. var update = data.UPDATEDATE;
  197. $("#UPDATEDATE").html(update.substring(0, update.lastIndexOf(".")));
  198. //显示是否为虚拟机构
  199. if(data.IS_VIRTUAL=="1"){
  200. $("#IS_VIRTUAL").html("是");
  201. }else{
  202. $("#IS_VIRTUAL").html("否");
  203. } */
  204. //修改标题
  205. $("#titleShow").html(data.ORG_NAME);
  206. //getUserInfo(data.ENTRY_MAN_ID);
  207. },
  208. error : function(e) {
  209. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  210. }
  211. });
  212. }
  213. //初始化表格的方法
  214. function LinkGridInit(treeNode,id){
  215. //判定机构是否为虚拟机构
  216. if(treeNode==null){
  217. isVirtual=false;
  218. }else{
  219. isVirtual = treeNode.isVirtual=="1"?true:false;
  220. }
  221. //根据是否为虚拟机构判定能sql条件
  222. if(isVirtual){
  223. initCondition="IS_DEL=0 AND VIRTUAL_ORG_ID='"+id+"'";
  224. }else{
  225. 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')";
  226. };
  227. //跟新loadparams
  228. loadParams={
  229. "listId" : '211',
  230. "condition" : initCondition,
  231. direction : 'asc', // 排序方式
  232. sort : 'sort_no'
  233. };
  234. var roleCons = roleButtonArr();
  235. var toolBarOpt1 = {
  236. items : [{
  237. text : '添加',
  238. click : 'onAdd1',
  239. iconClass : 'add1_tem',
  240. id:"10209",
  241. disabled : false
  242. },
  243. /* {
  244. text : '添加',
  245. click : 'onAdd',
  246. iconClass : 'add1_tem',
  247. id:"10209",
  248. disabled : false
  249. }, */
  250. {
  251. text : '删除',
  252. click : 'onDelete',
  253. iconClass : 'delete_tem',
  254. id:"1020b",
  255. disabled : false
  256. }, {
  257. text : '修改',
  258. click : 'onEdit',
  259. iconClass : 'update_tem',
  260. id:"1020a",
  261. disabled : false
  262. },
  263. {
  264. text : '导出',
  265. click : 'exportTotalData',
  266. iconClass : 'export_tem',
  267. id:"10006",
  268. disabled : false
  269. }, {
  270. text : '短信',
  271. click : 'sendMessage',
  272. iconClass : 'sendmsg_tem',
  273. id:"10204",
  274. disabled : false
  275. }/* , {
  276. text : '邮件',
  277. click : 'sendEmail',
  278. iconClass : 'sendemail_tem',
  279. id:"10006",
  280. disabled : false
  281. } */
  282. /* , {
  283. text : '汇总',
  284. click : 'collect',
  285. iconClass : 'collect_tem',
  286. id:"10007",
  287. disabled : false
  288. } */
  289. , {
  290. text : '上移',
  291. click : 'moveUp',
  292. iconClass : 'shangyi_tem',
  293. id:"10209",
  294. disabled : false
  295. }
  296. , {
  297. text : '下移',
  298. click : 'moveDown',
  299. iconClass : 'xiayi_tem',
  300. id:"10209",
  301. disabled : false
  302. }, {
  303. text : '置顶',
  304. click : 'moveDownMax1(1)',
  305. iconClass : 'zhiding_tem',
  306. id:"10209",
  307. disabled : false
  308. }
  309. ],
  310. roleCons:roleCons
  311. };
  312. var grid_option1 = {
  313. columns : [ {
  314. display : disname,
  315. name : 'EMC_ROLE_211_SHOW',
  316. align : 'center',
  317. width : "20%",
  318. render : function(rowdata, rowindex, value, column) {
  319. var test = "";
  320. if(rowdata.PHONE_211==null||rowdata.EMC_ROLE_211==null)
  321. test = ";background-color:#FF5151";
  322. return "<a href='javascript:;' style='width:100%;height:100%;color:black;display:block"+test+"' title='" + value + "'>" + value + "</a>";
  323. }
  324. },
  325. {
  326. display : '姓名',
  327. name : 'INLINK_NAME_211',
  328. align : 'center',
  329. width : "10%",
  330. isPrimaryKey:true,
  331. /* render : function(rowdata, value) {
  332. return '<a href="javascript:void(0)" '
  333. + 'onclick=clickView("'
  334. + rowdata.FD_OBJECTID211
  335. +'")>'+ rowdata.INLINK_NAME_211 +'</a>';
  336. } */
  337. render : function(rowdata, rowindex, value, column) {
  338. var test = "";
  339. if(rowdata.PHONE_211==null||rowdata.EMC_ROLE_211==null)
  340. test = ";background-color:#FF5151";
  341. return "<a href='javascript:;' style='width:100%;height:100%;display:block"+test+"' title='" + value + "' onclick='openDetail(" + rowindex + ")'>" + value + "</a>";
  342. }
  343. },
  344. {
  345. display : '所属单位',
  346. name : 'PARENT_ORG_ID_211_SHOW',
  347. align : 'center',
  348. width : "20%",
  349. render : function(rowdata, rowindex, value, column) {
  350. var test = "";
  351. if(rowdata.PHONE_211==null||rowdata.EMC_ROLE_211==null)
  352. test = ";background-color:#FF5151";
  353. return "<a href='javascript:;' style='width:100%;height:100%;color:black;display:block"+test+"' title='" + value + "'>" + value + "</a>";
  354. }
  355. },
  356. {
  357. display : '所属部门',
  358. name : 'PARENT_DEPT_ID_211',
  359. align : 'center',
  360. width : "20%",
  361. render : function(rowdata, rowindex, value, column) {
  362. var h = "";
  363. var test = "";
  364. $.ajax({
  365. url : $.pathname() + '/ws/InDepartmentService/InDepartmentService/getDeptById/',
  366. async:false,
  367. type : 'post',
  368. timeout : 15000,
  369. data : { id : value},
  370. dataType : 'json',
  371. success : function(data){
  372. h=data.DEPT_NAME;
  373. },
  374. error : function(e){
  375. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  376. }
  377. });
  378. if(rowdata.PHONE_211==null||rowdata.EMC_ROLE_211==null)
  379. test = ";background-color:#FF5151";
  380. return "<a href='javascript:;' style='width:100%;height:100%;color:black;display:block"+test+"' title='" + h + "'>" + h + "</a>";
  381. }
  382. },
  383. {
  384. display : '手机',
  385. name : 'PHONE_211',
  386. align : 'center',
  387. width : "15%" ,
  388. render : function(rowdata, rowindex, value, column){
  389. var phone = "";var phone2 = "";
  390. var test = "";
  391. if(regex.test(value)||value==null){
  392. phone = "1" == rowdata.IS_SHOW_TEL_211 ? "****" : value==null?"":value;
  393. phone2 = phone;
  394. }else{
  395. phone = "1" == rowdata.IS_SHOW_TEL_211 ? "<span style=\"color:blue\"><b>****(非移动号码)</b></span>" : "<span style=\"color:blue\"><b>"+value+"</b></span>";
  396. phone2 = "1" == rowdata.IS_SHOW_TEL_211 ? "****(非移动号码)" : value;
  397. }
  398. if(rowdata.PHONE_211==null||rowdata.EMC_ROLE_211==null)
  399. test = ";background-color:#FF5151";
  400. return "<a href='javascript:;' style='width:100%;height:100%;color:black;display:block"+test+"' title='" + phone2 + "'>" + phone + "</a>";
  401. }
  402. },
  403. {
  404. display : '4A账号',
  405. name : 'INLINK_INDEX_211',
  406. align : 'center',
  407. width : "15%",
  408. render : function(rowdata, rowindex, value, column) {
  409. var h = "";
  410. var test = "";
  411. $.ajax({
  412. url : $.pathname() + '/ws/crud/CRUDService/getDataById/',
  413. async:false,
  414. type : 'post',
  415. timeout : 15000,
  416. data : { classid : '880', objectID : value},
  417. dataType : 'json',
  418. success : function(data){
  419. h=data.LOGIN_NAME_880;
  420. },
  421. error : function(e){
  422. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  423. }
  424. });
  425. if(rowdata.PHONE_211==null||rowdata.EMC_ROLE_211==null)
  426. test = ";background-color:#FF5151";
  427. return "<a href='javascript:;' style='width:100%;height:100%;color:black;display:block"+test+"' title='" + h + "'>" + h + "</a>";
  428. }
  429. }
  430. ],
  431. rownumbers : true,
  432. checkbox : true,
  433. pageSize : 10,
  434. /* rowAttrRender: function(rowdata, rowid){
  435. return ("" == rowdata.EMC_ROLE_211||"" == PHONE_211) ? "style=\"background-color:#76c3f9;\"" : '';
  436. }, */
  437. percentWidthMode : true
  438. };
  439. var options1={
  440. url : $.pathname() + '/ws/crud/CRUDService/queryQui',
  441. params: loadParams,
  442. //width:"80%",
  443. gridOptions: grid_option1,
  444. singleRecodeOptions:{a:"aa"},
  445. paperOpration:{showInput:"true"},
  446. toolBarOptions: toolBarOpt1
  447. };
  448. LinkGrid = gridAndSingleRecode=$("#InlinkMainGrid").quickgridAndSingleRecode(options1);
  449. }
  450. //置顶方法
  451. function moveDownMax1(max){
  452. var rows = LinkGrid.getSelectedRows();
  453. var rowsLength = rows.length;
  454. if (rowsLength == 0) {
  455. top.Dialog.alert("请选中要移动的记录!");
  456. return;
  457. }
  458. if (rows.length > 1) {
  459. top.Dialog.alert("只能选择一条记录");
  460. return;
  461. }
  462. /* if(rows[0].__index+1==LinkGrid.getData().length){
  463. top.Dialog.alert("已经移动到底端!");
  464. return;
  465. } */
  466. var fd_id = rows[0].FD_OBJECTID211;
  467. //选中人的虚拟机构ID需要根据改ID去查询当前ID下挂着的人最小的序号
  468. //var xuniId = LinkGrid.getRow(rows[0].__index+1).VIRTUAL_ORG_ID_211;
  469. var xuniId = rows[0].VIRTUAL_ORG_ID_211;
  470. moveDownMax("EMC_AM_ORG_INLINK","sort_no",max,xuniId,"VIRTUAL_ORG_ID",fd_id,LinkGrid);
  471. }
  472. //加载人员列表的方法 20160520 此方法已经没用,但担心新的方法存在隐患故此保留
  473. function loadLinkManGrid(treeNode,id){
  474. //判定机构是否为虚拟机构
  475. if(treeNode==null){
  476. isVirtual=false;
  477. }else{
  478. isVirtual = treeNode.isVirtual=="1"?true:false;
  479. }
  480. //根据是否为虚拟机构判定能sql条件
  481. if(isVirtual){
  482. initCondition="IS_DEL=0 AND VIRTUAL_ORG_ID='"+treeNode.id+"'";
  483. }else{
  484. 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')";
  485. };
  486. //跟新loadparams
  487. loadParams={
  488. "listId" : '211',
  489. "condition" : initCondition,
  490. "direction":'asc',
  491. "sort": 'SORT_NO'
  492. };
  493. LinkGrid.setOptions({//重置加载列表的参数
  494. params :loadParams
  495. });
  496. LinkGrid.rend();
  497. document.location.reload();
  498. }
  499. //刷新information界面方法
  500. function refreshInformation(treeNode,id){
  501. /* //更新单击的树节点 20160520 唐群胜注
  502. parentClickOrg = parent.selectedTreeNode
  503. loadOrgInformation(parentClickOrg,id);
  504. loadLinkManGrid(parentClickOrg,id);
  505. //录入人 ENTRY_MAN_ID 机构表里存的录入人ID 机构表classId 213
  506. getOrgInfo(id); */
  507. document.location.reload();
  508. }
  509. //点击新增触发方法
  510. function onAdd1() {
  511. if(!checkIsVirtual(parentClickOrg.id)){
  512. top.Dialog.alert("实体机构不能添加人员");
  513. return;
  514. }
  515. //超级管理员只能维护本机单位的数据
  516. var corp_id = parentClickOrg.corpId;
  517. if(loginOrgId!=corp_id){
  518. top.Dialog.alert("只能维护本级单位的信息");
  519. return;
  520. }
  521. /* //调用父界面的打开tab方法
  522. parent.addTab("Add_Inlink.jsp","【"+parentClickOrg.name+"】新增人员") */
  523. var diag = new top.Dialog();// 定义一个窗口对象
  524. diag.Title = "新增"+parentClickOrg.name+"内部人员";// 窗口标题
  525. diag.URL = $.pathname() +"/page/business/am/org/query/virtual_add_inside.jsp?id="+parentClickOrg.id+"&name="+parentClickOrg.name+"&adminRoleId="+loginOrgId;// 窗口对应的页面
  526. diag.Height = 500;
  527. diag.Width = 1000;
  528. diag.Top = "30%";
  529. diag.ShowOkButton=false;// 不显示确认按钮
  530. diag.ShowCancelButton=false;// 不显示取消按钮
  531. diag.ButtonAlign="center";// 按钮居中
  532. diag.CancelEvent = function(){
  533. diag.close();
  534. diag=null;
  535. parent.resetWindowSize();
  536. };
  537. diag.show();// 显示窗口
  538. // 添加关闭按钮
  539. diag.addButton("close","关闭",function(){
  540. diag.close();
  541. diag=null;
  542. parent.resetWindowSize();
  543. });
  544. // 添加确定按钮
  545. diag.addButton("yes","保存",function(){
  546. var callbackfn = diag.innerFrame.contentWindow.addLinkManFn();
  547. if(callbackfn=="over"){
  548. //切换标签
  549. //parent.avtiveTab('tab1_index1');
  550. diag.close();
  551. diag=null;
  552. document.location.reload();
  553. //刷新表格
  554. /* refreshInformation(parentClickOrg,parentClickOrg.id);
  555. parent.resetWindowSize(); */
  556. }
  557. });
  558. }
  559. // 点击新增触发方法 20160520 方法早已废弃
  560. function onAdd() {
  561. if(!checkIsVirtual(parentClickOrg.id)){
  562. top.Dialog.alert("实体机构不能添加人员");
  563. return;
  564. }
  565. /* //调用父界面的打开tab方法
  566. parent.addTab("Add_Inlink.jsp","【"+parentClickOrg.name+"】新增人员") */
  567. var diag = new top.Dialog();// 定义一个窗口对象
  568. diag.Title = "新增内部人员";// 窗口标题
  569. diag.URL = $.pathname() +"/page/business/am/org/query/Add_Inlink.jsp?id="+parentClickOrg.id+"&name="+parentClickOrg.name;// 窗口对应的页面
  570. diag.Height = 500;
  571. diag.Width = 810;
  572. diag.ShowOkButton=false;// 不显示确认按钮
  573. diag.ShowCancelButton=false;// 不显示取消按钮
  574. diag.ButtonAlign="center";// 按钮居中
  575. diag.CancelEvent = function(){
  576. diag.close();
  577. diag=null;
  578. parent.resetWindowSize();
  579. };
  580. diag.show();// 显示窗口
  581. // 添加关闭按钮
  582. diag.addButton("close","关闭",function(){
  583. diag.close();
  584. diag=null;
  585. parent.resetWindowSize();
  586. });
  587. // 添加确定按钮
  588. diag.addButton("yes","确定",function(){
  589. var callbackfn = diag.innerFrame.contentWindow.addLinkManFn();
  590. if(callbackfn=="over"){
  591. //切换标签
  592. parent.avtiveTab('tab1_index1');
  593. diag.close();
  594. diag=null;
  595. //刷新表格
  596. refreshInformation(parentClickOrg,parentClickOrg.id);
  597. parent.resetWindowSize();
  598. }
  599. });
  600. }
  601. // 检查是否应急机构,不能给实体机构添加人员
  602. function checkIsVirtual(deptId){
  603. var flag=false;
  604. $.ajax({
  605. url : $.pathname() + '/ws/InDepartmentService/InDepartmentService/checkIsVirtual',
  606. async:false,
  607. type : 'post',
  608. timeout : 15000,
  609. data : deptId,
  610. dataType : 'json',
  611. success : function(data){
  612. if(data == '2'){
  613. flag=true;
  614. }
  615. },
  616. error : function(e){
  617. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  618. }
  619. });
  620. return flag;
  621. }
  622. // 点击修改按钮触发方法
  623. function onEdit() {
  624. var rows = LinkGrid.getSelectedRows();
  625. if (rows.length == 0) {
  626. top.Dialog.alert("请选择一条记录");
  627. return;
  628. }
  629. if (rows.length > 1) {
  630. top.Dialog.alert("只能选择一条记录");
  631. return;
  632. }
  633. //超级管理员只能维护本机单位的数据
  634. var corp_id = parentClickOrg.corpId;
  635. if(loginOrgId!=corp_id){
  636. top.Dialog.alert("只能维护本级单位的信息");
  637. return;
  638. }
  639. var fd_id = rows[0].FD_OBJECTID211;
  640. var user_id = rows[0].INLINK_INDEX_211;
  641. var name = rows[0].INLINK_NAME_211;
  642. parent.addTab("Update_Inlink.jsp?fd_id=" + fd_id,"修改【"+name+"】信息")
  643. // window.location.href="addoutlink.html?"+fd_id;
  644. }
  645. // 删除按钮点击事件
  646. function onDelete() {
  647. var rows = LinkGrid.getSelectedRows();
  648. var rowsLength = rows.length;
  649. if (rowsLength == 0) {
  650. top.Dialog.alert("请选中要删除的记录!");
  651. return;
  652. }
  653. var corp_id = parentClickOrg.corpId;
  654. if(loginOrgId!=corp_id){
  655. top.Dialog.alert("只能维护本级单位的信息");
  656. return;
  657. }
  658. var ids = "";
  659. var userId = "";
  660. for (var i = 0; i < rowsLength; i++) {
  661. ids += rows[i].FD_OBJECTID211 + ",";
  662. userId += rows[i].INLINK_INDEX_211 +",";
  663. }
  664. userId=userId.substring(0, userId.length-1);
  665. var deptId = rows[0].VIRTUAL_ORG_ID_211;
  666. top.Dialog.confirm("确定要删除吗?|删除", function() {
  667. // 删除记录
  668. $.post($.pathname() + "/ws/crud/CRUDService/delete/", {
  669. "objectIDs" : ids,
  670. classid : 211
  671. }, function(result) {
  672. if (result.Msg.sucsess == true) {
  673. top.Dialog.alert("删除成功");
  674. // 刷新表格数据
  675. LinkGrid.rend();// 刷新列表
  676. loadOrgInformation(parentClickOrg,parentClickOrg.id);//删除人员时机构信息中的人数也会进行变动
  677. //refreshInformation(parentClickOrg,parentClickOrg.id); 20160520 唐群胜注
  678. } else {
  679. top.Dialog.alert("删除失败!");
  680. }
  681. }, "json");
  682. });
  683. }
  684. // 导出
  685. function exportTotalData() {
  686. var rows = LinkGrid.getSelectedRows();
  687. var rowsLength = rows.length;
  688. //根据是否为虚拟机构判定能sql条件
  689. if(isVirtual){
  690. initCondition="IS_DEL=0 AND VIRTUAL_ORG_ID='"+parentClickOrg.id+"'";
  691. }else{
  692. 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')";
  693. };
  694. var sql = {
  695. "listId" : "211",
  696. "condition" : initCondition
  697. };
  698. if (rowsLength == 0) {
  699. top.Dialog.confirm("是否导出所有人员信息?|是", function() {
  700. 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");
  701. return;
  702. });
  703. }else{
  704. var ids = "";
  705. for ( var i = 0; i < rowsLength; i++) {
  706. ids += "'"+rows[i].FD_OBJECTID211+"'" + ",";
  707. }
  708. var temp = ids.substring(0,ids.length-1);
  709. var selectCondition = " IS_DEL='0' ";
  710. selectCondition += " AND FD_OBJECTID IN (" + temp + ") " ; //'%" +name+"%';
  711. var selectSql = {
  712. "listId" :'211' ,
  713. "condition" : selectCondition
  714. };
  715. top.Dialog.confirm("是否导出所选中的人员信息?|是", function() {
  716. 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");
  717. return;
  718. });
  719. }
  720. }
  721. function clickView(fdObjectId){
  722. parent.addTab("View_Inlink.jsp?fd_id=" + fdObjectId,"【"+parentClickOrg.name+"】查看人员");
  723. }
  724. //点击主键跳转详细信息页面
  725. this.openDetail = function(rowindex) {
  726. var row = LinkGrid.getRow(rowindex);
  727. var fd_id = row.FD_OBJECTID211;
  728. parent.addTab("View_Inlink.jsp?fd_id=" + fd_id,"【"+parentClickOrg.name+"】查看人员");
  729. };
  730. function showPrimaryKey(obj,index){
  731. var fd_id = obj.FD_OBJECTID211;
  732. parent.addTab("View_Inlink.jsp?fd_id=" + fd_id,"【"+parentClickOrg.name+"】查看人员");
  733. }
  734. function onView(){
  735. var rows = LinkGrid.getSelectedRows();
  736. if (rows.length == 0) {
  737. top.Dialog.alert("请选择一条记录");
  738. return;
  739. }
  740. if (rows.length > 1) {
  741. top.Dialog.alert("只能选择一条记录");
  742. return;
  743. }
  744. var fd_id = rows[0].FD_OBJECTID211;
  745. var name = rows[0].INLINK_NAME_211;
  746. parent.addTab("View_Inlink.jsp?fd_id=" + fd_id,"【"+name+"】详细信息");
  747. }
  748. function collect(){
  749. parent.addTab("Org_Collection.jsp?statisticId=" + parentClickOrg.id,"【"+parentClickOrg.name+"】统计信息");
  750. }
  751. function sendEmail(){
  752. window.location.href = "mailto:example@example.com";
  753. }
  754. function sendMessage(){
  755. var rows = LinkGrid.getSelectedRows();
  756. var rowsLength = rows.length;
  757. if (rowsLength == 0) {
  758. top.Dialog.alert("请选中要发送的人员信息!");
  759. return;
  760. }
  761. var name = "";
  762. var iphone = "";
  763. for ( var i = 0; i < rowsLength; i++) {
  764. name += rows[i].INLINK_NAME_211 + ";";
  765. iphone += rows[i].PHONE_211 + ";";
  766. }
  767. addMsg(name,iphone);
  768. //g.loadData();
  769. //LinkGrid.rend();// 刷新列表
  770. }
  771. //上移组织机构联系人
  772. function moveUp(){
  773. var rows = LinkGrid.getSelectedRows();
  774. var rowsLength = rows.length;
  775. if (rowsLength == 0) {
  776. top.Dialog.alert("请选中要移动的记录!");
  777. return;
  778. }
  779. if (rows.length > 1) {
  780. top.Dialog.alert("只能选择一条记录");
  781. return;
  782. }
  783. if (rows[0].__index == 0) {
  784. top.Dialog.alert("已经移动到顶端!");
  785. return;
  786. }
  787. var up_id = LinkGrid.getRow(rows[0].__index-1).FD_OBJECTID211;
  788. var fd_id = rows[0].FD_OBJECTID211;
  789. var up_sort = LinkGrid.getRow(rows[0].__index-1).SORT_NO_211;
  790. var fd_sort = rows[0].SORT_NO_211;
  791. $.post($.pathname() +"/ws/orgInDeptService/OrgInDeptService/getMove", {
  792. "up_id" : up_id,
  793. "fd_id" : fd_id,
  794. "up_sort" : up_sort,
  795. "fd_sort" : fd_sort
  796. }, function(result) {
  797. if (result.Msg.sucsess == true) {
  798. top.Dialog.alert("上移成功",null,null,null,1);
  799. // 刷新表格数据
  800. LinkGrid.rend();
  801. //表格刷新成功后需要设置该行数据被选中
  802. setTimeout(function(){
  803. LinkGrid.select(rows[0].__index-1);
  804. },600);
  805. } else {
  806. top.Dialog.alert("上移失败!");
  807. }
  808. }, "json");
  809. }
  810. //下移组织机构联系人
  811. function moveDown(){
  812. var rows = LinkGrid.getSelectedRows();
  813. var rowsLength = rows.length;
  814. if (rowsLength == 0) {
  815. top.Dialog.alert("请选中要移动的记录!");
  816. return;
  817. }
  818. if (rows.length > 1) {
  819. top.Dialog.alert("只能选择一条记录");
  820. return;
  821. }
  822. if(rows[0].__index+1==LinkGrid.getData().length){
  823. top.Dialog.alert("已经移动到底端!");
  824. return;
  825. }
  826. var up_id = LinkGrid.getRow(rows[0].__index+1).FD_OBJECTID211;
  827. var fd_id = rows[0].FD_OBJECTID211;
  828. var up_sort = LinkGrid.getRow(rows[0].__index+1).SORT_NO_211;
  829. var fd_sort = rows[0].SORT_NO_211;
  830. $.post($.pathname() +"/ws/orgInDeptService/OrgInDeptService/getMove", {
  831. "up_id" : up_id,
  832. "fd_id" : fd_id,
  833. "up_sort" : up_sort,
  834. "fd_sort" : fd_sort
  835. }, function(result) {
  836. if (result.Msg.sucsess == true) {
  837. top.Dialog.alert("下移成功",null,null,null,1);
  838. // 刷新表格数据
  839. LinkGrid.rend();
  840. //表格刷新成功后需要设置该行数据被选中
  841. setTimeout(function(){
  842. LinkGrid.select(rows[0].__index+1);
  843. },600);
  844. } else {
  845. top.Dialog.alert("下移失败!");
  846. }
  847. }, "json");
  848. }
  849. function addTest(){
  850. parent.addVirtualOrg();
  851. }
  852. function editTest(){
  853. parent.editOrgInfo();
  854. }
  855. function deleteTest(){
  856. parent.deleteOrg();
  857. }
  858. /********显示机构信息**************/
  859. function showOrg(){
  860. //显示机构信息的时候需要隐藏掉隐藏机构信息的按钮 ID是hide
  861. //同时需要隐藏表格信息 id是grid
  862. $("#org").attr("style","border: 1px solid #cdcaca;margin:0px 3px 10px 3px;");
  863. $("#lururen").show();//录入人信息
  864. $("#hide").show();
  865. $("#show").hide();//隐藏:显示机构信息的按钮
  866. $("#linkman").hide();//隐藏表格
  867. $("#queryTd").hide();//隐藏查询框
  868. }
  869. /********隐藏机构信息***************/
  870. function hideOrg(){
  871. //隐藏机构信息的时候需要显示显示机构信息的按钮id是:show
  872. //同时需要显示表格信息 id是grid
  873. $("#org").attr("style","display: none; border-color:#999999;");
  874. $("#lururen").hide();//录入人信息
  875. $("#hide").hide();
  876. $("#show").show();//隐藏:显示机构信息的按钮
  877. $("#linkman").show();//隐藏表格
  878. $("#queryTd").show();//显示查询框
  879. }
  880. //处理高度自适应,每次浏览器尺寸变化时触发
  881. function customHeightSet(contentHeight){
  882. $(".layout_content").height(contentHeight-50)
  883. $("#page").height(contentHeight-50);
  884. }
  885. </script>
  886. </head>
  887. <body style="height:950px">
  888. <input type="hidden" id="hideInput" />
  889. <!-- 外面框架的盒子放组织机构详细信息和人员列表的 -->
  890. <div id="formContent" style="overflow:auto;border: 1px solid #cdcaca;background: white;">
  891. <!-- 头部的title -->
  892. <div style="height: 50px;border-style:solid;border-width:1px;border-right:1px;border-left:1px;border-top:1px;border-color:#cdcaca;" align="center">
  893. <font style="font-weight: bold;font-size: 20px;line-height: 45px;color:#3e62a0;" id="titleShow"></font>
  894. </div>
  895. <div class="table_class" style="margin:5px 5px 5px 5px">
  896. <!-- /*****************************机构基本信息*****************************/ -->
  897. <fieldset id="org" >
  898. <legend>机构信息</legend>
  899. <table width="100%" formMode="view">
  900. <tr id="zbdh">
  901. <td width="14%" align="right">总值班室电话:</td>
  902. <td width="19%" id="DUTY_TEL" name="DUTY_TEL"></td>
  903. <td width="14%" align="right">总值班室传真:</td>
  904. <td width="19%" id="DUTY_FAX" name="DUTY_FAX"></td>
  905. <td width="14%" align="right">总值班室邮箱:</td>
  906. <td width="20%" id="DUTY_EMAIL" name="DUTY_EMAIL"></td>
  907. </tr>
  908. <tr id="zhjg">
  909. <td align="right">总指挥:</td>
  910. <td id="ZONGZHIHUI" name="ZONGZHIHUI"></td>
  911. <td align="right">副总指挥:</td>
  912. <td id="FUZONGZHIHUI" name="FUZONGZHIHUI"></td>
  913. <td align="right">成员:</td>
  914. <td id="CHENGYUAN" name="CHENGYUAN"></td>
  915. </tr>
  916. <tr id="yjdh">
  917. <td width="14%" align="right">应急办电话:</td>
  918. <td width="19%" id="EMERGENCY_TEL" name="EMERGENCY_TEL"></td>
  919. <td width="14%" align="right">应急办传真:</td>
  920. <td width="19%" id="EMERGENCY_FAX" name="EMERGENCY_FAX"></td>
  921. <td width="14%" align="right">应急办邮箱:</td>
  922. <td width="20%" id="EMERGENCY_EMAIL" name="EMERGENCY_EMAIL"></td>
  923. </tr>
  924. <tr id="yjbcy">
  925. <td align="right">主任:</td>
  926. <td id="ZHUREN" name="ZHUREN"></td>
  927. <td align="right">副主任:</td>
  928. <td id="FUZHUREN" name="FUZHUREN"></td>
  929. <td align="right">成员:</td>
  930. <td id="CHENGYUAN1" name="CHENGYUAN1"></td>
  931. </tr>
  932. </table>
  933. </fieldset>
  934. <fieldset>
  935. <legend>人员信息</legend>
  936. <table width="100%" >
  937. <tr>
  938. <td align="left" width="257px" id="queryTd">
  939. <input class="validate[length[0,16]]" type="text" name="INLINK_NAME_211" id="INLINK_NAME_211" watermark="请输入姓名" clearable="true" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  940. <a id="searchButt"><img src="/nwyj/scripts/qui/libs/icons/toolbar_icons/search_tem.png" alt="" /></a><input style='display:none' />
  941. </td>
  942. <!-- <td align="right">
  943. <input id="show" type="button" onclick="showOrg()" value="机构信息"/>
  944. <input id="hide" type="button" onclick="hideOrg()" value="人员信息"/>
  945. </td> -->
  946. </tr>
  947. </table>
  948. <!-- /******************************联系人列表*************************************/ -->
  949. <div id="linkman" style="width:100%;overflover:auto;margin: 5px 5px 10px 3px">
  950. <div class="padding_right5">
  951. <div id="InlinkMainGrid"></div>
  952. </div>
  953. </div>
  954. <!-- /******************************联系人列表end*************************************/ -->
  955. </fieldset>
  956. </div>
  957. </div>
  958. </body>
  959. </html>