123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- var role_id = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();
- $(function(){
- fileShare();
-
- $searchOne = $("#searchOne");//查询图标绑定查询事件
- $searchOne.bind('click', function() {
- searchHandler();
- });
- });
-
- var BUSINE_ID1 ="";
- var BUSINE_ID ="";
- var temp1 = new Array();
- var temp = new Array();
-
- function fileShare(){
-
- var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/fileShare/';
- var params = {
- units : deptId,
- receiveMan:role_id,
- type:"1"
- };
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data){
-
- if(JSON.stringify(data).length>11){
- BUSINE_ID1 = data.rows[0].BUSINE_ID;//取业务ID
- BUSINE_ID=BUSINE_ID1.substring(0,BUSINE_ID1.length-1);
- temp = BUSINE_ID.split(",");
- for(var i=0; i<temp.length;i++){
- temp1.push("'" + temp[i] +"'");
- }
- }
- if(temp1.length>0){
- initComplete111();
- }else{
- temp1="'0'";
- initComplete111();
- }
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
-
- var g;
- /**定义变量**/
-
- var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+""; //登录人ID
- //var condition = "IS_DEL='0' and (PLAN_STAT='1' or PLAN_STAT1='1' or REMARK1='"+ getUser_id +"') and (UNITS='"+deptId+"' or UNITS IN(SELECT A.ID FROM EMC_AM_ORG_DEPARTMENT_TEST A WHERE A.PARENT_ID='"+deptId+"'))";
- //列表加载参数
- function initComplete111(){
- var condition = "IS_DEL='0' and FD_OBJECTID IN("+temp1+")";
- var loadParams = {
- "listId" : '230',
- "condition" : condition,
- direction:'DESC',
- sort: 'UPDATEDATE'
- };
- /**
- * 工具条
- */
- var roleCons = roleButtonArr();
- var toolBarOpt1 = {
- items : [
- {text: '下载', click: "onDownload", iconClass: 'download_tem',id:"10007"}],
- roleCons:roleCons
- };
- /**
- * 树形列
- */
- var grid_option1 = {
- columns: [
- // {name : 'FD_OBJECTID',hide : true},
- {display : '文件标题',name : 'FILE_TITLE_230', align : 'center',width : '20%',isPrimaryKey:true,
- render : function(rowdata, value) {
- return '<a href="javascript:void(0)" '
- + 'onclick=jumpPage("'
- + rowdata.FD_OBJECTID230
- +'")>'+ rowdata.FILE_TITLE_230 +'</a>';
- }
- },
- {display : '文件分类',name : 'FILE_CLASSIFY_230_SHOW', align : 'center',width : '10%'},
- // {display : '发布状态',name : 'FILE_STATUS_230_SHOW', align : 'center',width : '10%'},
- // {display : '上报状态',name : 'SHANGBAO_230_SHOW', align : 'center',width : '10%'},
- {display : '发文日期',name : 'FILE_ADD_DATE_230', align : 'center',width : '10%'},
- {display : '归档人',name : 'PIGEONHOLE_MAN_ID_230_SHOW', align : 'center',width : '10%'},
- {display : '归档日期',name : 'PIGEONHOLE_DATE_230', align : 'center',width : '10%'},
- {display : '变更说明',name : 'CHANGE_DETAIL_230', align : 'center',width : '15%'},
- {display : '变更类型',name : 'CHANGE_TYPE_230_SHOW', align : 'center',width : '10%'},
- {display : '文件摘要',name : 'FILE_CONTENT_230', align : 'center',width : '15%'}
- ],
- rownumbers : true,
- checkbox : true,
- width:"100%",
- pageSize : 10,
- percentWidthMode : true
- };
- var options1={
- url :'/nwyj/ws/crud/CRUDService/queryQui',
- params:loadParams,
- gridOptions:grid_option1,
- singleRecodeOptions:{a:"aa"},
- paperOpration:{showInput:"true"},
- toolBarOptions:toolBarOpt1
- };
- g=gridAndSingleRecode=$("#maingrid").quickgridAndSingleRecode(options1);
- }
-
- //查询
- function searchHandler() {
- var title = $('#FILE_TITLE_230').val();//标题
- var condition = "IS_DEL='0' and FD_OBJECTID IN("+BUSINE_ID+")";
-
- if(title!=""&&title!="请输入文件名称"){
- condition += " AND FILE_TITLE LIKE '%" +title+"%'";
- }
-
- g.setOptions({// 重置加载列表的参数
- params : {
- "listId" : '230',
- "condition" : condition
- }
- });
- g.rend();
- }
- //点击查看
- function jumpPage(id){
- window.location.href="/nwyj/page/business/am/file/FileAMInfo.jsp?"+id;
- }
- //下载
- function onDownload(){
-
- //批量打包下载
- var FD_OBJECTID = "";
- var rows = g.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要下载的文件!");
- return;
- }
-
- for (var i = 0; i < rows.length; i++) {
- var FD_OBJECTID1= rows[i].FD_OBJECTID230;//预案的主键
- var COLUMN_1_230 =rows[i].COLUMN_1_230;//预案的标识位(新的预案还是旧的预案)
- var COLUMN_3_230 =rows[i].COLUMN_3_230;//上传标识
- var COLUMN_4_230 =rows[i].COLUMN_4_230;//修改预案后新增预案的情况,也必有附件
- //新增文件,控制必传附件 纯新增
- if(COLUMN_1_230=="0"&&COLUMN_4_230=="0"&&COLUMN_3_230=="1"){
- //getFileList(fd_id,1);
- FD_OBJECTID += "'"+FD_OBJECTID1 +"'"+ ",";//文件的主键
- }
- //修改文件后新增预案的情况,也必有附件 纯修编
- if(COLUMN_1_230!="0"&&COLUMN_4_230!="0"&&COLUMN_3_230=="1"){
- //getFileList(fd_bojectid,1);
- FD_OBJECTID += "'"+FD_OBJECTID1+"'" + ",";//文件的主键
- }
- //纯修改
- if(COLUMN_1_230=="0"&&COLUMN_4_230!="0"&&COLUMN_3_230=="0"){
- //getFileList(PLAN_VERSION_REMARK,1);
- FD_OBJECTID += "'"+COLUMN_4_230+"'" + ",";//文件的主键
- }
- //修编修改
- if(COLUMN_1_230!="0"&&COLUMN_4_230!="0"&&COLUMN_3_230=="0"){
- //getFileList(PLAN_VERSION_REMARK,1);
- FD_OBJECTID += "'"+COLUMN_4_230+"'" + ",";//文件的主键
- }
- }
-
- 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);
- //alert(downfilename1+"============"+filenames1);
- //返回回调打包下载的函数,拼传给回调函数的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);
- }
-
- $.messager=top.Dialog;
|