| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=GBK">
- <title>编辑流程环节</title>
- <link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
- <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
- <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
- <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
- <script type="text/javascript" src="/shares/js/constant.js"></script>
- <script type="text/javascript" src="/shares/js/common.js"></script>
- <script type="text/javascript">
- var grid = null;
- var win1 = null;
- var tache_json=null;
- $(function () {
- var jsonobj="${tache_list}";
- tache_json=eval("("+jsonobj+")");
- grid = $("#maingrid4").ligerGrid({
- columns:
- [
- { display: '环节配置ID', name: 'universalid', type: 'text',isSort: false, hide: true,width:10},
- { display: '特定操作名称', name: 'tache_op_name', type: 'text',isSort: false,width:350},
- { display: '环节模板', name: 'tmodelid', type: 'select',isSort: false,width:300,
- editor: { type: 'select',isShowCheckBox: true, isMultiSelect: true, data: tache_json, valueField: 'tmodelId', textField: 'tmodelName' },
- render : function(item, rowindex, value) {
- for (var i = 0; i < tache_json.length; i++)
- {
- if (tache_json[i]['tmodelId'] == item.tmodelid)
- return tache_json[i]['tmodelName'];
- }
- return "";
- }
- },
- { display: '特定操作URL', name: 'op_url', type: 'text',isSort: false,width:450}
- ],
- url:'codeFlowConfAction.do?task=page_tache&conf_id=${codeflow.universalid}&time='+new Date().getTime(),
- usePager: false,
- enabledEdit: true,
- rownumbers:true,
- selectRowButtonOnly:true,
- width :'99.8%',
- height : '99%'
- });
- $("#pageloading").hide();
- });
-
-
- function submitTache(){
- var tache=grid.getData();
- var html="";
- var flag=false;
- var is_same=true;//原先的tmodelid有效
- var is_repeat = false;//数组是否重复
- var tache_ids = "";//环节模版ids
- $.each(tache,function(i,obj){
- flag=true;
- var tmodelid=obj.tmodelid;
- if(typeof(tmodelid)=="undefined" || tmodelid==null || tmodelid==""){
- if(tmodelid !="0")
- html="环节模板不能为空";
- return ;
- }else{
- //判断现有流程环节模板id是否有效
- var _i=-1;
- for (var i = 0; i < tache_json.length; i++)
- {
- if (tache_json[i]['tmodelId'] == tmodelid){
- _i=1;
- }
- }
- if(_i==-1){
- is_same=false;
- }
- }
- if(""!=tache_ids){
- tache_ids = tache_ids+","+obj.tmodelid;
- }else{
- tache_ids = tache_ids+obj.tmodelid;
- }
- });
- if(html !=""){
- $.ligerDialog.warn(html);
- return ;
- }
- if(!flag){
- $.ligerDialog.warn("环节模板不能为空!");
- return ;
- }
- if(!is_same){
- $.ligerDialog.warn("环节模板不能为空!");
- return ;
- }
- var tacheids = [];
- if(tache_ids.indexOf(",")>0){
- tacheids = tache_ids.split(",");
- }else{
- var arr = [tache_ids];
- tacheids=arr;
- }
- is_repeat = isRepeat(tacheids);
- if(is_repeat){
- $.ligerDialog.warn("环节模板不能重复选择!");
- return ;
- }
- // $.ligerDialog.warn(html);
- $("#tache_json").val(JSON.stringify(tache));
- $("#_form").submit();
- }
- /**
- *验证数组数据是否重复
- */
- function isRepeat(arr){
- var hash = {};
- for(var i in arr){
- if(hash[arr[i]])
- return true;
- hash[arr[i]]=true;
- }
- return false;
- }
- </script>
- </head>
- <body>
- <div class="container-layout">
- <div id="title" class="form-button" >
- <form id="_form" method="post" action="codeFlowConfAction.do?task=tache_edit">
- <input type="button" class="l-button" value="保存" onclick="submitTache()" style="width: 90px"/>
- <input type="hidden" name="tache_json" id="tache_json" />
- <input type="hidden" name="conf_id" value="${codeflow.universalid}" />
- <input type="hidden" id="tabid" name="tabid" value="${param.tabid }">
- </form>
- </div>
- <div class="default_search" >
- <ul class="list_search" style="width:300px;">
- <li class="title" style="float: left;width:300px; " ><span>流程标志:${codeflow.mark }</span></li>
- </ul>
- <ul class="list_search" style="width:350px;">
- <li class="title" style="float: left;width:350px; "><span>流程名称:${codeflow.conf_name }</span></li>
- </ul>
- <ul class="list_search" style="width:300px;">
- <li class="title" style="float: left;width:300px; ">
- <span>流程模板:
- <c:forEach items="${flowModel }" var="flow">
- <c:if test="${flow.modelId==codeflow.flow_template_id }">
- ${flow.modelName }
- </c:if>
- </c:forEach>
- </span>
- </li>
- </ul>
- </div>
- <div style="clear: both;">
- <div id="maingrid4" style="margin:0; padding:0"></div>
- </div>
- <div style="display:none;">
- <!-- g data total ttt -->
- </div>
- </div>
- <%@ include file="/include/message.jsp"%>
- </body>
- </html>
|