12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073 |
- //部门id
- var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- //取得用户真实姓名
- var realname = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
- //登录人ID
- var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+"";
- //登陆用户的单位名称
- var corp_name = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_names();
- //父部门id
- var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
- //用户登录的单位ID
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- $(function(){
- //下拉框加载
- // $("#FILE_CLASSIFY_231").initCanstSelect('BM_FILE_CLASSIFY');
- // $('#CHANGE_TYPE_231').initCanstSelect('BM_CHANGETYPE');
- // $("#COLUMN_2_231").initCanstSelect('BM_FILE_SECURITY');
-
- getChildInfo();
-
- /** 绑定更多的按钮点击事件 */
- $more = $("#more"); // 更多按钮
- $more.bind('click', function() {
- more();
- });
- $searchButt = $("#searchButt");// 更多查询按钮
- $searchButt.live('click', function() {
- searchHandler();
- });
- $searchOne = $("#searchOne");//查询图标绑定查询事件
- $searchOne.bind('click', function() {
- searchHandler();
- });
- });
- var conditionData2="";
- function getChildInfo(){
- var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getresourXj/';///ws/PlanHuiZong/ContingencyPlanHuiZong/getChidInfo/
- var params = {
- id : deptId,
- value:"PUBLISH_COMP_ID"
- };
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data){
-
- // conditionData2 = JSON.stringify(data);
- //
- // conditionData2 = conditionData2.replace(/\\\"/g,"\"");
- // conditionData2 = conditionData2.replace(/\"{/g,"{");
- // conditionData2 = conditionData2.replace(/}\"/g,"}");
- // var test = eval("("+conditionData2+")");
- // if(conditionData2!='{"list":[{"name":"查询单位","className":"PUBLISH_COMP_ID","list":[]}]}'){
- // test.dept.list[0].equalType = "equal";
- // conditionData.list.push(test.dept.list[0]);
- // }else{
- // test.dept.list[0].equalType = "equal";
- // conditionData.list.push(test.dept.list[0]);
- // }
- //
- // /* if(parent_id!="1"){
- // conditionData.list.push(test1.list[0]);
- // }*/
- //
- //
- //
- // createConditionsDom(conditionData);
- // $(".item").unbind("click").bind("click",bindSelectOne);
-
-
-
- var conditionData3 = JSON.stringify(data);
- var test = eval("("+conditionData3+")");
- if(conditionData3!='{"list":[{"name":"查询单位","className":"PUBLISH_COMP_ID","equalType":"equal","list":[]}]}'){
- conditionData.list.push(test.list[0]);
- }
- createConditionsDom(conditionData);
- $(".item").unbind("click").bind("click",bindSelectOne);
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
-
- var g;
-
- //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+"') or PUBLISH_COMP_ID='"+parentId+"')";
- // 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='"+deptId+"' or PUBLISH_COMP_ID IN(SELECT A.ID FROM EMC_AM_ORG_DEPARTMENT_TEST A WHERE A.PARENT_ID='"+deptId+"' ) and SHANGBAO='1')";
- //var condition = "IS_DEL=0 and ( FABU='1' or PIGEONHOLE_MAN_ID='"+userId+"') ";
- var condition = "IS_DEL='0' and (FABU='1' or PIGEONHOLE_MAN_ID='"+ getUser_id +"') and (PUBLISH_COMP_ID='"+deptId+"' or PUBLISH_COMP_ID='"+parentId+"')";
- //列表加载参数
- var loadParams = {
- "listId" : '231',
- "condition" : condition,
- direction:'DESC',
- sort: 'UPDATEDATE'
- };
- //初始化列表
- function initComplete(){
- /**
- * 工具条
- */
- var roleCons = roleButtonArr();
- var toolBarOpt1 = {items: [
- { text: '新增' ,click:"onAdd",iconClass: 'add1_tem',id:"bgdxz"},
- { text: '删除' ,click:"onDelete",iconClass: 'delete_tem',id:"bgdsc"},
- { text: '修改' ,click:"onEdit",iconClass: 'update_tem',id:"bgdxg"},
- { text: '查看',click:"onView",iconClass: 'view_tem', id:"bgdck"},
- // { text: '历史版本' ,click:"onViewHistory",iconClass: 'history_tem',id:"10201"},
- { text: '导入' , click:"onImport",iconClass: 'import_tem',id:"bgddr" },
- { text: '导出' , click:"exportTotalData",iconClass: 'export_tem',id:"bgddc"},
- // { text: '下载' ,click:"onDownLoad",iconClass: 'download_tem',id:"10007"},
- { text: '汇总', click: "sumUnit", iconClass: 'poll_tem' ,id:"bgdhz"},
- { text: '共享', click: "publicShare", iconClass: 'share_tem' ,id:"bgdgx"},
- { text: '撤销',click: "noPublish", iconClass: 'release_tem' ,id:"bgdcx"}
- ],
- roleCons:roleCons};
- /**
- * 树形列
- */
- var grid_option1 = {
- columns: [
- {display : '文件标题',name : 'FILE_TITLE_231', align : 'center',width : '15%',isPrimaryKey:true,
- // render : function(rowdata, value) {
- // return '<a href="javascript:void(0)" '
- // + 'onclick=jumpPage("'
- // + rowdata.FD_OBJECTID231
- // +'")>'+ rowdata.FILE_TITLE_231 +'</a>';
- // }
- render : function(rowdata, rowindex, value, column) {
- return "<a href='javascript:;' style='width:100%;height:100%;display:block' title='" + value + "' onclick='openDetail(" + rowindex + ")'>" + value + "</a>";
- }
- },
- {display : '发布单位',name : 'PUBLISH_COMP_ID_231_SHOW', align : 'center',width : '15%'},
- {display : '文件分类',name : 'FILE_CLASSIFY_231_SHOW', align : 'center',width : '10%'},
- {display : '发文日期',name : 'FILE_ADD_DATE_231', align : 'center',width : '10%'},
- {display : '归档人',name : 'PIGEONHOLE_MAN_ID_231_SHOW', align : 'center',width : '10%'},
- {display : '归档日期',name : 'PIGEONHOLE_DATE_231', align : 'center',width : '10%'},
- // {display : '文件摘要',name : 'FILE_CONTENT_231', align : 'center',width : '10%'},
- // {display : '变更说明',name : 'CHANGE_DETAIL_231', align : 'center',width : '10%'},
- {display : '保密等级',name : 'COLUMN_2_231_SHOW', align : 'center',width : '10%'},
- {display : '状态',name : 'CHANGE_TYPE_231_SHOW', align : 'center',width : '10%'},
- // {display : '电子文件',name : 'ELECTRONIC_FILE_231', align : 'center',width : '7%'},
- { display: '操作', isAllowHide: false, align: 'center', width:'10%',
- render: function (rowdata, rowindex, value, column){
- //判断是否已经发布。取发布的状态,如果已经发布为“1”;未发布为“0”
- var fabu='';//fabu
- if(rowdata.FABU_231=="1"){
- fabu = '<div class="c_toolcontent"><span class="fashang_07 hand" title="发布" onclick="onPublish1()"></span></div>';
- }else{
- fabu = '<div class="c_toolcontent"><span class="fashang_06 hand" title="发布" onclick="onPublish(' + rowindex + ')"></span></div>';
- }
- //判断是否已经发布。取发布的状态,如果已经上报为“1”;未上报为“0”fashang_09
- var shangbao='';
- if(rowdata.SHANGBAO_231=="1"){
- shangbao = '<div class="c_toolcontent"><span class="sendup_templan hand" title="上报" onclick="shangbao1()"></span></div>';
- }else{
- shangbao = '<div class="c_toolcontent"><span class="fashang_plan hand" title="上报" onclick="onReport(' + rowindex + ')"></span></div>';
- }
- //共享
- var gongxiang='';
- if(rowdata.IS_SHARE_231=="1"){
- gongxiang = '<div class="c_toolcontent"><span class="share_07 hand" title="撤销共享" onclick="noShare(' + rowindex + ')"></span></div>';
- }else{
- gongxiang = '<div class="c_toolcontent"><span class="share_03 hand" title="共享" onclick="onShare(' + rowindex + ')"></span></div>';
- }
- return fabu
- /*+ shangbao*/ + gongxiang;
-
- }
- }
-
- ],
- rownumbers : true,
- checkbox : true,
- pageSize : 10,
- percentWidthMode : true
- };
-
- var options1={
- url :'/nwyj/ws/crud/CRUDService/queryQui',
- params:loadParams,
- width:'100%',
- sortName : 'UPDATEDATE_231',
- gridOptions:grid_option1,
- singleRecodeOptions:{a:"aa"},
- paperOpration:{showInput:"true"},
- toolBarOptions:toolBarOpt1
- };
- g=gridAndSingleRecode=$("#maingrid").quickgridAndSingleRecode(options1);
-
- /*// showAndHide();
- g = $("#maingrid").quiGrid({
- columns: [
- // {name : 'FD_OBJECTID',hide : true},
- {display : '标题',name : 'FILE_TITLE_231', align : 'center',width : '250'},
- {display : '分类',name : 'FILE_CLASSIFY_231_SHOW', align : 'center',width : '200'},
- // {display : '发布状态',name : 'FILE_STATUS_230_SHOW', align : 'center',width : '10%'},
- // {display : '上报状态',name : 'SHANGBAO_230_SHOW', align : 'center',width : '10%'},
- {display : '发布日期',name : 'FILE_ADD_DATE_231', align : 'center',width : '200'},
- {display : '归档人',name : 'PIGEONHOLE_MAN_ID_231_SHOW', align : 'center',width : '180'},
- {display : '归档日期',name : 'PIGEONHOLE_DATE_231', align : 'center',width : '220'},
- {display : '变更说明',name : 'CHANGE_DETAIL_231', align : 'center',width : '240'},
- {display : '保密等级',name : 'COLUMN_2_231_SHOW', align : 'center',width : '110'},
- {display : '状态',name : 'CHANGE_TYPE_231_SHOW', align : 'center',width : '133'},
- {display : '电子文件',name : 'ELECTRONIC_FILE_231', align : 'center',width : '110'},
- { display: '操作', isAllowHide: false, align: 'left', width:100,
- render: function (rowdata, rowindex, value, column){
- //判断是否已经发布。取发布的状态,如果已经发布为“1”;未发布为“0”
- var fabu='';//fabu
- if(rowdata.FABU_231=="1"){
- fabu = '<span class="fashang_06 hand" title="发布" onclick="onPublish1()"></span>';
- }else{
- fabu = '<span class="fashang_07 hand" title="发布" onclick="onPublish(' + rowindex + ')"></span>';
- }
- //判断是否已经发布。取发布的状态,如果已经上报为“1”;未上报为“0”fashang_09
- var shangbao='';
- if(rowdata.SHANGBAO_231=="1"){
- shangbao = '<span class="fashang_plan hand" title="上报" onclick="shangbao1()"></span>';
- }else{
- shangbao = '<span class="sendup_templan hand" title="上报" onclick="onReport(' + rowindex + ')"></span>';
- }
- return fabu
- + shangbao;
-
- }
- }
-
- ],
- url :$.pathname() + '/ws/crud/CRUDService/queryQui',
- params : loadParams,
- sortName : 'UPDATEDATE_231',
- sortOrder : 'desc nulls last',
- rownumbers:true,
- checkbox:true,
- height: '99%',
- width:"100%",
- pageSize: 10,
- percentWidthMode:true,
- //顶部图标按钮栏
- toolbar:
- {
- items: [
- { text: '新增' ,click:onAdd,iconClass: 'add1_tem', disabled: false },//OK
- { line: true },
- { text: '删除' ,click:onDelete,iconClass: 'delete_tem', disabled: false },
- { line: true },
- { text: '修改' ,click:onEdit,iconClass: 'update_tem', disabled: false },
- { line: true },
- { text: '查看详情',click:onView,iconClass: 'view_tem', disabled: false },
- { line: true },
- { text: '查看历史版本' ,click:onViewHistory,iconClass: 'icon_history', disabled: false },
- { line: true },
- { text: '导入' , click:onImport,iconClass: 'import_tem', disabled: false },
- { line: true },
- { text: '导出' , click:exportTotalData,iconClass: 'icon_export', disabled: false },
- { line: true },
- { text: '下载' ,click:onDownLoad,iconClass: 'download_tem', disabled: false },
- { line: true },
- ]
- }
- });*/
- }
-
- function onPublish1(){
- top.Dialog.alert("该文件已经发布!");
- }
-
- function shangbao1(){
- top.Dialog.alert("该文件已经上报!");
- }
-
- //点击查看
- function jumpPage(id){
- window.location.href="FileEMInfo.jsp?"+id;
- }
- function showPrimaryKey(obj,index){
- var fd_id = obj.FD_OBJECTID231;
- window.location.href="FileEMInfo.jsp?"+fd_id;
- }
-
- //导出
- function exportTotalData(){
- var rows = g.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- excelExport(
- 231,
- loadParams,
- "保供电制度文件",
- "IS_DEL,UPDATEDATE,FD_OBJECTID,COLUMN_1,COLUMN_3,COLUMN_4,PUBLISH_COMP_ID,FILE_STATUS,VERSION_ID,SHANGBAO,FABU,REPORT_COMP_ID"
- );
- return;
- }
- var ids = "";
- for ( var i = 0; i < rowsLength; i++) {
- ids += "'"+rows[i].FD_OBJECTID231+"'" + ",";
- }
- var temp = ids.substring(0,ids.length-1);
- // alert(temp);
-
- var condition = " IS_DEL='0' ";
- condition += " AND FD_OBJECTID IN (" + temp + ") " ; //'%" +name+"%';
- var sql = {
- "listId" :'231' ,
- "condition" : condition
- };
- excelExport(
- 231,
- sql,
- "保供电制度文件",
- // ['IS_DEL','UPDATEDATE','FD_OBJECTID','COLUMN_1','COLUMN_3','COLUMN_4','PUBLISH_COMP_ID','FILE_STATUS','VERSION_ID','SHANGBAO','FABU','REPORT_COMP_ID']
- "IS_DEL,UPDATEDATE,FD_OBJECTID,COLUMN_1,COLUMN_3,COLUMN_4,PUBLISH_COMP_ID,FILE_STATUS,VERSION_ID,SHANGBAO,FABU,REPORT_COMP_ID"
- );
-
- }
- //查询
- //function searchHandler() {
- // var title = $('#FILE_TITLE_231').val();//标题
- // var classify = $('#FILE_CLASSIFY_231').val();//分类
- // var type = $('#CHANGE_TYPE_231').val();//更新类别
- // //时间区间
- // var date1 = $('#DATE1').val();
- // var date2 = $('#DATE2').val();
- // //var userId = row.PIGEONHOLE_MAN_ID_231;
- // var condition = "IS_DEL=0 and ( FABU='1' or PIGEONHOLE_MAN_ID='"+getUser_id+"') ";
- //
- // var baomidengji = $("#COLUMN_2_231").val();//保密等级
- //
- // if(title!=""&&title!="请输入文件名称"){
- // condition += " AND FILE_TITLE LIKE '%" +title+"%'";
- // }
- // if(baomidengji!=""){
- // condition += " AND COLUMN_2 LIKE '%" +baomidengji+"%'";
- // }
- // if(classify!=""){
- // condition += " AND FILE_CLASSIFY = '" + classify + "' ";
- // }
- // if(type!=""){
- // condition += " AND CHANGE_TYPE = '" + type + "' ";
- // }
- // //日期
- // if(date1!="" && date2!=""){
- // condition += " AND FILE_ADD_DATE BETWEEN '" + date1 +"' AND '" + date2 + "' ";
- // }
- // if(date1!="" && date2==""){
- // condition += " AND FILE_ADD_DATE >= '" + date1 +"' " ;
- // }
- // if(date1=="" && date2!=""){
- // condition += " AND FILE_ADD_DATE <= '" + date2 + "' ";
- // }
- // g.setOptions({// 重置加载列表的参数
- // params : {
- // "listId" : '231',
- // "condition" : condition,
- // direction:'DESC',
- // sort: 'UPDATEDATE'
- // }
- // });
- // g.rend();
- //}
- // function searchHandler(){
- // $queryForm = $("#queryForm");
- // if($("#FILE_TITLE_231").val()=="请输入文件名称"){
- // $("#FILE_TITLE_231").val("");
- // }
- // $queryForm.serialize();
- // //获取选中的值
- // var searchCondition = getSelectCon(conditionData);
- // var queryParams = getQueryFormParams($queryForm);
- // var params=$.extend({},loadParams,queryParams);
- //
- // var startTime=$("#startTime").val();
- // var endTime=$("#endTime").val();
- // var startDate=$("#startDate").val();
- // var endDate=$("#endDate").val();
- // if(startTime != null && startTime != "" && endTime != null && endTime != ""){
- // /*startTime = startTime +" 00:00";
- // endTime = endTime +" 23:59";*/
- // var condition1 = " and FILE_ADD_DATE between '"+startTime+"' and '"+endTime+"'";
- // params.condition = params.condition + condition1;
- // }else if(startDate != null && startDate != "" && endDate != null && endDate != ""){
- // /*startDate = startDate+" 00:00";
- // endDate = endDate +" 23:59";*/
- // var condition2 = " and PIGEONHOLE_DATE between '"+startDate+"' and '"+endDate+"'";
- // params.condition = params.condition + condition2;
- // }else{
- // var searchCondition = getSelectCon(conditionData);
- // params.condition = searchCondition.condition + params.condition;
- // }
- //
- //// alert(params.condition);
- //
- // //与之前参数条件拼接
- // params.condition = searchCondition.condition + params.condition;
- // g.setOptions({"params":params});
- // //加载数据
- // g.rend();
- // }
-
- function searchHandler(){
-
- $queryForm = $("#queryForm");
- if($("#FILE_TITLE_231").val()=="请输入文件标题"){
- $("#FILE_TITLE_231").val("");
- }
- $queryForm.serialize();
- var $comp_id = $("#selectConditions").find(".PUBLISH_COMP_ID");
- var loadParams11;
- //判断是否有用单位做查询条件
- if(!!$comp_id.prop("outerHTML")){
-
- loadParams11 = {
- "listId" : '231',
- "condition" : " IS_DEL='0' and FABU='1' ",
- direction:'DESC',
- sort: 'UPDATEDATE'
- };
- }else{
-
- loadParams11 = $.extend({},loadParams,loadParams);
- }
- //获取选中的值
- var searchCondition = getSelectCon(conditionData);
- var queryParams = getQueryFormParams($queryForm);//拼接出来的条件
- var params=$.extend({},loadParams11,queryParams);// 默认
- //与之前参数条件拼接
- params.condition = searchCondition.condition + params.condition;
- // alert(JSON.stringify(params));
- g.setOptions({"params":params});
- //加载数据
- g.rend();
- }
-
-
-
- //新增
- function onAdd(){
- window.location.href="FileEMAdd.jsp";
- }
- function onDelete(){
- var rows = g.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要删除的记录!");
- return;
- }
- var ids = "";
- for ( var i = 0; i < rowsLength; i++) {
- ids += rows[i].FD_OBJECTID231 + ",";
-
- if(rows[i].FABU_231=="1"||rows[i].SHANGBAO_231=="1"){
- if(rows[i].FABU_231=="1"){
- top.Dialog.alert("您选中的文件已经发布!");
- }else if(rows[i].SHANGBAO_231){
- top.Dialog.alert("您选中的文件已经上报!");
- }
- return;
- }
-
- if(rows[i].PIGEONHOLE_MAN_ID_231!=getUser_id){
- top.Dialog.alert("只能刪除自己上传的文件!");
- return;
- }
- }
-
- top.Dialog.confirm("确定要删除吗?|删除", function() {
- // 删除记录
-
- $.post($.pathname() +"/ws/crud/CRUDService/delete/", {
- "objectIDs" : ids,
- classid : 231
- }, function(result) {
- if (result.Msg.sucsess == true) {
- $.messager.alert("删除成功",null,null,null,-1);
- // 刷新表格数据
- g.rend();
- } else {
- top.Dialog.alert("删除失败!");
- }
- }, "json");
-
- });
- }
- //修改
- function onEdit(){
- var rows = g.getSelectedRows();
- if (rows.length == 0) {
- top.Dialog.alert("请选择一条记录");
- return;
- }
- if (rows.length > 1) {
- top.Dialog.alert("只能选择一条记录");
- return;
- }
- //归档人
- //只能修改自己上传的文件
- var userIds = rows[0].PIGEONHOLE_MAN_ID_231;
- if(userIds!=getUser_id){
- top.Dialog.alert("只能修改自己上传的文件!");
- return;
- }
- //上报或发布的不能修改
- var shangbao = rows[0].SHANGBAO_231;
- var fabu = rows[0].FABU_231;
- if(shangbao=="1"){
- top.Dialog.alert("上报的文件不能修改!");
- return;
- }else if(fabu=="1"){
- top.Dialog.alert("发布的文件不能修改!");
- return;
- }
- // if(PIGEONHOLE_MAN_ID_231!=tianbaorenID){
- // top.Dialog.alert("不能修改别人上传的文件!");
- // return;
- // }
- var fd_id = rows[0].FD_OBJECTID231;
- window.location.href="FileEMEdit.jsp?"+fd_id;
- };
- //查看详情
- function onView(){
- var rows = g.getSelectedRows();
- if (rows.length == 0) {
- top.Dialog.alert("请选择一个文件");
- return;
- }
- if (rows.length > 1) {
- top.Dialog.alert("只能选择一个文件");
- return;
- }
-
- var fd_id = rows[0].FD_OBJECTID231;
- window.location.href="FileEMInfo.jsp?"+fd_id;
- // var fd_id = rows[0].FD_OBJECTID231;
- // var url = "FileEMInfo.jsp?"+fd_id;
- // window.parent.document.setAttribute("src", "/nwyj/page/business/am/file/"+url);
- }
-
- this.openDetail = function(rowindex) {
- var row = g.getRow(rowindex);
- var fd_id = row.FD_OBJECTID231;
- window.location.href="FileEMInfo.jsp?"+fd_id;
- };
-
- //上报
- function onReport(data){
- var row = g.getRow(data);
- var fd_id = row.FD_OBJECTID231;
- //只能上报自己上传的文件
- var userId = row.PIGEONHOLE_MAN_ID_231;
- if(getUser_id!=userId){
- top.Dialog.alert("只能上报自己上传的文件!");
- return;
- }
- top.Dialog.confirm("确定要上报吗?|上报", function() {
- // 上报
- $.post($.pathname() +"/ws/EmcPlan/EmgencyPlanService/bgdfileShangbao/", {
- //当前单位id
- comp_id : dpids,
- fd_id : fd_id,
- }, function(result) {
- if (result.Msg.sucsess == true) {
- $.messager.alert("上报成功",null,null,null,-1);
- //消息推送
- fillShangbao(data);
- // 刷新表格数据
- g.rend();
- } else {
- top.Dialog.alert("上报失败!");
- }
- }, "json");
-
- });
- }
- //上报前先给上级单位公共消息库里插入一条记录
- /**
- * 1、取本级单位ID
- * 2、上报人ID
- * 3、上报消息主键
- * 4、服务名称(URL)
- **/
- function fillShangbao(data){
- var row = g.getRow(data);
- var fd_id = row.FD_OBJECTID231;
- remark=fd_id;
- //向后台发送请求调用dwr
- var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/sendMsgDwr/';
- var msg = "<a href=\"javascript:void(0)\" onclick=\"openY('/nwyj/page/business/am/public/FileEMInfo.jsp?"+fd_id+"')\">"+corp_name+"的保供电制度文件</a>";
- //var msg = "<a href=\"javascript:void(0)\" onclick=\"openY('/nwyj/page/business/am/contingencyPlan/PlanAdd.jsp')\">应急预案</a>";
- var params = {
- parentDeptName:parentId,
- msg:msg
- };
-
- $.ajax({
- url : url,
- type : 'post',
- data : params,
- dataType : 'text',
- timeout : 60000,
- success : function(data){
- },
- error : function(){
- $.messager.alert('操作失败');
- }
-
- });
- }
-
- //发布
- function onPublish(data){
- var row = g.getRow(data);
- //只能上报自己上传的文件
- var userId = row.PIGEONHOLE_MAN_ID_231;
- if(getUser_id!=userId){
- top.Dialog.alert("只能发布自己上传的文件!");
- return;
- }
- top.Dialog.confirm("确定要发布吗?|发布", function() {
- var fd_id = row.FD_OBJECTID231;
- // 发布规范文件
- $.post($.pathname() +"/ws/EmcPlan/EmgencyPlanService/bgdfileFabu/", {
- comp_id : dpids,
- fd_id : fd_id,
- }, function(result) {
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("发布成功");
- // 刷新表格数据
- g.rend();
- } else {
- top.Dialog.alert("发布失败!");
- }
- }, "json");
-
- }
- );
-
- }
- //撤回
- function onCallBack(rowid){
- top.Dialog.confirm("确定要撤回吗?|撤回", function() {
- if(status=="0"){
- top.Dialog.alert("只能撤回已发布或已上报的文件");
- return;
- }
- // 发布规范文件
- $.post($.pathname() +"/ws/SystemFile/SystemFileService/callBack", {
- "fd_id" : rowid
- }, function(result) {
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("撤回成功",null,null,null,1);
- // 刷新表格数据
- g.rend();
- } else {
- top.Dialog.alert("撤回失败!");
- }
- }, "json");
-
- });
-
- }
- //下载
- function onDownLoad(){
- var rows = g.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要下载的文件!");
- return;
- }
-
- var fd_id = rows[0].FD_OBJECTID231;
- showFile(fd_id);
- }
-
- function showFile(fd_id){
- var diag = new top.Dialog();// 定义一个窗口对象
- diag.Title = "下载";// 窗口标题
- diag.URL = $.pathname() +"/page/business/am/base/showDownloadFile.html?fd_id="+fd_id;// 窗口对应的页面
- diag.Height = 400;
- diag.ShowOkButton=false;// 不显示确认按钮
- diag.ShowCancelButton=false;// 不显示取消按钮
- diag.ButtonAlign="center";// 按钮居中
- diag.show();// 显示窗口
- }
- //共享 单一的
- function onShare(data){
- var row = g.getRow(data);
- var fd_id = row.FD_OBJECTID231+",";
- //只能共享以及发布的文件
- if(row.FABU_231!="1"){
- top.Dialog.alert("只能共享已经发布的文件!");
- return;
- }
- //只能共享自己上传的文件
- var REMARK1 = row.PIGEONHOLE_MAN_ID_231;
- if(REMARK1!=getUser_id){
- top.Dialog.alert("只能共享自己上传的文件!");
- return;
- }
- top.Dialog.confirm("确定要共享吗?|共享", function() {
- // 发布规范文件
- $.post($.pathname() +"/ws/FILEPOLL/FileAMService/FileEMShare/", {
- fd_id : fd_id,
- }, function(result) {
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("共享成功");
- // 刷新表格数据
- g.rend();
- } else {
- top.Dialog.alert("共享失败!");
- }
- }, "json");
-
- });
-
- }
- //撤销共享
- function noShare(data){
-
- var row = g.getRow(data);
- var fd_id = row.FD_OBJECTID231+",";
- //只能撤销自己上传的文件
- var REMARK1 = row.PIGEONHOLE_MAN_ID_231;
- if(REMARK1!=getUser_id){
- top.Dialog.alert("只能撤销自己上传的文件!");
- return;
- }
- top.Dialog.confirm("确定要撤销共享吗?|撤销", function() {
- // 发布规范文件
- $.post($.pathname() +"/ws/FILEPOLL/FileAMService/noFileEMShare/", {
- fd_id : fd_id,
- }, function(result) {
- if (result.Msg.sucsess == true) {
- top.Dialog.alert("撤销成功");
- // 刷新表格数据
- g.rend();
- } else {
- top.Dialog.alert("撤销失败!");
- }
- }, "json");
-
- });
-
- }
-
- //导入
- function onImport(){
- window.location.href="FileEM-import.jsp";
- }
- //查看历史版本
- function onViewHistory(){
-
- var rows = g.getSelectedRows();
- if(rows.length==0){
- top.Dialog.alert("请选择一条记录");
- return;
- }
- if(rows.length>1){
- top.Dialog.alert("只能选择一条记录");
- return;
- }
- //上一个版本的预案ID
-
- var fd_id = rows[0].COLUMN_1_231;
- var fd_id1 = rows[0].FD_OBJECTID231;
- window.location.href="FileEMVersion.jsp?"+fd_id+"?" + fd_id1;
- }
- //更多
- function more(){
- $('#moreDiv').toggle(400,function(){
- $("#emptyCondition").click();
- $(parent.document.body).find("#frmright").height($(window.document.body).height()+30);
- });
- }
- //汇总统计
- function sumUnit(){
- window.location.href="FileEM-poll.jsp";
- }
-
- //共享
- function publicShare(){
- var rows = g.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要共享的记录!");
- return;
- }
-
- var REMARK1 = rows[0].PIGEONHOLE_MAN_ID_231;
- if(REMARK1!=getUser_id){
- top.Dialog.alert("只能共享自己上传的文件!");
- return;
- }
-
- var ids = "";
- var sturtssb = "";
- for ( var i = 0; i < rowsLength; i++) {
- ids += rows[i].FD_OBJECTID231 + ",";
- sturtssb += rows[i].FABU_231 + ",";
- if(rows[i].FABU_231!="1"){
- if(rowsLength==1){
- top.Dialog.alert("您选中的记录未发布!");
- }else{
- top.Dialog.alert("您选中的记录有未发布的!");
- }
- return;
- }
- if(rows[i].IS_SHARE_231 == "1"){
- if(rowsLength==1){
- top.Dialog.alert("您选中的记录已共享!");
- }else{
- top.Dialog.alert("您选中的记录中包含已共享的!");
- }
- return;
- }
- }
-
- /* $("#BUSINE_ID_217").val(ids);
-
- var diag = new top.Dialog();
- diag.Title = "文件共享";
- diag.URL = $.pathname() + '/page/business/am/public/readDept.jsp';
- diag.Width = 700;
- diag.Height = 500;
- diag.Top = "80%";
- diag.Left = "50%";
- diag.ShowButtonRow=true;
- diag.ButtonAlign = 'center';
- diag.OkButtonText="确 定";
- diag.OKEvent = function(){
- Validate(diag);
- *//******改变共享字段的值,即改变共享状态***************//*
- for(var i=0;i<rowsLength;i++){
- var fd_id = rows[i].FD_OBJECTID231;
- var is_share=rows[i].IS_SHARE_231;
- if(is_share==1){
- top.Dialog.alert("包含已共享记录,请重新选择");
- return;
- }
- var params = {
- classid : "231",
- FD_OBJECTID231 : fd_id,
- IS_SHARE_231 : '1'
- };
- //top.Dialog.confirm("确定要共享吗?|共享", function() {
- $.ajax({
- url : $.pathname() + '/ws/crud/CRUDService/updateWarning/',
- type : 'post',
- timeout : 15000,
- data : params,
- dataType : 'json',
- success : function(data) {
- top.Dialog.alert('成功共享!', null, null, null, -1);
- g.rend();
- },
- error : function(e) {
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- //});
- }
- *//******改变改变共享字段的值,即改变共享状体***************//*
- };
- diag.show(); */
-
- top.Dialog.confirm("确定要共享吗?|共享", function() {
- $.post($.pathname() +"/ws/FILEPOLL/FileAMService/FileEMShare/", {
- fd_id : ids,
- }, function(result) {
- if (result.Msg.sucsess == true) {
- $.messager.alert("共享成功");
- // 刷新表格数据
- g.rend();
- } else {
- top.Dialog.alert("共享失败!");
- }
- }, "json");
-
- });
-
- }
- /* 废弃 */
- function Validate(diag){
- var zhh="";//总指挥
- var fzhh="";//副总指挥
- var yjbzr="";//应急办主任
- var yjbfzr="";//应急办副主任
- var yjbcy="";//应急办副成员
- var zyglry="";//专业部门管理人员
-
- var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+""; //登录人ID
- //分享单位的ID deptId
- var time1=diag.innerFrame.contentWindow.$("#time1").val();
- var time2=diag.innerFrame.contentWindow.$("#time2").val();
-
-
- //获取应急角色被勾选的值
- if(diag.innerFrame.contentWindow.document.getElementById("football-1").checked){
- //选中取值(可以取到这个值)
- zhh = "R002105430201";
- }else{
- zhh = "";
- }
-
- if(diag.innerFrame.contentWindow.document.getElementById("football-2").checked){
- //选中取值(可以取到这个值)
- fzhh = "R002105430202";
- }else{
- zyglry = "";
- }
-
- if(diag.innerFrame.contentWindow.document.getElementById("football-3").checked){
- //选中取值(可以取到这个值)
- yjbzr = "R002105430203";
- }else{
- yjbzr = "";
- }
-
- if(diag.innerFrame.contentWindow.document.getElementById("football-4").checked){
- //选中取值(可以取到这个值)
- yjbfzr = "R002105430204";
- }else{
- yjbfzr = "";
- }
-
- if(diag.innerFrame.contentWindow.document.getElementById("football-5").checked){
- //选中取值(可以取到这个值)
- yjbcy = "R002105430205";
- }else{
- yjbcy = "";
- }
-
- if(diag.innerFrame.contentWindow.document.getElementById("football-6").checked){
- //选中取值(可以取到这个值)
- zyglry = "R002105430206||R002105430207||R002105430208||R002105430209||R002105430210||R002105430211||R002105430212||R002105430213||R002105430214";
- }else{
- zyglry = "";
- }
-
-
- //被分享查看的人
- var RECEIVE_MAN = zhh + "||" + fzhh + "||" + yjbzr + "||" + yjbfzr + "||" + yjbcy + "||" + zyglry;
-
- //分享的单位 deptId
-
- //获取zTree对象
- var zTree = diag.innerFrame.contentWindow.$.fn.zTree.getZTreeObj("tree-1");
- //得到选中的数据集
- var checkedNodes = zTree.getCheckedNodes(true);
- if(time1==""||time2==""){
- $.messager.alert('请选择分享的起始时间!');
- return;
- }
- if(time1>time2){
- $.messager.alert('请选择正确的分享起始时间!');
- return;
- }
- if(checkedNodes==""){
- $.messager.alert('请选择要申请查看的单位!');
- return;
- }
- var compValue="";
- //var compValue2="";
- for(var i = 0; i < checkedNodes.length; i++){
- //机构名称
- compValue += checkedNodes[i].id + ",";
- //compValue2 += checkedNodes[i].name+",";
- }
- var compid = compValue.substring(0,compValue.length-1);
- //var compname = compValue2.substring(0,compValue2.length-1);
-
- //给第二个form的字段设置值
- $("#SHARE_MAN_217").val(getUser_id); //SHARE_MAN_217 分享人
- $("#SHARE_UNITS_217").val(deptId); //SHARE_UNITS_217分享单位
- $("#RECEIVE_UNITS_217").val(compid); //RECEIVE_UNITS_217 被分享单位
- //SHARE_TYPE_217分享的业务类型 写死3
- $("#SHARE_START_TIME_217").val(time1); //SHARE_START_TIME_217开始时间
- $("#SHARE_END_TIME_217").val(time2); //SHARE_END_TIME_217结束时间
- //BUSINE_ID_217业务ID 点击分享的时候已经赋值给页面了
- $("#RECEIVE_MAN_217").val(RECEIVE_MAN); //RECEIVE_MAN_217接收的人
-
- var $form = $('#fillForm1');
- var url = $.pathname() + '/ws/crud/CRUDService/create';
- $.ajax({
- url : url,
- type : 'post',
- data : $form.serialize(),
- dataType : 'text',
- timeout : 60000,
- success : function(data){
- $.messager.alert("共享成功",null,null,null,-1);
- },
- error : function(){
- $.messager.alert('操作失败');
- }
-
- });
-
- top.Dialog.close();//关闭新增窗口
- }
-
- //撤销
- function noPublish(){
- var rows = g.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要撤销的记录!");
- return;
- } else if (rowsLength > 1) {
- top.Dialog.alert("请选中一条要撤销的记录!");
- return;
- }
-
- var ids = "";
- for ( var i = 0; i < rowsLength; i++) {
- ids += rows[i].FD_OBJECTID231 + ",";
- var Bcompid = rows[i].PUBLISH_COMP_ID_231;
- if(deptId!=Bcompid){
- top.Dialog.alert("只能撤销本单位的文件!");
- return;
- }
- if(rows[i].FABU_231!="1"){
- top.Dialog.alert("您选中的记录还没有发布!");
- return;
- }
- }
- top.Dialog.confirm("确定要撤销发布吗?|撤销", function() {
- $.post($.pathname() +"/ws/FILEPOLL/FileAMService/noPublish/", {
- fd_id : ids,
- }, function(result) {
- if (result.Msg.sucsess == true) {
- $.messager.alert("撤销成功",null,null,null,-1);
- // 刷新表格数据
- g.rend();
- } else {
- top.Dialog.alert("撤销失败!");
- }
- }, "json");
- });
- }
-
- $.messager=top.Dialog;
-
- function showPrimaryKey(obj,index){
- var fd_id = obj.FD_OBJECTID231;
- $('#frmright', window.parent.document).attr('src',$.pathname()+'/page/business/am/PPSFile/FileEMInfo.jsp?'+fd_id);
- }
|