f965cc9720287c2c80e0f0497ed10b0756a06fe5.svn-base 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. /*****************************************************有预警的应急预案预警时短息通知的JS***********************************************************/
  2. $(function(){
  3. $("#titlename").html(parent.parent.titlename);
  4. getIniValue();
  5. //getRelevancyInfo(sub_fd_id,SUB_BM_YAXHLB);//初始化存入库表的值
  6. getOrgInfo2();//初始化应急组织列表
  7. setHeightThis();
  8. //window.setTimeout("setHeightThis()", 200);
  9. });
  10. function setHeightThis(){
  11. $(parent.parent.document.body).find("iframe").height($(window.document.body).height()+700);
  12. $(parent.parent.parent.document.body).find("iframe").height($(parent.parent.document.body).height()+700);
  13. }
  14. function resetSearch(){
  15. document.location.reload();
  16. }
  17. function goBack(){
  18. var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlan.jsp";
  19. top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  20. }
  21. //取预案的主键
  22. var sub_fd_id ="";
  23. //取页面传过来的预案主键ID : 传过来的预案ID
  24. sub_fd_id = parent.parent.fd_id;
  25. //预案的类型
  26. var SUB_BM_YAXHLB= "";
  27. SUB_BM_YAXHLB = parent.parent.BM_YAXHLB;
  28. var tempValue="";
  29. /**************************拼接类型*************************************************/
  30. //判断细化类型
  31. /**
  32. * 细化类型
  33. * 4、人身事故
  34. * 5、大面积停电事件
  35. * 6、设备事故
  36. * 7、电厂大坝厂房事故
  37. * 8、环境污染
  38. * 9、防风防汛
  39. * 10、地震灾害
  40. * 11、低温雨雪冰冻灾害
  41. * 12、电力供应及客户服务
  42. * 13、生产场所防恐怖袭击
  43. * 14、突发性群体事件
  44. * 15、突发新闻事件
  45. * 16、涉外突发事件
  46. * 17、网络与信息安全
  47. * 18、突发公共卫生
  48. * **/
  49. if(SUB_BM_YAXHLB=="4"){
  50. tempValue="4_5_1";
  51. }else if(SUB_BM_YAXHLB=="5"){
  52. tempValue="5_5_1";
  53. }else if(SUB_BM_YAXHLB=="6"){
  54. tempValue="6_5_1";
  55. }else if(SUB_BM_YAXHLB=="7"){
  56. tempValue="7_5_1";
  57. }else if(SUB_BM_YAXHLB=="8"){
  58. tempValue="8_5_1";
  59. }else if(SUB_BM_YAXHLB=="9"){
  60. tempValue="9_5_1";
  61. }else if(SUB_BM_YAXHLB=="10"){
  62. tempValue="10_5_1";
  63. }else if(SUB_BM_YAXHLB=="11"){
  64. tempValue="11_5_1";
  65. }else if(SUB_BM_YAXHLB=="12"){
  66. tempValue="12_5_1";
  67. }else if(SUB_BM_YAXHLB=="13"){
  68. tempValue="13_5_1";
  69. }else if(SUB_BM_YAXHLB=="14"){
  70. tempValue="14_5_1";
  71. }else if(SUB_BM_YAXHLB=="15"){
  72. tempValue="15_5_1";
  73. }else if(SUB_BM_YAXHLB=="16"){
  74. tempValue="16_5_1";
  75. }else if(SUB_BM_YAXHLB=="17"){
  76. tempValue="17_5_1";
  77. }else if(SUB_BM_YAXHLB=="18"){
  78. tempValue="18_5_1";
  79. }else if(SUB_BM_YAXHLB=="21"){
  80. tempValue="21_5_1";
  81. }else if(SUB_BM_YAXHLB=="22"){
  82. tempValue="22_5_1";
  83. }else if(SUB_BM_YAXHLB=="23"){
  84. tempValue="23_5_1";
  85. }else if(SUB_BM_YAXHLB=="24"){
  86. tempValue="24_5_1";
  87. }
  88. /*//重设高度
  89. function reSetHight(){
  90. $(parent.parent.document.body).find("iframe").height(1300);
  91. $(top.parent.document.body).find("#frmright").height(1000);
  92. }*/
  93. var orgName1 = "";
  94. var orgName2 = "";
  95. var orgName3 = "";
  96. var orgName4 = "";
  97. function getIniValue(){
  98. var url = $.pathname()
  99. + "/ws/sendmenu/SendMsgService/PlanInfo";
  100. var params = {
  101. file_id : sub_fd_id,
  102. grade_type:tempValue,
  103. };
  104. $.ajax({
  105. url : url,
  106. type : 'post',
  107. timeout : 12000,
  108. data : params,
  109. dataType : 'json',
  110. success : function(data) {
  111. var orgVlue = data.rows[0].MSG_OPTER;
  112. $("#show_SPONSOR_COMP_299").val(orgVlue);
  113. orgName1 = data.rows[0].FRIST_GRADE;
  114. orgName2 = data.rows[0].SECOND_GRADE;
  115. orgName3 = data.rows[0].THRID_GRADE;
  116. orgName4 = data.rows[0].FOURTH_GRADE;
  117. $('#show_SPONSOR_COMP_2991').val(orgName1);
  118. $('#show_SPONSOR_COMP_2992').val(orgName2);
  119. $('#show_SPONSOR_COMP_2993').val(orgName3);
  120. $('#show_SPONSOR_COMP_2994').val(orgName4);
  121. fd_id215 = data.rows[0].FD_OBJECTID;
  122. FILLER1_215 = data.rows[0].FILLER1;
  123. $("#fd_id215").val(fd_id215);
  124. $("#FILLER1_215").val(FILLER1_215);
  125. },
  126. error : function(e) {
  127. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  128. }
  129. });
  130. }
  131. var type = SUB_BM_YAXHLB + "5_2";//拼短信通知的类型
  132. var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  133. /*****************************************测试返回数据*************************************************/
  134. //单位ID
  135. var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  136. var loadData;
  137. var org;
  138. /****************************************************单表**********************************************************/
  139. function getOrgInfo2() {
  140. org = $("#maingridorg1").quiGrid({
  141. columns: [
  142. {display : '姓名',name : 'name',align : 'center',width : '20%'},
  143. /*{display : '所属单位',name : 'org',align : 'center',width : '14%'},
  144. {display : '所属部门',name : 'dept',align : 'center',width : '14%'}, */
  145. { display: '红色预警',level1 : 'level1', isAllowHide: false, align: 'center', width:'20%',
  146. render: function (rowdata, rowindex, value, column){
  147. var fabu='';
  148. if(rowdata.level1=="1"){//"1"代表被选中的
  149. fabu = '<span id="1" class="getUserInfo1 hand" title="取消" onclick="fabu(' + rowindex + ',this,\''+rowdata.fd_objectid+'\',\''+rowdata.level1+'\')"></span>';
  150. }else{
  151. fabu = '<span id="1" class="getUserInfo2 hand" title="取消" onclick="fabu(' + rowindex + ',this ,\''+rowdata.fd_objectid+'\',\''+rowdata.level1+'\')"></span>';
  152. }
  153. return fabu;
  154. },
  155. },
  156. { display: '橙色预警',level2 : 'level2', isAllowHide: false, align: 'center', width:'20%',
  157. render: function (rowdata, rowindex, value, column){
  158. var fabu='';
  159. if(rowdata.level2=="1"){
  160. fabu = '<span id="2" class="getUserInfo1 hand" title="取消" onclick="fabu(' + rowindex + ',this,\''+rowdata.fd_objectid+'\',\''+rowdata.level2+'\')"></span>';
  161. }else{
  162. fabu = '<span id="2" class="getUserInfo2 hand" title="选中" onclick="fabu(' + rowindex + ',this ,\''+rowdata.fd_objectid+'\',\''+rowdata.level2+'\')"></span>';
  163. }
  164. return fabu;
  165. },
  166. },
  167. { display: '黄色预警',level3 : 'level3', isAllowHide: false, align: 'center', width:'20%',
  168. render: function (rowdata, rowindex, value, column){
  169. var fabu='';
  170. if(rowdata.level3=="1"){
  171. fabu = '<span id="3" class="getUserInfo1 hand" title="取消" onclick="fabu(' + rowindex + ',this,\''+rowdata.fd_objectid+'\',\''+rowdata.level3+'\')"></span>';
  172. }else{
  173. fabu = '<span id="3" class="getUserInfo2 hand" title="选中" onclick="fabu(' + rowindex + ',this ,\''+rowdata.fd_objectid+'\',\''+rowdata.level3+'\')"></span>';
  174. }
  175. return fabu;
  176. },
  177. },
  178. { display: '蓝色预警',level4 : 'level4', isAllowHide: false, align: 'center', width:'20%',
  179. render: function (rowdata, rowindex, value, column){
  180. var fabu='';
  181. if(rowdata.level4=="1"){
  182. fabu = '<span id="4" class="getUserInfo1 hand" title="取消" onclick="fabu(' + rowindex + ',this,\''+rowdata.fd_objectid+'\',\''+rowdata.level4+'\')"></span>';
  183. }else{
  184. fabu = '<span id="4" class="getUserInfo2 hand" title="选中" onclick="fabu(' + rowindex + ',this ,\''+rowdata.fd_objectid+'\',\''+rowdata.level4+'\')"></span>';
  185. }
  186. return fabu;
  187. },
  188. }
  189. ],
  190. url :$.pathname()+ "/ws/planService/PlanService/queryDxtzyjzz",
  191. params :{
  192. fdId : sub_fd_id,
  193. gtype:"1",
  194. deptId:deptId
  195. },
  196. sortName : '',
  197. sortOrder : '',
  198. rownumbers : true,
  199. checkbox : false,
  200. /* height: '99%',
  201. width:"100%",*/
  202. pageSize : 10,
  203. percentWidthMode : true,
  204. isChecked:checkedHandler,
  205. onCheckRow: checkRowHandler,
  206. onCheckAllRow: checkAllRowHandler,
  207. //顶部图标按钮栏
  208. toolbar:{
  209. items:[
  210. //{text: '查看', click: "onView", iconClass: 'view_tem',id:"10003"}
  211. //{text: '查看', click: onView, iconClass: 'view_tem'},
  212. { line : true }
  213. ]
  214. }
  215. });
  216. }
  217. //预案ID.
  218. //人ID.
  219. //预警还是响应.
  220. //1234.
  221. //0 1
  222. //123组织、队伍、专家
  223. //地址changeDxtzyjzz
  224. function fabu(rowindex,event,userid,is_del){
  225. var id = $(event).attr("id");//取1234个等级
  226. var url = $.pathname() + '/ws/planService/PlanService/changeDxtzyjzz/';
  227. if(is_del=="1"){
  228. is_del="0";
  229. }else{
  230. is_del="1";
  231. }
  232. var params = {
  233. gtype : "1", //预警或响应
  234. //gtype:tempValue,
  235. fdId:sub_fd_id,//预案主键
  236. msgType:"1", //组织1、队伍2、专家3
  237. msgOpter:userid,//人员ID
  238. clum:id,//
  239. clv:is_del//删除还是创建标志
  240. };
  241. $.ajax({
  242. url : url,
  243. type : 'post',
  244. timeout : 60000,
  245. data : params,
  246. dataType : 'json',
  247. success : function(data){
  248. if(data=="1"){
  249. var classValue = $(event).attr("class");
  250. if(classValue=="getUserInfo2 hand"){
  251. $(event).removeClass("getUserInfo2 hand");
  252. $(event).addClass("getUserInfo1 hand");
  253. }else{
  254. $(event).removeClass("getUserInfo1 hand");
  255. $(event).addClass("getUserInfo2 hand");
  256. }
  257. }
  258. },
  259. error : function(e){
  260. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  261. }
  262. });
  263. };
  264. var fd_id215 = "";
  265. //判断是走新增还是走修改的方法
  266. function isAdd1(){
  267. if(fd_id215!=""){
  268. //修改方法
  269. edit();
  270. }else{
  271. //新增绑定条件
  272. addTransferDaily();
  273. }
  274. }
  275. //修改
  276. function edit(){
  277. //常用组织的名称
  278. var orgValueName1 = $('#show_SPONSOR_COMP_2991').val();
  279. var orgValueName2 = $('#show_SPONSOR_COMP_2992').val();
  280. var orgValueName3 = $('#show_SPONSOR_COMP_2993').val();
  281. var orgValueName4 = $('#show_SPONSOR_COMP_2994').val();
  282. var orgValue1 = $('#SPONSOR_COMP_2991').val();
  283. var orgValue2 = $('#SPONSOR_COMP_2992').val();
  284. var orgValue3 = $('#SPONSOR_COMP_2993').val();
  285. var orgValue4 = $('#SPONSOR_COMP_2994').val();
  286. var orgValue1Temp1 = "";
  287. var orgValue1Temp2 = "";
  288. var orgValue1Temp3 = "";
  289. var orgValue1Temp4 = "";
  290. if(orgName1!=orgValueName1){
  291. orgValue1Temp1 = orgValueName1;
  292. }else{
  293. orgValue1Temp1 = orgName1;
  294. }
  295. if(orgName2!=orgValueName2){
  296. orgValue1Temp2 = orgValueName2;
  297. }else{
  298. orgValue1Temp2 = orgName2;
  299. }
  300. if(orgName3!=orgValueName3){
  301. orgValue1Temp3 = orgValueName3;
  302. }else{
  303. orgValue1Temp3 = orgName3;
  304. }
  305. if(orgName4!=orgValueName4){
  306. orgValue1Temp4 = orgValueName4;
  307. }else{
  308. orgValue1Temp4 = orgName4;
  309. }
  310. $("#FRIST_GRADE_215").val(orgValue1Temp1);
  311. $("#SECOND_GRADE_215").val(orgValue1Temp2);
  312. $("#THRID_GRADE_215").val(orgValue1Temp3);
  313. $("#FOURTH_GRADE_215").val(orgValue1Temp4);
  314. var orgValue = orgValue1 + "|" + orgValue2 + "|" + orgValue3 + "|" + orgValue4;
  315. //写入预案分级的等级
  316. $("#GRADE_TYPE_215").val(tempValue);
  317. $("#FILLER1_215").val(sub_fd_id);
  318. $("#MSG_OPTER_215").val(orgValue);
  319. var formValue = $('#fillForm').serialize();
  320. var url = $.pathname() + '/ws/crud/CRUDService/update';
  321. $.ajax({
  322. url : url,
  323. type : 'post',
  324. data : formValue,
  325. dataType : 'text',
  326. timeout : 60000,
  327. success : function(data){
  328. $.messager.alert('修改成功');
  329. location.reload();//防风防汛短信通知刷新当前页面。
  330. //parent.location.reload();
  331. },
  332. error : function(){
  333. $.messager.alert('操作失败');
  334. }
  335. });
  336. }
  337. //增加
  338. function addTransferDaily(){
  339. //红橙黄蓝四个级别预警的常用组织ID
  340. var orgValue1 = $('#SPONSOR_COMP_2991').val();
  341. var orgValue2 = $('#SPONSOR_COMP_2992').val();
  342. var orgValue3 = $('#SPONSOR_COMP_2993').val();
  343. var orgValue4 = $('#SPONSOR_COMP_2994').val();
  344. var orgValue = orgValue1 + "|" + orgValue2 + "|" + orgValue3 + "|" + orgValue4;
  345. $("#MSG_OPTER_215").val(orgValue);
  346. //常用组织的名称
  347. var orgValueName1 = $('#show_SPONSOR_COMP_2991').val();
  348. var orgValueName2 = $('#show_SPONSOR_COMP_2992').val();
  349. var orgValueName3 = $('#show_SPONSOR_COMP_2993').val();
  350. var orgValueName4 = $('#show_SPONSOR_COMP_2994').val();
  351. //alert("orgValueName1:" + orgValueName1 + "orgValueName2:" + orgValueName2 + "orgValueName3" + orgValueName3 + "orgValueName4" + orgValueName4);
  352. $("#FRIST_GRADE_215").val(orgValueName1);
  353. $("#SECOND_GRADE_215").val(orgValueName2);
  354. $("#THRID_GRADE_215").val(orgValueName3);
  355. $("#FOURTH_GRADE_215").val(orgValueName4);
  356. //写入预案分级的等级
  357. $("#GRADE_TYPE_215").val(tempValue);
  358. //预案的ID
  359. $("#FILLER1_215").val(sub_fd_id);
  360. $form = $('#fillForm');
  361. var url = $.pathname() + '/ws/crud/CRUDService/create';
  362. $.ajax({
  363. url : url,
  364. type : 'post',
  365. data : $form.serialize(),
  366. dataType : 'text',
  367. timeout : 60000,
  368. success : function(data){
  369. $.messager.alert("保存成功",null,null,null,-1);
  370. location.reload();
  371. //parent.location.reload();
  372. },
  373. error : function(){
  374. $.messager.alert('操作失败');
  375. }
  376. });
  377. }
  378. /*****************************************短信通知人员列表*********************************************/
  379. $.messager=top.Dialog;
  380. /*$(window).resize(function(){
  381. $(parent.document.body).find("#frmright").css("height","1000px");
  382. });*/