4658381f350c78394f4910d9a091273731319aae.svn-base 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  1. $(function(){
  2. //setSelectDisabled3();
  3. /***2016-04-11梳理下拉框的值,用公共方法的下拉框取值方式***/
  4. //预案类型
  5. $("#PLAN_TYPE_214").initCanstSelect('BM_PLANTYPE');
  6. $("#PLAN_TYPE_214").render();
  7. //突发事件类型
  8. $("#BYSUNESS_TYPE_2141").initCanstSelect('BM_BYSUNESS_TYPE');
  9. $("#BYSUNESS_TYPE_2141").render();
  10. /*//包含的突发事件
  11. $("#PLAN_REFINE_CATEGORY_214").initCanstSelect('BM_YAXHLB');
  12. $("#PLAN_REFINE_CATEGORY_214").render();*/
  13. //取登录人的ID
  14. ENTERING_214 = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  15. //用户所属单位
  16. var getCorp_names = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
  17. $("#UNITS_214_SHOW").val(getCorp_names);
  18. //取登录用户信息
  19. //登录用户姓名
  20. var userName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
  21. $("#REAL_NAME_880").html(userName);
  22. //用户手机号
  23. getMobile = top.com.sinosoft.lz.system.user.LoginInfo.getMobile();
  24. if(getMobile==undefined){
  25. $("#MOBILE_880").html("暂无手机号码");
  26. }else{
  27. $("#MOBILE_880").html(getMobile);
  28. }
  29. $("#INS_UNITS_2141").OrgSel({valuetype:"renyuanguangli"});
  30. //$("#UPDERTAKE_COMP_299").OrgSel();
  31. $("#show_INS_UNITS_2141").attr("class","validate[required,functionCall[func1|* 不能选择本部]]");
  32. $("#COMPANY_ID_880").html(getCorp_names);
  33. //用户所属部门
  34. var getDeptnames = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
  35. $("#ORG_ID_880").html(getDeptnames);
  36. $('#fileDiv').newAsyncFileUpload("",null,1);
  37. var AreaSql = "select FD_CODE,PARENT_ID,FD_DESCRIPTION from BM_MAPVALUECANST where FD_TYPE = 'BM_YAXHLB'";
  38. //细化类别
  39. var treeUrl = $.pathname() + '/ws/sys/constantService/getTreeCanst/';
  40. var params = {
  41. sql:AreaSql
  42. };
  43. $.ajax({
  44. url : treeUrl,
  45. type : 'post',
  46. timeout : 60000,
  47. data : params,
  48. dataType : 'json',
  49. async: false,
  50. success : function(data){
  51. $("#PLAN_REFINE_CATEGORY_214").data("data",data[0].constlist);
  52. $("#PLAN_REFINE_CATEGORY_214").render();
  53. mydata = data[0].constlist;
  54. }});
  55. $abc = $("#PLAN_REFINE_CATEGORY_214");
  56. $abc.bind('change',function(){
  57. test();
  58. });
  59. //包含的突发事件
  60. // $("#PLAN_REFINE_CATEGORY_214").getCanstSelect({state:"BM_YAXHLB",width:"280"} );
  61. $("#goback").hover(function(){
  62. $(this).attr("src","/nwyj/images/temp/back_hover.png");
  63. },function(){
  64. $(this).attr("src","/nwyj/images/temp/back.png");
  65. });
  66. });
  67. function func1(){
  68. if($("#INS_UNITS_2141").val()=="benbu999"){
  69. return true;
  70. }
  71. return false;
  72. }
  73. var mydata;
  74. //登录人ID
  75. var ENTERING_214 = "";
  76. var getMobile="";
  77. var temp = "";
  78. function test(){
  79. var getValue = $("#PLAN_REFINE_CATEGORY_214").attr('relValue');
  80. if(getValue=="0"||getValue=="1"||getValue=="2"||getValue=="3"){
  81. top.Dialog.alert('选择具体的专项预案!');
  82. $("#PLAN_REFINE_CATEGORY_214").resetValue();
  83. return;
  84. }else{
  85. if(getValue=="4"||getValue=="5"||getValue=="6"||getValue=="7"){
  86. temp = "106";
  87. }else if(getValue=="9"||getValue=="10"||getValue=="11"){
  88. temp = "105";
  89. }else if(getValue=="8"||getValue=="18"){
  90. temp = "107";
  91. }else{
  92. temp = "108";
  93. }
  94. }
  95. }
  96. //重新获取包含的突发事件过滤,不需要所有的都加载。
  97. function reInitCategory(){
  98. //取突发事件类型的值
  99. var bysunes = $('#BYSUNESS_TYPE_2141').val();
  100. //定义转换突发事件类型的变量,因为当时存入库表的时候没有考虑周全,需要转换。
  101. var parnet_id = "";
  102. if(bysunes=="105"){
  103. parnet_id = "0";
  104. }else if(bysunes=="106"){
  105. parnet_id = "1";
  106. }else if(bysunes=="107"){
  107. parnet_id = "2";
  108. }else if(bysunes=="108"){
  109. parnet_id = "3";
  110. }
  111. //var AreaSql = "select FD_CODE,PARENT_ID,FD_DESCRIPTION from BM_MAPVALUECANST where FD_TYPE = 'BM_YAXHLB' and parent_id = '"+parnet_id+"'";
  112. //细化类别
  113. //var treeUrl = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/reInitCategory';
  114. var AreaSql = "";
  115. if(parnet_id.length!=0)
  116. AreaSql = "select FD_CODE,PARENT_ID,FD_DESCRIPTION from BM_MAPVALUECANST where FD_TYPE = 'BM_YAXHLB' and parent_id = '"+parnet_id+"'";
  117. else
  118. AreaSql = "select FD_CODE,PARENT_ID,FD_DESCRIPTION from BM_MAPVALUECANST where FD_TYPE = 'BM_YAXHLB' ";
  119. //细化类别
  120. var treeUrl = $.pathname() + '/ws/sys/constantService/getTreeCanst/';
  121. var params = {
  122. sql:AreaSql
  123. };
  124. $.ajax({
  125. url : treeUrl,
  126. type : 'post',
  127. timeout : 60000,
  128. data : params,
  129. dataType : 'json',
  130. async: false,
  131. success : function(data){
  132. $("#PLAN_REFINE_CATEGORY_214").data("data",data[0].constlist);
  133. $("#PLAN_REFINE_CATEGORY_214").render();
  134. // mydata = data[0].constlist;
  135. }});
  136. }
  137. //如果是总体预案,设置突发事件类型为不可用
  138. function setSelectDisabled(){
  139. var selectValue = $("#PLAN_TYPE_214").val();
  140. if(selectValue=="102"){
  141. // alert(1111);
  142. //如果是总体预案,设置突发事件类型为不可用
  143. $("#BYSUNESS_TYPE_2141").attr("class","");
  144. $("#BYSUNESS_TYPE_2141").attr("disabled",true);
  145. $("#BYSUNESS_TYPE_2141").render();
  146. //总体预案包含的突发事件类型为所有
  147. //PLAN_REFINE_CATEGORY1_214
  148. $("#PLAN_REFINE_CATEGORY_214").attr("selectedValue","4,5,6,7,8,9,10,11,12,13,14,15,16,17,18");
  149. $("#PLAN_REFINE_CATEGORY_214").render();
  150. }else{
  151. $("#BYSUNESS_TYPE_2141").attr("class","validate[required]");
  152. $("#BYSUNESS_TYPE_2141").attr("disabled",false);
  153. $("#BYSUNESS_TYPE_2141").render();
  154. //非总体预案设置包含的突发事件类型为自己手动选择
  155. $("#PLAN_REFINE_CATEGORY_214").attr("selectedValue","");
  156. $("#PLAN_REFINE_CATEGORY_214").render();
  157. }
  158. //选择专项预案的时候包含的突发事件只能选择一个,包含的突发事件类型为必输项
  159. if(selectValue=="103"){
  160. //如果是专项预案,设置包含的突发事件类型只能选择一个
  161. $("#PLAN_REFINE_CATEGORY_214").attr("multiMode","false");
  162. $("#PLAN_REFINE_CATEGORY_214").render();
  163. // $("#INS_UNITS_2141").attr("class","validate[required]");
  164. // $("#INS_UNITS_2141").attr("disabled",false);
  165. // $("#INS_UNITS_2141").render();
  166. }else{
  167. $("#PLAN_REFINE_CATEGORY_214").attr("multiMode","true");
  168. $("#PLAN_REFINE_CATEGORY_214").render();
  169. }
  170. //如果是政府预案,预案编码、责任部门不需要填写,包含的突发事件不需要填写。
  171. if(selectValue=="106"){
  172. //责任部门
  173. // $("#INS_UNITS_2141").attr("class","");
  174. // $("#INS_UNITS_2141").attr("disabled",true);
  175. // $("#INS_UNITS_2141").render();
  176. //包含的突发事件
  177. $('#PLAN_REFINE_CATEGORY_214').attr("class","selectTree ");
  178. $("#PLAN_REFINE_CATEGORY_214").attr("disabled",true);
  179. $("#PLAN_REFINE_CATEGORY_214").render();
  180. $("#PLAN_NO_214").attr("disabled",true);
  181. $("#PLAN_NO_214").reomveClass("validate[required]");
  182. }else{
  183. // $("#INS_UNITS_2141").attr("disabled",false);
  184. // $("#INS_UNITS_2141").attr("class","validate[required]");
  185. // $("#INS_UNITS_2141").render();
  186. $("#PLAN_REFINE_CATEGORY_214").attr("class","selectTree validate[required]");
  187. $("#PLAN_REFINE_CATEGORY_214").render();
  188. $("#PLAN_NO_214").attr("disabled",false);
  189. $("#PLAN_NO_214").addClass("class","validate[required]");
  190. }
  191. }
  192. var changeValue = "";
  193. //如果是总体预案,设置突发事件类型为不可用
  194. function setSelectDisabled3(obj){
  195. //如果时候总体预案,设置突发事件类型为不可用,包含的突发事件为所有
  196. var selectValue = $(obj).val();
  197. changeValue = selectValue;
  198. if(changeValue=="102"){
  199. //如果是总体预案,设置突发事件类型为不可用
  200. $("#BYSUNESS_TYPE_2141").attr("selectedValue","109");
  201. $("#BYSUNESS_TYPE_2141").attr("class","");
  202. $("#BYSUNESS_TYPE_2141").attr("disabled",true);
  203. $("#BYSUNESS_TYPE_2141").render();
  204. //总体预案包含的突发事件类型为所有
  205. $("#PLAN_REFINE_CATEGORY_214").attr("multiMode","true");
  206. /***********************选择为总体预案时 IE8报错的问题 start---********************/
  207. //$("#PLAN_REFINE_CATEGORY_214").attr("selectedValue","4,5,6,7,8,9,10,11,12,13,14,15,16,17,18");
  208. /***********************选择为总体预案时 IE8报错的问题 end---********************/
  209. //2016-05-27湛江局许永山说总体预案是综合类的。
  210. //2016-08-16省公司张壮领说总体预案不是综合类的。不用添加综合类
  211. $("#PLAN_REFINE_CATEGORY_214").attr("selectedValue","19");
  212. $("#PLAN_REFINE_CATEGORY_214").attr("disabled",true);
  213. $("#PLAN_REFINE_CATEGORY_214").attr("class","selectTree ");
  214. $("#PLAN_REFINE_CATEGORY_214").attr("selectedValue","");
  215. $("#PLAN_REFINE_CATEGORY_214").attr("multiMode","true");
  216. $("#PLAN_REFINE_CATEGORY_214").render();
  217. //预案编码为必输
  218. $('#PLAN_NO_214').attr("disabled",false);
  219. $('#PLAN_NO_214').val("");
  220. }else if(changeValue=="103"){
  221. //突发事件类型可用、必输
  222. $("#BYSUNESS_TYPE_2141").attr("disabled",false);
  223. $("#BYSUNESS_TYPE_2141").attr("class","validate[required]");
  224. $("#BYSUNESS_TYPE_2141").attr("selectedValue","");
  225. $("#BYSUNESS_TYPE_2141").render();
  226. //包含的突发事件可用、必输
  227. $("#PLAN_REFINE_CATEGORY_214").attr("disabled",false);
  228. $("#PLAN_REFINE_CATEGORY_214").attr("class","selectTree validate[required]");
  229. $("#PLAN_REFINE_CATEGORY_214").attr("selectedValue","");
  230. $("#PLAN_REFINE_CATEGORY_214").attr("multiMode","false");
  231. $("#PLAN_REFINE_CATEGORY_214").render();
  232. //归口部门
  233. // $("#INS_UNITS_2141").attr("disabled",false);
  234. // $("#INS_UNITS_2141").attr("class","validate[required]");
  235. // $("#INS_UNITS_2141").attr("selectedValue","");
  236. // $("#INS_UNITS_2141").render();
  237. //预案编码为必输
  238. $('#PLAN_NO_214').attr("disabled",false);
  239. $('#PLAN_NO_214').val("");
  240. }else if(changeValue=="104"||changeValue=="105"){//突发事件类型可用、必输
  241. $("#BYSUNESS_TYPE_2141").attr("disabled",false);
  242. $("#BYSUNESS_TYPE_2141").attr("class","validate[required]");
  243. $("#BYSUNESS_TYPE_2141").attr("selectedValue","");
  244. $("#BYSUNESS_TYPE_2141").render();
  245. //包含的突发事件可用、必输
  246. $("#PLAN_REFINE_CATEGORY_214").attr("disabled",false);
  247. $("#PLAN_REFINE_CATEGORY_214").attr("class","selectTree validate[required]");
  248. $("#PLAN_REFINE_CATEGORY_214").attr("selectedValue","");
  249. $("#PLAN_REFINE_CATEGORY_214").attr("multiMode","true");
  250. $("#PLAN_REFINE_CATEGORY_214").render();
  251. //归口部门
  252. // $("#INS_UNITS_2141").attr("disabled",false);
  253. // $("#INS_UNITS_2141").attr("class","validate[required]");
  254. // $("#INS_UNITS_2141").attr("selectedValue","");
  255. // $("#INS_UNITS_2141").render();
  256. //预案编码为必输
  257. $('#PLAN_NO_214').attr("disabled",false);
  258. $('#PLAN_NO_214').val("");
  259. }else if(changeValue=="106"){
  260. $("#BYSUNESS_TYPE_2141").attr("disabled",true);
  261. $("#BYSUNESS_TYPE_2141").attr("class","");
  262. $("#BYSUNESS_TYPE_2141").attr("selectedValue","");
  263. $("#BYSUNESS_TYPE_2141").render();
  264. //包含的突发事件可用、必输
  265. $("#PLAN_REFINE_CATEGORY_214").attr("disabled",false);
  266. $("#PLAN_REFINE_CATEGORY_214").attr("class","selectTree validate[required]");
  267. $("#PLAN_REFINE_CATEGORY_214").attr("selectedValue","");
  268. $("#PLAN_REFINE_CATEGORY_214").attr("multiMode","true");
  269. $("#PLAN_REFINE_CATEGORY_214").render();
  270. //归口部门
  271. // $("#INS_UNITS_2141").attr("disabled",true);
  272. // $("#INS_UNITS_2141").attr("class","");
  273. // $("#INS_UNITS_2141").attr("selectedValue","");
  274. // $("#INS_UNITS_2141").render();
  275. //预案编码为必输
  276. $('#PLAN_NO_214').val(" ");
  277. $('#PLAN_NO_214').attr("disabled","disabled");
  278. }
  279. }
  280. //包含的突发事件类型处理只能录入15个专项预案,如有重复的给出提示
  281. function setSelectDisabled1(){
  282. //是专项预案才往下走。
  283. var planType = $('#PLAN_TYPE_214').val();
  284. //取类型
  285. var type = $('#PLAN_REFINE_CATEGORY_214').attr("relvalue");
  286. var type1 = $('#PLAN_REFINE_CATEGORY_214').attr("relText");
  287. if(planType=="103"){
  288. //如果该单位下已经存在该类型的预案,不让往下填写表单。
  289. getZhuanxValue(type,type1);
  290. }
  291. }
  292. //发送请求取回该类型预案的ID
  293. function getZhuanxValue(data,data1){
  294. var url = $.pathname()
  295. + "/ws/sendmenu/SendMsgService/getZhuanxiangPlan";
  296. var params = {
  297. parent_id : parent_id,//单位ID
  298. grade_type:data,//预案类型
  299. };
  300. $.ajax({
  301. url : url,
  302. type : 'post',
  303. timeout : 12000,
  304. data : params,
  305. dataType : 'json',
  306. success : function(data) {
  307. if(JSON.stringify(data).length>11){
  308. //获取该类型的预案ID
  309. var orgVlue = data.rows[0].FD_OBJECTID;
  310. //提示用户是否跳转到修改页面或者重新选择包含的突发事件类型
  311. top.Dialog.alert("已经有:" + data1 + "的预案,请重新选择!");
  312. $("#PLAN_REFINE_CATEGORY_214").resetValue();
  313. /*top.Dialog.confirm("已经有该类型的预案存在,请重新选择包含的突发事件?|离开", function() {
  314. window.location.href="PlanEdit.jsp?"+orgVlue;
  315. });*/
  316. }
  317. },
  318. error : function(e) {
  319. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  320. }
  321. });
  322. }
  323. //取复选框勾选的值
  324. var strRO="";
  325. //取系统时间:年月日时分秒
  326. var date = allGetServerTime();
  327. var seperator1 = "";
  328. var seperator2 = "";
  329. var month = date.getMonth() + 1;
  330. var strDate = date.getDate();
  331. if (month >= 1 && month <= 9) {
  332. month = "0" + month;
  333. }
  334. if (strDate >= 0 && strDate <= 9) {
  335. strDate = "0" + strDate;
  336. }
  337. var time = date.getFullYear() + seperator1 + month + seperator1 + strDate
  338. + "" + date.getHours() + seperator2 + date.getMinutes()
  339. + seperator2 + date.getSeconds();
  340. //单位ID
  341. var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  342. var parent_id = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  343. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+""; //登录人ID
  344. //取上传文件的名称
  345. var file = "";
  346. //新增
  347. function add(containerId){
  348. //取系统时间
  349. var date = allGetServerTime();
  350. var seperator1 = "";
  351. var seperator2 = "";
  352. var month = date.getMonth() + 1;
  353. var strDate = date.getDate();
  354. if (month >= 1 && month <= 9) {
  355. month = "0" + month;
  356. }
  357. if (strDate >= 0 && strDate <= 9) {
  358. strDate = "0" + strDate;
  359. }
  360. var PLAN_EN_TIME_214 = date.getFullYear() + "-" + month +"-" + strDate;
  361. var plantype = $("#PLAN_TYPE_214").val();//预案类型
  362. var ywfl = $("#BYSUNESS_TYPE_2141").val();//突发事件类型
  363. var category = $("#PLAN_REFINE_CATEGORY_214").attr('relValue');//包含的突发事件
  364. var unit = $("#INS_UNITS_2141").val();//责任部门
  365. var name = $("#PLAN_NAME_214").val();//预案名称
  366. var plannmo = $("#PLAN_NO_214").val();//预案编码
  367. var takeDate = $("#TAKE_DATE_214").val();//颁布日期
  368. var makeDate = $("#ISSUE_DATE_214").val();//实施日期
  369. var valid = $(containerId).validationEngine({returnIsValid: true});
  370. if(valid == true){
  371. //时间判断
  372. if(makeDate!=""&&makeDate!=null&&makeDate!=undefined){
  373. if(makeDate<takeDate){
  374. top.Dialog.alert("实施日期不能比颁布日期提前!");
  375. return;
  376. }
  377. }
  378. if(hasFile()==false){
  379. top.Dialog.alert("请选择上传的文件!");
  380. return;
  381. }
  382. $('#DZ_FILE_214').val(PLAN_EN_TIME_214);
  383. //登录人手机号
  384. $("#ENTERING_TEL_214").val(getMobile);
  385. //ENTERING_214 存入登录人的ID
  386. $("#ENTERING_214").val(ENTERING_214);
  387. $("#UNITS_214").val(parent_id);
  388. $("#REMARK1_214").val(getUser_id);
  389. $("#VERSION_214").val(name+time+"版本");//版本
  390. $('#INS_UNITS_214').val(unit);
  391. $('#BYSUNESS_TYPE_214').val(ywfl);
  392. var $form=$("#fillForm");
  393. var formValue = $form.serialize();
  394. var url = $.pathname() +"/ws/uploadForm/FileUpDownService/asyncFileUpLoad";
  395. $.request.add(url,formValue,function(data){
  396. if(plantype=="103"){
  397. top.Dialog.confirm("要绑定该预案吗?|绑定", function() {
  398. var fd_id = data.Msg.objectID;
  399. closeProgress();
  400. var url = "/nwyj/page/business/am/contingencyPlan/"+"PlanNexus.jsp?"+fd_id+"?0?"+category+"?"+name;
  401. window.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  402. },function(){
  403. closeProgress();
  404. top.Dialog.alert(data.Msg.info);
  405. goBack();
  406. });
  407. }else{
  408. closeProgress();
  409. top.Dialog.alert(data.Msg.info);
  410. goBack();
  411. }
  412. });
  413. }else{
  414. //预案的类型
  415. if(plantype==""){
  416. top.Dialog.alert('请选择预案类型!');
  417. return;
  418. }
  419. //突发事件类型
  420. var PLAN_TYPE_214 =$("#PLAN_TYPE_214").val();
  421. if(PLAN_TYPE_214=="103"){
  422. if(ywfl==""){
  423. top.Dialog.alert('请选择突发事件类型!');
  424. return;
  425. }
  426. }
  427. if(plantype!="102"){
  428. //包含的突发事件
  429. if(category==""){
  430. top.Dialog.alert('请选择包含的突发事件!');
  431. return;
  432. }
  433. }
  434. //责任部门
  435. // if(PLAN_TYPE_214!="106"){
  436. if(unit==""){
  437. top.Dialog.alert('请选择归口部门!');
  438. return;
  439. }
  440. if(unit=="benbu999"){
  441. top.Dialog.alert('归口部门不能为本部!');
  442. return;
  443. }
  444. // }
  445. //预案名称
  446. if(name==""){
  447. top.Dialog.alert('预案名称填写不正确,请按要求填写!');
  448. return;
  449. }
  450. //预案编码
  451. if(PLAN_TYPE_214!="106"){
  452. if(plannmo==""){
  453. top.Dialog.alert('预案编码填写不正确,请按要求填写!');
  454. return;
  455. }
  456. }
  457. //颁布日期
  458. if(takeDate==""){
  459. top.Dialog.alert('颁布日期,请按要求填写!');
  460. return;
  461. }
  462. if(makeDate==""){
  463. top.Dialog.alert('实施日期,请按要求填写!');
  464. return;
  465. }
  466. top.Dialog.alert('请检查标红输入框!');
  467. return;
  468. }
  469. }
  470. //重置
  471. function resetSearch(){
  472. //突发事件类型
  473. document.location.reload();
  474. }
  475. function fileToSave($form,listGrid,msg,url){
  476. showProgressBar("正在提交中...");
  477. //表单异步提交处理
  478. $form.ajaxSubmit({
  479. type: 'post',
  480. url:url,
  481. //表单提交成功后的回调
  482. success: function(responseText, statusText, xhr, $form){
  483. responseText = eval('('+responseText+')');
  484. closeProgress();
  485. if(msg!=undefined){
  486. if(responseText.info == 'success')
  487. top.Dialog.alert(msg+'成功!');//弹出提示
  488. else
  489. top.Dialog.alert(msg+'失败!');//弹出提示
  490. }else{
  491. if(responseText.info == 'success')
  492. top.Dialog.alert('添加成功!');//弹出提示
  493. else
  494. top.Dialog.alert('添加失败!');//弹出提示
  495. }
  496. goBack();
  497. }
  498. });
  499. }
  500. function goBack() {
  501. var backId = (window.location.href).split('?')[1];
  502. if(backId=="ZX"){
  503. var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlanZX.jsp";
  504. window.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  505. }else{
  506. var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlan.jsp";
  507. window.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  508. }
  509. }
  510. function redPlanDeptp(data){
  511. diag = new top.Dialog();// 定义一个窗口对象
  512. diag.Title = "选择关联的专项预案";// 窗口标题
  513. diag.URL = $.pathname() +"/page/business/am/contingencyPlan/PlanGuanlian.jsp?"+data;// 窗口对应的页面
  514. diag.Height = 500;
  515. diag.Width =600;
  516. diag.ShowOkButton=false;// 不显示确认按钮
  517. diag.ShowCancelButton=false;// 不显示取消按钮
  518. diag.ButtonAlign="center";// 按钮居中
  519. diag.show();// 显示窗口
  520. }
  521. $.messager=top.Dialog;