
var cst=2062;var oxe="DefaultF_";var FlowMng={};function yhx(b){if(ymr(b)||isNaN(b)||parseInt(b,10)<1)b=npp(cst,oxe);if(ymr(b)||isNaN(b)||parseInt(b,10)<1){art.VLdialog.alert("请点击左边的工作流，选择流程后点击这里进入流程的设计！",function(){},20,"提示");return}
var c="/WorkFlow/FlowDesigner.html?IsDesigning=1&flowId="+b;var d=950;var e=500;art.VLdialog.open(c,{title:"工作流设计",width:d,height:e,zIndex:'99999',background:'#0c2136',lock:true,top:'47.2%',duration:0,opacity:0.3,button:[{name:'新建节点',title:"新建节点",width:'250px',height:'20px',callback:function(){var a=this.iframe.contentWindow;a.pyp();return false},focus:true},{name:'保存布局',title:"保存布局",width:'250px',height:'20px',callback:function(){var a=this.iframe.contentWindow;a.zze(b);return false},focus:true},{name:'刷   新',title:"刷   新",width:'250px',height:'20px',callback:function(){var a=this.iframe.contentWindow;a.elw(b,true);return false}},{name:'关   闭',width:'250px',height:'20px',callback:function(){var a=this.iframe.contentWindow;return true},focus:false}]},true)}
DcxCom.ShowWfDlgDesigner=yhx;function kmi(a,b,c){var d=c.iframe.contentWindow;var e=d.mxx(a,b);var f=d.yci(a,b);var g=d.col(a,b);var h=g.$form;var i=d.sme(h,false,a,b,true,a,f);if(ymr(i)||i==false){art.VLdialog.alert("获取表单数据失败。您输入的数据有误。",function(){},4,"提示");return null}
return null};function xst(){var c=WF.tum(cst,oxe,this);if(!ymr(c)){var d={"obj":c};var e="/WebServices/WorkFlow/FlowType.asmx/AddFlow";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:e,data:JSON2.stringify(d),dataType:'json',success:function(a){a=hmy(a);if(a.IsOK)art.VLdialog.tips("保存成功！",1);else art.VLdialog.tips("保存失败。原因："+a.ErrorMsg+"",1);var b=a.NewId;omb(cst,oxe,b,2)},error:function(a){var b=JSON2.stringify(a);alert("添加工作流失败。详情："+b);return false}})}}
FlowMng.AddFlow=xst;function miu(){var c=WF.tum(cst,oxe,this);if(!ymr(c)){var d={"obj":c};var e="/WebServices/WorkFlow/FlowType.asmx/UpdateFlow";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:e,data:JSON2.stringify(d),dataType:'json',success:function(a){a=hmy(a);if(a.IsOK)art.VLdialog.tips("保存成功！",1);else art.VLdialog.tips("保存失败。原因："+a.ErrorMsg+"",1);Dcx.RemoveCache(c.FlowId,1)},error:function(a){var b=JSON2.stringify(a);alert("修改工作流失败。详情："+b);return false}})}}
FlowMng.UpdateFlow=miu;function yof(){if(e<1)return;var e=zgp(cst,oxe);art.VLdialog.confirm('确定要删除本流程吗？',function(){if(!ymr(MFieldJson)){var c={"flowId":e};var d="/WebServices/WorkFlow/FlowType.asmx/DeleteFlow";$.ajax({type:"POST",contentType:"application/json; charset=utf-8",url:d,data:JSON2.stringify(c),dataType:'json',success:function(a){a=hmy(a);if(a.IsOK){art.VLdialog.tips("删除成功！",1);yyr(cst,oxe,true)}else art.VLdialog.tips("删除失败。原因："+a.ErrorMsg+"",1);Dcx.RemoveCache(e,1)},error:function(a){var b=JSON2.stringify(a);alert("删除工作流失败。详情："+b);return false}})}},function(){art.VLdialog.tips('你取消了删除')})}
FlowMng.DeleteFlow=yof;