function Todolist_InitPage () { var _todohtml = ""; var _runhtml = ""; var _cchtml = ""; var _completehtml = ""; //获取待办、在途、已完成数据 var handler = new HttpHandler("BP.WF.HttpHandler.CCMobilePortal_SaaS"); var data = handler.DoMethodReturnString("GetGenerWorks"); data = JSON.parse(data); //待办数据 var Todolist = data.Todolist; //在途数据 var Running = data.Running; //已完成数据 var Complete = data.Complte; //抄送数据 var CC = data.CC; //待办总数 $("#Todolist_EmpWorks").html(Todolist.length); //在途总数 $("#Todolist_Runnings").html(Running.length); //抄送总数 $("#Todolist_CCs").html(CC.length); //已完成总数 $("#Todolist_Completes").html(Complete.length); $("#EmpWorks_Count").html(Todolist.length); if (Todolist.length <= 0) { _todohtml += "
"; _todohtml += ""; _todohtml += "暂无数据"; _todohtml += "
"; $("#item_todolist").html(_todohtml); } else { //填充待办信息 $.each(Todolist, function (i, t) { _todohtml += "
"; _todohtml += "
" + t.FlowName+"
"; _todohtml += "
"; _todohtml += "
"; _todohtml += "
"; _todohtml += t.Title + "
"; if (t.WFState == 5) _todohtml += "
被退回
"; _todohtml += "
"; _todohtml += "
"; _todohtml += "
发起人:" + t.StarterName + "
"; _todohtml += "
发起时间:" + t.RDT + "
"; _todohtml += "
当前节点:" + t.NodeName + "
"; if (t.WFState == 5) { _todohtml += "
"; _todohtml += "
"; _todohtml += "
流程退回提示
"; var h = new HttpHandler("BP.WF.HttpHandler.CCMobile"); h.AddPara("WorkID", t.WorkID); h.AddPara("FK_Node", t.FK_Node); var returnData = h.DoMethodReturnString("DB_GenerReturnWorks"); returnData = cceval('(' + returnData + ')'); _todohtml += "
来自节点:
" + returnData[0].ReturnNodeName + "
"; _todohtml += "
"; _todohtml += "
退回人:
" + returnData[0].Returner + "
"; _todohtml += "
退回时间:
" + returnData[0].RDT + "
"; _todohtml += "
原因:
" + returnData[0].BeiZhu + "
"; } _todohtml += "
"; }); $("#item_todolistData").html(_todohtml); } if (Running.length <= 0) { _runhtml += "
"; _runhtml += ""; _runhtml += "暂无数据"; _runhtml += "
"; $("#item_runningData").html(_runhtml); } else { //填充在途信息 $.each(Running, function (i, t) { _runhtml += "
"; _runhtml += "
" + t.FlowName +"
"; _runhtml += "
"; _runhtml += "
"; _runhtml += "
"; _runhtml += t.Title + "
"; _runhtml += "
"; _runhtml += "
"; _runhtml += "
发起人:" + t.StarterName + "
"; _runhtml += "
发起时间:" + t.RDT + "
"; _runhtml += "
"; }); $("#item_runningData").html(_runhtml); } if (Complete.length <= 0) { _completehtml += "
"; _completehtml += ""; _completehtml += "暂无数据"; _completehtml += "
"; $("#item_completeData").html(_completehtml); } else { //填充在途信息 $.each(Complete, function (i, t) { _completehtml += "
"; _completehtml += "
" + t.FlowName + "
"; _completehtml += "
"; _completehtml += "
"; _completehtml += "
"; _completehtml += t.Title + "
"; _completehtml += "
"; _completehtml += "
"; _completehtml += "
发起人:" + t.StarterName + "
"; _completehtml += "
发起时间:" + t.RDT + "
"; _completehtml += "
"; }); $("#item_completeData").html(_completehtml); } if (CC.length <= 0) { _cchtml += "
"; _cchtml += ""; _cchtml += "暂无数据"; _cchtml += "
"; $("#item_ccData").html(_cchtml); } else { //填充抄送信息 $.each(CC, function (i, t) { _cchtml += "
"; _cchtml += "
" + t.FlowName +"
"; _cchtml += "
"; _cchtml += "
"; _cchtml += "
"; _cchtml += t.Title + "
"; _cchtml += "
"; _cchtml += "
"; _cchtml += "
抄送人:" + t.Rec + "
"; _cchtml += "
抄送时间:" + t.RDT + "
"; if (t.Sta==0) _cchtml += "
抄送状态:未读
"; else _cchtml += "
抄送状态:已读
"; _cchtml += ""; }); $("#item_ccData").html(_cchtml); } //绑定点击事件 var boxs = $(".box"); $.each(boxs, function (i, box) { var divId = $(box).attr("id"); //将ID值进行分解 var vals = divId.split('_'); //WorkID var oid = vals[0]; //流程编号 var fk_flow = vals[1]; //流程处理状态 var type = vals[2]; //节点编号 var fk_node = vals[3]; //fid var fid = vals[4]; if (type == "Todolist") { $("#" + divId).on("tap", function () { var url = basePath+"/CCMobile/MyFlow.htm?FK_Flow=" + fk_flow + "&WorkID=" + oid + "&FID=" + fid + "&MyFlowFrom=todolist" + "&m=" + Math.random(); SetHref(url); }); } else{ $("#" + divId).on("tap", function () { var url = basePath+"/CCMobile/MyView.htm?FK_Flow=" + fk_flow + "&WorkID=" + oid + "&FK_Node=" + fk_node + "&FID=" + fid + "&MyViewFrom=todolist" + "&m=" + Math.random(); SetHref(url); }); } }); }