提交 1491de9e 编写于 作者: doc_wei's avatar doc_wei

新增会签设定按钮

上级 86c40ac2
// 会签
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui', 'soulTable', 'table', 'form'], function (exports) {
winui.renderColor();
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$,
form = layui.form,
table = layui.table,
soulTable = layui.soulTable;
var chooseUserList = new Array();
var taskId = GetUrlParam("taskId");
// 获取会签节点信息
AjaxPostUtil.request({url: reqBasePath + "activitiTask006", params: {taskId: taskId}, method: "GET", type: 'json', callback: function(json) {
if(json.returnCode == 0) {
if(json.bean.isSequential){
$("#jointlySignType").html("串行多实例会签");
}else{
$("#jointlySignType").html("并行多实例会签");
}
chooseUserList = [].concat(json.bean.assigneeList);
} else {
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}, async: false});
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'get',
data: chooseUserList,
even: true,
page: false,
rowDrag: {
trigger: 'row',
done: function(obj) {}
},
cols: [[
{ type: 'checkbox', align: 'center' },
{ field: 'name', title: '会签人', align: 'left', width: 180, templet: function(d){
return '<input type="text" id="approvalId' + d.id + '" placeholder="请选择审批人" class="layui-input" readonly="readonly" ' +
'value="' + (isNull(d.name) ? "" : d.name) + '"/>' +
'<i class="fa fa-plus-circle input-icon chooseApprovalIdBtn" style="top: 8px;"></i>';
}},
{ field: 'email', title: '邮箱', align: 'left', width: 200}
]],
done: function(res){
for (var i = 0; i < res.rows.length; i++) {
// 不允许删除的设置为不可选中
if(res.rows[i].noDelete){
disabledRow(res.rows[i].LAY_TABLE_INDEX);
}
}
matchingLanguage();
soulTable.render(this);
}
});
function disabledRow(index) {
// 第index行复选框不可选
let t = $(".layui-table tr[data-index=" + index + "] input[type='checkbox']");
t.prop('disabled', true);
t.addClass('layui-btn-disabled');
t.next().css("cursor", "not-allowed");
}
form.render();
form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) {
if(table.cache.messageTable.length == 0){
winui.window.msg('请最少选择一条数据.', {icon: 2,time: 2000});
return false;
}
var params = {
taskId: taskId,
chooseUserMation: JSON.stringify(table.cache.messageTable)
};
AjaxPostUtil.request({url: reqBasePath + "activitiTask005", params: params, type: 'json', method: "POST", callback: function(json){
if(json.returnCode == 0){
parent.layer.close(index);
parent.refreshCode = '0';
}else{
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}});
}
return false;
});
$("body").on("click", "#addRow", function(){
addRow();
});
$("body").on("click", "#deleteRow", function(){
deleteRow();
});
// 新增行
var rowNum = 1;
function addRow() {
chooseUserList = [].concat(table.cache.messageTable);
chooseUserList.push({id: rowNum});
table.reload("messageTable", {data: chooseUserList});
rowNum++;
}
// 删除行
function deleteRow() {
chooseUserList = [].concat(table.cache.messageTable);
var check_box = table.checkStatus('messageTable').data;
for (var i = 0; i < check_box.length; i++){
var list = [];
$.each(chooseUserList, function(j, item){
if(item.id != check_box[i].id){
list.push(item);
}
});
chooseUserList = [].concat(list);
}
table.reload("messageTable", {data: chooseUserList});
}
// 人员选择
$("body").on("click", ".chooseApprovalIdBtn", function(){
var trId = $(this).parent().find("input").attr("id").replace("approvalId", "");
systemCommonUtil.userReturnList = [];
systemCommonUtil.chooseOrNotMy = "2"; // 人员列表中是否包含自己--1.包含;其他参数不包含
systemCommonUtil.chooseOrNotEmail = "2"; // 人员列表中是否必须绑定邮箱--1.必须;其他参数没必要
systemCommonUtil.checkType = "2"; // 人员选择类型,1.多选;其他。单选
systemCommonUtil.openSysUserStaffChoosePage(function (staffChooseList){
loadUseTableMation(trId, staffChooseList[0]);
});
});
function loadUseTableMation(trId, userReturnMation){
var inIndex = -1;
$.each(chooseUserList, function(j, item){
if(item.id == trId){
inIndex = j;
return;
}
});
if(inIndex != -1){
chooseUserList[inIndex] = userReturnMation;
}
table.reload("messageTable", {data: chooseUserList});
}
// 取消
$("body").on("click", "#cancle", function(){
parent.layer.close(index);
});
});
\ No newline at end of file
......@@ -28,7 +28,7 @@ layui.config({
{ field: 'jobNumber', title: '工号', align: 'left', rowspan: '2', width: 120},
{ field: 'userName', title: '姓名', align: 'left', rowspan: '2', width: 120},
{ title: '公司信息', align: 'center', colspan: '3'},
{ field: 'userEmail', title: '邮箱', align: 'left', rowspan: '2', width: 200}
{ field: 'email', title: '邮箱', align: 'left', rowspan: '2', width: 200}
],[
{ field: 'companyName', title: '公司', align: 'left', width: 120},
{ field: 'departmentName', title: '部门', align: 'left', width: 120},
......
......@@ -30,7 +30,7 @@ layui.config({
{ field: 'jobNumber', title: '工号', align: 'left', rowspan: '2', width: 120},
{ field: 'userName', title: '姓名', align: 'left', rowspan: '2', width: 120},
{ title: '公司信息', align: 'center', colspan: '3'},
{ field: 'userEmail', title: '邮箱', align: 'left', rowspan: '2', width: 200}
{ field: 'email', title: '邮箱', align: 'left', rowspan: '2', width: 200}
],[
{ field: 'companyName', title: '公司', align: 'left', width: 120},
{ field: 'departmentName', title: '部门', align: 'left', width: 120},
......
......@@ -70,9 +70,7 @@ layui.config({
subTasks(data, obj);
} else if (layEvent === 'details') { //详情
activitiUtil.activitiDetails(data);
} else if (layEvent === 'turnMultiInstance') { //转为会签
activitiUtil.turnMultiInstance(data.processInstanceId, data.id);
}
}
});
// 提交任务
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
<style type="text/css">
.layui-table-cell {
height: auto;
}
</style>
</head>
<body>
<div style="margin:0 auto;padding:20px;">
<form class="layui-form" action="" id="showForm" autocomplete="off">
<div class="layui-form-item layui-col-xs12">
<span class="hr-title">会签设定</span><hr>
</div>
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">会签类型:</label>
<div class="layui-input-block ver-center" id="jointlySignType">
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="winui-tool" style="text-align: left;">
<button id="addRow" class="winui-toolbtn" type="button"><i class="fa fa-plus" aria-hidden="true"></i>新增行</button>
<button id="deleteRow" class="winui-toolbtn" type="button"><i class="fa fa-trash-o" aria-hidden="true"></i>删除行</button>
</div>
<table class="layui-table" id="messageTable">
</table>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formAddBean"><language showName="com.skyeye.submit"></language></button>
</div>
</div>
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/addSignTask/'}).use('jointlySign');
</script>
</body>
</html>
\ No newline at end of file
......@@ -36,9 +36,6 @@
{{# if(!d.suspended){ }}
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="subTasks">审批</a>
{{# } }}
<!--{{# if(!d.isMultiInstance){ }}
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="turnMultiInstance">转为会签</a>
{{# } }}-->
</script>
</div>
......
......@@ -188,6 +188,10 @@ var activitiUtil = {
operatorBtnHtml += '<a class="layui-btn layui-btn-normal" id="transfer" style="height: 30px; line-height: 30px; padding: 0 15px;">转办</a>';
operatorBtnHtml += '<a class="layui-btn layui-btn-normal" id="beforeAddSignTask" style="height: 30px; line-height: 30px; padding: 0 15px;">前加签</a>';
operatorBtnHtml += '<a class="layui-btn layui-btn-normal" id="afterAddSignTask" style="height: 30px; line-height: 30px; padding: 0 15px;">后加签</a>';
if(task.isMultiInstance){
// 会签节点进行加签
operatorBtnHtml += '<a class="layui-btn layui-btn-normal" id="jointlySign" style="height: 30px; line-height: 30px; padding: 0 15px;">会签设定</a>';
}
$("#" + boxId).html(operatorBtnHtml);
// 初始化监听事件
activitiUtil.activitiMenuEvent(task, callback);
......@@ -286,6 +290,25 @@ var activitiUtil = {
});
});
// 会签设定人员
$("body").on("click", "#jointlySign", function() {
_openNewWindows({
url: "../../tpl/addSignTask/jointlySign.html?taskId=" + task.taskId,
title: "会签设定",
pageId: "jointlySignPage",
area: ['90vw', '90vh'],
callBack: function(refreshCode){
if (refreshCode == '0') {
if (typeof callback === 'function') {
callback();
}
} else if (refreshCode == '-9999') {
winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000});
}
}
});
});
}
};
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册