提交 | 用户 | 时间
|
8286c6
|
1 |
layui.use(['table', 'admin', 'ax', 'func', 'layer', 'laydate'], function () { |
懒 |
2 |
var $ = layui.$; |
|
3 |
var table = layui.table; |
|
4 |
var laydate = layui.laydate; |
|
5 |
var $ax = layui.ax; |
|
6 |
var admin = layui.admin; |
|
7 |
var func = layui.func; |
|
8 |
var layer = layui.layer; |
|
9 |
|
|
10 |
/** |
|
11 |
* 管理 |
|
12 |
*/ |
|
13 |
var Task = { |
|
14 |
tableId: "taskTable" |
|
15 |
}; |
|
16 |
|
|
17 |
/** |
|
18 |
* 初始化表格的列 |
|
19 |
*/ |
|
20 |
Task.initColumn = function () { |
|
21 |
return [[ |
|
22 |
{type: 'checkbox'}, |
|
23 |
{field: 'id_', hide: true, title: ''}, |
|
24 |
{field: 'dgrm_resource_name_', hide: true, title: ''}, |
|
25 |
{field: 'task_def_key_', hide: true, title: ''}, |
|
26 |
{field: 'task_def_key_', hide: true, title: ''}, |
|
27 |
{field: 'priority_', hide: true, title: ''}, |
|
28 |
{field: 'tenant_id_', hide: true, title: ''}, |
|
29 |
{field: 'suspension_state_', hide: true, title: ''}, |
|
30 |
{field: 'rev_', hide: true, title: ''}, |
|
31 |
{field: 'execution_id_', hide: true, title: ''}, |
|
32 |
{field: 'proc_inst_id_', hide: true, title: ''}, |
|
33 |
|
|
34 |
{field: 'pname_', sort: true, title: '流程名称'}, |
|
35 |
{field: 'initator', sort: true, title: '申请人'}, |
|
36 |
{field: 'assignee_', sort: true, title: '当前节点(待办人)'}, |
|
37 |
{field: 'name_', sort: true, title: '当前任务'}, |
|
38 |
{field: 'create_time_', sort: true, title: '创建时间'}, |
|
39 |
{align: 'center', toolbar: '#tableBar', title: '操作'} |
|
40 |
|
|
41 |
]]; |
|
42 |
}; |
|
43 |
|
|
44 |
//渲染时间选择框 |
|
45 |
laydate.render({ |
|
46 |
elem: '#lastStart', |
|
47 |
range: false, |
|
48 |
max: Feng.currentDate() |
|
49 |
}); |
|
50 |
|
|
51 |
//渲染时间选择框 |
|
52 |
laydate.render({ |
|
53 |
elem: '#lastEnd', |
|
54 |
range: false, |
|
55 |
max: Feng.currentDate() |
|
56 |
}); |
|
57 |
|
|
58 |
// 渲染表格 |
|
59 |
var tableResult = table.render({ |
|
60 |
elem: '#' + Task.tableId, |
|
61 |
url: Feng.ctxPath + '/taskWaiting/list', |
|
62 |
page: true, |
|
63 |
height: "full-158", |
|
64 |
cellMinWidth: 100, |
|
65 |
cols: Task.initColumn() |
|
66 |
}); |
|
67 |
|
|
68 |
/** |
|
69 |
* 点击查询按钮 |
|
70 |
*/ |
|
71 |
Task.search = function () { |
|
72 |
var queryData = {}; |
|
73 |
queryData['keywords'] = $("#keywords").val(); |
|
74 |
queryData['lastStart'] = $("#lastStart").val(); |
|
75 |
queryData['lastEnd'] = $("#lastEnd").val(); |
|
76 |
table.reload(Task.tableId, { |
|
77 |
where: queryData, page: {curr: 1} |
|
78 |
}); |
|
79 |
}; |
|
80 |
|
|
81 |
|
|
82 |
/** |
|
83 |
* 点击委派 |
|
84 |
* |
|
85 |
* @param data 点击按钮时候的行数据 |
|
86 |
*/ |
|
87 |
Task.openDelegateDlg = function (data) { |
|
88 |
layer.open({ |
|
89 |
type: 2, |
|
90 |
title: '委派', |
|
91 |
area: ['800px', '400px'], |
|
92 |
content: Feng.ctxPath + '/taskWaiting/delegatePage?ID_=' + data.id_, |
|
93 |
end: function () { |
|
94 |
Task.search(); |
|
95 |
} |
|
96 |
}); |
|
97 |
}; |
|
98 |
|
|
99 |
/** |
|
100 |
* 点击办理 |
|
101 |
* |
|
102 |
* @param data 点击按钮时候的行数据 |
|
103 |
*/ |
|
104 |
Task.onHandleItem = function (data) { |
|
105 |
func.open({ |
|
106 |
title: '办理', |
|
107 |
content: Feng.ctxPath + '/taskWaiting/handlePage?ID_=' + data.id_ + "&DGRM_RESOURCE_NAME_=" + data.dgrm_resource_name_ + "&PROC_INST_ID_=" + data.proc_inst_id_, |
|
108 |
tableId: Task.tableId |
|
109 |
}); |
|
110 |
}; |
|
111 |
|
|
112 |
// 搜索按钮点击事件 |
|
113 |
$('#btnSearch').click(function () { |
|
114 |
Task.search(); |
|
115 |
}); |
|
116 |
|
|
117 |
// 工具条点击事件 |
|
118 |
table.on('tool(' + Task.tableId + ')', function (obj) { |
|
119 |
var data = obj.data; |
|
120 |
var layEvent = obj.event; |
|
121 |
|
|
122 |
if (layEvent === 'delegate') { |
|
123 |
Task.openDelegateDlg(data); |
|
124 |
} else if (layEvent === 'handle') { |
|
125 |
Task.onHandleItem(data); |
|
126 |
} |
|
127 |
}); |
|
128 |
}); |