var corpId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids(); var role_id = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids(); var dbtypesc=[]; var dbtypeaj=[]; function createSpecialTable(){ $("#specialReport").empty(); $(".dateSel").hide(); // $("body").eq(0).showLoading(); $.ajax({ url : $.pathname()+ "/ws/xianlutingyun/XianlutingyunService/getSpecialReport", type : 'post', async : false, data : {"comp_id":corpId,"role_id":role_id}, dataType : 'json', success : function(data){ if(data.length==0){ $("#specialReport").append("没有要填写的报表数据"); $("body").eq(0).hideLoading(); return; } var div = $("
"); $("#specialReport").append(div); for (var i = 0; i < data.length; i++) { var table = $("
"); var th = $(""); var id = data[i].id; //表头 th.append($("
"+data[i].name+"
")); th.append($("填报角色报表类型填报时间操作")); table.append(th); div.append(table); //报表类型 var report_data = data[i].report_info; for(var j=0;j"); if($("#table"+i+" ."+role_id).hasClass(role_id)){ $("#table"+i+" ."+role_id).find("td").eq(0).attr("rowspan",num); }else{ var td = $(""+role_name+""); tr.append(td); } var td2 = $(""+obj.report_name+""); var td3 = $("当天任意时间点"); var td4 = $(""); var tb_input = $("填报"); tb_input.data("data-id",id); tb_input.data("data-type",obj.report_type); tb_input.data("data-role",role_id); tb_input.data("data-scheduleName",data[i].name); tb_input.data("data_early_warning",data[i].alertwarning); if(role_id=="R002105430211"){ dbtypesc.push(obj.report_type); }else{ dbtypeaj.push(obj.report_type); } tb_input.on("click",sr_click); td4.append(tb_input); tr.append(td2).append(td3).append(td4); table.append(tr); } // div.append(table); } $("body").eq(0).hideLoading(); }, error : function(e) { $.messager.alert('查询行失败!', '访问服务失败!', 'error'); } }); } /** * 点击新增报表的填报事件 */ function sr_click(){ var $self = $(this); var task_id = $self.data("data-id"); var report_type = $self.data("data-type"); var role_id = $self.data("data-role"); var dbtype = []; if(role_id=="R002105430211"){ dbtype = dbtypesc; }else{ dbtype = dbtypeaj; } var scheduleName =$self.data("data-scheduleName"); var affair = $self.data("data_early_warning").split("-")[0]; if(report_type=="115"){ top.document.getElementById("frmright").setAttribute("src", "/nwyj/scripts/business/em/response/report/specialReport_AddEdit.html?"+report_type+"?"+task_id+"?"+dbtype+"?"+affair+"?"+scheduleName); }else{ top.document.getElementById("frmright").setAttribute("src", "/nwyj/scripts/business/em/response/report/specialReport_Write.html?"+report_type+"?"+task_id+"?"+dbtype+"?"+affair+"?"+scheduleName); } }