123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833 |
- /**
- * 按钮
- * @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
- var newWarningId = "";
- function buttonFun(){//按钮的显示情况
- getPersonMsg();
- //personId = isSeenBut.split(",")[0];//如果这样代码可以用,那么getPersonMsg()就可以不用
-
- //isSend : 1-待审核;3-待签发;4-待分发
- //根据状态判断该显示那些按钮
- //再根据登录人id是不是等于处理人id判断【根据状态判断该显示那些按钮】是否隐藏
- if(isSend == 0 && user_ID == writerIdBut){
- $("#sendBut").show();//【发送】
- $("#sendBut").after(" ");
- $("#issueBut").show();//【发布】
- $("#issueBut").after(" ");
-
- }
- if(isSend == 4 && user_ID == writerIdBut){
- $("#issueBut").show();//【发布】
- $("#issueBut").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走发布
- debugger;
- /** ***********************************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) {
- 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('访问服务失败!');
- }
- });
-
-
-
- $.ajax({
- url : $.pathname() + '/ws/crud/CRUDService/updateWarning/',
- type : 'post',
- timeout : 15000,
- data : params,
- dataType : 'json',
- //async : false,
- success : function(data) {
- newWarningId = data.Msg.objectID;
-
- $.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) {
- var eventId = $("#EVENT_ID_365").val();
- if(ewpBut != "51"){//非解除
- if(ewpBut == "49"){//初次发布,说明是预警转响应的一条记录
- finishPlan1(prevEWId,CorpArea,"0");//上次响应编号、单位
- }else { //初次发布的调整 和 再调整
- finishPlan1(prevEWId,CorpArea,"1");//上次响应编号、单位
- }
- createPlan(dataMsg,eventId);
- top.createActiveTab("任务清单",$.pathname()+ "/page/business/em/response/emergencyResponse/WarningReleaseMatter.jsp?fd_id="+ fd_id+"&isActivePage=true");
- top.Dialog.alert('发布通过!', null, null, null, -1);
- }else{//解除
- finishPlan($("#EARLY_WARNING_ID_365").html(),releaseUnitId,eventId,$("#EVENT_ID_365_SHOW").html());//20160830
- }
- },error : function(e) {
- top.Dialog.alert('系统提示信息!');
- }});
- }else{ //初次发布的响应通知单
- var eventType = dataMsg.MEET_EMERGENCIES_PLAN_365;
- var time = dataMsg.RELEASE_RELIEVE_DATE_365;
- time = time.split(" ")[0];
- var noticeId = dataMsg.FD_OBJECTID365;
- var compId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- var eventId = createEventByNotice(eventType,time,compId,noticeId);//生成事件名称,并返回事件id
- $("#EVENT_ID_365").val(eventId);
- dataMsg.EVENT_ID_365 = eventId;
- $("#IS_SEND_365").val(5);
- createPlan(dataMsg,eventId);
- }
- },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(isAlert=="2"){
- createPlan1(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 finishPlan1(alertNum,companyId,IS_ALERT){
- var params = {WARNING_NUMBER:alertNum,COMP_ID:companyId,IS_ALERT:IS_ALERT};
- $.ajax({
- url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/releasePlan',
- type : 'post',
- timeout : 15000,
- data : params,
- dataType : 'text',
- success : function(data) {
- }
- });
- }
- /**
- * 结束报表填报计划
- */
- 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 createPlan(row,eventId){
-
- var alertLevel = row.CURRENT_ER_LEVEL_365;
- $.ajax({
- url : $.pathname() + '/ws/sendmenu/SendMsgService/getReportAndPlanTime',
- type : 'post',
- data : {"event_type_id":row.MEET_EMERGENCIES_PLAN_365,"event_level":alertLevel,"comp_id":CorpArea},
- dataType : 'text',
- async:false,
- success : function(data) {
-
- if(data != null && data != ""){
- var alertDate = data; //周期时间
- var temporaryTime = ""; //临时时间
- var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- 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";//预警还是响应
- parmas = {
- WARNING_NUMBER : row.EARLY_WARNING_ID_365,
- START_TIME : row.RELEASE_RELIEVE_DATE_365,
- FILL_IN_SCHEDULE : "周期性",
- 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:row.MEET_EMERGENCIES_PLAN_365,
- eventId:row.EVENT_ID_365
- };
- $.ajax({
- url : $.pathname() + '/ws/getPlanRequires/getPlanRequireService/createPlanByAlert',
- type : 'post',
- timeout : 15000,
- data : parmas,
- dataType : 'text',
- async: false,
- success : function(data) {
- top.Dialog.alert('发布通过!', null, null, null, -1);
-
- }
- });
- }else{
- top.Dialog.alert('该突发事件类型没有配置报表报告计划!');
- top.Dialog.alert('发布通过!', null, null, null, -1);
-
- };
- },
- error : function(e) {
- $.messager.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 : 'text',
- 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);
- var length = data.length;
- for (var int = 0; int < 3-length; int++) {
- data = "0"+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 : "2"
- };
- $.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");
- },
- error : function(e) {
- $.messager.alert('结束事件失败!');
- }
- });
- }
- /**
- * 生成事件的方法
- * @param _url 要跳转的页面路径
- * @param eventType 事件类型id
- * @param time 事件日期
- * @param compId 发布单位id
- * @param compName 发布单位name
- */
- function createEventByNotice(eventType,time,compId,noticeId){
- var realName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
- var realName_ID = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- var eventId = "";
- $.ajax({
- url : $.pathname() + '/ws/response/responseService/creteEventByNotice/',
- data : {
- "eventType":eventType,
- "time":time,
- "compId":compId,
- "input_per_name":realName,
- "input_per_id":realName_ID
- },
- type : 'post',
- dataType : 'text',
- async:false,
- success : function(data) {
- eventId = data;
- updateNoticeEvent(noticeId,eventId);
- updateNewEvent(data);
- },
- error:function(e){
- console.log("生成事件名称失败!");
- }
- });
- return eventId;
- }
- /***
- * 修改通知单的事件id字段
- * @param noticeId
- * @param data
- */
- function updateNoticeEvent(noticeId,eventId){
- var params = {
- classid : "365",
- FD_OBJECTID365 : noticeId,
- EVENT_ID_365:eventId
- };
- $.ajax({//发布通知单时,把本单位相同预案的其它通知单状态改为结束--6(并归档)
- url : $.pathname() + '/ws/crud/CRUDService/updateWarning/',
- data : params,
- type : 'post',
- dataType : 'json',
- success : function(data) {
- console.log("修改通知单事件字段成功!");
- },error : function(e) {
- console.log("修改通知单事件字段失败!");
- }
- });
- }
- /**
- * 修改事件名称
- */
- function updateNewEvent(eventId){
- var diag = new top.Dialog();
- diag.Title = '事件名称';
- diag.URL = $.pathname() + '/page/business/em/alert/warning/WarningEvent.jsp?fd_id='+eventId;
- diag.OkButtonText = '确定';
- diag.ShowCloseButton = false;
- diag.ShowCancelButton = false;
- diag.OKEvent = function(){
- var flag = diag.innerFrame.contentWindow.saveUpdateEvent();
- if(flag){
- diag.close();
- guanLianEvent(eventId);//关联事件
- }
-
- };
- diag.Width = 800; //宽度
- diag.Height = 200; //宽度
- diag.ButtonAlign = 'center';
- diag.show();
- }
- /**
- * 关联事件
- */
- function guanLianEvent(fd_id){
- var diag = new top.Dialog();
- diag.Title = '关联事件';
- diag.URL = $.pathname() + "/page/business/em/alert/warning/WarningEventGuanLian.jsp?fd_id="+newWarningId;
- diag.OkButtonText = "确定";
- diag.CancelButtonText = "不关联";
- diag.OKEvent = function(){
- diag.innerFrame.contentWindow.updateAndAddEventGuanLian();
- diag.close();
- top.createActiveTab("任务清单",$.pathname()+ "/page/business/em/response/emergencyResponse/WarningReleaseMatter.jsp?fd_id="+ newWarningId+"&isActivePage=true");
- };
- diag.CancelEvent = function(){
- diag.close();
- top.createActiveTab("任务清单",$.pathname()+ "/page/business/em/response/emergencyResponse/WarningReleaseMatter.jsp?fd_id="+ newWarningId+"&isActivePage=true");
- };
- diag.Width = 600; //宽度
- diag.Height = 400; //宽度
- diag.ButtonAlign = 'center';
- diag.show();
- }
|