taskReminderEdit.jsp 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/commons/include/html_doctype.html"%>
  3. <html>
  4. <head>
  5. <title>任务催办设置</title>
  6. <base target="_self" />
  7. <%@include file="/commons/include/form.jsp" %>
  8. <%-- <link href="${ctx}/styles/default/css/jquery.qtip.css" rel="stylesheet" />
  9. <link rel="stylesheet" type="text/css" href="${ctx}/js/codemirror/lib/codemirror.css" > --%>
  10. <f:link href="jquery.qtip.css"></f:link>
  11. <f:link href="codemirror/lib/codemirror.css"></f:link>
  12. <script type="text/javascript" src="${ctx}/js/hotent/displaytag.js" ></script>
  13. <script type="text/javascript" src="${ctx}/servlet/ValidJs?form=taskReminder"></script>
  14. <script type="text/javascript" src="${ctx}/js/hotent/platform/system/TemplateDialog.js"></script>
  15. <script type="text/javascript" src="${ctx}/js/hotent/platform/system/ScriptDialog.js" ></script>
  16. <script type="text/javascript" src="${ctx}/js/jquery/plugins/jquery.qtip.js" ></script>
  17. <script type="text/javascript" src="${ctx}/js/codemirror/lib/codemirror.js"></script>
  18. <script type="text/javascript" src="${ctx}/js/codemirror/lib/util/matchbrackets.js"></script>
  19. <script type="text/javascript" src="${ctx}/js/codemirror/mode/groovy/groovy.js"></script>
  20. <script type="text/javascript" src="${ctx}/js/hotent/platform/system/SysDialog.js"></script>
  21. <script type="text/javascript" charset="utf-8" src="${ctx}/js/ueditor2/form-setting/editor_config.js"></script>
  22. <script type="text/javascript" charset="utf-8" src="${ctx}/js/ueditor2/editor_api.js"></script>
  23. <style>
  24. .sub{ display: none;}
  25. .condExp-control{
  26. width: 98%;
  27. padding: 2px;
  28. margin:2px;
  29. border: solid 1px #A8CFEB;
  30. }
  31. .condExp-control [name='flowOperate']{
  32. width:65px;
  33. }
  34. .condExp-editor{
  35. width: 540px;
  36. padding: 2px;
  37. margin:2px;
  38. height: 100px;
  39. border: solid 1px #A8CFEB;
  40. overflow: auto;
  41. }
  42. .condExp-editor-input{
  43. width:100%;
  44. height: 100px;
  45. }
  46. .script-control{
  47. width: 98%;
  48. padding: 2px;
  49. margin:2px;
  50. border: solid 1px #A8CFEB;
  51. }
  52. .script-editor{
  53. width: 98%;
  54. padding: 2px;
  55. margin:2px;
  56. height: 100px;
  57. border: solid 1px #A8CFEB;
  58. overflow: auto;
  59. }
  60. .script-editor-input{
  61. width:100%;
  62. height: 100px;
  63. }
  64. .send-msg-tr{
  65. display:none;
  66. }
  67. .choose-assigner{
  68. display:none;
  69. }
  70. .day-input{
  71. width:40px;
  72. }
  73. </style>
  74. <script type="text/javascript">
  75. /*KILLDIALOG*/
  76. var dialog = frameElement.dialog; //调用页面的dialog对象(ligerui对象)
  77. var editorMail;
  78. var editorMsg
  79. function showRequest(formData, jqForm, options) {
  80. return true;
  81. }
  82. //CodeMirror Editor
  83. var condExpScriptEditor=null,
  84. actionScriptEditor=null,
  85. curTime = '${taskReminder.times}';
  86. $(function() {
  87. $("input.day-input").focus(function(){
  88. $(this).select();
  89. });
  90. //total page layout
  91. $("#reminder-layout").ligerLayout({
  92. rightWidth:210
  93. });
  94. //是否发送催办信息的checkbox
  95. $("#needSendMsg").change(function(){
  96. var me = $(this),
  97. sendMsg = me.attr("checked");
  98. if(sendMsg){
  99. $(".send-msg-tr").show();
  100. }
  101. else{
  102. $("select[name='times']").val(0);
  103. $(".send-msg-tr").hide();
  104. }
  105. });
  106. if(curTime>0){
  107. $("#needSendMsg").attr("checked","checked").trigger("change");
  108. }
  109. //TaskReminder form Edit Layout
  110. $("#reminder-div-tab").ligerTab({
  111. });
  112. //reminder action change handle
  113. change();
  114. //save reminder
  115. $("a.save").click(save);
  116. //new reminder
  117. $("#btnAdd").click(add);
  118. ueditorInit()//初始化编辑器
  119. setTimeout(function(){
  120. var height=$("#condExp").height();
  121. condExpScriptEditor = CodeMirror.fromTextArea(document.getElementById("condExp"), {
  122. mode: "text/x-groovy",
  123. lineNumbers: true,
  124. matchBrackets: true
  125. });
  126. condExpScriptEditor.setSize(null,height);
  127. },0);
  128. setTimeout(function(){
  129. var height=$("#script").height();
  130. actionScriptEditor = CodeMirror.fromTextArea(document.getElementById("script"), {
  131. mode: "text/x-groovy",
  132. lineNumbers: true,
  133. matchBrackets: true
  134. });
  135. actionScriptEditor.setSize(null,height);
  136. },0);
  137. $("#reminders-list-table tbody tr").click(function(){
  138. var id=$(this).find("input.pk").val();
  139. url=__ctx + "/platform/bpm/taskReminder/edit.ht?actDefId=${actDefId}&nodeId=${nodeId}&id=" + id;
  140. document.getElementById('goLocation').href = url;
  141. document.getElementById('goLocation').click();
  142. });
  143. // 添加预警行
  144. $("#addWarning").click(function(){
  145. var tr = $("#warningTemplate").val();
  146. var WarningTable = $("#taskWarningSetList");
  147. WarningTable.append($(tr));
  148. });
  149. handFlowVars();
  150. });
  151. //初始化编辑器
  152. function ueditorInit(){
  153. editorMail = new baidu.editor.ui.Editor
  154. ({minFrameHeight:100,initialFrameWidth:'100%',lang:'zh_cn',toolbars:
  155. [['source','undo','redo','bold','italic', 'underline',
  156. 'subscript','superscript', 'removeformat',
  157. 'selectall', 'forecolor', 'fontsize', 'backcolor','justifyleft',
  158. 'justifyright', 'justifycenter', 'justifyjustify',
  159. 'sendperson','readperson','jumpurl' ,'taskname','remaintime']]
  160. });
  161. editorMsg = new baidu.editor.ui.Editor
  162. ({minFrameHeight:100,initialFrameWidth:'100%',lang:'zh_cn',toolbars:
  163. [['source','undo','redo','bold','italic', 'underline',
  164. 'subscript','superscript', 'removeformat',
  165. 'selectall', 'forecolor', 'fontsize', 'backcolor','justifyleft',
  166. 'justifyright', 'justifycenter', 'justifyjustify'
  167. ,'sendperson','readperson','jumpurl' ,'taskname','remaintime']]
  168. });
  169. editorMail.render("mailContent");
  170. editorMsg.render("msgContent");
  171. }
  172. function delWaringLine(me){
  173. $(me).closest("tr").remove();
  174. }
  175. function handtaskWarningSet(){
  176. var warningTable = $("#taskWarningSetList");
  177. var warningSetList = [];
  178. var tbody = $(warningTable.children()[1]);
  179. tbody.children().each(function(){
  180. var tr = $(this);
  181. var name = $("[name='warnName']",tr).val();
  182. if(name){
  183. var reminderDueDay = $("[name='reminderDueDay']",tr).val();
  184. var reminderDueHour = $("[name='reminderDueHour']",tr).val();
  185. var reminderDueMinute = $("[name='reminderDueMinute']",tr).val();
  186. var relativeType = $("[name='relativeType']",tr).val();
  187. var level = $("[name='level']",tr).val();
  188. warningSetList.push(
  189. { name:name,
  190. reminderDueDay:reminderDueDay,
  191. reminderDueHour:reminderDueHour,
  192. reminderDueMinute:reminderDueMinute,
  193. relativeType:relativeType,
  194. level:level
  195. });
  196. }
  197. });
  198. $("#warningSetJson").val(JSON.stringify(warningSetList));
  199. }
  200. /**
  201. * Action Change handler
  202. */
  203. function change(){
  204. var s= $("#action").val();
  205. $(".sub").hide();
  206. $(".choose-assigner").hide();
  207. if(s==7){//选择执行脚本
  208. $(".sub").show();
  209. if(actionScriptEditor){
  210. actionScriptEditor.refresh();
  211. }
  212. }
  213. if(s==5){//选择交办
  214. $(".choose-assigner").show();
  215. }
  216. }
  217. /**
  218. * Select Template
  219. */
  220. function slectTemplate(txtId,isText){
  221. var objcondExpCode=document.getElementById(txtId);
  222. TemplateDialog({isText:isText,callback:function(content){
  223. if(txtId=='mailContent'){
  224. var html = editorMail.getContent();
  225. editorMail.setContent(html+content);
  226. }else if(txtId=='msgContent'){
  227. var html = editorMsg.getContent();
  228. editorMsg.setContent(html+content);
  229. }else{
  230. jQuery.insertText(objcondExpCode,content);
  231. }
  232. }});
  233. };
  234. /**
  235. * 添加
  236. */
  237. function add(){
  238. url=__ctx + "/platform/bpm/taskReminder/edit.ht?actDefId=${actDefId}&nodeId=${nodeId}&id=0";
  239. document.getElementById('goLocation').href = url;
  240. document.getElementById('goLocation').click();
  241. }
  242. /**
  243. * 保存
  244. */
  245. function save(){
  246. handtaskWarningSet();
  247. condExpScriptEditor.save();
  248. actionScriptEditor.save();
  249. var name=$("#name").val();
  250. if(!name){
  251. $.ligerDialog.warn("请输入任务任务催办名称","提示信息");
  252. return;
  253. }
  254. var ctime=getTotalMinute($("#completeTr"));
  255. var stime=getTotalMinute($("#startTr"));
  256. //每次时间间隔*催办次数。
  257. var etime=getTotalMinute($("#endTr")) * ( parseInt($("#times").val())-1);
  258. if(ctime<stime+etime){
  259. $.ligerDialog.warn('办结时间不能比催办时间短',"提示信息");
  260. return;
  261. }
  262. $("#mailContent").val(editorMail.getContent());
  263. $("#msgContent").val(editorMsg.getContent());
  264. var rtn=$("#taskReminderForm").valid();
  265. if(!rtn) return;
  266. var url=__ctx+ "/platform/bpm/taskReminder/save.ht";
  267. var para=$('#taskReminderForm').serialize();
  268. $.post(url,para,showResult);
  269. }
  270. function showResult(responseText){
  271. var obj=new com.hotent.form.ResultMessage(responseText);
  272. if(!obj.isSuccess()){
  273. $.ligerDialog.err('出错信息',"任务催办提醒失败",obj.getMessage());
  274. return;
  275. }else{
  276. $.ligerDialog.confirm(obj.getMessage()+',是否继续操作?','提示信息',function(rtn){
  277. if(!rtn){
  278. dialog.close();
  279. }else{
  280. url=__ctx + "/platform/bpm/taskReminder/edit.ht?actDefId=${actDefId}&nodeId=${nodeId}&id=0";
  281. document.getElementById('goLocation').href = url;
  282. document.getElementById('goLocation').click();
  283. }
  284. });
  285. }
  286. }
  287. /**
  288. *
  289. */
  290. function scriptSelectScript(obj){
  291. ScriptDialog({callback:function(script){
  292. var pos=scriptScriptEditor.getCursor();
  293. scriptScriptEditor.replaceRange(script,pos);
  294. }});
  295. }
  296. /**
  297. *
  298. */
  299. function condExpSelectScript(obj){
  300. ScriptDialog({callback:function(script){
  301. var pos=condExpScriptEditor.getCursor();
  302. condExpScriptEditor.replaceRange(script,pos);
  303. }});
  304. }
  305. function getTotalMinute(e){
  306. var t=0;
  307. $(e).find(".dayInput").each(function(){
  308. t+= parseInt(3600* this.value);
  309. });
  310. $(e).find(".hourInput").each(function(){
  311. t+=parseInt(60* this.value);
  312. });
  313. $(e).find(".minuteInput").each(function(){
  314. t+=parseInt(this.value);
  315. });
  316. return t;
  317. }
  318. function constructFlowOperate(type){
  319. var select = $("select[name='flowOperate']");
  320. select.html("");
  321. type=type.toLowerCase();
  322. switch(type){
  323. case 'int':
  324. case 'number':
  325. case 'date':
  326. var eq=$("<option value='eq'>等于</option>");
  327. var ne=$("<option value='ne'>不等于</option>");
  328. var gt=$("<option value='gt'>大于</option>");
  329. var lt=$("<option value='lt'>小于</option>");
  330. select.append(eq);
  331. select.append(ne);
  332. select.append(gt);
  333. select.append(lt);
  334. break;
  335. case 'varchar':
  336. var eq=$("<option value='eq'>等于</option>");
  337. var ne=$("<option value='ne'>不等于</option>");
  338. select.append(eq);
  339. select.append(ne);
  340. break;
  341. }
  342. }
  343. function dateTimePicker(){
  344. WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',alwaysUseStartDate:true});
  345. $(this).blur();
  346. }
  347. /**
  348. * Select a different flow var
  349. * @params obj,target dom object
  350. */
  351. function selectFlowVar(obj,type){
  352. var obj=$(obj);
  353. obj.qtip("destroy");
  354. if(type==1){
  355. var fname=obj.val();
  356. if(!fname){
  357. return;
  358. }
  359. var ftype = obj.find("option:selected").attr("ftype");
  360. constructFlowOperate(ftype);
  361. var valueInput=$("<input name='flowValue'/>");
  362. var oldValueInput=$("input[name='flowValue']");
  363. if('date'==ftype.toLowerCase()){
  364. valueInput.addClass("date");
  365. valueInput.focus(dateTimePicker);
  366. }
  367. oldValueInput.replaceWith(valueInput);
  368. }else if(type==2){
  369. var fname = obj.val();
  370. var pos=actionScriptEditor.getCursor();
  371. actionScriptEditor.replaceRange(fname,pos);
  372. }
  373. var opt = obj.find("option:selected")
  374. var fname=opt.attr("fname");
  375. var fdesc=opt.attr("fdesc");
  376. var ftype=opt.attr("ftype");
  377. ftype=dbTypeToGroovyType(ftype);
  378. var content=""
  379. +"<table class='table-detail'>"
  380. +"<tr>"
  381. +"<th>名称</th>"
  382. +"<td>"+fname+"</td>"
  383. +"</tr>"
  384. +"<tr>"
  385. +"<th>注释</th>"
  386. +"<td>"+fdesc+"</td>"
  387. +"</tr>"
  388. +"<tr>"
  389. +"<th>类型</th>"
  390. +"<td>"+ftype+"</td>"
  391. +"</tr>"
  392. +"</table>";
  393. obj.qtip({
  394. content:content
  395. });
  396. }
  397. /**
  398. * Generate Express from Gui setting
  399. * @params obj,target dom object
  400. */
  401. function generateExpress(obj){
  402. var div = $(obj).closest("div.condExp-control");
  403. var flowVar=div.find("select[name='flowVar']").find("option:selected");
  404. var flowVarName=flowVar.val();
  405. var flowVarType=flowVar.attr("ftype");
  406. var flowVarOperate=div.find("select[name='flowOperate']").find("option:selected").val();
  407. var flowVarValue=div.find("input[name='flowValue']").val();
  408. if(!flowVarName){
  409. $.ligerDialog.warn("请选择流程变量!");
  410. return;
  411. }
  412. if(!flowVarOperate){
  413. $.ligerDialog.warn("请选择变量操作类型变量!");
  414. return;
  415. }
  416. if(!flowVarValue){
  417. $.ligerDialog.warn("请输入流程变量值!");
  418. return;
  419. }
  420. var exp=null;
  421. flowVarType=flowVarType.toLowerCase();
  422. switch(flowVarType){
  423. case 'int':
  424. case 'number':
  425. switch(flowVarOperate){
  426. case "eq":
  427. exp = flowVarName+" == "+flowVarValue;
  428. break;
  429. case "ne":
  430. exp = flowVarName+" != "+flowVarValue;
  431. break;
  432. case "gt":
  433. exp = flowVarName+" > "+flowVarValue;
  434. break;
  435. case "ge":
  436. exp = flowVarName+" >= "+flowVarValue;
  437. break;
  438. case "lt":
  439. exp = flowVarName+" < "+flowVarValue;
  440. break;
  441. case "le":
  442. exp = flowVarName+" <= "+flowVarValue;
  443. break;
  444. }
  445. break;
  446. case 'date':
  447. flowVarValue = "com.hotent.core.util.TimeUtil.convertString(\""+flowVarValue+'\","yyyy-MM-dd")';
  448. switch(flowVarOperate){
  449. case "eq":
  450. exp = flowVarValue+".compareTo((Date)"+flowVarName+") == 0";
  451. break;
  452. case "ne":
  453. exp = flowVarValue+".compareTo((Date)"+flowVarName+") !=0 ";
  454. break;
  455. case "gt":
  456. exp = flowVarValue+".compareTo((Date)"+flowVarName+") < 0";
  457. break;
  458. case "lt":
  459. exp = flowVarValue+".compareTo((Date)"+flowVarName+") > 0";
  460. break;
  461. }
  462. break;
  463. case 'varchar':
  464. switch(flowVarOperate){
  465. case "eq":
  466. exp = flowVarName+".equals(\""+flowVarValue+"\")";
  467. break;
  468. case "ne":
  469. exp =" !"+flowVarName+".equals(\""+flowVarValue+"\")";
  470. break;
  471. }
  472. break;
  473. }
  474. var pos=condExpScriptEditor.getCursor();
  475. condExpScriptEditor.replaceRange(exp,pos);
  476. }
  477. /**
  478. * 数据库类型到Groovy类型的转换
  479. * @params type relation data type
  480. * @return groovy type
  481. */
  482. function dbTypeToGroovyType(type){
  483. type=type.toLowerCase();
  484. var t;
  485. switch(type){
  486. case 'int':
  487. t='int';
  488. break;
  489. case 'number':
  490. t='double';
  491. break;
  492. case 'date':
  493. t='java.lang.Date';
  494. break;
  495. case 'varchar':
  496. case 'clob':
  497. t='java.lang.String';
  498. break;
  499. default:
  500. t=type;
  501. }
  502. return t;
  503. };
  504. //选择交办人
  505. function chooseAssigner(){
  506. UserDialog({
  507. isSingle:true,
  508. callback:function(userId,fullname){
  509. if(userId=='' || userId==null || userId==undefined) return;
  510. $("input[name='assignerId']").val(userId);
  511. $("input[name='assignerName']").val(fullname);
  512. }
  513. });
  514. };
  515. function handFlowVars(){
  516. $("select[name='selFlowVar']").change(function(){
  517. var val="{"+$(this).val()+"}";
  518. var thisEditor=$(this).closest('tr').find('textarea');
  519. var editorName=$(thisEditor).attr('name');
  520. if(val.length==0) return;
  521. if(editorName.indexOf('mail')!=-1){
  522. var html = editorMail.getContent();
  523. editorMail.setContent(html+"$"+val);
  524. }else{
  525. var html = editorMsg.getContent();
  526. editorMsg.setContent(html+"$"+val);
  527. }
  528. });
  529. }
  530. </script>
  531. </head>
  532. <body>
  533. <div class="panel">
  534. <div class="panel-top">
  535. <div class="tbar-title">
  536. <span class="tbar-label">编辑任务节点催办时间设置</span>
  537. </div>
  538. <div class="panel-toolbar">
  539. <div class="toolBar">
  540. <div class="group"><a class="link add" id="btnAdd"><span></span>增加</a></div>
  541. <div class="l-bar-separator"></div>
  542. <div class="group"><a class="link save" id="dataFormSave" href="javascript:;"><span></span>保存</a></div>
  543. <div class="l-bar-separator"></div>
  544. <div class="group"><a class="link del" onclick="javascript:dialog.close();"><span></span>关闭</a></div>
  545. </div>
  546. </div>
  547. </div>
  548. <div class="panel-body">
  549. <div class="reminder-layout" id="reminder-layout">
  550. <div class="reminder-edit" position="center">
  551. <div style="height:570px;overflow: auto;">
  552. <form id="taskReminderForm" method="post" action="save.ht">
  553. <div class="reminder-div" >
  554. <div class="reminder-div-tab" id="reminder-div-tab">
  555. <div class="reminder-div-base" title="催办基本信息设置">
  556. <div class="panel-detail">
  557. <fieldset class="fieldset-detail">
  558. <legend>
  559. <span>到期条件设置</span>
  560. </legend>
  561. <table class="table-detail" cellpadding="0" cellspacing="0" border="0">
  562. <tr>
  563. <th width="120px">名称:</th>
  564. <td >
  565. <input id="name" name="name" value="${taskReminder.name}" class="inputText" />
  566. </td>
  567. <!-- <th >默认:</th> -->
  568. <!-- <td > -->
  569. <%-- <input id="isDefaultTrue" name="isDefault" type="radio" value="1" <c:if test="${taskReminder.isDefault==1 }">checked="checked"</c:if> /> --%>
  570. <!-- <label for="isDefaultTrue">是</label> -->
  571. <%-- <input id="isDefaultFalse" name="isDefault" type="radio" value="0" <c:if test="${taskReminder.isDefault!=1 }">checked="checked"</c:if> /> --%>
  572. <!-- <label for="isDefaultFalse">否</label> -->
  573. <!-- </td> -->
  574. <th width="100px">当前节点:</th>
  575. <td><input type="text" value="${nodeId}" disabled="disabled"/></td>
  576. </tr>
  577. <tr>
  578. <th>相对节点:</th>
  579. <td>
  580. <select name="relativeNodeId">
  581. <c:forEach items="${nodes}" var="node">
  582. <option value="${node.nodeId}" <c:if test="${node.nodeId==taskReminder.relativeNodeId}">selected="selected"</c:if>>${node.nodeName}</option>
  583. </c:forEach>
  584. </select>
  585. </td>
  586. <th>相对动作:</th>
  587. <td>
  588. <select name="relativeNodeType">
  589. <option value="0" >创建</option>
  590. <option value="1" <c:if test="${taskReminder.relativeNodeType==1}">selected="selected"</c:if>>完成</option>
  591. </select>
  592. </td>
  593. </tr>
  594. <tr>
  595. <th >相对时间: </th>
  596. <td id="completeTr">
  597. <input class="day-input" type="text" name="completeTimeDay" value="${completeTimeDay}"/>
  598. <span>天</span>
  599. <select id="completeTimeHour" class="hourInput" name="completeTimeHour">
  600. <c:forEach var="i" begin="0" end="23" step="1">
  601. <option value="${i}" <c:if test="${completeTimeHour==i}">selected="selected"</c:if>>${i}小时</option>
  602. </c:forEach>
  603. </select>
  604. <select id="completeTimeMinute" class="minuteInput" name="completeTimeMinute">
  605. <c:forEach var="i" begin="0" end="4" step="1">
  606. <option value="${i}" <c:if test="${completeTimeMinute==i}">selected="selected"</c:if>>${i}分钟</option>
  607. </c:forEach>
  608. <c:forEach var="i" begin="5" end="59" step="5">
  609. <option value="${i}" <c:if test="${completeTimeMinute==i}">selected="selected"</c:if>>${i}分钟</option>
  610. </c:forEach>
  611. </select>
  612. </td>
  613. <th>相对时间类型:</th>
  614. <td>
  615. <select name="relativeTimeType">
  616. <option value="0">工作日</option>
  617. <option value="1" <c:if test="${taskReminder.relativeTimeType==1}">selected="selected"</c:if>>日历日</option>
  618. </select>
  619. </td>
  620. </tr>
  621. <tr>
  622. <th >
  623. <a href="javascript:;" class="link tipinfo"><span style="z-index: 100;text-align: left;">条件表达要求是返回Boolean值的脚本。返回true,表示满足条件;返回talse,表示条件不满足。如果表达式为空,将视为返回true。</span></a>
  624. 条件表达式:
  625. </th>
  626. <td colspan="3">
  627. <div class="condExp-control">
  628. <a href="javascript:;" class="link var" title="常用脚本" onclick="condExpSelectScript(this)">常用脚本</a>
  629. <%-- <f:flowVar defId="${defId}"></f:flowVar> --%>
  630. <span class="green">表单变量</span>
  631. <select name="flowVar" onchange="selectFlowVar(this,1)">
  632. <option value="">请选择...</option>
  633. <optgroup label="表单变量"></optgroup>
  634. <c:forEach items="${flowVars}" var="flowVar">
  635. <option class="flowvar-item" value="${flowVar.fieldName}" fname="${flowVar.fieldName}" fdesc="${flowVar.fieldDesc}" ftype="${flowVar.fieldType}">${flowVar.fieldDesc}</option>
  636. </c:forEach>
  637. <c:if test="${not empty defVars}">
  638. <optgroup label="自定义变量"></optgroup>
  639. <c:forEach items="${defVars}" var="defVars">
  640. <option class="flowvar-item" value="${defVars.varKey}" fname="${defVars.varKey}" fdesc="${defVars.varName}" ftype="${defVars.varDataType}">${defVars.varName}</option>
  641. </c:forEach>
  642. </c:if>
  643. </select>
  644. <span class="green">比较</span>
  645. <select name="flowOperate" >
  646. </select>
  647. <span class="green">值</span>
  648. <input name="flowValue"/>
  649. <a onclick="generateExpress(this)" href="javascript:;" class="button">
  650. <span>生成</span>
  651. </a>
  652. </div>
  653. <div class="condExp-editor">
  654. <textarea id="condExp" name="condExp" class="condExp-editor-input">${taskReminder.condExp}</textarea>
  655. </div>
  656. </td>
  657. </tr>
  658. </table>
  659. </fieldset>
  660. <fieldset class="fieldset-detail">
  661. <legend>
  662. <span>到期动作设置</span>
  663. </legend>
  664. <table class="table-detail" cellpadding="0" cellspacing="0" border="0">
  665. <tr>
  666. <th width="100">执行动作: </th>
  667. <td colspan="3">
  668. <select id="action" onchange="change()" name="action">
  669. <option value="0" <c:if test="${taskReminder.action==0}">selected="selected"</c:if>>无动作</option>
  670. <option value="1" <c:if test="${taskReminder.action==1}">selected="selected"</c:if>>执行同意操作</option>
  671. <option value="2" <c:if test="${taskReminder.action==2}">selected="selected"</c:if>>执行反对操作</option>
  672. <option value="3" <c:if test="${taskReminder.action==3}">selected="selected"</c:if>>执行驳回操作</option>
  673. <option value="4" <c:if test="${taskReminder.action==4}">selected="selected"</c:if>>执行驳回到发起人操作</option>
  674. <option value="5" <c:if test="${taskReminder.action==5}">selected="selected"</c:if>>执行交办操作</option>
  675. <option value="6" <c:if test="${taskReminder.action==6}">selected="selected"</c:if>>结束该流程</option>
  676. <option value="7" <c:if test="${taskReminder.action==7}">selected="selected"</c:if>>调用指定方法</option>
  677. </select>
  678. </td>
  679. </tr>
  680. <tr class="sub" width="100">
  681. <th >执行脚本: </th>
  682. <td colspan="3">
  683. <div class="condExp-control">
  684. <a href="javascript:;" class="link var" title="常用脚本" onclick="scriptSelectScript(this)">常用脚本</a>
  685. <span class="green">表单变量:</span>
  686. <%-- <f:flowVar defId="${defId}" controlName="selFlowVar"></f:flowVar> --%>
  687. <select name="flowVar" onchange="selectFlowVar(this,2)">
  688. <option value="">请选择...</option>
  689. <c:forEach items="${flowVars}" var="flowVar">
  690. <option class="flowvar-item" value="${flowVar.fieldName}" fname="${flowVar.fieldName}" fdesc="${flowVar.fieldDesc}" ftype="${flowVar.fieldType}">${flowVar.fieldDesc}</option>
  691. </c:forEach>
  692. </select>
  693. </div>
  694. <div class="script-editor">
  695. <textarea rows="6" cols="60" id="script" name="script" class="script-editor-input">${taskReminder.script}</textarea>
  696. </div>
  697. </td>
  698. </tr>
  699. <tr class="choose-assigner" width="100">
  700. <th>指定交办人员:</th>
  701. <td colspan="3">
  702. <input type="hidden" name="assignerId" value="${taskReminder.assignerId}"/>
  703. <input type="text" name="assignerName" readonly="readonly" value="${taskReminder.assignerName}"/>
  704. <a href="javascript:;" onclick="chooseAssigner()" class="button">
  705. <span>选择</span>
  706. </a>
  707. </td>
  708. </tr>
  709. </table>
  710. </fieldset>
  711. <fieldset class="fieldset-detail">
  712. <legend>
  713. <span>发送催办消息设置</span>
  714. </legend>
  715. <table class="table-detail" cellpadding="0" cellspacing="0" border="0">
  716. <tr>
  717. <th width="100">
  718. 发送催办信息:
  719. </th>
  720. <td colspan="3">
  721. <label><input type="checkbox" id="needSendMsg"/>发送</label>
  722. </td>
  723. </tr>
  724. <tr class="send-msg-tr">
  725. <th>开始发送时间:</th>
  726. <td id="startTr" colspan="3">
  727. <input class="day-input" type="text" name="reminderStartDay" value="${reminderStartDay}"/>
  728. <span>天</span>
  729. <select id="reminderStartHour" class="hourInput" name="reminderStartHour">
  730. <c:forEach var="i" begin="0" end="23" step="1">
  731. <option value="${i}" <c:if test="${reminderStartHour==i}">selected="selected"</c:if>>${i}小时</option>
  732. </c:forEach>
  733. </select>
  734. <select id="reminderStartMinute" class="minuteInput" name="reminderStartMinute">
  735. <c:forEach var="i" begin="0" end="4" step="1">
  736. <option value="${i}" <c:if test="${reminderStartMinute==i}">selected="selected"</c:if>>${i}分钟</option>
  737. </c:forEach>
  738. <c:forEach var="i" begin="5" end="59" step="5">
  739. <option value="${i}" <c:if test="${reminderStartMinute==i}">selected="selected"</c:if>>${i}分钟</option>
  740. </c:forEach>
  741. </select>
  742. </td>
  743. </tr>
  744. <tr class="send-msg-tr">
  745. <th><a href="javascript:;" class="tipinfo"><span>每过多长的时间发送催办信息。 </span></a>发送的间隔:</th>
  746. <td id="endTr">
  747. <input class="day-input" type="text" name="reminderEndDay" value="${reminderEndDay}"/>
  748. <span>天</span>
  749. <select id="reminderEndHour" class="hourInput" name="reminderEndHour">
  750. <c:forEach var="i" begin="0" end="23" step="1">
  751. <option value="${i}" <c:if test="${reminderEndHour==i}">selected="selected"</c:if>>${i}小时</option>
  752. </c:forEach>
  753. </select>
  754. <select id="reminderEndMinute" class="minuteInput" name="reminderEndMinute">
  755. <c:forEach var="i" begin="1" end="4" step="1">
  756. <option value="${i}" <c:if test="${reminderEndMinute==i}">selected="selected"</c:if>>${i}分钟</option>
  757. </c:forEach>
  758. <c:forEach var="i" begin="5" end="59" step="5">
  759. <option value="${i}" <c:if test="${reminderEndMinute==i}">selected="selected"</c:if>>${i}分钟</option>
  760. </c:forEach>
  761. </select>
  762. </td>
  763. <th>发送信息次数: </th>
  764. <td>
  765. <select name="times" >
  766. <c:forEach var="i" begin="0" end="10" step="1">
  767. <option value="${i}" <c:if test="${taskReminder.times==i}">selected="selected"</c:if>>${i}</option>
  768. </c:forEach>
  769. </select>
  770. </td>
  771. </tr>
  772. </table>
  773. </fieldset>
  774. <fieldset class="fieldset-detail">
  775. <legend>
  776. <span>任务紧急程度预警设置</span>
  777. </legend>
  778. <table class="table-grid" id="taskWarningSetList" cellpadding="0" cellspacing="0" border="0">
  779. <thead>
  780. <tr>
  781. <td colspan="5">
  782. <a class="link add" id="addWarning">增加预警项</a> <span style="color: gray;">到期动作为“无动作”时方才有效</span>
  783. </td>
  784. </tr>
  785. <tr align="center">
  786. <th>名称</th>
  787. <th>相对到期类型</th>
  788. <th>相对时间</th>
  789. <th>紧急程度</th>
  790. <th>管理</th>
  791. </tr>
  792. </thead>
  793. <c:forEach items="${taskReminder.taskWarningSetList}" var="warningSet">
  794. <tr>
  795. <td>
  796. <input class="input" type="text" name="warnName" value="${warningSet.name}"/>
  797. </td>
  798. <td>
  799. <select name="relativeType" >
  800. <option value="before" <c:if test="${warningSet.relativeType eq 'before'}">selected="selected"</c:if>>之前</option>
  801. <option value="after" <c:if test="${warningSet.relativeType eq 'after'}">selected="selected"</c:if>>之后</option>
  802. </select>
  803. </td>
  804. <td id="relativeTime">
  805. <input class="day-input" type="text" name="reminderDueDay" value="${warningSet.reminderDueDay}"/>
  806. <span>天</span>
  807. <select class="hourInput" name="reminderDueHour">
  808. <c:forEach var="i" begin="0" end="23" step="1">
  809. <option value="${i}" <c:if test="${warningSet.reminderDueDay==i}">selected="selected"</c:if>>${i}小时</option>
  810. </c:forEach>
  811. </select>
  812. <select id="reminderDueMinute" class="minuteInput" name="reminderDueMinute">
  813. <c:forEach var="i" begin="1" end="4" step="1">
  814. <option value="${i}" <c:if test="${warningSet.reminderDueMinute==i}">selected="selected"</c:if>>${i}分钟</option>
  815. </c:forEach>
  816. <c:forEach var="i" begin="5" end="59" step="5">
  817. <option value="${i}" <c:if test="${warningSet.reminderDueMinute==i}">selected="selected"</c:if>>${i}分钟</option>
  818. </c:forEach>
  819. </select>
  820. </td>
  821. <td>
  822. <select name="level">
  823. <c:forEach items="${warningSettingList}" var="warningSetting">
  824. <option value="${warningSetting.level}" <c:if test="${warningSet.level eq warningSetting.level}">selected="selected"</c:if>>${warningSetting.name}</option>
  825. </c:forEach>
  826. </select>
  827. </td>
  828. <td><a class="link del" onclick="delWaringLine(this)">删除</a></td>
  829. </tr>
  830. </c:forEach>
  831. </table>
  832. </fieldset>
  833. </div>
  834. </div>
  835. <div class="reminder-div-msg-mail" title="邮件内容">
  836. <div class="panel-detail">
  837. <table class="table-detail" cellpadding="0" cellspacing="0" border="0">
  838. <tr>
  839. <th width="60" >邮件内容: </th>
  840. <td>
  841. <div>
  842. <a href="javascript:;" class="link var" title="选择模板内容" onclick="slectTemplate('mailContent',false)">选择模板内容</a>
  843. <f:flowVar defId="${defId}" controlName="selFlowVar"></f:flowVar>
  844. </div>
  845. <textarea id="mailContent" name="mailContent" rows="20" cols="50">${taskReminder.mailContent}</textarea>
  846. </td>
  847. </tr>
  848. </table>
  849. </div>
  850. </div>
  851. <div class="reminder-div-msg-inter" title="站内消息内容">
  852. <div class="panel-detail">
  853. <table class="table-detail" cellpadding="0" cellspacing="0" border="0">
  854. <tr>
  855. <th width="60" >站内消息内容: </th>
  856. <td>
  857. <div>
  858. <a href="javascript:;" class="link var" title="选择模板内容" onclick="slectTemplate('msgContent',false)">选择模板内容</a>
  859. <f:flowVar defId="${defId}" controlName="selFlowVar"></f:flowVar>
  860. </div>
  861. <textarea id="msgContent" name="msgContent" rows="12" cols="50">${taskReminder.msgContent}</textarea>
  862. </td>
  863. </tr>
  864. </table>
  865. </div>
  866. </div>
  867. <div class="reminder-div-msg-sms" title="手机短信内容">
  868. <div class="panel-detail">
  869. <table class="table-detail" cellpadding="0" cellspacing="0" border="0">
  870. <tr >
  871. <th width="60" >手机短信内容: </th>
  872. <td>
  873. <div>
  874. <a href="javascript:;" class="link var" title="选择模板内容" onclick="slectTemplate('smsContent',true)">选择模板内容</a>
  875. </div>
  876. <textarea id="smsContent" name="smsContent" rows="12" cols="50">${taskReminder.smsContent}</textarea>
  877. </td>
  878. </tr>
  879. </table>
  880. </div>
  881. </div>
  882. </div>
  883. </div>
  884. <div>
  885. <input type="hidden" name="taskDueId" value="${taskReminder.taskDueId}" />
  886. <input type="hidden" name="actDefId" value="${actDefId}" />
  887. <input type="hidden" name="nodeId" value="${nodeId}" />
  888. <input type="hidden" id="defId" name="defId" value="${defId}" />
  889. <input type="hidden" name="warningSetJson" id="warningSetJson">
  890. <!-- 预警级别模板设置 -->
  891. <textarea id="warningTemplate" style="display:none;">
  892. <tr>
  893. <td>
  894. <input class="input" type="text" name="warnName" value=""/>
  895. </td>
  896. <td>
  897. <select name="relativeType" >
  898. <option value="before">之前</option>
  899. <option value="after">之后</option>
  900. </select>
  901. </td>
  902. <td id="relativeTime">
  903. <input class="day-input" type="text" name="reminderDueDay" value=""/>
  904. <span>天</span>
  905. <select id="reminderDueHour" class="hourInput" name="reminderDueHour">
  906. <c:forEach var="i" begin="0" end="23" step="1">
  907. <option value="${i}">${i}小时</option>
  908. </c:forEach>
  909. </select>
  910. <select id="reminderDueMinute" class="minuteInput" name="reminderDueMinute">
  911. <c:forEach var="i" begin="1" end="4" step="1">
  912. <option value="${i}">${i}分钟</option>
  913. </c:forEach>
  914. <c:forEach var="i" begin="5" end="59" step="5">
  915. <option value="${i}">${i}分钟</option>
  916. </c:forEach>
  917. </select>
  918. </td>
  919. <td>
  920. <select name="level">
  921. <c:forEach items="${warningSettingList }" var="warningSetting">
  922. <option value="${warningSetting.level}">${warningSetting.name}</option>
  923. </c:forEach>
  924. </select>
  925. </td>
  926. <td><a class="link del" onclick="delWaringLine(this)">删除</a></td>
  927. </tr>
  928. </textarea>
  929. </div>
  930. </form>
  931. </div>
  932. </div>
  933. <div class="reminders-list" position="right">
  934. <div class="reminders-div">
  935. <table class="table-grid" id="reminders-list-table">
  936. <thead>
  937. <tr>
  938. <th>名称</th>
  939. <th>管理</th>
  940. </tr>
  941. </thead>
  942. <tbody>
  943. <c:forEach items="${taskReminders }" var="reminder" varStatus="status">
  944. <tr <c:if test="${status.index%2==0 }">class="odd"</c:if><c:if test="${status.index%2==1 }">class="even"</c:if>>
  945. <td>
  946. <span>${reminder.name }</span>
  947. <input class="pk" type="hidden" value="${reminder.taskDueId}"/>
  948. </td>
  949. <td>
  950. <a class="link del" href="del.ht?taskDueId=${reminder.taskDueId}">删除</a>
  951. </td>
  952. </tr>
  953. </c:forEach>
  954. </tbody>
  955. </table>
  956. </div>
  957. </div>
  958. </div>
  959. </div>
  960. <a href="" id="goLocation" style="display:none;"></a>
  961. </div>
  962. </body>
  963. </html>