123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889 |
- /**
- * 功能:应急xiangying报告添加及修改
- *
- *
- * @author HXB
- * @date 2015/09/22
- */
- WarningAddEditAdjust = function() {
- /**定义变量**/
- var _this = this;
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- var is_skip = 0;//判断是否跳转发送(1)或发布(2)页面
- var nowTime = "";
- var radioValue1 = "";//选择纸质签发
- var radioValue2 = "";//选择口头授权
-
- _this.DateTime = function(){
- $.ajax({//后台获取系统当前时间
- url:$.pathname()+ '/ws/response/responseService/getNowTime',
- // data : {},
- type : 'post',
- dataType : 'text',
- async : false,
- timeout : 6000,
- success : function(result){
- nowTime=result;
- },error : function(e){
- top.Dialog.alert("获取后台时间失败!");
- return;
- }
- });
- };
-
- /***新增信息***/
- _this.save = function(){
- _this.DateTime();
- $form = $('#editForm');
- var url = $.pathname() +"/ws/uploadForm/FileUpDownService/asyncFileUpLoad";
- if(is_adjst == 1){//调整
- var is_Plan = 0; //是否触发计划填报
- //$("#RELEASE_UNIT_365").val('');
- $("#IS_SEND_365").val(0); //未发送状态
-
- //数据ID情况
- $("#FD_OBJECTID365").val('');
- $("#classid").val(365);
- //$("#WRITER_365").val($("#CHECKCK").val()); //填报人
- //$("#WRITE_DEPT_365").val($("#unitId").attr("relValue"));
- $("#EARLY_WARNING_PROPERTY_365").val(50); //响应性质
- $("#WETHER_EW_ADJUST_365").val(1);
- $("#WRITE_TIME_365").val(nowTime); //填报时间
- $("#CHECK_STATUS_365").val(42); //调整发布
- $("#IS_LAST_ID_365").val(fd_id); //上次响应编号
- $("#PREV_ER_LEVEL_365").val($("#PREV_ER_LEVEL").attr("relValue"));
- if(!(fd_id.length>0 && is_adjst == 1)){
- $("#EARLY_WARNING_AREA_ID_365").val($("#EARLY_WARNING_AREA_NAME_365").val());//预警范围ID
- }
- $("#EARLY_WARNING_AREA_NAME_365").val($("#EARLY_WARNING_AREA_NAME_365_show").val());//预警范围NAME
- //$("#RELEASE_UNIT_365").val($("#unitId").attr("relValue"));//发布单位
- is_skip = 0;
- fileToSave($form,null,null,url);
- }else{
- top.Dialog.alert(CHECKREDBOX);
- };
- };
- function fileToSave($form,listGrid,msg,url){
- // var flag = 1;//是否发布接口的开关
-
- var earlyWarningAreaId = $("#EARLY_WARNING_AREA_ID_365").val();
- var lastLevel = $("#PREV_ER_LEVEL_365").val();
- var currentLevel = $("#CURRENT_ER_LEVEL_365").val();
- $("body").eq(0).showLoading();
- //表单异步提交处理
- var formValue = $form.serialize();
- if(is_skip==1){//发送
- send(url,formValue);
- }else{
- $.request.add(url,formValue,function(data){
- $("body").eq(0).hideLoading();
- if(is_skip == 2){//发布
- //top.Dialog.alert('发布成功!');//弹出提示
- $.ajax({//发布通知单时,右下角弹框提示发布单位的下级和本级的应急办成员
- url : $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/tzdIssueDwr/',
- data : { fd_id : data.Msg.objectID },//参数为发布的通知单的ID
- type : 'post',
- timeout : 15000,
- dataType : 'text',
- async : false,
- success : function(data) {
-
- },error : function(e) {
- top.Dialog.alert("系统错误!");
- }
- });
-
-
-
- $.ajax({//发布以后,用推送的方式,调用首页的方法,更新首页导航下方滚动的预警通知单信息(不需要传参数)
- url : $.pathname() + '/ws/alertToImpl/AlertToImplService/updadeWarningMsgOfMainPage/',
- type : 'post',
- timeout : 15000,
- //data : params,
- dataType : 'text',
- success : function(data) {
-
- },error : function(e) {
- //$.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
-
- // if(flag == 1){ //暂时接口走不通20160705,所以暂时关掉
- var params = {
- classid : "365",
- FD_OBJECTID365 :data.Msg.objectID,
- RELIEVE_DATE_365:getDateTime(),
- IS_SEND_365 : "6",
- PLAN_NAME : "",
- EARLY_WARNING_AREA_ID : earlyWarningAreaId,
- LAST_LEVEL : lastLevel,
- CURRENT_LEVEL : currentLevel
- };
-
- $.ajax({//接口
- url : $.pathname() + '/ws/alertToImpl/AlertToImplService/responseSend/',
- type : 'post',
- timeout : 15000,
- data : params,
- dataType : 'json',
- success : function(result) {
- // saveAddNum(data.Msg.objectID);
- },error : function(e) {
- // $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- saveAddNum1(data.Msg.objectID);
- // }else{
- // saveAddNum(data.Msg.objectID);
- // };
- }else{
- top.Dialog.alert('保存成功!');//弹出提示
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/emergencyResponse/Warning.jsp");
- }
- });
- }
- }
- function send(url,formValue){
- var diag = new top.Dialog();
- diag.Title = '组织人员';
- //diag.URL = $.pathname() + '/page/business/em/alert/warning/WarningaddUnitSend.jsp?fd_id='+fd_id; //修改对应的路径的编辑界面
- diag.URL = $.pathname() + '/page/business/em/alert/warning/WarningaddUnitTest.jsp?fd_id=' + fd_id + '&isSend=1';
- diag.OkButtonText = '发送';
- diag.OKEvent = function(){
- $.request.add(url,formValue,function(data){
- $("body").eq(0).hideLoading();
- var fd_id = data.Msg.objectID;
- _this.sendSave(diag,fd_id);
- });
- };
- diag.CancelEvent = function(){
- $("body").eq(0).hideLoading();
- diag.close();
- };
- diag.Width = 500; //宽度
- // diag.Height = 150; //高度
- diag.ButtonAlign = 'center';//发送和取消按钮的位置
- diag.show();
- }
- /**新增方法**/
- _this.sendSave = function(diag,fd_id){
- $("body").eq(0).showLoading();//遮罩
- _this.DateTime();
- var a = diag.innerFrame.contentWindow.$("#temp input[name='PERSON_ID_378']:checked").val();//弹框页面的下一节点人的id
- var c = diag.innerFrame.contentWindow.$("#temp input[name='PERSON_ID_378']:checked").next().html();//弹框页面的下一节点人的NAME
- var d = diag.innerFrame.contentWindow.$("#temp input[name='PERSON_ID_378']:checked").next().next().val();//弹框页面的下一节点人的电话
- var e = diag.innerFrame.contentWindow.$("#msgRemind").attr("checked");//短信是否被勾选
- var f = diag.innerFrame.contentWindow.$("#appRemind").attr("checked");//app是否被勾选
- var g = '您有新的通知单任务,请及时处理!';//短信内容
- var h = nowTime;//系统时间
-
- if(a==undefined || a=='' || a==null){
- top.Dialog.alert("请选择人员!");
- return;
- }
-
- if(e=='checked'){//短信被勾选
- //alert("短信提醒");
- if(a == undefined){
- top.Dialog.alert("请选择短信接收人!");
- return;
- }
- var url0 = $.pathname() + '/ws/sendsms/SendSmsService/saveMessage';
- var params = {
- realName : realName,//发送人真实姓名
- smsRecTel : d,//接收电话
- smsTime : h,//系统时间
- smsContent : g,//短信内容
- smsSendId : realName_ID,//发送人Id
- smsPeople : a,//接收人员id
- type:"短信发送"
- };
- //alert("realName="+realName+"电话:"+d+"系统时间:"+h+"短信内容:"+g+"发送人ID:"+realName_ID+"接收人ID:"+a);
- //return;
- $.ajax({
- type : 'post',
- url : url0,
- data : params,
- async:false,
- dataType : 'json',
- success : function (data){
- //alert(JSON.stringify(data));
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
- if(f=='checked'){
- top.Dialog.alert('应急app提醒!');
- }
-
- $.ajax({////修改通知单表的IS_SEEN字段为【下一处理人ID,0 ,处理人ID】
- url : $.pathname() + '/ws/sendsms/SendSmsService/updateIs_Seen',
- data : { tableName : "ECM_EM_PUBLISH_ALERT_NOTICE" , //表名
- fdId : fd_id , //id
- nextPeopId : a , //下一处理人ID
- userId : realName_ID//处理人ID
- },
- type : 'post',
- dataType : 'json',
- async:false,
- success : function (data){
-
- },error : function(e){
- top.Dialog.alert("系统提示信息!");
- }
- });
-
- var params = {classid :"365",FD_OBJECTID365:fd_id,IS_SEND_365 :"1"};
- var params1 = {
- classid:"378",
- PERSON_ID_378:a,
- PERSON_NAME_378:c,
- BUSINESS_ID_378:fd_id,
- STATUES_378:"1",
- DISPOSE_378:"0"
- };
- $.ajax({
- url : $.pathname() + '/ws/crud/CRUDService/updateWarning/',
- type : 'post',
- timeout : 15000,
- data : params,
- dataType : 'json',
- success : function(data) {
- var url = $.pathname() + '/ws/crud/CRUDService/create/';
- $.request.add(url,params1,function(data){
- diag.innerFrame.contentWindow.top.Dialog.close();//关闭弹框
- top.Dialog.alert('发送成功!');
-
-
-
- /** 代办右上角红色圈里面数字的改变 **/
- var url = $.pathname() + '/ws/xianlutingyun/XianlutingyunService/WarningTask';
- // var compId = top.com.sinosoft.lz.system.user.LoginInfo.getCompany_id();
- var user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- // var roleid = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();
- var paramsWaitdo = {
- // userId : user_id,//
- netx_id : a//,//
- // isRole : ,//
- // company_id : compId,//
- // role_id : roleid//
- };
- $.ajax({//代办处理
- url : url,
- data : paramsWaitdo,
- type : 'post',
- dataType : 'text',
- timeout : 15000,
- // async : false,
- success : function(data){
- // top.Dialog.alert('发送成功!', null, null, null, -1);
- // top.Dialog.alert('成功!');
- },error : function (e){
- // top.Dialog.alert('系统错误!');
- }
- });
-
-
- // 跳转到列表页
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/emergencyResponse/Warning.jsp");
- });
- },
- error : function(e) {
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
-
- };
- //页面发送按钮gel
- _this.is_Send = function(){
- _this.DateTime();
- if($("#WETHER_EW_ADJUST").attr("checked")=="checked"){//勾选调整
- $("#EARLY_WARNING_PROPERTY_365").val(50);
- $("#CHECK_STATUS_365").val(42);
- $("#WETHER_EW_ADJUST_365").val(1);
- }else if($("#WARNING_PROPERTY").attr("checked")=="checked"){//勾选初次
- $("#EARLY_WARNING_PROPERTY_365").val(49);
- $("#CHECK_STATUS_365").val(41);
- $("#WETHER_EW_ADJUST_365").val(0);
- };
- $("#classid").val("365");
- //$("#RELEASE_UNIT_365").val($("#unitId").attr("relValue"));//发布单位
- if(!(fd_id.length>0 && is_adjst == 1)){
- $("#EARLY_WARNING_AREA_ID_365").val($("#EARLY_WARNING_AREA_NAME_365").val());//预警范围ID
- }
- $("#EARLY_WARNING_AREA_NAME_365").val($("#EARLY_WARNING_AREA_NAME_365_show").val());//预警范围NAME
- //$("#RELEASE_UNIT_365").val($("#WRITE_DEPT_365").attr("relValue"));//发布单位
- is_skip = 1;
- $form = $('#editForm');
- //附件
- //var file = $("#uploaderFileName").val();
- var url = $.pathname() +"/ws/uploadForm/FileUpDownService/asyncFileUpLoad";
- $("#WRITE_TIME_365").val(nowTime); //填报时间
- fileToSave($form,null,null,url);
- };
- //页面发布按钮
- _this.is_Issue = function(){
- _this.DateTime();
- if($("#WETHER_EW_ADJUST").attr("checked")=="checked"){//勾选调整
- $("#EARLY_WARNING_PROPERTY_365").val(50);
- $("#CHECK_STATUS_365").val(42);
- $("#WETHER_EW_ADJUST_365").val(1);
- }else if($("#WARNING_PROPERTY").attr("checked")=="checked"){//勾选初次
- $("#EARLY_WARNING_PROPERTY_365").val(49);
- $("#CHECK_STATUS_365").val(41);
- $("#WETHER_EW_ADJUST_365").val(0);
- };
- $("#classid").val("365");
- if(!(fd_id.length>0 && is_adjst == 1)){
- $("#EARLY_WARNING_AREA_ID_365").val($("#EARLY_WARNING_AREA_NAME_365").val());//预警范围ID
- }
- $("#EARLY_WARNING_AREA_NAME_365").val($("#EARLY_WARNING_AREA_NAME_365_show").val());//预警范围NAME
- //$("#RELEASE_UNIT_365").val($("#unitId").attr("relValue"));//发布单位
- is_skip = 2;
- $form = $('#editForm');
- //附件
- //var file = $("#uploaderFileName").val();
- var url = $.pathname() +"/ws/uploadForm/FileUpDownService/asyncFileUpLoad";
- $("#WRITE_TIME_365").val(nowTime); //填报时间
- var fbTime = $("#RELEASE_RELIEVE_DATE_365").val();//发布时间
- if(fbTime == null || fbTime == ""){
- top.Dialog.alert("发布时间不能为空!请填写完整!");
- return;
- };
- //if(!hasFile()){//附件不能为空!请选择并上传附件
- if(false){
- top.Dialog.alert("附件不能为空!请选择并上传附件");
- return;
- }else{
- //top.Dialog.confirm("是否要创建新的填报计划?|报表",function(){
- $("body").eq(0).showLoading();//遮罩
- var lastID = $("#IS_LAST_ID_365").val();
- if(lastID != null && lastID != ""){
- var params = {
- classid : "365",
- FD_OBJECTID365 :lastID,
- RELIEVE_DATE_365:getDateTime(),
- IS_SEND_365 : "6"
- };
-
- $.ajax({
- url : $.pathname() + '/ws/crud/CRUDService/updateWarning/',
- type : 'post',
- timeout : 15000,
- data : params,
- dataType : 'json',
- success : function(data) {
- //alert(data.EARLY_WARNING_AREA_NAME);
- },error : function(e) {
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
-
- }
- $("#IS_SEND_365").val(5);
- //top.Dialog.confirm("是否要创建新的填报计划?|报表",function(){
- var prepareId = $("#yjbh").attr("relValue"); //突发事件类型id
- var alertNum = $("#EARLY_WARNING_ID_365").val(); //响应编号
- var alertNum1 = $("#PREV_EW_ID_365").val(); //上次响应编号
- var relieveDate = $("#RELEASE_RELIEVE_DATE_365").val(); //发布时间
- var alertLevel = $("#CURRENT_ER_LEVEL_365").attr("relValue"); //发布时间
-
- //createPlan(prepareId,alertNum,relieveDate,alertLevel);
- finishPlan(alertNum1,CorpArea);
- createPlan(prepareId,alertNum,relieveDate,alertLevel);
- fileToSave($form,null,null,url);
- /*},function(){
- fileToSave($form,null,null,url);
- });*/
- }
-
- //fileToSave($form,null,null,url);
- };
-
- function chooseLeader(){//选择口头授权的领导人(默认为本级(本单位)应急总指挥/副总指挥/主任/副主任)
- var diag = new top.Dialog();
- diag.Title = '口头授权领导';
- diag.id = "ok111";
- //diag.URL = $.pathname() + '/page/business/em/alert/warning/WarningaddUnitTest.jsp';
- diag.URL = $.pathname() + '/page/business/em/alert/warning/WarningAgreeIssueLeader.jsp';
- diag.OkButtonText = '确定';
- diag.OKEvent = function(){
- var a = diag.innerFrame.contentWindow.$("input[name='PERSON_ID_378']:checked").val();//选择的同意发布的领导的ID
- var b = diag.innerFrame.contentWindow.$("input[name='PERSON_ID_378']:checked").next().text();//选择的同意发布的领导的NAME
- var c = diag.innerFrame.contentWindow.$("input[id='radio_1']:checked").attr("checked");//选择纸质签发
- var d = diag.innerFrame.contentWindow.$("input[id='radio_2']:checked").attr("checked");//选择口头授权
- radioValue1 = c;//纸质签发是否被选
- radioValue2 = d;//口头授权是否被选
- $("#AGREE_ISSUE_LEADER_ID_365").val(a);
- $("#AGREE_ISSUE_LEADER_NAME_365").val(b);
-
- if(radioValue1 == "checked"){//选择纸质签发
- if(!hasFile()){//无附件
- top.Dialog.confirm("纸质签发必须上传附件!</br>请上传附件|响应",function(){//点击确定--回到通知单填报页面
- diag.close();
- },function(){//点击取消--回到弹框选择口头授权的页面
-
- });
- }else if(a==undefined){//有附件但是没有选择口头授权人
- top.Dialog.confirm("请选择签发人!|响应",function(){//点击确定--回到通知单填报页面
-
- },function(){//点击取消--回到弹框选择口头授权的页面
- diag.close();
- });
- }else{
- _this.is_Issue();
- diag.close();
- }
- }else if(radioValue2 == "checked"){//选择口头授权
- if(a==undefined){//没有选择签发人
- top.Dialog.confirm("请选择签发人!|响应",function(){//点击确定--回到弹框选择口头授权的页面
- return;
- },function(){//点击取消--回到通知单填报页面
- diag.close();
- return;
- });
- }else{
- _this.is_Issue();
- diag.close();
- }
- }
-
- //_this.is_Issue();
- //diag.close();
- };
- /*diag.CancelEvent = function(){
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/alert/warning/Warning.jsp");
- diag.close();
- };*/
- diag.Width = 500; //宽度
- //diag.Height = 150; //高度
- diag.ButtonAlign = 'center';//发送和取消按钮的位置
- diag.show();
- }
-
-
- function saveAddNum1(fd_id){
- var $form1 = $('#alertResponseNumForm');
- var formValue = $form1.serialize();
- var url = $.pathname() + '/ws/crud/CRUDService/create/';
- $.ajax({
- url : url,
- type : 'post',
- timeout : 15000,
- data : formValue,
- async: false,
- dataType : 'json',
- success : function(data) {
- top.Dialog.alert('发布成功!');//弹出提示
- top.createActiveTab("任务清单",$.pathname()+ "/page/business/em/response/emergencyResponse/WarningReleaseMatter.jsp?fd_id="+ fd_id+"&isActivePage=true");
- }
- });
- };
-
- function saveAddNum(fd_id){
- var CorpArea = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- /*top.Dialog.confirm("是否要创建新的填报计划?|响应",function(){
- var prepareId = $("#MEET_EMERGENCIES_PLAN_365").attr("relValue"); //预案ID
- var alertNum = $("#EARLY_WARNING_ID_365").val(); //预警编号
- var relieveDate = $("#RELEASE_RELIEVE_DATE_365").val(); //发布时间
- var alertLevel = $("#CURRENT_ER_LEVEL_365").attr("relValue"); //预警级别
- var typhoonDate = $("#TYPHOON_DATE_365").val();
- createPlan(prepareId,alertNum,relieveDate,alertLevel,typhoonDate);
-
- var preAlertNum = $("#PREV_EW_ID_365").val(); //上次预警编号
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids(); //部门ID
- finishPlan(preAlertNum,CorpArea);
- // top.Dialog.alert('保存成功!');//弹出提示
- var $form1 = $('#alertResponseNumForm');
- var formValue = $form1.serialize();
- var url = $.pathname() + '/ws/crud/CRUDService/create/';
- $.request.add(url,formValue,function(data){
- top.Dialog.alert('发布成功!');//弹出提示
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/WarningReleaseMatter.jsp?fd_id="+ fd_id);
- });
- },function(){*/
- var alertNum = $("#EARLY_WARNING_ID_365").val(); //预警编号
- var preAlertNum = $("#PREV_EW_ID_365").val(); //上次预警编号
- top.Dialog.alert('发布成功!');//弹出提示
- var $form1 = $('#alertResponseNumForm');
- var alertLevel = $("#CURRENT_ER_LEVEL_365").attr("relvalue");
- var alertName = $("#EARLY_WARNING_NAME_365").val();//预警名称
- var areaId = $("#EARLY_WARNING_AREA_ID_365").val();//预警范围部门id
- var areaName = $("#EARLY_WARNING_AREA_NAME_365").val();//预警范围部门id
- var formValue = $form1.serialize();
- var url = $.pathname() + '/ws/crud/CRUDService/create/';
- $.request.add(url,formValue,function(data){
- updatePlan(preAlertNum,alertNum,CorpArea,meet_plan_id,taifengTime,alertLevel,fd_id,alertName,areaId,areaName);
- });
- // });
- // var $form1 = $('#alertResponseNumForm');
- // var formValue = $form1.serialize();
- // var url = $.pathname() + '/ws/crud/CRUDService/create/';
- // $.request.add(url,formValue,function(data){
- // $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/WarningReleaseMatter.jsp?fd_id="+ fd_id);
- // });
- };
-
- /**
- * 结束报表填报计划
- */
- function finishPlan(alertNum,companyId){
- var params = {WARNING_NUMBER:alertNum,COMP_ID:companyId,IS_ALERT:"1"};
- $.ajax({
- url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/releasePlan',
- type : 'post',
- timeout : 15000,
- async : false,
- data : params,
- dataType : 'text',
- success : function(data) {
- }
- });
- }
- /**
- * 替换计划
- */
- function updatePlan(oldAlert,newAlert,companyId,meet_plan_id,typhoon,alertLevel,fd_id,alertName,areaId,areaName){
- //alert(oldAlert+"--"+newAlert+"--"+companyId)
- if(meet_plan_id == "" || (meet_plan_id.split(",").length==2 && meet_plan_id.split(",")[0].substring(0,4)=="plan")){
- //$('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/WarningReleaseMatter.jsp?fd_id="+ fd_id);
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/Warning.jsp?fd_id="+ fd_id);//任务清单页面
- return;
- }
- var planTime = getPlanTime(meet_plan_id,typhoon,alertLevel);
- console.log(alertLevel+"-----"+planTime);
- var circleTime = planTime.split("_______")[0];
- var temporaryTime = planTime.split("_______")[1];
- var params = {OLD_WARN:oldAlert,NEW_WARN:newAlert,COMP_ID:companyId,'isAlert':'1',"temporaryTime":temporaryTime,"circleTime":circleTime,alertName:alertName,areaId:areaId,areaName:areaName,alertLevel:alertLevel};
- $.ajax({
- url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/updatePlan',
- type : 'post',
- timeout : 15000,
- data : params,
- async: false,
- dataType : 'text',
- success : function(data) {
- //$('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/WarningReleaseMatter.jsp?fd_id="+ fd_id);
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/Warning.jsp?fd_id="+ fd_id);//任务清单页面
- }
- });
- }
- /**
- * 通过预案数据获取周期性和临时性时间
- * @param meet_plan_id
- * @param typhoon
- * @returns {String}
- */
- function getPlanTime(meet_plan_id,typhoon,alertLevel){
- var alertDate = ""; //周期时间
- var temporaryTime = ""; //临时时间
- $.ajax({
- url : $.pathname() + '/ws/sendmenu/SendMsgService/PlanInfoEM',
- type : 'post',
- timeout : 15000,
- data : {file_id:meet_plan_id,grade_type:'%6_2'},
- dataType : 'json',
- async: false,
- success : function(data) {
- var status = data[0].PLAN_REFINE_CATEGORY;
- //如果状态等于14代表突发性群体事件 ,16涉外突发事件,17网络与信息安全无报表填报要求
- if(status == 14 || status == 16 || status == 17){
- return;
- }
- if(data != null && data != ""){
- var tempRow = data;
-
- if(alertLevel == 29){
- alertDate = tempRow[0].FRIST_GRADE;
- }else if(alertLevel == 30){
- alertDate = tempRow[0].SECOND_GRADE;
- }else if(alertLevel == 31){
- alertDate = tempRow[0].THRID_GRADE;
- }else if(alertLevel == 32){
- alertDate = tempRow[0].FOURTH_GRADE;
- }
- if(alertDate.indexOf("||")>-1){
- alertDate = alertDate.split('||');
- temporary = alertDate[0];
- alertDate = alertDate[1];
- }
- if(typhoon != null && typhoon != ''){
- temporaryTime = getFormatString(typhoon,temporary);
- }
- //5为大面积停电事件每隔1、2、3小时填写一次
- if(status ==5){
- var mTime = getSysTimeM();
- var num = parseInt(alertDate);
- alertDate = "";
- for (var i = 0; i < 24;) {
- var nu = (i<10 ? "0"+ i : i);
- alertDate += "#"+nu+":"+mTime;
- i += num;
- }
- }
- if(alertDate.indexOf("#")==0){
- //if(alertDate.startsWith("#")){
- alertDate = alertDate.substring(1);
- }
- }
- }
- });
- return alertDate+"_______"+temporaryTime;
- }
- /**
- * 创建报表填报计划
- */
- function createPlan(prepareId,alertNum,relieveDate,alertLevel){
- var CorpArea = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- $.ajax({
- url : $.pathname() + '/ws/sendmenu/SendMsgService/getReportAndPlanTime',
- type : 'post',
- data : {"event_type_id":prepareId,"event_level":alertLevel,"comp_id":CorpArea},
- dataType : 'text',
- async:false,
- success : function(data) {
-
- if(data != null && data != ""){
-
- var istemporary = "周期性";
- var alertDate = data; //周期时间
- var temporaryTime = ""; //临时时间
- var CorpArea = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- var Corp_names = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
- var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();//用户id
- var role_ids = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();//角色id
- var real_name = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name;//用户名?还是角色名?这里需要用户名
- var alertName = $("#EARLY_WARNING_NAME_365").val();//预警名称
- var areaId = $("#EARLY_WARNING_AREA_ID_365").val();//预警范围部门id
- var areaName = $("#EARLY_WARNING_AREA_NAME_365").val();//预警范围部门名称
- var EVENT_ID_365 = $("#EVENT_ID_365").val();//事件id
- var MEET_EMERGENCIES_PLAN_365 = $("#MEET_EMERGENCIES_PLAN_365").val();//事件类型id
- var isAlert = $("#IS_ALERT_365").val();//预警还是响应
- var parmas = {
- WARNING_NUMBER : alertNum,
- START_TIME : nowTime.substring(0, nowTime
- .lastIndexOf(":")),
- FILL_IN_SCHEDULE : istemporary,
- REPORT_DEPT : "",
- DEPT_ID : CorpArea,
- ROUND_TIME : alertDate,
- TEMPORARY_TIME : temporaryTime,
- USER_ID : userId,
- ROLE_ID : role_ids,
- deptName : Corp_names,
- real_name : real_name,
- alertName : alertName,
- areaId : areaId,
- areaName : areaName,
- isAlert : isAlert,
- alertLevel : alertLevel,
- eventType:MEET_EMERGENCIES_PLAN_365,
- eventId:EVENT_ID_365
-
- };
- //$.request.add("nwyj/ws/getPlanRequires/getPlanRequireService/createPlanByAlert",parmas,function(data){});
- $.ajax({
- url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/createPlanByAlert',
- type : 'post',
- timeout : 15000,
- data : parmas,
- async : false,
- dataType : 'json',
- success : function(data) {
- //top.Dialog.alert('创建报表计划成功!');
- //$('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/alert/warning/Warning.jsp");
- }
- });
- }else{
- top.Dialog.alert('预案没有绑定需填报的报表或时间,无法生成报告和报表!');
- }
- },
- error : function(e) {
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
-
- }
- // 传递过来的参数( 日期类型 date , 字符串 str 格式 "-20:00#-20:30#+21:00#+21:30#+22:00#" )
- function getFormatString(timed,str){
- var s='';
- timed=timed.replace(/-/g,"/"); // 如果传递过来的是日期字符串timed,可以在这里转成日期类型
- var date=new Date(timed);
- str = str.replace(/##/g,"#");
- if(str.indexOf("#")==0){
- str = str.substring(1,str.length);
- }
- if(str.lastIndexOf("#")==str.length-1){
- str = str.substring(0,str.length-1);
- }
- var array=str.split(/[:#]/);
- //var array=str.split("#");
- var hourArray=new Array([array.length/2]);
- var operArray=new Array([array.length/2]);
- var j=0;
- // for(var i=0 ;i<array.length/2;i++){
- // operArray[i]=array[j].slice(0,1);
- // hourArray[i]=array[j].slice(1);
- // j+=2;
- // }
- for(var i=0 ;i<array.length/2;i++){
- operArray[i]=array[i*2+1];
- hourArray[i]=array[i*2];
- //j+=2;
- }
- var ms=date.getTime();
- //j=1;
- for(var i=0 ;i<array.length/2;i++){
- var ms1=ms+(hourArray[i]*60*60*1000+operArray[i]*60*1000);
- s+=getDateString(ms1)+'#';
- //j+=2;
- }
- s = timeStrSort(s,"esc","#","yyyy-MM-dd HH:mm");
- console.log(s);
- return s;
- }
- function getDateString(ms){
- var s="";
- var d=allGetServerTime();
- d.setTime(ms);
- var vYear = d.getFullYear();
- var vMon = d.getMonth() + 1;
- var vDay = d.getDate();
- var h = d.getHours();
- var m = d.getMinutes();
- var se = d.getSeconds();
- s=vYear+"-"+(vMon<10 ? "0" + vMon : vMon)+"-"+(vDay<10 ? "0"+ vDay : vDay)+" "+(h<10 ? "0"+ h : h)+":"+(m<10 ? "0" + m : m)+":"+(se<10 ? "0" + se : se);
- return s;
- }
- return {
- init : function() {
- $('#save').bind('click',function(){
- var benci = $("#CURRENT_ER_LEVEL_365").val();//本次预警级别
- var shangci = $("#PREV_ER_LEVEL").val();//上次预警级别
- if(benci == shangci){
- top.Dialog.alert("尚未调整响应级别!");
- return;
- }
-
- $form = $('#editForm');
- var valid = $form.validationEngine({returnIsValid: true});//表单验证
- if($("#EARLY_WARNING_AREA_NAME_365").val()==""){
- top.Dialog.alert("请选择预警范围(响应范围)!");
- return ;
- }
-
- if(!valid){
- top.Dialog.alert("请检查标红输入框!");
- return ;
- }
-
- fabuTime_new = $("#RELEASE_RELIEVE_DATE_365").val();
- if(fabuTime_old > fabuTime_new){//guoenle--161012
- top.Dialog.alert("调整后的发布时间不能早于调整前");
- return;
- }
-
- top.Dialog.confirm("是否要保存?|响应",function(){//点击确定
- _this.save();
- },function(){//点击取消
- //alert("bbbbbb");
- });
- });
- $('#back').bind('click',function(){
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/emergencyResponse/Warning.jsp");
- });
- $("#is_Send").bind('click',function(){
- var benci = $("#CURRENT_ER_LEVEL_365").val();//本次预警级别
- var shangci = $("#PREV_ER_LEVEL").val();//上次预警级别
- if(benci == shangci){
- top.Dialog.alert("尚未调整响应级别!");
- return;
- }
-
- $form = $('#editForm');
- var valid = $form.validationEngine({returnIsValid: true});//表单验证
-
- if($("#EARLY_WARNING_AREA_NAME_365").val()==""){
- top.Dialog.alert("请选择预警范围(响应范围)!");
- return ;
- }
- if(!valid){
- top.Dialog.alert("请检查标红输入框!");
- return ;
- }
-
- fabuTime_new = $("#RELEASE_RELIEVE_DATE_365").val();
- if(fabuTime_old > fabuTime_new){//guoenle--161012
- top.Dialog.alert("调整后的发布时间不能早于调整前");
- return;
- }
-
- top.Dialog.confirm("是否要发送?|响应",function(){//点击确定
- _this.is_Send();
- },function(){//点击取消
- //alert("bbbbbb");
- });
- });
- $("#is_Issue").bind('click',function(){
- var benci = $("#CURRENT_ER_LEVEL_365").val();//本次预警级别
- var shangci = $("#PREV_ER_LEVEL").val();//上次预警级别
- if(benci == shangci){
- top.Dialog.alert("尚未调整响应级别!");
- return;
- }
-
- $form = $('#editForm');
- var valid = $form.validationEngine({returnIsValid: true});//表单验证
-
- if($("#EARLY_WARNING_AREA_NAME_365").val()==""){
- top.Dialog.alert("请选择预警范围(响应范围)!");
- return ;
- }
- if(!valid){
- top.Dialog.alert("请检查标红输入框!");
- return ;
- }
-
- fabuTime_new = $("#RELEASE_RELIEVE_DATE_365").val();
- if(fabuTime_old > fabuTime_new){//guoenle--161012
- top.Dialog.alert("调整后的发布时间不能早于调整前");
- return;
- }
-
- //top.Dialog.confirm("是否要发布?|响应",function(){//点击确定
- chooseLeader();
- //_this.is_Issue();
- /*},function(){//点击取消
- //alert("bbbbbb");
- });*/
- });
- }
- };
- }();
- $(function() {
- WarningAddEditAdjust.init();
- });
- //获得当前系统时间:分
- function getSysTimeM(){
- var s="";
- var d = allGetServerTime();
- var vYear = d.getFullYear();
- var vMon = d.getMonth() + 1;
- var vDay = d.getDate();
- var h = d.getHours();
- var m = d.getMinutes();
- var se = d.getSeconds();
- //s=vYear+"-"+(vMon<10 ? "0" + vMon : vMon)+"-"+(vDay<10 ? "0"+ vDay : vDay)+" "+(h<10 ? "0"+ h : h)+":"+(m<10 ? "0" + m : m)+":"+(se<10 ? "0" +se : se);
- s= (m<10 ? "0" + m : m);
- return s;
- }
|