8232eaf6da3dbf4bbc9917cf54682a83a1ace9fd.svn-base 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458
  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. <!--加载中开始-->
  30. <link href="<%=path%>/scripts/showLoading/showLoading.css" rel="stylesheet" type="text/css" />
  31. <script type="text/javascript" src="<%=path%>/scripts/showLoading/jquery.showLoading.js"></script>
  32. <!--加载中结束-->
  33. <style type ="text/css">
  34. //隐藏layout布局的线条
  35. .l-layout-center{
  36. border:none!important;
  37. _left:320px;
  38. _width:100%;
  39. }
  40. .l-layout-left{
  41. border:none!important;
  42. }
  43. .l-layout-drophandle-left{
  44. width: 1px;
  45. }
  46. body,div,ul,li,p{
  47. margin:0;
  48. padding:0;
  49. font-size: 14px;
  50. }
  51. .pageNumber {
  52. height:35px;
  53. }
  54. .tdTitle{
  55. width:10%;
  56. text-align:center;
  57. background:#f8f8f8;
  58. font-weight: bold;
  59. }
  60. ._paper_id{
  61. display:none;
  62. }
  63. </style>
  64. <script type="text/javascript">
  65. var isParent = "<%=request.getParameter("isParent")%>";//应急指挥中心为true,应急办为false
  66. //"贵州电网公司应急指挥中心成员名单"或"贵州电网公司应急办成员名单"
  67. var deptNameMsg = "";//"单位名称"+"应急指挥中心"/"应急办"+"成员名单"
  68. //取得用户真实名字
  69. var realName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
  70. var realName_ID = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  71. var realName_phe = top.com.sinosoft.lz.system.user.LoginInfo.getMobile();
  72. //登陆人单位name
  73. var loginOrgName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
  74. //定义grid表格对象
  75. var LinkGrid;
  76. //当前点击的机构节点
  77. var parentClickOrg;
  78. //登陆人的机构id
  79. var loginOrgId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  80. var dept_id = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  81. //被选择的机构的单位id
  82. var selectedCorpId = null;
  83. //grid表格的加载参数
  84. var loadParams;
  85. //grid表格的condition
  86. var initCondition;
  87. //判定是否点击的为虚拟机构还是实体机构
  88. var isVirtual = false;
  89. //定义查询sql
  90. var sql_condition="";
  91. //取登录人角色,安监部角色能看见必要按钮 R002105430213
  92. var role = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();
  93. var roles = role.split(",");
  94. //登陆人的id
  95. var User_ID1 = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  96. //移动号码正则表达式
  97. var regex = /^1(3[4-9]|5[012789]|8[23478]|4[7]|7[8])\d{8}$/;
  98. var disname = "应急角色";
  99. var condition6 = "";//保存按钮要用到的查询条件
  100. $searchButt = null;// 查询按钮
  101. $queryForm = null;
  102. //标题
  103. var name = null;
  104. var href = "";
  105. var version_name = "";
  106. //用于存储有单位或者部门为空的index
  107. var blankIndex = "";
  108. $(function(){
  109. href = decodeURI(location.href);
  110. var id = href.split("?")[2];
  111. var name =href.split("?")[3];
  112. var orgtype =href.split("?")[4];
  113. var pid =href.split("?")[5];
  114. var corp_id ="";
  115. $.ajax({
  116. data:{"org_id":id},
  117. type:'post',
  118. dataType:'text',
  119. async:false,
  120. url:"/nwyj/ws/LinkMan/LinkManService/getCorpId/",
  121. success:function(result){
  122. corp_id=result;
  123. }
  124. });
  125. if(!(id==null||id=="")){
  126. parent.check(id);
  127. parentClickOrg={
  128. "id":id,
  129. "name":name,
  130. "orgtype":orgtype,
  131. "pid":pid,
  132. "corpId":corp_id,
  133. "isVirtual":"1"
  134. };
  135. }else{
  136. parentClickOrg = parent.selectedTreeNode;//取父页面的值
  137. }
  138. selectedCorpId = parentClickOrg.corpId;
  139. var tempFlag = false;
  140. for(var i=0;i<roles.length;i++){
  141. if(roles[i]=="R002105430213"){
  142. tempFlag = true;
  143. }
  144. }
  145. if(!(tempFlag&&selectedCorpId==loginOrgId)){//不是安监部角色无法修改
  146. $("#update").hide();
  147. $("#titleShow").css("margin-left","0");
  148. }
  149. if(parentClickOrg.orgtype=="ZHZXYJB"){
  150. disname = "应急办角色";
  151. }else if(parentClickOrg.orgtype=="ZHZX"){
  152. disname = "应急指挥中心角色";
  153. }
  154. $("#titleShow").html(parentClickOrg.name);
  155. loadVersionInfo();//加载版本号
  156. LinkGridInit(parentClickOrg,parentClickOrg.id);//初始化表格的方法
  157. $(top.document).find("body").hideLoading();
  158. //若有空白的单位和部门,弹框提示“检测到第几行某某的所属单位或者部门信息有误, 请联系系统管理员解决该问题”
  159. if(blankIndex.length>0){
  160. blankIndex = blankIndex.substr(0,blankIndex.length-1);
  161. top.Dialog.alert("检测到"
  162. + blankIndex
  163. +"的所属单位或者部门信息有误, 请联系系统管理员解决该问题");
  164. }
  165. var gridHeight =$(".padding_right5").height();
  166. $(parent.document).find("#layout1").height(gridHeight+600);
  167. $(parent.document).find("#page").height(gridHeight+600);
  168. showOrgInfo();//加载机构信息的方法
  169. $queryForm = $("#queryForm");
  170. $searchButt = $("#searchButt");// 查询按钮
  171. $searchButt.bind('click', function() {
  172. search();
  173. });
  174. $("._toolBar_grid").bind('click',function(){
  175. parent.resetWindowSize()
  176. })
  177. $("._toolBar_singleRecode").bind('click',function(){
  178. parent.resetWindowSize1200(); //l-layout-center
  179. })
  180. //绑定查询框事件
  181. $("#INLINK_NAME_211").focus(function (){
  182. $("#INLINK_NAME_211").on("keyup", function(event) {
  183. var e = event||window.event;
  184. var getValue = $("#INLINK_NAME_211").val().trim();
  185. if(e&&e.keyCode=="13"){
  186. search();
  187. }
  188. });
  189. })
  190. if(parentClickOrg.name.indexOf("指挥中心")>0){
  191. $("#director").hide();
  192. $("#executive_deputy_director").hide();
  193. $("#deputy_director").hide();
  194. }else{
  195. $("#commander_in_chief").hide();
  196. $("#executive_deputy_commander").hide();
  197. $("#deputy_commander").hide();
  198. }
  199. });
  200. function loadVersionInfo(){
  201. var VIRTUAL_ORG_ID = parentClickOrg.id;
  202. $.ajax({
  203. data:{
  204. "virtual_org_id":VIRTUAL_ORG_ID
  205. },
  206. type:'post',
  207. dataType:'json',
  208. url:$.pathname() + '/ws/Linker/HistoryLinkerService/getVersionInfo/',
  209. success:function(data){
  210. if(data.title!=""&&data.title!="null"&&data.title!=null){
  211. $("#version_name").html(data.title);
  212. }
  213. version_name = data.title;//版本名称
  214. data.v_remark = data.v_remark.replace(/space/g,"&nbsp;");
  215. $("#v_remark").html(data.v_remark);//修改说明
  216. //录入人组件
  217. $("#recorder_name").html(data.made_man);
  218. $("#recorder_phone").html(data.made_man_phone);
  219. var dept_name = getDeptName(data.made_man_dept);
  220. var corp_name = getCorpName(data.made_man_dept);
  221. $("#recorder_dept").html(dept_name);
  222. $("#recorder_corp").html(corp_name);
  223. },
  224. error:function(){
  225. top.Dialog.alert("获取版本信息失败!");
  226. }
  227. });
  228. }
  229. /*
  230. * 获取单位
  231. */
  232. function getCorpName(id) {
  233. var rsl = "";
  234. $.ajax({
  235. url :$.pathname() + '/ws/Linker/HistoryLinkerService/getCorpName/',
  236. type : 'post',
  237. timeout : 60000,
  238. data : {
  239. id : id
  240. },
  241. async:false,
  242. dataType : 'text',
  243. success : function(result) {
  244. rsl = result;
  245. }
  246. });
  247. return rsl;
  248. }
  249. /*
  250. * 获取组织
  251. */
  252. function getDeptName(id) {
  253. var rsl = "";
  254. $.ajax({
  255. url : "/nwyj/ws/InDepartmentService/InDepartmentService/getDeptById/",
  256. type : 'post',
  257. timeout : 60000,
  258. data : {
  259. id : id
  260. },
  261. async:false,
  262. dataType : 'json',
  263. success : function(data) {
  264. rsl = data.DEPT_NAME;
  265. }
  266. });
  267. return rsl;
  268. }
  269. function search(){
  270. var getValue = $("#INLINK_NAME_211").val().trim();
  271. //去掉水印
  272. if(getValue=="请输入姓名"){
  273. getValue ="";
  274. }
  275. 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')";
  276. var params = {
  277. "listId" : '211',
  278. "condition" : searchCondition,
  279. "dir" : 'asc', // 排序方式
  280. sort : 'EMC_ROLE,SORT_NO',
  281. INLINK_NAME_211 : getValue
  282. };
  283. LinkGrid.setOptions( {
  284. params : params
  285. });
  286. LinkGrid.rend();//加载数据
  287. }
  288. //当前机构的节点取录入人信息 parentClickOrg
  289. //发送请求在机构表里取录入人ID
  290. function getOrgInfo(id){
  291. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  292. var params = {
  293. classid : '236',
  294. objectID : id
  295. };
  296. $.ajax({
  297. url : url,
  298. type : 'post',
  299. timeout : 60000,
  300. data : params,
  301. dataType : 'json',
  302. success : function(data){
  303. var userID = data.ENTRY_MAN_ID_236; //录入人ID
  304. getUserInfo(userID);
  305. },
  306. error : function(e){
  307. /* top.Dialog.alert('系统提示信息', '访问服务失败!', 'error'); */
  308. }
  309. });
  310. }
  311. //发送请求在机构表里取录入人ID
  312. function getUserInfo(userID){
  313. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  314. var params = {
  315. classid : '880',
  316. objectID : userID
  317. };
  318. $.ajax({
  319. url : url,
  320. type : 'post',
  321. timeout : 60000,
  322. data : params,
  323. dataType : 'json',
  324. success : function(data){
  325. var REAL_NAME_880 = data.REAL_NAME_880;
  326. var MOBILE = data.MOBILE_880; //手机
  327. //var COMPANY_ID = data.COMPANY_ID_880_SHOW;//所属单位
  328. var ORG_ID = data.ORG_ID_880_SHOW;//所属部门
  329. $("#REAL_NAME_880").html(REAL_NAME_880);
  330. $("#MOBILE_880").html(MOBILE);
  331. //$("#COMPANY_ID_880").html(COMPANY_ID);
  332. $("#ORG_ID_880").html(ORG_ID);
  333. },
  334. error : function(e){
  335. /* top.Dialog.alert('系统提示信息', '访问服务失败!', 'error'); */
  336. }
  337. });
  338. }
  339. //加载机构信息
  340. function showOrgInfo(){
  341. var rows = LinkGrid.getData();
  342. var num1 = 0 ;var num2 = 0 ;var num3 = 0 ;var num4 = 0 ;var num5 = 0 ;var num6 = 0 ;var num7 = 0 ;var num8 = 0 ;
  343. for(var i=0;i<rows.length;i++){
  344. if(rows[i].EMC_ROLE_211=="1"){
  345. num1++;
  346. }
  347. if(rows[i].EMC_ROLE_211=="2"){
  348. num2++;
  349. }
  350. if(rows[i].EMC_ROLE_211=="3"){
  351. num3++;
  352. }
  353. if(rows[i].EMC_ROLE_211=="4"){
  354. num4++;
  355. }
  356. if(rows[i].EMC_ROLE_211=="5"){
  357. num5++;
  358. }
  359. if(rows[i].EMC_ROLE_211=="6"){
  360. num6++;
  361. }
  362. if(rows[i].EMC_ROLE_211=="7"){
  363. num7++;
  364. }
  365. if(rows[i].EMC_ROLE_211=="8"){
  366. num8++;
  367. }
  368. }
  369. $("#total_num").html(rows.length);//总人数
  370. $("#commander_in_chief_num").html(num1);//总指挥
  371. $("#executive_deputy_commander_num").html(num2);//常务副总指挥
  372. $("#deputy_commander_num").html(num3);//副总指挥
  373. $("#director_num").html(num4);//主任
  374. $("#executive_deputy_director_num").html(num5);//常务副主任
  375. $("#deputy_director_num").html(num6);//副主任
  376. $("#member_num").html(num7);//成员
  377. //$("#manager_num").html(num8);//管理人员
  378. }
  379. //初始化表格的方法
  380. function LinkGridInit(treeNode,id){
  381. //判定机构是否为虚拟机构
  382. if(treeNode==null){
  383. isVirtual=false;
  384. }else{
  385. isVirtual = treeNode.isVirtual=="1"?true:false;
  386. }
  387. //根据是否为虚拟机构判定能sql条件
  388. if(isVirtual){
  389. initCondition="IS_DEL=0 AND VIRTUAL_ORG_ID='"+id+"'";
  390. }else{
  391. 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')";
  392. };
  393. //跟新loadparams
  394. loadParams={
  395. "listId" : '211',
  396. "condition" : initCondition,
  397. "dir" : 'asc', // 排序方式
  398. sort : 'emc_role,sort_no'
  399. };
  400. var roleCons = roleButtonArr();
  401. var toolBarOpt1 = {
  402. items : [/* {
  403. text : '添加',
  404. click : 'onAdd1',
  405. iconClass : 'add1_tem',
  406. id:"10209",
  407. disabled : false
  408. },
  409. {
  410. text : '删除',
  411. click : 'onDelete',
  412. iconClass : 'delete_tem',
  413. id:"1020b",
  414. disabled : false
  415. }, {
  416. text : '修改',
  417. click : 'onEdit',
  418. iconClass : 'update_tem',
  419. id:"1020a",
  420. disabled : false
  421. }, {
  422. text : '导出为模板',
  423. click : 'exportTotalData',
  424. iconClass : 'export_tem',
  425. id:"10006",
  426. disabled : false
  427. }, {
  428. text : '导入',
  429. click : 'importTotalData',
  430. iconClass : 'import_tem',
  431. id:"10007",
  432. disabled : false
  433. }, */
  434. {
  435. text : '导出为通讯录',
  436. click : 'exportContact',
  437. iconClass : 'export_tem',
  438. id:"10007",
  439. disabled : false
  440. }, {
  441. text : '短信',
  442. click : 'sendMessage',
  443. iconClass : 'sendmsg_tem',
  444. id:"10204",
  445. disabled : false
  446. } /*, {
  447. text : '邮件',
  448. click : 'sendEmail',
  449. iconClass : 'sendemail_tem',
  450. id:"10006",
  451. disabled : false
  452. } , {
  453. text : '汇总',
  454. click : 'collect',
  455. iconClass : 'collect_tem',
  456. id:"10007",
  457. disabled : false
  458. } , {
  459. text : '上移',
  460. click : 'moveUp',
  461. iconClass : 'shangyi_tem',
  462. id:"10209",
  463. disabled : false
  464. }
  465. , {
  466. text : '下移',
  467. click : 'moveDown',
  468. iconClass : 'xiayi_tem',
  469. id:"10209",
  470. disabled : false
  471. }, {
  472. text : '置顶',
  473. click : 'moveDownMax1(1)',
  474. iconClass : 'zhiding_tem',
  475. id:"10209",
  476. disabled : false
  477. } */
  478. ],
  479. roleCons:roleCons
  480. };
  481. var grid_option1 = {
  482. columns : [ {
  483. display : disname,
  484. name : 'EMC_ROLE_211_SHOW',
  485. align : 'center',
  486. width : "15%",
  487. render : function(rowdata, rowindex, value, column) {
  488. var test = "";
  489. if(value==null||value==""||value=="null"){//为空显示红色
  490. test = ";background-color:#FF5151";
  491. }
  492. return "<a href='javascript:;' style='width:100%;height:100%;color:black;display:block"+test+"' title='" + value + "'>" + value + "</a>";
  493. }
  494. },
  495. {
  496. display : '姓名',
  497. name : 'INLINK_NAME_211',
  498. align : 'center',
  499. width : "10%",
  500. isPrimaryKey:true,
  501. render : function(rowdata, rowindex, value, column) {
  502. var test = "";
  503. var title = value;
  504. if(value==null||value==""||value=="null"){//为空显示红色
  505. value = "";
  506. test = ";background-color:#FF5151";
  507. }else{
  508. var flag = compareName(rowdata.INLINK_INDEX_211,rowdata.INLINK_NAME_211);
  509. if(!flag){
  510. test = ";background-color:#ffff00";
  511. title = "该人员可能发生了调动,请确认所属单位和所属部门是否正确";
  512. }
  513. }
  514. return "<a href='javascript:;' style='width:100%;height:100%;display:block"+test+"' title='" + title + "' onclick='openDetail(" + rowindex + ")'>" + value + "</a>";
  515. }
  516. },
  517. {
  518. display : '所属单位',
  519. name : 'PARENT_ORG_ID_211_SHOW',
  520. align : 'center',
  521. width : "15%",
  522. render : function(rowdata, rowindex, value, column) {
  523. var test = "";
  524. var title = value;
  525. if(value==null||value==""||value=="null"){//为空显示红色
  526. value ="";
  527. test = ";background-color:#FF5151";
  528. }else{
  529. var flag = compareOrg(rowdata.INLINK_INDEX_211,rowdata.PARENT_DEPT_ID_211,rowdata.PARENT_ORG_ID_211);
  530. if(!flag){
  531. test = ";background-color:#ffff00";
  532. title = "该人员可能发生了调动,请确认所属单位和所属部门是否正确";
  533. }
  534. }
  535. return "<a href='javascript:;' style='width:100%;height:100%;color:black;display:block"+test+"' title='" + title + "'>" + value + "</a>";
  536. }
  537. },
  538. {
  539. display : '所属部门',
  540. name : 'PARENT_DEPT_ID_211',
  541. align : 'center',
  542. width : "30%",
  543. render : function(rowdata, rowindex, value, column) {
  544. var h = "";
  545. var test = "";
  546. h = getOrg(value);
  547. if(h==null||h==""||h=="null"||h==null){
  548. blankIndex += "第"+(rowindex+1) + "行"+rowdata.INLINK_NAME_211+","
  549. }
  550. rowdata.PARENT_DEPT_ID_211_SHOW = h;
  551. var title = h;
  552. if(h==null||h==""||h=="null"||h==null){//为空显示红色
  553. h = "";
  554. value ="";
  555. test = ";background-color:#FF5151";
  556. }else{
  557. var flag = compareDept(rowdata.INLINK_INDEX_211,rowdata.PARENT_DEPT_ID_211);
  558. if(!flag){
  559. test = ";background-color:#ffff00";
  560. title = "该人员可能发生了调动,请确认所属单位和所属部门是否正确";
  561. }
  562. }
  563. return "<a href='javascript:;' style='width:100%;height:100%;color:black;display:block"+test+"' title='" + title + "'>" + h + "</a>";
  564. }
  565. },
  566. {
  567. display : '手机',
  568. name : 'PHONE_211',
  569. align : 'center',
  570. width : "15%" ,
  571. render : function(rowdata, rowindex, value, column){
  572. var phone = "";var phone2 = "";
  573. var test = "";
  574. if(regex.test(value)){//移动号码
  575. phone = "1" == rowdata.IS_SHOW_TEL_211 ? "****" : value==null?"":value;
  576. phone2 = phone;
  577. }else{//非移动号码
  578. phone = "1" == rowdata.IS_SHOW_TEL_211 ? "<span style=\"color:blue\"><b>****(非移动号码)</b></span>" : "<span style=\"color:blue\"><b>"+value+"</b></span>";
  579. phone2 = "1" == rowdata.IS_SHOW_TEL_211 ? "****(本手机号为非移动号码,无法通过本平台发送短信)" : value+"(本手机号为非移动号码,无法通过本平台发送短信)";
  580. }
  581. if(value==null||value==""||value=="null"){
  582. test = ";background-color:#FF5151";
  583. phone = "";
  584. phone2 = "";
  585. }
  586. return "<a href='javascript:;' style='width:100%;height:100%;color:black;display:block"+test+"' title='" + phone2 + "'>" + phone + "</a>";
  587. }
  588. },
  589. {
  590. display : '4A账号',
  591. name : 'INLINK_INDEX_211',
  592. align : 'center',
  593. width : "15%",
  594. render : function(rowdata, rowindex, value, column) {
  595. var h = "";
  596. var test = "";
  597. $.ajax({
  598. url : $.pathname() + '/ws/crud/CRUDService/getDataById/',
  599. async:false,
  600. type : 'post',
  601. timeout : 15000,
  602. data : { classid : '880', objectID : value},
  603. dataType : 'json',
  604. success : function(data){
  605. h=data.LOGIN_NAME_880;
  606. },
  607. error : function(e){
  608. /* $.messager.alert('系统提示信息', '访问服务失败!', 'error'); */
  609. }
  610. });
  611. if(value==null||value==""||value=="null"){
  612. value ="";
  613. test = ";background-color:#FF5151";
  614. }
  615. return "<a href='javascript:;' style='width:100%;height:100%;color:black;display:block"+test+"' title='" + h + "'>" + h + "</a>";
  616. }
  617. }
  618. ],
  619. rownumbers : true,
  620. checkbox : true,
  621. percentWidthMode : true,
  622. usePager:false,
  623. headFixMode:true,
  624. //title:title
  625. };
  626. var options1={
  627. url : $.pathname() + '/ws/crud/CRUDService/query',
  628. params: loadParams,
  629. //width:"80%",
  630. gridOptions: grid_option1,
  631. singleRecodeOptions:{a:"aa"},
  632. paperOpration:{showInput:"true"},
  633. toolBarOptions: toolBarOpt1
  634. };
  635. LinkGrid = gridAndSingleRecode=$("#InlinkMainGrid").quickgridAndSingleRecode(options1);
  636. //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  637. var objMsg=JSON.stringify(options1);
  638. condition6 = options1.params.condition;
  639. }
  640. //置顶方法
  641. function moveDownMax1(max){
  642. var rows = LinkGrid.getSelectedRows();
  643. var rowsLength = rows.length;
  644. if (rowsLength == 0) {
  645. top.Dialog.alert("请选中要移动的记录!");
  646. return;
  647. }
  648. if (rows.length > 1) {
  649. top.Dialog.alert("只能选择一条记录");
  650. return;
  651. }
  652. var fd_id = rows[0].FD_OBJECTID211;
  653. //选中人的虚拟机构ID需要根据改ID去查询当前ID下挂着的人最小的序号
  654. //var xuniId = LinkGrid.getRow(rows[0].__index+1).VIRTUAL_ORG_ID_211;
  655. var xuniId = rows[0].VIRTUAL_ORG_ID_211;
  656. moveDownMax("EMC_AM_ORG_INLINK","sort_no",max,xuniId,"VIRTUAL_ORG_ID",fd_id,LinkGrid);
  657. }
  658. //加载人员列表的方法 20160520 此方法已经没用,但担心新的方法存在隐患故此保留
  659. function loadLinkManGrid(treeNode,id){
  660. //判定机构是否为虚拟机构
  661. if(treeNode==null){
  662. isVirtual=false;
  663. }else{
  664. isVirtual = treeNode.isVirtual=="1"?true:false;
  665. }
  666. //根据是否为虚拟机构判定能sql条件
  667. if(isVirtual){
  668. initCondition="IS_DEL=0 AND VIRTUAL_ORG_ID='"+treeNode.id+"'";
  669. }else{
  670. 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')";
  671. };
  672. //跟新loadparams
  673. loadParams={
  674. "listId" : '211',
  675. "condition" : initCondition,
  676. "direction":'asc',
  677. "sort": 'EMC_ROLE,SORT_NO'
  678. };
  679. LinkGrid.setOptions({//重置加载列表的参数
  680. params :loadParams
  681. });
  682. LinkGrid.rend();
  683. document.location.reload();
  684. }
  685. function getOrg(dept_id){
  686. var org = "";
  687. $.ajax({
  688. data:{
  689. "dept_id":dept_id
  690. },
  691. type:'post',
  692. dataType:'',
  693. async:false,
  694. url:$.pathname() + '/ws/Linker/HistoryLinkerService/getOrg/',
  695. success:function(result){
  696. org = result;
  697. }
  698. });
  699. return org;
  700. }
  701. //刷新information界面方法
  702. function refreshInformation(treeNode,id){
  703. /* //更新单击的树节点 20160520 唐群胜注
  704. parentClickOrg = parent.selectedTreeNode
  705. loadOrgInformation(parentClickOrg,id);
  706. loadLinkManGrid(parentClickOrg,id);
  707. //录入人 ENTRY_MAN_ID 机构表里存的录入人ID 机构表classId 213
  708. getOrgInfo(id); */
  709. document.location.reload();
  710. }
  711. //点击新增触发方法
  712. function onAdd1() {
  713. if(!checkIsVirtual(parentClickOrg.id)){
  714. top.Dialog.alert("实体机构不能添加人员");
  715. return;
  716. }
  717. //超级管理员只能维护本机单位的数据
  718. var corp_id = parentClickOrg.corpId;
  719. if(loginOrgId!=corp_id){
  720. top.Dialog.alert("只能维护本级单位的信息");
  721. return;
  722. }
  723. /* //调用父界面的打开tab方法
  724. parent.addTab("Add_Inlink.jsp","【"+parentClickOrg.name+"】新增人员") */
  725. var diag = new top.Dialog();// 定义一个窗口对象
  726. diag.Title = "新增"+parentClickOrg.name+"内部人员";// 窗口标题
  727. diag.URL = $.pathname() +"/page/business/am/org/query/virtual_add_inside.jsp?id="+parentClickOrg.id+"&name="+parentClickOrg.name+"&adminRoleId="+loginOrgId;// 窗口对应的页面
  728. diag.Height = 500;
  729. diag.Width = 1000;
  730. diag.Top = "30%";
  731. diag.ShowOkButton=false;// 不显示确认按钮
  732. diag.ShowCancelButton=false;// 不显示取消按钮
  733. diag.ButtonAlign="center";// 按钮居中
  734. diag.CancelEvent = function(){
  735. diag.close();
  736. diag=null;
  737. parent.resetWindowSize();
  738. };
  739. diag.show();// 显示窗口
  740. // 添加关闭按钮
  741. diag.addButton("close","关闭",function(){
  742. diag.close();
  743. diag=null;
  744. parent.resetWindowSize();
  745. });
  746. // 添加确定按钮
  747. diag.addButton("yes","保存",function(){
  748. var callbackfn = diag.innerFrame.contentWindow.addLinkManFn();
  749. if(callbackfn=="over"){
  750. //切换标签
  751. //parent.avtiveTab('tab1_index1');
  752. diag.close();
  753. diag=null;
  754. document.location.reload();
  755. //刷新表格
  756. /* refreshInformation(parentClickOrg,parentClickOrg.id);
  757. parent.resetWindowSize(); */
  758. }
  759. });
  760. }
  761. // 点击新增触发方法 20160520 方法早已废弃
  762. function onAdd() {
  763. if(!checkIsVirtual(parentClickOrg.id)){
  764. top.Dialog.alert("实体机构不能添加人员");
  765. return;
  766. }
  767. /* //调用父界面的打开tab方法
  768. parent.addTab("Add_Inlink.jsp","【"+parentClickOrg.name+"】新增人员") */
  769. var diag = new top.Dialog();// 定义一个窗口对象
  770. diag.Title = "新增内部人员";// 窗口标题
  771. diag.URL = $.pathname() +"/page/business/am/org/query/Add_Inlink.jsp?id="+parentClickOrg.id+"&name="+parentClickOrg.name;// 窗口对应的页面
  772. diag.Height = 500;
  773. diag.Width = 810;
  774. diag.ShowOkButton=false;// 不显示确认按钮
  775. diag.ShowCancelButton=false;// 不显示取消按钮
  776. diag.ButtonAlign="center";// 按钮居中
  777. diag.CancelEvent = function(){
  778. diag.close();
  779. diag=null;
  780. parent.resetWindowSize();
  781. };
  782. diag.show();// 显示窗口
  783. // 添加关闭按钮
  784. diag.addButton("close","关闭",function(){
  785. diag.close();
  786. diag=null;
  787. parent.resetWindowSize();
  788. });
  789. // 添加确定按钮
  790. diag.addButton("yes","确定",function(){
  791. var callbackfn = diag.innerFrame.contentWindow.addLinkManFn();
  792. if(callbackfn=="over"){
  793. //切换标签
  794. parent.avtiveTab('tab1_index1');
  795. diag.close();
  796. diag=null;
  797. //刷新表格
  798. refreshInformation(parentClickOrg,parentClickOrg.id);
  799. parent.resetWindowSize();
  800. }
  801. });
  802. }
  803. // 检查是否应急机构,不能给实体机构添加人员
  804. function checkIsVirtual(deptId){
  805. var flag=false;
  806. $.ajax({
  807. url : $.pathname() + '/ws/InDepartmentService/InDepartmentService/checkIsVirtual',
  808. async:false,
  809. type : 'post',
  810. timeout : 15000,
  811. data : deptId,
  812. dataType : 'json',
  813. success : function(data){
  814. if(data == '2'){
  815. flag=true;
  816. }
  817. },
  818. error : function(e){
  819. /* $.messager.alert('系统提示信息', '访问服务失败!', 'error'); */
  820. }
  821. });
  822. return flag;
  823. }
  824. // 点击修改按钮触发方法
  825. function onEdit() {
  826. var rows = LinkGrid.getSelectedRows();
  827. if (rows.length == 0) {
  828. top.Dialog.alert("请选择一条记录");
  829. return;
  830. }
  831. if (rows.length > 1) {
  832. top.Dialog.alert("只能选择一条记录");
  833. return;
  834. }
  835. //超级管理员只能维护本机单位的数据
  836. var corp_id = parentClickOrg.corpId;
  837. if(loginOrgId!=corp_id){
  838. top.Dialog.alert("只能维护本级单位的信息");
  839. return;
  840. }
  841. var fd_id = rows[0].FD_OBJECTID211;
  842. var user_id = rows[0].INLINK_INDEX_211;
  843. var name = rows[0].INLINK_NAME_211;
  844. parent.addTab("Update_Inlink.jsp?fd_id=" + fd_id,"修改【"+name+"】信息")
  845. // window.location.href="addoutlink.html?"+fd_id;
  846. }
  847. // 删除按钮点击事件
  848. function onDelete() {
  849. var rows = LinkGrid.getSelectedRows();
  850. var rowsLength = rows.length;
  851. if (rowsLength == 0) {
  852. top.Dialog.alert("请选中要删除的记录!");
  853. return;
  854. }
  855. var corp_id = parentClickOrg.corpId;
  856. if(loginOrgId!=corp_id){
  857. top.Dialog.alert("只能维护本级单位的信息");
  858. return;
  859. }
  860. var ids = "";
  861. var userId = "";
  862. for (var i = 0; i < rowsLength; i++) {
  863. ids += rows[i].FD_OBJECTID211 + ",";
  864. userId += rows[i].INLINK_INDEX_211 +",";
  865. }
  866. userId=userId.substring(0, userId.length-1);
  867. var deptId = rows[0].VIRTUAL_ORG_ID_211;
  868. top.Dialog.confirm("确定要删除吗?|删除", function() {
  869. // 删除记录
  870. $.post($.pathname() + "/ws/crud/CRUDService/delete/", {
  871. "objectIDs" : ids,
  872. classid : 211
  873. }, function(result) {
  874. if (result.Msg.sucsess == true) {
  875. top.Dialog.alert("删除成功");
  876. // 刷新表格数据
  877. LinkGrid.rend();// 刷新列表
  878. loadOrgInformation(parentClickOrg,parentClickOrg.id);//删除人员时机构信息中的人数也会进行变动
  879. //refreshInformation(parentClickOrg,parentClickOrg.id); 20160520 唐群胜注
  880. } else {
  881. top.Dialog.alert("删除失败!");
  882. }
  883. }, "json");
  884. });
  885. }
  886. // 导出为通讯录
  887. function exportContact() {
  888. var rows = LinkGrid.getSelectedRows();
  889. var rowsLength = rows.length;
  890. //根据是否为虚拟机构判定能sql条件
  891. var initCondition=" AND VIRTUAL_ORG_ID='"+parentClickOrg.id+"' ORDER BY EMC_ROLE,SORT_NO";
  892. if (rowsLength == 0) {
  893. top.Dialog.confirm("是否导出所有人员信息?|是", function() {
  894. exportData(initCondition);
  895. return;
  896. });
  897. }else{
  898. var ids = "";
  899. for ( var i = 0; i < rowsLength; i++) {
  900. ids += "'"+rows[i].FD_OBJECTID211+"'" + ",";
  901. }
  902. var temp = ids.substring(0,ids.length-1);
  903. var selectCondition = " AND VIRTUAL_ORG_ID='"+parentClickOrg.id+"' AND FD_OBJECTID IN (" + temp + ") ORDER BY EMC_ROLE,SORT_NO" ; //'%" +name+"%';
  904. top.Dialog.confirm("是否导出所选中的人员信息?|是", function() {
  905. exportData(selectCondition);
  906. return;
  907. });
  908. }
  909. }
  910. function exportData(condition){
  911. var params = {
  912. "condition":condition,
  913. "virtual_org_id":parentClickOrg.id,
  914. "version_name" :version_name
  915. };
  916. $.ajax({
  917. data:params,
  918. type:'post',
  919. dataType:'text',
  920. url:$.pathname() + '/ws/Linker/HistoryLinkerService/createContactExcel/',
  921. success:function(data){
  922. var url = "/nwyj/page/common/getExcel.jsp?exportContent="
  923. + data + "&destFileName="
  924. + encodeURI(encodeURI(parentClickOrg.name+"通讯录"));
  925. window.open(url);
  926. }
  927. });
  928. }
  929. function updateOrg(){
  930. //先检测历史表中是否存在处于编辑状态的版本
  931. var if_exist;
  932. if_exist = getHistoryVersion();
  933. if(if_exist){//若存在询问是否要创建新的版本
  934. ifGetNewVersion();
  935. }else{//不存在则直接创建新的版本
  936. getNewVersion();
  937. }
  938. }
  939. function getHistoryVersion(VIRTUAL_ORG_ID){
  940. var VIRTUAL_ORG_ID = parentClickOrg.id;
  941. var flag = false;
  942. $.ajax({
  943. data:{
  944. "virtual_org_id":VIRTUAL_ORG_ID
  945. },
  946. type:'post',
  947. dataType:'text',
  948. async:false,
  949. url:$.pathname() + '/ws/Linker/HistoryLinkerService/getHistoryVersion/',
  950. success:function(result){
  951. if(result=="true"){
  952. flag = true;
  953. }
  954. },
  955. error:function(){
  956. top.Dialog.alert("获取版本信息失败!");
  957. }
  958. });
  959. return flag;
  960. }
  961. function ifGetNewVersion(){
  962. var diag = new top.Dialog();
  963. diag.ShowOkButton=false;
  964. diag.ShowCancelButton=false;
  965. diag.ButtonAlign = 'center';
  966. diag.Height = 140;
  967. diag.Width = 500;
  968. diag.Top = "30%";
  969. diag.InnerHtml= "</br></br></br><div style='font-size:17px;text-align:center'>检测到存在编辑中的版本:</br>【是】,则继续编辑</br>【否】,则重新编辑</div>";
  970. diag.show();
  971. diag.addButton("close","否",function(){
  972. getNewVersion();
  973. diag.close();
  974. });
  975. diag.addButton("add","是",function(){
  976. var url = encodeURI($.pathname()+ "/page/business/am/org/query/AllInformationEdit.jsp?"+parentClickOrg.id+"?"+parentClickOrg.name+"?"+parentClickOrg.orgtype+"?"+parentClickOrg.pid+"?"+parentClickOrg.corpId+"?"+parentClickOrg.isVirtual);
  977. getEditWindow(url);
  978. diag.close();
  979. });
  980. }
  981. function getNewVersion(){
  982. deptNameMsg = parentClickOrg.name+"成员名单";
  983. var url = encodeURI($.pathname()+ "/page/business/am/org/query/AllInformationEdit.jsp?"+parentClickOrg.id+"?"+parentClickOrg.name+"?"+parentClickOrg.orgtype+"?"+parentClickOrg.pid+"?"+parentClickOrg.corpId+"?"+parentClickOrg.isVirtual+"?"+"true");
  984. getEditWindow(url);
  985. }
  986. function getEditWindow(url){
  987. var gridHeight =$(".padding_right5").height();
  988. var diag = new parent.Dialog();
  989. //短信管理按新增按钮时跳转地址
  990. diag.Title = "修改机构信息";
  991. diag.URL = url;
  992. diag.Top = "0%";
  993. diag.Left = "50%";
  994. diag.ID="updateOrg";
  995. diag.Height =gridHeight+800;
  996. diag.Width = 1200;
  997. diag.ShowOkButton=false;// 不显示确认按钮
  998. diag.ShowCancelButton=false;// 不显示取消按钮
  999. diag.ButtonAlign = 'center';
  1000. diag.show();
  1001. }
  1002. function clickView(fdObjectId){
  1003. parent.addTab("View_Inlink.jsp?fd_id=" + fdObjectId,"【"+parentClickOrg.name+"】查看人员");
  1004. }
  1005. //点击主键跳转详细信息页面
  1006. this.openDetail = function(rowindex) {
  1007. var row = LinkGrid.getRow(rowindex);
  1008. var fd_id = row.FD_OBJECTID211;
  1009. parent.addTab("View_Inlink.jsp?fd_id=" + fd_id,"【"+parentClickOrg.name+"】查看人员");
  1010. };
  1011. function showPrimaryKey(obj,index){
  1012. var fd_id = obj.FD_OBJECTID211;
  1013. parent.addTab("View_Inlink.jsp?fd_id=" + fd_id,"【"+parentClickOrg.name+"】查看人员");
  1014. }
  1015. function onView(){
  1016. var rows = LinkGrid.getSelectedRows();
  1017. if (rows.length == 0) {
  1018. top.Dialog.alert("请选择一条记录");
  1019. return;
  1020. }
  1021. if (rows.length > 1) {
  1022. top.Dialog.alert("只能选择一条记录");
  1023. return;
  1024. }
  1025. var fd_id = rows[0].FD_OBJECTID211;
  1026. var name = rows[0].INLINK_NAME_211;
  1027. parent.addTab("View_Inlink.jsp?fd_id=" + fd_id,"【"+name+"】详细信息");
  1028. }
  1029. function collect(){
  1030. parent.addTab("Org_Collection.jsp?statisticId=" + parentClickOrg.id,"【"+parentClickOrg.name+"】统计信息");
  1031. }
  1032. function sendEmail(){
  1033. window.location.href = "mailto:example@example.com";
  1034. }
  1035. function sendMessage(){
  1036. var rows = LinkGrid.getSelectedRows();
  1037. var rowsLength = rows.length;
  1038. if (rowsLength == 0) {
  1039. top.Dialog.alert("请选中要发送的人员信息!");
  1040. return;
  1041. }
  1042. var data = [];
  1043. for(var i=0;i<rowsLength;i++){
  1044. var rowdata = {
  1045. "userId":rows[i].INLINK_INDEX_211,
  1046. "userName" : rows[i].INLINK_NAME_211,
  1047. "org_name" : rows[i].PARENT_ORG_ID_211_SHOW,
  1048. "dept_name" : rows[i].PARENT_DEPT_ID_211_SHOW,
  1049. "phone" : rows[i].PHONE_211
  1050. }
  1051. data.push(rowdata);
  1052. }
  1053. var diag = new parent.Dialog();
  1054. //短信管理按新增按钮时跳转地址
  1055. var url = "/nwyj/page/system/newsms/sendMsg.html";
  1056. diag.Title = "修改人员 信息";
  1057. diag.URL = encodeURI(url);
  1058. diag.Top = "0%";
  1059. diag.Left = "50%";
  1060. diag.ID="sendMsg";
  1061. diag.Height = 850;
  1062. diag.Width = 1200;
  1063. diag.ShowOkButton=false;// 不显示确认按钮
  1064. diag.ShowCancelButton=false;// 不显示取消按钮
  1065. diag.ButtonAlign = 'center';
  1066. diag.OnLoad = function(){
  1067. diag.innerFrame.contentWindow.getValue(data,"日常管理/应急组织机构/组织机构管理","人工手动发送");
  1068. }
  1069. diag.show();
  1070. diag.addButton("close","关闭",function(){
  1071. diag.close();
  1072. });
  1073. }
  1074. //上移组织机构联系人
  1075. function moveUp(){
  1076. var rows = LinkGrid.getSelectedRows();
  1077. var rowsLength = rows.length;
  1078. if (rowsLength == 0) {
  1079. top.Dialog.alert("请选中要移动的记录!");
  1080. return;
  1081. }
  1082. if (rows.length > 1) {
  1083. top.Dialog.alert("只能选择一条记录");
  1084. return;
  1085. }
  1086. if (rows[0].__index == 0) {
  1087. top.Dialog.alert("已经移动到顶端!");
  1088. return;
  1089. }
  1090. var up_id = LinkGrid.getRow(rows[0].__index-1).FD_OBJECTID211;
  1091. var fd_id = rows[0].FD_OBJECTID211;
  1092. var up_sort = LinkGrid.getRow(rows[0].__index-1).SORT_NO_211;
  1093. var fd_sort = rows[0].SORT_NO_211;
  1094. $.post($.pathname() +"/ws/orgInDeptService/OrgInDeptService/getMove", {
  1095. "up_id" : up_id,
  1096. "fd_id" : fd_id,
  1097. "up_sort" : up_sort,
  1098. "fd_sort" : fd_sort
  1099. }, function(result) {
  1100. if (result.Msg.sucsess == true) {
  1101. // 刷新表格数据
  1102. LinkGrid.rend();
  1103. //表格刷新成功后需要设置该行数据被选中
  1104. setTimeout(function(){
  1105. LinkGrid.select(rows[0].__index-1);
  1106. },600);
  1107. } else {
  1108. top.Dialog.alert("上移失败!");
  1109. }
  1110. }, "json");
  1111. }
  1112. //下移组织机构联系人
  1113. function moveDown(){
  1114. var rows = LinkGrid.getSelectedRows();
  1115. var rowsLength = rows.length;
  1116. if (rowsLength == 0) {
  1117. top.Dialog.alert("请选中要移动的记录!");
  1118. return;
  1119. }
  1120. if (rows.length > 1) {
  1121. top.Dialog.alert("只能选择一条记录");
  1122. return;
  1123. }
  1124. if(rows[0].__index+1==LinkGrid.getData().length){
  1125. top.Dialog.alert("已经移动到底端!");
  1126. return;
  1127. }
  1128. var up_id = LinkGrid.getRow(rows[0].__index+1).FD_OBJECTID211;
  1129. var fd_id = rows[0].FD_OBJECTID211;
  1130. var up_sort = LinkGrid.getRow(rows[0].__index+1).SORT_NO_211;
  1131. var fd_sort = rows[0].SORT_NO_211;
  1132. $.post($.pathname() +"/ws/orgInDeptService/OrgInDeptService/getMove", {
  1133. "up_id" : up_id,
  1134. "fd_id" : fd_id,
  1135. "up_sort" : up_sort,
  1136. "fd_sort" : fd_sort
  1137. }, function(result) {
  1138. if (result.Msg.sucsess == true) {
  1139. //top.Dialog.alert("下移成功",null,null,null,1);
  1140. // 刷新表格数据
  1141. LinkGrid.rend();
  1142. //表格刷新成功后需要设置该行数据被选中
  1143. setTimeout(function(){
  1144. LinkGrid.select(rows[0].__index+1);
  1145. },600);
  1146. } else {
  1147. top.Dialog.alert("下移失败!");
  1148. }
  1149. }, "json");
  1150. }
  1151. function addTest(){
  1152. parent.addVirtualOrg();
  1153. }
  1154. function editTest(){
  1155. parent.editOrgInfo();
  1156. }
  1157. function deleteTest(){
  1158. parent.deleteOrg();
  1159. }
  1160. /********显示机构信息**************/
  1161. function showOrg(){
  1162. //显示机构信息的时候需要隐藏掉隐藏机构信息的按钮 ID是hide
  1163. //同时需要隐藏表格信息 id是grid
  1164. $("#org").attr("style","border: 1px solid #cdcaca;margin:0px 3px 10px 3px;");
  1165. $("#lururen").show();//录入人信息
  1166. $("#hide").show();
  1167. $("#show").hide();//隐藏:显示机构信息的按钮
  1168. $("#linkman").hide();//隐藏表格
  1169. $("#queryTd").hide();//隐藏查询框
  1170. }
  1171. /********隐藏机构信息***************/
  1172. function hideOrg(){
  1173. //隐藏机构信息的时候需要显示显示机构信息的按钮id是:show
  1174. //同时需要显示表格信息 id是grid
  1175. $("#org").attr("style","display: none; border-color:#999999;");
  1176. $("#lururen").hide();//录入人信息
  1177. $("#hide").hide();
  1178. $("#show").show();//隐藏:显示机构信息的按钮
  1179. $("#linkman").show();//隐藏表格
  1180. $("#queryTd").show();//显示查询框
  1181. }
  1182. //处理高度自适应,每次浏览器尺寸变化时触发
  1183. function customHeightSet(contentHeight){
  1184. $(".layout_content").height(contentHeight-50)
  1185. $("#page").height(contentHeight-50);
  1186. }
  1187. function compareName(id,name){
  1188. var flag = false;
  1189. $.ajax({
  1190. data:{
  1191. "user_id":id,
  1192. "user_name":name
  1193. },
  1194. type:'post',
  1195. dataType:'text',
  1196. async:false,
  1197. url:$.pathname()+'/ws/Linker/HistoryLinkerService/compareName',
  1198. success:function(result){
  1199. if(result=="true"){
  1200. flag = true;
  1201. }
  1202. }
  1203. });
  1204. return flag;
  1205. }
  1206. function compareOrg(id,dept_id,org){
  1207. var flag = false;
  1208. $.ajax({
  1209. data:{
  1210. "user_id":id,
  1211. "dept_id":dept_id,
  1212. "corp_id":org
  1213. },
  1214. type:'post',
  1215. dataType:'text',
  1216. async:false,
  1217. url:$.pathname()+'/ws/Linker/HistoryLinkerService/compareOrg',
  1218. success:function(result){
  1219. if(result=="true"){
  1220. flag= true;
  1221. }
  1222. }
  1223. });
  1224. return flag;
  1225. }
  1226. function compareDept(id,dept_id){
  1227. var flag = false;
  1228. $.ajax({
  1229. data:{
  1230. "user_id":id,
  1231. "dept_id":dept_id
  1232. },
  1233. type:'post',
  1234. dataType:'text',
  1235. async:false,
  1236. url:$.pathname()+'/ws/Linker/HistoryLinkerService/compareDept',
  1237. success:function(result){
  1238. if(result=="true"){
  1239. flag = true;
  1240. }
  1241. }
  1242. });
  1243. return flag;
  1244. }
  1245. </script>
  1246. </head>
  1247. <body style="height:950px">
  1248. <input type="hidden" id="hideInput" />
  1249. <!-- 外面框架的盒子放组织机构详细信息和人员列表的 -->
  1250. <div id="formContent" style="/* overflow:auto; */border: 1px solid #cdcaca;background: white;">
  1251. <!-- 头部的title -->
  1252. <div style="height: 50px;border-style:solid;border-width:1px;border-right:1px;border-left:1px;border-top:1px;border-color:#cdcaca;" align="center">
  1253. <font style="margin-left:30%;font-weight: bold;font-size: 20px;line-height: 45px;color:#3e62a0;"id="titleShow"></font>
  1254. <input id="update" type="button" value="修改" onclick="updateOrg()" style="margin-left:25%;" />
  1255. </div>
  1256. <div class="table_class" style="margin:5px 5px 5px 5px">
  1257. <div align="right" class="table_class" style="margin:5px 5px 0px 5px">
  1258. </div>
  1259. <!-- /*****************************机构基本信息*****************************/ -->
  1260. <fieldset id="org" >
  1261. <legend>机构信息</legend>
  1262. <table width="100%" formMode="view">
  1263. <tr>
  1264. <td>总人数<span style="color:blue" id = "total_num" name = "total_num">0</span>人、
  1265. <span id="commander_in_chief" name = "commander_in_chief">其中总指挥<span style="color:blue" id = "commander_in_chief_num" name = "commander_in_chief_num">0</span>人、</span>
  1266. <span id="executive_deputy_commander" name = "executive_deputy_commander">常务副总指挥<span style="color:blue" id = "executive_deputy_commander_num" name = "deputy_commander_num">0</span>人、</span>
  1267. <span id="deputy_commander" name = "deputy_commander">副总指挥<span style="color:blue" id = "deputy_commander_num" name = "deputy_commander_num">0</span>人、</span>
  1268. <span id="director" name = "director">主任<span style="color:blue" id = "director_num" name = "director_num">0</span>人、</span>
  1269. <span id="executive_deputy_director" name = "executive_deputy_director">常务副主任<span style="color:blue" id = "executive_deputy_director_num" name = "deputy_director_num">0</span>人、</span>
  1270. <span id="deputy_director" name = "deputy_director">副主任<span style="color:blue" id = "deputy_director_num" name = "deputy_director_num">0</span>人、</span>
  1271. 成员<span style="color:blue" id = "member_num" name = "member_num">0</span>人。
  1272. </td>
  1273. </tr>
  1274. <!-- <tr id="zbdh">
  1275. <td width="14%" align="right">总值班室电话:</td>
  1276. <td width="19%" id="DUTY_TEL" name="DUTY_TEL"></td>
  1277. <td width="14%" align="right">总值班室传真:</td>
  1278. <td width="19%" id="DUTY_FAX" name="DUTY_FAX"></td>
  1279. <td width="14%" align="right">总值班室邮箱:</td>
  1280. <td width="20%" id="DUTY_EMAIL" name="DUTY_EMAIL"></td>
  1281. </tr> -->
  1282. <!-- <tr id="zhjg">
  1283. <td align="right">总指挥:</td>
  1284. <td id="ZONGZHIHUI" name="ZONGZHIHUI"></td>
  1285. <td align="right">副总指挥:</td>
  1286. <td id="FUZONGZHIHUI" name="FUZONGZHIHUI"></td>
  1287. <td align="right">成员:</td>
  1288. <td id="CHENGYUAN" name="CHENGYUAN"></td>
  1289. </tr>
  1290. <tr id="yjdh">
  1291. <td width="14%" align="right">应急办电话:</td>
  1292. <td width="19%" id="EMERGENCY_TEL" name="EMERGENCY_TEL"></td>
  1293. <td width="14%" align="right">应急办传真:</td>
  1294. <td width="19%" id="EMERGENCY_FAX" name="EMERGENCY_FAX"></td>
  1295. <td width="14%" align="right">应急办邮箱:</td>
  1296. <td width="20%" id="EMERGENCY_EMAIL" name="EMERGENCY_EMAIL"></td>
  1297. </tr>
  1298. <tr id="yjbcy">
  1299. <td align="right">主任:</td>
  1300. <td id="ZHUREN" name="ZHUREN"></td>
  1301. <td align="right">副主任:</td>
  1302. <td id="FUZHUREN" name="FUZHUREN"></td>
  1303. <td align="right">成员:</td>
  1304. <td id="CHENGYUAN1" name="CHENGYUAN1"></td>
  1305. </tr> -->
  1306. </table>
  1307. </fieldset>
  1308. <fieldset>
  1309. <legend id ="version_name">人员信息</legend>
  1310. <!-- /******************************联系人列表*************************************/ -->
  1311. <div id="linkman" style="width:100%;margin: 5px 5px 10px 3px">
  1312. <div class="padding_right5">
  1313. <div id="InlinkMainGrid"></div>
  1314. </div>
  1315. 注:表格中标黄的信息为需要更新的数据
  1316. </div>
  1317. <!-- /******************************联系人列表end*************************************/ -->
  1318. </fieldset>
  1319. <fieldset>
  1320. <legend>修改说明</legend>
  1321. <div id = "v_remark"></div>
  1322. </fieldset>
  1323. <fieldset>
  1324. <legend>录入人信息</legend>
  1325. <table id="basicTable" class="tableStyle" formModle="line" width="98%">
  1326. <tr>
  1327. <td class="tdTitle">姓名:</td>
  1328. <td width="40%"><div id="recorder_name" name="recorder_name" type="text" readonly="readonly" ></div></td>
  1329. <td class="tdTitle">手机号码:</td>
  1330. <td width="40%"><div id="recorder_phone" name="recorder_phone" type="text" readonly="readonly"></div></td>
  1331. </tr>
  1332. <tr>
  1333. <td class="tdTitle">所属单位:</td>
  1334. <td width="40%"><div id="recorder_corp" name="corp_name" type="text" readonly="readonly"></div></td>
  1335. <td class="tdTitle">所属部门:</td>
  1336. <td width="40%"><div id="recorder_dept" name="dept_name" type="text" readonly="readonly"></div></td>
  1337. </tr>
  1338. </table>
  1339. </fieldset>
  1340. </div>
  1341. </div>
  1342. </body>
  1343. </html>