RoadFlow2.1 临时演示

Set_SubFlow.aspx 33KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Set_SubFlow.aspx.cs" Inherits="WebForm.Platform.WorkFlowDesigner.Set_SubFlow" %>
  2. <!DOCTYPE html>
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head runat="server">
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  6. <title></title>
  7. </head>
  8. <body>
  9. <form id="form1" runat="server">
  10. <%
  11. RoadFlow.Platform.WorkFlow bworkFlow = new RoadFlow.Platform.WorkFlow();
  12. RoadFlow.Platform.DBConnection bdbConn = new RoadFlow.Platform.DBConnection();
  13. RoadFlow.Platform.WorkFlowButtons bworkFlowButtons = new RoadFlow.Platform.WorkFlowButtons();
  14. RoadFlow.Platform.AppLibrary bappLibrary = new RoadFlow.Platform.AppLibrary();
  15. string appLibraryTypes = bappLibrary.GetTypeOptions();
  16. string stepID = Request.QueryString["id"];
  17. string stepX = Request.QueryString["x"];
  18. string stepY = Request.QueryString["y"];
  19. string stepWidth = Request.QueryString["width"];
  20. string stepHeight = Request.QueryString["height"];
  21. string flowOptions = bworkFlow.GetOptions("");
  22. %>
  23. <div id="tabdiv">
  24. <div id="div_base" title="&nbsp;&nbsp;基本&nbsp;&nbsp;">
  25. <div style="height:8px;"></div>
  26. <table cellpadding="0" cellspacing="1" border="0" width="99%" class="formtable">
  27. <tr>
  28. <th>步骤ID:</th>
  29. <td colspan="3"><input type="text" id="base_ID" value="<%=stepID %>" class="mytext" readonly="readonly" style="width:75%"/></td>
  30. </tr>
  31. <tr>
  32. <th>步骤名称:</th>
  33. <td colspan="3"><input type="text" id="base_Name" class="mytext" style="width:75%"/></td>
  34. </tr>
  35. <tr>
  36. <th style="width:100px">意见显示:</th>
  37. <td style="width:35%">
  38. <select class="myselect" value1="1" style="width:75%;" id="base_OpinionDisplay">
  39. <option value="1">显示</option>
  40. <option value="0">不显示</option>
  41. </select>
  42. </td>
  43. <th style="width:100px">超期提示:</th>
  44. <td style="width:35%">
  45. <select class="myselect" value1="1" style="width:75%;" id="base_ExpiredPrompt">
  46. <option value="1">提示</option>
  47. <option value="0">不提示</option>
  48. </select>
  49. </td>
  50. </tr>
  51. <tr>
  52. <th>审签类型:</th>
  53. <td>
  54. <select class="myselect" value1="2" style="width:75%;" id="base_SignatureType">
  55. <option value="0">无签批意见栏</option>
  56. <option value="1">有签批意见(无须签章)</option>
  57. <option value="2">有签批意见(须签章)</option>
  58. </select>
  59. </td>
  60. <th>工时(小时):</th>
  61. <td><input type="text" id="base_WorkTime" class="mytext" style="width:73%;"/></td>
  62. </tr>
  63. <tr>
  64. <th>是否归档:</th>
  65. <td>
  66. <select class="myselect" value1="0" style="width:75%;" id="base_Archives">
  67. <option value="0">不归档</option>
  68. <option value="1">归档</option>
  69. </select>
  70. </td>
  71. <th></th>
  72. <td>
  73. </td>
  74. </tr>
  75. <tr>
  76. <th>表单:</th>
  77. <td colspan="3">
  78. <select class="myselect" style="width:130px; max-height:200px;" onchange="form_types_change(this.value);" id="form_types">
  79. <option value=""></option>
  80. <%=appLibraryTypes %>
  81. </select>
  82. <select class="myselect" style="width:390px;" id="form_forms" ></select>
  83. </td>
  84. </tr>
  85. <tr>
  86. <th>子流程:</th>
  87. <td colspan="3"><select id="base_SubFlow" class="myselect" style="width:75%;"><option value=""></option><%=flowOptions %></select></td>
  88. </tr>
  89. <tr>
  90. <th>说明:</th>
  91. <td colspan="3"><textarea id="base_Note" class="mytext" style="width:89%; height:50px;"></textarea></td>
  92. </tr>
  93. </table>
  94. </div>
  95. <div id="div_behavior" title="&nbsp;&nbsp;策略&nbsp;&nbsp;">
  96. <div style="height:8px;"></div>
  97. <table cellpadding="0" cellspacing="1" border="0" width="99%" class="formtable">
  98. <tr>
  99. <th style="width:13%">流转类型:</th>
  100. <td style="width:37%">
  101. <select class="myselect" style="width:210px;" id="behavior_FlowType">
  102. <option value="0">系统控制</option>
  103. <option value="1">单选一个分支流转</option>
  104. <option value="2">多选几个分支流转</option>
  105. </select>
  106. </td>
  107. <th>运行时选择:</th>
  108. <td>
  109. <select class="myselect" style="width:210px;" id="behavior_RunSelect">
  110. <option value="1">允许</option>
  111. <option value="0">不允许</option>
  112. </select>
  113. </td>
  114. </tr>
  115. <tr>
  116. <th>处理者类型:</th>
  117. <td>
  118. <select class="myselect" style="width:210px;" id="behavior_HandlerType">
  119. <option value="0">所有成员</option>
  120. <option value="1">部门</option>
  121. <option value="2">岗位</option>
  122. <option value="3">工作组</option>
  123. <option value="4">人员</option>
  124. <option value="5">发起者</option>
  125. <option value="6">前一步骤处理者</option>
  126. <option value="7">某一步骤处理者</option>
  127. <option value="8">字段值</option>
  128. <option value="9">发起者领导</option>
  129. <option value="10">发起者分管领导</option>
  130. <option value="11">前一步处理者领导</option>
  131. <option value="12">前一步处理者分管领导</option>
  132. </select>
  133. </td>
  134. <th>选择范围:</th>
  135. <td><input type="text" id="behavior_SelectRange" onchange="handlerTypeCng()" user="0" more="0" dept="1" station="1" workgroup="1" class="mymember" style="width:164px;"/></td>
  136. </tr>
  137. <tr>
  138. <th>处理者步骤:</th>
  139. <td>
  140. <select class="myselect" style="width:210px;" id="behavior_HandlerStep"></select>
  141. </td>
  142. <th>值字段:</th>
  143. <td>
  144. <select class="myselect" style="width:210px;" id="behavior_ValueField"></select>
  145. </td>
  146. </tr>
  147. <tr>
  148. <th>默认处理者:</th>
  149. <td><input type="text" class="mymember" dept="1" station="1" workgroup="1" user="1" more="1" id="behavior_DefaultHandler" style="width:164px;"/></td>
  150. <th>退回策略:</th>
  151. <td>
  152. <select class="myselect" style="width:210px;" id="behavior_BackModel">
  153. <option value="1">根据处理策略退回</option>
  154. <option value="0">不能退回</option>
  155. </select>
  156. </td>
  157. </tr>
  158. <tr>
  159. <th>处理策略:</th>
  160. <td>
  161. <select class="myselect" style="width:210px;" id="behavior_HanlderModel">
  162. <option value="0">所有人必须同意</option>
  163. <option value="1">一人同意即可</option>
  164. <option value="2">依据人数比例</option>
  165. <option value="3">独立处理</option>
  166. </select>
  167. </td>
  168. <th>退回类型:</th>
  169. <td>
  170. <select class="myselect" style="width:210px;" id="behavior_BackType">
  171. <option value="0">退回前一步</option>
  172. <option value="1">退回第一步</option>
  173. <option value="2">退回某一步</option>
  174. </select>
  175. </td>
  176. </tr>
  177. <tr>
  178. <th>策略百分比:</th>
  179. <td><input type="text" id="behavior_Percentage" class="mytext" style="width:205px" /></td>
  180. <th>退回步骤:</th>
  181. <td>
  182. <select class="myselect" style="width:210px;" id="behavior_BackStep">
  183. </select>
  184. </td>
  185. </tr>
  186. <tr>
  187. <th>会签策略:</th>
  188. <td>
  189. <select class="myselect" value1="0" style="width:210px;" id="behavior_Countersignature">
  190. <option value="0">不会签</option>
  191. <option value="1">所有步骤同意</option>
  192. <option value="2">一个步骤同意即可</option>
  193. <option value="3">依据比例</option>
  194. </select>
  195. </td>
  196. <th>会签百分比:</th>
  197. <td>
  198. <input type="text" id="behavior_CountersignaturePercentage" class="mytext" style="width:205px" />
  199. </td>
  200. </tr>
  201. <tr>
  202. <th>子流程策略:</th>
  203. <td>
  204. <select class="myselect" value1="0" style="width:210px;" id="behavior_SubFlowStrategy">
  205. <option value="0">子流程完成才能提交</option>
  206. <option value="1">子流程发起即可提交</option>
  207. </select>
  208. </td>
  209. <th></th>
  210. <td>
  211. </td>
  212. </tr>
  213. </table>
  214. </div>
  215. <!--
  216. <div id="div_form" class="mytab_div" style="display:none; width:99%; margin:0 auto;">
  217. <div>
  218. <table cellpadding="0" cellspacing="1" border="0">
  219. <tr>
  220. <td style="padding-right:4px;">
  221. <select class="myselect" style="width:130px; max-height:200px;" onchange="form_types_change(this.value);" id="form_types">
  222. <option value=""></option>
  223. </select>
  224. </td>
  225. <td>
  226. </td>
  227. <td style="padding-left:3px;"><input type="button" class="mybutton" value="添加" onclick="form_add();" /></td>
  228. </tr>
  229. </table>
  230. </div>
  231. <div style="border:0px solid #e8e8e8; margin-top:6px; padding:3px 5px 3px 5px;" id="form_list">
  232. <div style="width:98%;"></div>
  233. </div>
  234. </div>
  235. -->
  236. <div id="div_button" style="width:99%;margin:0 auto;" title="&nbsp;&nbsp;按钮&nbsp;&nbsp;">
  237. <div style="height:8px;"></div>
  238. <div id="button_List" style="width:220px; height:270px; overflow:auto; border:1px solid #e8e8e8; padding:3px; float:left;">
  239. <div style="width:94%;">
  240. <ul class="listulli" note="按钮之间的分隔线" title="按钮之间的分隔线" val="other_splitline" onmouseover="$(this).removeClass().addClass('listulli1');" onmouseout="if($currentButton==null || $currentButton.get(0)!==this){$(this).removeClass().addClass('listulli');}" onclick="button_click(this);" ondblclick="button_dblclick(this)" >- -分隔线- -</ul>
  241. <%
  242. foreach(var button in bworkFlowButtons.GetAll(true))
  243. {
  244. %>
  245. <ul class="listulli" note="<%=button.Note %>" title="<%=button.Note %>" val="<%=button.ID %>" onmouseover="$(this).removeClass().addClass('listulli1');" onmouseout="if($currentButton==null || $currentButton.get(0)!==this){$(this).removeClass().addClass('listulli');}" onclick="button_click(this);" ondblclick="button_dblclick(this)" ><label style="background:url(../../<%=button.Ico%>) no-repeat left;padding-left:20px;"><%=button.Title %></label></ul>
  246. <%}%>
  247. </div>
  248. </div>
  249. <div style="float:left; width:50px; text-align:center; padding-top:100px;">
  250. <input type="button" class="mybutton" value="添加" onclick="button_add();" /><br /><br />
  251. <input type="button" class="mybutton" value="删除" onclick="button_remove();" />
  252. </div>
  253. <div id="button_Select" style="width:220px; height:270px; overflow:auto; border:1px solid #e8e8e8; padding:3px; float:left;">
  254. <div style="width:94%;"></div>
  255. </div>
  256. <div style="width:20px; height:270px; float:left;"></div>
  257. <div id="button_Note" style="width:140px; height:270px; overflow:auto; border:1px solid #e8e8e8; padding:3px; float:left; overflow:auto;">
  258. <div style="font-weight:bold; line-height:22px;">按钮说明:</div>
  259. <div id="button_Note1" style="line-height:22px;"></div>
  260. </div>
  261. <div style="clear:both;"></div>
  262. </div>
  263. <div id="div_data" style="width:99%; margin:0 auto;" title="&nbsp;&nbsp;数据&nbsp;&nbsp;">
  264. <div style="height:8px;"></div>
  265. <table cellpadding="0" cellspacing="1" border="0">
  266. <tr>
  267. <td>数据表:</td>
  268. <td style="padding-right:8px;"><select class="myselect" id="data_alltable" style="width:160px;"></select></td>
  269. <td style="height:32px;">将所有字段设置为:</td>
  270. <td style="padding-right:8px;"><select class="myselect" id="data_allstate" onchange="data_StateCng(this.value)"><option value=""></option><option value="0">编辑</option><option value="1">只读</option><option value="2">隐藏</option></select></td>
  271. <td>将所有字段检查设置为:</td>
  272. <td><select class="myselect" id="data_allcheck" style="width:120px;" onchange="data_CheckCng(this.value)"><option value=""></option><option value="0">不检查</option><option value="1">允许为空,非空时检查</option><option value="2">不允许为空,并检查</option></select></td>
  273. </tr>
  274. </table>
  275. <div style="width:100%; height:260px; overflow:auto;">
  276. <table cellpadding="0" cellspacing="1" border="0" width="100%" class="listtable" id="data_table">
  277. <thead>
  278. <tr>
  279. <th>数据连接</th>
  280. <th>数据表</th>
  281. <th>字段名称</th>
  282. <th>字段状态</th>
  283. <th>数据检查</th>
  284. </tr>
  285. </thead>
  286. <tbody>
  287. </tbody>
  288. </table>
  289. </div>
  290. </div>
  291. <div id="div_event" title="&nbsp;&nbsp;事件&nbsp;&nbsp;">
  292. <div style="height:8px;"></div>
  293. <table cellpadding="0" cellspacing="1" border="0" width="99%" class="formtable">
  294. <tr>
  295. <th style="width:130px;">子流程激活前事件:</th>
  296. <td><input type="text" id="event_SubFlowActivationBefore" class="mytext" style="width:75%" /></td>
  297. </tr>
  298. <tr>
  299. <th style="width:130px;">子流程完成后事件:</th>
  300. <td><input type="text" id="event_SubFlowCompletedBefore" class="mytext" style="width:75%" /></td>
  301. </tr>
  302. <tr>
  303. <th style="width:130px;">步骤提交前事件:</th>
  304. <td><input type="text" id="event_SubmitBefore" class="mytext" style="width:75%" /></td>
  305. </tr>
  306. <tr>
  307. <th>步骤提交后事件:</th>
  308. <td><input type="text" id="event_SubmitAfter" class="mytext" style="width:75%" /></td>
  309. </tr>
  310. <tr>
  311. <th>步骤退回前事件:</th>
  312. <td><input type="text" id="event_BackBefore" class="mytext" style="width:75%" /></td>
  313. </tr>
  314. <tr>
  315. <th>步骤退回后事件:</th>
  316. <td><input type="text" id="event_BackAfter" class="mytext" style="width:75%" /></td>
  317. </tr>
  318. </table>
  319. </div>
  320. </div>
  321. <div style="width:100%; margin:10px auto 10px auto; text-align:center;">
  322. <input type="button" class="mybutton" value=" 确 定 " onclick="confirm1();" />
  323. <input type="button" class="mybutton" value=" 取 消 " onclick="new RoadUI.Window().close();" />
  324. </div>
  325. <script type="text/javascript">
  326. var frame = null;
  327. var openerid = '<%=Request.QueryString["openerid"]%>';
  328. var stepid = '<%=stepID%>';
  329. $(function ()
  330. {
  331. new RoadUI.Tab({ id: "tabdiv", replace: true, contextmenu:false });
  332. var iframes = top.frames;
  333. for (var i = 0; i < iframes.length; i++)
  334. {
  335. if (iframes[i].name == openerid + "_iframe")
  336. {
  337. frame = iframes[i]; break;
  338. }
  339. }
  340. if (frame == null) return;
  341. //初始化行为里面字段值选择项以及字段状态列表
  342. var fields = frame.links_tables_fields;
  343. var tables = [];
  344. if(fields && fields.length>0)
  345. {
  346. var trs='';
  347. var valueFieldOptions='<option value=""></option>';
  348. for(var i=0;i<fields.length;i++)
  349. {
  350. valueFieldOptions+='<option value="'+fields[i].link+'.'+fields[i].table+'.'+fields[i].field+'">'+fields[i].linkName+'.'+fields[i].table+'.'+fields[i].field+(fields[i].fieldNote?'('+fields[i].fieldNote+')':'')+'</option>';
  351. trs+='<tr>';
  352. trs+='<td style="background:#ffffff; height:30px;">';
  353. trs+='<input type="hidden" value="'+i.toString()+'" id="data_check_index_'+i.toString()+'" />';
  354. trs+='<input type="hidden" value="'+fields[i].link+'.'+fields[i].table+'.'+fields[i].field+'" id="data_check_field_'+i.toString()+'" />';
  355. trs+=fields[i].linkName+'</td>';
  356. trs+='<td style="background:#ffffff;">'+fields[i].table+'</td>';
  357. trs+='<td style="background:#ffffff;">'+fields[i].field+(fields[i].fieldNote?'('+fields[i].fieldNote+')':'')+'</td>';
  358. trs+='<td style="background:#ffffff;"><select class="myselect" id="data_check_status_'+i.toString()+'" style="width:60px;"><option value="0">编辑</option><option value="1">只读</option><option value="2">隐藏</option></select></td>';
  359. trs+='<td style="background:#ffffff;"><select class="myselect" id="data_check_check_'+i.toString()+'" style="width:100px;"><option value="0">不检查</option><option value="1">允许为空,非空时检查</option><option value="2">不允许为空,并检查</option></select></td>';
  360. trs+='</tr>';
  361. tables.push(fields[i].table);
  362. }
  363. $("#behavior_ValueField").html(valueFieldOptions);
  364. $("#data_table tbody").append(trs);
  365. new RoadUI.Select().init($(".myselect", $("#data_table tbody")));
  366. }
  367. //初始化所有表过滤下拉选择
  368. tables = tables.unique();
  369. var tablesoptions='<option value=""></option>';
  370. for(var i=0; i<tables.length; i++)
  371. {
  372. tablesoptions+='<option value="'+tables[i]+'">'+tables[i]+'</option>';
  373. }
  374. $("#data_alltable").html(tablesoptions).bind("change",function()
  375. {
  376. var value=$(this).val();
  377. var $trs=$("#data_table tbody tr");
  378. if(value.length==0)
  379. {
  380. $trs.show();
  381. return;
  382. }
  383. for(var i=0;i<$trs.size();i++)
  384. {
  385. var $tds=$("td",$trs.eq(i));
  386. if($tds.size()>2 && $tds.eq(1).text()!=value)
  387. {
  388. $trs.eq(i).hide();
  389. }
  390. else
  391. {
  392. $trs.eq(i).show();
  393. }
  394. }
  395. });
  396. var json = frame.wf_json;
  397. var step;
  398. if(json && json.steps && json.steps.length>0)
  399. {
  400. var stepOptions='<option value=""></option>';//初始化行为里面的处理者步骤和退回步骤选择
  401. for(var i=0;i<json.steps.length;i++)
  402. {
  403. if(json.steps[i].id==stepid)
  404. {
  405. step=json.steps[i];
  406. }
  407. else
  408. {
  409. stepOptions+='<option value="'+json.steps[i].id+'">'+json.steps[i].name+'</option>';
  410. }
  411. }
  412. $("#behavior_HandlerStep").html(stepOptions);
  413. $("#behavior_BackStep").html(stepOptions);
  414. }
  415. initStep(step);
  416. //按钮排序
  417. new RoadUI.DragSort($("#button_Select div"));
  418. //删除子流程选择项中的当前流程选项(子流程不能是当前流程)
  419. var $subflows=$("#base_SubFlow option");
  420. for(var i=0;i<$subflows.size();i++)
  421. {
  422. if($subflows.eq(i).val().length>0 && $subflows.eq(i).val()==json.id)
  423. {
  424. $subflows.eq(i).remove();
  425. }
  426. }
  427. });
  428. function form_types_change(value)
  429. {
  430. $.ajax({ url: top.rootdir + "/Platform/RoleApp/GetApps.ashx", data: { type: value }, async: false, type: "post", success: function (txt)
  431. {
  432. $("#form_forms").html('<option value=""></option>'+txt);
  433. }
  434. });
  435. }
  436. function form_add(formid, formtitle, formtype)
  437. {
  438. formid = formid || $("#form_forms").val();
  439. if (!formid)
  440. {
  441. alert("请选择要添加的表单!");
  442. return false;
  443. }
  444. else if ($("#form_list div ul[val='" + formid + "']").size() > 0)
  445. {
  446. alert("该表单已经添加了!");
  447. return false;
  448. }
  449. var formtitle = formtitle || $("#form_forms option[value='" + formid + "']").text();
  450. var formtype = formtype || $("#form_types option[value='" + $("#form_types").val() + "']").text();
  451. var $ul = $('<ul class="listulli" val="' + formid + '"><span>' + formtitle +
  452. '</span> - <span style="color:#999999;">' + formtype + '</span>' +
  453. '<span onclick="form_remove(this); return false;" style="padding-right:12px; margin-left:10px; height:18px; line-height:18px; cursor:pointer;' +
  454. ' background:url(../../Images/ico/cancel.gif) no-repeat left; padding-left:19px;"><a href="javascript:form_remove(this);return false;">删除</a></span></ul>');
  455. $("#form_list div").append($ul);
  456. new RoadUI.DragSort($("#form_list div"));
  457. }
  458. function form_remove(span)
  459. {
  460. //if (confirm("您真的要删除该表单吗?"))
  461. //{
  462. $(span).parent().remove();
  463. //new RoadUI.DragSort($("#form_list div"));
  464. //}
  465. }
  466. var $currentButton = null;
  467. function button_click(ul)
  468. {
  469. $currentButton = $(ul);
  470. var $buttons = null;
  471. if ($currentButton.parent().parent().attr('id') == "button_List")
  472. {
  473. $buttons = $("#button_List div ul");
  474. }
  475. else if($currentButton.parent().parent().attr('id') == "button_Select")
  476. {
  477. $buttons = $("#button_Select div ul");
  478. }
  479. $buttons.each(function ()
  480. {
  481. $(this).removeClass().addClass("listulli");
  482. });
  483. $(ul).removeClass().addClass("listulli1");
  484. $("#button_Note1").text($(ul).attr("note"));
  485. }
  486. function button_dblclick(ul)
  487. {
  488. button_click(ul);
  489. button_add();
  490. }
  491. function button_add()
  492. {
  493. if ($currentButton == null)
  494. {
  495. alert("请选择要添加的按钮!");return false;
  496. }
  497. if ($currentButton.parent().parent().attr('id') == "button_List")
  498. {
  499. if($("#button_Select div ul[val='" + $currentButton.attr("val") + "']").size()>0)
  500. {
  501. alert("当前按钮已经选择了!"); return false;
  502. }
  503. $("#button_Select div").append($currentButton.clone());
  504. }
  505. else if ($currentButton.parent().parent().attr('id') == "button_Select")
  506. {
  507. $currentButton.remove();
  508. }
  509. $currentButton = null;
  510. new RoadUI.DragSort($("#button_Select div"));
  511. }
  512. function button_remove()
  513. {
  514. if ($currentButton == null)
  515. {
  516. alert("请选择要删除的按钮!"); return false;
  517. }
  518. $currentButton.remove();
  519. new RoadUI.DragSort($("#button_Select div"));
  520. }
  521. function initStep(step)
  522. {
  523. if(!step)
  524. {
  525. $("#base_Name").val("新步骤");
  526. return;
  527. }
  528. $("#base_Name").val(step.name);
  529. if(step.opinionDisplay) $("#base_OpinionDisplay").val(step.opinionDisplay);
  530. if(step.expiredPrompt) $("#base_ExpiredPrompt").val(step.expiredPrompt);
  531. if(step.signatureType) $("#base_SignatureType").val(step.signatureType);
  532. if(step.workTime) $("#base_WorkTime").val(step.workTime);
  533. //if(step.limitTime) $("#base_LimitTime").val(step.limitTime);
  534. //if(step.otherTime) $("#base_OtherTime").val(step.otherTime);
  535. if(step.archives) $("#base_Archives").val(step.archives);
  536. if(step.note) $("#base_Note").val(step.note);
  537. if(step.subflow) $("#base_SubFlow").val(step.subflow);
  538. if(step.behavior.flowType) $("#behavior_FlowType").val(step.behavior.flowType);
  539. if(step.behavior.runSelect) $("#behavior_RunSelect").val(step.behavior.runSelect);
  540. if(step.behavior.handlerType) $("#behavior_HandlerType").val(step.behavior.handlerType);
  541. if(step.behavior.selectRange)
  542. {
  543. $("#behavior_SelectRange").val(step.behavior.selectRange);
  544. new RoadUI.Member().setValue($("#behavior_SelectRange"));
  545. }
  546. if(step.behavior.handlerStep) $("#behavior_HandlerStep").val(step.behavior.handlerStep);
  547. if(step.behavior.valueField) $("#behavior_ValueField").val(step.behavior.valueField);
  548. if(step.behavior.defaultHandler)
  549. {
  550. $("#behavior_DefaultHandler").val(step.behavior.defaultHandler);
  551. new RoadUI.Member().setValue($("#behavior_DefaultHandler"));
  552. }
  553. if(step.behavior.hanlderModel) $("#behavior_HanlderModel").val(step.behavior.hanlderModel);
  554. if(step.behavior.backModel) $("#behavior_BackModel").val(step.behavior.backModel);
  555. if(step.behavior.backType) $("#behavior_BackType").val(step.behavior.backType);
  556. if(step.behavior.backStep) $("#behavior_BackStep").val(step.behavior.backStep);
  557. if(step.behavior.percentage) $("#behavior_Percentage").val(step.behavior.percentage);
  558. if(step.behavior.countersignature) $("#behavior_Countersignature").val(step.behavior.countersignature);
  559. if(step.behavior.countersignaturePercentage) $("#behavior_CountersignaturePercentage").val(step.behavior.countersignaturePercentage);
  560. if(step.behavior.subflowstrategy) $("#behavior_SubFlowStrategy").val(step.behavior.subflowstrategy);
  561. var forms=step.forms;
  562. if(forms && forms.length>0)
  563. {
  564. for(var i=0;i<forms.length;i++)
  565. {
  566. //form_add(forms[i].id,forms[i].name,forms[i].type);
  567. $('#form_types').val(forms[i].type);
  568. form_types_change(forms[i].type);
  569. $("#form_forms").val(forms[i].id);
  570. }
  571. }
  572. var buttons=step.buttons;
  573. if(buttons && buttons.length>0)
  574. {
  575. for(var i=0;i<buttons.length;i++)
  576. {
  577. var $ul=$("#button_List div ul[val='"+buttons[i].id+"']");
  578. if($ul.size()>0)
  579. {
  580. $currentButton=$ul;
  581. button_add();
  582. }
  583. }
  584. }
  585. initDataFiledStatus(step.fieldStatus);
  586. if(step.event)
  587. {
  588. $("#event_SubFlowActivationBefore").val(step.event.subflowActivationBefore);
  589. $("#event_SubFlowCompletedBefore").val(step.event.subflowCompletedBefore);
  590. $("#event_SubmitBefore").val(step.event.submitBefore);
  591. $("#event_SubmitAfter").val(step.event.submitAfter);
  592. $("#event_BackBefore").val(step.event.backBefore);
  593. $("#event_BackAfter").val(step.event.backAfter);
  594. }
  595. }
  596. function initDataFiledStatus(fields)//初始化字段状态列表
  597. {
  598. if(!fields || fields.length==0)
  599. {
  600. return;
  601. }
  602. $("#data_table tbody tr").each(function(){
  603. var field=$("input[id^='data_check_field_']",$(this)).val();
  604. var status="0";
  605. var check="0";
  606. for(var i=0;i<fields.length;i++)
  607. {
  608. if(fields[i].field==field)
  609. {
  610. status=fields[i].status;
  611. check=fields[i].check;
  612. break;
  613. }
  614. }
  615. $("select[id^='data_check_status_']",$(this)).val(status)
  616. $("select[id^='data_check_check_']",$(this)).val(check)
  617. });
  618. }
  619. function data_StateCng(value)
  620. {
  621. $("select[id^='data_check_status_']", $("#data_table tbody")).val(value);
  622. }
  623. function data_CheckCng(value)
  624. {
  625. $("select[id^='data_check_check_']", $("#data_table tbody")).val(value);
  626. }
  627. function confirm1()
  628. {
  629. var step = {};
  630. step.id = stepid;
  631. step.type = "subflow";
  632. step.name = $("#base_Name").val() || "";
  633. step.opinionDisplay = $("#base_OpinionDisplay").val() || "";
  634. step.expiredPrompt = $("#base_ExpiredPrompt").val()||"";
  635. step.signatureType = $("#base_SignatureType").val() || "";
  636. step.workTime = $("#base_WorkTime").val() || "";
  637. step.limitTime = "" // $("#base_LimitTime").val() || "";
  638. step.otherTime = "" // $("#base_OtherTime").val() || "";
  639. step.archives = $("#base_Archives").val() || "";
  640. step.archivesParams = $("#base_ArchivesParams").val()||"";
  641. step.note = $("#base_Note").val() || "";
  642. step.position = {x:<%=stepX%>, y:<%=stepY%>, width:<%=stepWidth%>, height:<%=stepHeight%>};
  643. step.countersignature = $("#base_Countersignature_1").prop("checked") ? 1 : 0;
  644. step.subflow = $("#base_SubFlow").val() || "";
  645. step.behavior={
  646. flowType: $("#behavior_FlowType").val() || "",
  647. runSelect: $("#behavior_RunSelect").val() || "",
  648. handlerType: $("#behavior_HandlerType").val() || "",
  649. selectRange: $("#behavior_SelectRange").val() || "",
  650. handlerStep: $("#behavior_HandlerStep").val() || "",
  651. valueField: $("#behavior_ValueField").val() || "",
  652. defaultHandler: $("#behavior_DefaultHandler").val() || "",
  653. hanlderModel: $("#behavior_HanlderModel").val() || "",
  654. backModel: $("#behavior_BackModel").val() || "",
  655. backType: $("#behavior_BackType").val() || "",
  656. backStep: $("#behavior_BackStep").val()||"",
  657. percentage: $("#behavior_Percentage").val() || "",
  658. countersignature: $("#behavior_Countersignature").val() || "0",
  659. countersignaturePercentage: $("#behavior_CountersignaturePercentage").val() || "",
  660. subflowstrategy: $("#behavior_SubFlowStrategy").val() || ""
  661. };
  662. step.forms = [];
  663. //$("#form_list div ul").each(function(i){
  664. // var $spans=$(this).children('span');
  665. // step.forms.push({ id: $(this).attr("val"), name:$spans.eq(0).text(), type:$spans.eq(1).text(), srot:i });
  666. //});
  667. var form_type=$('#form_types').val()||"";
  668. var form_forms=$("#form_forms").val()||"";
  669. if(form_forms.length > 0 && form_type.length > 0)
  670. {
  671. step.forms.push({ id: form_forms, name:"", type:form_type, srot:0 });
  672. }
  673. step.buttons=[];
  674. $("#button_Select div ul").each(function(i){
  675. step.buttons.push({ id: $(this).attr("val"), sort: i });
  676. });
  677. step.fieldStatus=[];
  678. $("#data_table tbody input[type='hidden'][id^='data_check_index_']").each(function(i){
  679. var index=$(this).val();
  680. var fields=$("#data_check_field_"+index).val();
  681. var status=$("#data_check_status_"+index).val();
  682. var check=$("#data_check_check_"+index).val();
  683. step.fieldStatus.push({field:fields,status:status,check:check});
  684. });
  685. step.event = {
  686. subflowActivationBefore: $("#event_SubFlowActivationBefore").val()||"",
  687. subflowCompletedBefore: $("#event_SubFlowCompletedBefore").val()||"",
  688. submitBefore: $("#event_SubmitBefore").val()||"",
  689. submitAfter: $("#event_SubmitAfter").val() || "",
  690. backBefore: $("#event_BackBefore").val() || "",
  691. backAfter: $("#event_BackAfter").val() || ""
  692. };
  693. frame.addStep1(step);
  694. frame.setStepText(step.id,step.name);
  695. new RoadUI.Window().close();
  696. }
  697. </script>
  698. </form>
  699. </body>
  700. </html>