tache_edit.jsp 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
  2. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html;charset=GBK">
  7. <title>编辑流程环节</title>
  8. <link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
  9. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  10. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  11. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
  12. <script type="text/javascript" src="/shares/js/constant.js"></script>
  13. <script type="text/javascript" src="/shares/js/common.js"></script>
  14. <script type="text/javascript">
  15. var grid = null;
  16. var win1 = null;
  17. var tache_json=null;
  18. $(function () {
  19. var jsonobj="${tache_list}";
  20. tache_json=eval("("+jsonobj+")");
  21. grid = $("#maingrid4").ligerGrid({
  22. columns:
  23. [
  24. { display: '环节配置ID', name: 'universalid', type: 'text',isSort: false, hide: true,width:10},
  25. { display: '特定操作名称', name: 'tache_op_name', type: 'text',isSort: false,width:350},
  26. { display: '环节模板', name: 'tmodelid', type: 'select',isSort: false,width:300,
  27. editor: { type: 'select',isShowCheckBox: true, isMultiSelect: true, data: tache_json, valueField: 'tmodelId', textField: 'tmodelName' },
  28. render : function(item, rowindex, value) {
  29. for (var i = 0; i < tache_json.length; i++)
  30. {
  31. if (tache_json[i]['tmodelId'] == item.tmodelid)
  32. return tache_json[i]['tmodelName'];
  33. }
  34. return "";
  35. }
  36. },
  37. { display: '特定操作URL', name: 'op_url', type: 'text',isSort: false,width:450}
  38. ],
  39. url:'codeFlowConfAction.do?task=page_tache&conf_id=${codeflow.universalid}&time='+new Date().getTime(),
  40. usePager: false,
  41. enabledEdit: true,
  42. rownumbers:true,
  43. selectRowButtonOnly:true,
  44. width :'99.8%',
  45. height : '99%'
  46. });
  47. $("#pageloading").hide();
  48. });
  49. function submitTache(){
  50. var tache=grid.getData();
  51. var html="";
  52. var flag=false;
  53. var is_same=true;//原先的tmodelid有效
  54. var is_repeat = false;//数组是否重复
  55. var tache_ids = "";//环节模版ids
  56. $.each(tache,function(i,obj){
  57. flag=true;
  58. var tmodelid=obj.tmodelid;
  59. if(typeof(tmodelid)=="undefined" || tmodelid==null || tmodelid==""){
  60. if(tmodelid !="0")
  61. html="环节模板不能为空";
  62. return ;
  63. }else{
  64. //判断现有流程环节模板id是否有效
  65. var _i=-1;
  66. for (var i = 0; i < tache_json.length; i++)
  67. {
  68. if (tache_json[i]['tmodelId'] == tmodelid){
  69. _i=1;
  70. }
  71. }
  72. if(_i==-1){
  73. is_same=false;
  74. }
  75. }
  76. if(""!=tache_ids){
  77. tache_ids = tache_ids+","+obj.tmodelid;
  78. }else{
  79. tache_ids = tache_ids+obj.tmodelid;
  80. }
  81. });
  82. if(html !=""){
  83. $.ligerDialog.warn(html);
  84. return ;
  85. }
  86. if(!flag){
  87. $.ligerDialog.warn("环节模板不能为空!");
  88. return ;
  89. }
  90. if(!is_same){
  91. $.ligerDialog.warn("环节模板不能为空!");
  92. return ;
  93. }
  94. var tacheids = [];
  95. if(tache_ids.indexOf(",")>0){
  96. tacheids = tache_ids.split(",");
  97. }else{
  98. var arr = [tache_ids];
  99. tacheids=arr;
  100. }
  101. is_repeat = isRepeat(tacheids);
  102. if(is_repeat){
  103. $.ligerDialog.warn("环节模板不能重复选择!");
  104. return ;
  105. }
  106. // $.ligerDialog.warn(html);
  107. $("#tache_json").val(JSON.stringify(tache));
  108. $("#_form").submit();
  109. }
  110. /**
  111. *验证数组数据是否重复
  112. */
  113. function isRepeat(arr){
  114. var hash = {};
  115. for(var i in arr){
  116. if(hash[arr[i]])
  117. return true;
  118. hash[arr[i]]=true;
  119. }
  120. return false;
  121. }
  122. </script>
  123. </head>
  124. <body>
  125. <div class="container-layout">
  126. <div id="title" class="form-button" >
  127. <form id="_form" method="post" action="codeFlowConfAction.do?task=tache_edit">
  128. <input type="button" class="l-button" value="保存" onclick="submitTache()" style="width: 90px"/>
  129. <input type="hidden" name="tache_json" id="tache_json" />
  130. <input type="hidden" name="conf_id" value="${codeflow.universalid}" />
  131. <input type="hidden" id="tabid" name="tabid" value="${param.tabid }">
  132. </form>
  133. </div>
  134. <div class="default_search" >
  135. <ul class="list_search" style="width:300px;">
  136. <li class="title" style="float: left;width:300px; " ><span>流程标志:${codeflow.mark }</span></li>
  137. </ul>
  138. <ul class="list_search" style="width:350px;">
  139. <li class="title" style="float: left;width:350px; "><span>流程名称:${codeflow.conf_name }</span></li>
  140. </ul>
  141. <ul class="list_search" style="width:300px;">
  142. <li class="title" style="float: left;width:300px; ">
  143. <span>流程模板:
  144. <c:forEach items="${flowModel }" var="flow">
  145. <c:if test="${flow.modelId==codeflow.flow_template_id }">
  146. ${flow.modelName }
  147. </c:if>
  148. </c:forEach>
  149. </span>
  150. </li>
  151. </ul>
  152. </div>
  153. <div style="clear: both;">
  154. <div id="maingrid4" style="margin:0; padding:0"></div>
  155. </div>
  156. <div style="display:none;">
  157. <!-- g data total ttt -->
  158. </div>
  159. </div>
  160. <%@ include file="/include/message.jsp"%>
  161. </body>
  162. </html>