5c40bda0943fae225a6e36217385108261947476.svn-base 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>应急组织外部机构信息</title>
  6. <!--框架必需start-->
  7. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/jquery.js"></script>
  8. <script type="text/javascript"
  9. src="/nwyj/scripts/qui/libs/js/language/cn.js"></script>
  10. <script type="text/javascript"
  11. src="/nwyj/scripts/qui/libs/js/framework.js"></script>
  12. <link href="/nwyj/scripts/qui/libs/css/import_basic.css"
  13. rel="stylesheet" type="text/css" />
  14. <link rel="stylesheet" type="text/css" id="skin"
  15. prePath="/nwyj/scripts/qui/" />
  16. <link rel="stylesheet" type="text/css" id="customSkin" />
  17. <!--框架必需end-->
  18. <script type="text/javascript"
  19. src="/nwyj/scripts/qui/libs/js/form/form.js"></script>
  20. <script type="text/javascript"
  21. src="/nwyj/scripts/qui/libs/js/form/validation.js"></script>
  22. <script type="text/javascript"
  23. src="/nwyj/scripts/qui/libs/js/form/validationRule.js"></script>
  24. <script type="text/javascript"
  25. src="/nwyj/scripts/qui/libs/js/popup/messager.js"></script>
  26. <!--弹窗组件start-->
  27. <script type="text/javascript"
  28. src="/nwyj/scripts/qui/libs/js/popup/drag.js"></script>
  29. <script type="text/javascript"
  30. src="/nwyj/scripts/qui/libs/js/popup/dialog.js"></script>
  31. <!--弹窗组件end-->
  32. <!--弹出式提示框start-->
  33. <script type="text/javascript"
  34. src="/nwyj/scripts/qui/libs/js/popup/messager.js"></script>
  35. <!--弹出式提示框end-->
  36. <!--数据表格start-->
  37. <script src="/nwyj/scripts/qui/libs/js/table/quiGrid.js"
  38. type="text/javascript"></script>
  39. <!--数据表格end-->
  40. <!--树组件start-->
  41. <link rel="stylesheet" type="text/css"
  42. href="/nwyj/scripts/qui/libs/js/tree/ztree/ztree.css" />
  43. <script type="text/javascript"
  44. src="/nwyj/scripts/qui/libs/js/tree/ztree/ztree.js"></script>
  45. <script type="text/javascript"
  46. src="/nwyj/scripts/qui/libs/js/form/selectTree.js"></script>
  47. <script type="text/javascript"
  48. src="/nwyj/scripts/qui/libs/js/form/listerTree.js"></script>
  49. <!--树组件end-->
  50. <!-- 日期选择框start -->
  51. <script type="text/javascript"
  52. src="/nwyj/scripts/qui/libs/js/form/datePicker/WdatePicker.js"></script>
  53. <!-- 日期选择框end -->
  54. <!-- 扩展工具js -->
  55. <script type="text/javascript" src="/nwyj/scripts/common/common.js"></script>
  56. <script type="text/javascript"
  57. src="/nwyj/scripts/jquery/plugins/jquery.extension.util.js"></script>
  58. <script type="text/javascript"
  59. src="/nwyj/scripts/freamwork/com/sinosoft/common/common.js"></script>
  60. <!-- <script type="text/javascript"
  61. src="../../../../../scripts/business/am/org/maintenance/out-orginfo.js"></script> -->
  62. <script type="text/javascript">
  63. //部门id
  64. var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  65. //取得用户真实姓名
  66. var realname = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
  67. //获取用户的Id
  68. var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  69. //部门名称
  70. var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
  71. //父部门id
  72. var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
  73. //外部单位的怕人id
  74. var outOrgParentId =top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  75. //alert("进入modify页面");
  76. var fd_id="";
  77. var resetValue = {};
  78. var flagAdd_Edit;
  79. // 记录树形下拉框值
  80. var Dname;
  81. var DnameShow;
  82. var Lname;
  83. var LnameShow;
  84. $(function() {
  85. //绑定点击图片事件
  86. $("#back").click(function(){
  87. //fd_id = fd_id==""?outOrgParentId:fd_id;
  88. goBack();
  89. });
  90. $("#OrgReset").bind("click",function(){
  91. reset_input();
  92. })
  93. //给下拉框赋值--常量表中的
  94. $("#ORG_DEPT_TYPE_212").initCanstSelect('BM_OUT_ORG_TYPE');
  95. // 部门树的请求地址
  96. var deptUrl = $.pathname()
  97. + '/ws/orgInDeptService/OrgInDeptService/getDeptRootById';
  98. // 添加额外属性主要用于最初的初始节点
  99. $("#LINK_DEPT_212").attr('params', '{"deptId":"' + dpids + '"}');
  100. // 异步加载请求地址
  101. $("#LINK_DEPT_212").attr('url', deptUrl);
  102. var iframe = parent.document.getElementsByName("frmrightChild")[0];
  103. var iframeUrl = iframe.src;
  104. //alert("修改src==="+iframeUrl);
  105. //判定修改或者新增
  106. if ((iframeUrl).indexOf('?') > -1) {
  107. flagAdd_Edit="edit";
  108. //alert("进入修改界面");
  109. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  110. fd_id = iframeUrl.split('?')[1];
  111. var params = {
  112. classid : '212',
  113. objectID : fd_id
  114. };
  115. $.ajax({
  116. url : url,
  117. type : 'post',
  118. timeout : 60000,
  119. data : params,
  120. dataType : 'json',
  121. success : function(data) {
  122. resetValue=data;
  123. $("#fillForm").ajaxWrite({
  124. data : data
  125. });
  126. $("#fillForm input[name='classid']").val("212");
  127. $("#fillForm input[name='fd_id212']").val(fd_id);
  128. //修改标题
  129. $("#titleShow").html("修改"+data.ORG_DEPT_NAME_212+"信息");
  130. // 设定联动部门树形下拉框的值
  131. Dname = data.LINK_DEPT_212;
  132. DnameShow = data.LINK_DEPT_212_SHOW;
  133. // 获取隐藏域的值(已通过SHOW转换了的值)--树形下拉框的隐形域
  134. // 异步加载树的赋值--联动部门
  135. $("#LINK_DEPT_212").attr("relValue", Dname);
  136. $("#LINK_DEPT_212").attr("relText", DnameShow);
  137. $("#LINK_DEPT_212").find("input:text").val(DnameShow);
  138. // 设定联动联系人树形下拉框的值
  139. Lname = data.LINK_MAN_212;
  140. LnameShow = data.LINK_MAN_212_SHOW;
  141. $("#LINK_MAN_212").attr("relValue", Lname);
  142. $("#LINK_MAN_212").attr("relText", LnameShow);
  143. $("#LINK_MAN_212").find("input:text").val(LnameShow);
  144. /*
  145. * //给联动联系人赋值--用于表单提交 $("#linkName").val(Lname);
  146. */
  147. // 联动人员请求地址
  148. /* var pUrl = $.pathname()
  149. + '/ws/orgInDeptService/OrgInDeptService/getInLinkManById';
  150. // 联动人员的的post请求
  151. $.post(pUrl, {
  152. "id" : Dname
  153. }, function(data) {
  154. // 存在联动人员则加载树
  155. $("#LINK_MAN_212").data("data", data);
  156. $("#LINK_MAN_212").render();
  157. }, "json");
  158. $("#LINK_MAN_212").attr("selectedValue", Lname);
  159. $("#LINK_MAN_212").render(); */
  160. },
  161. error : function(e) {
  162. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  163. }
  164. });
  165. }else{
  166. //新增
  167. //alert("进入新增界面");
  168. //修改标题
  169. flagAdd_Edit="add";
  170. // 初始化部门树
  171. $.post(deptUrl, {
  172. "id" : dpids
  173. }, function(data) {
  174. $("#LINK_DEPT_212").data("data", data);
  175. $("#LINK_DEPT_212").render();
  176. }, "json");
  177. $("#titleShow").html("新增外部机构");
  178. };
  179. // 绑定部门下拉框的选中值得改变状态
  180. $("#LINK_DEPT_212").bind(
  181. "change",
  182. function() {
  183. var selectedDept = $(this).attr("relValue");
  184. var selectedNode = $("#LINK_DEPT_212").data("selectedNode");
  185. if (selectedDept) {
  186. // 联动人员请求地址
  187. var pUrl = $.pathname()
  188. + '/ws/orgInDeptService/OrgInDeptService/getInLinkManById';
  189. // 联动人员的的post请求
  190. $.post(pUrl, {
  191. "id" : selectedDept,
  192. "type":selectedNode.isV
  193. }, function(data) {
  194. // 判定选中机构下是否有联动人员
  195. if (data.treeNodes.length == 0) {
  196. top.Dialog.alert("该机构下没有联动人员");
  197. $("#LINK_MAN_212").resetValue();
  198. } else {
  199. // 存在联动人员则加载树
  200. $("#LINK_MAN_212").data("data", data);
  201. $("#LINK_MAN_212").render();
  202. }
  203. }, "json");
  204. }
  205. });
  206. });
  207. //修改事件--表单提交时触发
  208. function save_orgInfo1() {
  209. if(flagAdd_Edit=="add"){
  210. //验证表单--新增
  211. addValidate();
  212. }else if(flagAdd_Edit="edit"){
  213. //验证表单--修改
  214. editValidate();
  215. }
  216. };
  217. //修改表单验证
  218. function editValidate() {
  219. var valid = $("#fillForm").validationEngine({
  220. returnIsValid : true,
  221. });
  222. if (valid == true) {
  223. editfn();
  224. } else {
  225. top.Dialog.alert('表单填写不正确,请按要求填写!');
  226. }
  227. };
  228. //新增
  229. function addValidate(){
  230. var valid = $("#fillForm").validationEngine({
  231. returnIsValid : true,
  232. });
  233. if (valid == true) {
  234. addfn();
  235. } else {
  236. top.Dialog.alert('表单填写不正确,请按要求填写!');
  237. }
  238. };
  239. //新增机构信息--发送请求后台交互
  240. function addfn(){
  241. //alert("进入新增表单提交");
  242. var orgNameInform = $("#ORG_DEPT_NAME_212").val();
  243. //记录新增的机构类别
  244. var addorgType = $("#ORG_DEPT_TYPE_212").attr("relValue");
  245. //alert(addorgType);
  246. $("#fillForm input[name='PARENT_ID_212']").val(outOrgParentId);
  247. $form = $("#fillForm");
  248. $("#classid").val("212");
  249. var formValue = $form.serialize();
  250. var url = $.pathname() + "/ws/crud/CRUDService/create/";
  251. $.ajax({
  252. url : url,
  253. type : "post",
  254. timeout : 60000,
  255. data : formValue,
  256. async:false,
  257. dataType : "json",
  258. success : function(data) {
  259. if(data.Msg.info =="新增成功"){
  260. //alert(orgNameInform+"|"+outOrgParentId);
  261. var newNode={id:data.Msg.objectID, parentId:outOrgParentId, name:orgNameInform,
  262. objectId:data.Msg.objectID,classId:"210",orgType:addorgType,
  263. icon:"/nwyj/scripts/qui/libs/icons/home.gif"};
  264. parent.outOrgNodeAdd(newNode);
  265. //更新左边点击的属性值
  266. top.Dialog.alert("新增"+ orgNameInform +"外部机构成功");
  267. parent.sup_classId = newNode.classId;
  268. parent.sup_org_name = newNode.name;
  269. parent.sup_fd_objectId = newNode.objectId;
  270. parent.sup_orgType= newNode.orgType;
  271. goBack();
  272. }
  273. if(data.Msg.info =="新增失败"){
  274. top.Dialog.alert("新增机构失败,稍后再试");
  275. }
  276. },
  277. error : function() {
  278. top.Dialog.alert("新增机构失败,稍后再试...");
  279. }
  280. });
  281. };
  282. //返回到详情界面
  283. function goBack() {
  284. var iframe = parent.document.getElementsByName("frmrightChild")[0];
  285. iframe.src = "out-org-info.html";
  286. }
  287. //修改机构信息--发送请求后台交互
  288. function editfn() {
  289. var orgNameInform = $("#ORG_DEPT_NAME_212").val();
  290. //记录修改的机构类别
  291. var addorgType = $("#ORG_DEPT_TYPE_212").attr("relValue");
  292. $form = $("#fillForm");
  293. var formValue = $form.serialize();
  294. var url = $.pathname() + "/ws/crud/CRUDService/update/";
  295. $.ajax({
  296. url : url,
  297. type : "post",
  298. timeout : 60000,
  299. data : formValue,
  300. dataType : "json",
  301. success : function(data) {
  302. if(data.Msg.info=="修改成功"){
  303. var newNode={id:fd_id, parentId:outOrgParentId, name:orgNameInform,
  304. objectId:fd_id,classId:"210",
  305. orgType:addorgType,
  306. icon:"/nwyj/scripts/qui/libs/icons/home.gif"};
  307. parent.outOrgNodeRefresh(newNode);
  308. top.Dialog.alert("修改机构成功,返回机构详情界面");
  309. //手动更新选中机构(即为当前机构)的信息
  310. parent.sup_classId = newNode.classId;
  311. parent.sup_org_name = newNode.name;
  312. parent.sup_fd_objectId = newNode.objectId;
  313. parent.sup_orgType= newNode.orgType;
  314. goBack(fd_id);
  315. }else if(data.Msg.info=="fail"){
  316. alert("修改失败");
  317. }
  318. },
  319. error : function() {
  320. top.Dialog.alert("修改失败,稍后再试...");
  321. }
  322. });
  323. };
  324. // 重置按钮
  325. function reset_input() {
  326. $("#ORG_DEPT_NAME_212").val(resetValue.ORG_DEPT_NAME_212);
  327. $("#ORG_DEPT_TYPE_212").val(resetValue.ORG_DEPT_TYPE_212);
  328. $("#LOCATION_212").val(resetValue.LOCATION_212);
  329. $("#CODE_212").val(resetValue.CODE_212);
  330. $("#SITE_212").val(resetValue.SITE_212);
  331. // 重置联动部门
  332. $("#LINK_DEPT_212").attr("relValue", Dname);
  333. $("#LINK_DEPT_212").attr("relText", DnameShow);
  334. $("#LINK_DEPT_212").find("input:text").val(DnameShow);
  335. // 重置联动联系人
  336. $("#LINK_MAN_212").attr("relValue", Lname);
  337. $("#LINK_MAN_212").attr("relText", LnameShow);
  338. $("#LINK_MAN_212").find("input:text").val(LnameShow);
  339. }
  340. </script>
  341. </head>
  342. <body>
  343. <div class="box1" id="formContent"
  344. style="overflow:auto;height:545px;border: 1px solid #E4E4E4;background: #F8F8F8;">
  345. <div style="height: 50px;background: #F8F8F8;" align="center">
  346. <img align="left" alt="返回" title="返回" src="/nwyj/images/temp/back.png" id="back"/>
  347. <font style="font-weight: bold;font-size: 20px;line-height: 45px;" id="titleShow"></font></div>
  348. <div>
  349. <form id="fillForm" action="javascript:save_orgInfo1()" method="post"
  350. failAlert="表单填写错误,请检查">
  351. <table class="tableStyle" formMode="line">
  352. <tr style="display: none;">
  353. <td><input type="hidden" id="fd_id212" name="FD_OBJECTID212"
  354. required="true" /> <input type="hidden" name="classid"
  355. value="212" required="true" />
  356. <input type="hidden" name="PARENT_ID_212"
  357. required="true" /></td>
  358. </tr>
  359. <tr>
  360. <td colspan="4" align="center" id="option_tr" style=""><input
  361. type="submit" value="保存 " /> <input type="button" id="OrgReset" value=" 重置 " />
  362. </td>
  363. </tr>
  364. <tr>
  365. <td width="18%"><span class="star">*</span>机构名称:</td>
  366. <td width="32%"><input id="ORG_DEPT_NAME_212"
  367. name="ORG_DEPT_NAME_212" type="text" value="" maxlength="20"
  368. class="validate[required,length[1,15]]" /></td>
  369. <td width="18%"><span class="star">*</span>机构类别:</td>
  370. <td width="32%"><select id="ORG_DEPT_TYPE_212"
  371. name="ORG_DEPT_TYPE_212" prompt="请选择"
  372. class="validate[required]" /></td>
  373. </tr>
  374. <tr>
  375. <td width="18%">所在区域:</td>
  376. <td width="32%" ><input id="LOCATION_212" name="LOCATION_212" maxlength="80"
  377. type="text" class=" validate[length[0,80]]" />
  378. </td>
  379. <td width="18%">办公地点:</td>
  380. <td width="32%" > <input id="WORK_ADDRESS_212" maxlength="100"
  381. name="WORK_ADDRESS_212" type="text" maxlength="80"
  382. class=" validate[length[0,80]]" /></td>
  383. </tr>
  384. <!-- <tr>
  385. <td width="18%"><span class="star">*</span>联动部门:</td>
  386. <td width="32%" ><input id="LINK_DEPT_212"
  387. name="LINK_DEPT_212" type="text"
  388. class=" validate[required]" /></td>
  389. <td width="18%"><span class="star">*</span>联动联系人:</td>
  390. <td width="32%" ><input id="LINK_MAN_212" name="LINK_MAN_212"
  391. type="text" class=" validate[required]" /></td>
  392. </tr> -->
  393. <tr>
  394. <td width="15%"><span class="star">*</span>联动部门:</td>
  395. <td width="35%"><div class="selectTree validate[required]"
  396. id="LINK_DEPT_212" asyncMode="true" name="LINK_DEPT_212" ></div></td>
  397. <td width="15%"><span class="star">*</span>联动联系人:</td>
  398. <td width="35%"><div class="selectTree validate[required]"
  399. id="LINK_MAN_212" name="LINK_MAN_212" ></div></td>
  400. </tr>
  401. <tr>
  402. <td width="18%">邮编:</td>
  403. <td width="32%" ><input id="CODE_212" name="CODE_212" maxlength="10"
  404. type="text" class=" validate[custom[zipcode]]" /></td>
  405. <td width="18%">网址:</td>
  406. <td width="32%" ><input id="SITE_212" name="SITE_212" maxlength="30"
  407. type="text" class="Validate[length[0,20]]" /></td>
  408. </tr>
  409. </table>
  410. </form>
  411. </div>
  412. </div>
  413. </body>
  414. </html>