var fileID; function init(fd_id,OBJ_FIRST){ fileID=fd_id; var condition=""; if(OBJ_FIRST=="0"){ condition = "FD_OBJECTID = '"+fd_id+"' and IS_DEL = '1' "; }else{ condition = " IS_DEL = '1' and ((OBJ_FIRST='0' AND FD_OBJECTID='"+ OBJ_FIRST+"') OR (OBJ_FIRST='"+ OBJ_FIRST+"')) "; } var loadParams = { "listId" : '242', "condition" : condition, direction:'DESC', sort: 'UPDATEDATE' }; var roleCons = roleButtonArr(); /** grid载入数据* */ var toolBarOpt1 = { items : [ // {text : '下载',click:"onDownLoad",iconClass: 'download_tem',id:"10007" } ], roleCons:roleCons }; var grid_option1={ columns : [ {display : '标准名称', name : 'STANDARD_NAME_242', align : 'center',width : "15%",isPrimaryKey:true, render : function(rowdata, value) { return ''+ rowdata.STANDARD_NAME_242 +''; } }, {display : '发文单位', name : 'DISPATCH_UNIT_242', align : 'center',width : "15%"}, {display : '标准代号', name : 'STANDARD_CODE_242', align : 'center',width : "10%"}, {display : '印发日期', name : 'PRINT_DATE_242', align : 'center',width : "10%"}, {display : '录入人', name : 'TYPEIN_PEOPLE_242_SHOW', align : 'center',width : "10%"}, // {display : '录入人联系方式', name : 'TYPEIN_PEOPLE_PHONE_NUM_242',align : 'center',width : "15%"}, {display : '录入时间', name : 'TYPEIN_TIME_242', align : 'center',width : "10%"} , {display : '单位', name : 'UNITE_242_SHOW', align : 'center',width : "10%"} , {display : '部门', name : 'DEPT_242_SHOW', align : 'center',width : "10%"} , {display : '状态', name : 'STATE_242_SHOW', align : 'center',width : "10%"} ], detail: { //onShowDetail: showFlow, height: 'auto' }, pageSize : 10, rownumbers : true, checkbox : true, percentWidthMode : true }; var options1={ url :'/nwyj/ws/crud/CRUDService/queryQui', params:loadParams, width:960, gridOptions:grid_option1, singleRecodeOptions:{a:"aa"}, paperOpration:{showInput:"true"}, toolBarOptions:toolBarOpt1 }; g=gridAndSingleRecode=$("#gridtable").quickgridAndSingleRecode(options1); } //单击跳转 function jumpPage(fd_id){ if(fileID==fd_id){ top.Dialog.alert("您选择的是本条记录"); return; } if((window.location.href).split('?')[2]=="1"){ // $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/standard/standard_info.jsp?"+fd_id+"?1"); $.indexOpenNextWindow("/nwyj/page/business/am/fileManager/standard/standard_info.jsp?"+fd_id+"?1"); }else{ // $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/standard/standard_info.jsp?"+fd_id); $.indexOpenNextWindow("/nwyj/page/business/am/fileManager/standard/standard_info.jsp?"+fd_id); } } /***********************************************************下载************************************************************/ function onDownLoad(){ var FD_OBJECTID = ""; var rows = g.getSelectedRows(); if(rows.length==0){ top.Dialog.alert("请选择一条记录"); return; } for (var i = 0; i < rows.length; i++) { var FD_OBJECTID1= rows[i].FD_OBJECTID242;//预案的主键 FD_OBJECTID += "'"+FD_OBJECTID1+"'" + ",";//预案的主键(复数) } var temp = FD_OBJECTID.substring(0,FD_OBJECTID.length-1); //发送请求,获取文件名的集合。 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); //返回回调打包下载的函数,拼传给回调函数的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); } /**************************************************************end***********************************************************/ function fabu(data,data2) { var fd_id = data+","; //只能发布自己上传的文件 var userId = data2; var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id(); if(getUser_id!=userId){ top.Dialog.alert("只能发布自己上传的文件!"); return; } top.Dialog.confirm("确定要发布吗?|发布", function() { // 发布规范文件 $.post($.pathname() +"/ws/STANDARDPOLL/StandardService/StandardFabu/", { fd_id : fd_id, }, function(result) { if (result.Msg.sucsess == true) { top.Dialog.alert("发布成功",null,null,null,1); //跳转到本页 var url = "/nwyj/page/business/am/fileManager/standard/"+"standard_view.jsp?"+data; top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url)); } else { top.Dialog.alert("发布失败!"); } }, "json"); }); }; function share(){ top.Dialog.alert("发布之后才能共享!"); } function share2(data,data2){ var fd_id = data+","; //只能共享自己上传的文件 var userId = data2; var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id(); if(getUser_id!=userId){ top.Dialog.alert("只能共享自己上传的文件!"); return; } top.Dialog.confirm("确定要共享吗?|共享", function() { // 发布规范文件 $.post($.pathname() +"/ws/STANDARDPOLL/StandardService/StandardShare/", { fd_id : fd_id, }, function(result) { if (result.Msg.sucsess == true) { top.Dialog.alert("共享成功",null,null,null,1); //跳转到本页 var url = "/nwyj/page/business/am/fileManager/standard/"+"standard_view.jsp?"+data; top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url)); } else { top.Dialog.alert("共享失败!"); } }, "json"); }); } function noshare(data,data2){ var fd_id = data+","; //只能撤销自己上传的文件 var userId = data2; var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id(); if(getUser_id!=userId){ top.Dialog.alert("只能撤销自己上传的文件!"); return; } top.Dialog.confirm("确定要撤销共享吗?|撤销", function() { // 发布规范文件 $.post($.pathname() +"/ws/STANDARDPOLL/StandardService/noStandardShare/", { fd_id : fd_id, }, function(result) { if (result.Msg.sucsess == true) { top.Dialog.alert("撤销成功",null,null,null,1); //跳转到本页 var url = "/nwyj/page/business/am/fileManager/standard/"+"standard_view.jsp?"+data; top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url)); } else { top.Dialog.alert("撤销失败!"); } }, "json"); }); }