136 lines
5.6 KiB
HTML
136 lines
5.6 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 %}
|
|
|
|
</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 exportgrpxexcel() {
|
|
var datalist = $('#grpxtable').datagrid('getData').rows;
|
|
for(var j = 0,len = datalist.length; j < len; j++){
|
|
var dic = datalist[j]
|
|
for (var key in dic) {
|
|
dic["姓名"]=dic["participant__name"]
|
|
dic["培训编号"]=dic["train__trainnum"]
|
|
dic["培训名称"]=dic["train__trainname"]
|
|
dic["培训地点"]=dic["train__trainplace"]
|
|
dic["开始时间"]=dic["train__starttime"]
|
|
dic["得分"]=dic["score"]
|
|
if(dic["score"]==null){dic["得分"]=''}
|
|
if(dic["checked"]==0){dic["签到情况"]='未微信签到'}
|
|
if(dic["checked"]==1){dic["签到情况"]='已微信签到'}
|
|
dic["授课人"]=dic["train__lecturer__name"]
|
|
delete dic["train__trainid"];
|
|
delete dic["participant__name"];
|
|
delete dic["train__trainnum"];
|
|
delete dic["train__trainname"];
|
|
delete dic["train__trainplace"];
|
|
delete dic["train__starttime"];
|
|
delete dic["score"];
|
|
delete dic["checked"];
|
|
delete dic["train__lecturer__name"];
|
|
delete dic["train__state"];
|
|
delete dic["train__teacher"];
|
|
}
|
|
}
|
|
JSONToCSVConvertor(JSON.stringify(datalist), "个人培训档案", true);
|
|
}
|
|
</script> |