var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
var parent_id = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
var parent_ids = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
//登陆用户的单位名称
var corp_name = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
$(function(){
getChildInfo();
/** 绑定更多的按钮点击事件 */
$more = $("#more"); // 更多按钮
$more.bind('click', function() {
more();
});
$searchButt = $("#searchButt");// 更多查询按钮
$searchButt.live('click', function() {
searchHandler();
});
//清空条件
$("#emptyCondition").bind("click",function(){
$("#PLAN_NAME_214").val("");
var $selConditions = $("#selectConditions");
var $selCon = $selConditions.find(".selectCondi");
for(var i=0;i<$selCon.length;i++){
$selCon[i].click();
}
});
$searchOne = $("#searchOne");//查询图标绑定查询事件
$searchOne.bind('click', function() {
searchHandler();
});
});
var conditionData2="";
function getChildInfo(){
var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getChidInfo/';
var params = {
id : parent_id,
};
$.ajax({
url : url,
type : 'post',
timeout : 60000,
data : params,
dataType : 'json',
success : function(data){
conditionData2 = JSON.stringify(data);
var test = eval("("+conditionData2+")");
if(conditionData2!='{"list":[{"name":"查询单位","className":"UNITS","list":[]}]}'){
conditionData.list.push(test.list[0]);
}
createConditionsDom(conditionData);
$(".item").unbind("click").bind("click",bindSelectOne);
},
error : function(e){
$.messager.alert('系统提示信息', '访问服务失败!', 'error');
}
});
}
//当前系统时间
//var time = TAKE_DATE
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;
}
time = date.getFullYear() + seperator1 +"-"+ month + seperator1 + "-"+strDate;
var g;
/**定义变量**/
var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+""; //登录人ID
var condition = "DATEDIFF(MONTH,take_date , DATE '"+time+"') >35 and IS_DEL='0' and UNITS='"+deptId+"'";
//列表加载参数
var loadParams = {
"listId" : '214',
"condition" : condition,
direction:'DESC',
sort: 'UPDATEDATE'
};
function initComplete(){
/**
* 工具条
*/
var roleCons = roleButtonArr();
var toolBarOpt1 = {
items:[
{ text : '短信',click : 'sendMessage',iconClass : 'sendmsg_tem',id:"10005",disabled : false }
],
roleCons:roleCons
};
/**
* 树形列
*/
var grid_option1 = {
columns: [
{ display: '预案名称', name: 'PLAN_NAME_214', align: 'center', width: "10%",isPrimaryKey:true,
render : function(rowdata, value) {
return ''+ rowdata.PLAN_NAME_214 +'';
}
},
{ display: '预案编码', name: 'PLAN_NO_214', align: 'center', width: '10%'},
{ display: '预案类型', name: 'PLAN_TYPE_214_SHOW', align: 'center', width: '10%'},
{ display: '突发事件类型', name: 'BYSUNESS_TYPE_214_SHOW', align: 'center', width: '10%'},
{ display: '责任部门', name: 'INS_UNITS_214_SHOW', align: 'center', width: '8%'},
{ display: '颁布日期', name: 'ISSUE_DATE_214', align: 'center' , width: '8%' },
{ display: '实施日期', name: 'TAKE_DATE_214', align: 'center' , width: '8%' },
{ display: '所属单位', name: 'UNITS_214_SHOW', align: 'center', width: '15%' },
{ display: '简要说明', name: 'SYFW_214', align: 'center', width: '20%'}
/* { display: '操作', isAllowHide: false, align: 'center', width:'8%',
render: function (rowdata, rowindex, value, column){
//判断是否已经发布。取发布的状态,如果已经发布为“1”;未发布为“0”
var fabu='';//fabu
if(rowdata.PLAN_STAT_214=="1"){
fabu = '';
}else{
fabu = '';
}
//判断是否已经发布。取发布的状态,如果已经上报为“1”;未上报为“0”fashang_09fashang_plan
var shangbao='';
if(rowdata.PLAN_STAT1_214=="1"){
shangbao = '';
}else{
shangbao = '';
//shangbao = '';
}
return fabu
+ shangbao;
}
}*/
],
rownumbers : true,
checkbox : true,
pageSize : 10,
percentWidthMode : true
};
var options1={
url :'/nwyj/ws/crud/CRUDService/queryQui',
params:loadParams,
height: '100%',
width:"100%",
gridOptions:grid_option1,
singleRecodeOptions:{a:"aa"},
paperOpration:{showInput:"true"},
toolBarOptions:toolBarOpt1
};
g=gridAndSingleRecode=$("#maingrid").quickgridAndSingleRecode(options1);
}
//下载
function onDownload(){
var FD_OBJECTID = "";
var rows = g.getSelectedRows();
for (var i = 0; i < rows.length; i++) {
var FD_OBJECTID1= rows[i].FD_OBJECTID214;//预案的主键
var PLAN_BIAOZHI1 =rows[i].PLAN_BIAOZHI_214;//预案的标识位(新的预案还是旧的预案)
var UPLOAND_FLAG1 =rows[i].UPLOAND_FLAG_214;//上传标识
var PLAN_VERSION_REMAR1 =rows[i].PLAN_VERSION_REMARK_214;//修改预案后新增预案的情况,也必有附件
//新增预案,控制必传附件 纯新增
if(PLAN_BIAOZHI1=="0"&&PLAN_VERSION_REMAR1=="0"&&UPLOAND_FLAG1=="1"){
//getFileList(fd_id,1);
FD_OBJECTID += "'"+FD_OBJECTID1 +"'"+ ",";//预案的主键
}
//修改预案后新增预案的情况,也必有附件 纯修编
if(PLAN_BIAOZHI1!="0"&&PLAN_VERSION_REMAR1!="0"&&UPLOAND_FLAG1=="1"){
//getFileList(fd_bojectid,1);
FD_OBJECTID += "'"+FD_OBJECTID1+"'" + ",";//预案的主键
}
//纯修改
if(PLAN_BIAOZHI1=="0"&&PLAN_VERSION_REMAR1!="0"&&UPLOAND_FLAG1=="0"){
//getFileList(PLAN_VERSION_REMARK,1);
FD_OBJECTID += "'"+PLAN_VERSION_REMAR1+"'" + ",";//预案的主键
}
//修编修改
if(PLAN_BIAOZHI1!="0"&&PLAN_VERSION_REMAR1!="0"&&UPLOAND_FLAG1=="0"){
//getFileList(PLAN_VERSION_REMARK,1);
FD_OBJECTID += "'"+PLAN_VERSION_REMAR1+"'" + ",";//预案的主键
}
}
var temp = FD_OBJECTID.substring(0,FD_OBJECTID.length-1);
//alert("temp****"+temp + "****99999****");
//发送请求,获取文件名的集合。
var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getPlanFile/';
var params = {
fileId : temp
};
var SAVENAME1="";
var NAME1 = "";
var FILEEXT1="";
$.ajax({
url : url,
type : 'post',
timeout : 60000,
data : params,
dataType : 'json',
success : function(data){
var dataLenth = data.rows.length;
var filenames="";
var downfilename = "";
for (var i = 0; i < dataLenth; i++) {
SAVENAME1= data.rows[i].SAVENAME;
NAME1= data.rows[i].NAME;
FILEEXT1= data.rows[i].FILEEXT;
filenames +=SAVENAME1 + "." + FILEEXT1 + ";";
downfilename+=NAME1 + "." + FILEEXT1 + ";";
}
var filenames1 = filenames.substring(0,filenames.length-1);
filenames = decodeURI(filenames1);
var downfilename1 = downfilename.substring(0,downfilename.length-1);
downfilename = decodeURI(downfilename1);
showFile(filenames1,downfilename1);
//alert(downfilename1+"============"+filenames1);
//返回回调打包下载的函数,拼传给回调函数的filenames,downfilename
},
error : function(e){
$.messager.alert('系统提示信息', '访问服务失败!', 'error');
}
});
}
function showFile(downfilename,filenames){
var url = "/nwyj/page/business/am/org/query/getZipFile.jsp?downfilename="+downfilename+"&filenames="+filenames;
window.open(url);
}
//高级查询
function searchHandler(){
$queryForm = $("#queryForm");
if($("#PLAN_NAME_214").val()=="预案名称"){
$("#PLAN_NAME_214").val("");
}
$queryForm.serialize();
//获取选中的值
var searchCondition = getSelectCon(conditionData);
var queryParams = getQueryFormParams($queryForm);
var params=$.extend({},loadParams,queryParams);
//与之前参数条件拼接
params.condition = searchCondition.condition + params.condition;
g.setOptions({"params":params});
//加载数据
g.rend();
}
//点击查看
function jumpPage(fd_id,PLAN_BIAOZHI,BM_YAXHLB,PLAN_REFINE_CATEGORY,PLAN_TYPE){
if(PLAN_TYPE!="103"){
window.location.href="Planinfo.jsp?"+fd_id;
}else{
if(PLAN_REFINE_CATEGORY=="17"){//网络与信息安全
window.location.href="PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="4"){//人身事故
window.location.href="PlanOnViewNexus/PlanNexusRSSG.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="5"){//大面积停电事件
window.location.href="PlanOnViewNexus/PlanNexusDMJTD.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="6"){//设备事故
window.location.href="PlanOnViewNexus/PlanNexusSBSG.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="7"){//电厂大坝厂房事故
window.location.href="PlanOnViewNexus/PlanNexusDCDB.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="8"){//环境污染
window.location.href="PlanOnViewNexus/PlanNexusHJWR.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="9"){//防风防汛PlanOnViewList\NewMsgNotice
window.location.href="PlanOnViewNexus/PlanNexus.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="10"){//地震灾害
window.location.href="PlanOnViewNexus/PlanNexusDZZH.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="11"){//低温雨雪冰冻灾害
window.location.href="PlanOnViewNexus/PlanNexusDWBD.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="12"){//电力供应及客户服务PlanNexusDLGY.jsp
window.location.href="PlanOnViewNexus/PlanNexusDLGY.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="13"){//生产场所防恐怖袭击
window.location.href="PlanOnViewNexus/PlanNexusKBXJ.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="14"){//突发性群体事件
window.location.href="PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="15"){//突发新闻事件
window.location.href="PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="16"){//涉外突发事件
window.location.href="PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="18"){//突发公共卫生
window.location.href="PlanOnViewNexus/PlanNexusGGWS.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else{
window.location.href="PlanNexus.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}
}
}
function onView(){
//根据预案类型分别跳转不同的预案绑定的页面
var rows = g.getSelectedRows();
if(rows.length==0){
top.Dialog.alert("请选择一条记录");
return;
}
if(rows.length>1){
top.Dialog.alert("只能选择一条记录");
return;
}
/**
* 如果是地震预案,跳转到地震对应的预案.
* 传给子页面的值:
* 1、主键
* 2、 版本(初次版本为0;方便日后修订预案后将原有预案的绑定条件带出来。避免用户再次录入绑定条件)
* 3、预案具体业务分类,方便分别找到对应的报表填报计划页面
*
* **/
var fd_id = rows[0].FD_OBJECTID214;
var PLAN_BIAOZHI = rows[0].PLAN_BIAOZHI_214;
var PLAN_REFINE_CATEGORY = rows[0].PLAN_REFINE_CATEGORY_214;
var BM_YAXHLB = rows[0].PLAN_REFINE_CATEGORY_214;
var PLAN_TYPE = rows[0].PLAN_TYPE_214;
if(PLAN_TYPE!="103"){
window.location.href="Planinfo.jsp?"+fd_id;
}else{
if(PLAN_REFINE_CATEGORY=="17"){//网络与信息安全
window.location.href="PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="4"){//人身事故
window.location.href="PlanOnViewNexus/PlanNexusRSSG.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="5"){//大面积停电事件
window.location.href="PlanOnViewNexus/PlanNexusDMJTD.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="6"){//设备事故
window.location.href="PlanOnViewNexus/PlanNexusSBSG.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="7"){//电厂大坝厂房事故
window.location.href="PlanOnViewNexus/PlanNexusDCDB.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="8"){//环境污染
window.location.href="PlanOnViewNexus/PlanNexusHJWR.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="9"){//防风防汛
window.location.href="PlanOnViewNexus/PlanNexus.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="10"){//地震灾害
window.location.href="PlanOnViewNexus/PlanNexusDZZH.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="11"){//低温雨雪冰冻灾害
window.location.href="PlanOnViewNexus/PlanNexusDWBD.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="12"){//电力供应及客户服务PlanNexusDLGY.jsp
window.location.href="PlanOnViewNexus/PlanNexusDLGY.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="13"){//生产场所防恐怖袭击
window.location.href="PlanOnViewNexus/PlanNexusKBXJ.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="14"){//突发性群体事件
window.location.href="PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="15"){//突发新闻事件
window.location.href="PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="16"){//涉外突发事件
window.location.href="PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else if(PLAN_REFINE_CATEGORY=="18"){//突发公共卫生
window.location.href="PlanOnViewNexus/PlanNexusGGWS.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}else{
window.location.href="PlanNexus.jsp?"+fd_id+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB;
}
}
}
$.messager=top.Dialog;
// 更多
function more() {
$('#moreDiv').toggle();
$(parent.document.body).find("#frmright").height($(window.document.body).height());
}
//短信
function sendMessage(){
addMsg();
}
$.messager=top.Dialog;