be4621f4663797b4ac08cbdfa29b33b356597896.svn-base 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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" : '241',
  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 : 'DOCUMENT_NAME_241', align : 'center',width : "15%",isPrimaryKey:true,
  27. render : function(rowdata, value) {
  28. return '<a href="javascript:void(0)" '
  29. + 'onclick=jumpPage("'
  30. + rowdata.FD_OBJECTID241
  31. +'")>'+ rowdata.DOCUMENT_NAME_241 +'</a>';
  32. }
  33. },
  34. {display : '发文单位', name : 'DISPATCH_UNIT_241', align : 'center',width : "15%"},
  35. {display : '字号/编号/代号', name : 'DISPATCH_WORD_SIZE_241', align : 'center',width : "15%"},
  36. {display : '印发/发布日期', name : 'PRINT_DATE_241', align : 'center',width : "15%"},
  37. {display : '录入人', name : 'TYPEIN_PEOPLE_241_SHOW', align : 'center',width : "10%"},
  38. // {display : '录入人联系方式', name : 'TYPEIN_PEOPLE_PHONE_NUM_241',align : 'center',width : "15%"},
  39. {display : '录入时间', name : 'TYPEIN_TIME_241', align : 'center',width : "10%"} ,
  40. {display : '单位', name : 'UNITE_241_SHOW', align : 'center',width : "10%"} ,
  41. {display : '部门', name : 'DEPT_241_SHOW', align : 'center',width : "10%"} ,
  42. {display : '状态', name : 'STATE_241_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/document/document_info.jsp?"+fd_id+"?1");
  72. $.indexOpenNextWindow("/nwyj/page/business/am/fileManager/document/document_info.jsp?"+fd_id+"?1");
  73. }else{
  74. // $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/document/document_info.jsp?"+fd_id);
  75. $.indexOpenNextWindow("/nwyj/page/business/am/fileManager/document/document_info.jsp?"+fd_id);
  76. }
  77. }
  78. /***********************************************************下载************************************************************/
  79. function onDownLoad(){
  80. var FD_OBJECTID = "";
  81. var rows = g.getSelectedRows();
  82. if(rows.length==0){
  83. top.Dialog.alert("请选择一条记录");
  84. return;
  85. }
  86. for (var i = 0; i < rows.length; i++) {
  87. var FD_OBJECTID1= rows[i].FD_OBJECTID241;//预案的主键
  88. FD_OBJECTID += "'"+FD_OBJECTID1+"'" + ",";//预案的主键(复数)
  89. }
  90. var temp = FD_OBJECTID.substring(0,FD_OBJECTID.length-1);
  91. //发送请求,获取文件名的集合。
  92. var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getPlanFile/';
  93. var params = {
  94. fileId : temp
  95. };
  96. var SAVENAME1="";
  97. var NAME1 = "";
  98. var FILEEXT1="";
  99. $.ajax({
  100. url : url,
  101. type : 'post',
  102. timeout : 60000,
  103. data : params,
  104. dataType : 'json',
  105. success : function(data){
  106. var dataLenth = data.rows.length;
  107. var filenames="";
  108. var downfilename = "";
  109. for (var i = 0; i < dataLenth; i++) {
  110. SAVENAME1= data.rows[i].SAVENAME;
  111. NAME1= data.rows[i].NAME;
  112. FILEEXT1= data.rows[i].FILEEXT;
  113. filenames +=SAVENAME1 + "." + FILEEXT1 + ";";
  114. downfilename+=NAME1 + "." + FILEEXT1 + ";";
  115. }
  116. var filenames1 = filenames.substring(0,filenames.length-1);
  117. filenames = decodeURI(filenames1);
  118. var downfilename1 = downfilename.substring(0,downfilename.length-1);
  119. downfilename = decodeURI(downfilename1);
  120. showFile(filenames1,downfilename1);
  121. //返回回调打包下载的函数,拼传给回调函数的filenames,downfilename
  122. },
  123. error : function(e){
  124. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  125. }
  126. });
  127. }
  128. function showFile(downfilename,filenames){
  129. var url = "/nwyj/page/business/am/org/query/getZipFile.jsp?downfilename="+downfilename+"&filenames="+filenames;
  130. window.open(url);
  131. }
  132. /**************************************************************end***********************************************************/
  133. function fabu(data,data2) {
  134. var fd_id = data+",";
  135. //只能发布自己上传的文件
  136. var userId = data2;
  137. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  138. if(getUser_id!=userId){
  139. top.Dialog.alert("只能发布自己上传的文件!");
  140. return;
  141. }
  142. top.Dialog.confirm("确定要发布吗?|发布", function() {
  143. // 发布规范文件
  144. $.post($.pathname() +"/ws/DOCUPOLL/DocService/DocuFabu/", {
  145. fd_id : fd_id,
  146. }, function(result) {
  147. if (result.Msg.sucsess == true) {
  148. top.Dialog.alert("发布成功",null,null,null,1);
  149. //跳转到本页
  150. var url = "/nwyj/page/business/am/fileManager/document/"+"document_view.jsp?"+data;
  151. top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  152. } else {
  153. top.Dialog.alert("发布失败!");
  154. }
  155. }, "json");
  156. });
  157. };
  158. function share(){
  159. top.Dialog.alert("发布之后才能共享!");
  160. }
  161. function share2(data,data2){
  162. var fd_id = data+",";
  163. //只能共享自己上传的文件
  164. var userId = data2;
  165. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  166. if(getUser_id!=userId){
  167. top.Dialog.alert("只能共享自己上传的文件!");
  168. return;
  169. }
  170. top.Dialog.confirm("确定要共享吗?|共享", function() {
  171. // 发布规范文件
  172. $.post($.pathname() +"/ws/DOCUPOLL/DocService/DocuShare/", {
  173. fd_id : fd_id,
  174. }, function(result) {
  175. if (result.Msg.sucsess == true) {
  176. top.Dialog.alert("共享成功",null,null,null,1);
  177. //跳转到本页
  178. var url = "/nwyj/page/business/am/fileManager/document/"+"document_view.jsp?"+data;
  179. top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  180. } else {
  181. top.Dialog.alert("共享失败!");
  182. }
  183. }, "json");
  184. });
  185. }
  186. function noshare(data,data2){
  187. var fd_id = data+",";
  188. //只能撤销自己上传的文件
  189. var userId = data2;
  190. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  191. if(getUser_id!=userId){
  192. top.Dialog.alert("只能撤销自己上传的文件!");
  193. return;
  194. }
  195. top.Dialog.confirm("确定要撤销共享吗?|撤销", function() {
  196. // 发布规范文件
  197. $.post($.pathname() +"/ws/DOCUPOLL/DocService/noDocuShare/", {
  198. fd_id : fd_id,
  199. }, function(result) {
  200. if (result.Msg.sucsess == true) {
  201. top.Dialog.alert("撤销成功",null,null,null,1);
  202. //跳转到本页
  203. var url = "/nwyj/page/business/am/fileManager/document/"+"document_view.jsp?"+data;
  204. top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
  205. } else {
  206. top.Dialog.alert("撤销失败!");
  207. }
  208. }, "json");
  209. });
  210. }