b82fa160ac0850f38724a3b7446f9c2f0c678575.svn-base 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. var sub_fd_id ="";
  2. $(function(){
  3. //2015-09-29 可以取到父页面的预案ID
  4. //取页面传过来的预案主键ID
  5. sub_fd_id = parent.fd_id;
  6. var PLAN_BIAOZHI="";
  7. //查询信息
  8. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  9. var params = {
  10. classid : '214',
  11. objectID : sub_fd_id
  12. };
  13. $.ajax({
  14. url : url,
  15. type : 'post',
  16. timeout : 60000,
  17. data : params,
  18. dataType : 'json',
  19. success : function(data){
  20. $("#titlename").html(data.PLAN_NAME_214);
  21. PLAN_BIAOZHI=data.PLAN_BIAOZHI_214;
  22. var units = data.UNITS_214_SHOW;
  23. $("#UNITS1_214_SHOW").html(units);
  24. var share = data.PLAN_SHARE_214;
  25. var fb_submit=data.PLAN_STAT_214;
  26. var sb_submit=data.PLAN_STAT1_214;
  27. // if(fb_submit=="1"&&sb_submit=="1"){
  28. // if(share=="1"){
  29. // $("#submit").hide();
  30. // $("#submit1").show();
  31. // }else{
  32. // $("#submit1").hide();
  33. // $("#submit").show();
  34. // }
  35. // }else{
  36. $("#submit1").hide();
  37. $("#submit").hide();
  38. // }
  39. var is_units = data.INS_UNITS_214_SHOW;
  40. $("#INS_UNITS1_214_SHOW").html(is_units);
  41. for(var i in data){
  42. $('#'+i).html(data[i]);
  43. }
  44. getVersion(sub_fd_id,PLAN_BIAOZHI,data.UPDATEDATE_214);
  45. getUserInfo(data.ENTERING_214);
  46. },
  47. error : function(e){
  48. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  49. }
  50. });
  51. $('#fileDiv').newAsyncFileUpload("",sub_fd_id,0);
  52. window.setTimeout("setHeightThis()", 200);
  53. });
  54. function getUserInfo(userID){
  55. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  56. var params = {
  57. classid : '880',
  58. objectID : userID
  59. };
  60. $.ajax({
  61. url : url,
  62. type : 'post',
  63. timeout : 60000,
  64. data : params,
  65. dataType : 'json',
  66. success : function(data){
  67. // var DRILL_LINKMAN =data.REAL_NAME_880;
  68. var MOBILE = data.MOBILE_880; //手机
  69. // var COMPANY_ID = data.COMPANY_ID_880_SHOW;//所属单位
  70. // var ORG_ID = data.ORG_ID_880_SHOW;//所属部门
  71. // getDeptName(data.ORG_ID_880);
  72. //
  73. // $("#DRILL_LINKMAN").html(DRILL_LINKMAN);
  74. // $("#ORG_ID").html(ORG_ID);
  75. // $("#COMPANY_ID").html(COMPANY_ID);
  76. $("#MOBILE").html(MOBILE);
  77. },
  78. error : function(e){
  79. top.Dialog.alert('系统提示信息', '访问服务失败!', 'error');
  80. }
  81. });
  82. }
  83. function setHeightThis(){
  84. $(parent.document.body).find("iframe").height($(window.document.body).height()+150);
  85. $(parent.parent.document.body).find("iframe").height($(parent.document.body).height()+300);
  86. }
  87. //预案共享
  88. function share(type){
  89. sub_fd_id = parent.fd_id;
  90. //根据预案的ID修改:PLAN_SHARE的状态 sub_fd_id 预案的ID
  91. //撤销共享
  92. var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/planShare/';
  93. var params = {
  94. planID : sub_fd_id,
  95. isShare:type
  96. };
  97. $.ajax({
  98. url : url,
  99. type : 'post',
  100. timeout : 60000,
  101. data : params,
  102. dataType : 'json',
  103. success : function(data){
  104. if(type=="1"){
  105. top.Dialog.alert("共享成功!");
  106. window.location.reload();
  107. }else{
  108. top.Dialog.alert("撤销成功!");
  109. window.location.reload();
  110. }
  111. },
  112. error : function(e){
  113. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  114. }
  115. });
  116. }
  117. /****************************************预案历史版本展示**************************************************************/
  118. var g;
  119. var fileID;
  120. function getVersion(data,data1,updatetime){
  121. fileID=data;
  122. // UPDATEDATE <= '"+updatetime+"' and ((OBJ_FIRST='0' AND FD_OBJECTID='"+ OBJ_FIRST+"') OR (OBJ_FIRST='"+ OBJ_FIRST+"'))
  123. /**定义变量**/
  124. var condition = "";
  125. if(data1=="0"){//版本标志位等于0的时候,没有更多版本。就传当前预案的OBJECTID
  126. condition = "FD_OBJECTID = '"+data+"' and IS_DEL = '1' ";
  127. }else{//版本标志位不等于0的时候,有更多的版本,取标志位等于
  128. condition = " IS_DEL ='1' AND UPDATEDATE <= '"+updatetime+"' AND ((PLAN_BIAOZHI='0' AND FD_OBJECTID='"+ data1+"') OR (PLAN_BIAOZHI='"+ data1+"'))";
  129. }
  130. //列表加载参数
  131. var loadParams = {
  132. "listId" : '214',
  133. "condition" : condition,
  134. direction:'DESC',
  135. sort: 'UPDATEDATE'
  136. };
  137. /**
  138. * 工具条
  139. */
  140. var roleCons = roleButtonArr();
  141. var toolBarOpt1 = {
  142. items:[
  143. // {text: '下载', click: "onDownload", iconClass: 'download_tem',id:"10007"}
  144. ],
  145. roleCons:roleCons
  146. };
  147. /**
  148. * 树形列
  149. */
  150. var grid_option1 = {
  151. columns: [
  152. { display: '预案名称', name: 'PLAN_NAME_214', align: 'center', width: "10%",isPrimaryKey:true,
  153. render : function(rowdata, value) {
  154. return '<a href="javascript:void(0)" '
  155. + 'onclick=jumpPage("'
  156. + rowdata.FD_OBJECTID214+'","'+rowdata.PLAN_BIAOZHI_214+'","'+ rowdata.PLAN_REFINE_CATEGORY_214+'","'+ rowdata.PLAN_REFINE_CATEGORY_214+'","'+ rowdata.PLAN_TYPE_214+'")>'+ rowdata.PLAN_NAME_214 +'</a>';
  157. }
  158. },
  159. { display: '预案编码', name: 'PLAN_NO_214', align: 'center', width: '10%'},
  160. { display: '预案类型', name: 'PLAN_TYPE_214_SHOW', align: 'center', width: '10%'},
  161. { display: '突发事件类型', name: 'BYSUNESS_TYPE_214_SHOW', align: 'center', width: '10%'},
  162. // { display: '变更类别', name: 'CHANGE_TYPE_214_SHOW', align: 'center' , width: '10%'},
  163. //{ display: '适用范围', name: 'SYFW_214', align: 'center', width: '8%'},
  164. { display: '责任部门', name: 'INS_UNITS_214_SHOW', align: 'center', width: '10%'},
  165. { display: '颁布日期', name: 'ISSUE_DATE_214', align: 'center' , width: '10%' },
  166. { display: '实施日期', name: 'TAKE_DATE_214', align: 'center' , width: '10%' },
  167. { display: '所属单位', name: 'UNITS_214_SHOW', align: 'center', width: '15%' },
  168. { display: '简要说明', name: 'SYFW_214', align: 'center', width: '15%'}
  169. // { display: '操作', isAllowHide: false, align: 'center', width:'8%',
  170. // render: function (rowdata, rowindex, value, column){
  171. // //判断是否已经发布。取发布的状态,如果已经发布为“1”;未发布为“0”
  172. // var fabu='';//fabu
  173. // if(rowdata.PLAN_STAT_214=="1"){
  174. // fabu = '<span class="fashang_07 hand" title="发布" onclick="fabu1()"></span>';
  175. // }else{
  176. // fabu = '<span class="fashang_06 hand" title="发布" onclick="fabu(' + rowindex + ')"></span>';
  177. // }
  178. // //判断是否已经发布。取发布的状态,如果已经上报为“1”;未上报为“0”fashang_09fashang_plan
  179. // var shangbao='';
  180. // if(rowdata.PLAN_STAT1_214=="1"){
  181. // shangbao = '<span class="sendup_templan hand" title="上报" onclick="shangbao1()"></span>';
  182. // }else{
  183. // shangbao = '<span class="fashang_plan hand" title="上报" onclick="shangbao(' + rowindex + ')"></span>';
  184. // }
  185. // return fabu
  186. // + shangbao;
  187. // }
  188. // }
  189. ],
  190. rownumbers : true,
  191. checkbox : true,
  192. pageSize : 10,
  193. percentWidthMode : true
  194. };
  195. var options1={
  196. url :'/nwyj/ws/crud/CRUDService/queryQui',
  197. params:loadParams,
  198. height: '100%',
  199. width:"100%",
  200. gridOptions:grid_option1,
  201. singleRecodeOptions:{a:"aa"},
  202. paperOpration:{showInput:"true"},
  203. toolBarOptions:toolBarOpt1
  204. };
  205. g=gridAndSingleRecode=$("#maingrid1").quickgridAndSingleRecode(options1);
  206. }
  207. //点击查看
  208. function jumpPage(fd_id1,PLAN_BIAOZHI,BM_YAXHLB,PLAN_REFINE_CATEGORY,PLAN_TYPE){//,UPDATEDATE
  209. if(fileID==fd_id1){
  210. top.Dialog.alert("您选择的是本条记录");
  211. return;
  212. }
  213. // alert(fd_id1+","+PLAN_BIAOZHI+","+BM_YAXHLB+","+PLAN_REFINE_CATEGORY+","+PLAN_TYPE);
  214. // parent.location.href="/nwyj/page/business/am/contingencyPlan/planview.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
  215. $.indexOpenNextWindow("/nwyj/page/business/am/contingencyPlan/planview.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB);
  216. // if(PLAN_TYPE!="103"){
  217. // window.location.href="/nwyj/page/business/am/contingencyPlan/Planinfo.jsp?"+fd_id1 /*+ "?" + UPDATEDATE*/;
  218. // }else{
  219. // if(PLAN_REFINE_CATEGORY=="17"){//网络与信息安全
  220. // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
  221. // }else if(PLAN_REFINE_CATEGORY=="4"){//人身事故
  222. // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusRSSG.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
  223. // }else if(PLAN_REFINE_CATEGORY=="5"){//大面积停电事件
  224. // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusDMJTD.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
  225. // }else if(PLAN_REFINE_CATEGORY=="6"){//设备事故
  226. // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusSBSG.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
  227. // }else if(PLAN_REFINE_CATEGORY=="7"){//电厂大坝厂房事故
  228. // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusDCDB.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
  229. // }else if(PLAN_REFINE_CATEGORY=="8"){//环境污染
  230. // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusHJWR.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
  231. // }else if(PLAN_REFINE_CATEGORY=="9"){//防风防汛PlanOnViewList\NewMsgNotice
  232. // parent.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexus.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
  233. // }else if(PLAN_REFINE_CATEGORY=="10"){//地震灾害
  234. // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusDZZH.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
  235. // }else if(PLAN_REFINE_CATEGORY=="11"){//低温雨雪冰冻灾害
  236. // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusDWBD.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
  237. // }else if(PLAN_REFINE_CATEGORY=="12"){//电力供应及客户服务PlanNexusDLGY.jsp
  238. // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusDLGY.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
  239. // }else if(PLAN_REFINE_CATEGORY=="13"){//生产场所防恐怖袭击
  240. // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusKBXJ.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
  241. // }else if(PLAN_REFINE_CATEGORY=="14"){//突发性群体事件
  242. // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
  243. // }else if(PLAN_REFINE_CATEGORY=="15"){//突发新闻事件
  244. // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
  245. // }else if(PLAN_REFINE_CATEGORY=="16"){//涉外突发事件
  246. // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusTFQT.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
  247. // }else if(PLAN_REFINE_CATEGORY=="18"){//突发公共卫生
  248. // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanOnViewNexus/PlanNexusGGWS.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
  249. // }else{
  250. // window.location.href="/nwyj/page/business/am/contingencyPlan/PlanNexus.jsp?"+fd_id1+"?"+PLAN_BIAOZHI+"?" + BM_YAXHLB /*+ "?" + UPDATEDATE*/;
  251. // }
  252. // }
  253. }
  254. //下载
  255. function onDownload(){
  256. var FD_OBJECTID = "";
  257. var rows = g.getSelectedRows();
  258. for (var i = 0; i < rows.length; i++) {
  259. var FD_OBJECTID1= rows[i].FD_OBJECTID214;//预案的主键
  260. var PLAN_BIAOZHI1 =rows[i].PLAN_BIAOZHI_214;//预案的标识位(新的预案还是旧的预案)
  261. var UPLOAND_FLAG1 =rows[i].UPLOAND_FLAG_214;//上传标识
  262. var PLAN_VERSION_REMAR1 =rows[i].PLAN_VERSION_REMARK_214;//修改预案后新增预案的情况,也必有附件
  263. //新增预案,控制必传附件 纯新增
  264. if(PLAN_BIAOZHI1=="0"&&PLAN_VERSION_REMAR1=="0"&&UPLOAND_FLAG1=="1"){
  265. //getFileList(fd_id,1);
  266. FD_OBJECTID += "'"+FD_OBJECTID1 +"'"+ ",";//预案的主键
  267. }
  268. //修改预案后新增预案的情况,也必有附件 纯修编
  269. if(PLAN_BIAOZHI1!="0"&&PLAN_VERSION_REMAR1!="0"&&UPLOAND_FLAG1=="1"){
  270. //getFileList(fd_bojectid,1);
  271. FD_OBJECTID += "'"+FD_OBJECTID1+"'" + ",";//预案的主键
  272. }
  273. //纯修改
  274. if(PLAN_BIAOZHI1=="0"&&PLAN_VERSION_REMAR1!="0"&&UPLOAND_FLAG1=="0"){
  275. //getFileList(PLAN_VERSION_REMARK,1);
  276. FD_OBJECTID += "'"+PLAN_VERSION_REMAR1+"'" + ",";//预案的主键
  277. }
  278. //修编修改
  279. if(PLAN_BIAOZHI1!="0"&&PLAN_VERSION_REMAR1!="0"&&UPLOAND_FLAG1=="0"){
  280. //getFileList(PLAN_VERSION_REMARK,1);
  281. FD_OBJECTID += "'"+PLAN_VERSION_REMAR1+"'" + ",";//预案的主键
  282. }
  283. }
  284. var temp = FD_OBJECTID.substring(0,FD_OBJECTID.length-1);
  285. //alert("temp****"+temp + "****99999****");
  286. //发送请求,获取文件名的集合。
  287. var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getPlanFile/';
  288. var params = {
  289. fileId : temp
  290. };
  291. var SAVENAME1="";
  292. var NAME1 = "";
  293. var FILEEXT1="";
  294. $.ajax({
  295. url : url,
  296. type : 'post',
  297. timeout : 60000,
  298. data : params,
  299. dataType : 'json',
  300. success : function(data){
  301. var dataLenth = data.rows.length;
  302. var filenames="";
  303. var downfilename = "";
  304. for (var i = 0; i < dataLenth; i++) {
  305. SAVENAME1= data.rows[i].SAVENAME;
  306. NAME1= data.rows[i].NAME;
  307. FILEEXT1= data.rows[i].FILEEXT;
  308. filenames +=SAVENAME1 + "." + FILEEXT1 + ";";
  309. downfilename+=NAME1 + "." + FILEEXT1 + ";";
  310. }
  311. var filenames1 = filenames.substring(0,filenames.length-1);
  312. filenames = decodeURI(filenames1);
  313. var downfilename1 = downfilename.substring(0,downfilename.length-1);
  314. downfilename = decodeURI(downfilename1);
  315. showFile(filenames1,downfilename1);
  316. //alert(downfilename1+"============"+filenames1);
  317. //返回回调打包下载的函数,拼传给回调函数的filenames,downfilename
  318. },
  319. error : function(e){
  320. $.messager.alert('系统提示信息', '访问服务失败!', 'error');
  321. }
  322. });
  323. }
  324. function showFile(downfilename,filenames){
  325. var url = "/nwyj/page/business/am/org/query/getZipFile.jsp?downfilename="+downfilename+"&filenames="+filenames;
  326. window.open(url);
  327. }