123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- var comp_id = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- var role_id = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();
- function initComplete(){
-
- var condition ='1=1';
- initGrid(condition);
- }
- function initGrid(condition){
- var roleCons = roleButtonArr();
- var option = {
- columns : [
- // {display : '报表名称', name : 'REPORT_NAME_443',align : 'center',width : "100%",isPrimaryKey:true,render:editReport}
- {display : '报表名称', name : 'REPORT_NAME_443',align : 'center',width : "100%",isPrimaryKey:true,//render:editReport,
- render : function(rowdata, rowindex, value, column) {
- // return "<div onclick=editmodel("+rowdata.REPORT_TYPE_443+",'"+value+"')>"+rowdata.REPORT_NAME_443+"</div>";
- return "<a href='javascript:;' style='width:100%;height:100%;display:block' title='" + value + "' onclick=editmodel("+rowdata.REPORT_TYPE_443+",'"+value+"')>" + value + "</a>";
- }
- }
- /* {display : '填报部门', name : 'TABLE_NAME_443',align : 'center', width : "50%",showTitle:true}*/
- ],
- pageSize : 10,
- rownumbers : true,
- percentWidthMode : true,
- checkbox : true
- };
- var toolBars =getItem(comp_id, role_id, roleCons);
- function getItem(compId,roleId,roleCons){
- var item = "";
- var roleArr = role_id.split(",");
- if(compId=="8F6F2D6B24494CB6B1F1E0931E7AF87D" && $.inArray("R002105430213",roleArr)>-1){
- item= {
- items: [
- { text: '新增', click: 'onAdd', iconClass: 'add1_tem', disabled: false ,id:"bbxz"},
- { text: '删除', click: 'onDelete', iconClass: 'delete_tem', disabled: false,id:"bbsc" }
- ],
- roleCons:roleCons
- };
- }else{
- item = false;
- }
- return item;
- }
- var options={
- url : $.pathname() + '/ws/crud/CRUDService/queryQui',
- params:{
- "listId":443,
- "condition":condition,
- direction : 'desc', // 排序方式
- sort : 'REPORT_NAME'
- },
-
- width:"100%",
- gridOptions:option,
- paperOpration:{showInput:"true"},
- toolBarOptions:toolBars
- };
-
- g=gridAndSingleRecode=$("#maingrid").quickgridAndSingleRecode(options);
- }
- function onAdd(){
- /*if(comp_id!="8F6F2D6B24494CB6B1F1E0931E7AF87D"){
- top.Dialog.alert("只有省公司的安监部人员才有权限新增");
- return;
- }*/
- var url = "/nwyj/page/business/am/report/addReport/addNewReport.jsp";
-
- window.parent.document.getElementById("frmright").setAttribute("src", encodeURI(url));
- }
- function editReport(rowdata,rowindex,value,column){
-
- return "<div onclick=editmodel("+rowdata.REPORT_TYPE_443+",'"+value+"')>"+rowdata.REPORT_NAME_443+"</div>";
-
- }
- function editmodel(val,table){
- var iframe = parent.document.getElementsByName("frmright")[0];
- iframe.src = encodeURI("/nwyj/page/business/am/report/dictionary/Show_Type.html?"+val+"?"+table);
- }
- /*window.onload = function (){
- $(".selectbox").attr("readonly","readonly");
- };*/
- function getRole_id(id){
- /*var role_id = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids();*/
- if(id.indexOf(",")!=-1){
- var role_ids = id.split(",");
- for(var i=0;i<role_ids.length;i++){
- if(role_ids[i]=="R002105430210"||role_ids[i]=="R002105430211"||role_ids[i]=="R002105430212"||role_ids[i]=="R002105430213"){
- return role_ids[i];
- }
- }
- }else{
- return id;
- }
- }
- function onDelete(){
-
- var row = g.getSelectedRows();
- /*if(comp_id!="8F6F2D6B24494CB6B1F1E0931E7AF87D"){
- top.Dialog.alert("只有省公司的安监部人员才有权限删除");
- return;
- }*/
- if(row.length==0){
- top.Dialog.alert("请选择要删除的记录");
- return;
- }
- if(row.length>1){
- top.Dialog.alert("一次只能删除一条记录");
- return;
- }
- var fd_id = row[0].FD_OBJECTID_443;
- //var report_name = row[0].REPORT_NAME_443;
- var report_type=row[0].REPORT_TYPE_443;
- var delUrl = $.pathname() +"/ws/xianlutingyun/XianlutingyunService/deleteRcTables";
- var params = {fd_id:fd_id,
- check:"rc",
- type:report_type};
-
- top.Dialog.confirm("确定要删除吗?|删除", function() {
-
- addRecords(delUrl,params,"删除表");
- g.rend();
-
- });
- }
|