You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

207 lines
6.3 KiB

<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="org.wdk.WDKConstant"%>
<%@ page import="org.wdk.WDKCore"%>
<%@ page import="org.wdk.WDK"%>
<%@ page import="com.noblelift.imp.platform.module.portal.source.SessionUser"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String WDK_ROOT = WDKCore.WDK_ROOT;
SessionUser su = (SessionUser) WDK.getSessionUser(request, response);
WDK.writeSessionUser(out, su);
%>
<html>
<head>
<base href="<%=basePath%>" target="_self">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
</style>
<script type="text/javascript" src="<%=WDK_ROOT%>/theme/je/core/js/wdk.js"></script>
<title>流程复制</title>
<script type="text/javascript">
var param = $.getURLParam('param');
var jparam = $.str2json($.urlparam_decode(param));
var src_id =jparam.queryParams.id;
var src_enname = jparam.queryParams.enname;
var src_cnname = jparam.queryParams.cnname;
var users = {
total : 1,
rows : [ {
enname : src_enname,
cnname : src_cnname
}
]};
window.onload = function() {
$('#ss').numberspinner({
min: 1,
max: 30,
value:1,
editable: true
});
$('#layout_grid').datagrid({
title : '待复制的流程基本信息',
iconCls : 'icon-edit',
fitColumns:true,
rownumbers:true,
singleSelect : true,
columns : [ [
{field:'enname',title:'流程名称',width:100,editor: { type: 'validatebox', options: {required:true} }},
{field:'cnname',title:'流程中文名称',width:100,align:'left',editor: { type: 'validatebox', options: {required:true} }} ] ],
onBeforeEdit : function(index, row) {
row.editing = true;
$('#layout_grid').datagrid('refreshRow', index);
editcount++;
},
onAfterEdit : function(index, row) {
row.editing = false;
$('#layout_grid').datagrid('refreshRow', index);
editcount--;
},
onCancelEdit : function(index, row) {
row.editing = false;
$('#layout_grid').datagrid('refreshRow', index);
editcount--;
},
onDblClickRow:function(rowIndex,rowData){
editrow(rowIndex);
},
onLoadSuccess:function(data){
$('#layout_grid').datagrid('beginEdit', 0);
}
}).datagrid('loadData', users)
.datagrid('acceptChanges');
};
var editcount = 0;
function editrow(index) {
$('#layout_grid').datagrid('beginEdit', index);
}
function deleterow(index) {
$.messager.confirm('确认', '是否真的删除?', function(r) {
if (r) {
$('#layout_grid').datagrid('deleteRow', index);
}
});
}
function saverow(index) {
$('#layout_grid').datagrid('endEdit', index);
}
function cancelrow(index) {
$('#layout_grid').datagrid('cancelEdit', index);
}
function addrow() {
/*if (editcount > 0) {
$.messager.alert('警告', '当前还有' + editcount + '记录正在编辑,不能增加记录。');
return;
}*/
$('#layout_grid').datagrid('appendRow', {
pdid : $.getUUID(),
enname : src_enname,
cnname : src_cnname
});
}
function saveall() {
//$('#layout_grid').datagrid('acceptChanges');
var _rowdata = $('#layout_grid').datagrid('getRows');
for(var i=0;i<_rowdata.length;i++){
var isSuccess = $('#layout_grid').datagrid('validateRow',i);
if(isSuccess==false){
alert('必填未输入');
return;
}
}
$.wait_open();
$('#layout_grid').datagrid('acceptChanges');
var _data ={
_SRVNAME : 'service.wdk.wfrepository',
_SRVMETHOD: 'copyFlowDesign',
_DATA: $.json2str({
copyInfos:$.json2str(_rowdata),
designerId:src_id
}),
};
$.cuajax({
url:'wdk?action=wdk.pub&method=call_service&ajaxparam='+new Date().getTime(),
method:"post",
timeout:WDK_Timeout,
data:_data,
success:function(result) {
$.wait_close();
//重新刷新数据
alert(result);
$.closeWin();
},
error:function(result){
$.wait_close();
alert('网络错误!result='+result);
}
});
}
function cancelall() {
$('#layout_grid').datagrid('rejectChanges');
}
function closewin(){
$.closeWin();
}
function reflesh(){
var rows = $('#ss').numberspinner('getValue');
var _rowdata = $('#layout_grid').datagrid('getRows');
var _rows = _rowdata.length;
if(rows>_rows){
for(var i=0;i<(rows-_rows);i++){
addrow();
}
}else if(rows<_rows){
for(var i=0;i<(_rows-rows);i++){
$('#layout_grid').datagrid('deleteRow', _rowdata.length-1);
}
}
for(var j=0;j<_rowdata.length;j++){
$('#layout_grid').datagrid('beginEdit', j);
}
}
</script>
</head>
<body class="easyui-layout" style="padding:0px;margin:0px;background-color:#FFFFFF;">
<!-- 按钮 -->
<div data-options="region:'north',border:false,collapsed:false" style="height:30px;overflow:hidden;border-bottom:1px solid #d4a375;text-align:left;" >
<a id="_btnaddledger" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-add'" href="javascript:void(0)" onclick="saveall()">确定</a>
<a id="_btnaddledger" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-add'" href="javascript:void(0)" onclick="closewin()">关闭</a>
</div>
<!-- 表格 -->
<div data-options="region:'center',border:false,collapsed:false" style="overflow:hidden;border:0px solid #d4a375;" >
<table class="condi_tb" cellpadding="0" cellspacing="0" style="height:40px;">
<tr>
<td style="width:100px;padding-left:10px;">复制数量:</td>
<td style="width:300px;">
<input type="text" id="ss" name="ss" class="txt" style="width:280px;" ></input>
</td>
<td colspan="2">
<a id="_btnaddledger" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-add'" href="javascript:void(0)" onclick="reflesh()">刷新</a>
</td>
</tr>
</table>
<div id="layout_grid" class="easyui-panel" data-options="collapsible:false,border:false">
<table id="dg"></table>
</div>
</div>
</body>
</html>