123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292 |
- var corpId = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- var jb_role = getRoleNameById();//获取专业管理部门角色id,name
- jb_role[0].R002105430205 = "应急办";
- function createBaoGaoTable(corpId,role_id){
- $("#baoGaoCon").empty();
- $(".dateSel").hide();
- $("body").eq(0).showLoading();
- $.ajax({
- url : $.pathname()+ "/ws/xianlutingyun/XianlutingyunService/getBaoGaoDaiBan",
- type : 'post',
- timeout : 15000,
- async : false,
- data : {"company_id":corpId,"role_id":role_id},
- dataType : 'json',
- success : function(data){
- var sj_add = false;
- var bj_add = false;
- if(data==null ){
- $("#baoGaoCon").append("<span class='spantip'>没有要填写的报告数据</span>");
- $("body").eq(0).hideLoading();
- return;
- }
- var sj_div = $("<div style='width : 99.2%'><div class='bgd_title bgd_show' id='baoGao_sj'>上级</div><hr/></div>");
- var bj_div = $("<div style='width : 99.2%'><div class='bgd_title bgd_show' id='baoGao_bj'>本级</div><hr/></div>");
- $("#baoGaoCon").append(sj_div);
- $("#baoGaoCon").append(bj_div);
- var $sj = $("<div id='content_baoGao_sj'></div>");//上级报告填报要求
- var $bj = $("<div id='content_baoGao_bj'></div>");//本级报告填报要求
- sj_div.after($sj);
- bj_div.after($bj);
- // $sj.append($("<div style='width : 99.2%'><div class='bgd_title bgd_hide' id='baoGao_sj'>上级</div><hr/></div>"));
- // $bj.append($("<div style='width : 99.2%'><div class='bgd_title bgd_hide' id-'baoGao_bj'>本级</div><hr/></div>"));
- for (var i = 0; i < data.length; i++) {
- var table = $("<table class='table'></table>");
- var th = $("<thead></thead>");
- var tbody = $("<tbody></tbody>");
- var is_up = data[i].is_up;
- if(is_up==0){
- $sj.append(table);
- sj_add = true;
- }else{
- $bj.append(table);
- bj_add = true;
- }
- table.append(th).append(tbody);
- //表头
- th.append($("<tr><td class='cententCenter' colspan='4'><div class='TitleHeads blue_color'>"+data[i].PROGRAMME_NAME+"</div></td></tr>"));
- th.append($("<tr><td class='cententCenter td_head'>报告类型</td><td class='cententCenter td_head'>要求填报时间</td><td class='cententCenter td_head'>填报角色</td><td class='cententCenter td_head'>操作</td></tr>"));
-
- //填报时间#填报角色
- var input_time = data[i].input_time;
- //获取第一列(报告类型)的跨行数
- var rowspan1 = getCharNumFromString(input_time,"#");
- var tr = $("<tr></tr>");
-
- //报告类型
- var report_type = data[i].REPORT_TYPE;
- var report_type_name = "";
- if(report_type==1){
- report_type_name = "预警行动信息报告";
- }else if(report_type==2){
- report_type_name = "预警总结报告";
- }else if(report_type==3){
- report_type_name = "应急工作专报";
- }else if(report_type==4){
- report_type_name = "应急工作动态";
- }
- var td1 = $("<td rowspan='"+rowspan1+"' class='cententCenter td_border1' >"+report_type_name+"</td>");
-
- var timeArr = input_time.split(";");
- for (var j = 0; j < timeArr.length; j++) {
- var inputRoleArr = timeArr[j].split("#");//第一个元素为时间,后面的元素才是填报角色id
- var td2 = $("<td rowspan='"+(inputRoleArr.length-1)+"' class='cententCenter td_border1' >"+inputRoleArr[0]+"</td>");
- var tr1 = $("<tr></tr>");
- if(j==0){
- tr.append(td1).append(td2);
- tbody.append(tr);
- }else{
- tr1.append(td2);
- }
-
- //循环填报角色id
- for (var k = 1; k < inputRoleArr.length; k++) {
- var td3 = $("<td class='cententCenter td_border1' >"+jb_role[0][inputRoleArr[k]]+"</td>");
-
- var tb_input = $("<span class='input1'>填报</span>");
- tb_input.data("plan_time",inputRoleArr[0]);//要求填报时间
- tb_input.data("input_role",inputRoleArr[k]);//填报角色id
- tb_input.data("report_type",report_type);//报告类型
- tb_input.data("plan_id",data[i].FD_OBJECTID);//填报要求id
- tb_input.on("click",report_click);
- var td4 = $("<td class='cententCenter td_border1' ></td>");
- td4.append(tb_input);
-
- var tr2 = $("<tr></tr>");
- if(j==0 && k==1){
- tr.append(td3).append(td4);
-
- }else if(j!=0 && k==1){
- tr1.append(td3).append(td4);
- tbody.append(tr1);
- }else{
- tr2.append(td3).append(td4);
- tbody.append(tr2);
- }
- }
- }
- }
- if(!sj_add){
- $sj.append("<span class='spantip'>没有上级发布的报告要求</span>");
- }
- if(!bj_add){
- $bj.append("<span class='spantip'>没有本级发布的报告要求</span>");
- }
- setHt();
- $("body").eq(0).hideLoading();
- },
- error : function(e) {
- $.messager.alert('查询行失败!', '访问服务失败!', 'error');
- }
- });
-
- }
-
- /***
- * 获取某字符串中某字符的个数
- * @param str 字符串
- * @param char 字符
- * @returns str中char的个数
- */
- function getCharNumFromString(str,char){
- var num = 0;
- if(!str || !char || str=="" || char=="" ){
- num = 0;
- }else{
- var str1 = str.replace(new RegExp(char,'g'),"");
- num = str.length - str1.length;
- }
- return num;
- };
-
- /**
- * 点击报告的填报事件
- */
- function report_click(){
- var $self = $(this);
- var plan_time = $self.data("plan_time");//要求填报时间
- var input_role = $self.data("input_role");//填报角色id
- var report_type = $self.data("report_type");//报告类型
- var plan_id = $self.data("plan_id");//填报要求id
-
- if(report_type=="1"){
- top.document.getElementById("frmright").setAttribute("src", $.pathname()+ "/page/business/em/alert/report/reportInput/ReportInputAddEdit.jsp?pagetype=daiban&plan_id="+plan_id+"&plan_time="+plan_time+"&input_role="+input_role);
- }else if(report_type=="2"){
- //var url = $.pathname()+ "/page/business/em/alert/report/reportInput1/ReportInputAddEdit.jsp?plan_id="+plan_id;
- //alert(url+'======url');
- top.document.getElementById("frmright").setAttribute("src", $.pathname()+ "/page/business/em/alert/report/reportInput1/ReportInputAddEdit.jsp?pagetype=daiban&plan_id="+plan_id+"&plan_time="+plan_time+"&input_role="+input_role);
- }
- if(report_type=="3"){
- top.document.getElementById("frmright").setAttribute("src", $.pathname()+ "/page/business/em/response/report/reportInput/ReportInputAddEdit.jsp?pagetype=daiban&plan_id="+plan_id+"&plan_time="+plan_time+"&input_role="+input_role);
- }else if(report_type=="4"){
- top.document.getElementById("frmright").setAttribute("src", $.pathname()+ "/page/business/em/response/report/reportInput1/ReportInputAddEdit.jsp?pagetype=daiban&plan_id="+plan_id+"&plan_time="+plan_time+"&input_role="+input_role);
- }
- }
-
- /**
- 获取简报角色
- **/
- function getRoleNameById(){
- var roles = "";
- $.ajax({
- url : $.pathname() + '/ws/qrps/QueryReportProgrammeService/loadJBRole1',
- type : 'post',
- timeout : 15000,
- dataType : 'json',
- async:false,
- success : function(data) {
- roles = data;
- },
- error : function(e) {
- $.messager.alert('报送失败');
- }
- });
- return roles;
- }
-
- /**
- * 加载处置值班待办
- * @param corpId
- * @param role_id
- */
- function createWarningDutyTable(corpId,role_id){
- $("#baoGaoCon").empty();
- $(".dateSel").hide();
- $("body").eq(0).showLoading();
- $.ajax({
- url : $.pathname()+ "/ws/xianlutingyun/XianlutingyunService/getDBmsg1",
- type : 'post',
- timeout : 15000,
- async : false,
- data : {
- role_id:role_id,
- company_id:corpId,
- type:"8"//1通知单 2处置报表 3报告 4队伍调拨 5装备调拨 6限申请 7预案修编 8日常报表
- },
- dataType : 'json',
- success : function(data){
- data = data.rows.rows;
- if(!data || data.length==0 ){
- $("#baoGaoCon").append("<span class='spantip'>没有要安排的值班任务</span>");
- $("body").eq(0).hideLoading();
- return;
- }
- var table = $("<table class='table'></table>");
- var th = $("<thead></thead>");
- var tbody = $("<tbody></tbody>");
- $("#baoGaoCon").append(table);
- table.append(th).append(tbody);
- //表头
- th.append($("<tr><td class='cententCenter td_head'>任务名称</td><td class='cententCenter td_head'>开始日期</td><td class='cententCenter td_head'>截止日期</td><td class='cententCenter td_head'>班次</td><td class='cententCenter td_head'>开始时间</td><td class='cententCenter td_head'>部门</td><td class='cententCenter td_head'>操作</td></tr>"));
- for (var i = 0; i < data.length; i++) {
-
- //填报角色
- var roleStr = data[i].roleStr;
- roleStr = roleStr.split(";");
- //获取跨行数
- var rowspan1 = roleStr.length;
- var tr = $("<tr></tr>");
- var planId = data[i].planId;
- var PLAN_NAME = data[i].PLAN_NAME;
- var START_DATE = data[i].START_DATE;
- var END_DATE = data[i].END_DATE;
- var DUTY_NUM = data[i].DUTY_NUM;
- var START_TIME = data[i].START_TIME;
-
-
- var td1 = $("<td rowspan='"+rowspan1+"' class='cententCenter td_border1' >"+PLAN_NAME+"</td>");
- var td2 = $("<td rowspan='"+rowspan1+"' class='cententCenter td_border1' >"+START_DATE+"</td>");
- var td3 = $("<td rowspan='"+rowspan1+"' class='cententCenter td_border1' >"+END_DATE+"</td>");
- var td4 = $("<td rowspan='"+rowspan1+"' class='cententCenter td_border1' >"+DUTY_NUM+"</td>");
- var td5 = $("<td rowspan='"+rowspan1+"' class='cententCenter td_border1' >"+START_TIME+"</td>");
-
- for (var j = 0; j < roleStr.length; j++) {
- var inputRoleArr = roleStr[j].split(",");//填报角色id、name
- var roleId = inputRoleArr[0];
- var roleName = inputRoleArr[1];
-
- var td6 = $("<td class='cententCenter td_border1' >"+roleName+"</td>");
-
- var tb_input = $("<span class='input1'>填报</span>");
- var td7 = $("<td class='cententCenter td_border1' ></td>");
- tb_input.data("data_plan_id",planId);
- tb_input.data("data_role_id",roleId);
- tb_input.data("roleName",roleName);
- tb_input.on("click",duty_click);
- td7.append(tb_input);
- if(j==0){
- tr.append(td1).append(td2).append(td3).append(td4).append(td5).append(td6).append(td7);
- tbody.append(tr);
- }else{
- var tr1 = $("<tr></tr>");
- tr1.append(td6).append(td7);
- tbody.append(tr1);
- }
-
- }
- }
- setHt();
- $("body").eq(0).hideLoading();
- },
- error : function(e) {
- $.messager.alert('查询行失败!', '访问服务失败!', 'error');
- }
- });
-
- }
-
- /**
- * 处置值班点击事件
- */
- function duty_click(){
- var $self = $(this);
- var plan_id = $self.data("data_plan_id");//任务id
- var roleName = $self.data("roleName");//填报角色name
- roleName = encodeURI(encodeURI(roleName));
- var input_role = $self.data("data_role_id");//填报角色id
- top.document.getElementById("frmright").setAttribute("src", $.pathname()+ "/page/business/em/warningDuty/DutyRecordsAddEdit.jsp?pagetype=daiban&planId="+plan_id+"&input_role="+input_role+"&roleName="+roleName);
- }
|