$(function(){ //setSelectDisabled3(); /***2016-04-11梳理下拉框的值,用公共方法的下拉框取值方式***/ //预案类型 $("#PLAN_TYPE_214").initCanstSelect('BM_PLANTYPE'); $("#PLAN_TYPE_214").render(); //突发事件类型 $("#BYSUNESS_TYPE_2141").initCanstSelect('BM_BYSUNESS_TYPE'); $("#BYSUNESS_TYPE_2141").render(); /*//包含的突发事件 $("#PLAN_REFINE_CATEGORY_214").initCanstSelect('BM_YAXHLB'); $("#PLAN_REFINE_CATEGORY_214").render();*/ //取登录人的ID ENTERING_214 = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id(); //用户所属单位 var getCorp_names = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names(); $("#UNITS_214_SHOW").val(getCorp_names); //取登录用户信息 //登录用户姓名 var userName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name(); $("#REAL_NAME_880").html(userName); //用户手机号 getMobile = top.com.sinosoft.lz.system.user.LoginInfo.getMobile(); if(getMobile==undefined){ $("#MOBILE_880").html("暂无手机号码"); }else{ $("#MOBILE_880").html(getMobile); } $("#INS_UNITS_2141").OrgSel({valuetype:"renyuanguangli"}); //$("#UPDERTAKE_COMP_299").OrgSel(); $("#show_INS_UNITS_2141").attr("class","validate[required,functionCall[func1|* 不能选择本部]]"); $("#COMPANY_ID_880").html(getCorp_names); //用户所属部门 var getDeptnames = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames(); $("#ORG_ID_880").html(getDeptnames); $('#fileDiv').newAsyncFileUpload("",null,1); var AreaSql = "select FD_CODE,PARENT_ID,FD_DESCRIPTION from BM_MAPVALUECANST where FD_TYPE = 'BM_YAXHLB'"; //细化类别 var treeUrl = $.pathname() + '/ws/sys/constantService/getTreeCanst/'; var params = { sql:AreaSql }; $.ajax({ url : treeUrl, type : 'post', timeout : 60000, data : params, dataType : 'json', async: false, success : function(data){ $("#PLAN_REFINE_CATEGORY_214").data("data",data[0].constlist); $("#PLAN_REFINE_CATEGORY_214").render(); mydata = data[0].constlist; }}); $abc = $("#PLAN_REFINE_CATEGORY_214"); $abc.bind('change',function(){ test(); }); //包含的突发事件 // $("#PLAN_REFINE_CATEGORY_214").getCanstSelect({state:"BM_YAXHLB",width:"280"} ); $("#goback").hover(function(){ $(this).attr("src","/nwyj/images/temp/back_hover.png"); },function(){ $(this).attr("src","/nwyj/images/temp/back.png"); }); }); function func1(){ if($("#INS_UNITS_2141").val()=="benbu999"){ return true; } return false; } var mydata; //登录人ID var ENTERING_214 = ""; var getMobile=""; var temp = ""; function test(){ var getValue = $("#PLAN_REFINE_CATEGORY_214").attr('relValue'); if(getValue=="0"||getValue=="1"||getValue=="2"||getValue=="3"){ top.Dialog.alert('选择具体的专项预案!'); $("#PLAN_REFINE_CATEGORY_214").resetValue(); return; }else{ if(getValue=="4"||getValue=="5"||getValue=="6"||getValue=="7"){ temp = "106"; }else if(getValue=="9"||getValue=="10"||getValue=="11"){ temp = "105"; }else if(getValue=="8"||getValue=="18"){ temp = "107"; }else{ temp = "108"; } } } //重新获取包含的突发事件过滤,不需要所有的都加载。 function reInitCategory(){ //取突发事件类型的值 var bysunes = $('#BYSUNESS_TYPE_2141').val(); //定义转换突发事件类型的变量,因为当时存入库表的时候没有考虑周全,需要转换。 var parnet_id = ""; if(bysunes=="105"){ parnet_id = "0"; }else if(bysunes=="106"){ parnet_id = "1"; }else if(bysunes=="107"){ parnet_id = "2"; }else if(bysunes=="108"){ parnet_id = "3"; } //var AreaSql = "select FD_CODE,PARENT_ID,FD_DESCRIPTION from BM_MAPVALUECANST where FD_TYPE = 'BM_YAXHLB' and parent_id = '"+parnet_id+"'"; //细化类别 //var treeUrl = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/reInitCategory'; var AreaSql = ""; if(parnet_id.length!=0) AreaSql = "select FD_CODE,PARENT_ID,FD_DESCRIPTION from BM_MAPVALUECANST where FD_TYPE = 'BM_YAXHLB' and parent_id = '"+parnet_id+"'"; else AreaSql = "select FD_CODE,PARENT_ID,FD_DESCRIPTION from BM_MAPVALUECANST where FD_TYPE = 'BM_YAXHLB' "; //细化类别 var treeUrl = $.pathname() + '/ws/sys/constantService/getTreeCanst/'; var params = { sql:AreaSql }; $.ajax({ url : treeUrl, type : 'post', timeout : 60000, data : params, dataType : 'json', async: false, success : function(data){ $("#PLAN_REFINE_CATEGORY_214").data("data",data[0].constlist); $("#PLAN_REFINE_CATEGORY_214").render(); // mydata = data[0].constlist; }}); } //如果是总体预案,设置突发事件类型为不可用 function setSelectDisabled(){ var selectValue = $("#PLAN_TYPE_214").val(); if(selectValue=="102"){ // alert(1111); //如果是总体预案,设置突发事件类型为不可用 $("#BYSUNESS_TYPE_2141").attr("class",""); $("#BYSUNESS_TYPE_2141").attr("disabled",true); $("#BYSUNESS_TYPE_2141").render(); //总体预案包含的突发事件类型为所有 //PLAN_REFINE_CATEGORY1_214 $("#PLAN_REFINE_CATEGORY_214").attr("selectedValue","4,5,6,7,8,9,10,11,12,13,14,15,16,17,18"); $("#PLAN_REFINE_CATEGORY_214").render(); }else{ $("#BYSUNESS_TYPE_2141").attr("class","validate[required]"); $("#BYSUNESS_TYPE_2141").attr("disabled",false); $("#BYSUNESS_TYPE_2141").render(); //非总体预案设置包含的突发事件类型为自己手动选择 $("#PLAN_REFINE_CATEGORY_214").attr("selectedValue",""); $("#PLAN_REFINE_CATEGORY_214").render(); } //选择专项预案的时候包含的突发事件只能选择一个,包含的突发事件类型为必输项 if(selectValue=="103"){ //如果是专项预案,设置包含的突发事件类型只能选择一个 $("#PLAN_REFINE_CATEGORY_214").attr("multiMode","false"); $("#PLAN_REFINE_CATEGORY_214").render(); // $("#INS_UNITS_2141").attr("class","validate[required]"); // $("#INS_UNITS_2141").attr("disabled",false); // $("#INS_UNITS_2141").render(); }else{ $("#PLAN_REFINE_CATEGORY_214").attr("multiMode","true"); $("#PLAN_REFINE_CATEGORY_214").render(); } //如果是政府预案,预案编码、责任部门不需要填写,包含的突发事件不需要填写。 if(selectValue=="106"){ //责任部门 // $("#INS_UNITS_2141").attr("class",""); // $("#INS_UNITS_2141").attr("disabled",true); // $("#INS_UNITS_2141").render(); //包含的突发事件 $('#PLAN_REFINE_CATEGORY_214').attr("class","selectTree "); $("#PLAN_REFINE_CATEGORY_214").attr("disabled",true); $("#PLAN_REFINE_CATEGORY_214").render(); $("#PLAN_NO_214").attr("disabled",true); $("#PLAN_NO_214").reomveClass("validate[required]"); }else{ // $("#INS_UNITS_2141").attr("disabled",false); // $("#INS_UNITS_2141").attr("class","validate[required]"); // $("#INS_UNITS_2141").render(); $("#PLAN_REFINE_CATEGORY_214").attr("class","selectTree validate[required]"); $("#PLAN_REFINE_CATEGORY_214").render(); $("#PLAN_NO_214").attr("disabled",false); $("#PLAN_NO_214").addClass("class","validate[required]"); } } var changeValue = ""; //如果是总体预案,设置突发事件类型为不可用 function setSelectDisabled3(obj){ //如果时候总体预案,设置突发事件类型为不可用,包含的突发事件为所有 var selectValue = $(obj).val(); changeValue = selectValue; if(changeValue=="102"){ //如果是总体预案,设置突发事件类型为不可用 $("#BYSUNESS_TYPE_2141").attr("selectedValue","109"); $("#BYSUNESS_TYPE_2141").attr("class",""); $("#BYSUNESS_TYPE_2141").attr("disabled",true); $("#BYSUNESS_TYPE_2141").render(); //总体预案包含的突发事件类型为所有 $("#PLAN_REFINE_CATEGORY_214").attr("multiMode","true"); /***********************选择为总体预案时 IE8报错的问题 start---********************/ //$("#PLAN_REFINE_CATEGORY_214").attr("selectedValue","4,5,6,7,8,9,10,11,12,13,14,15,16,17,18"); /***********************选择为总体预案时 IE8报错的问题 end---********************/ //2016-05-27湛江局许永山说总体预案是综合类的。 //2016-08-16省公司张壮领说总体预案不是综合类的。不用添加综合类 $("#PLAN_REFINE_CATEGORY_214").attr("selectedValue","19"); $("#PLAN_REFINE_CATEGORY_214").attr("disabled",true); $("#PLAN_REFINE_CATEGORY_214").attr("class","selectTree "); $("#PLAN_REFINE_CATEGORY_214").attr("selectedValue",""); $("#PLAN_REFINE_CATEGORY_214").attr("multiMode","true"); $("#PLAN_REFINE_CATEGORY_214").render(); //预案编码为必输 $('#PLAN_NO_214').attr("disabled",false); $('#PLAN_NO_214').val(""); }else if(changeValue=="103"){ //突发事件类型可用、必输 $("#BYSUNESS_TYPE_2141").attr("disabled",false); $("#BYSUNESS_TYPE_2141").attr("class","validate[required]"); $("#BYSUNESS_TYPE_2141").attr("selectedValue",""); $("#BYSUNESS_TYPE_2141").render(); //包含的突发事件可用、必输 $("#PLAN_REFINE_CATEGORY_214").attr("disabled",false); $("#PLAN_REFINE_CATEGORY_214").attr("class","selectTree validate[required]"); $("#PLAN_REFINE_CATEGORY_214").attr("selectedValue",""); $("#PLAN_REFINE_CATEGORY_214").attr("multiMode","false"); $("#PLAN_REFINE_CATEGORY_214").render(); //归口部门 // $("#INS_UNITS_2141").attr("disabled",false); // $("#INS_UNITS_2141").attr("class","validate[required]"); // $("#INS_UNITS_2141").attr("selectedValue",""); // $("#INS_UNITS_2141").render(); //预案编码为必输 $('#PLAN_NO_214').attr("disabled",false); $('#PLAN_NO_214').val(""); }else if(changeValue=="104"||changeValue=="105"){//突发事件类型可用、必输 $("#BYSUNESS_TYPE_2141").attr("disabled",false); $("#BYSUNESS_TYPE_2141").attr("class","validate[required]"); $("#BYSUNESS_TYPE_2141").attr("selectedValue",""); $("#BYSUNESS_TYPE_2141").render(); //包含的突发事件可用、必输 $("#PLAN_REFINE_CATEGORY_214").attr("disabled",false); $("#PLAN_REFINE_CATEGORY_214").attr("class","selectTree validate[required]"); $("#PLAN_REFINE_CATEGORY_214").attr("selectedValue",""); $("#PLAN_REFINE_CATEGORY_214").attr("multiMode","true"); $("#PLAN_REFINE_CATEGORY_214").render(); //归口部门 // $("#INS_UNITS_2141").attr("disabled",false); // $("#INS_UNITS_2141").attr("class","validate[required]"); // $("#INS_UNITS_2141").attr("selectedValue",""); // $("#INS_UNITS_2141").render(); //预案编码为必输 $('#PLAN_NO_214').attr("disabled",false); $('#PLAN_NO_214').val(""); }else if(changeValue=="106"){ $("#BYSUNESS_TYPE_2141").attr("disabled",true); $("#BYSUNESS_TYPE_2141").attr("class",""); $("#BYSUNESS_TYPE_2141").attr("selectedValue",""); $("#BYSUNESS_TYPE_2141").render(); //包含的突发事件可用、必输 $("#PLAN_REFINE_CATEGORY_214").attr("disabled",false); $("#PLAN_REFINE_CATEGORY_214").attr("class","selectTree validate[required]"); $("#PLAN_REFINE_CATEGORY_214").attr("selectedValue",""); $("#PLAN_REFINE_CATEGORY_214").attr("multiMode","true"); $("#PLAN_REFINE_CATEGORY_214").render(); //归口部门 // $("#INS_UNITS_2141").attr("disabled",true); // $("#INS_UNITS_2141").attr("class",""); // $("#INS_UNITS_2141").attr("selectedValue",""); // $("#INS_UNITS_2141").render(); //预案编码为必输 $('#PLAN_NO_214').val(" "); $('#PLAN_NO_214').attr("disabled","disabled"); } } //包含的突发事件类型处理只能录入15个专项预案,如有重复的给出提示 function setSelectDisabled1(){ //是专项预案才往下走。 var planType = $('#PLAN_TYPE_214').val(); //取类型 var type = $('#PLAN_REFINE_CATEGORY_214').attr("relvalue"); var type1 = $('#PLAN_REFINE_CATEGORY_214').attr("relText"); if(planType=="103"){ //如果该单位下已经存在该类型的预案,不让往下填写表单。 getZhuanxValue(type,type1); } } //发送请求取回该类型预案的ID function getZhuanxValue(data,data1){ var url = $.pathname() + "/ws/sendmenu/SendMsgService/getZhuanxiangPlan"; var params = { parent_id : parent_id,//单位ID grade_type:data,//预案类型 }; $.ajax({ url : url, type : 'post', timeout : 12000, data : params, dataType : 'json', success : function(data) { if(JSON.stringify(data).length>11){ //获取该类型的预案ID var orgVlue = data.rows[0].FD_OBJECTID; //提示用户是否跳转到修改页面或者重新选择包含的突发事件类型 top.Dialog.alert("已经有:" + data1 + "的预案,请重新选择!"); $("#PLAN_REFINE_CATEGORY_214").resetValue(); /*top.Dialog.confirm("已经有该类型的预案存在,请重新选择包含的突发事件?|离开", function() { window.location.href="PlanEdit.jsp?"+orgVlue; });*/ } }, error : function(e) { $.messager.alert('系统提示信息', '访问服务失败!', 'error'); } }); } //取复选框勾选的值 var strRO=""; //取系统时间:年月日时分秒 var date = allGetServerTime(); var seperator1 = ""; var seperator2 = ""; var month = date.getMonth() + 1; var strDate = date.getDate(); if (month >= 1 && month <= 9) { month = "0" + month; } if (strDate >= 0 && strDate <= 9) { strDate = "0" + strDate; } var time = date.getFullYear() + seperator1 + month + seperator1 + strDate + "" + date.getHours() + seperator2 + date.getMinutes() + seperator2 + date.getSeconds(); //单位ID var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids(); var parent_id = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids(); var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+""; //登录人ID //取上传文件的名称 var file = ""; //新增 function add(containerId){ //取系统时间 var date = allGetServerTime(); var seperator1 = ""; var seperator2 = ""; var month = date.getMonth() + 1; var strDate = date.getDate(); if (month >= 1 && month <= 9) { month = "0" + month; } if (strDate >= 0 && strDate <= 9) { strDate = "0" + strDate; } var PLAN_EN_TIME_214 = date.getFullYear() + "-" + month +"-" + strDate; var plantype = $("#PLAN_TYPE_214").val();//预案类型 var ywfl = $("#BYSUNESS_TYPE_2141").val();//突发事件类型 var category = $("#PLAN_REFINE_CATEGORY_214").attr('relValue');//包含的突发事件 var unit = $("#INS_UNITS_2141").val();//责任部门 var name = $("#PLAN_NAME_214").val();//预案名称 var plannmo = $("#PLAN_NO_214").val();//预案编码 var takeDate = $("#TAKE_DATE_214").val();//颁布日期 var makeDate = $("#ISSUE_DATE_214").val();//实施日期 var valid = $(containerId).validationEngine({returnIsValid: true}); if(valid == true){ //时间判断 if(makeDate!=""&&makeDate!=null&&makeDate!=undefined){ if(makeDate