197 lines
8.9 KiB
Plaintext
197 lines
8.9 KiB
Plaintext
<#assign base=request.contextPath />
|
|
<#import "../common/defaultLayout.ftl" as defaultLayout>
|
|
<@defaultLayout.layout>
|
|
<link rel="stylesheet" href="${base}/assets/css/amazeui.switch.css"/>
|
|
<div class="admin-content">
|
|
<div class="am-cf am-padding" style="padding:1rem 1.6rem 1.6rem 1rem;margin:0px;">
|
|
<!-- padding:1px 2px 3px 4px;上、右、下,和左 -->
|
|
<div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">${procDefName!}</strong> /
|
|
<small>任务配置</small>
|
|
</div>
|
|
</div>
|
|
<input name="procDefId" id="procDefId" type="hidden" value="${procDefId!}"/>
|
|
<div class="am-g">
|
|
<div class="am-u-sm-12 <#--am-scrollable-horizontal-->">
|
|
<!-- padding:1px 2px 3px 4px;上、右、下,和左 -->
|
|
<table class="am-table am-table-striped am-table-hover table-main">
|
|
<thead>
|
|
<tr class="am-text-nowrap">
|
|
<th class="table-title">序号</th>
|
|
<th class="table-title">任务名称</th>
|
|
<#--<th class="table-title">任务类型</th>-->
|
|
<th class="table-date">回退任务</th>
|
|
<th class="table-set ">按人员设置审批人</th>
|
|
<th class="table-set ">按角色设置审批人</th>
|
|
<th class="table-set ">审批通过脚本</th>
|
|
<th class="table-set ">审批驳回脚本</th>
|
|
<th class="table-set am-text-center">操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<#list taskList as list>
|
|
<tr>
|
|
<td>${list_index+1}</td>
|
|
<td>${list.taskName!}</td>
|
|
<#--<td>
|
|
<#if list.taskIndex != 1>
|
|
<#if list.taskType == 0>
|
|
或签
|
|
<#else>
|
|
会签
|
|
</#if>
|
|
</#if>
|
|
</td>-->
|
|
|
|
<td>
|
|
<#if list.taskIndex != 1>
|
|
<select data-am-selected="{btnSize: 'sm',btnWidth: '150px', maxHeight: 500}"
|
|
id="rollbackTask_${list.id}">
|
|
<#list taskList as l>
|
|
<option value="${l.taskKey}"
|
|
<#if list.rollbackTaskKey == l.taskKey>selected</#if> >${l.taskName!}</option>
|
|
</#list>
|
|
</select>
|
|
</#if>
|
|
</td>
|
|
|
|
<td>
|
|
<#if list.taskIndex != 1>
|
|
<select multiple data-am-selected="{btnSize: 'sm',btnWidth: '150px',maxHeight: 500,searchBox: 1}"
|
|
id="userSelect_${list.id}">
|
|
<#list adminList as l>
|
|
<option value="${l.id}"
|
|
<#if list.candidateUserList?seq_contains(l.id?c)>selected</#if> >${l.realName!}</option>
|
|
</#list>
|
|
</select>
|
|
</#if>
|
|
</td>
|
|
|
|
|
|
<td>
|
|
<#if list.taskIndex != 1>
|
|
<select multiple data-am-selected="{btnSize: 'sm',btnWidth: '150px',maxHeight: 500,searchBox: 1}"
|
|
id="roleSelect_${list.id}">
|
|
<#list roleList as l>
|
|
<option value="${l.id}"
|
|
<#if list.candidateRoleList?seq_contains(l.id?c)>selected</#if> >${l.name!}</option>
|
|
</#list>
|
|
</select>
|
|
</#if>
|
|
</td>
|
|
|
|
<td>
|
|
<#if list.taskIndex != 1>
|
|
<select data-am-selected="{btnSize: 'sm', btnWidth: '150px', maxHeight: 500, searchBox: 1}"
|
|
id="scriptSelect_${list.id}">
|
|
<option value="0"></option>
|
|
<#list scriptList as l>
|
|
<option value="${l.id}"
|
|
<#if list.endScript! == l.id>selected</#if> >${l.scriptName!}</option>
|
|
</#list>
|
|
</select>
|
|
</#if>
|
|
</td>
|
|
|
|
<td>
|
|
<#if list.taskIndex != 1>
|
|
<select data-am-selected="{btnSize: 'sm',btnWidth: '150px',maxHeight: 500, searchBox: 1}"
|
|
id="rollbackScriptSelect_${list.id}">
|
|
<option value="0"></option>
|
|
<#list scriptList as l>
|
|
<option value="${l.id}"
|
|
<#if list.rollbackScript! == l.id>selected</#if> >${l.scriptName!}</option>
|
|
</#list>
|
|
</select>
|
|
</#if>
|
|
</td>
|
|
|
|
<td>
|
|
<#if list.taskIndex != 1>
|
|
<div class="am-btn-toolbar">
|
|
<div class="am-btn-group am-btn-group-xs">
|
|
<button type="button"
|
|
class="am-btn am-btn-default am-btn-xs am-text-secondary"
|
|
onclick="saveConfig('${list.id}')">
|
|
<span class="am-icon-pencil-square-o"></span>
|
|
保存
|
|
</button>
|
|
|
|
</div>
|
|
</div>
|
|
</#if>
|
|
</td>
|
|
|
|
</tr>
|
|
</#list>
|
|
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="am-margin">
|
|
<#--<button type="submit" class="am-btn am-btn-primary am-btn-xs">提交保存</button>-->
|
|
<button type="button" class="am-btn am-btn-warning am-btn-xs"
|
|
onclick="location.href='${base}/actProcDef/list'">返回
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</@defaultLayout.layout>
|
|
|
|
<script src="${base}/assets/js/amazeui.switch.js"></script>
|
|
<script type="text/javascript">
|
|
var urlBase = "${base}";
|
|
var url;
|
|
|
|
|
|
var saveConfig = function (taskId) {
|
|
var rollbackTaskKey = $("#rollbackTask_" + taskId + " option:selected").val();
|
|
var endScript = $("#scriptSelect_" + taskId + " option:selected").val();
|
|
var rollbackScript = $("#rollbackScriptSelect_" + taskId + " option:selected").val();
|
|
|
|
var $userSelected = $("#userSelect_" + taskId + " option:selected");
|
|
var userIds = '';
|
|
$userSelected.each(function () {
|
|
if (userIds == '') {
|
|
userIds = $(this).val();
|
|
} else {
|
|
userIds = userIds + "#" + $(this).val();
|
|
}
|
|
});
|
|
|
|
var $roleSelected = $("#roleSelect_" + taskId + " option:selected");
|
|
var roleIds = '';
|
|
$roleSelected.each(function () {
|
|
if (roleIds == '') {
|
|
roleIds = $(this).val();
|
|
} else {
|
|
roleIds = roleIds + "#" + $(this).val();
|
|
}
|
|
});
|
|
|
|
var params = {
|
|
id: taskId,
|
|
procDefId: $("#procDefId").val(),
|
|
rollbackTaskKey: rollbackTaskKey,
|
|
endScript: endScript,
|
|
rollbackScript: rollbackScript,
|
|
candidateUsers: userIds,
|
|
candidateRoles: roleIds
|
|
};
|
|
$.ajax({
|
|
url: '${base}/actTaskDef/saveConfig',
|
|
data: params,
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
layer.msg(data.msg);
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
</script>
|