123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366 |
- var sub_fd_id ="";
-
-
-
- $(function(){
- //2015-09-29 可以取到父页面的预案ID
- //取页面传过来的预案主键ID
- sub_fd_id = parent.fd_id;
-
- var PLAN_BIAOZHI="";
- //查询信息
- var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
- var params = {
- classid : '214',
- objectID : sub_fd_id
- };
-
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data){
- $("#titlename").html(data.PLAN_NAME_214);
- PLAN_BIAOZHI=data.PLAN_BIAOZHI_214;
- var units = data.UNITS_214_SHOW;
- $("#UNITS1_214_SHOW").html(units);
- var share = data.PLAN_SHARE_214;
- var fb_submit=data.PLAN_STAT_214;
- var sb_submit=data.PLAN_STAT1_214;
- // if(fb_submit=="1"&&sb_submit=="1"){
- // if(share=="1"){
- // $("#submit").hide();
- // $("#submit1").show();
- // }else{
- // $("#submit1").hide();
- // $("#submit").show();
- // }
- // }else{
- $("#submit1").hide();
- $("#submit").hide();
- // }
- var is_units = data.INS_UNITS_214_SHOW;
- $("#INS_UNITS1_214_SHOW").html(is_units);
- for(var i in data){
- $('#'+i).html(data[i]);
- }
- getVersion(sub_fd_id,PLAN_BIAOZHI,data.UPDATEDATE_214);
- getUserInfo(data.ENTERING_214);
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
-
- $('#fileDiv').newAsyncFileUpload("",sub_fd_id,0);
- window.setTimeout("setHeightThis()", 200);
- });
- function getUserInfo(userID){
- var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
- var params = {
- classid : '880',
- objectID : userID
- };
-
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data){
- // var DRILL_LINKMAN =data.REAL_NAME_880;
- var MOBILE = data.MOBILE_880; //手机
- // var COMPANY_ID = data.COMPANY_ID_880_SHOW;//所属单位
- // var ORG_ID = data.ORG_ID_880_SHOW;//所属部门
- // getDeptName(data.ORG_ID_880);
- //
- // $("#DRILL_LINKMAN").html(DRILL_LINKMAN);
- // $("#ORG_ID").html(ORG_ID);
- // $("#COMPANY_ID").html(COMPANY_ID);
- $("#MOBILE").html(MOBILE);
-
- },
- error : function(e){
- top.Dialog.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
- function setHeightThis(){
- $(parent.document.body).find("iframe").height($(window.document.body).height()+150);
- $(parent.parent.document.body).find("iframe").height($(parent.document.body).height()+300);
- }
-
-
- //预案共享
- function share(type){
- sub_fd_id = parent.fd_id;
- //根据预案的ID修改:PLAN_SHARE的状态 sub_fd_id 预案的ID
- //撤销共享
- var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/planShare/';
- var params = {
- planID : sub_fd_id,
- isShare:type
- };
-
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data){
- if(type=="1"){
- top.Dialog.alert("共享成功!");
- window.location.reload();
- }else{
- top.Dialog.alert("撤销成功!");
- window.location.reload();
- }
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
-
- }
- /****************************************预案历史版本展示**************************************************************/
- var g;
- var fileID;
- function getVersion(data,data1,updatetime){
- fileID=data;
- // UPDATEDATE <= '"+updatetime+"' and ((OBJ_FIRST='0' AND FD_OBJECTID='"+ OBJ_FIRST+"') OR (OBJ_FIRST='"+ OBJ_FIRST+"'))
- /**定义变量**/
- var condition = "";
- if(data1=="0"){//版本标志位等于0的时候,没有更多版本。就传当前预案的OBJECTID
- condition = "FD_OBJECTID = '"+data+"' and IS_DEL = '1' ";
- }else{//版本标志位不等于0的时候,有更多的版本,取标志位等于
- condition = " IS_DEL ='1' AND UPDATEDATE <= '"+updatetime+"' AND ((PLAN_BIAOZHI='0' AND FD_OBJECTID='"+ data1+"') OR (PLAN_BIAOZHI='"+ data1+"'))";
- }
- //列表加载参数
- var loadParams = {
- "listId" : '214',
- "condition" : condition,
- direction:'DESC',
- sort: 'UPDATEDATE'
- };
-
-
- /**
- * 工具条
- */
- var roleCons = roleButtonArr();
- var toolBarOpt1 = {
- items:[
- // {text: '下载', click: "onDownload", iconClass: 'download_tem',id:"10007"}
- ],
- roleCons:roleCons
- };
- /**
- * 树形列
- */
- var grid_option1 = {
- columns: [
- { display: '预案名称', name: 'PLAN_NAME_214', align: 'center', width: "10%",isPrimaryKey:true,
- render : function(rowdata, value) {
- return '<a href="javascript:void(0)" '
- + 'onclick=jumpPage("'
- + rowdata.FD_OBJECTID214+'","'+rowdata.PLAN_BIAOZHI_214+'","'+ rowdata.PLAN_REFINE_CATEGORY_214+'","'+ rowdata.PLAN_REFINE_CATEGORY_214+'","'+ rowdata.PLAN_TYPE_214+'")>'+ rowdata.PLAN_NAME_214 +'</a>';
- }
- },
- { 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: 'CHANGE_TYPE_214_SHOW', align: 'center' , width: '10%'},
- //{ display: '适用范围', name: 'SYFW_214', align: 'center', width: '8%'},
- { display: '责任部门', name: 'INS_UNITS_214_SHOW', align: 'center', width: '10%'},
- { display: '颁布日期', name: 'ISSUE_DATE_214', align: 'center' , width: '10%' },
- { display: '实施日期', name: 'TAKE_DATE_214', align: 'center' , width: '10%' },
- { display: '所属单位', name: 'UNITS_214_SHOW', align: 'center', width: '15%' },
- { display: '简要说明', name: 'SYFW_214', align: 'center', width: '15%'}
- // { 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 = '<span class="fashang_07 hand" title="发布" onclick="fabu1()"></span>';
- // }else{
- // fabu = '<span class="fashang_06 hand" title="发布" onclick="fabu(' + rowindex + ')"></span>';
- // }
- // //判断是否已经发布。取发布的状态,如果已经上报为“1”;未上报为“0”fashang_09fashang_plan
- // var shangbao='';
- // if(rowdata.PLAN_STAT1_214=="1"){
- // shangbao = '<span class="sendup_templan hand" title="上报" onclick="shangbao1()"></span>';
- // }else{
- // shangbao = '<span class="fashang_plan hand" title="上报" onclick="shangbao(' + rowindex + ')"></span>';
- // }
- // 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=$("#maingrid1").quickgridAndSingleRecode(options1);
- }
-
-
- //点击查看
- function jumpPage(fd_id1,PLAN_BIAOZHI,BM_YAXHLB,PLAN_REFINE_CATEGORY,PLAN_TYPE){//,UPDATEDATE
- if(fileID==fd_id1){
- top.Dialog.alert("您选择的是本条记录");
- return;
- }
- // alert(fd_id1+","+PLAN_BIAOZHI+","+BM_YAXHLB+","+PLAN_REFINE_CATEGORY+","+PLAN_TYPE);
- // parent.location.href="/nwyj/page/business/am/contingencyPlan/planview.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
- $.indexOpenNextWindow("/nwyj/page/business/am/contingencyPlan/planview.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB);
- // if(PLAN_TYPE!="103"){
- // window.location.href="/nwyj/page/business/am/contingencyPlan/Planinfo.jsp?"+fd_id1 /*+ "?" + UPDATEDATE*/;
- // }else{
- // if(PLAN_REFINE_CATEGORY=="17"){//网络与信息安全
- // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
- // }else if(PLAN_REFINE_CATEGORY=="4"){//人身事故
- // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusRSSG.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
- // }else if(PLAN_REFINE_CATEGORY=="5"){//大面积停电事件
- // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusDMJTD.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
- // }else if(PLAN_REFINE_CATEGORY=="6"){//设备事故
- // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusSBSG.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
- // }else if(PLAN_REFINE_CATEGORY=="7"){//电厂大坝厂房事故
- // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusDCDB.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
- // }else if(PLAN_REFINE_CATEGORY=="8"){//环境污染
- // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusHJWR.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
- // }else if(PLAN_REFINE_CATEGORY=="9"){//防风防汛PlanOnViewList\NewMsgNotice
- // parent.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexus.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
- // }else if(PLAN_REFINE_CATEGORY=="10"){//地震灾害
- // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusDZZH.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
- // }else if(PLAN_REFINE_CATEGORY=="11"){//低温雨雪冰冻灾害
- // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusDWBD.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
- // }else if(PLAN_REFINE_CATEGORY=="12"){//电力供应及客户服务PlanNexusDLGY.jsp
- // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusDLGY.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
- // }else if(PLAN_REFINE_CATEGORY=="13"){//生产场所防恐怖袭击
- // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusKBXJ.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
- // }else if(PLAN_REFINE_CATEGORY=="14"){//突发性群体事件
- // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
- // }else if(PLAN_REFINE_CATEGORY=="15"){//突发新闻事件
- // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
- // }else if(PLAN_REFINE_CATEGORY=="16"){//涉外突发事件
- // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
- // }else if(PLAN_REFINE_CATEGORY=="18"){//突发公共卫生
- // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusGGWS.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
- // }else{
- // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanNexus.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
- // }
- // }
- }
-
-
- //下载
- 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);
- }
-
|