RoadFlow2.1 临时演示

Set_Step.aspx 31KB

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