120 lines
4.8 KiB
HTML
120 lines
4.8 KiB
HTML
<table id="grpxtable" style="width:auto;height:100%;"></table>
|
|
<a id="downa" href="" target="_blank" style="display:none"></a>
|
|
<div id="grpxtablebar" style="padding:5px;height:auto">
|
|
<div>
|
|
<label>部门</label>
|
|
<input class="easyui-combobox" id="sbm" editable=false data-options="
|
|
method: 'get' ,
|
|
loadFilter: function(rows){
|
|
return convert(rows);
|
|
},
|
|
formatter:function(node){
|
|
var s=node.text;
|
|
if (node.children){
|
|
s +=' <span style=\' color:blue\'>(' + node.children.length + ')</span>';
|
|
}
|
|
return s;
|
|
},
|
|
">
|
|
<label>人员</label>
|
|
<input class="easyui-combobox" id="sry" editable=false>
|
|
<a class="easyui-linkbutton" data-options="iconCls: 'fa-search',plain:true" onclick="grpxsearch()">查询</a>
|
|
{% load myfilter %}
|
|
{% if request|has_permission:'b_personaltrain_exportexl' %}
|
|
<a class="easyui-linkbutton" data-options="iconCls: 'fa-download',plain:true" onclick="exportgrpxexcel()">导出Excel</a>
|
|
{% endif %}
|
|
{% if request|has_permission:'b_personaltrain_litall' %}
|
|
<a class="easyui-linkbutton" data-options="iconCls: 'fa-plus',plain:true" onclick="listall()">显示全部</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<script>
|
|
$("#sbm").combotree({ url: 'parthandle?a=tree', onSelect: function (node) { $('#sry').combobox({ url: 'getuser?partid=' + node.id + '&a=combobox', }); } });
|
|
$(function(){
|
|
$('#grpxtable').datagrid({url:'api/train?a=listjoin'});
|
|
})
|
|
$('#grpxtable').datagrid({
|
|
url: '',
|
|
rownumbers: true,
|
|
singleSelect: true,
|
|
striped: true,
|
|
fitColumns: true,
|
|
method: 'get',
|
|
pagination: 'true',
|
|
pageSize: 20,
|
|
toolbar: '#grpxtablebar',
|
|
border:false,
|
|
columns: [[
|
|
{ field: 'train__trainid', title: '培训ID', hidden: true },
|
|
{ field: 'participant__name', title: '姓名', width: 80 },
|
|
{ field: 'train__trainnum', title: '编号', width: 150 },
|
|
{
|
|
field: 'train__state', title: '状态', width: 80, styler: function (value, row, index) {
|
|
if (value == 0) {
|
|
return 'background-color:yellow;';
|
|
}
|
|
else {
|
|
return 'background-color:green;';
|
|
}
|
|
}, formatter: function (value, row, index) {
|
|
if (value == 0) {
|
|
return '待评估';
|
|
}
|
|
else {
|
|
return '已评估'
|
|
}
|
|
}
|
|
},
|
|
{ field: 'train__trainname', title: '培训名称', width: 200 },
|
|
{ field: 'train__trainplace', title: '培训地点', width: 80 },
|
|
{ field: 'train__starttime', title: '开始时间', width: 200 },
|
|
{ field: 'train__duration', title: '时长(小时)', width: 50 },
|
|
{ field: 'checked', title: '签到情况', width: 80 , styler: function (value, row, index) {
|
|
if (value == 0) {
|
|
return 'background-color:yellow;';
|
|
}
|
|
else {
|
|
return 'background-color:green;';
|
|
}
|
|
}, formatter: function (value, row, index) {
|
|
if (value == 0) {
|
|
return '未微信签到';
|
|
}
|
|
else {
|
|
return '已微信签到'
|
|
}
|
|
}},
|
|
{ field: 'train__teacher', title: '授课人', width: 200},
|
|
{ field: 'examtestdetail', title: '考试详情', width: 200, formatter: function (value, row, index) {
|
|
if(value != null){
|
|
return '<a target="_blank" href="/html/examhistory/'+value+'" >点击查看</a>'
|
|
}
|
|
|
|
} },
|
|
]]
|
|
});
|
|
function grpxsearch(){
|
|
var sry = $('#sry').combobox('getValue')
|
|
var url = 'api/train?a=listjoin'
|
|
if(sry!=''){
|
|
url = url + '&sry='+sry
|
|
$('#grpxtable').datagrid({url:url});
|
|
}else{
|
|
$.messager.alert('提示', '请先选择人员!');
|
|
}
|
|
|
|
}
|
|
function listall(){
|
|
var sry = $('#sry').combobox('getValue')
|
|
var url = 'api/train?a=listall'
|
|
|
|
$('#grpxtable').datagrid({url:url});
|
|
|
|
}
|
|
function exportgrpxexcel() {
|
|
var sry = $('#sry').combobox('getValue')
|
|
let url = 'api/train?a=exportexcel&sry='+sry
|
|
$('<form method="post" action="' + url + '"></form>').appendTo('body').submit().remove();
|
|
|
|
}
|
|
</script> |