123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- 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("<span class='spantip'>没有要填写的报表数据</span>");
- $("body").eq(0).hideLoading();
- return;
- }
- var div = $("<div style='width : 99.2%'><div id='sr_div'></div></div>");
- $("#specialReport").append(div);
- for (var i = 0; i < data.length; i++) {
- var table = $("<table class='table' id='table"+i+"'></table>");
- var th = $("<thead></thead>");
- var id = data[i].id;
- //表头
- th.append($("<tr><td class='cententCenter' colspan='4'><div class='TitleHeads blue_color'>"+data[i].name+"</div></td></tr>"));
- th.append($("<tr><td class='cententCenter td_head' style='width:14.5%'>填报角色</td><td class='cententCenter td_head' style='width:50%'>报表类型</td><td class='cententCenter td_head' style='width:20%'>填报时间</td><td class='cententCenter td_head' style='width:14.7%'>操作</td></tr>"));
- table.append(th);
- div.append(table);
-
- //报表类型
- var report_data = data[i].report_info;
- for(var j=0;j<report_data.length;j++){
- var obj = report_data[j];
- var num = obj.num;
- var role_id = obj.role_id;
- var role_name = obj.role_name;
- var tr = $("<tr class='"+role_id+"'></tr>");
- if($("#table"+i+" ."+role_id).hasClass(role_id)){
- $("#table"+i+" ."+role_id).find("td").eq(0).attr("rowspan",num);
- }else{
- var td = $("<td rowspan='"+num+"' class='cententCenter td_border1' >"+role_name+"</td>");
- tr.append(td);
- }
- var td2 = $("<td class='cententCenter td_border1'>"+obj.report_name+"</td>");
- var td3 = $("<td class='cententCenter td_border1'>当天任意时间点</td>");
- var td4 = $("<td class='cententCenter td_border1'></td>");
- var tb_input = $("<span class='input1'>填报</span>");
- 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);
- }
- }
-
|