123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029 |
- laws = function() {
- /** 定义变量* */
- var _this = this;
- _this.listGrid = null;// 数据列表
- //_this.searchPanel = null; // 查询面板
- $queryForm = null;// 查询区域表单
- $searchButt = null;// 查询按钮
- $more = null; // 更多
- _this.loadParams = null;// 列表加载参数
-
- //取登录人应急角色
- var Roleid = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids() + ",";
- var roleidTemp =Roleid.split(",");
- var flag="0";
-
-
-
- /** *新增信息** */
- _this.addForm = function() {
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/laws/laws_add.jsp");
- };
- /** *修改、删除信息 各级单位的超级管理员可以修改表单信息。湛江局许永山提的建议 2016-05-31** */
- _this.editForm = function() {
-
-
- var rows = _this.listGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要修改的记录!");
- return;
- } else if (rowsLength > 1) {
- top.Dialog.alert("请选中一条要修改的记录!");
- return;
- } else {
- for(var i=0; i< roleidTemp.length; i++){
- if(roleidTemp[i]=="R002105430200"){
- flag="1";
- }
- }
-
- if(rows[0].COLUMN_3_243=="1"&&flag=="0"){
- top.Dialog.alert("发布后的记录不能够修改!");
- return;
- }
- var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- if(getUser_id!=rows[0].TYPEIN_PEOPLE_243&&flag=="0"){
- top.Dialog.alert("只能修改自己上传的文件!");
- return;
- }
- var fd_id = rows[0].FD_OBJECTID243;
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/laws/laws_edit.jsp?"+fd_id);
- }
- };
- /** *删除信息** */
- _this.del = function(){
-
- var rows = _this.listGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要删除的记录!");
- return;
- }
- for(var i=0; i< roleidTemp.length; i++){
- if(roleidTemp[i]=="R002105430200"){
- flag="1";
- }
- }
-
- var ids = "";
- var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- var flag1 = false;
- for ( var i = 0; i < rowsLength; i++) {
- ids += rows[i].FD_OBJECTID243 + ",";
- if(rows[i].COLUMN_3_243=="1"&&flag=="0"){
- if(rowsLength==1){
- top.Dialog.alert("您选中的记录已发布,不能删除!");
- }else{
- top.Dialog.alert("您选中的记录中有已发布的,不能删除!");
- }
- return;
- }
- if(getUser_id!=rows[i].TYPEIN_PEOPLE_243&&flag=="0"){
- if(rowsLength==1){
- top.Dialog.alert("您只能删除您自己上传的文件记录!");
- }else{
- top.Dialog.alert("您只能删除您自己上传的文件记录!");
- }
- return;
- }
- $.ajax({
- url : $.pathname() + '/ws/crud/CRUDService/getDataById/',
- type : 'post',
- timeout : 60000,
- data : { classid : '800', objectID : rows[i].UNITE_243 },
- async:false, //异步
- dataType : 'json',
- success : function(data){
- if(data.DEPT_LEVEL_800<dept_level){
- flag1 = true;
- }
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
- if(flag1){
- top.Dialog.alert("不能删除上级的记录!");
- return;
- }else{
- top.Dialog.confirm("确定要删除吗?|删除", function() {
- // 删除记录
-
- $.post($.pathname() +"/ws/crud/CRUDService/delete/", {
- "objectIDs" : ids,
- classid : 243
- }, function(result) {
- if (result.Msg.sucsess == true) {
- $.messager.alert("删除成功",null,null,null,1);
- // 刷新表格数据
- _this.listGrid.rend();
- } else {
- top.Dialog.alert("删除失败!");
- }
- }, "json");
-
- });
- }
- };
- /** **查看详细信息*** */
- _this.show = function() {
- var rows = _this.listGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要查看的记录!");
- return;
- } else if (rowsLength > 1) {
- top.Dialog.alert("请选中一条要查看的记录!");
- return;
- } else {
- var fd_id = _this.listGrid.getSelectedRow().FD_OBJECTID243;
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/laws/laws_view.jsp?"+fd_id);
- }
- };
- //点击主键跳转详细信息页面
- _this.openDetail = function(rowindex) {
- var row = _this.listGrid.getRow(rowindex);
- var fd_id = row.FD_OBJECTID243;
- // $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/laws/laws_view.jsp?"+fd_id);
- $.indexOpenNextWindow("/nwyj/page/business/am/fileManager/laws/laws_view.jsp?"+fd_id);
- };
-
- /** **历史版本*** */
- _this.onhistory = function() {
- var rows = _this.listGrid.getSelectedRows();
- if(rows.length==0){
- top.Dialog.alert("请选择一条记录");
- return;
- }
- if(rows.length>1){
- top.Dialog.alert("只能选择一条记录");
- return;
- }
- //上一个版本的预案ID
- // var fd_id = rows[0].OBJ_FIRST_243;
- var fd_id = rows[0].FD_OBJECTID243;
-
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/laws/laws_version.jsp?"+fd_id);
- };
- /** **导出*** */
- _this.exportTotalData = function() {
- var rows = _this.listGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.confirm("是否导出所有的文件信息?|是", function() {
- var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+"";
- var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
- var loadParams ={
- "listId" :'243' ,
- // "condition" : "is_del='0' and(COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE in (select dept_id from SYS_DEPARTMENT where is_del ='0' and dept_type='1' start with dept_id='"+dpids+"' connect by prior parent_id = dept_id) ",
- "condition" : "is_del='0' and(COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE ='"+dpids+"' ",
- direction:'DESC',
- sort: 'UPDATEDATE'
- };
- excelExport(243,loadParams,"应急制度文件信息","IS_DEL,UPDATEDATE,FD_OBJECTID,COLUMN_1,COLUMN_2,COLUMN_3,COLUMN_4,OBJ_FIRST,VERSION,TYPEIN_PEOPLE_PHONE_NUM");
- });
- return;
- }
- var ids = "";
- for ( var i = 0; i < rowsLength; i++) {
- ids += "'"+rows[i].FD_OBJECTID243+"'" + ",";
- }
- var temp = ids.substring(0,ids.length-1);
-
- var condition = " IS_DEL='0' ";
- condition += " AND FD_OBJECTID IN (" + temp + ") " ; //'%" +name+"%';
- var sql = {
- "listId" :'243' ,
- "condition" : condition,
- direction:'DESC',
- sort: 'UPDATEDATE'
- };
- excelExport(243,sql,"应急制度文件","IS_DEL,UPDATEDATE,FD_OBJECTID,COLUMN_1,COLUMN_2,COLUMN_3,COLUMN_4,OBJ_FIRST,VERSION,TYPEIN_PEOPLE_PHONE_NUM");
- };
- /** 导入 */
- _this.showImportDialog = function() {
- window.location.href="laws-import.jsp";
- };
- /************************************** **下载*** *************************************************/
- _this.onDownLoad = function() {
-
- //批量打包下载
- var FD_OBJECTID = "";
- var rows = _this.listGrid.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);
- //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);
- }
- /****************************************************end******************************************************/
-
- /** **统计*** */
- _this.sum = function() {
- window.location.href="laws_poll.jsp";
- };
- // 查询
- // function search() {
- //
- // if($("#LAWS_REGULATIONS_NAME_243").val()=="法律法规"){
- // $("#LAWS_REGULATIONS_NAME_243").val("");
- // }
- // $queryForm.serialize();
- // var $comp_id = $("#selectConditions").find(".UNITE");
- // var loadParams11;
- // //判断是否有用单位做查询条件
- // if(!!$comp_id.prop("outerHTML")){
- //
- // loadParams11 = {
- // "listId" : '243',
- // "condition" : " IS_DEL='0' AND COLUMN_3='1' ",
- // direction:'DESC',
- // sort: 'UPDATEDATE'
- // };
- // }else{
- //
- // loadParams11 = $.extend({},_this.loadParams,loadParams);
- // }
- // var searchCondition = getSelectCon(conditionData);
- // var queryParams = getQueryFormParams($queryForm);
- // var params=$.extend({},loadParams11,queryParams);// 默认
- // params.condition = searchCondition.condition + params.condition;
- // _this.exportParams = params;
- // _this.listGrid.setOptions( {
- // params : params
- // });
- // _this.listGrid.rend();//加载数据
- // }
- function search(){
- if($("#LAWS_REGULATIONS_NAME").val()=="法律法规"){
- $("#LAWS_REGULATIONS_NAME").val("");
- }
- var name = $("#LAWS_REGULATIONS_NAME").val();
- //部门id
- var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- //登录人ID
- var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+"";
- //父部门id
- var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
- $queryForm.serialize();
- var $comp_id = $("#selectConditions").find(".UNITE");
- var loadParams11;
- //判断是否有用单位做查询条件
- if(!!$comp_id.prop("outerHTML")){
- if(name!=""){
- loadParams11 = {
- "listId" : '243',
- "condition" : " IS_DEL='0' AND (COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and (ISSUE_ORGANIZATION like '%"+name+"%' or LAWS_REGULATIONS_NAME like '%"+name+"%' or ISSUE_ARTICLE_NUM like '%"+name+"%' or ISSUE_DATE like '%"+name+"%' or IMPLEMENT_DATE like '%"+name+"%' or DESCRIPTION like '%"+name+"%')",
- direction:'DESC',
- sort: 'UPDATEDATE'
- };
- }else{
- loadParams11 = {
- "listId" : '243',
- "condition" : " IS_DEL='0' AND (COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) ",
- direction:'DESC',
- sort: 'UPDATEDATE'
- };
- }
- }else{
- if(name==""){
- loadParams11 = $.extend({},_this.loadParams,loadParams);
- }else{
- loadParams11 = {
- "listId" : '243',
- "condition" : " is_del='0' and (COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE in (select dept_id from SYS_DEPARTMENT where is_del ='0' and dept_type='1' start with dept_id='"+dpids+"' connect by prior parent_id = dept_id) and (ISSUE_ORGANIZATION like '%"+name+"%' or LAWS_REGULATIONS_NAME like '%"+name+"%' or ISSUE_ARTICLE_NUM like '%"+name+"%' or ISSUE_DATE like '%"+name+"%' or IMPLEMENT_DATE like '%"+name+"%' or DESCRIPTION like '%"+name+"%')",
- direction:'DESC',
- sort: 'UPDATEDATE'
- };
- }
-
- }
- var searchCondition = getSelectCon(conditionData);
-
- var ff = searchCondition.condition.split("and");
-
- var queryParams = getQueryFormParams($queryForm);
- var params=$.extend({},loadParams11,queryParams);// 默认
-
-
-
- params.condition = searchCondition.condition + params.condition;
- _this.exportParams = params;
- _this.listGrid.setOptions( {
- params : params
- });
-
- _this.listGrid.rend();//加载数据
- };
-
- _this.searchHandler2 = function(){
- if($("#LAWS_REGULATIONS_NAME").val()=="请输入法律法规名称"){
- $("#LAWS_REGULATIONS_NAME").val("");
- }
-
- //部门id
- var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- //登录人ID
- var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id()+"";
- //父部门id
- var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
-
- var name = $("#LAWS_REGULATIONS_NAME").val();
- var TAKE_DATE1 = $('#TAKE_DATE1').val();
- var TAKE_DATE2 = $('#TAKE_DATE2').val();
- var ISSUE_DATE1 = $('#ISSUE_DATE1').val();
- var ISSUE_DATE2 = $('#ISSUE_DATE2').val();
- var ISSUE_ORGANIZATION = $("#ISSUE_ORGANIZATION").val();
-
- var condition = "";
- if(zTreeCompId=="" || zTreeCompId==dpids){
- // condition = "is_del='0' and(COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE in (select dept_id from SYS_DEPARTMENT where is_del ='0' and dept_type='1' start with dept_id='"+dpids+"' connect by prior parent_id = dept_id)";
- condition = "is_del='0' and(COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE ='"+dpids+"' ";
- }else{
- condition = "is_del='0' and COLUMN_3='1' and UNITE='"+zTreeCompId+"' ";
- }
- if(name!=""){
- condition += " AND LAWS_REGULATIONS_NAME LIKE '%" +name+"%'";
- }
- if(ISSUE_ORGANIZATION!=""){
- condition += " AND ISSUE_ORGANIZATION LIKE '%" +ISSUE_ORGANIZATION+"%'";
- }
-
- /***************时间*******************/
-
- if((TAKE_DATE1!=""&&TAKE_DATE2=="")||(TAKE_DATE1==""&&TAKE_DATE2!="")){
- top.Dialog.alert("发布日期的开始日期或结束日期不能为空");
- return;
- }else if(TAKE_DATE1>TAKE_DATE2){
- top.Dialog.alert("发布日期的开始日期不能晚于结束日期");
- return;
- }else if(TAKE_DATE1!=""&&TAKE_DATE2!=""){
- condition += " AND ISSUE_DATE BETWEEN '"+TAKE_DATE1+"' AND '"+TAKE_DATE2+"' ";
- }
-
- if((ISSUE_DATE1!=""&&ISSUE_DATE2=="")||(ISSUE_DATE1==""&&ISSUE_DATE2!="")){
- top.Dialog.alert("实施日期的开始日期或结束日期不能为空");
- return;
- }else if(ISSUE_DATE1>ISSUE_DATE2){
- top.Dialog.alert("实施日期的开始日期不能晚于结束日期");
- return;
- }else if(ISSUE_DATE1!=""&&ISSUE_DATE2!=""){
- condition += " AND IMPLEMENT_DATE BETWEEN '"+ISSUE_DATE1+"' AND '"+ISSUE_DATE2+"' ";
- }
-
- /****************复选框查询******************/
- //分类
- var CLASSES = "";
- $("input:checkbox[name=CLASSES]").each(function(){
- if($(this).attr("checked")){
- if($(this).val()=="0000"){
- CLASSES += " CLASSES = '1' or CLASSES = '2' or CLASSES = '3' or CLASSES = '4' or CLASSES = '5' or ";
- }else{
- CLASSES += "CLASSES = '" + $(this).val() +"' or ";
- }
- }
- });
- if(CLASSES!=""){
- CLASSES = CLASSES.substring(0,CLASSES.lastIndexOf("or"));
- condition += " and ("+CLASSES+") ";
- }
-
- //状态
- var STATE = "";
- $("input:checkbox[name=STATE]").each(function(){
- if($(this).attr("checked")){
- if($(this).val()=="0000"){
- STATE += " STATE = '1' or STATE = '2' or STATE = '3' or STATE = '4' or STATE = '5' or ";
- }else{
- STATE += "STATE = '" + $(this).val() +"' or ";
- }
- }
- });
- if(STATE!=""){
- STATE = STATE.substring(0,STATE.lastIndexOf("or"));
- condition += " and ("+STATE+") ";
- }
-
- //发布情况
- var COLUMN_3 = "";
- $("input:checkbox[name=COLUMN_3]").each(function(){
- if($(this).attr("checked")){
- if($(this).val()=="0000"){
- COLUMN_3 += " COLUMN_3 = '1' or COLUMN_3 = '0' or ";
- }else{
- COLUMN_3 += "COLUMN_3 = '" + $(this).val() +"' or ";
- }
- }
- });
- if(COLUMN_3!=""){
- COLUMN_3 = COLUMN_3.substring(0,COLUMN_3.lastIndexOf("or"));
- condition += " and ("+COLUMN_3+") ";
- }
-
- // $queryForm.serialize();
- // var $comp_id = $("#selectConditions").find(".UNITE");
- // var loadParams11;
- // //判断是否有用单位做查询条件
- // if(!!$comp_id.prop("outerHTML")){
- // if(name!=""){
- // loadParams11 = {
- // "listId" : '243',
- // "condition" : " IS_DEL='0' AND COLUMN_3='1' and (ISSUE_ORGANIZATION like '%"+name+"%' or LAWS_REGULATIONS_NAME like '%"+name+"%' or ISSUE_ARTICLE_NUM like '%"+name+"%' or ISSUE_DATE like '%"+name+"%' or IMPLEMENT_DATE like '%"+name+"%' or DESCRIPTION like '%"+name+"%')",
- // direction:'DESC',
- // sort: 'UPDATEDATE'
- // };
- // }else{
- // loadParams11 = {
- // "listId" : '243',
- // "condition" : " IS_DEL='0' AND COLUMN_3='1' ",
- // direction:'DESC',
- // sort: 'UPDATEDATE'
- // };
- // }
- // }else{
- // if(name==""){
- // loadParams11 = $.extend({},_this.loadParams,loadParams);
- // }else{
- // loadParams11 = {
- // "listId" : '243',
- // "condition" : " is_del='0' and (COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE in (select dept_id from SYS_DEPARTMENT where is_del ='0' and dept_type='1' start with dept_id='"+dpids+"' connect by prior parent_id = dept_id) and (ISSUE_ORGANIZATION like '%"+name+"%' or LAWS_REGULATIONS_NAME like '%"+name+"%' or ISSUE_ARTICLE_NUM like '%"+name+"%' or ISSUE_DATE like '%"+name+"%' or IMPLEMENT_DATE like '%"+name+"%' or DESCRIPTION like '%"+name+"%')",
- // direction:'DESC',
- // sort: 'UPDATEDATE'
- // };
- // }
- //
- // }
- // var searchCondition = getSelectCon(conditionData);
- // var queryParams = getQueryFormParams($queryForm);
- // var params=$.extend({},loadParams11,queryParams);// 默认
- // params.condition = searchCondition.condition + params.condition;
- // _this.exportParams = params;
- // _this.listGrid.setOptions( {
- // params : params
- // });
- _this.listGrid.setOptions({//重置加载列表的参数
- params : {
- "listId" :'243' ,
- "condition" : condition,
- direction:'DESC',
- sort: 'UPDATEDATE'
- }
- });
- _this.listGrid.rend();//加载数据
- };
-
-
- function more() {
- $('#moreDiv').toggle(400,function(){
- // $("#emptyCondition").click();
- // $(parent.document.body).find("#frmright").height($(window.document.body).height()+30);
- // setHt();
- checkAndSetHeight();//changeFormat.js
- });
- }
-
- function setHt(){
- /* alert($("#layout1 .padding_right5").height())
- alert($("#layout1 .selDiv").height());
- alert($(".l-layout-left").height()); */
- var leftHeight = $(".layout_content").height()+70;
- var rightHeight = $("#layout1 .padding_right5").height()+$("#layout1 #moreDiv").height()+70;
- var height = leftHeight>rightHeight?leftHeight:rightHeight;
- $(top.document.body).find("#frmright").height($(window.document.body).height(height)+30);
- }
- /*// 更多
- function more() {
- $('#moreDiv').toggle();
- $(parent.document.body).find("#frmright").height($(window.document.body).height());
- }*/
- /*************************************************************************************************/
- //发布 单一
- _this.fabu = function(data) {
- var row = _this.listGrid.getRow(data);
- var fd_id = row.FD_OBJECTID243+",";
- //只能发布自己上传的文件
- var userId = row.TYPEIN_PEOPLE_243;
- 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);
- // 刷新表格数据
- _this.listGrid.rend();
- } else {
- top.Dialog.alert("发布失败!");
- }
- }, "json");
-
- });
- };
- //发布 批量
- _this.onPublish = function() {
- var rows = _this.listGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要发布的记录!");
- return;
- }
-
- var ids = "";
- var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- for ( var i = 0; i < rowsLength; i++) {
- ids += rows[i].FD_OBJECTID243 + ",";
-
- if(rows[i].COLUMN_3_243=="1"){
- if(rowsLength==1){
- top.Dialog.alert("您选中的记录已经发布!");
- }else{
- top.Dialog.alert("您选中的记录有已经发布的!");
- }
- return;
- }
- if(getUser_id!=rows[i].TYPEIN_PEOPLE_243){
- if(rowsLength==1){
- top.Dialog.alert("您选中的记录不是您自己上传的文件记录,请选择您自己上传的文件记录!");
- }else{
- top.Dialog.alert("您选中的记录有不是您自己上传的文件记录,请选择您自己上传的文件记录!");
- }
- return;
- }
-
- }
- top.Dialog.confirm("确定要发布吗?|发布", function() {
- $.post($.pathname() +"/ws/LAWSPOLL/LawsService/LawsFabu/", {
- fd_id : ids,
- }, function(result) {
- if (result.Msg.sucsess == true) {
- $.messager.alert("发布成功",null,null,null,-1);
- // 刷新表格数据
- _this.listGrid.rend();
- } else {
- top.Dialog.alert("发布失败!");
- }
- }, "json");
-
- });
- };
-
-
- //共享 单一
- _this.gongxiang = function(data) {
- var row = _this.listGrid.getRow(data);
- var fd_id = row.FD_OBJECTID243+",";
- //只能共享以及发布的文件
- if(row.COLUMN_3_243!="1"){
- top.Dialog.alert("只能共享已经发布的文件!");
- return;
- }
- //只能共享自己上传的文件
- // var userId = row.TYPEIN_PEOPLE_243;
- // var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- // if(getUser_id!=userId){
- // top.Dialog.alert("只能共享自己上传的文件!");
- // return;
- // }
- if(dept_level!="1"){
- if(dept_level!="2"){
- top.Dialog.alert("只有省级用户才能共享!");
- return;
- }else{
- var userDept_id = row.UNITE_243;
- var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- if(userDept_id==dpids){
- 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);
- // 刷新表格数据
- _this.listGrid.rend();
- } else {
- top.Dialog.alert("共享失败!");
- }
- }, "json");
-
- });
- };
-
- //共享 批量
- _this.publicShare = function() {
- var rows = _this.listGrid.getSelectedRows();
- var rowsLength = rows.length;
- if (rowsLength == 0) {
- top.Dialog.alert("请选中要共享的记录!");
- return;
- }
-
- var ids = "";
- var getUser_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- for ( var i = 0; i < rowsLength; i++) {
- ids += rows[i].FD_OBJECTID243 + ",";
-
- if(rows[i].COLUMN_4_243=="1"){
- if(rowsLength==1){
- top.Dialog.alert("您选中的记录已经共享!");
- }else{
- top.Dialog.alert("您选中的记录有已经共享的!");
- }
- return;
- }
- if(rows[i].COLUMN_3_243!="1"){
- if(rowsLength==1){
- top.Dialog.alert("您选中的记录还没有发布!");
- }else{
- top.Dialog.alert("您选中的记录中有还没有发布的!");
- }
- return;
- }
- if(getUser_id!=rows[i].TYPEIN_PEOPLE_243){
- if(rowsLength==1){
- top.Dialog.alert("您选中的记录不是您自己上传的文件记录,请选择您自己上传的文件记录!");
- }else{
- top.Dialog.alert("您选中的记录有不是您自己上传的文件记录,请选择您自己上传的文件记录!");
- }
- return;
- }
-
- }
- top.Dialog.confirm("确定要共享吗?|共享", function() {
- $.post($.pathname() +"/ws/LAWSPOLL/LawsService/LawsShare/", {
- fd_id : ids,
- }, function(result) {
- if (result.Msg.sucsess == true) {
- $.messager.alert("共享成功",null,null,null,-1);
- // 刷新表格数据
- _this.listGrid.rend();
- } else {
- top.Dialog.alert("共享失败!");
- }
- }, "json");
-
- });
-
- };
- //撤销共享
- _this.gongxiang1 = function(data){
-
- var row = _this.listGrid.getRow(data);
- var fd_id = row.FD_OBJECTID243+",";
- //只能撤销自己上传的文件
- var userId = row.TYPEIN_PEOPLE_243;
- 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);
- // 刷新表格数据
- _this.listGrid.rend();
- } else {
- top.Dialog.alert("撤销失败!");
- }
- }, "json");
-
- });
- };
-
-
- //撤销发布
- _this.noPublish = function() {
- var rows = _this.listGrid.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_OBJECTID243 + ",";
- if(rows[i].COLUMN_3_243!="1"){
- top.Dialog.alert("您选中的记录还没有发布!");
- return;
- }
- }
- top.Dialog.confirm("确定要撤销发布吗?|撤销", function() {
- $.post($.pathname() +"/ws/LAWSPOLL/LawsService/noLawsFabu/", {
- fd_id : ids,
- }, function(result) {
- if (result.Msg.sucsess == true) {
- $.messager.alert("撤销成功",null,null,null,-1);
- // 刷新表格数据
- _this.listGrid.rend();
- } else {
- top.Dialog.alert("撤销失败!");
- }
- }, "json");
-
- });
- };
-
- /*************************************************************************************************/
- return {
- init : function() {
- $queryForm = $("#queryForm");
- /** 绑定查询面板的按钮点击事件* */
- // $searchButt = $("#searchButt");// 查询按钮
- // $searchButt.bind('click', function() {
- // search();
- // });
- // $searchButt = $("#searchButt");// 更多查询按钮
- // $searchButt.live('click', function() {
- // search();
- // });
- $searchOne = $("#searchOne");//查询图标绑定查询事件
- $searchOne.bind('click', function() {
- searchHandler2();
- });
- /** 绑定更多的按钮点击事件 */
- $more = $("#more"); // 更多按钮
- $more.bind('click', function() {
- more();
- });
-
-
- //部门id
- var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- //取得用户真实姓名
- 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();
- $("body").eq(0).showLoading();
- // 列表加载参数
- _this.loadParams = {
- listId : '243',
- direction:'DESC',
- sort: 'EMC_AM_LAWS_REGULATIONS.UPDATEDATE',
- //sublist:' left join ECM_EM_TREATED_HUMAN',
- //subCondition:' on ECM_EM_PUBLISH_ALERT_NOTICE.FD_OBJECTID=ECM_EM_TREATED_HUMAN.BUSINESS_ID ',
- //condition : " EMC_AM_LAWS_REGULATIONS.is_del='0' "
- // condition : "is_del='0' and(COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE in (select dept_id from SYS_DEPARTMENT where is_del ='0' and dept_type='1' start with dept_id='"+dpids+"' connect by prior parent_id = dept_id)"
- condition : "is_del='0' and(COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE ='"+dpids+"' "
- };
- var roleCons = roleButtonArr();
- /** grid载入数据* */
- var toolBarOpt1 = {
- items : [ {text : '新增',click : 'addForm',iconClass : 'add1_tem',id : 'wjxz'},
- {text : '删除',click : 'del',iconClass : 'delete_tem',id : 'wjsc'},
- {text : '修改',click : 'editForm',iconClass : 'update_tem',id : 'wjxg'},
- // {text : '查看',click : 'show',iconClass : 'view_tem',id : '10003'},
- // {text : '历史版本',click:"onhistory",iconClass: 'history_tem',id:"10201" },
- {text : '导入', click: "showImportDialog", iconClass: 'import_tem' ,id:"wjdr"},
- {text : '导出',click:"exportTotalData",iconClass: 'export_tem',id:"10006"},
- // {text : '下载',click:"onDownLoad",iconClass: 'download_tem',id:"10007" },
- {text : '汇总',click: "sum", iconClass: 'poll_tem' ,id:"10200"},
- // {text : '发布',click: "onPublish", iconClass: 'release_tem' ,id:"wjfb"},
- //{text : '共享',click: "publicShare", iconClass: 'share_tem' ,id:"10200"},
- {text : '撤销',click: "noPublish", iconClass: 'retract_tem' ,id:"10215"}
- ],
- roleCons:roleCons
- };
-
-
-
- var grid_option1={
- columns : [
- {display : '名称', name : 'LAWS_REGULATIONS_NAME_243', align : 'left',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>';
- // }
- 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 : 'ISSUE_ORGANIZATION_243', align : 'center',width : "15%",showTitle:true},
- {display : '颁布文号', name : 'ISSUE_ARTICLE_NUM_243', align : 'center',width : "10%",showTitle:true},
- {display : '发布日期', name : 'ISSUE_DATE_243', align : 'center',width : "10%",showTitle:true},
- {display : '填写人员', name : 'TYPEIN_PEOPLE_243_SHOW', align : 'center',width : "10%",showTitle:true},
- // {display : '录入人联系方式', name : 'TYPEIN_PEOPLE_PHONE_NUM_243',align : 'center',width : "10%",showTitle:true},
- {display : '实施日期', name : 'IMPLEMENT_DATE_243', align : 'center',width : "10%",showTitle:true} ,
- {display : '单位', name : 'UNITE_243_SHOW', align : 'center',width : "10%",showTitle:true} ,
- // {display : '部门', name : 'DEPT_243_SHOW', align : 'center',width : "10%",showTitle:true} ,
- {display : '状态', name : 'STATE_243_SHOW', align : 'center',width : "10%",showTitle:true},
- {display : '操作', isAllowHide: false, align : 'center', width:'10%',
- render: function (rowdata, rowindex, value, column){
- //判断是否已经发布。取发布的状态,如果已经发布为“1”;未发布为“0”
- var fabu='';//fabu
- if(rowdata.COLUMN_3_243=="1"){
- fabu = '<span class="fashang_07 hand" title="发布" onclick="fabu1()"></span>';
- }else{
- fabu = '<span class="fashang_06 hand" title="发布" onclick="fabu(' + rowindex + ')"></span>';
- }
- //判断是否已经共享。取共享的状态,如果已经共享为“1”;未共享为“0”
- var gongxiang='';
- if(rowdata.COLUMN_4_243=="1"){
- gongxiang = '<span class="share_07 hand" title="撤销共享" onclick="gongxiang1(' + rowindex + ')"></span>';
- }else{
- gongxiang = '<span class="share_03 hand" title="共享" onclick="gongxiang(' + rowindex + ')"></span>';
- }
- return fabu + gongxiang;
-
- }
- }],
- /* detail: {
- //onShowDetail: showFlow,
- height: 'auto'
- },*/
- pageSize : 10,
- rownumbers : true,
- checkbox : true,
- percentWidthMode : true,
- onAfterShowData:function(data){
- setHt();
- }
- };
-
- var options1={
- url :'/nwyj/ws/crud/CRUDService/queryQui',
- params: _this.loadParams,
- height: '100%',
- width:"100%",
- gridOptions:grid_option1,
- singleRecodeOptions:{a:"aa"},
- paperOpration:{showInput:"true"},
- toolBarOptions:toolBarOpt1
- };
-
- _this.listGrid=gridAndSingleRecode=$("#maingrid").quickgridAndSingleRecode(options1);
- $("body").eq(0).hideLoading();
- }
- };
- }();
- $(function() {
- laws.init();
- // getCompName();
- /*$("#UNITE").OrgSel({selectedMulti : true,loadCorp:"loadCorp",setMulti : {
- "Y" : "s",
- "N" : ""
- }});*/
- getDeptLevel();
- });
- /**************2016-09-10 唐群胜 获取登陆人的级别*****************/
- var dept_level="";
- function getDeptLevel(){
- var dpids = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- $.ajax({
- url : $.pathname()+ "/ws/planService/PlanService/getDeptLevel",
- type : 'post',
- timeout : 60000,
- data : {id:dpids},
- dataType : 'text',
- success : function(data){
- dept_level=data;
- }
- });
- }
- //单击跳转
- function jumpPage(fd_id){
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/laws/laws_view.jsp?"+fd_id);
- }
- function showPrimaryKey(obj,index){
- var fd_id = obj.FD_OBJECTID243;
- // $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/laws/laws_view.jsp?"+fd_id);
- $.indexOpenNextWindow("/nwyj/page/business/am/fileManager/laws/laws_view.jsp?"+fd_id);
- }
- function getCompName(){
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- var url = $.pathname() + '/ws/PlanHuiZong/ContingencyPlanHuiZong/getresourXj/';
- var params = {
- id : deptId,
- value:"UNITE",
- flag:"1"
- };
- $.ajax({
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data){
- var conditionData3 = JSON.stringify(data);
- var test = eval("("+conditionData3+")");
- if(conditionData3!='{"list":[{"name":"查询单位","className":"UNITE","equalType":"equal","list":[]}]}'){
- conditionData.list.push(test.list[0]);
- }
- createConditionsDom(conditionData);
- $(".item").unbind("click").bind("click",bindSelectOne);
- },
- error : function(e){
- $.messager.alert('系统提示信息', '访问服务失败!', 'error');
- }
- });
- }
- function fabu1(){
- top.Dialog.alert("该文件已经发布!");
- }
- //清空
- function resetSearch(){
- $('#LAWS_REGULATIONS_NAME').val("");
- $('#ISSUE_ORGANIZATION').val("");
- $('#TAKE_DATE1').val("");
- $('#TAKE_DATE2').val("");
- $('#ISSUE_DATE1').val("");
- $('#ISSUE_DATE2').val("");
- $("input:checkbox[name=CLASSES]").attr("checked",false);
- $("input:checkbox[name=STATE]").attr("checked",false);
- $("input:checkbox[name=COLUMN_3]").attr("checked",false);
- }
- $.messager=top.Dialog;
|