60b4bc1135b08b7db9c6ffa2a361283c5accfe2c.svn-base 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. var fileID;
  2. function init(fd_id,OBJ_FIRST){
  3. fileID=fd_id;
  4. var condition="";
  5. if(OBJ_FIRST=="0"){
  6. condition = "FD_OBJECTID = '"+fd_id+"' and IS_DEL = '1' ";
  7. }else{
  8. condition = " IS_DEL = '1' and ((OBJ_FIRST='0' AND FD_OBJECTID='"+ OBJ_FIRST+"') OR (OBJ_FIRST='"+ OBJ_FIRST+"')) ";
  9. }
  10. var loadParams = {
  11. "listId" : '243',
  12. "condition" : condition,
  13. direction:'DESC',
  14. sort: 'UPDATEDATE'
  15. };
  16. var roleCons = roleButtonArr();
  17. /** grid载入数据* */
  18. var toolBarOpt1 = {
  19. items : [
  20. // {text : '下载',click:"onDownLoad",iconClass: 'download_tem',id:"10007" }
  21. ],
  22. roleCons:roleCons
  23. };
  24. var grid_option1={
  25. columns : [
  26. {display : '法律法规名称', name : 'LAWS_REGULATIONS_NAME_243', align : 'center',width : "15%",isPrimaryKey:true,
  27. render : function(rowdata, value) {
  28. return '<a href="javascript:void(0)" '
  29. + 'onclick=jumpPage("'
  30. + rowdata.FD_OBJECTID243
  31. +'")>'+ rowdata.LAWS_REGULATIONS_NAME_243 +'</a>';
  32. }
  33. },
  34. {display : '颁布机构', name : 'ISSUE_ORGANIZATION_243', align : 'center',width : "15%"},
  35. {display : '颁布文号', name : 'ISSUE_ARTICLE_NUM_243', align : 'center',width : "10%"},
  36. {display : '发布日期', name : 'ISSUE_DATE_243', align : 'center',width : "10%"},
  37. {display : '录入人', name : 'TYPEIN_PEOPLE_243_SHOW', align : 'center',width : "10%"},
  38. // {display : '录入人联系方式', name : 'TYPEIN_PEOPLE_PHONE_NUM_243',align : 'center',width : "15%"},
  39. {display : '实施日期', name : 'IMPLEMENT_DATE_243', align : 'center',width : "10%"} ,
  40. {display : '单位', name : 'UNITE_243_SHOW', align : 'center',width : "10%"} ,
  41. {display : '部门', name : 'DEPT_243_SHOW', align : 'center',width : "10%"} ,
  42. {display : '状态', name : 'STATE_243_SHOW', align : 'center',width : "10%"}
  43. ],
  44. detail: {
  45. //onShowDetail: showFlow,
  46. height: 'auto'
  47. },
  48. pageSize : 10,
  49. rownumbers : true,
  50. checkbox : true,
  51. percentWidthMode : true
  52. };
  53. var options1={
  54. url :'/nwyj/ws/crud/CRUDService/queryQui',
  55. params:loadParams,
  56. width:960,
  57. gridOptions:grid_option1,
  58. singleRecodeOptions:{a:"aa"},
  59. paperOpration:{showInput:"true"},
  60. toolBarOptions:toolBarOpt1
  61. };
  62. g=gridAndSingleRecode=$("#gridtable").quickgridAndSingleRecode(options1);
  63. }
  64. //单击跳转
  65. function jumpPage(fd_id){
  66. if(fileID==fd_id){
  67. top.Dialog.alert("您选择的是本条记录");
  68. return;
  69. }
  70. if((window.location.href).split('?')[2]=="1"){
  71. // $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/laws/laws_info.jsp?"+fd_id+"?1");
  72. $.indexOpenNextWindow("/nwyj/page/business/am/fileManager/laws/laws_info.jsp?"+fd_id+"?1");
  73. }else{
  74. // $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/laws/laws_info.jsp?"+fd_id);
  75. $.indexOpenNextWindow("/nwyj/page/business/am/fileManager/laws/laws_info.jsp?"+fd_id);
  76. }
  77. // window.open("/nwyj/page/business/am/fileManager/laws/laws_info.jsp?"+fd_id);
  78. }
  79. /***********************************************************下载************************************************************/
  80. function onDownLoad(){
  81. var FD_OBJECTID = "";
  82. var rows = g.getSelectedRows();
  83. if(rows.length==0){
  84. top.Dialog.alert("请选择一条记录");
  85. return;
  86. }
  87. for (var i = 0; i < rows.length; i++) {
  88. var FD_OBJECTID1= rows[i].FD_OBJECTID243;//预案的主键
  89. FD_OBJECTID += "'"+FD_OBJECTID1+"'" + ",";//预案的主键(复数)
  90. }
  91. var temp = FD_OBJECTID.substring(0,FD_OBJECTID.length-1);
  92. //发送请求,获取文件名的集合。
  93. var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getPlanFile/';
  94. var params = {
  95. fileId : temp
  96. };
  97. var SAVENAME1="";
  98. var NAME1 = "";
  99. var FILEEXT1="";
  100. $.ajax({
  101. url : url,
  102. type : 'post',
  103. timeout : 60000,
  104. data : params,
  105. dataType : 'json',
  106. success : function(data){
  107. var dataLenth = data.rows.length;
  108. var filenames="";
  109. var downfilename = "";
  110. for (var i = 0; i < dataLenth; i++) {
  111. SAVENAME1= data.rows[i].SAVENAME;
  112. NAME1= data.rows[i].NAME;
  113. FILEEXT1= data.rows[i].FILEEXT;
  114. filenames +=SAVENAME1 + "." + FILEEXT1 + ";";
  115. downfilename+=NAME1 + "." + FILEEXT1 + ";";
  116. }
  117. var filenames1 = filenames.substring(0,filenames.length-1);
  118. filenames = decodeURI(filenames1);
  119. var downfilename1 = downfilename.substring(0,downfilename.length-1);
  120. downfilename = decodeURI(downfilename1);
  121. showFile(filenames1,downfilename1);
  122. //返回回调打包下载的函数,拼传给回调函数的filenames,downfilename
  123. },
  124. error : function(e){
  125. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  126. }
  127. });
  128. }
  129. function showFile(downfilename,filenames){
  130. var url = "/nwyj/page/business/am/org/query/getZipFile.jsp?downfilename="+downfilename+"&filenames="+filenames;
  131. window.open(url);
  132. }
  133. /**************************************************************end***********************************************************/
  134. function fabu(data,data2) {
  135. var fd_id = data+",";
  136. //只能发布自己上传的文件
  137. var userId = data2;
  138. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  139. if(getUser_id!=userId){
  140. top.Dialog.alert("只能发布自己上传的文件!");
  141. return;
  142. }
  143. top.Dialog.confirm("确定要发布吗?|发布", function() {
  144. // 发布规范文件
  145. $.post($.pathname() +"/ws/LAWSPOLL/LawsService/LawsFabu/", {
  146. fd_id : fd_id,
  147. }, function(result) {
  148. if (result.Msg.sucsess == true) {
  149. top.Dialog.alert("发布成功",null,null,null,1);
  150. //跳转到本页
  151. var url = "/nwyj/page/business/am/fileManager/laws/"+"laws_view.jsp?"+data;
  152. top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  153. } else {
  154. top.Dialog.alert("发布失败!");
  155. }
  156. }, "json");
  157. });
  158. };
  159. function share(){
  160. top.Dialog.alert("发布之后才能共享!");
  161. }
  162. function share2(data,data2){
  163. var fd_id = data+",";
  164. //只能共享自己上传的文件
  165. var userId = data2;
  166. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  167. if(getUser_id!=userId){
  168. top.Dialog.alert("只能共享自己上传的文件!");
  169. return;
  170. }
  171. top.Dialog.confirm("确定要共享吗?|共享", function() {
  172. // 发布规范文件
  173. $.post($.pathname() +"/ws/LAWSPOLL/LawsService/LawsShare/", {
  174. fd_id : fd_id,
  175. }, function(result) {
  176. if (result.Msg.sucsess == true) {
  177. top.Dialog.alert("共享成功",null,null,null,1);
  178. //跳转到本页
  179. var url = "/nwyj/page/business/am/fileManager/laws/"+"laws_view.jsp?"+data;
  180. top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  181. } else {
  182. top.Dialog.alert("共享失败!");
  183. }
  184. }, "json");
  185. });
  186. }
  187. function noshare(data,data2){
  188. var fd_id = data+",";
  189. //只能撤销自己上传的文件
  190. var userId = data2;
  191. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  192. if(getUser_id!=userId){
  193. top.Dialog.alert("只能撤销自己上传的文件!");
  194. return;
  195. }
  196. top.Dialog.confirm("确定要撤销共享吗?|撤销", function() {
  197. // 发布规范文件
  198. $.post($.pathname() +"/ws/LAWSPOLL/LawsService/noLawsShare/", {
  199. fd_id : fd_id,
  200. }, function(result) {
  201. if (result.Msg.sucsess == true) {
  202. top.Dialog.alert("撤销成功",null,null,null,1);
  203. //跳转到本页
  204. var url = "/nwyj/page/business/am/fileManager/laws/"+"laws_view.jsp?"+data;
  205. top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  206. } else {
  207. top.Dialog.alert("撤销失败!");
  208. }
  209. }, "json");
  210. });
  211. }