123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- $(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 '<a href="javascript:void(0)" '
- +'title='+rowdata.STANDARD_NAME_242
- + ' onclick=jumpPage("'
- + rowdata.FD_OBJECTID242
- +'")>'+ rowdata.STANDARD_NAME_242 +'</a>';
- }
- },
- {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();
- }
|