$(function(){ $searchOne = $("#searchOne");//查询图标绑定查询事件 $searchOne.bind('click', function() { searchHandler(); }); }); var g; var condition=" IS_DEL='0' and COLUMN_4='1' "; //列表加载参数 var loadParams = { "listId" : '242', "condition" : condition, direction:'DESC', sort: 'UPDATEDATE' }; function initComplete(){ 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%",showTitle:true}, {display : '标准代号', name : 'STANDARD_CODE_242', align : 'center',width : "10%",showTitle:true}, {display : '印发日期', name : 'PRINT_DATE_242', align : 'center',width : "10%",showTitle:true}, {display : '录入人', name : 'TYPEIN_PEOPLE_242_SHOW', align : 'center',width : "10%",showTitle:true}, // {display : '录入人联系方式', name : 'TYPEIN_PEOPLE_PHONE_NUM_242',align : 'center',width : "15%",showTitle:true}, {display : '录入时间', name : 'TYPEIN_TIME_242', align : 'center',width : "10%",showTitle:true} , {display : '单位', name : 'UNITE_242_SHOW', align : 'center',width : "10%",showTitle:true} , {display : '部门', name : 'DEPT_242_SHOW', align : 'center',width : "10%",showTitle:true} , {display : '状态', name : 'STATE_242_SHOW', align : 'center',width : "10%",showTitle:true} ], 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=$("#maingrid").quickgridAndSingleRecode(options1); } //单击跳转 function jumpPage(fd_id){ // $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/standard/standard_view.jsp?"+fd_id+"?1"); $.indexOpenNextWindow("/nwyj/page/business/am/fileManager/standard/standard_view.jsp?"+fd_id+"?1"); } /***********************************************************下载************************************************************/ 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 searchHandler() { var title = $('#STANDARD_NAME_242').val();//标题 var condition = "IS_DEL='0' and COLUMN_4='1'"; if(title!=""&&title!="技术标准"){ condition += " AND STANDARD_NAME LIKE '%" +title+"%'"; } g.setOptions({// 重置加载列表的参数 params : { "listId" : '242', "condition" : condition, direction:'DESC', sort: 'UPDATEDATE' } }); g.rend(); }