unis_sip/ruoyi-admin/src/main/resources/templates/flowable/manage/approveUser.html

100 lines
4.3 KiB
HTML

<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('编辑审批人')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="model-approve-edit">
<div class="row" th:each="info : ${approveConfig}">
<div class="col-xs-2">
<div class="form-group">
<label class=" control-label">流程节点:[[${info.taskName}]]</label>
<input type="hidden" th:name="${'approveConfigList['+infoStat.index+'].id'}" th:value="${info.id}">
<input type="hidden" th:name="${'approveConfigList['+infoStat.index+'].processKey'}" th:value="${info.processKey}">
<input type="hidden" th:name="${'approveConfigList['+infoStat.index+'].taskName'}" th:value="${info.taskName}">
</div>
</div>
<div class="col-xs-5">
<div class="form-group">
<label class="col-sm-4 control-label">审批人:</label>
<div class="col-sm-8">
<input type="hidden" th:name="${'approveConfigList['+infoStat.index+'].approveUser'}" th:value="${info.approveUser}">
<input type="text" th:onclick="selectPeople([[${infoStat.index}]])" readonly th:name="${'approveConfigList['+infoStat.index+'].approveUserName'}" th:value="${info.approveUserName}">
</div>
</div>
</div>
<div class="col-xs-5">
<div class="form-group">
<label class="col-sm-4 control-label">审批角色:</label>
<div class="col-sm-8">
<select class="form-control noselect2 selectpicker" th:data-selected="${info.approveRole}" th:name="${'approveConfigList['+infoStat.index+'].approveRole'}" data-none-selected-text="请选择审批角色" multiple>
<option th:each="role : ${roles}" th:value="${role.roleId.toString()}"
th:selected="${info.approveRoleList.contains(role.roleId.toString())}">[[${role.roleName}]]</option>
</select>
</div>
</div>
</div>
</div>
</form>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: bootstrap-select-js" />
<script th:inline="javascript">
var prefix = ctx + "flow/manage"
$("#form-leaveapply-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/approveUser", $('#model-approve-edit').serialize());
}
}
function selectPeople(listIndex) {
let approveUser = $(`input[name="approveConfigList[${listIndex}].approveUser"]`).val()
var url = prefix + "/selectPeople?user="+(approveUser?approveUser:"");
top.layer.open($.extend({
id: 'chooseApproveUser', // 唯一id
type: 2,
maxmin: true ,
shade: 0.3,
title: '选择审批人',
fix: false,
area: [ '680px', '680px'],
content: url,
btn: ['确定', '取消'],
shadeClose: true ,
yes: function ( index,layero){
doSubmitPeople(index, layero,listIndex)
},
cancel: function () {
return true;
}
}));
}
function doSubmitPeople(index, layero,listIndex) {
var rows = layero.find("iframe")[0].contentWindow.getSelections();
$.modal.close(index);
let nameDomKey=`input[name="approveConfigList[${listIndex}].approveUserName"]`
$(nameDomKey).val(rows.map(item=>item.userName).join(","))
let idDomKey=`input[name="approveConfigList[${listIndex}].approveUser"]`
$(idDomKey).val(rows.map(item=>item.userId).join(","))
}
$(function(){
})
</script>
</body>
</html>