1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030 |
- standard = 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/standard/standard_add.jsp");
- };
- /** *修改信息** */
- _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_242=="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_242&&flag=="0"){
- top.Dialog.alert("只能修改自己上传的文件!");
- return;
- }
- var fd_id = rows[0].FD_OBJECTID242;
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/standard/standard_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_OBJECTID242 + ",";
- if(rows[i].COLUMN_3_242=="1"&&flag=="0"){
- if(rowsLength==1){
- top.Dialog.alert("您选中的记录已发布,不能删除!");
- }else{
- top.Dialog.alert("您选中的记录中有已发布的,不能删除!");
- }
- return;
- }
- if(getUser_id!=rows[i].TYPEIN_PEOPLE_242&&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_242 },
- 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 : 242
- }, 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_OBJECTID242;
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/standard/standard_view.jsp?"+fd_id);
- }
- };
-
- //点击主键跳转详细信息页面
- _this.openDetail = function(rowindex) {
- var row = _this.listGrid.getRow(rowindex);
- var fd_id = row.FD_OBJECTID242;
- // $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/standard/standard_view.jsp?"+fd_id);
- $.indexOpenNextWindow("/nwyj/page/business/am/fileManager/standard/standard_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_242;
- var fd_id = rows[0].FD_OBJECTID242;
-
- $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/standard/standard_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" :'242' ,
- // "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(242,loadParams,"技术标准文件信息","IS_DEL,UPDATEDATE,FD_OBJECTID,COLUMN_1,COLUMN_2,COLUMN_3,COLUMN_4,OBJ_FIRST,VERSION,TYPEIN_PEOPLE_PHONE_NUM,AUSPICE_DEPT");
- });
- return;
- }
- var ids = "";
- for ( var i = 0; i < rowsLength; i++) {
- ids += "'"+rows[i].FD_OBJECTID242+"'" + ",";
- }
- var temp = ids.substring(0,ids.length-1);
-
- var condition = " IS_DEL='0' ";
- condition += " AND FD_OBJECTID IN (" + temp + ") " ; //'%" +name+"%';
- var sql = {
- "listId" :'242' ,
- "condition" : condition,
- direction:'DESC',
- sort: 'UPDATEDATE'
- };
- excelExport(242,sql,"技术标准文件信息","IS_DEL,UPDATEDATE,FD_OBJECTID,COLUMN_1,COLUMN_2,COLUMN_3,COLUMN_4,OBJ_FIRST,VERSION,TYPEIN_PEOPLE_PHONE_NUM,AUSPICE_DEPT");
- };
- /** 导入 */
- _this.showImportDialog = function() {
- window.location.href="standard-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_OBJECTID242;//预案的主键
- 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="standard_poll.jsp";
- };
- // 查询
- // function search() {
- //
- // if($("#STANDARD_NAME_242").val()=="国标行标"){
- // $("#STANDARD_NAME_242").val("");
- // }
- // $queryForm.serialize();
- // var $comp_id = $("#selectConditions").find(".UNITE");
- // var loadParams11;
- // //判断是否有用单位做查询条件
- // if(!!$comp_id.prop("outerHTML")){
- //
- // loadParams11 = {
- // "listId" : '242',
- // "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($("#STANDARD_NAME").val()=="技术标准"){
- $("#STANDARD_NAME").val("");
- }
- var name = $("#STANDARD_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" : '242',
- "condition" : " IS_DEL='0' AND (COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) ",
- direction:'DESC',
- sort: 'UPDATEDATE'
- };
- }else{
- loadParams11 = {
- "listId" : '242',
- "condition" : " IS_DEL='0' AND (COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and(DISPATCH_UNIT like '%"+name+"%' or AUSPICE_DEPT like '%"+name+"%' or STANDARD_NAME like '%"+name+"%' or STANDARD_CODE like '%"+name+"%' or PRINT_DATE like '%"+name+"%' or IMPLEMENT_DATE like '%"+name+"%' or DESCRIPTION like '%"+name+"%')",
- direction:'DESC',
- sort: 'UPDATEDATE'
- };
- }
-
- }else{
- if(name==""){
- loadParams11 = $.extend({},_this.loadParams,loadParams);
- }else{
- loadParams11 = {
- "listId" : '242',
- // "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 (DISPATCH_UNIT like '%"+name+"%' or AUSPICE_DEPT like '%"+name+"%' or STANDARD_NAME like '%"+name+"%' or STANDARD_CODE like '%"+name+"%' or PRINT_DATE like '%"+name+"%' or IMPLEMENT_DATE like '%"+name+"%' or DESCRIPTION like '%"+name+"%')",
- "condition" : "is_del='0' and(COLUMN_3='1' or TYPEIN_PEOPLE = '"+getUser_id+"' ) and UNITE ='"+dpids+"' and (DISPATCH_UNIT like '%"+name+"%' or AUSPICE_DEPT like '%"+name+"%' or STANDARD_NAME like '%"+name+"%' or STANDARD_CODE like '%"+name+"%' or PRINT_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.rend();//加载数据
- }
- _this.searchHandler2 = function(){
-
- if($("#STANDARD_NAME").val()=="请输入技术标准名称"){
- $("#STANDARD_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 = $("#STANDARD_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 DISPATCH_UNIT = $("#DISPATCH_UNIT").val();
- var STANDARD_CODE = $("#STANDARD_CODE").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 STANDARD_NAME LIKE '%" +name+"%'";
- }
- if(DISPATCH_UNIT!=""){
- condition += " AND DISPATCH_UNIT LIKE '%" +DISPATCH_UNIT+"%'";
- }
- if(STANDARD_CODE!=""){
- condition += " AND STANDARD_CODE LIKE '%" +STANDARD_CODE+"%'";
- }
-
- /***************时间*******************/
-
- 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 PRINT_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 ";
- }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" : '242',
- // "condition" : " IS_DEL='0' AND COLUMN_3='1' ",
- // direction:'DESC',
- // sort: 'UPDATEDATE'
- // };
- // }else{
- // loadParams11 = {
- // "listId" : '242',
- // "condition" : " IS_DEL='0' AND COLUMN_3='1' and(DISPATCH_UNIT like '%"+name+"%' or AUSPICE_DEPT like '%"+name+"%' or STANDARD_NAME like '%"+name+"%' or STANDARD_CODE like '%"+name+"%' or PRINT_DATE like '%"+name+"%' or IMPLEMENT_DATE like '%"+name+"%' or DESCRIPTION like '%"+name+"%')",
- // direction:'DESC',
- // sort: 'UPDATEDATE'
- // };
- // }
- //
- // }else{
- // if(name==""){
- // loadParams11 = $.extend({},_this.loadParams,loadParams);
- // }else{
- // loadParams11 = {
- // "listId" : '242',
- // "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 (DISPATCH_UNIT like '%"+name+"%' or AUSPICE_DEPT like '%"+name+"%' or STANDARD_NAME like '%"+name+"%' or STANDARD_CODE like '%"+name+"%' or PRINT_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" :'242' ,
- "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_OBJECTID242+",";
- //只能发布自己上传的文件
- var userId = row.TYPEIN_PEOPLE_242;
- 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/STANDARDPOLL/StandardService/StandardFabu/", {
- 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_OBJECTID242 + ",";
-
- if(rows[i].COLUMN_3_242=="1"){
- if(rowsLength==1){
- top.Dialog.alert("您选中的记录已经发布!");
- }else{
- top.Dialog.alert("您选中的记录有已经发布的!");
- }
- return;
- }
- if(getUser_id!=rows[i].TYPEIN_PEOPLE_242){
- if(rowsLength==1){
- top.Dialog.alert("您选中的记录不是您自己上传的文件记录,请选择您自己上传的文件记录!");
- }else{
- top.Dialog.alert("您选中的记录有不是您自己上传的文件记录,请选择您自己上传的文件记录!");
- }
- return;
- }
-
- }
- top.Dialog.confirm("确定要发布吗?|发布", function() {
- $.post($.pathname() +"/ws/STANDARDPOLL/StandardService/StandardFabu/", {
- 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_OBJECTID242+",";
- //只能共享以及发布的文件
- if(row.COLUMN_3_242!="1"){
- top.Dialog.alert("只能共享已经发布的文件!");
- return;
- }
- //只能共享自己上传的文件
- // var userId = row.TYPEIN_PEOPLE_242;
- // 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_242;
- 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/STANDARDPOLL/StandardService/StandardShare/", {
- 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_OBJECTID242 + ",";
-
- if(rows[i].COLUMN_4_242=="1"){
- if(rowsLength==1){
- top.Dialog.alert("您选中的记录已经共享!");
- }else{
- top.Dialog.alert("您选中的记录有已经共享的!");
- }
- return;
- }
- if(rows[i].COLUMN_3_242!="1"){
- if(rowsLength==1){
- top.Dialog.alert("您选中的记录还没有发布!");
- }else{
- top.Dialog.alert("您选中的记录中有还没有发布的!");
- }
- return;
- }
- if(getUser_id!=rows[i].TYPEIN_PEOPLE_242){
- if(rowsLength==1){
- top.Dialog.alert("您选中的记录不是您自己上传的文件记录,请选择您自己上传的文件记录!");
- }else{
- top.Dialog.alert("您选中的记录有不是您自己上传的文件记录,请选择您自己上传的文件记录!");
- }
- return;
- }
-
- }
- top.Dialog.confirm("确定要共享吗?|共享", function() {
- $.post($.pathname() +"/ws/STANDARDPOLL/StandardService/StandardShare/", {
- 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_OBJECTID242+",";
- //只能共享自己上传的文件
- var userId = row.TYPEIN_PEOPLE_242;
- 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/STANDARDPOLL/StandardService/noStandardShare/", {
- 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_OBJECTID242 + ",";
- if(rows[i].COLUMN_3_242!="1"){
- top.Dialog.alert("您选中的记录还没有发布!");
- return;
- }
- }
- top.Dialog.confirm("确定要撤销发布吗?|撤销", function() {
- $.post($.pathname() +"/ws/STANDARDPOLL/StandardService/noStandardFabu/", {
- 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.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();
-
-
-
- // 列表加载参数
- _this.loadParams = {
- listId : '242',
- direction:'DESC',
- sort: 'EMC_AM_NATIONAL_VOCATION_STANDARD.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_NATIONAL_VOCATION_STANDARD.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 : 'STANDARD_NAME_242', align : 'left',width : "15%",isPrimaryKey:true,
- // render : function(rowdata, value) {
- // return '<a href="javascript:void(0)" '
- // + 'onclick=jumpPage("'
- // + rowdata.FD_OBJECTID242
- // +'")>'+ rowdata.STANDARD_NAME_242 +'</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 : 'DISPATCH_UNIT_242', align : 'center',width : "15%",showTitle:true},
- {display : '标准代号', name : 'STANDARD_CODE_242', align : 'center',width : "10%",showTitle:true},
- {display : '印发日期', name : 'PRINT_DATE_242', align : 'center',width : "10%",showTitle:true},
- {display : '填写人员', name : 'TYPEIN_PEOPLE_242_SHOW', align : 'center',width : "10%",showTitle:true},
- // {display : '录入人联系方式', name : 'TYPEIN_PEOPLE_PHONE_NUM_242',align : 'center',width : "15%",showTitle:true},
- {display : '录入时间', name : 'TYPEIN_TIME_242', align : 'center',width : "10%",showTitle:true} ,
- {display : '单位', name : 'UNITE_242_SHOW', align : 'center',width : "10%",showTitle:true} ,
- // {display : '部门', name : 'DEPT_242_SHOW', align : 'center',width : "10%",showTitle:true} ,
- {display : '状态', name : 'STATE_242_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_242=="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_242=="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);
- }
- };
- }();
- $(function() {
- standard.init();
- // getCompName();
- 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/standard/standard_view.jsp?"+fd_id);
- }
- function showPrimaryKey(obj,index){
- var fd_id = obj.FD_OBJECTID242;
- // $('#frmright', window.parent.document).attr('src',$.pathname()+ "/page/business/am/fileManager/standard/standard_view.jsp?"+fd_id);
- $.indexOpenNextWindow("/nwyj/page/business/am/fileManager/standard/standard_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(){
- $('#STANDARD_NAME').val("");
- $('#DISPATCH_UNIT').val("");
- $('#STANDARD_CODE').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;
|