a01a59404c0d6b4bf10ab28c5e65153fc4ecfac8.svn-base 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760
  1. //单位ID
  2. var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  3. //取得用户真实姓名
  4. var realname = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
  5. //获取用户的Id
  6. var userId = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  7. //登陆用户的单位名称
  8. var corp_name = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
  9. //父部门id
  10. var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
  11. //登录人ID
  12. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+"";
  13. $(function(){
  14. /* //下拉框加载
  15. $("#FILE_CLASSIFY_230").initCanstSelect('BM_FILE_CLASSIFY');
  16. $('#CHANGE_TYPE_230').initCanstSelect('BM_CHANGETYPE');
  17. /** 绑定更多的按钮点击事件 */
  18. $more = $("#more"); // 更多按钮
  19. $more.bind('click', function() {
  20. more();
  21. });
  22. $searchButt = $("#searchButt");// 更多查询按钮
  23. $searchButt.live('click', function() {
  24. searchHandler();
  25. });
  26. $searchOne = $("#searchOne");//查询图标绑定查询事件
  27. $searchOne.bind('click', function() {
  28. searchHandler();
  29. });
  30. //清空条件
  31. $("#emptyCondition").bind("click",function(){
  32. $("#FILE_TITLE_230").val("");
  33. var $selConditions = $("#selectConditions");
  34. var $selCon = $selConditions.find(".selectCondi");
  35. for(var i=0;i<$selCon.length;i++){
  36. $selCon[i].click();
  37. }
  38. });
  39. });
  40. //没有发布的文件别人不能看
  41. var g;
  42. //列表加载参数
  43. /* var condition = "IS_DEL='0' and ( PIGEONHOLE_MAN_ID='"+userId+"' or FABU='1')";*/
  44. var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  45. var condition = "IS_DEL='0' and (FABU='1' or SHANGBAO='1' or PIGEONHOLE_MAN_ID='"+ getUser_id +"') and (PUBLISH_COMP_ID='"+deptId+"' or PUBLISH_COMP_ID IN(SELECT A.ID FROM EMC_AM_ORG_DEPARTMENT_TEST A WHERE A.PARENT_ID='"+deptId+"'))";
  46. //这个sql是对着的。
  47. //var condition = "IS_DEL='0' and (FABU='1' or SHANGBAO='1' or PIGEONHOLE_MAN_ID='"+ getUser_id +"') and PUBLISH_COMP_ID='"+deptId+"'";
  48. var loadParams = {
  49. "listId" : '230',
  50. "condition" : condition,
  51. direction:'DESC',
  52. sort: 'UPDATEDATE'
  53. };
  54. //初始化列表
  55. function initComplete(){
  56. //双视图不支持getRow()取行号的方法。
  57. /**
  58. * 工具条
  59. */
  60. var roleCons = roleButtonArr();
  61. var toolBarOpt1 = {
  62. items : [ { text: '新增' ,click:"onAdd",iconClass: 'add1_tem' ,id:"10000"},//OK
  63. { text: '删除' ,click:"onDelete",iconClass: 'delete_tem' , id:"10002"},
  64. { text: '修改' ,click:"onEdit",iconClass: 'update_tem',id:"10001"},
  65. { text: '查看' ,click:"onView",iconClass: 'view_tem' , id:"10003"},
  66. { text: '历史版本' ,click:"onViewHistory",iconClass: 'history_tem',id:"10201" },
  67. //{ text: '导入' ,click:"onImport",iconClass: 'import_tem',id:"10004"},
  68. { text: '导出' ,click:"exportTotalData",iconClass: 'export_tem',id:"10006"},
  69. { text: '下载' ,click:"onDownLoad",iconClass: 'download_tem',id:"10007" },
  70. { text: '汇总统计', click: "sumUnit", iconClass: 'poll_tem' ,id:"10200"},
  71. { text: '共享', click: "publicShare", iconClass: 'share_tem' ,id:"10200"}],
  72. roleCons:roleCons
  73. };
  74. /**
  75. * 树形列
  76. */
  77. var grid_option1 = {
  78. columns: [
  79. // {name : 'FD_OBJECTID',hide : true},
  80. {display : '文件标题',name : 'FILE_TITLE_230', align : 'center',width : '20%',isPrimaryKey:true,
  81. render : function(rowdata, value) {
  82. return '<a href="javascript:void(0)" '
  83. + 'onclick=jumpPage("'
  84. + rowdata.FD_OBJECTID230
  85. +'")>'+ rowdata.FILE_TITLE_230 +'</a>';
  86. }
  87. },
  88. {display : '文件分类',name : 'FILE_CLASSIFY_230_SHOW', align : 'center',width : '10%'},
  89. // {display : '发布状态',name : 'FILE_STATUS_230_SHOW', align : 'center',width : '10%'},
  90. // {display : '上报状态',name : 'SHANGBAO_230_SHOW', align : 'center',width : '10%'},
  91. {display : '发文日期',name : 'FILE_ADD_DATE_230', align : 'center',width : '10%'},
  92. {display : '归档人',name : 'PIGEONHOLE_MAN_ID_230_SHOW', align : 'center',width : '10%'},
  93. {display : '归档日期',name : 'PIGEONHOLE_DATE_230', align : 'center',width : '10%'},
  94. {display : '变更说明',name : 'CHANGE_DETAIL_230', align : 'center',width : '10%'},
  95. {display : '变更类型',name : 'CHANGE_TYPE_230_SHOW', align : 'center',width : '10%'},
  96. {display : '文件摘要',name : 'FILE_CONTENT_230', align : 'center',width : '10%'},
  97. { display: '操作', isAllowHide: false, align: 'center', width:'10%',
  98. render: function (rowdata, rowindex, value, column){
  99. //判断是否已经发布。取发布的状态,如果已经发布为“1”;未发布为“0”
  100. var fabu='';//fabu
  101. if(rowdata.FABU_230=="1"){
  102. fabu = '<span class="fashang_07 hand" title="发布" onclick="onPublish1()"></span>';
  103. }else{
  104. fabu = '<span class="fashang_06 hand" title="发布" onclick="onPublish(' + rowindex + ')"></span>';
  105. }
  106. //判断是否已经发布。取发布的状态,如果已经上报为“1”;未上报为“0”fashang_09 sendup_templan
  107. var shangbao='';
  108. if(rowdata.SHANGBAO_230=="1"){
  109. shangbao = '<span class="sendup_templan hand" title="上报" onclick="shangbao1()"></span>';
  110. }else{
  111. shangbao = '<span class="fashang_plan hand" title="上报" onclick="onReport(' + rowindex + ')"></span>';
  112. }
  113. return fabu
  114. + shangbao;
  115. }
  116. }
  117. ],
  118. rownumbers : true,
  119. checkbox : true,
  120. width:"100%",
  121. pageSize : 10,
  122. percentWidthMode : true
  123. };
  124. var options1={
  125. url :'/nwyj/ws/crud/CRUDService/queryQui',
  126. params:loadParams,
  127. gridOptions:grid_option1,
  128. singleRecodeOptions:{a:"aa"},
  129. paperOpration:{showInput:"true"},
  130. toolBarOptions:toolBarOpt1
  131. };
  132. g=gridAndSingleRecode=$("#maingrid").quickgridAndSingleRecode(options1);
  133. }
  134. function onPublish1(){
  135. top.Dialog.alert("该文件已经发布!");
  136. }
  137. function shangbao1(){
  138. top.Dialog.alert("该文件已经上报!");
  139. }
  140. //点击查看
  141. function jumpPage(id){
  142. window.location.href="FileAMInfo.jsp?"+id;
  143. }
  144. //导出
  145. function exportTotalData(){
  146. var rows = g.getSelectedRows();
  147. var rowsLength = rows.length;
  148. if (rowsLength == 0) {
  149. top.Dialog.confirm("是否导出所有的文件信息?|是", function() {
  150. excelExport(230,loadParams,"应急制度文件信息",['IS_DEL','UPDATEDATE','FD_OBJECTID','COLUMN_1','COLUMN_2','COLUMN_3','COLUMN_4','SHANGBAO','FABU','VERSION_ID','FILE_STATUS','PUBLISH_COMP_ID','REPORT_COMP_ID']);
  151. });
  152. return;
  153. }
  154. var ids = "";
  155. for ( var i = 0; i < rowsLength; i++) {
  156. ids += "'"+rows[i].FD_OBJECTID230+"'" + ",";
  157. }
  158. var temp = ids.substring(0,ids.length-1);
  159. // alert(temp);
  160. var condition = " IS_DEL='0' ";
  161. condition += " AND FD_OBJECTID IN (" + temp + ") " ; //'%" +name+"%';
  162. var sql = {
  163. "listId" :'230' ,
  164. "condition" : condition,
  165. direction:'DESC',
  166. sort: 'UPDATEDATE'
  167. };
  168. excelExport(230,sql,"应急制度文件信息",['IS_DEL','UPDATEDATE','FD_OBJECTID','COLUMN_1','COLUMN_2','COLUMN_3','COLUMN_4','SHANGBAO','FABU','VERSION_ID','FILE_STATUS','PUBLISH_COMP_ID','REPORT_COMP_ID']);
  169. }
  170. //查询
  171. //function searchHandler() {
  172. // var title = $('#FILE_TITLE_230').val();//标题
  173. // var classify = $('#FILE_CLASSIFY_230').val();//分类
  174. // var type = $('#CHANGE_TYPE_230').val();//更新类别
  175. // //时间区间
  176. // var date1 = $('#DATE1').val();
  177. // var date2 = $('#DATE2').val();
  178. //// var condition = "IS_DEL='0' and PUBLISH_COMP_ID='"+dpids+"'";
  179. // var condition = "IS_DEL='0' and ( PIGEONHOLE_MAN_ID='"+userId+"' or FABU='1')";
  180. //
  181. // if(title!=""&&title!="请输入文件名称"){
  182. // condition += " AND FILE_TITLE LIKE '%" +title+"%'";
  183. // }
  184. // if(classify!=""){
  185. // condition += " AND FILE_CLASSIFY = '" + classify + "' ";
  186. // }
  187. // if(type!=""){
  188. // condition += " AND CHANGE_TYPE = '" + type + "' ";
  189. // }
  190. // //日期
  191. // if(date1!="" && date2!=""){
  192. // condition += " AND FILE_ADD_DATE BETWEEN '" + date1 +"' AND '" + date2 + "' ";
  193. // }
  194. // if(date1!="" && date2==""){
  195. // condition += " AND FILE_ADD_DATE >= '" + date1 +"' " ;
  196. // }
  197. // if(date1=="" && date2!=""){
  198. // condition += " AND FILE_ADD_DATE <= '" + date2 + "' ";
  199. // }
  200. // //PUBLISH_COMP_ID='"+dpids+"
  201. //
  202. // g.setOptions({// 重置加载列表的参数
  203. // params : {
  204. // "listId" : '230',
  205. // "condition" : condition
  206. // }
  207. // });
  208. // g.rend();
  209. //
  210. //}
  211. function searchHandler(){
  212. $queryForm = $("#queryForm");
  213. if($("#FILE_TITLE_230").val()=="请输入文件名称"){
  214. $("#FILE_TITLE_230").val("");
  215. }
  216. $queryForm.serialize();
  217. //获取选中的值
  218. var searchCondition = getSelectCon(conditionData);
  219. var queryParams = getQueryFormParams($queryForm);
  220. var params=$.extend({},loadParams,queryParams);
  221. //与之前参数条件拼接
  222. params.condition = searchCondition.condition + params.condition;
  223. g.setOptions({"params":params});
  224. //加载数据
  225. g.rend();
  226. }
  227. //新增
  228. function onAdd(){
  229. window.location.href="FileAMAdd.jsp";
  230. }
  231. //删除
  232. function onDelete(){
  233. var rows = g.getSelectedRows();
  234. var rowsLength = rows.length;
  235. if (rowsLength == 0) {
  236. top.Dialog.alert("请选中要删除的记录!");
  237. return;
  238. }
  239. var ids = "";
  240. for ( var i = 0; i < rowsLength; i++) {
  241. ids += rows[i].FD_OBJECTID230 + ",";
  242. if(rows[i].FABU_230=="1"||rows[i].SHANGBAO_230=="1"){
  243. if(rows[i].FABU_230=="1"){
  244. top.Dialog.alert("您选中的文件已经发布!");
  245. }else if(rows[i].SHANGBAO_230){
  246. top.Dialog.alert("您选中的文件已经上报!");
  247. }
  248. return;
  249. }
  250. if(rows[i].PIGEONHOLE_MAN_ID_230!=userId){
  251. top.Dialog.alert("只能刪除自己上传的文件!");
  252. return;
  253. }
  254. }
  255. top.Dialog.confirm("确定要删除吗?|删除", function() {
  256. // 删除记录
  257. $.post($.pathname() +"/ws/crud/CRUDService/delete/", {
  258. "objectIDs" : ids,
  259. classid : 230
  260. }, function(result) {
  261. if (result.Msg.sucsess == true) {
  262. $.messager.alert("删除成功",null,null,null,-1);
  263. // 刷新表格数据
  264. g.rend();
  265. } else {
  266. top.Dialog.alert("删除失败!");
  267. }
  268. }, "json");
  269. });
  270. }
  271. //修改
  272. function onEdit(){
  273. var rows = g.getSelectedRows();
  274. if (rows.length == 0) {
  275. top.Dialog.alert("请选择一条记录");
  276. return;
  277. }
  278. if (rows.length > 1) {
  279. top.Dialog.alert("只能选择一条记录");
  280. return;
  281. }
  282. //只能修改自己上传的文件
  283. var userId = rows[0].PIGEONHOLE_MAN_ID_230;
  284. if(userId!=getUser_id){
  285. top.Dialog.alert("只能修改自己上传的文件!");
  286. return;
  287. }
  288. //上报或发布的不能修改
  289. var shangbao = rows[0].SHANGBAO_230;
  290. var fabu = rows[0].FABU_230;
  291. if(shangbao=="1"){
  292. top.Dialog.alert("发布的文件不能修改!");
  293. return;
  294. }else if(fabu=="1"){
  295. top.Dialog.alert("上报的文件不能修改!");
  296. return;
  297. }
  298. var fd_id = rows[0].FD_OBJECTID230;
  299. window.location.href="FileAMEdit.jsp?"+fd_id;
  300. //var url = "FileAMEdit.jsp?"+fd_id;
  301. // window.parent.document.getElementById("iframeChild2").setAttribute("src", "/nwyj/page/business/am/file/"+url);
  302. };
  303. //查看详情
  304. function onView(){
  305. var rows = g.getSelectedRows();
  306. if (rows.length == 0) {
  307. top.Dialog.alert("请选择一个规范文件");
  308. return;
  309. }
  310. if (rows.length > 1) {
  311. top.Dialog.alert("只能选择一个规范文件");
  312. return;
  313. }
  314. var fd_id = rows[0].FD_OBJECTID230;
  315. var fd_id1 = rows[0].COLUMN_1_230;
  316. $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/file/FileAMInfo.jsp?"+fd_id+"?"+fd_id1);
  317. // window.parent.document.getElementById("iframeChild2").setAttribute("src", "/nwyj/page/business/am/file/"+url);
  318. }
  319. //上报
  320. function onReport(data){
  321. var row = g.getRow(data);
  322. var fd_id = row.FD_OBJECTID230;
  323. //只能上报自己上传的文件
  324. var userId = row.PIGEONHOLE_MAN_ID_230;
  325. if(getUser_id!=userId){
  326. top.Dialog.alert("只能上报自己上传的文件!");
  327. return;
  328. }
  329. top.Dialog.confirm("确定要上报吗?|上报", function() {
  330. // 上报
  331. $.post($.pathname() +"/ws/EmcPlan/EmgencyPlanService/fileShangbao/", {
  332. //当前单位id
  333. comp_id : dpids,
  334. fd_id : fd_id,
  335. }, function(result) {
  336. if (result.Msg.sucsess == true) {
  337. $.messager.alert("上报成功",null,null,null,-1);
  338. //推送消息
  339. fillShangbao(data);
  340. // 刷新表格数据
  341. g.rend();
  342. } else {
  343. top.Dialog.alert("上报失败!");
  344. }
  345. }, "json");
  346. });
  347. }
  348. //上报前先给上级单位公共消息库里插入一条记录
  349. /**
  350. * 1、取本级单位ID
  351. * 2、上报人ID
  352. * 3、上报消息主键
  353. * 4、服务名称(URL)
  354. **/
  355. function fillShangbao(data){
  356. var row = g.getRow(data);
  357. var fd_id = row.FD_OBJECTID230;
  358. //向后台发送请求调用dwr
  359. var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/sendMsgDwr/';
  360. var msg = "<a href=\"javascript:void(0)\" onclick=\"openY('/nwyj/page/business/am/public/FileAMInfo.jsp?"+fd_id+"')\">"+corp_name+"的日常制度文件</a>";
  361. //var msg = "<a href=\"javascript:void(0)\" onclick=\"openY('/nwyj/page/business/am/contingencyPlan/PlanAdd.jsp')\">应急预案</a>";
  362. var params = {
  363. parentDeptName:parentId,
  364. msg:msg
  365. };
  366. $.ajax({
  367. url : url,
  368. type : 'post',
  369. data : params,
  370. dataType : 'text',
  371. timeout : 60000,
  372. success : function(data){
  373. },
  374. error : function(){
  375. $.messager.alert('操作失败');
  376. }
  377. });
  378. }
  379. //发布
  380. function onPublish(data){
  381. var row = g.getRow(data);
  382. var fd_id = row.FD_OBJECTID230;
  383. //只能上报自己上传的文件
  384. var userId = row.PIGEONHOLE_MAN_ID_230;
  385. if(getUser_id!=userId){
  386. top.Dialog.alert("只能发布自己上传的文件!");
  387. return;
  388. }
  389. top.Dialog.confirm("确定要发布吗?|发布", function() {
  390. // 发布规范文件
  391. $.post($.pathname() +"/ws/EmcPlan/EmgencyPlanService/fileFabu/", {
  392. comp_id : dpids,
  393. fd_id : fd_id,
  394. }, function(result) {
  395. if (result.Msg.sucsess == true) {
  396. top.Dialog.alert("发布成功",null,null,null,1);
  397. // 刷新表格数据
  398. g.rend();
  399. } else {
  400. top.Dialog.alert("发布失败!");
  401. }
  402. }, "json");
  403. }
  404. );
  405. }
  406. //撤回
  407. function onCallBack(rowid){
  408. top.Dialog.confirm("确定要撤回吗?|撤回", function() {
  409. if(status=="0"){
  410. top.Dialog.alert("只能撤回已发布或已上报的文件");
  411. return;
  412. }
  413. // 发布规范文件
  414. $.post($.pathname() +"/ws/SystemFile/SystemFileService/callBack", {
  415. "fd_id" : rowid
  416. }, function(result) {
  417. if (result.Msg.sucsess == true) {
  418. top.Dialog.alert("撤回成功",null,null,null,1);
  419. // 刷新表格数据
  420. g.rend();
  421. } else {
  422. top.Dialog.alert("撤回失败!");
  423. }
  424. }, "json");
  425. });
  426. }
  427. //下载
  428. function onDownLoad(){
  429. //批量打包下载
  430. var FD_OBJECTID = "";
  431. var rows = g.getSelectedRows();
  432. for (var i = 0; i < rows.length; i++) {
  433. var FD_OBJECTID1= rows[i].FD_OBJECTID230;//预案的主键
  434. var COLUMN_1_230 =rows[i].COLUMN_1_230;//预案的标识位(新的预案还是旧的预案)
  435. var COLUMN_3_230 =rows[i].COLUMN_3_230;//上传标识
  436. var COLUMN_4_230 =rows[i].COLUMN_4_230;//修改预案后新增预案的情况,也必有附件
  437. //新增文件,控制必传附件 纯新增
  438. if(COLUMN_1_230=="0"&&COLUMN_4_230=="0"&&COLUMN_3_230=="1"){
  439. //getFileList(fd_id,1);
  440. FD_OBJECTID += "'"+FD_OBJECTID1 +"'"+ ",";//文件的主键
  441. }
  442. //修改文件后新增预案的情况,也必有附件 纯修编
  443. if(COLUMN_1_230!="0"&&COLUMN_4_230!="0"&&COLUMN_3_230=="1"){
  444. //getFileList(fd_bojectid,1);
  445. FD_OBJECTID += "'"+FD_OBJECTID1+"'" + ",";//文件的主键
  446. }
  447. //纯修改
  448. if(COLUMN_1_230=="0"&&COLUMN_4_230!="0"&&COLUMN_3_230=="0"){
  449. //getFileList(PLAN_VERSION_REMARK,1);
  450. FD_OBJECTID += "'"+COLUMN_4_230+"'" + ",";//文件的主键
  451. }
  452. //修编修改
  453. if(COLUMN_1_230!="0"&&COLUMN_4_230!="0"&&COLUMN_3_230=="0"){
  454. //getFileList(PLAN_VERSION_REMARK,1);
  455. FD_OBJECTID += "'"+COLUMN_4_230+"'" + ",";//文件的主键
  456. }
  457. }
  458. var temp = FD_OBJECTID.substring(0,FD_OBJECTID.length-1);
  459. //发送请求,获取文件名的集合。
  460. var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getPlanFile/';
  461. var params = {
  462. fileId : temp
  463. };
  464. var SAVENAME1="";
  465. var NAME1 = "";
  466. var FILEEXT1="";
  467. $.ajax({
  468. url : url,
  469. type : 'post',
  470. timeout : 60000,
  471. data : params,
  472. dataType : 'json',
  473. success : function(data){
  474. var dataLenth = data.rows.length;
  475. var filenames="";
  476. var downfilename = "";
  477. for (var i = 0; i < dataLenth; i++) {
  478. SAVENAME1= data.rows[i].SAVENAME;
  479. NAME1= data.rows[i].NAME;
  480. FILEEXT1= data.rows[i].FILEEXT;
  481. filenames +=SAVENAME1 + "." + FILEEXT1 + ";";
  482. downfilename+=NAME1 + "." + FILEEXT1 + ";";
  483. }
  484. var filenames1 = filenames.substring(0,filenames.length-1);
  485. filenames = decodeURI(filenames1);
  486. var downfilename1 = downfilename.substring(0,downfilename.length-1);
  487. downfilename = decodeURI(downfilename1);
  488. showFile(filenames1,downfilename1);
  489. //alert(downfilename1+"============"+filenames1);
  490. //返回回调打包下载的函数,拼传给回调函数的filenames,downfilename
  491. },
  492. error : function(e){
  493. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  494. }
  495. });
  496. }
  497. function showFile(downfilename,filenames){
  498. var url = "/nwyj/page/business/am/org/query/getZipFile.jsp?downfilename="+downfilename+"&filenames="+filenames;
  499. window.open(url);
  500. }
  501. //共享
  502. function onShare(){
  503. alert("待定");
  504. }
  505. //导入
  506. function onImport(){
  507. // window.location.href = "FileList_AM-import.jsp";
  508. }
  509. //查看历史版本
  510. function onViewHistory(){
  511. var rows = g.getSelectedRows();
  512. if(rows.length==0){
  513. top.Dialog.alert("请选择一条记录");
  514. return;
  515. }
  516. if(rows.length>1){
  517. top.Dialog.alert("只能选择一条记录");
  518. return;
  519. }
  520. //上一个版本的预案ID
  521. var fd_id = rows[0].COLUMN_1_230;
  522. var fd_id1 = rows[0].FD_OBJECTID230;
  523. //var url = "FileVersion.jsp?"+fd_id+"?"+fd_id1;
  524. $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/file/FileVersion.jsp?"+fd_id+"?"+fd_id1);
  525. // top.document.getElementById("iframeChild2").setAttribute("src", "/nwyj/page/business/am/file/"+url);
  526. }
  527. //更多
  528. function more(){
  529. $('#moreDiv').toggle();
  530. // $("#FILE_CLASSIFY_230").resetValue();
  531. // $("#CHANGE_TYPE_230").resetValue();
  532. // $("#DATE1").val(""); $("#DATE2").val("");
  533. $("#FILE_TITLE_230").val("");
  534. }
  535. //汇总统计
  536. function sumUnit(){
  537. window.location.href="FileAM-poll.jsp";
  538. }
  539. //共享
  540. function publicShare(){
  541. var rows = g.getSelectedRows();
  542. var rowsLength = rows.length;
  543. if (rowsLength == 0) {
  544. top.Dialog.alert("请选中要分享的记录!");
  545. return;
  546. }
  547. var REMARK1 = rows[0].PIGEONHOLE_MAN_ID_230;
  548. if(REMARK1!=getUser_id){
  549. top.Dialog.alert("只能分享自己上传的文件!");
  550. return;
  551. }
  552. var ids = "";
  553. var sturtssb = "";
  554. for ( var i = 0; i < rowsLength; i++) {
  555. ids += rows[i].FD_OBJECTID230 + ",";
  556. sturtssb += rows[i].FABU_230 + ",";
  557. if(rows[i].FABU_230!="1"){
  558. if(rowsLength==1){
  559. top.Dialog.alert("您选中的记录未发布!");
  560. }else{
  561. top.Dialog.alert("您选中的记录有未发布的!");
  562. }
  563. return;
  564. }
  565. }
  566. $("#BUSINE_ID_217").val(ids);
  567. var diag = new top.Dialog();
  568. diag.Title = "文件共享";
  569. diag.URL = $.pathname() + '/page/business/am/public/readDept.jsp';
  570. diag.Width = 700;
  571. diag.Height = 500;
  572. diag.Top = "80%";
  573. diag.Left = "50%";
  574. diag.ShowButtonRow=true;
  575. diag.ButtonAlign = 'center';
  576. diag.OkButtonText="确 定";
  577. diag.OKEvent = function(){
  578. Validate(diag);
  579. };
  580. diag.show();
  581. }
  582. function Validate(diag){
  583. var zhh="";//总指挥
  584. var fzhh="";//副总指挥
  585. var yjbzr="";//应急办主任
  586. var yjbfzr="";//应急办副主任
  587. var yjbcy="";//应急办副成员
  588. var zyglry="";//专业部门管理人员
  589. var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+""; //登录人ID
  590. //分享单位的ID deptId
  591. var time1=diag.innerFrame.contentWindow.$("#time1").val();
  592. var time2=diag.innerFrame.contentWindow.$("#time2").val();
  593. //获取应急角色被勾选的值
  594. if(diag.innerFrame.contentWindow.document.getElementById("football-1").checked){
  595. //选中取值(可以取到这个值)
  596. zhh = "R002105430201";
  597. }else{
  598. zhh = "";
  599. }
  600. if(diag.innerFrame.contentWindow.document.getElementById("football-2").checked){
  601. //选中取值(可以取到这个值)
  602. fzhh = "R002105430202";
  603. }else{
  604. zyglry = "";
  605. }
  606. if(diag.innerFrame.contentWindow.document.getElementById("football-3").checked){
  607. //选中取值(可以取到这个值)
  608. yjbzr = "R002105430203";
  609. }else{
  610. yjbzr = "";
  611. }
  612. if(diag.innerFrame.contentWindow.document.getElementById("football-4").checked){
  613. //选中取值(可以取到这个值)
  614. yjbfzr = "R002105430204";
  615. }else{
  616. yjbfzr = "";
  617. }
  618. if(diag.innerFrame.contentWindow.document.getElementById("football-5").checked){
  619. //选中取值(可以取到这个值)
  620. yjbcy = "R002105430205";
  621. }else{
  622. yjbcy = "";
  623. }
  624. if(diag.innerFrame.contentWindow.document.getElementById("football-6").checked){
  625. //选中取值(可以取到这个值)
  626. zyglry = "R002105430206||R002105430207||R002105430208||R002105430209||R002105430210||R002105430211||R002105430212||R002105430213||R002105430214";
  627. }else{
  628. zyglry = "";
  629. }
  630. //被分享查看的人
  631. var RECEIVE_MAN = zhh + "||" + fzhh + "||" + yjbzr + "||" + yjbfzr + "||" + yjbcy + "||" + zyglry;
  632. //分享的单位 deptId
  633. //获取zTree对象
  634. var zTree = diag.innerFrame.contentWindow.$.fn.zTree.getZTreeObj("tree-1");
  635. //得到选中的数据集
  636. var checkedNodes = zTree.getCheckedNodes(true);
  637. if(time1==""||time2==""){
  638. $.messager.alert('请选择分享的起始时间!');
  639. return;
  640. }
  641. if(time1>time2){
  642. $.messager.alert('请选择正确的分享起始时间!');
  643. return;
  644. }
  645. if(checkedNodes==""){
  646. $.messager.alert('请选择要申请查看的单位!');
  647. return;
  648. }
  649. var compValue="";
  650. //var compValue2="";
  651. for(var i = 0; i < checkedNodes.length; i++){
  652. //机构名称
  653. compValue += checkedNodes[i].id + ",";
  654. //compValue2 += checkedNodes[i].name+",";
  655. }
  656. var compid = compValue.substring(0,compValue.length-1);
  657. //var compname = compValue2.substring(0,compValue2.length-1);
  658. //给第二个form的字段设置值
  659. $("#SHARE_MAN_217").val(getUser_id); //SHARE_MAN_217 分享人
  660. $("#SHARE_UNITS_217").val(deptId); //SHARE_UNITS_217分享单位
  661. $("#RECEIVE_UNITS_217").val(compid); //RECEIVE_UNITS_217 被分享单位
  662. //SHARE_TYPE_217分享的业务类型 写死3
  663. $("#SHARE_START_TIME_217").val(time1); //SHARE_START_TIME_217开始时间
  664. $("#SHARE_END_TIME_217").val(time2); //SHARE_END_TIME_217结束时间
  665. //BUSINE_ID_217业务ID 点击分享的时候已经赋值给页面了
  666. $("#RECEIVE_MAN_217").val(RECEIVE_MAN); //RECEIVE_MAN_217接收的人
  667. var $form = $('#fillForm1');
  668. var url = $.pathname() + '/ws/crud/CRUDService/create';
  669. $.ajax({
  670. url : url,
  671. type : 'post',
  672. data : $form.serialize(),
  673. dataType : 'text',
  674. timeout : 60000,
  675. success : function(data){
  676. $.messager.alert("共享成功",null,null,null,-1);
  677. },
  678. error : function(){
  679. $.messager.alert('操作失败');
  680. }
  681. });
  682. top.Dialog.close();//关闭新增窗口
  683. }
  684. $.messager=top.Dialog;