97da00272474b1b0d8ef08d82d91f7039dbe17c6.svn-base 5.6 KB

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