var role_id = top.com.sinosoft.lz.system.user.LoginInfo.getRoleids(); var userId =top.com.sinosoft.lz.system.user.LoginInfo.getUser_id(); var dept_id = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids(); var fd_id; var yqRole = getYqRole(role_id); var userZyRole = getZyRole(role_id); var defalutArr = ["R002105430210","R002105430211","R002105430212","R002105430213"]; var tableObj = getThing($.pathname() +"/ws/xianlutingyun/XianlutingyunService/getTableObj",{},'text'); tableObj = eval('('+tableObj+')'); var deptLevel = getThing($.pathname() +"/ws/xianlutingyun/XianlutingyunService/getDeptLevel",{"comp_id":dept_id},"text"); function initComplete(){ var url = decodeURI(window.location.href); getToggle(userZyRole,yqRole); if($.inArray("R002105430205",yqRole)>-1){ $("#send_report").toggle(); } if(url.indexOf("?")>-1){ var data = url.split("?"); if(data.length==2&&data[1].indexOf("fd_id=")!=-1){ fd_id = data[1].split("=")[1].split("_")[0]; showScheduleMsg(fd_id); } } $("#img").changePic(); } function newPage(){ // 自动带出--填报要求名称、开始时间、截止时间、周期性、填报时间、填报模板 var cfArr = []; if($("#SYSTEM_DEPT").html()==""){ cfArr.push("R002105430210"); } else if($("#EQUIPMENT_DEPT").html()==""){ cfArr.push("R002105430211"); } else if($("#MARKETING_DEPT").html()==""){ cfArr.push("R002105430212"); }else if($("#SAFEY_DEPT").html()==""){ cfArr.push("R002105430213"); } var hasArr = saveSameRole(cfArr,defalutArr); var hasCfArr = checkHasRole(hasArr,userZyRole); if(hasCfArr.length==0){ top.Dialog.alert("你具备的专业管理部门角色没有要求拆分"); }else if(hasCfArr.length==1){ window.parent.document.getElementById("frmright").setAttribute("src", "/nwyj/page/business/em/report/reportDept/addReportRequire.html?fd_id="+fd_id+"&role_Id="+hasCfArr[0]); }else{ /*top.Dialog.confirm("系统检测到您具有多重专业管理部门角色,可拆分多个计划,请选择一个专业管理部门角色再进行下一步操作", function() {*/ var zyRoleId = getUserZyRole(hasCfArr); getRoleDeaitl(userId,hasCfArr,goAnotherPage,"/nwyj/page/business/em/report/reportDept/addReportRequire.html",zyRoleId,fd_id); /* });*/ } } function goAnotherPage(url){ window.parent.document.getElementById("frmright").setAttribute("src", url); } function goback(){ window.parent.document.getElementById("frmright").setAttribute("src", "/nwyj/page/business/em/report/Report_Require.jsp"); } var num=0; var user_id ="" ; var comp=""; var send_stat =""; function send(){ if(userId!=user_id){ top.Dialog.alert("不可发布其他人填写的记录"); return; } else if(comp!=dept_id){ top.Dialog.alert("不可发布其他公司填写的记录"); return; } else if(send_stat=="1"){ top.Dialog.alert("该记录已发布,不可重复发布"); return; } else if(num==1){ top.Dialog.alert("该记录已发布,不可重复发布"); return; } else { num=1; top.Dialog.confirm("确定要发布吗?|发布", function() { $("body").showLoading(); $.post($.pathname() +"/ws/xianlutingyun/XianlutingyunService/SendPlan", { fd_id : fd_id }, function(result) { if (result[0].succ == "true") { $("body").hideLoading(); var name=result[0].name; var tel=result[0].tel; top.Dialog.confirm("发布成功,是否发送短信?|是",function(){ addMsg(name,tel,"","1"); },function(){ goback(); }); /* top.Dialog.alert("发布成功",null,null,null,null);*/ // 刷新表格数据 ///g.rend(); } else { top.Dialog.alert("发布失败!"); } }, "json"); }); } } function getToggle(arr1,arr2){ if(checkUserRole(arr1,arr2)==1){ $('#anniu').toggle(); } } function showScheduleMsg(fd_id){ $.ajax({ url : $.pathname() +"/ws/xianlutingyun/XianlutingyunService/getReportScheduleMsg", type : 'post', timeout : 15000, data : {fd_id:fd_id}, dataType : 'json', async:false, success : function(data) { data = removeNull(data); data = data.rows[0]; user_id = data.USER_ID; comp = data.COMP_ID; send_stat = data.SEND_STAT; var schedule = data.FILL_IN_SCHEDULE; $("#WARNING_NUMBER_337").text(data.WARNING_NUMBER); $("#PROJECT_NAME_337").text(data.PROJECT_NAME); $("#START_TIME_337").text(data.START_TIME); $("#END_TIME_337").text(data.END_TIME); $("#FILL_IN_SCHEDULE_337").text(schedule); if(schedule=="周期性"){ $(".temporary").hide(); $(".round").show(); $("#ROUND_TIME_337").text(data.ROUND_TIME); } if(schedule=="临时性"){ $(".temporary").show(); $(".round").hide(); $("#TEMPORARY_TIME_337").text(data.TEMPORARY_TIME); } var message = data.REPORT_DEPT.split(":")[1].split("|"); var depts =""; for(var i=0;i"); var li ; for(var i=0;i"+textArr[i]+""); }else{ li = $("
  • "+textArr[i]+",
  • "); } var type = obj[textArr[i]]; if(deptLevel=="1" || deptLevel=="2"){ if(type="2"){ type="101"; } } li.data("data_type",type); //li.data("data_type",obj[textArr[i]]); li.on("click",function(){ var report_type = $(this).data("data_type"); window.parent.document.getElementById("frmright").setAttribute("src",encodeURI("/nwyj/page/business/em/report/View.html?report_type="+report_type+"&fd_id="+fd_id+"_a&go=yj")); }); ul.append(li); }; return ul; };