29e0c9a2d3dd6267ed168dd9759a488d32e264cf.svn-base 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  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=utf-8" />
  7. <!--框架必需start-->
  8. <%@include file="../.././../../include1.jsp"%>
  9. <!--引用资源文件,JS CSS-->
  10. <script type="text/javascript"
  11. src="<%=path%>/scripts/jquery/plugins/jquery.extension.util.js"></script>
  12. <script type="text/javascript"
  13. src="<%=path%>/scripts/freamwork/com/sinosoft/common/common.js"></script>
  14. <script type="text/javascript"
  15. src="<%=path%>/scripts/freamwork/com/sinosoft/common/utils/utils.js"></script>
  16. <script type="text/javascript"
  17. src="<%=path%>/scripts/freamwork/com/sinosoft/common/frameWork/frameWork.js"></script>
  18. <script type="text/javascript"
  19. src="<%=path%>/scripts/freamwork/com/sinosoft/common/utils/Request.js"></script>
  20. <script type="text/javascript"
  21. src="<%=path%>/scripts/freamwork/com/sinosoft/common/searchUtil.js"></script>
  22. <link
  23. href="<%=path%>/scripts/freamwork/com/sinosoft/common/searchUtil.css"
  24. rel="stylesheet" type="text/css" />
  25. <style type = "text/css">
  26. .legend{
  27. font-family:宋体;
  28. font-weight: bold;
  29. font-size:14px;
  30. color:#3e62a0;
  31. }
  32. .table-style{
  33. border-style:solid;
  34. border-width:1px;
  35. border-color:#cdcaca;
  36. margin:0px 20px 0px 20px;
  37. border-collapse:collapse;
  38. width: 895px;
  39. }
  40. .table-style2{
  41. border:1px solid #cdcaca;
  42. margin:0px 20px 0px 20px;
  43. border-collapse:collapse;
  44. width: 895px;
  45. }
  46. .td-font{
  47. font-family:宋体;
  48. font-size:14px;
  49. color:#161616;
  50. }
  51. .td-move{
  52. padding: 10px 5px 0px 0px;
  53. }
  54. .td-style{
  55. border:1px solid #cdcaca;
  56. border-collapse:collapse;
  57. padding-left: 10px
  58. }
  59. </style>
  60. <script type="text/javascript">
  61. //新增的父机构节点
  62. var parentClickOrg = parent.selectedTreeNode;
  63. //登录人id
  64. var entryManId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  65. //tab 标签id
  66. var tabId = parent.tabIndex;
  67. //重置的值
  68. var resetValue={};
  69. $(function(){
  70. //绑定重置按钮
  71. $("#OrgReset").bind("click",function(){
  72. window.location.href="/nwyj/page/business/am/org/query/Add_VirtualOrg.jsp";
  73. //reset_input();
  74. })
  75. //给下拉框赋值--常量表中的
  76. //$("#ORG_TYPE").initCanstSelect('BM_VIRTUAL_ORG_TYPE');
  77. $("#ORG_PROP").initCanstSelect('BM_ORG_PROP');
  78. $("#OFFICE_TYPE").initCanstSelect('BM_ORG_OFFICE_TYPE');
  79. getOrgType();
  80. //机构性质下拉框绑定change事件
  81. $("#ORG_TYPE").bind("change",function(){
  82. var selValue = $(this).attr("relValue");
  83. if(selValue=="XCZHB"||selValue=="XCGZZ"){
  84. $star =$('<span class="star">*</span>');
  85. $("#ORG_ADDRESS").attr("class","validate[required,length[1,80]]");
  86. $("#ORG_ADDRESS").parent("td").prev().html('<span class="star">*</span>机构地址');
  87. $("#ORG_ADDRESS").render();
  88. $("#ORG_PROP").attr("selectedValue","");
  89. $("#ORG_PROP").attr("class","");
  90. $("#ORG_PROP").attr("disabled",true);
  91. $("#ORG_PROP").render();
  92. }else{
  93. $("#ORG_PROP").attr("class","validate[required,length[1,25]]");
  94. $("#ORG_PROP").attr("disabled",false);
  95. if(selValue=="ZHZX"){
  96. $("#ORG_PROP").attr("selectedValue","YJZHJG");
  97. }else if(selValue=="ZHZXYJB"){
  98. $("#ORG_PROP").attr("selectedValue","YJGLJG");
  99. }else{
  100. $("#ORG_PROP").attr("selectedValue","");
  101. }
  102. $("#ORG_PROP").render();
  103. $("#ORG_ADDRESS").attr("class","validate[length[0,80]]");
  104. $("#ORG_ADDRESS").parent("td").prev().html('机构地址');
  105. $("#ORG_ADDRESS").render();
  106. }
  107. });
  108. gernerateInputs("DUTY_TEL");
  109. //gernerateInputs("EMERGENCY_TEL");
  110. //gernerateInputs("EMERGENCY_TEL","1231,232,3434,343");
  111. //修改标题
  112. $("#titleShow").html("新增【"+parentClickOrg.name+"】信息");
  113. //取登录人的ID
  114. ENTERING_214 = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  115. //用户所属单位
  116. var getCorp_names = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
  117. var getDeptnames = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames()
  118. //取登录用户信息
  119. //登录用户姓名
  120. var userName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
  121. $("#REAL_NAME_880").html(userName);
  122. //用户手机号
  123. getMobile = top.com.sinosoft.lz.system.user.LoginInfo.getMobile();
  124. if(getMobile==undefined){
  125. $("#MOBILE_880").html("暂无手机号码");
  126. }else{
  127. $("#MOBILE_880").html(getMobile);
  128. }
  129. $("#COMPANY_ID_880").html(getCorp_names);
  130. $("#ORG_ID_880").html(getDeptnames);
  131. });
  132. //生成input
  133. function gernerateInputs(id,data){
  134. $("#"+id).empty();
  135. $firstSpan = $('<span><input class="validate[required,custom[onlyNumber],length[1,15]] " type="text" style ="margin: 0px 0px 5px 0px;" maxlength="15" ><img style = "margin:0px 0px 0px 7px" src="/nwyj/scripts/qui/libs/icons/add.png" onclick="addMore(this)"/></span>');
  136. $secondSpan =$('<span><input class="validate[required,custom[onlyNumber],length[1,15]] " type="text" style ="margin: 0px 0px 5px 0px;" maxlength="15" ><img style = "margin:0px 0px 0px 7px" src="/nwyj/scripts/qui/libs/icons/delete.png" onclick="deleteInput(this)"/></span>') ;
  137. if(data==null||data==undefined||data==""||data=="null"){
  138. $("#"+id).append($firstSpan);
  139. }else{
  140. var dataValues = data.split(",");
  141. $("#"+id).append($firstSpan);
  142. //加载input
  143. for(var i = 1;i<dataValues.length;i++){
  144. addMore($("#"+id).find("span:first").find("span"));
  145. //$("#"+id).append($secondSpan);
  146. }
  147. //赋值
  148. $("#"+id).children("span").each(function(index ,event){
  149. $(this).find("input").val(dataValues[index]);
  150. });
  151. }
  152. $("#"+id).find("input").render();
  153. }
  154. //新增一个input
  155. function addMore(event){
  156. var $td = $(event).parent("span").parent("td");
  157. if($td.children("span").length>4){
  158. top.Dialog.alert("超过个数限制");
  159. return;
  160. }
  161. var $i = $(event).prev().clone();
  162. $i.val("");
  163. var $span = $('<span></span>');
  164. //alert($(event).prev().attr("id"));
  165. $span.append($i);
  166. $span.append($('<img style = "margin:0px 0px 0px 7px" src="/nwyj/scripts/qui/libs/icons/delete.png" onclick="deleteInput(this)"/>'))
  167. $(event).parent("span").parent("td").append($span);
  168. }
  169. //获取inputs 的值
  170. function getAllTel(id){
  171. var v="";
  172. $("#"+id).children("span").each(function(){
  173. var t = $(this).find("input").val();
  174. v +=t+",";
  175. });
  176. if(v.lastIndexOf(",") > -1){
  177. v=v.substring(0, v.length-1);
  178. }
  179. return v;
  180. }
  181. //删除input
  182. function deleteInput(event){
  183. $(event).parent("span").remove();
  184. }
  185. //新增验证
  186. function addValidate(){
  187. var valid = $("#fillForm").validationEngine({
  188. returnIsValid : true,
  189. });
  190. if (valid == true) {
  191. addfn();
  192. } else {
  193. top.Dialog.alert('表单填写不正确,请按要求填写!');
  194. }
  195. };
  196. //新增后台方法
  197. //新增机构信息--发送请求后台交互
  198. function addfn(){
  199. $("#fillForm input[name='PARENT_ID']").val(parentClickOrg.id);
  200. $("#fillForm input[name='IS_VIRTUAL']").val("1");
  201. $("#fillForm input[name='DUTY_TEL']").val(getAllTel("DUTY_TEL"));
  202. $("#fillForm input[name='EMERGENCY_TEL']").val(getAllTel("EMERGENCY_TEL"));
  203. $("#fillForm input[name='ENTRY_MAN_ID']").val(entryManId);
  204. var entrycompName = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
  205. $("#fillForm input[name='ENTRY_MAN_NAME']").val(entrycompName);
  206. var $form = $("#fillForm");
  207. var formValue = $form.serialize();
  208. var url = $.pathname() + "/ws/InDepartmentService/InDepartmentService/createVirtualOrg";
  209. $.ajax({
  210. url : url,
  211. type : "post",
  212. timeout : 60000,
  213. data : formValue,
  214. async:false,
  215. dataType : "json",
  216. success : function(data) {
  217. top.Dialog.alert("新增机构成功!");
  218. //新增应急机构成功后更新树
  219. parent.initTree();
  220. parent.addNewVirtualOrg(parentClickOrg,data,tabId);
  221. },
  222. error : function() {
  223. top.Dialog.alert("新增机构失败,稍后再试...");
  224. }
  225. });
  226. };
  227. //重置按钮
  228. function reset_input(){
  229. $("#ORG_NAME").val("");
  230. $("#ORG_NAME").resetValue();
  231. $("#ORG_TYPE").resetValue();
  232. $("#ORG_PROP").resetValue();
  233. $("#SHORT_NAME").val(resetValue.SHORT_NAME);
  234. $("#OFFICE_TYPE").resetValue();
  235. $("#ORG_ADDRESS").val(resetValue.ORG_ADDRESS);
  236. $("#DUTY_FAX").val(resetValue.DUTY_FAX);
  237. $("#EMERGENCY_FAX").val(resetValue.EMERGENCY_FAX);
  238. $("#DUTY_EMAIL").val(resetValue.DUTY_FAX);
  239. $("#EMERGENCY_EMAIL").val(resetValue.EMERGENCY_FAX);
  240. //重置电话号码
  241. gernerateInputs("DUTY_TEL",resetValue.DUTY_TEL);
  242. gernerateInputs("EMERGENCY_TEL",resetValue.EMERGENCY_TEL);
  243. /* //刷新当前页面即可
  244. window.location.reload();//刷新当前页面. */
  245. }
  246. /************2016-09-13 唐群胜加****************/
  247. function getOrgType(){
  248. $.ajax({
  249. url : $.pathname() + "/ws/InDepartmentService/InDepartmentService/getOrgType",
  250. type : "post",
  251. timeout : 60000,
  252. data : {id:parentClickOrg.id},
  253. async:false,
  254. dataType : "text",
  255. success : function(data) {
  256. if(data=="ZHZX"){
  257. var selData={"list":[{"value":"ZHZXYJB","key":"应急办"},{"value":"XCZHB","key":"现场指挥部"},{"value":"XCGZZ","key":"现场工作组"},{"value":"XCCZZHB","key":"现场应急处置指挥部"}]};
  258. $("#ORG_TYPE").data("data",selData)
  259. $("#ORG_TYPE").render();
  260. }else if(data=="ZHZXYJB"){
  261. var selData={"list":[{"value":"ZHZX","key":"应急指挥中心"},{"value":"XCZHB","key":"现场指挥部"},{"value":"XCGZZ","key":"现场工作组"},{"value":"XCCZZHB","key":"现场应急处置指挥部"}]};
  262. $("#ORG_TYPE").data("data",selData)
  263. $("#ORG_TYPE").render();
  264. }else if(data=="ZHZXZHZXYJB"){
  265. var selData={"list":[{"value":"XCZHB","key":"现场指挥部"},{"value":"XCGZZ","key":"现场工作组"},{"value":"XCCZZHB","key":"现场应急处置指挥部"}]};
  266. $("#ORG_TYPE").data("data",selData)
  267. $("#ORG_TYPE").render();
  268. }else{
  269. $("#ORG_TYPE").initCanstSelect('BM_VIRTUAL_ORG_TYPE');
  270. }
  271. }
  272. });
  273. }
  274. </script>
  275. </head>
  276. <body>
  277. <div id="formContent" style="overflow:auto;border: 1px solid #cdcaca;background:white;">
  278. <div style="height: 50px;border: 1px solid #cdcaca;border-right:1px;border-left:1px;border-top:1px;" align="center">
  279. <font style="font-weight: bold;font-size: 20px;line-height: 45px;color:#3e62a0;" id="titleShow"></font>
  280. </div>
  281. <form id="fillForm" action="javascript:addValidate()" method="post" failAlert="表单填写错误,请检查">
  282. <div style="margin:10px 20px 0px 0px;float:right;">
  283. <input type="submit" value="保存 " />&nbsp;&nbsp;
  284. <input type="button" id="OrgReset" value="重置 " />
  285. </div><br />
  286. <!-- /***********************************机构基本信息********************************************/ -->
  287. <fieldset style="border-color:#cdcaca;margin:0px 20px 10px 20px">
  288. <legend class="legend">基本信息:</legend>
  289. <table class="table-style" align="center">
  290. <tr style="display: none;">
  291. <td><input type="hidden" id="fd_id" name="FD_OBJECTID"
  292. required="true" />
  293. <input type="hidden" name="classid"
  294. value="" required="true" />
  295. <input type="hidden" name="PARENT_ID"
  296. required="true" />
  297. <input type="hidden" name="IS_VIRTUAL"
  298. required="true" value="" />
  299. <input type="hidden" name="SORT_NO"
  300. required="true" value="" />
  301. <input type="hidden" name="ORG_LEVEL"
  302. required="true" value="" />
  303. <input type="hidden" name="DUTY_TEL"
  304. required="true" value="" />
  305. <input type="hidden" name="ENTRY_MAN_ID"
  306. required="true" value="" />
  307. <input type="hidden" name="ENTRY_MAN_NAME"
  308. required="true" value="" />
  309. <input type="hidden" name="EMERGENCY_TEL"
  310. required="true" value="" />
  311. </td>
  312. </tr>
  313. <tr>
  314. <td align="right" width="120px" ><span class="star">*</span><span class="td-font">机构类型:</span></td>
  315. <td width="280px" ><select id="ORG_TYPE" selWidth="206"
  316. name="ORG_TYPE" prompt="请选择"
  317. class="validate[required]" />
  318. </td>
  319. <td align="right" width="120px" ><span class="star">*</span><span class="td-font">机构名称:</span></td>
  320. <td width="280px"><input id="ORG_NAME"
  321. name="ORG_NAME" type="text" maxlength="25"
  322. class="validate[required,length[1,25]]" />
  323. </td>
  324. </tr>
  325. <tr>
  326. <td align="right" ><span class="star">*</span><span class="td-font">机构性质:</span></td>
  327. <td ><select id="ORG_PROP"
  328. name="ORG_PROP" prompt="请选择"
  329. class="validate[required]" selWidth="206" /></td>
  330. <td align="right" ><span class="star">*</span><span class="td-font">办公类型:</span></td>
  331. <td ><select id="OFFICE_TYPE"
  332. name="OFFICE_TYPE" prompt="请选择"
  333. class="selectWidth validate[required]" selWidth="206" /></td>
  334. </tr>
  335. <tr>
  336. <td align="right" ><span class="td-font">机构地址:</span></td>
  337. <td colspan="3" ><input id="ORG_ADDRESS" name="ORG_ADDRESS" maxlength="80" type="text" style="width: 86%;"
  338. class=" validate[length[0,80]]" />
  339. </tr>
  340. <tr>
  341. <td align="right" ><span class="star">*</span><span class="td-font">总值班室电话:</span></td>
  342. <td id="DUTY_TEL" width="200px"></td><!-- 加宽度是防止有的浏览器在会使页面变形 -->
  343. <td align="right" ><span class="star">*</span><span class="td-font">应急办电话:</span></td>
  344. <td id="EMERGENCY_TEL" width="200px">
  345. <span> <input class="validate[required,custom[onlyNumber],length[1,15]] textinput" type="text" maxlength="15" style="margin: 0px 0px 5px; font-family: 微软雅黑; font-size: 14px;" truetype="textinput">
  346. <img onclick="addMore(this)" src="/nwyj/scripts/qui/libs/icons/add.png" style="margin:0px 0px 0px 7px">
  347. </span>
  348. </td>
  349. </tr>
  350. <tr>
  351. <td align="right" ><span class="td-font">总值班室传真:</span></td>
  352. <td ><input id="DUTY_FAX" name = "DUTY_FAX" maxlength="15"type="text" class=" validate[custom[onlyNumber],length[0,15]]" /></td>
  353. <td align="right" ><span class="td-font">应急办传真:</span></td>
  354. <td > <input id="EMERGENCY_FAX" name = "EMERGENCY_FAX" maxlength="15"type="text" class=" validate[custom[onlyNumber],length[0,15]]" /></td>
  355. </tr>
  356. <tr>
  357. <td align="right" ><span class="td-font">总值班室邮箱:</span></td>
  358. <td > <input id="DUTY_EMAIL" name = "DUTY_EMAIL" maxlength="30"type="text" class=" validate[custom[email],length[0,30]]" /></td>
  359. <td align="right" ><span class="td-font">应急办邮箱:</span></td>
  360. <td > <input id="EMERGENCY_EMAIL" name = "EMERGENCY_EMAIL" maxlength="30"type="text" class=" validate[custom[email],length[0,30]]" /></td>
  361. </tr>
  362. </table>
  363. </fieldset>
  364. <!-- /***************************************机构基本信息end************************************/ -->
  365. <!-- *****************************录入人信息部分************************************** -->
  366. <fieldset style="border-color:#cdcaca;margin:10px 20px 20px 20px" >
  367. <legend class="legend">填写人员信息:</legend>
  368. <table align="center" class="table-style2" id="fillForm">
  369. <tr>
  370. <td align="right" width="120px" class="td-style"><span class="td-font">单位:</span></td>
  371. <td width="280px" class="td-style"><div id="COMPANY_ID_880" name="COMPANY_ID_880" readOnly="true"/></td>
  372. <td align="right" width="120px" class="td-style"><span class="td-font">部门:</span></td>
  373. <td width="280px" class="td-style"><div id="ORG_ID_880" name="ORG_ID_880" readOnly="true"/></td>
  374. </tr>
  375. <tr>
  376. <td align="right" class="td-style"><span class="td-font">填写人员:</span></td>
  377. <td class="td-style"><div id="REAL_NAME_880" name="REAL_NAME_880" readOnly="true"/></td>
  378. <td align="right" class="td-style"><span class="td-font">填写人员联系方式:</span></td>
  379. <td class="td-style"><div id="MOBILE_880" name="MOBILE_880" readOnly="true"/></td>
  380. </tr>
  381. </table>
  382. </fieldset>
  383. <!-- /***************************************录入人信息end***************************************/ -->
  384. </form>
  385. </div>
  386. </body>
  387. </html>