getPageContext('Dai_submitList').bind('initfn',{},function(){ var c = $(this); var jqgrid=$("#DaiSubmitListGrid",c); var schoolId=null; //启用选项卡 categoryTab(c,jqgrid,"sccaName"); ScEmphasisManager.getJwclient(pageSession.user.orgId,{ callback:function(data){ if(data==null)data=false; jw_client=data; if(!jw_client){ ScEmphasisManager.getSchoolId(pageSession.user.orgId,{ callback:function(data2){ schoolId=data2; },async:false }); } },async:false }); function caozuoFmt(cellvalue, options, rowObject){ var retrun_html=""; if("131072".in_acl()){ retrun_html+="编辑"; } if("65536".in_acl()){ retrun_html+=" 提交"; } return retrun_html; } function scrtOverDateFmt(cellvalue, options, rowObject){ var scrtOver = LandyJquery.util.formatDate('yy-MM-dd', cellvalue, null); var today = LandyJquery.util.formatDate('yy-MM-dd', new Date(), null); if(today > scrtOver){ var scrtOver2 = new Date(scrtOver.replace(/-/g, "/")); today = new Date(today.replace(/-/g, "/")); var days = (today.getTime()-scrtOver2.getTime())/86400000; return scrtOver+"(已逾期"+days+"天)"; }else{ return scrtOver; } } jqgrid.landyjgrid({ colNames : ['ID','scchId','sccoRemark','sccoOrgId','sccoFlowState','检查项分类','检查表名称','执行开始时间','执行结束时间','提交截止时间','操作','流程'], colModel : [ {name : 'sccoId',index : 'sccoId',width : 60,hidden : true}, {name : 'scchId',index : 'scchId',width : 60,hidden : true}, {name : 'sccoRemark',index : 'sccoRemark',width : 60,hidden : true}, {name : 'sccoOrgId',index : 'sccoOrgId',width : 60,hidden : true}, {name : 'sccoFlowState',index : 'sccoFlowState',width : 60,hidden : true}, {name : 'sccaName',index : 'sccaName',width : 60,align:"center",sortable:false}, {name : 'scchTitle',index : 'scchTitle',width : 140,align:"center",sortable:false/*,formatter:'datetimeFmatter'*/}, {name : 'scrtBegin',index : 'scrtBegin',width : 80,align:"center",formatter:'dateFmatter'}, {name : 'scrtEnd',index : 'scrtEnd',width : 80,align:"center",formatter:'dateFmatter'}, {name : 'scrtOver',index : 'scrtOver',width : 100,align:"center",sortable:false,formatter:scrtOverDateFmt}, {name : '',index : '',width : 80,align:"center",sortable:false,formatter:caozuoFmt}, {name : 'rolenames',index : 'rolenames',width : 10,hidden : true} ], rowNum : 20, rowList : [20, 50, 100,500 ], pager : '#DaiSubmitListGridPager', sortname : '', viewrecords : true, sortorder : "", shrinkToFit : true, queryType : "Dai_submitListQuery", autoLoad : true, multiselect : false, height:250, gridComplete: function () {}, onBuildAdditionQueryFields : function() { $(this).clearCondition(); var conditions = LandyJquery.grid.buildGridSearchConditionsByForm("daiSubmitListQueryForm", c); conditions.push({fieldName:'sccoFlowState1',fieldType:'int',fieldStringValue:5}); conditions.push({fieldName:'scchState',fieldType:'String',fieldStringValue:'已终止'}); var orgIds = []; if(null != schoolId){ orgIds.push(schoolId); }else{ orgIds.push(pageSession.user.orgId); } conditions.push({fieldName:'sccoOrgId',fieldType:'String[]',fieldStringValue:orgIds}); conditions.push({fieldName:'sccoFlowRole',fieldType:'String[]',fieldStringValue:getLoginUserRoles()}); $(this).addConditions(conditions); } }); //编辑 $("#update",c).bind("click",function(event,data){ orgData=jqgrid.getRowDataByRowId(data.rowId); newOpenByUrl({ autoOpen: false, height: 550, width: 800, modal: true, title:"编辑详情", buttons:{}, open:function(event, ui) { var dc = $(this); var scchId = orgData.scchId; var check = null; var workDay = []; if(isNotNull(scchId,true)){ ScCheckOrgSubjectManager.getRoleNamesByScchIdQuery(scchId,{ callback:function(data){ if(data != null && data.length>0){ check = data[0]; } },async:false }); } $('#editDetailGrid',dc).landytempletegrid({ queryType:'Dai_DaiSubmitEditByScchIdQuery', sortcontainer:'', datareader:['sccsScsuName', 'sccsScsuContent', 'sccsScsuMethod', 'scosIsOk', 'scosProblem', 'scosId', 'scosSccoId', 'scosSccsId', 'scosSccfId', 'scosOrgId', ],//要查出来的数据 tpl:"#sccsScsuName#" + "#sccsScsuContent#" + "#sccsScsuMethod#" + "#scosIsOk#达标" + "#scosProblem#" + "#scosId#" + "#scosSccoId#" + "#scosSccsId#" + "#scosSccfId#" + "#scosOrgId#",//必须要有dom元素 nodatatpl:"没有查询结果", fieldconfig:{ scosIsOk:{ type:function(row){ if(row == 'Y'){ return ''; } return '' }, editor:function(pos,v){ var $e = $(''); if(v == "Y"){ $e.attr('checked','checked'); } return $e; }, editvalue:function($e){ if($e.prop('checked') == true){ return 'Y'; } return 'N'; } }, scosProblem:{ type:function(row){ return '