123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383 |
-
- //2015-09-29 可以取到父页面的预案ID
- var sub_fd_id ="";
- sub_fd_id = parent.fd_id;
-
- //取预案PLAN_BIAOZHI字段,如果该字段等于0,说明该预案没有修订版本。没有绑定过任何条件。如果不等于0,则该预案有过修订版本。可能存在绑定过的条件。
- var PLAN_BIAOZHI="";
- PLAN_BIAOZHI = parent.PLAN_BIAOZHI;
- //取父页面传过来的预案细化类型
- var SUB_BM_YAXHLB = "";
- SUB_BM_YAXHLB = parent.BM_YAXHLB;
- //给页面赋值细化类型
- var tempValue = "";
- //判断细化类型
- /**
- * 细化类型
- * 4、人身事故
- * 5、大面积停电事件
- * 6、设备事故
- * 7、电厂大坝厂房事故
- * 8、环境污染
- * 9、防风防汛
- * 10、地震灾害
- * 11、低温雨雪冰冻灾害
- * 12、电力供应及客户服务
- * 13、生产场所防恐怖袭击
- * 14、突发性群体事件
- * 15、突发新闻事件
- * 16、涉外突发事件
- * 17、网络与信息安全
- * 18、突发公共卫生
- * **/
-
-
-
- if(SUB_BM_YAXHLB=="4"){
- tempValue="4_1";
- }else if(SUB_BM_YAXHLB=="5"){
- tempValue="5_1";
- }else if(SUB_BM_YAXHLB=="6"){
- tempValue="6_1";
- }else if(SUB_BM_YAXHLB=="7"){
- tempValue="7_1";
- }else if(SUB_BM_YAXHLB=="8"){
- tempValue="8_1";
- }else if(SUB_BM_YAXHLB=="9"){
- tempValue="9_1";
- }else if(SUB_BM_YAXHLB=="10"){
- tempValue="10_1";
- }else if(SUB_BM_YAXHLB=="11"){
- tempValue="11_1";
- }else if(SUB_BM_YAXHLB=="12"){
- tempValue="12_1";
- }else if(SUB_BM_YAXHLB=="13"){
- tempValue="13_1";
- }else if(SUB_BM_YAXHLB=="14"){
- tempValue="14_1";
- }else if(SUB_BM_YAXHLB=="15"){
- tempValue="15_1";
- }else if(SUB_BM_YAXHLB=="16"){
- tempValue="16_1";
- }else if(SUB_BM_YAXHLB=="17"){
- tempValue="17_1";
- }else if(SUB_BM_YAXHLB=="18"){
- tempValue="18_1";
- }else if(SUB_BM_YAXHLB=="21"){
- tempValue="21_1";
- }else if(SUB_BM_YAXHLB=="22"){
- tempValue="22_1";
- }else if(SUB_BM_YAXHLB=="23"){
- tempValue="23_1";
- }else if(SUB_BM_YAXHLB=="24"){
- tempValue="24_1";
- }
-
- var temp1="";
- if(PLAN_BIAOZHI=="0"){
- temp1 = sub_fd_id;
- }else{
- temp1 =PLAN_BIAOZHI;
- }
-
- //如果突发事件四个等级都为空,则证明该条件没有被绑定,走新增的方法
- var FRIST_GRAD="";
- var SECOND_GRADE="";
- var THRID_GRADE="";
- var FOURTH_GRADE="";
- var total = "";
- var fd_id215 = "";
- var FILLER1_215 = "";
- //如果突发事件四个等级不为空,走修改的方法。
-
- //记录当前页面的值
- var InitformValue="";
-
- $(function(){
- setTimeout(function(){
- $("#titlename").html(parent.titlename);
- },100);
-
-
- var url = $.pathname()
- + "/ws/sendmenu/SendMsgService/PlanInfo";
- var params = {
- file_id : sub_fd_id,
- grade_type:tempValue,
- };
- $.ajax({
- url : url,
- type : 'post',
- timeout : 12000,
- data : params,
- dataType : 'json',
- success : function(data) {
- if(data.rows.length!=0){
- window.setTimeout("setHeightThis()", 200);
- FRIST_GRADE = data.rows[0].FRIST_GRADE;//FRIST_GRADE
- SECOND_GRADE = data.rows[0].SECOND_GRADE;
- THRID_GRADE = data.rows[0].THRID_GRADE;
- FOURTH_GRADE = data.rows[0].FOURTH_GRADE;
- fd_id215 = data.rows[0].FD_OBJECTID;
-
- FILLER1_215 = data.rows[0].FILLER1;
- total = FRIST_GRADE+SECOND_GRADE+THRID_GRADE+FOURTH_GRADE;
- $("#FRIST_GRADE_215").html(FRIST_GRADE);
- $("#SECOND_GRADE_215").html(SECOND_GRADE);
- $("#THRID_GRADE_215").html(THRID_GRADE);
- $("#FOURTH_GRADE_215").html(FOURTH_GRADE);
-
- $("#fd_id215").val(fd_id215);
- $("#FILLER1_215").val(FILLER1_215);
-
- for ( var i in data) {
- $('#' + i).html(data[i]);
- }
- }
- //记录当前页面的值
- InitformValue = $('#fillForm').serialize();
- $("#infotab").init();
- },
- error : function(e) {
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
-
-
-
- });
-
- function setHeightThis(){
- $(parent.document.body).find("iframe").height($(window.document.body).height()+30);
- $(parent.parent.document.body).find("iframe").height($(parent.document.body).height()+280);
- }
-
-
-
- //判断是走新增还是走修改的方法
- function isAdd(containerId){
- //fd_id215
- if(fd_id215!=""){
- //修改方法
- edit(containerId);
- }else{
- //新增绑定条件
- addTransferDaily(containerId);
- }
- }
-
- //保存跳转下一步
- function isAdd1(){
- if(fd_id215!=""){
- //修改方法
- edit1();
- }else{
- //新增绑定条件
- addTransferDaily1();
- }
- }
-
- //新增保存并跳转下一步
- function addTransferDaily1(){
- var FRIST_GRADE = $("#FRIST_GRADE_215").val();
- var SECOND_GRADE = $("#SECOND_GRADE_215").val();
- var THRID_GRADE = $("#THRID_GRADE_215").val();
- var FOURTH_GRADE = $("#FOURTH_GRADE_215").val();
- var total = FRIST_GRADE + SECOND_GRADE + THRID_GRADE + FOURTH_GRADE;
- if(total==""){
- top.Dialog.alert('还没绑定任何条件!');
- return;
- }else{
- //取父页面的变量
- var sub_fd_id = parent.fd_id;
- $("#FILLER1_215").val(sub_fd_id);
- //写入预案分级的等级
- $("#GRADE_TYPE_215").val(tempValue);
- $form = $('#fillForm');
- var url = $.pathname() + '/ws/crud/CRUDService/create';
- $.ajax({
- url : url,
- type : 'post',
- data : $form.serialize(),
- dataType : 'text',
- timeout : 60000,
- success : function(data){
- $.messager.alert("保存成功",null,null,null,-1);
- Next();
- },
- error : function(){
- $.messager.alert('操作失败');
- }
- });
- }
- }
-
- //修改保存并跳转下一步
- function edit1(){
- $("#GRADE_TYPE_215").val(tempValue);
- var formValue = $('#fillForm').serialize();
- var url = $.pathname() + '/ws/crud/CRUDService/update';
- $.ajax({
- url : url,
- type : 'post',
- data : formValue,
- dataType : 'text',
- timeout : 60000,
- success : function(data){
- $.messager.alert('修改成功');
- Next();
- },
- error : function(){
- $.messager.alert('操作失败');
- }
- });
- }
-
- //修改
- function edit(containerId){
- var FRIST_GRADE = $("#FRIST_GRADE_215").val();
- var SECOND_GRADE = $("#SECOND_GRADE_215").val();
- var THRID_GRADE = $("#THRID_GRADE_215").val();
- var FOURTH_GRADE = $("#FOURTH_GRADE_215").val();
-
- var valid = $(containerId).validationEngine({returnIsValid: true});
- if(valid == true){
- $("#GRADE_TYPE_215").val(tempValue);
- var formValue = $('#fillForm').serialize();
- var url = $.pathname() + '/ws/crud/CRUDService/update';
- $.ajax({
- url : url,
- type : 'post',
- data : formValue,
- dataType : 'text',
- timeout : 60000,
- success : function(data){
- $.messager.alert('修改成功');
- //刷新页面
- location.reload();
- },
- error : function(){
- $.messager.alert('操作失败');
- }
- });
- }else{
- if(FRIST_GRADE==""){
- top.Dialog.alert("特别重大事件不能为空!");
- return;
- }
- if(SECOND_GRADE==""){
- top.Dialog.alert("重大事件不能为空!");
- return;
- }
- if(THRID_GRADE==""){
- top.Dialog.alert("比较重大事件不能为空!");
- return;
- }
- if(FOURTH_GRADE==""){
- top.Dialog.alert("一般事件不能为空!");
- return;
- }
- }
- }
-
- //重置
- function resetSearch(){
- document.location.reload();
- }
-
- //新增绑定条件的方法
- function addTransferDaily(containerId){
- var FRIST_GRADE = $("#FRIST_GRADE_215").val();
- var SECOND_GRADE = $("#SECOND_GRADE_215").val();
- var THRID_GRADE = $("#THRID_GRADE_215").val();
- var FOURTH_GRADE = $("#FOURTH_GRADE_215").val();
- // var total = FRIST_GRADE + SECOND_GRADE + THRID_GRADE + FOURTH_GRADE;
- var valid = $(containerId).validationEngine({returnIsValid: true});
- if(valid == true){
- $("#FILLER1_215").val(sub_fd_id);
- //写入预案分级的等级
- $("#GRADE_TYPE_215").val(tempValue);
-
- $form = $('#fillForm');
-
- var url = $.pathname() + '/ws/crud/CRUDService/create';
-
- $.ajax({
- url : url,
- type : 'post',
- data : $form.serialize(),
- dataType : 'text',
- timeout : 60000,
- success : function(data){
- $.messager.alert("保存成功",null,null,null,-1);
- //刷新页面
- location.reload();
- },
- error : function(){
- $.messager.alert('操作失败');
- }
- });
-
- }else{
- if(FRIST_GRADE==""){
- top.Dialog.alert("特别重大事件不能为空!");
- return;
- }
- if(SECOND_GRADE==""){
- top.Dialog.alert("重大事件不能为空!");
- return;
- }
- if(THRID_GRADE==""){
- top.Dialog.alert("比较重大事件不能为空!");
- return;
- }
- if(FOURTH_GRADE==""){
- top.Dialog.alert("一般事件不能为空!");
- return;
- }
- }
-
-
- // if(total==""){
- // top.Dialog.alert('还没绑定任何条件!');
- // return;
- // }else{}
- }
-
- //保存并跳转到下一步
- function Next() {
- var url = "/nwyj/page/business/am/contingencyPlan/"+"PlanGradeYJ.jsp";
- parent.document.getElementById("text1").setAttribute("class", "");
- parent.document.getElementById("text2").setAttribute("class", "current");
- parent.document.getElementById("frmrightChild").setAttribute("src", ""+encodeURI(url));
- }
-
- //返回事件
- function goBack() {
- if(parent.backId=="ZX"){
- var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlanZX.jsp";
- top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
- }else{
- var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlan.jsp";
- top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
- }
- /* var formValue = $('#fillForm').serialize();
- if(formValue!=InitformValue){
- top.Dialog.confirm("您已修改了表单,是否需要离开?|离开", function() {
- var url = "/nwyj/page/business/am/contingencyPlan/"+"ContingencyPlan.jsp";
- top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
- });
- }else{
-
- }
- */
- }
-
-
- $.messager=top.Dialog;
|