123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- var fileID;
- function init(fd_id,OBJ_FIRST){
- fileID=fd_id;
- var condition="";
- if(OBJ_FIRST=="0"){
- condition = "FD_OBJECTID = '"+fd_id+"' and IS_DEL = '1' ";
- }else{
- condition = " IS_DEL = '1' and ((OBJ_FIRST='0' AND FD_OBJECTID='"+ OBJ_FIRST+"') OR (OBJ_FIRST='"+ OBJ_FIRST+"')) ";
- }
- var loadParams = {
- "listId" : '243',
- "condition" : condition,
- direction:'DESC',
- sort: 'UPDATEDATE'
- };
-
- var roleCons = roleButtonArr();
- /** grid载入数据* */
- var toolBarOpt1 = {
- items : [
- // {text : '下载',click:"onDownLoad",iconClass: 'download_tem',id:"10007" }
- ],
- roleCons:roleCons
- };
-
- var grid_option1={
- columns : [
- {display : '法律法规名称', name : 'LAWS_REGULATIONS_NAME_243', align : 'center',width : "15%",isPrimaryKey:true,
- render : function(rowdata, value) {
- return '<a href="javascript:void(0)" '
- + 'onclick=jumpPage("'
- + rowdata.FD_OBJECTID243
- +'")>'+ rowdata.LAWS_REGULATIONS_NAME_243 +'</a>';
- }
- },
- {display : '颁布机构', name : 'ISSUE_ORGANIZATION_243', align : 'center',width : "15%"},
- {display : '颁布文号', name : 'ISSUE_ARTICLE_NUM_243', align : 'center',width : "10%"},
- {display : '发布日期', name : 'ISSUE_DATE_243', align : 'center',width : "10%"},
- {display : '录入人', name : 'TYPEIN_PEOPLE_243_SHOW', align : 'center',width : "10%"},
- // {display : '录入人联系方式', name : 'TYPEIN_PEOPLE_PHONE_NUM_243',align : 'center',width : "15%"},
- {display : '实施日期', name : 'IMPLEMENT_DATE_243', align : 'center',width : "10%"} ,
- {display : '单位', name : 'UNITE_243_SHOW', align : 'center',width : "10%"} ,
- {display : '部门', name : 'DEPT_243_SHOW', align : 'center',width : "10%"} ,
- {display : '状态', name : 'STATE_243_SHOW', align : 'center',width : "10%"}
- ],
- detail: {
- //onShowDetail: showFlow,
- height: 'auto'
- },
- pageSize : 10,
- rownumbers : true,
- checkbox : true,
- percentWidthMode : true
- };
-
- var options1={
- url :'/nwyj/ws/crud/CRUDService/queryQui',
- params:loadParams,
- width:960,
- gridOptions:grid_option1,
- singleRecodeOptions:{a:"aa"},
- paperOpration:{showInput:"true"},
- toolBarOptions:toolBarOpt1
- };
-
- g=gridAndSingleRecode=$("#gridtable").quickgridAndSingleRecode(options1);
- }
- //单击跳转
- function jumpPage(fd_id){
- if(fileID==fd_id){
- top.Dialog.alert("您选择的是本条记录");
- return;
- }
- if((window.location.href).split('?')[2]=="1"){
- // $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/laws/laws_info.jsp?"+fd_id+"?1");
- $.indexOpenNextWindow("/nwyj/page/business/am/fileManager/laws/laws_info.jsp?"+fd_id+"?1");
- }else{
- // $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/laws/laws_info.jsp?"+fd_id);
- $.indexOpenNextWindow("/nwyj/page/business/am/fileManager/laws/laws_info.jsp?"+fd_id);
- }
-
- // window.open("/nwyj/page/business/am/fileManager/laws/laws_info.jsp?"+fd_id);
- }
- /***********************************************************下载************************************************************/
- function onDownLoad(){
- var FD_OBJECTID = "";
- var rows = g.getSelectedRows();
- if(rows.length==0){
- top.Dialog.alert("请选择一条记录");
- return;
- }
- for (var i = 0; i < rows.length; i++) {
- var FD_OBJECTID1= rows[i].FD_OBJECTID243;//预案的主键
-
- FD_OBJECTID += "'"+FD_OBJECTID1+"'" + ",";//预案的主键(复数)
-
- }
-
- var temp = FD_OBJECTID.substring(0,FD_OBJECTID.length-1);
-
- //发送请求,获取文件名的集合。
- var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getPlanFile/';
- var params = {
- fileId : temp
- };
-
- var SAVENAME1="";
- var NAME1 = "";
- var FILEEXT1="";
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data){
- var dataLenth = data.rows.length;
- var filenames="";
- var downfilename = "";
-
- for (var i = 0; i < dataLenth; i++) {
- SAVENAME1= data.rows[i].SAVENAME;
- NAME1= data.rows[i].NAME;
- FILEEXT1= data.rows[i].FILEEXT;
-
- filenames +=SAVENAME1 + "." + FILEEXT1 + ";";
- downfilename+=NAME1 + "." + FILEEXT1 + ";";
- }
-
-
- var filenames1 = filenames.substring(0,filenames.length-1);
- filenames = decodeURI(filenames1);
- var downfilename1 = downfilename.substring(0,downfilename.length-1);
- downfilename = decodeURI(downfilename1);
- showFile(filenames1,downfilename1);
- //返回回调打包下载的函数,拼传给回调函数的filenames,downfilename
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
- function showFile(downfilename,filenames){
- var url = "/nwyj/page/business/am/org/query/getZipFile.jsp?downfilename="+downfilename+"&filenames="+filenames;
- window.open(url);
- }
- /**************************************************************end***********************************************************/
- function fabu(data,data2) {
- var fd_id = data+",";
- //只能发布自己上传的文件
- var userId = data2;
- var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- if(getUser_id!=userId){
- top.Dialog.alert("只能发布自己上传的文件!");
- return;
- }
- top.Dialog.confirm("确定要发布吗?|发布", function() {
- // 发布规范文件
- $.post($.pathname() +"/ws/LAWSPOLL/LawsService/LawsFabu/", {
- fd_id : fd_id,
- }, function(result) {
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("发布成功",null,null,null,1);
- //跳转到本页
- var url = "/nwyj/page/business/am/fileManager/laws/"+"laws_view.jsp?"+data;
- top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
- } else {
- top.Dialog.alert("发布失败!");
- }
- }, "json");
-
- });
- };
- function share(){
- top.Dialog.alert("发布之后才能共享!");
- }
- function share2(data,data2){
-
- var fd_id = data+",";
- //只能共享自己上传的文件
- var userId = data2;
- var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- if(getUser_id!=userId){
- top.Dialog.alert("只能共享自己上传的文件!");
- return;
- }
- top.Dialog.confirm("确定要共享吗?|共享", function() {
- // 发布规范文件
- $.post($.pathname() +"/ws/LAWSPOLL/LawsService/LawsShare/", {
- fd_id : fd_id,
- }, function(result) {
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("共享成功",null,null,null,1);
- //跳转到本页
- var url = "/nwyj/page/business/am/fileManager/laws/"+"laws_view.jsp?"+data;
- top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
- } else {
- top.Dialog.alert("共享失败!");
- }
- }, "json");
-
- });
- }
- function noshare(data,data2){
- var fd_id = data+",";
- //只能撤销自己上传的文件
- var userId = data2;
- var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- if(getUser_id!=userId){
- top.Dialog.alert("只能撤销自己上传的文件!");
- return;
- }
- top.Dialog.confirm("确定要撤销共享吗?|撤销", function() {
- // 发布规范文件
- $.post($.pathname() +"/ws/LAWSPOLL/LawsService/noLawsShare/", {
- fd_id : fd_id,
- }, function(result) {
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("撤销成功",null,null,null,1);
- //跳转到本页
- var url = "/nwyj/page/business/am/fileManager/laws/"+"laws_view.jsp?"+data;
- top.parent.document.getElementById("frmright").setAttribute("src", ""+encodeURI(url));
- } else {
- top.Dialog.alert("撤销失败!");
- }
- }, "json");
-
- });
- }
|