61741784ba753304372d3e367c0e9dca5cc4e320.svn-base 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  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. //登陆人的机构id
  62. var loginOrgId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  63. //登录人id
  64. var entryManId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  65. //当前点击的机构节点
  66. var parentClickOrg = parent.selectedTreeNode;
  67. //记录选中的组织id
  68. var selectedOrgId=[];
  69. //当前点击的机构节点
  70. var parentClickOrg = parent.selectedTreeNode;
  71. //修改的人员主键id
  72. var fd_id = "<%=request.getParameter("fd_id")%>";
  73. //保存ajax 数据 用于重置按钮
  74. var resetValue={};
  75. //tab 标签id
  76. var tabId = parent.tabIndex;
  77. //部门树的名称(id)
  78. var Dname="";
  79. //部门树的显示名
  80. var DnameShow="";
  81. //联动人的名称(id)
  82. var Lname="";
  83. //联动人的显示名
  84. var LnameShow="";
  85. $(function(){
  86. //绑定表单提交按钮和重置按钮
  87. $("#save").bind("click",function(){
  88. editValidate();
  89. });
  90. $("#cancel").bind("click",function(){
  91. reset_input();
  92. });
  93. // 记录选中的树的名字用于给表单赋值
  94. var orgName = parentClickOrg.name;
  95. var tree_fd_id = parentClickOrg.id;
  96. //标记机构类型
  97. var flagOrgType = parentClickOrg.orgType;
  98. // 部门树的请求地址
  99. var deptUrl = $.pathname()
  100. + '/ws/InDepartmentService/InDepartmentService/getOrgInfoById';
  101. // 添加额外属性主要用于最初的初始节点
  102. $("#LINK_DEPT_210").attr('params', '{"deptId":"' + loginOrgId + '"}');
  103. // 异步加载请求地址
  104. $("#LINK_DEPT_210").attr('url', deptUrl);
  105. var url = $.pathname() + "/ws/crud/CRUDService/getDataById/";
  106. var params = {
  107. classid : '210',
  108. objectID : fd_id
  109. };
  110. /* ajax请求 */
  111. $
  112. .ajax({
  113. url : url,
  114. type : 'post',
  115. timeout : 60000,
  116. data : params,
  117. dataType : 'json',
  118. success : function(data) {
  119. // 给resetValue赋值
  120. resetValue = data;
  121. $('#fillForm').ajaxWrite({
  122. data : data
  123. });
  124. $("#outlinktitle").html("修改"+orgName+"联系人") ;
  125. //给部门名称赋值
  126. $("#ORG_DEPT_ID_210_SHOW").html(data.ORG_DEPT_ID_210_SHOW);
  127. $("#ORG_TYPE_210_SHOW").html(transFormType(data.ORG_TYPE_210));
  128. $('#fillForm input[name="classid"]').val('210');
  129. // 设定联动部门树形下拉框的值
  130. Dname = data.LINK_DEPT_210;
  131. DnameShow = data.LINK_DEPT_210_SHOW;
  132. // 异步加载树的赋值--联动部门
  133. $("#LINK_DEPT_210").attr("relValue", Dname);
  134. $("#LINK_DEPT_210").attr("relText", DnameShow);
  135. $("#LINK_DEPT_210").find("input:text").val(DnameShow);
  136. // 设定联动联系人树形下拉框的值
  137. Lname = data.LINK_MAN_210;
  138. LnameShow = data.LINK_MAN_210_SHOW;
  139. // 初次加载获取联动人员下拉框 。
  140. // 联动人员请求地址
  141. var pUrl = $.pathname()
  142. + '/ws/orgInDeptService/OrgInDeptService/getInLinkManJustById';
  143. // 联动人员的的post请求
  144. $.post(pUrl, {
  145. "id" : Dname
  146. }, function(data) {
  147. // 判定选中机构下是否有联动人员
  148. if (data.treeNodes.length == 0) {
  149. $("#LINK_MAN_210").data("data","");
  150. $("#LINK_MAN_210").render();
  151. } else {
  152. // 存在联动人员则加载树
  153. $("#LINK_MAN_210").data("data", data);
  154. $("#LINK_MAN_210").render();
  155. }
  156. }, "json");
  157. $("#LINK_MAN_210").attr("relValue", Lname);
  158. $("#LINK_MAN_210").attr("relText", LnameShow);
  159. $("#LINK_MAN_210").find("input:text").val(LnameShow);
  160. $("#UPDATEDATE").html(data.UPDATEDATE_210);
  161. },
  162. error : function(e) {
  163. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  164. }
  165. });
  166. // 绑定部门下拉框的选中值得改变状态
  167. $("#LINK_DEPT_210")
  168. .bind(
  169. "change",
  170. function() {
  171. var selectedDept = $(this).attr("relValue");
  172. var selectedNode = $("#LINK_DEPT_210").data("selectedNode");
  173. if (selectedDept) {
  174. // 联动人员请求地址
  175. var pUrl = $.pathname()
  176. + '/ws/orgInDeptService/OrgInDeptService/getInLinkManById';
  177. // 联动人员的的post请求
  178. $.post(pUrl, {
  179. "id" : selectedDept,
  180. "type":selectedNode.isVirtual
  181. }, function(data) {
  182. // 判定选中机构下是否有联动人员
  183. if (data.treeNodes.length == 0) {
  184. top.Dialog.alert("该机构下没有联动人员");
  185. $("#LINK_MAN_210").data("data","");
  186. $("#LINK_MAN_210").render();
  187. } else {
  188. // 存在联动人员则加载树
  189. $("#LINK_MAN_210").data("data", data);
  190. $("#LINK_MAN_210").render();
  191. }
  192. }, "json");
  193. }
  194. });
  195. /****************************登陆人信息************************/
  196. //取登录用户信息
  197. //登录用户姓名
  198. var userName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
  199. $("#REAL_NAME_880").html(userName);
  200. //用户手机号
  201. getMobile = top.com.sinosoft.lz.system.user.LoginInfo.getMobile();
  202. if(getMobile==undefined){
  203. $("#MOBILE_880").html("暂无手机号码");
  204. }else{
  205. $("#MOBILE_880").html(getMobile);
  206. }
  207. //用户所属单位
  208. var getCorp_names = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
  209. $("#COMPANY_ID_880").html(getCorp_names);
  210. //用户所属部门
  211. var getDeptnames = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
  212. $("#ORG_ID_880").html(getDeptnames);
  213. /****************************登陆人信息************************/
  214. });
  215. //转换机构类型
  216. function transFormType(type){
  217. var typeShow="机构类别";
  218. switch(type){
  219. case '1':
  220. typeShow='政府机关';
  221. break;
  222. case '2':
  223. typeShow='教育';
  224. break;
  225. case '3':
  226. typeShow='卫生';
  227. break;
  228. case '4':
  229. typeShow='公安';
  230. break;
  231. case '5':
  232. typeShow='消防';
  233. break;
  234. case '6':
  235. typeShow='三防';
  236. break;
  237. case '7':
  238. typeShow='厂家';
  239. break;
  240. case '8':
  241. typeShow='重要用户';
  242. break;
  243. case '9':
  244. typeShow='其他';
  245. break;
  246. default :
  247. typeShow='其他';
  248. }
  249. return typeShow;
  250. }
  251. // 新增表单验证
  252. function editValidate() {
  253. var valid = $("#fillForm").validationEngine({
  254. returnIsValid : true,
  255. });
  256. if (valid == true) {
  257. editfn();
  258. } else {
  259. top.Dialog.alert('表单填写不正确,请按要求填写!');
  260. }
  261. }
  262. // 新增事件
  263. function editfn() {
  264. $("#ENTRY_MAN_ID_210").val(entryManId);
  265. $("#classid").val("210");
  266. $form = $("#fillForm");
  267. var formValue = $form.serialize();
  268. var url = $.pathname() + "/ws/crud/CRUDService/update/";
  269. $.ajax({
  270. url : url,
  271. type : "post",
  272. timeout : 60000,
  273. data : formValue,
  274. dataType : "json",
  275. async : false,
  276. success : function(data) {
  277. if (data.Msg.info == "修改成功") {
  278. //切换标签
  279. parent.avtiveTab('tab1_index1');
  280. //关闭页签
  281. parent.closeTab('tab1_index'+tabId);
  282. top.Dialog.alert("修改外部联系人成功");
  283. }
  284. if (data.Msg.info == "修改失败") {
  285. top.Dialog.alert("修改外部联系人失败");
  286. }
  287. },
  288. error : function() {
  289. top.Dialog.alert("修改失败,稍后再试...");
  290. }
  291. });
  292. };
  293. // 重置按钮
  294. function reset_input() {
  295. $("#LIAISON_NAME_210").val(resetValue.LIAISON_NAME_210);
  296. $("#PHONE_210").val(resetValue.PHONE_210);
  297. $("#ORG_TYPE_210").resetValue();
  298. $("#ORG_ADDRESS_210").val(resetValue.ORG_ADDRESS_210);
  299. $("#CODE_210").val(resetValue.CODE_210);
  300. $("#LANDLINE_210").val(resetValue.LANDLINE_210);
  301. $("#FAX_210").val(resetValue.FAX_210);
  302. $("#EMAIL_210").val(resetValue.EMAIL_210);
  303. $("#SITE_210").val(resetValue.SITE_210);
  304. // 重置联动部门
  305. $("#LINK_DEPT_210").attr("relValue", Dname);
  306. $("#LINK_DEPT_210").attr("relText", DnameShow);
  307. $("#LINK_DEPT_210").find("input:text").val(DnameShow);
  308. // 重置联动联系人
  309. $("#LINK_MAN_210").attr("relValue", Lname);
  310. $("#LINK_MAN_210").attr("relText", LnameShow);
  311. $("#LINK_MAN_210").find("input:text").val(LnameShow);
  312. }
  313. </script>
  314. </head>
  315. <body>
  316. <div id="formContent" style="overflow:auto;border: 1px solid #cdcaca;background:white;">
  317. <div style="height: 50px;border: 1px solid #cdcaca;border-right:1px;border-left:1px;border-top:1px;" align="center">
  318. <font style="font-weight: bold;font-size: 20px;line-height: 45px;color:#3e62a0;" id="outlinktitle"></font>
  319. </div>
  320. <div style="margin:10px 20px 0px 0px;float:right;">
  321. <input value="保存" id="save" type="button"/>&nbsp;&nbsp;
  322. <input id="cancel" value="重置" type="button"/>
  323. </div><br />
  324. <fieldset style="border-color:#cdcaca;margin:0px 20px 10px 20px" >
  325. <legend class="legend">基本信息:</legend>
  326. <form method="post" action="" id="fillForm">
  327. <table class="table-style" align="center" >
  328. <tr style="display: none;">
  329. <td>
  330. <input type="hidden" id="fd_id210" name="FD_OBJECTID210" required="true" />
  331. <input type="hidden" name="classid" value="210" required="true" />
  332. <input type="hidden" name="ORG_DEPT_ID_210" id="ORG_DEPT_ID_210" required="true" />
  333. <input type="hidden" name="ORG_TYPE_210" id="ORG_TYPE_210" required="true" />
  334. <input type="hidden" name="ENTRY_MAN_ID_210" id="ENTRY_MAN_ID_210" required="true" />
  335. </td>
  336. </tr>
  337. <tr>
  338. <td width="15%" align="right" style="padding-top: 10px"><span class="star">*</span><span class="td-font">联系人:</span></td>
  339. <td width="35%" style="padding-top: 10px"><input id="LIAISON_NAME_210" name="LIAISON_NAME_210" type="text" maxlength="10"
  340. class="validate[required,custom[chinese],length[1,10]]" /></td>
  341. <td width="15%" align="right" style="padding-top: 10px"><span class="star">*</span><span class="td-font">联系人手机:</span></td>
  342. <td width="35%" style="padding-top: 10px"><input id="PHONE_210" name="PHONE_210" type="text" maxlength="15"
  343. class=" validate[required,custom[mobilephone]]" /></td>
  344. </tr>
  345. <tr>
  346. <td align="right"><span class="td-font">机构类别:</span></td>
  347. <td name="ORG_TYPE_210_SHOW" id="ORG_TYPE_210_SHOW" ></td>
  348. <td align="right"><span class="td-font">外部机构名称:</span></td>
  349. <td id="ORG_DEPT_ID_210_SHOW" name="ORG_DEPT_ID_210_SHOW"></td>
  350. </tr>
  351. <tr>
  352. <td align="right"><span class="td-font">联系人座机:</span></td>
  353. <td ><input id="LANDLINE_210" name="LANDLINE_210" type="text" maxlength="15"
  354. class=" validate[custom[onlyNumber]],length[0,15]" /></td>
  355. <td align="right"><span class="td-font">联系人传真:</span></td>
  356. <td ><input id="FAX_210" name="FAX_210" type="text" maxlength="15"
  357. class=" validate[custom[telephone]]" /></td>
  358. </tr>
  359. <tr>
  360. <td align="right"><span class="td-font">办公OA邮箱:</span></td>
  361. <td ><input id="EMAIL_210" name="EMAIL_210" type="text" maxlength="30"
  362. class="validate[custom[email]]" /></td>
  363. <td align="right"><span class="td-font">网址:</span></td>
  364. <td ><input id="SITE_210" name="SITE_210" type="text" maxlength="30"
  365. class=" validate[length[0,64]]" /></td>
  366. </tr>
  367. <!-- <tr>
  368. <td align="right"><span class="star">*</span><span class="td-font">联动部门:</span></td>
  369. <td ><div class="selectTree validate[required]"
  370. id="LINK_DEPT_210" asyncMode="true" name="LINK_DEPT_210" selWidth="206"></div></td>
  371. <td align="right"><span class="star">*</span><span class="td-font">联动联系人:</span></td>
  372. <td ><div class="selectTree validate[required]"
  373. id="LINK_MAN_210" name="LINK_MAN_210" selWidth="206"></div></td>
  374. </tr> -->
  375. <tr>
  376. <td align="right"><span class="td-font">邮编:</span></td>
  377. <td colspan="3"><input id="CODE_210" name="CODE_210" type="text" maxlength="10"
  378. class=" validate[custom[zipcode]]" /></td>
  379. </tr>
  380. <tr>
  381. <td align="right" ><span class="td-font">所在区域:</span></td>
  382. <td colspan="3" ><input maxlength="46" type="text" style="width:86%;" id="LOCATION_210" name="LOCATION_210"
  383. class=" validate[length[0,80]]"/></td>
  384. </tr>
  385. <tr>
  386. <td align="right" style="padding-bottom: 10px"><span class="td-font">地址:</span></td>
  387. <td colspan="3" style="padding-bottom: 10px"><input id="ORG_ADDRESS_210" maxlength="46" style="width:86%;"
  388. name="ORG_ADDRESS_210" type="text"
  389. class=" validate[length[0,256]]" /></td>
  390. </tr>
  391. </table>
  392. </form>
  393. </fieldset>
  394. <!-- *****************************录入人信息部分************************************** -->
  395. <fieldset style="border-color:#cdcaca;margin:10px 20px 10px 20px" >
  396. <legend class="legend">填写人员信息:</legend>
  397. <table align="center" class="table-style2" id="fillForm" >
  398. <tr>
  399. <td align="right" width="120px" class="td-style"><span class="td-font">单位:</span></td>
  400. <td width="280px" class="td-style"><div id="COMPANY_ID_880" name="COMPANY_ID_880" readOnly="true"/></td>
  401. <td align="right" width="120px" class="td-style"><span class="td-font">部门:</span></td>
  402. <td width="280px" class="td-style"><div id="ORG_ID_880" name="ORG_ID_880" readOnly="true"/></td>
  403. </tr>
  404. <tr>
  405. <td align="right" class="td-style"><span class="td-font">填写人员:</span></td>
  406. <td class="td-style"><div id="REAL_NAME_880" name="REAL_NAME_880" readOnly="true"/></td>
  407. <td align="right" class="td-style"><span class="td-font">填写人员联系方式:</span></td>
  408. <td class="td-style"><div id="MOBILE_880" name="MOBILE_880" readOnly="true"/></td>
  409. </tr>
  410. <tr>
  411. <td align="right" class="td-style"><span class="td-font">录入时间:</span></td>
  412. <td class="td-style" colspan="3"><div id="UPDATEDATE" name="UPDATEDATE" readOnly="true"/></td>
  413. </tr>
  414. </table>
  415. </fieldset>
  416. <!-- /***************************************录入人信息end***************************************/ -->
  417. </div>
  418. </body>
  419. </html>