fc6c0c605c4e9e23dd85a89d98504dc46654826f.svn-base 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. $(function(){
  2. $searchOne = $("#searchOne");//查询图标绑定查询事件
  3. $searchOne.bind('click', function() {
  4. searchHandler();
  5. });
  6. });
  7. var g;
  8. var condition=" IS_DEL='0' and COLUMN_4='1' ";
  9. //列表加载参数
  10. var loadParams = {
  11. "listId" : '242',
  12. "condition" : condition,
  13. direction:'DESC',
  14. sort: 'UPDATEDATE'
  15. };
  16. function initComplete(){
  17. var roleCons = roleButtonArr();
  18. /** grid载入数据* */
  19. var toolBarOpt1 = {
  20. items : [
  21. // {text : '下载',click:"onDownLoad",iconClass: 'download_tem',id:"10007" }
  22. ],
  23. roleCons:roleCons
  24. };
  25. var grid_option1={
  26. columns : [
  27. {display : '标准名称', name : 'STANDARD_NAME_242', align : 'center',width : "15%",isPrimaryKey:true,
  28. render : function(rowdata, value) {
  29. return '<a href="javascript:void(0)" '
  30. +'title='+rowdata.STANDARD_NAME_242
  31. + ' onclick=jumpPage("'
  32. + rowdata.FD_OBJECTID242
  33. +'")>'+ rowdata.STANDARD_NAME_242 +'</a>';
  34. }
  35. },
  36. {display : '发文单位', name : 'DISPATCH_UNIT_242', align : 'center',width : "15%",showTitle:true},
  37. {display : '标准代号', name : 'STANDARD_CODE_242', align : 'center',width : "10%",showTitle:true},
  38. {display : '印发日期', name : 'PRINT_DATE_242', align : 'center',width : "10%",showTitle:true},
  39. {display : '录入人', name : 'TYPEIN_PEOPLE_242_SHOW', align : 'center',width : "10%",showTitle:true},
  40. // {display : '录入人联系方式', name : 'TYPEIN_PEOPLE_PHONE_NUM_242',align : 'center',width : "15%",showTitle:true},
  41. {display : '录入时间', name : 'TYPEIN_TIME_242', align : 'center',width : "10%",showTitle:true} ,
  42. {display : '单位', name : 'UNITE_242_SHOW', align : 'center',width : "10%",showTitle:true} ,
  43. {display : '部门', name : 'DEPT_242_SHOW', align : 'center',width : "10%",showTitle:true} ,
  44. {display : '状态', name : 'STATE_242_SHOW', align : 'center',width : "10%",showTitle:true}
  45. ],
  46. detail: {
  47. //onShowDetail: showFlow,
  48. height: 'auto'
  49. },
  50. pageSize : 10,
  51. rownumbers : true,
  52. checkbox : true,
  53. percentWidthMode : true
  54. };
  55. var options1={
  56. url :'/nwyj/ws/crud/CRUDService/queryQui',
  57. params:loadParams,
  58. width:960,
  59. gridOptions:grid_option1,
  60. singleRecodeOptions:{a:"aa"},
  61. paperOpration:{showInput:"true"},
  62. toolBarOptions:toolBarOpt1
  63. };
  64. g=gridAndSingleRecode=$("#maingrid").quickgridAndSingleRecode(options1);
  65. }
  66. //单击跳转
  67. function jumpPage(fd_id){
  68. // $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/standard/standard_view.jsp?"+fd_id+"?1");
  69. $.indexOpenNextWindow("/nwyj/page/business/am/fileManager/standard/standard_view.jsp?"+fd_id+"?1");
  70. }
  71. /***********************************************************下载************************************************************/
  72. function onDownLoad(){
  73. var FD_OBJECTID = "";
  74. var rows = g.getSelectedRows();
  75. if(rows.length==0){
  76. top.Dialog.alert("请选择一条记录");
  77. return;
  78. }
  79. for (var i = 0; i < rows.length; i++) {
  80. var FD_OBJECTID1= rows[i].FD_OBJECTID242;//预案的主键
  81. FD_OBJECTID += "'"+FD_OBJECTID1+"'" + ",";//预案的主键(复数)
  82. }
  83. var temp = FD_OBJECTID.substring(0,FD_OBJECTID.length-1);
  84. //发送请求,获取文件名的集合。
  85. var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getPlanFile/';
  86. var params = {
  87. fileId : temp
  88. };
  89. var SAVENAME1="";
  90. var NAME1 = "";
  91. var FILEEXT1="";
  92. $.ajax({
  93. url : url,
  94. type : 'post',
  95. timeout : 60000,
  96. data : params,
  97. dataType : 'json',
  98. success : function(data){
  99. var dataLenth = data.rows.length;
  100. var filenames="";
  101. var downfilename = "";
  102. for (var i = 0; i < dataLenth; i++) {
  103. SAVENAME1= data.rows[i].SAVENAME;
  104. NAME1= data.rows[i].NAME;
  105. FILEEXT1= data.rows[i].FILEEXT;
  106. filenames +=SAVENAME1 + "." + FILEEXT1 + ";";
  107. downfilename+=NAME1 + "." + FILEEXT1 + ";";
  108. }
  109. var filenames1 = filenames.substring(0,filenames.length-1);
  110. filenames = decodeURI(filenames1);
  111. var downfilename1 = downfilename.substring(0,downfilename.length-1);
  112. downfilename = decodeURI(downfilename1);
  113. showFile(filenames1,downfilename1);
  114. //返回回调打包下载的函数,拼传给回调函数的filenames,downfilename
  115. },
  116. error : function(e){
  117. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  118. }
  119. });
  120. }
  121. function showFile(downfilename,filenames){
  122. var url = "/nwyj/page/business/am/org/query/getZipFile.jsp?downfilename="+downfilename+"&filenames="+filenames;
  123. window.open(url);
  124. }
  125. /**************************************************************end***********************************************************/
  126. //查询
  127. function searchHandler() {
  128. var title = $('#STANDARD_NAME_242').val();//标题
  129. var condition = "IS_DEL='0' and COLUMN_4='1'";
  130. if(title!=""&&title!="技术标准"){
  131. condition += " AND STANDARD_NAME LIKE '%" +title+"%'";
  132. }
  133. g.setOptions({// 重置加载列表的参数
  134. params : {
  135. "listId" : '242',
  136. "condition" : condition,
  137. direction:'DESC',
  138. sort: 'UPDATEDATE'
  139. }
  140. });
  141. g.rend();
  142. }