297 lines
11 KiB
HTML
297 lines
11 KiB
HTML
<table id="pxtable" style="width:auto;height:100%;"></table>
|
|
<a id="downa" href="" target="_blank" style="display:none"></a>
|
|
<div id="pxtablebar" style="padding: 4px">
|
|
|
|
<div>
|
|
<label>快捷查询</label>
|
|
<select id='kjcxpx' style='width:150px'>
|
|
<option value="">请选择</option>
|
|
<option value="listtodo">我的待评估培训</option>
|
|
<option value="listall">全部培训</option>
|
|
</select>
|
|
<a onclick="javascript:$('#sdg_px').dialog('open')" class="easyui-linkbutton"
|
|
data-options="iconCls: 'fa-search',plain:true">详细筛选</a>
|
|
</div>
|
|
<div>
|
|
{% load myfilter %}
|
|
{% if request|has_permission:'b_train_add' %}
|
|
<a id="addtrain" onclick="javascript:opendg('新建培训','abtrain?a=addtrain')">新增</a>
|
|
{% endif %}
|
|
<a id="accesstrain" onclick="accesstrain()">评估</a>
|
|
{% if request|has_permission:'b_train_del' %}
|
|
<a id="deltrain" onclick="deltrain()">删除</a>
|
|
{% endif %}
|
|
{% if request|has_permission:'b_train_detail' %}
|
|
<a id="pxdetail" onclick="pxdetail()">查看详情</a>
|
|
{% endif %}
|
|
{% if request|has_permission:'b_train_exportdoc' %}
|
|
<a id="exportpxword" onclick="exportpxword()">导出Word</a>
|
|
{% endif %}
|
|
{% if request|has_permission:'b_train_exportxls' %}
|
|
<a id="exportpxexcel" onclick="exportpxexcel()">导出Excel</a>
|
|
{% endif %}
|
|
</div>
|
|
<div id="sdg_px" class="easyui-dialog" title="筛选条件" style="width:400px;height:300px;"
|
|
data-options="iconCls:'fa-search',resizable:true,modal:true,closed:true,border:false">
|
|
<div class="easyui-layout" style="width:100%;height:100%;">
|
|
<div data-options="region:'center'" style="height:100%;text-align:center">
|
|
<form id='searchpxff'>
|
|
<div style="margin-top:6px"><label>起始时间</label><input name='qssj' id='qssjpx' style="width:300px">
|
|
</div>
|
|
<div style="margin-top:6px"><label>结束时间</label><input name='jssj' id='jssjpx' style="width:300px">
|
|
</div>
|
|
<div style="margin-top:6px"><label>培训部门</label><input name='trainpart' id="strainpart"
|
|
style="width:300px;" /></div>
|
|
<div style="margin-top:6px"><label>培训级别</label><input name='trainlevel' id="strainlevel"
|
|
style="width:300px;" /></div>
|
|
<div style="margin-top:6px"><label>培训内容</label><input name='traincontent' id="straincontent"
|
|
style="width:300px;" editable=false /></div>
|
|
</form>
|
|
</div>
|
|
<div id='southdiv' data-options="region:'south'" style="height:46px;text-align:center;padding:6px">
|
|
<a id="pxsearch" onclick="pxsearch()">查询</a>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
$(function () {
|
|
var option = $('#main').attr('value')
|
|
$('#pxtable').datagrid({ url: 'pxhandle', queryParams: { a: option } });
|
|
$("#searchpxff").form('clear');
|
|
})
|
|
$('#pxtable').datagrid({
|
|
url: '',
|
|
rownumbers: true,
|
|
singleSelect: true,
|
|
striped: true,
|
|
fitColumns: true,
|
|
method: 'get',
|
|
pagination: 'true',
|
|
pageSize: 20,
|
|
toolbar: '#pxtablebar',
|
|
border: false,
|
|
columns: [[
|
|
{ field: 'trainid', title: '培训ID', hidden: true },
|
|
{ field: 'trainnum', title: '编号', width: 150 },
|
|
{
|
|
field: '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: 'trainplace', title: '培训地点', width: 80 },
|
|
{ field: 'trainname', title: '培训名称', width: 200 },
|
|
{ field: 'starttime', title: '开始时间', width: 200 },
|
|
{ field: 'traintype__dickeyname', title: '培训类型', width: 200 },
|
|
{ field: 'teacher', title: '授课人', width: 200 },
|
|
{ field: 'submituser__name', title: '填报人', width: 200 },
|
|
{ field: 'submituser__userid', title: '填报人ID', hidden: true },
|
|
]]
|
|
});
|
|
$('#kjcxpx').combobox({
|
|
editable: false,
|
|
onSelect: function (node) {
|
|
if (node.value != 0) {
|
|
$('#pxtable').datagrid({ url: 'pxhandle', queryParams: { a: node.value } });
|
|
}
|
|
}
|
|
});
|
|
$('#addtrain').linkbutton({
|
|
iconCls: 'fa-plus',
|
|
plain: true
|
|
});
|
|
$('#accesstrain').linkbutton({
|
|
iconCls: 'fa-flash',
|
|
plain: true
|
|
});
|
|
$('#deltrain').linkbutton({
|
|
iconCls: 'fa-trash',
|
|
plain: true
|
|
});
|
|
$('#wdtrain').linkbutton({
|
|
iconCls: 'icon-man',
|
|
plain: true
|
|
});
|
|
$('#pxsearch').linkbutton({
|
|
iconCls: 'fa-search',
|
|
});
|
|
$('#pxdetail').linkbutton({
|
|
iconCls: 'fa-info-circle',
|
|
plain: true
|
|
});
|
|
$('#exportpxword').linkbutton({
|
|
iconCls: 'fa-download',
|
|
plain: true
|
|
});
|
|
$('#exportpxexcel').linkbutton({
|
|
iconCls: 'fa-download',
|
|
plain: true
|
|
});
|
|
$('#straincontent').combobox();
|
|
$("#strainlevel").combobox({
|
|
url: 'getdicclass?dicid=4',
|
|
method: 'get',
|
|
valueField: 'value',
|
|
textField: 'text',
|
|
groupField: 'group',
|
|
editable: false,
|
|
onSelect: function (node) {
|
|
$('#straincontent').combobox({
|
|
editable: false,
|
|
url: 'getdickey?dicclass=' + node.value + '&a=combobox',
|
|
checkbox: true,
|
|
valueField: 'value',
|
|
textField: 'text'
|
|
});
|
|
}
|
|
});
|
|
$("#strainpart").combotree({
|
|
url: 'parthandle?a=tree',
|
|
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;
|
|
},
|
|
editable: false,
|
|
});
|
|
$("#qssjpx").datebox({ editable: false });
|
|
$("#jssjpx").datebox({ editable: false });
|
|
function pxdetail() {
|
|
var row = $('#pxtable').datagrid('getSelected');
|
|
if (row) {
|
|
var url = 'pxhandle?a=detailhtml&trainid=' + row.trainid
|
|
opendg('查看详情', url)
|
|
}
|
|
else { $.messager.alert('提示', '请选择一行数据!'); }
|
|
}
|
|
function deltrain() {
|
|
var row = $('#pxtable').datagrid('getSelected');
|
|
if (row) {
|
|
$.messager.confirm('提示', '确定删除吗?', function (r) {
|
|
if (r) {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: 'pxhandle?a=del',
|
|
data: { 'trainid': row.trainid },
|
|
datatype: "json",
|
|
beforeSend: function () { },
|
|
success: function (data) {
|
|
if (data.code == 1) {
|
|
$("#pxtable").datagrid('reload');
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '你无权删除该条培训!');
|
|
}
|
|
},
|
|
complete: function (XMLHttpRequest, textStatus) {
|
|
},
|
|
error: function () {
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '请选择一行数据!');
|
|
}
|
|
}
|
|
|
|
function accesstrain() {
|
|
var row = $('#pxtable').datagrid('getSelected');
|
|
if (row) {
|
|
if (row.state == 0) {
|
|
if ($("#userindex").attr('userid') == row.submituser__userid) {
|
|
url = 'abtrain?trainid=' + row.trainid + '&a=accesstrain'
|
|
opendg('评估培训', url)
|
|
} else { $.messager.alert('提示', '非填报人不能评估!'); }
|
|
|
|
}
|
|
else { $.messager.alert('提示', '该培训已经评估!'); }
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '请选择一行数据!');
|
|
}
|
|
}
|
|
function pxsearch() {
|
|
var querydata = $('#searchpxff').serializeJSON();
|
|
querydata['a'] = 'listsearch'
|
|
$('#sdg_px').dialog('close')
|
|
$('#pxtable').datagrid('load', querydata);
|
|
}
|
|
function exportpxword() {
|
|
|
|
var row = $('#pxtable').datagrid('getSelected');
|
|
if (row) {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: 'pxhandle?a=exportword&trainid=' + row.trainid,
|
|
datatype: "json",
|
|
async: false,
|
|
beforeSend: function () { loading() },
|
|
success: function (data) {
|
|
removeLoading();
|
|
if (data.code == 1) {
|
|
downloadurl = data.downloadurl
|
|
window.open(downloadurl);
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '导出Word失败!');
|
|
}
|
|
},
|
|
complete: function (XMLHttpRequest, textStatus) {
|
|
},
|
|
error: function () {
|
|
}
|
|
});
|
|
}
|
|
else { $.messager.alert('提示', '请选择一行数据!'); }
|
|
}
|
|
function exportpxexcel() {
|
|
var querydata = $('#searchpxff').serializeJSON();
|
|
querydata['a'] = 'exportexcel'
|
|
$.ajax({
|
|
type: "GET",
|
|
url: 'pxhandle',
|
|
data: querydata,
|
|
datatype: "json",
|
|
async: false,
|
|
beforeSend: function () { loading(); },
|
|
success: function (data) {
|
|
if (data.code == 1) {
|
|
|
|
window.open(data.downloadurl);
|
|
}
|
|
|
|
else {
|
|
$.messager.alert('提示', '导出Excel失败!');
|
|
}
|
|
removeLoading();
|
|
},
|
|
complete: function (XMLHttpRequest, textStatus) {
|
|
},
|
|
error: function () {
|
|
}
|
|
});
|
|
|
|
}
|
|
</script> |