4c2d868fb5c8a2affee29d173c21aa32aa460c29.svn-base 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005
  1. $(function(){
  2. //**加载下拉框的值*//*
  3. //突发事件类型
  4. $('#BYSUNESS_TYPE_214').initCanstSelect('BM_BYSUNESS_TYPE');
  5. var fd_id = (window.location.href).split('?')[1];
  6. $('#fileDiv').newAsyncFileUpload("",fd_id,1);
  7. $("#INS_UNITS_2141").OrgSel({valuetype:"renyuanguangli"});//归口部门
  8. $("#show_INS_UNITS_2141").attr("class","validate[functionCall[func1|* 不能选择本部]]");
  9. var AreaSql = "select FD_CODE,PARENT_ID,FD_DESCRIPTION from BM_MAPVALUECANST where FD_TYPE = 'BM_YAXHLB'";
  10. //细化类别
  11. var treeUrl = $.pathname() + '/ws/sys/constantService/getTreeCanst/';
  12. var params = {
  13. sql:AreaSql
  14. };
  15. $.ajax({
  16. url : treeUrl,
  17. type : 'post',
  18. timeout : 60000,
  19. data : params,
  20. dataType : 'json',
  21. async: false,
  22. success : function(data){
  23. $("#PLAN_REFINE_CATEGORY1_214").data("data",data[0].constlist);
  24. $("#PLAN_REFINE_CATEGORY1_214").render();
  25. }});
  26. $abc = $("#PLAN_REFINE_CATEGORY1_214");
  27. $abc.bind('change',function(){
  28. test();
  29. });
  30. $("#goback").hover(function(){
  31. $(this).attr("src","/nwyj/images/temp/back_hover.png");
  32. },function(){
  33. $(this).attr("src","/nwyj/images/temp/back.png");
  34. });
  35. });
  36. function func1(){
  37. if($("#INS_UNITS_2141").val()=="benbu999"){
  38. return true;
  39. }
  40. return false;
  41. }
  42. //包含的突发事件类型要能够自动匹配突发事件类型伊瑚bug2716
  43. function initComplete(){
  44. //绑定change事件
  45. $("#PLAN_REFINE_CATEGORY1_214").bind("change",function(){
  46. if(!$(this).attr("relValue")){
  47. top.Dialog.alert("请选择突发事件类型!");
  48. }else{
  49. //取父节点的ID,跟局父节点的ID给突发事件类型重新赋值。
  50. var node=$(this).data("selectedNode");
  51. if(node.parentId=="0"){
  52. $("#BYSUNESS_TYPE_214").setValue("105");
  53. }else if(node.parentId=="1"){
  54. $("#BYSUNESS_TYPE_214").setValue("106");
  55. }else if(node.parentId=="2"){
  56. $("#BYSUNESS_TYPE_214").setValue("107");
  57. }else if(node.parentId=="3"){
  58. $("#BYSUNESS_TYPE_214").setValue("108");
  59. }else if(node.parentId=="20"){
  60. $("#BYSUNESS_TYPE_214").setValue("109");
  61. }
  62. }
  63. });
  64. }
  65. // 修订页面的附件有误导,选择修订后应该将之前的附件隐藏 刘主管提的
  66. function changeFile(){
  67. var changeValue =$("#PLAN_STURTS_214").val();
  68. //修订或者修正状态下隐藏前面的附件。
  69. if(changeValue=="2"||changeValue=="3"){
  70. $(".div1").hide();
  71. }else{
  72. $(".div1").show();
  73. }
  74. }
  75. function getUserInfo(userID){
  76. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  77. var params = {
  78. classid : '880',
  79. objectID : userID
  80. };
  81. $.ajax({
  82. url : url,
  83. type : 'post',
  84. timeout : 60000,
  85. data : params,
  86. dataType : 'json',
  87. success : function(data){
  88. var MOBILE = data.MOBILE_880; //手机
  89. var COMPANY_ID = data.COMPANY_ID_880_SHOW;//所属单位
  90. var ORG_ID = data.ORG_ID_880_SHOW;//所属部门
  91. var userName = data.REAL_NAME_880;
  92. $("#ENTERING_214_SHOW").html(userName);
  93. $("#ENTERING_TEL_214").html(MOBILE);
  94. $("#INS_UNITS_214_SHOW").html(ORG_ID);
  95. },
  96. error : function(e){
  97. top.Dialog.alert('系统提示信息', '访问服务失败!', 'error');
  98. }
  99. });
  100. }
  101. var nn = "";
  102. //如果是总体预案,设置突发事件类型为不可用
  103. function setSelectDisabled3(obj){
  104. //如果时候总体预案,设置突发事件类型为不可用,包含的突发事件为所有
  105. var selectValue = $(obj).val();
  106. changeValue = selectValue;
  107. if(changeValue=="102"){
  108. //如果是总体预案,设置突发事件类型为不可用
  109. //如果是总体预案,设置突发事件类型为不可用
  110. $("#BYSUNESS_TYPE_214").attr("selectedValue","109");
  111. $("#BYSUNESS_TYPE_214").attr("class","");
  112. $("#BYSUNESS_TYPE_214").attr("disabled",true);
  113. $("#BYSUNESS_TYPE_214").render();
  114. //总体预案包含的突发事件类型为所有
  115. $("#PLAN_REFINE_CATEGORY1_214").attr("multiMode","true");
  116. /***************控制IE8报错的问题 选择为总体预案时 start---********************/
  117. $("#PLAN_REFINE_CATEGORY1_214").attr("class","selectTree ");
  118. //$("#PLAN_REFINE_CATEGORY1_214").attr("selectedValue","0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18");
  119. /***************控制IE8报错的问题 选择为总体预案时 end---********************/
  120. //2016-05-27湛江局许永山说总体预案是综合类的。
  121. $("#PLAN_REFINE_CATEGORY_214").attr("selectedValue","19");
  122. $("#PLAN_REFINE_CATEGORY1_214").attr("disabled",true);
  123. $("#PLAN_REFINE_CATEGORY1_214").render();
  124. //归口部门为必输字段
  125. $("#INS_UNITS_214").attr("class","validate[required]");
  126. $("#INS_UNITS_214").attr("selectedValue","112");
  127. $("#INS_UNITS_214").attr("disabled",true);
  128. $("#INS_UNITS_214").render();
  129. //预案编码为必输
  130. $('#PLAN_NO_214').attr("disabled",false);
  131. $('#PLAN_NO_214').val("");
  132. }else if(changeValue=="103"){
  133. //突发事件类型可用、必输
  134. $("#BYSUNESS_TYPE_214").attr("disabled",false);
  135. $("#BYSUNESS_TYPE_214").attr("class","validate[required]");
  136. $("#BYSUNESS_TYPE_214").render();
  137. var bysunessValue = $('#BYSUNESS_TYPE_214').val();
  138. //包含的突发事件可用、必输
  139. //reInitCategory(bysunessValue);
  140. $("#PLAN_REFINE_CATEGORY1_214").attr("disabled",false);
  141. $("#PLAN_REFINE_CATEGORY1_214").attr("class","selectTree validate[required]");
  142. $("#PLAN_REFINE_CATEGORY1_214").attr("selectedValue",nn);
  143. $("#PLAN_REFINE_CATEGORY1_214").attr("multiMode","false");
  144. $("#PLAN_REFINE_CATEGORY1_214").render();
  145. /********中山局现场培训后修改,中山局提出归口部门用组织机构***********/
  146. /*//归口部门
  147. $("#INS_UNITS_214").attr("disabled",false);
  148. $("#INS_UNITS_214").attr("class","validate[required]");
  149. //$("#INS_UNITS_214").attr("selectedValue","");
  150. $("#INS_UNITS_214").render();*/
  151. //预案编码为必输
  152. $('#PLAN_NO_214').attr("disabled",false);
  153. $('#PLAN_NO_214').val("");
  154. }else if(changeValue=="104"||changeValue=="105"){//突发事件类型可用、必输
  155. $("#BYSUNESS_TYPE_214").attr("disabled",false);
  156. $("#BYSUNESS_TYPE_214").attr("class","validate[required]");
  157. //$("#BYSUNESS_TYPE_214").attr("selectedValue","");
  158. $("#BYSUNESS_TYPE_214").render();
  159. //包含的突发事件可用、必输
  160. $("#PLAN_REFINE_CATEGORY1_214").attr("disabled",false);
  161. $("#PLAN_REFINE_CATEGORY1_214").attr("class","selectTree validate[required]");
  162. //$("#PLAN_REFINE_CATEGORY1_214").attr("selectedValue","");
  163. $("#PLAN_REFINE_CATEGORY1_214").attr("multiMode","true");
  164. $("#PLAN_REFINE_CATEGORY1_214").render();
  165. /********中山局现场培训后修改,中山局提出归口部门用组织机构***********/
  166. //归口部门
  167. /*$("#INS_UNITS_214").attr("disabled",false);
  168. $("#INS_UNITS_214").attr("class","validate[required]");
  169. //$("#INS_UNITS_214").attr("selectedValue","");
  170. $("#INS_UNITS_214").render();*/
  171. //预案编码为必输
  172. $('#PLAN_NO_214').attr("disabled",false);
  173. $('#PLAN_NO_214').val("");
  174. }else if(changeValue=="106"){
  175. $("#BYSUNESS_TYPE_214").attr("disabled",true);
  176. $("#BYSUNESS_TYPE_214").attr("class","");
  177. //$("#BYSUNESS_TYPE_214").attr("selectedValue","");
  178. $("#BYSUNESS_TYPE_214").render();
  179. //包含的突发事件可用、必输
  180. $("#PLAN_REFINE_CATEGORY1_214").attr("disabled",true);
  181. $("#PLAN_REFINE_CATEGORY1_214").attr("class","selectTree ");
  182. //$("#PLAN_REFINE_CATEGORY1_214").attr("selectedValue","");
  183. $("#PLAN_REFINE_CATEGORY1_214").attr("multiMode","true");
  184. $("#PLAN_REFINE_CATEGORY1_214").render();
  185. /********中山局现场培训后修改,中山局提出归口部门用组织机构***********/
  186. //归口部门
  187. /*$("#INS_UNITS_214").attr("disabled",true);
  188. $("#INS_UNITS_214").attr("class","");
  189. //$("#INS_UNITS_214").attr("selectedValue","");
  190. $("#INS_UNITS_214").render();*/
  191. //预案编码为必输
  192. //$('#PLAN_NO_214').val(" ");
  193. $('#PLAN_NO_214').attr("disabled","disabled");
  194. //$('#PLAN_NO_214').attr("class","");
  195. }
  196. }
  197. //重新获取包含的突发事件过滤,不需要所有的都加载。
  198. function reInitCategory(){
  199. //取突发事件类型的值
  200. var bysunes = $('#BYSUNESS_TYPE_214').val();
  201. if(bysunes==""){
  202. top.Dialog.alert("请选择突发事件类型!");
  203. return;
  204. };
  205. //定义转换突发事件类型的变量,因为当时存入库表的时候没有考虑周全,需要转换。
  206. var parnet_id = "";
  207. if(bysunes=="105"){
  208. parnet_id = "0";
  209. }else if(bysunes=="106"){
  210. parnet_id = "1";
  211. }else if(bysunes=="107"){
  212. parnet_id = "2";
  213. }else if(bysunes=="108"){
  214. parnet_id = "3";
  215. }
  216. //var AreaSql = "select FD_CODE,PARENT_ID,FD_DESCRIPTION from BM_MAPVALUECANST where FD_TYPE = 'BM_YAXHLB' and parent_id = '"+parnet_id+"'";
  217. //细化类别
  218. //var treeUrl = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/reInitCategory';
  219. var AreaSql = "select FD_CODE,PARENT_ID,FD_DESCRIPTION from BM_MAPVALUECANST where FD_TYPE = 'BM_YAXHLB' and parent_id = '"+parnet_id+"'";
  220. //细化类别
  221. var treeUrl = $.pathname() + '/ws/sys/constantService/getTreeCanst/';
  222. var params = {
  223. sql:AreaSql
  224. };
  225. $.ajax({
  226. url : treeUrl,
  227. type : 'post',
  228. timeout : 60000,
  229. data : params,
  230. dataType : 'json',
  231. async: false,
  232. success : function(data){
  233. $("#PLAN_REFINE_CATEGORY1_214").data("data",data[0].constlist);
  234. $("#PLAN_REFINE_CATEGORY1_214").render();
  235. $("#PLAN_REFINE_CATEGORY1_214").attr("relValue","");
  236. // mydata = data[0].constlist;
  237. }});
  238. }
  239. //单位ID
  240. var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  241. var parent_id = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  242. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+""; //登录人ID
  243. var time = "";
  244. var PLAN_BIAOZHI="";
  245. var UPLOAND_FLAG="";
  246. var PLAN_VERSION_REMARK="";
  247. //修改表单信息,获取记录
  248. if((window.location.href).indexOf('?')>-1){
  249. var fd_id = (window.location.href).split('?')[1];
  250. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  251. var params = {
  252. classid : '214',
  253. objectID : fd_id
  254. };
  255. $.ajax({
  256. url : url,
  257. type : 'post',
  258. timeout : 60000,
  259. data : params,
  260. dataType : 'json',
  261. success : function(data){
  262. $('#fillForm').ajaxWrite({data:data});
  263. $('#fillForm input[name="classid"]').val('214');
  264. nn = data.PLAN_REFINE_CATEGORY_214;
  265. PLAN_BIAOZHI = data.PLAN_BIAOZHI_214;
  266. var UPDATEDATE_214 = data.UPDATEDATE_214;
  267. $("#UPDATEDATE_214").html(UPDATEDATE_214);
  268. $("#show_INS_UNITS_2141").val(data.INS_UNITS_214_SHOW);
  269. var userID = data.ENTERING_214;
  270. getUserInfo(userID);
  271. $("#UNITS_214_DIV_SHOW").html(data.UNITS_214_SHOW);
  272. //$("#PLAN_REFINE_CATEGORY1_214").render();
  273. var PLAN_TYPE_214 = data.PLAN_TYPE_214;
  274. /* if(PLAN_TYPE_214=="102"){
  275. $("#BYSUNESS_TYPE_214").attr("class","");
  276. $("#BYSUNESS_TYPE_214").attr("disabled",true);
  277. $("#BYSUNESS_TYPE_214").render();
  278. }else{
  279. $("#BYSUNESS_TYPE_214").attr("class","validate[required]");
  280. $("#BYSUNESS_TYPE_214").attr("disabled",false);
  281. $("#BYSUNESS_TYPE_214").render();
  282. }*/
  283. if(PLAN_TYPE_214=="102"){
  284. //如果是总体预案,设置突发事件类型为不可用
  285. $("#BYSUNESS_TYPE_214").attr("class","");
  286. $("#BYSUNESS_TYPE_214").attr("disabled",true);
  287. $("#BYSUNESS_TYPE_214").render();
  288. //总体预案包含的突发事件类型为所有
  289. //PLAN_REFINE_CATEGORY1_214
  290. $("#PLAN_REFINE_CATEGORY1_214").attr("selectedValue",nn);
  291. //$("#PLAN_REFINE_CATEGORY1_214").attr("selectedValue","0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18");
  292. $("#PLAN_REFINE_CATEGORY1_214").attr("class","selectTree");
  293. $("#PLAN_REFINE_CATEGORY1_214").attr("disabled",true);
  294. $("#PLAN_REFINE_CATEGORY1_214").render();
  295. /********中山局现场培训后修改,中山局提出归口部门用组织机构***********/
  296. /*$("#INS_UNITS_214").attr("class","validate[required]");
  297. $("#INS_UNITS_214").attr("selectedValue","112");
  298. $("#INS_UNITS_214").attr("disabled",true);
  299. $("#INS_UNITS_214").render();*/
  300. }else
  301. /*{
  302. $("#BYSUNESS_TYPE_214").attr("class","validate[required]");
  303. $("#BYSUNESS_TYPE_214").attr("disabled",false);
  304. $("#BYSUNESS_TYPE_214").render();
  305. //非总体预案设置包含的突发事件类型为自己手动选择
  306. $("#PLAN_REFINE_CATEGORY1_214").attr("selectedValue","");
  307. $("#PLAN_REFINE_CATEGORY1_214").render();
  308. }*/
  309. //选择专项预案的时候包含的突发事件只能选择一个,包含的突发事件类型为必输项
  310. if(PLAN_TYPE_214=="103"){
  311. //如果是专项预案,设置包含的突发事件类型只能选择一个
  312. //reInitCategory();
  313. $("#PLAN_REFINE_CATEGORY1_214").attr("selectedValue",nn);
  314. $("#PLAN_REFINE_CATEGORY1_214").attr("multiMode","false");
  315. $("#PLAN_REFINE_CATEGORY1_214").render();
  316. /********中山局现场培训后修改,中山局提出归口部门用组织机构***********/
  317. /*$("#INS_UNITS_214").attr("class","validate[required]");
  318. $("#INS_UNITS_214").attr("disabled",false);
  319. $("#INS_UNITS_214").render();*/
  320. }else
  321. /*{
  322. $("#PLAN_REFINE_CATEGORY1_214").attr("multiMode","true");
  323. $("#PLAN_REFINE_CATEGORY1_214").render();
  324. }*/
  325. //如果是政府预案,预案编码、责任部门不需要填写,包含的突发事件不需要填写。
  326. if(PLAN_TYPE_214=="106"){
  327. $("#BYSUNESS_TYPE_214").attr("disabled",true);
  328. $("#BYSUNESS_TYPE_214").attr("class","");
  329. $("#BYSUNESS_TYPE_214").attr("selectedValue","");
  330. $("#BYSUNESS_TYPE_214").render();
  331. /********中山局现场培训后修改,中山局提出归口部门用组织机构***********/
  332. //归口部门
  333. /*$("#INS_UNITS_214").attr("disabled",true);
  334. $("#INS_UNITS_214").attr("class","");
  335. $("#INS_UNITS_214").attr("selectedValue","");
  336. $("#INS_UNITS_214").render();*/
  337. //包含的突发事件
  338. $("#PLAN_REFINE_CATEGORY1_214").attr("disabled",true);
  339. $('#PLAN_REFINE_CATEGORY1_214').attr("class","selectTree ");
  340. $("#PLAN_REFINE_CATEGORY_214").attr("selectedValue","");
  341. $("#PLAN_REFINE_CATEGORY_214").attr("multiMode","true");
  342. $("#PLAN_REFINE_CATEGORY1_214").render();
  343. $("#PLAN_NO_214").attr("disabled",true);
  344. $('#PLAN_NO_214').val(" ");
  345. }else{
  346. //reInitCategory();
  347. /********中山局现场培训后修改,中山局提出归口部门用组织机构***********/
  348. /*$("#INS_UNITS_214").attr("disabled",false);
  349. $("#INS_UNITS_214").attr("class","validate[required]");
  350. $("#INS_UNITS_214").render();*/
  351. $("#PLAN_REFINE_CATEGORY1_214").attr("selectedValue",nn);
  352. $("#PLAN_REFINE_CATEGORY1_214").attr("class","selectTree validate[required]");
  353. $("#PLAN_REFINE_CATEGORY1_214").render();
  354. $("#PLAN_NO_214").attr("disabled",false);
  355. $("#PLAN_NO_214").addClass("class","validate[required]");
  356. }
  357. },
  358. error : function(e){
  359. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  360. }
  361. });
  362. }
  363. var file ="";
  364. //取系统时间:年月日时分秒
  365. var date = allGetServerTime();
  366. var seperator1 = "";
  367. var seperator2 = "";
  368. var month = date.getMonth() + 1;
  369. var strDate = date.getDate();
  370. if (month >= 1 && month <= 9) {
  371. month = "0" + month;
  372. }
  373. if (strDate >= 0 && strDate <= 9) {
  374. strDate = "0" + strDate;
  375. }
  376. time = date.getFullYear() + seperator1 + month + seperator1 + strDate
  377. + "" + date.getHours() + seperator2 + date.getMinutes()
  378. + seperator2 + date.getSeconds();
  379. //删除原来信息
  380. function del(){
  381. // 删除记录
  382. $.post($.pathname() +"/ws/crud/CRUDService/delete/", {
  383. "objectIDs" : fd_id,
  384. classid : 214
  385. }, function(result) {
  386. if (result.Msg.sucsess == true) {
  387. //$.messager.alert("废止上一版本预案",null,null,null,1);
  388. // 刷新表格数据
  389. //g.loadData();
  390. } else {
  391. top.Dialog.alert("废止失败!");
  392. }
  393. }, "json");
  394. }
  395. function feizhicexiao(num){
  396. $.post($.pathname() +"/ws/EmcPlan/EmgencyPlanService/feizhichexiao/", {
  397. "id" : fd_id,
  398. "num" : num
  399. }, function(result) {
  400. if (result.Msg.sucsess == true) {
  401. if(num=="4"){
  402. $.messager.alert("废止成功",null,null,null,-1);
  403. }else{
  404. $.messager.alert("撤销成功",null,null,null,-1);
  405. }
  406. var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlan.jsp";
  407. top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  408. return;
  409. } else {
  410. top.Dialog.alert("操作失败!");
  411. }
  412. }, "json");
  413. }
  414. var temp = "";
  415. function test(){
  416. var getValue = $("#PLAN_REFINE_CATEGORY1_214").attr('relValue');
  417. if(getValue=="0"||getValue=="1"||getValue=="2"||getValue=="3"||getValue=="20"){
  418. top.Dialog.alert('选择具体的预案!');
  419. $("#PLAN_REFINE_CATEGORY1_214").resetValue();
  420. return;
  421. }else{
  422. if(getValue=="4"||getValue=="5"||getValue=="6"||getValue=="7"||getValue=="21"||getValue=="23"){
  423. temp = "106";
  424. }else if(getValue=="9"||getValue=="10"||getValue=="11"){
  425. temp = "105";
  426. }else if(getValue=="8"||getValue=="18"){
  427. temp = "107";
  428. }else if(getValue=="22"||getValue=="25"){
  429. temp = "109";
  430. }else{
  431. temp = "108";
  432. }
  433. }
  434. }
  435. //表单验证
  436. function validateForm(containerId){
  437. // test();
  438. var plantype = $("#PLAN_TYPE_214").val();//预案类型
  439. var ywfl = $("#BYSUNESS_TYPE_214").val();//突发事件类型
  440. var category = $("#PLAN_REFINE_CATEGORY_214").attr('relValue');//包含的突发事件
  441. /********中山局现场培训后修改,中山局提出归口部门用组织机构***********/
  442. var unit = $("#INS_UNITS_2141").val();//责任部门
  443. var name = $("#PLAN_NAME_214").val();//预案名称
  444. var plannmo = $("#PLAN_NO_214").val();//预案编码
  445. var takeDate = $("#TAKE_DATE_214").val();//颁布日期
  446. var makeDate = $("#ISSUE_DATE_214").val();//实施日期
  447. // var syfw = $("#SYFW_214").val();//简要说明
  448. if(plantype=="103"){
  449. test();
  450. }
  451. var valid = $(containerId).validationEngine({returnIsValid: true});
  452. if(valid == true){
  453. //时间判断
  454. if(makeDate!=""&&makeDate!=null&&makeDate!=undefined){
  455. if(makeDate<takeDate){
  456. top.Dialog.alert("实施日期不能比颁布日期提前!");
  457. return;
  458. }
  459. }
  460. var change = $('#CHANGE_TYPE').val();
  461. if(change=="111"){
  462. var ids = (window.location.href).split('?')[1];
  463. top.Dialog.confirm("确定要撤销吗?|撤销", function() {
  464. // 删除记录
  465. $.post($.pathname() +"/ws/crud/CRUDService/delete/", {
  466. "objectIDs" : ids,
  467. classid : 214
  468. }, function(result) {
  469. if (result.Msg.sucsess == true) {
  470. //$.messager.alert("撤销成功",null,null,null,1);
  471. goBack();
  472. } else {
  473. top.Dialog.alert("删除失败!");
  474. }
  475. }, "json");
  476. });
  477. return;
  478. }else{
  479. var flag = false;
  480. var obj = document.getElementsByName("uploaderFileName");
  481. for(var i =0;i<obj.length;i++){
  482. if(obj[i].id.length<30){
  483. flag = true;
  484. }
  485. }
  486. var zhuangtai=$("#PLAN_STURTS_214").attr('relValue');
  487. if(zhuangtai=="2"||zhuangtai=="3"){
  488. if(!flag){
  489. top.Dialog.alert("请选择上传的文件!");
  490. return;
  491. }
  492. //先删除原来记录。
  493. del();
  494. $("#fd_id214").val("");
  495. if(unit!=""){
  496. $("#INS_UNITS_214").val(unit);
  497. }
  498. //再新增记录
  499. add();
  500. }else if(zhuangtai=="5"){
  501. top.Dialog.confirm("确定要撤销吗?|撤销", function() {
  502. // 删除记录
  503. $.post($.pathname() +"/ws/crud/CRUDService/delete/", {
  504. "objectIDs" : fd_id,
  505. classid : 214
  506. }, function(result) {
  507. if (result.Msg.sucsess == true) {
  508. // $.messager.alert("撤销成功",null,null,null,-1);
  509. feizhicexiao("5");
  510. // var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlan.jsp";
  511. // top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  512. // return;
  513. } else {
  514. top.Dialog.alert("撤销失败!");
  515. return;
  516. }
  517. }, "json");
  518. });
  519. }else if(zhuangtai=="4"){
  520. top.Dialog.confirm("确定要废止吗?|废止", function() {
  521. // 删除记录
  522. $.post($.pathname() +"/ws/crud/CRUDService/delete/", {
  523. "objectIDs" : fd_id,
  524. classid : 214
  525. }, function(result) {
  526. if (result.Msg.sucsess == true) {
  527. // $.messager.alert("废止成功",null,null,null,-1);
  528. feizhicexiao("4");
  529. // var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlan.jsp";
  530. // top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  531. // return;
  532. } else {
  533. top.Dialog.alert("废止失败!");
  534. return;
  535. }
  536. }, "json");
  537. });
  538. }else{
  539. //变更类型
  540. $('#CHANGE_TYPE_214').val(110);
  541. //单位ID
  542. $("#UNITS_214").val(parent_id);
  543. //发布状态、上报状态写死为0
  544. if(unit!=""){
  545. $("#INS_UNITS_214").val(unit);
  546. }
  547. edit();
  548. }
  549. }
  550. //取上传附件容器的值,如果为空,则为单纯修改预案基本信息。如不为空,则为修订预案,重新上传预案。
  551. }else{
  552. if(plantype==""){
  553. top.Dialog.alert('请选择预案类型!');
  554. return;
  555. }
  556. var PLAN_TYPE_214 =$("#PLAN_TYPE_214").val();
  557. if(PLAN_TYPE_214=="103"){
  558. if(ywfl==""){
  559. top.Dialog.alert('请选择突发事件类型!');
  560. return;
  561. }
  562. }
  563. if(plantype!="106"){
  564. if(category==""){
  565. top.Dialog.alert('请选择包含的突发事件!');
  566. return;
  567. }
  568. }
  569. //责任部门
  570. /*if(PLAN_TYPE_214!="106"){
  571. if(unit==""){
  572. top.Dialog.alert('请选择归口部门!');
  573. return;
  574. }
  575. }*/
  576. if(unit=="benbu999"){
  577. top.Dialog.alert('归口部门不能为本部!');
  578. return;
  579. }
  580. //预案名称
  581. if(name==""){
  582. top.Dialog.alert('预案名称填写不正确,请按要求填写!');
  583. return;
  584. }
  585. //预案编码
  586. if(PLAN_TYPE_214!="106"){
  587. if(plannmo==""){
  588. top.Dialog.alert('预案编码填写不正确,请按要求填写!');
  589. return;
  590. }
  591. }
  592. //颁布日期
  593. if(takeDate==""){
  594. top.Dialog.alert('颁布日期,请按要求填写!');
  595. return;
  596. }
  597. if(makeDate==""){
  598. top.Dialog.alert('实施日期,请按要求填写!');
  599. return;
  600. }
  601. // if(syfw==""){
  602. // top.Dialog.alert('简要说明填写不正确,请按要求填写!');
  603. // return;
  604. // }
  605. // if(explain==""){
  606. // top.Dialog.alert('简要说明填写不正确,请按要求填写!');
  607. // return;
  608. // }
  609. top.Dialog.alert('请检查标红输入框!');
  610. return;
  611. }
  612. }
  613. function redPlanDeptp(data){
  614. diag = new top.Dialog();// 定义一个窗口对象
  615. diag.Title = "选择关联的专项预案";// 窗口标题
  616. diag.URL = $.pathname() +"/page/business/am/contingencyPlan/PlanGuanlian.jsp?"+data;// 窗口对应的页面
  617. diag.Height = 500;
  618. diag.Width =600;
  619. diag.ShowOkButton=false;// 不显示确认按钮
  620. diag.ShowCancelButton=false;// 不显示取消按钮
  621. diag.ButtonAlign="center";// 按钮居中
  622. diag.show();// 显示窗口
  623. }
  624. //取复选框勾选的值
  625. var strRO="";
  626. function add(containerId){
  627. /* //取文件的名称
  628. var obj = document.getElementsByName("uploaderFileName");
  629. var objtemp = obj[0].value;
  630. //取文件的类型
  631. var objType = document.getElementsByName("uploaderFileExt");
  632. var objTypetemp = objType[0].value;
  633. //alert("文件名是:" + objtemp +"."+ objTypetemp);
  634. file = objtemp +"."+ objTypetemp;
  635. //将更新时间字段的name替换一下
  636. $("#UPDATEDATE_214").attr("name","PLAN_ID_214");
  637. test();
  638. //var file = $("#uploaderFileName").val();
  639. var ldot = file.lastIndexOf(".");
  640. var type ="."+ file.substring(ldot + 1);
  641. var pos=file.lastIndexOf("\\");
  642. var filename = file.substring(pos+1,ldot);
  643. //**将部门预案和专项、总体预案进行绑定,用COLUMN_1的字段。将专项、总体预案ID存到COLUMN_1这个字段里。以备后面所用。*//*
  644. //取勾选的预案ID
  645. // var selectNodesRO = $("#selectTree5-1").data("selectedNodes");
  646. // for(var i=0;i<selectNodesRO.length;i++){
  647. // strRO += selectNodesRO[i].id;
  648. // }
  649. var tempFile = file.split(",");
  650. if(tempFile.length>1){
  651. top.Dialog.alert("只允许上传一个附件,请检查是否只上传了一个附件。");
  652. return;
  653. }
  654. if(file.length>200){
  655. top.Dialog.alert("您上传的附件名称太长,请重命名后上传。");
  656. return;
  657. }*/
  658. //取文件的名称
  659. var files = document.getElementsByName("uploaderFileName");
  660. //取文件的类型
  661. var filetype = document.getElementsByName("uploaderFileExt");
  662. /* if(files.length>0){
  663. for(var i=0 ;i<files.length;i++ ){
  664. var d = filetype[i].value;
  665. if(d!="doc"&&d!="pdf"&&d!="zip"&&d!="docx"){
  666. top.Dialog.alert('您上传的文件格式不合法,请上传.doc、.pdf或.zip格式的文件!');
  667. return;
  668. }
  669. }
  670. }*/
  671. //取系统时间
  672. var date = allGetServerTime();
  673. var seperator1 = "";
  674. var seperator2 = "";
  675. var month = date.getMonth() + 1;
  676. var strDate = date.getDate();
  677. if (month >= 1 && month <= 9) {
  678. month = "0" + month;
  679. }
  680. if (strDate >= 0 && strDate <= 9) {
  681. strDate = "0" + strDate;
  682. }
  683. var PLAN_EN_TIME_214 = date.getFullYear() + "-" + month +"-" + strDate;
  684. //删除上一版本上传的文件
  685. var fdobj = document.getElementsByName("uploaderFileObjectid");
  686. for(var i=fdobj.length; i>0; i--){
  687. var id = fdobj[0].id;
  688. id = id.replace("uploaderFileObjectid","");
  689. //大于30说明是从数据库查出来的附件
  690. if(id.length==30){
  691. $("#uploaderFileObjectid"+id).remove();
  692. $("#uploaderFileRealName"+id).remove();
  693. $("#uploaderFileName"+id).remove();
  694. $("#uploaderFileExt"+id).remove();
  695. }
  696. }
  697. $('#DZ_FILE_214').val(PLAN_EN_TIME_214);
  698. $("#COLUMN_1_214").val();
  699. $("#UNITS_214").val(parent_id);
  700. $("#REMARK1_214").val(getUser_id);
  701. var name = $("#PLAN_NAME_214").val();//预案名称
  702. $("#VERSION_214").val(name+time+"版本");
  703. //存上一个预案的主键 PLAN_BIAOZHI_214
  704. if(PLAN_BIAOZHI=="0"){
  705. $("#PLAN_BIAOZHI_214").val(fd_id);
  706. }else{
  707. $("#PLAN_BIAOZHI_214").val(PLAN_BIAOZHI);
  708. }
  709. var plantype = $("#PLAN_TYPE_214").val();
  710. if(plantype=="103"){
  711. $("#BYSUNESS_TYPE_214").val(temp);
  712. }
  713. $("#UPLOAND_FLAG_214").val("1");
  714. $("#PLAN_VERSION_REMARK_214").val(fd_id);
  715. var category = $("#PLAN_REFINE_CATEGORY1_214").attr('relValue');
  716. $("#PLAN_REFINE_CATEGORY_214").val(category);
  717. var $form=$("#fillForm");
  718. var formValue = $form.serialize();
  719. var url = $.pathname() +"/ws/uploadForm/FileUpDownService/asyncFileUpLoad";
  720. $.request.add(url,formValue,function(data){
  721. var plantype = $("#PLAN_TYPE_214").val();//预案类型
  722. if(plantype=="103"){
  723. top.Dialog.confirm("要绑定该预案吗?|绑定", function() {
  724. var fd_id1 = data.Msg.objectID;
  725. var category = $("#PLAN_REFINE_CATEGORY_214").val();//包含的突发事件
  726. var url = "";
  727. if(PLAN_BIAOZHI=="0"){
  728. url = "/nwyj/page/business/am/contingencyPlan/"+"PlanNexus.jsp?"+fd_id1+"?"+fd_id+"?"+category+"?"+name;
  729. }else{
  730. url = "/nwyj/page/business/am/contingencyPlan/"+"PlanNexus.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?"+category+"?"+name;
  731. }
  732. window.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  733. },function(){
  734. top.Dialog.alert("修改成功!");
  735. goBack();
  736. });
  737. }else{
  738. top.Dialog.alert("修改成功!");
  739. goBack();
  740. }
  741. });
  742. // var $form=$("#fillForm");
  743. // var url = $.pathname() +"/ws/uploadForm/FileUpDownService/fileUpLoad";
  744. // fileToSaveAdd($form,null,null,url);
  745. // }else{
  746. // top.Dialog.alert('请检查标红输入框!');
  747. // };
  748. }
  749. //预案修订的情况下调用新增的方法:
  750. function fileToSaveAdd($form,listGrid,msg,url){
  751. showProgressBar("正在提交中...");
  752. //表单异步提交处理
  753. $form.ajaxSubmit({
  754. type: 'post',
  755. url:url,
  756. //表单提交成功后的回调
  757. success: function(responseText, statusText, xhr, $form){
  758. responseText = eval('('+responseText+')');
  759. closeProgress();
  760. top.Dialog.alert("修改成功!",null,null,null,-1);
  761. // if(msg!=undefined){
  762. // if(responseText.info == 'success')
  763. // top.Dialog.alert(msg+'成功!');//弹出提示
  764. // else
  765. // top.Dialog.alert(msg+'失败!');//弹出提示
  766. // }else{
  767. // if(responseText.info == 'success')
  768. // top.Dialog.alert('添加成功!');//弹出提示
  769. // else
  770. // top.Dialog.alert('添加失败!');//弹出提示
  771. // }
  772. goBack();
  773. }
  774. });
  775. }
  776. //修改
  777. function edit(){
  778. var plantype = $("#PLAN_TYPE_214").val();
  779. if(plantype=="103"){
  780. test();
  781. $("#BYSUNESS_TYPE_214").val(temp);
  782. }
  783. var category = $("#PLAN_REFINE_CATEGORY1_214").attr('relValue');
  784. var COLUMN_1_214 = $("#redAlert").val();
  785. $("#COLUMN_1_214").val(COLUMN_1_214);
  786. $("#PLAN_REFINE_CATEGORY_214").val(category);
  787. $("#UPLOAND_FLAG_214").val("0");
  788. //上一个版本的预案的ID
  789. $("#PLAN_VERSION_REMARK_214").val(fd_id);
  790. $("#UPDATEDATE_214").attr("name","PLAN_ID_214");
  791. $("#PLAN_REFINE_CATEGORY").val();
  792. var formValue = $('#fillForm').serialize();
  793. var url = $.pathname() + '/ws/uploadForm/FileUpDownService/asyncFileUpLoad';
  794. $.ajax({
  795. url : url,
  796. type : 'post',
  797. data : formValue,
  798. dataType : 'text',
  799. timeout : 60000,
  800. success : function(data){
  801. var plantype = $("#PLAN_TYPE_214").val();//预案类型
  802. if(plantype=="103"){
  803. top.Dialog.confirm("要绑定该预案吗?|绑定", function() {
  804. var name = $("#PLAN_NAME_214").val();//预案名称
  805. var category = $("#PLAN_REFINE_CATEGORY_214").val();//包含的突发事件
  806. var url = "/nwyj/page/business/am/contingencyPlan/"+"PlanNexus.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?"+category+"?"+name;
  807. window.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  808. },function(){
  809. top.Dialog.alert("修改成功!");
  810. goBack();
  811. });
  812. }else{
  813. top.Dialog.alert("修改成功!");
  814. goBack();
  815. }
  816. },
  817. error : function(){
  818. $.messager.alert('操作失败');
  819. }
  820. });
  821. }
  822. /* //取表单里的值,如果都不等于空,证明该表单被修改过。离开的时候给出提示。
  823. function getValueGoBack(){
  824. var PLAN_NAME_214 = $("#PLAN_NAME_214").val();
  825. var PLAN_NO_214 = $("#PLAN_NO_214").val();
  826. var PLAN_TYPE_214 =$("#PLAN_TYPE_214").val();
  827. var PLAN_REFINE_CATEGORY_214 = $("#PLAN_REFINE_CATEGORY1_214").attr('relValue');
  828. var INS_UNITS_214 = $("#INS_UNITS_214").val();
  829. var redAlert = $("#redAlert").val();
  830. var SYFW_214 = $("#SYFW_214").val();
  831. var CHANGE_EXPLAIN_214 = $("#CHANGE_EXPLAIN_214").val();
  832. var TAKE_DATE_214 = $("#TAKE_DATE_214").val();
  833. var CHANGE_TYPE = $("#CHANGE_TYPE").val();
  834. var totalValue = CHANGE_TYPE + PLAN_NAME_214 + PLAN_NO_214 + PLAN_TYPE_214 + PLAN_REFINE_CATEGORY_214 + INS_UNITS_214 + redAlert + SYFW_214 + CHANGE_EXPLAIN_214 + TAKE_DATE_214 ;
  835. if(totalValue==totalValue1){
  836. var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlan.jsp";
  837. window.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  838. }else{
  839. top.Dialog.confirm("您已经修改了表单,是否需要离开?|离开", function() {
  840. var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlan.jsp";
  841. window.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  842. });
  843. }
  844. }*/
  845. //返回
  846. function goBack(){
  847. var backId = (window.location.href).split('?')[2];
  848. if(backId=="ZX"){
  849. var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlanZX.jsp";
  850. window.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  851. }else{
  852. var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlan.jsp";
  853. window.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  854. };
  855. }
  856. //重置
  857. function resetSearch(){
  858. document.location.reload();
  859. }
  860. $.messager=top.Dialog;