123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967 |
- /**
- * 按钮
- * @author 郭恩乐
- * 2016-11-03
- */
- var user_ID = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();//用户ID
- var role_ID = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();//用户多角色时,用逗号隔开
- var CorpArea = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- var personId = "";//处理人ID
- function buttonFun(){//按钮的显示情况
- getPersonMsg();
- //personId = isSeenBut.split(",")[0];//如果这样代码可以用,那么getPersonMsg()就可以不用
-
- //isSend : 1-待审核;3-待签发;4-待分发
- //根据状态判断该显示那些按钮
- //再根据登录人id是不是等于处理人id判断【根据状态判断该显示那些按钮】是否隐藏
-
- if(isSend == 0 && user_ID == writerIdBut){
- $("#sendBut").show();//【发送】
- $("#sendBut").after(" ");
- }
-
- if(isSeenBut.split(",")[1] == 0 && isSeenBut.split(",")[2] == user_ID && isSend != 0){
- $("#rollBackBut").show();//【撤回】
- $("#rollBackBut").after(" ");
- }
-
- if(personId == user_ID){
- if(isSend == 1){
- if(currentLevel == 29 || currentLevel == 30){//红橙色、一二级
- $("#checkBut").show();//【审核】
- $("#checkBut").after(" ");
- }else if(currentLevel == 31 || currentLevel == 32){//黄蓝色、三四级
- $("#checkSignBut").show();//【审核并签发】
- $("#checkSignBut").after(" ");
- }
- }else if(isSend == 3){
- $("#signBut").show();//【签发】
- $("#signBut").after(" ");
- }else if(isSend == 4){
- $("#issueBut").show();//【发布】
- $("#issueBut").after(" ");
- }
- }
- }
- function rollBackButFun(){//撤回
- var isSeenMsg = isSeenBut;
- var isSeen_0 = isSeenMsg.split(",")[0];//下一节点处理人ID
- var isSeen_1 = isSeenMsg.split(",")[1];//下一节点处理人是(1)否(0)查看
- var isSeen_2 = isSeenMsg.split(",")[2];//处理人ID
- var stateNow = isSend;//通知单当前状态
- var stateNext = 0;//通知单撤回后的状态(0-待发送 1-待审核 2-撤回 3-待签发 4-待分发 5-已发布 6-结束)
-
- if(isSeen_1 == 1){
- top.Dialog.alert("下一节点处理人已经查看,不能撤回了!");
- return;
- }else if(isSeen_1 == 0){
- if(user_ID !=isSeen_2){
- top.Dialog.alert("下一流程已走完,不能撤回了!");
- return;
- } else if(user_ID == isSeen_2){
- if(stateNow == 1){//待审核
- stateNext = stateNow-1;//撤回到待发送
- }else if(stateNow == 3){//待签发
- stateNext = stateNow-2;//撤回到待审核
- }else if(stateNow == 4){//待分发
- if(noticeLevel == 31 || noticeLevel == 32){//III级,IV级
- stateNext = stateNow-3;//撤回到待审核
- }else if(noticeLevel == 29 || noticeLevel == 30){//I级,II级
- stateNext = stateNow-1;//撤回到待签发
- }
- }
- }
-
- var params = {
- classid : "365",
- FD_OBJECTID365 : fd_id,
- //IS_SEND_365 : "0"
- IS_SEND_365 : stateNext,
- IS_SEEN_365 : "a,b,c"
- };
- top.Dialog.confirm("确定要撤回吗?|撤回", function() {
- $.ajax({
- url : $.pathname() + '/ws/crud/CRUDService/updateWarning/',
- type : 'post',
- timeout : 15000,
- data : params,
- dataType : 'json',
- success : function(data) {
- top.Dialog.alert('撤回成功!', null, null, null, -1);
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/Warning.jsp");
- //_this.listGrid.rend();
- },
- error : function(e) {
- top.Dialog.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- });
- }
-
- }
- function sendButFun(){//发送
- if(ewpBut == 51){
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/WarningRelieve.jsp?fd_id="+ fd_id+"&is_edit=0");
- }else{
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/WarningAddEdit.jsp?fd_id="+ fd_id+"&is_adjst=5");
-
- }
- }
- function checkButFun(){//审核
- if(ewpBut == 51){
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/RelieveFlowAuditIssue.jsp?fd_id="+ fd_id+"&is_audit="+0);
- }else{
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/WarningAuditIssue.jsp?fd_id="+ fd_id+"&is_audit="+0);
- }
- }
- function checkSignButFun(){//审核并签发
- if(ewpBut == 51){
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/RelieveFlowAuditIssue.jsp?fd_id="+ fd_id+"&is_audit="+0);
- }else{
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/WarningAuditIssue.jsp?fd_id="+ fd_id+"&is_audit="+0);
- }
- }
- function signButFun(){//签发
- if(ewpBut == 51){
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/RelieveFlowAuditIssue.jsp?fd_id="+ fd_id+"&is_audit="+1);
- }else{
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/em/response/emergencyResponse/WarningAuditIssue.jsp?fd_id="+ fd_id+"&is_audit="+1);
- }
- }
- function issueButFun(){
-
- $("#PLAN_TYPE_ID_368").val(planType);
- if(writerIdBut != user_ID){
- top.Dialog.alert("只有填报人才有发布权限!");
- return;
- }
-
- var flag = -1;//是-0否-1走发布
- /** ***********************************start************************************** **/
- if(ewpBut == 49){
- //1.判断是否有同单位同类型预案的预警通知单(如果有跳转到预警列表页面,没有,就继续)之前“发布通知单时,把本单位相同预案的其它通知单状态改为结束”去掉--updadeWarningStateTo6
- //2.判断是否有同单位同类型预案的响应通知单(如果有跳转到响应列表页面,没有,就继续)
- $.ajax({//查询本单位是否有相同预案的通知单
- url : $.pathname() + '/ws/alertToImpl/AlertToImplService/getTZDNum/',//获取通知单记录条数
- data : {planTypeId : planType,//预案类型
- isAlert : "1" ,//预警or响应
- corpId : CorpArea,//单位ID
- fd_id : fd_id,
- lastId : isLastId
- },
- type : 'post',
- timeout : 15000,
- dataType : 'text',
- async : false,
- success : function(data) {
- debugger;
- var aOrP = data.split(",")[0];//预警-0或响应-1
- var aOrPNum = data.split(",")[1];//通知单数量
- if(aOrP == "0"){
- if(aOrPNum > 0){
- flag = 1;
- top.Dialog.confirm("本单位有相同预案已发布的预警通知单,无法继续当前操作!是否处理已发布的预警通知单?|响应",
- function(){//确定
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/alert/warning/Warning.jsp");
- return;
- },
- function(){//取消
- //$('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/alert/warning/WarningAddEdit.jsp");
- top.Dialog.close();
- return;
- }
- );
- }else{
- flag = 0;
- }
- }else if(aOrP == "1"){
- if(aOrPNum > 0){
- flag = 1;
- top.Dialog.confirm("本单位有相同预案已发布的响应通知单,无法继续当前操作!是否处理已发布的响应通知单?|响应",
- function(){//确定
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/emergencyResponse/Warning.jsp");
- return;
- },
- function(){//取消
- //$('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/alert/warning/WarningAddEdit.jsp");
- top.Dialog.close();
- return;
- }
- );
- }else{
- flag = 0;
- }
- }
- },error : function(e) {
- top.Dialog.alert("系统提示信息!");
- }
- });
- }
- /** *******************************end****************************************** **/
- if(flag == 0 || flag == -1){
- var is_send = '5';
- if(ewpBut == "51"){
- is_send = '6';
- }
- //====================================================================================================================
- var url0 = $.pathname() + '/ws/human/TreateHumanService/updateTreateHumanDispose';
- var params0 = {
- personId_378 : user_ID,
- businessId_378 : fd_id,
- statues_378 : '4'
- };
- $.request.query(url0,params0,function(data){
- //alert(data);
- });
- //=====================================================================================================================
- var EARLY_WARNING_ID_365=getAlertNum($("#EARLY_WARNING_ID_365").html().split('-')[0],ewpBut);
- if("51"==ewpBut){//如果是解除
- EARLY_WARNING_ID_365=$("#EARLY_WARNING_ID_365").html();
- }
- var params = {
- classid : "365",
- FD_OBJECTID365 : fd_id,
- EARLY_WARNING_ID_365:EARLY_WARNING_ID_365,//通知单编号
- IS_SEND_365 : is_send,//通知单状态
- RELEASE_UNIT_365:CorpArea//,//发布单位
- };
- var planId = meetEmergencyPlan;//$("#MEET_EMERGENCIES_PLAN_365")
- var planName = "";
- $.ajax({//查询预案名称select PLAN_NAME from ECM_AM_YJYASERVER where FD_OBJECTID = planId
- url : $.pathname() + '/ws/response/responseService/getPlanName/',
- data : { planId214 : planId },
- type:'post',
- dataType : 'text',
- timeout : 666666,
- async : false,
- success : function(result){
- planName = result;
- },error : function(e){
- top.Dialog.alert("系统错误!");
- }
- });
- var earlyWarningAreaId = earlyWarningAreaIds;//$("#EARLY_WARNING_AREA_ID_365").val();
- var paramsJK = {
- classid : "365",
- FD_OBJECTID365 :fd_id,
- RELIEVE_DATE_365:getDateTime(),/////////////////////////////////////////////////////////
- IS_SEND_365 : "6",
- IS_RELIEVE_365:"2",
- PLAN_NAME : planName,
- EARLY_WARNING_AREA_ID : earlyWarningAreaId,
- LAST_LEVEL : lastLevel,
- CURRENT_LEVEL : currentLevel
- };
- var num = getAlertNum($("#EARLY_WARNING_ID_365").html().split('-')[0],ewpBut);
- top.Dialog.confirm("确定要发布吗?|发布", function() {
- //通过fd_id获取IS_LAST_ID
- $.ajax({
- url : $.pathname() + '/ws/response/responseService/getIsLastIdByFdid/',
- data : { FD_OBJECTID : fd_id },
- type : 'post',
- dataType : 'text',
- timeout : 15000,
- //async : false,
- success : function (lastId){
- //把fd_objectId为lastId的状态改为6(即结束该通知单),没有返回值
- $.ajax({
- url : $.pathname() + '/ws/response/responseService/updateIsSend/',
- data : { FD_OBJECTID : lastId },
- type : 'post',
- dataType : 'text',
- timeout : 15000,
- //async : false,
- success : function (nothing){
-
- },error : function(e){
- top.Dialog.alert('系统提示信息');
- }
- });
- },error : function(e){
- top.Dialog.alert('访问服务失败!');
- }
- });
-
-
- var men_url = $.pathname()+ "/page/business/em/response/emergencyResponse/WarningReleaseMatter.jsp?fd_id="+ fd_id;
-
- $.ajax({
- url : $.pathname() + '/ws/crud/CRUDService/updateWarning/',
- type : 'post',
- timeout : 15000,
- data : params,
- dataType : 'json',
- //async : false,
- success : function(data) {
-
- $.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("系统错误!");
- }
- });
-
-
- saveAddNum();
- if(isLastId != null && isLastId != ""){
- var params = {
- classid : "365",
- FD_OBJECTID365 : isLastId,
- RELIEVE_DATE_365:getDateTime(),////////////////////////////////////////////
- IS_SEND_365 : "6"
- };
- $.ajax({
- url : $.pathname() + '/ws/crud/CRUDService/update/',
- type : 'post',
- timeout : 15000,
- data : params,
- dataType : 'json',
- //async:false,
- success : function(data) {
- top.Dialog.alert('发布通过!', null, null, null, -1);
-
- if(ewpBut != "51"){//非解除
- if(ewpBut == "49"){//初次发布,说明是预警转响应的一条记录
- updatePlan(prevEWId,num,releaseUnitId,meetEmergencyPlan,typhoonDate,currentLevel,"2",$("#RELEASE_RELIEVE_DATE_365").html(),fd_id,dataMsg,men_url);
- }else{//调整
- // updatePlan(prevEWId,num,releaseUnitId,meetEmergencyPlan,typhoonDate,currentLevel,"1",$("#RELEASE_RELIEVE_DATE_365").html(),fd_id,dataMsg,men_url);
- updatePlan(prevEWId,num,releaseUnitId,meetEmergencyPlan,typhoonDate,currentLevel,"2",$("#RELEASE_RELIEVE_DATE_365").html(),fd_id,dataMsg,men_url);
- }
- }else{//解除
- finishPlan($("#EARLY_WARNING_ID_365").html(),releaseUnitId,eventId,$("#EVENT_ID_365_SHOW").html());//20160830
- }
- },error : function(e) {
- top.Dialog.alert('系统提示信息!');
- }});
- }else{
- createPlan2(dataMsg,men_url);
- top.Dialog.alert('发布通过!', null, null, null, -1);
- }
- },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) {
- //top.Dialog.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
-
-
- var jkUrl = "";//发布通知单时,调用接口的url
- var tzdProperty = ewpBut;//通知单预警性质
- if(tzdProperty == "51"){//解除
- jkUrl = $.pathname() + '/ws/alertToImpl/AlertToImplService/responseRelieveIssue/';
- }else if(tzdProperty == "49" || tzdProperty == "50"){//初次或调整
- jkUrl = $.pathname() + '/ws/alertToImpl/AlertToImplService/responseSend/';
- }
-
- $.ajax({
- url : jkUrl,
- type : 'post',
- timeout : 15000,
- //data : params,
- data : paramsJK,
- dataType : 'json',
- success : function(data) {
-
- },error : function(e) {
- //top.Dialog.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- });
- }
- }
- function saveAddNum(){
- 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/alert/warning/WarningReleaseMatter.jsp?fd_id="+ fd_id);
- });
- };
- /**
- * 替换计划
- */
- function updatePlan(oldAlert,newAlert,companyId,meet_plan_id,typhoon,alertLevel,isAlert,relieveDate,fd_id,row,men_url){
- var planTime = getPlanTime(meet_plan_id,typhoon,alertLevel);
- var circleTime = planTime.split("_______")[0];
- var temporaryTime = planTime.split("_______")[0];
- var params = {
- OLD_WARN : oldAlert,
- NEW_WARN : newAlert,
- COMP_ID : companyId,
- 'isAlert' : isAlert,
- "temporaryTime" : temporaryTime,
- "circleTime" : circleTime,
- areaName : row.EARLY_WARNING_AREA_NAME_365,
- areaId : row.EARLY_WARNING_AREA_ID_365
- };
- $.ajax({
- url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/updatePlan',
- type : 'post',
- timeout : 15000,
- data : params,
- dataType : 'text',
- success : function(data) {
- if(data){
- createPlan(meet_plan_id,newAlert,relieveDate,alertLevel,fd_id,row,men_url);
- }else{
- $('#frmright', window.parent.document).attr('src',men_url);
- }
- },error:function(e){
- alert("updateplan出错");
- }
- });
- }
- /**
- * 通过预案数据获取周期性和临时性时间
- * @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) {
- 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;
- }
- alertDate = alertDate.split('||');
- temporary = alertDate[0];
- alertDate = alertDate[1];
- if(typhoon != null && typhoon != ''){
- temporaryTime = getFormatString(typhoon,temporary);
- }
- }
- }
- });
- return alertDate+"_______"+temporaryTime;
- }
- /**
- * 结束报表填报计划
- */
- function finishPlan(alertNum,companyId,event_id,event_name){
- var params = {WARNING_NUMBER:alertNum,COMP_ID:companyId,IS_ALERT:"1"};
- $.ajax({
- url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/releasePlan',
- type : 'post',
- timeout : 15000,
- data : params,
- dataType : 'text',
- success : function(data) {
- var event_unit_id = queryEventInfo(event_id);
- if(event_unit_id==CorpArea){
- top.Dialog.confirm("发布通过,是否结束"+event_name+"事件?",function(){
- finishedEvent(event_id,event_name);
- },function(){
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/emergencyResponse/Warning.jsp");
- });
- }else{
- top.Dialog.alert('发布通过!', null, null, null, -1);
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/emergencyResponse/Warning.jsp");
- }
- }
- });
- }
- /**
- * 创建报表填报计划
- */
- function createPlan2(row,men_url){
- var status = row.PLAN_TYPE_ID_365;
- var grade_type = "%6_2";
- if(status=="5"){//大面积停电
- grade_type = "%6_1";
- }
- $.ajax({
- url : $.pathname() + '/ws/sendmenu/SendMsgService/PlanInfoEM',
- type : 'post',
- timeout : 15000,
- data : {file_id:row.MEET_EMERGENCIES_PLAN_365,grade_type:grade_type},
- dataType : 'json',
- async: false,
- success : function(data) {
- if(data != null && data != ""){
-
- //如果状态等于14代表突发性群体事件 ,16涉外突发事件,17网络与信息安全无报表填报要求
- if(status == 14 || status == 16 || status == 17){
- return;
- }
-
- var istemporary = "周期性";
- var tempRow = data;
- var alertLevel = row.CURRENT_ER_LEVEL_365;
- var alertDate = ""; //周期时间
- var temporaryTime = ""; //临时时间
- 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;
- }
- //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){
- alertDate = alertDate.substring(1, alertDate.length);
- }
- }
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();//部门名称
- var CorpArea = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- var Corp_names = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
- 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 =row.EARLY_WARNING_NAME_365;//预警名称
- var areaId = row.EARLY_WARNING_AREA_ID_365;//预警范围部门id
- var areaName = row.EARLY_WARNING_AREA_NAME_365;//预警范围部门名称
- var isAlert = "1";//预警还是响应
- if(status == 9 || status == 10){
- alertDate = alertDate.split('||');
- temporary = alertDate[0];
- var typhoon = row.TYPHOON_DATE_365;
- //alert(tempRow[0].TABLE_NAME.split("***")[1]);
- parmas = {
- WARNING_NUMBER : row.EARLY_WARNING_ID_365,
- START_TIME : row.RELEASE_RELIEVE_DATE_365,
- FILL_IN_SCHEDULE : "周期性",
- REPORT_DEPT : tempRow[0].TABLE_NAME.split("***")[1],
- DEPT_ID : CorpArea,
- ROUND_TIME : alertDate[1],
- 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
- };
- $.ajax({
- url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/createPlanByAlert',
- type : 'post',
- timeout : 15000,
- data : parmas,
- dataType : 'text',
- async: false,
- success : function(data) {
-
- }
- });
- if(typhoon != null && typhoon != ''){
- alertDate = "";
- temporaryTime = getFormatString(typhoon,temporary);
- parmas = {WARNING_NUMBER:alertNum,START_TIME:row.RELEASE_RELIEVE_DATE_365,
- FILL_IN_SCHEDULE:"临时性",REPORT_DEPT:tempRow[0].TABLE_NAME,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};
- $.ajax({
- url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/createPlanByAlert',
- type : 'post',
- timeout : 15000,
- data : parmas,
- dataType : 'json',
- async: false,
- success : function(data) {
- $('#frmright', window.parent.document).attr('src',men_url);
- }
- });
- }else{
- $('#frmright', window.parent.document).attr('src',men_url);
- }
-
-
- }else{
- parmas = {WARNING_NUMBER:row.EARLY_WARNING_ID_365,START_TIME:row.RELEASE_RELIEVE_DATE_365,
- FILL_IN_SCHEDULE:"周期性",REPORT_DEPT:tempRow[0].TABLE_NAME,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};
- $.ajax({
- url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/createPlanByAlert',
- type : 'post',
- timeout : 15000,
- data : parmas,
- dataType : 'text',
- async: false,
- success : function(data) {
- $('#frmright', window.parent.document).attr('src',men_url);
- }
- });
- }
- }else{
- top.Dialog.alert('预案中没有配置报表报告计划!');
- _this.listGrid.loadData();
- };
- },
- error : function(e) {
- top.Dialog.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
- /**
- * 创建报表填报计划
- */
- function createPlan(meet_plan_id,newAlert,relieveDate,alertLevel,fd_id,row,men_url){
- var status = row.PLAN_TYPE_ID_365;
- var grade_type = "%6_2";
- if(status=="5"){//大面积停电
- grade_type = "%6_1";
- }
- $.ajax({
- url : $.pathname() + '/ws/sendmenu/SendMsgService/PlanInfoEM',
- type : 'post',
- timeout : 15000,
- data : {file_id:row.MEET_EMERGENCIES_PLAN_365,grade_type:grade_type},
- dataType : 'json',
- async: false,
- success : function(data) {
- if(data != null && data != ""){
-
- //如果状态等于14代表突发性群体事件 ,16涉外突发事件,17网络与信息安全无报表填报要求
- if(status == 14 || status == 16 || status == 17){
- return;
- }
-
- var istemporary = "周期性";
- var tempRow = data;
- var alertLevel = row.CURRENT_ER_LEVEL_365;
- var alertDate = ""; //周期时间
- var temporaryTime = ""; //临时时间
- 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;
- }
- //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){
- alertDate = alertDate.substring(1, alertDate.length);
- }
- }
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();//部门名称
- var CorpArea = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- var Corp_names = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
- 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 =row.EARLY_WARNING_NAME_365;//预警名称
- var areaId = row.EARLY_WARNING_AREA_ID_365;//预警范围部门id
- var areaName = row.EARLY_WARNING_AREA_NAME_365;//预警范围部门名称
- var isAlert = "1";//预警还是响应
- if(status == 9 || status == 10){
- alertDate = alertDate.split('||');
- temporary = alertDate[0];
- var typhoon = row.TYPHOON_DATE_365;
- //alert(tempRow[0].TABLE_NAME.split("***")[1]);
- parmas = {
- WARNING_NUMBER : row.EARLY_WARNING_ID_365,
- START_TIME : row.RELEASE_RELIEVE_DATE_365,
- FILL_IN_SCHEDULE : "周期性",
- REPORT_DEPT : tempRow[0].TABLE_NAME.split("***")[1],
- DEPT_ID : CorpArea,
- ROUND_TIME : alertDate[1],
- 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
- };
- $.ajax({
- url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/createPlanByAlert',
- type : 'post',
- timeout : 15000,
- data : parmas,
- dataType : 'text',
- async: false,
- success : function(data) {
-
- }
- });
- if(typhoon != null && typhoon != ''){
- alertDate = "";
- temporaryTime = getFormatString(typhoon,temporary);
- parmas = {WARNING_NUMBER:alertNum,START_TIME:row.RELEASE_RELIEVE_DATE_365,
- FILL_IN_SCHEDULE:"临时性",REPORT_DEPT:tempRow[0].TABLE_NAME,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};
- $.ajax({
- url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/createPlanByAlert',
- type : 'post',
- timeout : 15000,
- data : parmas,
- dataType : 'json',
- async: false,
- success : function(data) {
- $('#frmright', window.parent.document).attr('src',men_url);
- }
- });
- }else{
- $('#frmright', window.parent.document).attr('src',men_url);
- }
-
-
- }else{
- parmas = {WARNING_NUMBER:row.EARLY_WARNING_ID_365,START_TIME:row.RELEASE_RELIEVE_DATE_365,
- FILL_IN_SCHEDULE:"周期性",REPORT_DEPT:tempRow[0].TABLE_NAME,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};
- $.ajax({
- url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/createPlanByAlert',
- type : 'post',
- timeout : 15000,
- data : parmas,
- dataType : 'text',
- async: false,
- success : function(data) {
- $('#frmright', window.parent.document).attr('src',men_url);
- }
- });
- }
- }else{
- top.Dialog.alert('预案中没有配置报表报告计划!');
- _this.listGrid.loadData();
- };
- },
- error : function(e) {
- top.Dialog.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
- //获取通知单编号
- function getAlertNum(thing,alertQuality){
- //获取系统年份
- var year = allGetServerTime().getFullYear();
- var quality = "F";
- if(alertQuality == '49'){
- quality = "F";
- }else{
- quality = "T";
- }
- var params = {
- companyId : CorpArea,
- year : year,
- isAdjust : quality,
- isAlert:'1',
- plan_type_id : $("#PLAN_TYPE_ID_368").val()
- };
-
- var url = $.pathname()+ '/ws/response/responseService/getAlertresponse';
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- dataType : 'json',
- data : params,
- async : false,
- success : function(data) {
- $("#IS_ADJUST_368").val(quality);
- $("#COMPANY_ID_368").val(CorpArea);
- $("#YEAR_368").val(year);
- $("#NUM_368").val(data);
- alertNum = thing + "-" + ""+quality+"" + "-" + year + "-" + data;//防风防汛-F-2016-83
- }
- });
- return alertNum;
- };
- function getPersonMsg(){
- //alert("fd_id="+fd_id+"\n isSend="+isSend);
- if(isSend != 0){
- $.ajax({//查询表【ECM_EM_TREATED_HUMAN】中的处理人ID
- url : $.pathname() + '/ws/sendsms/SendSmsService/getHumanMsg',
- data : { fd_id : fd_id , isSend : isSend},
- type : 'post',
- dataType : 'json',
- timeout : 666666,
- async : false,
- success : function (resultData){
- personId = resultData.personId;//处理人ID
- },error : function (e){
- top.Dialog.alert("系统错误!");
- }
- });
- }
- }
- /****
- * 根据id查询事件信息
- */
- function queryEventInfo(event_id){
- var unit_id = "";
- var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
- var params = {
- classid : '363',
- objectID : event_id
- };
- $.ajax({
- url : url,
- type : 'post',
- data : params,
- dataType : 'json',
- async:false,
- success : function(data) {
- unit_id = data.ISSUE_UNITE_ID_363;
- },
- error : function(e) {
- // $.messager.alert('访问服务失败!55', 'error');
- }
- });
- return unit_id;
- }
- /****
- * 根据id结束事件
- */
- function finishedEvent(event_id,event_name){
- var params = {
- classid : "363",
- FD_OBJECTID363 : event_id,
- EVENT_STATE_363 : "1"
- };
- $.ajax({
- url : $.pathname() + '/ws/crud/CRUDService/update/',
- type : 'post',
- data : params,
- dataType : 'json',
- success : function(data) {
- top.Dialog.alert(event_name+'事件已经结束!', null, null, null, -1);
- //$('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/response/emergencyResponse/Warning.jsp");
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/em/alert/warning/Warning.jsp");
- },
- error : function(e) {
- $.messager.alert('结束事件失败!');
- }
- });
- }
- //获得当前系统时间:年月日时分秒
- function getSysTime(){
- 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);
- return s;
- }
- //获得当前系统时间:分
- 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;
- }
|