113 lines
4.2 KiB
HTML
113 lines
4.2 KiB
HTML
|
|
<div id="resbilitytablebar" style="padding: 4px;height: 40px;background-color:#FCFCFC">
|
|
<div style="width: 500px;padding: 5px;">
|
|
<a id="addedu" class="easyui-linkbutton" onclick="javascript:opendg('新增文件','html/addresbility')" data-options="iconCls: 'fa-plus',plain:true">新增</a>
|
|
<a id="tzdetail" onclick="tzdetail()" class="easyui-linkbutton" data-options="iconCls: 'fa-info-circle',plain:true">点击查看</a>
|
|
<a id="edulook" class="easyui-linkbutton" onclick="jydetail()" data-options="iconCls: 'fa-plus',plain:true">观看详情</a>
|
|
<a id="deledu" class="easyui-linkbutton" onclick="deledu()" data-options="iconCls: 'fa-trash',plain:true">删除</a>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<table id="resbilitytable" style="width:100%;height:100%;text-align: center;"></table>
|
|
<script>
|
|
|
|
//点击观看
|
|
function tzdetail() {
|
|
var row = $('#resbilitytable').datagrid('getSelected');
|
|
if (row) {
|
|
var row = $('#resbilitytable').datagrid('getSelected');
|
|
$.ajax({
|
|
type: "get",
|
|
url: "api/getresbilitydata?a=readnum",
|
|
data: { 'id': row.id },
|
|
dateType: "json",
|
|
success: function (data) {
|
|
if (data.code == 1) {
|
|
document.getElementById("tzdetail").href = data.url;
|
|
document.getElementById("tzdetail").target = '_blank';//定义成打开新窗口
|
|
|
|
}
|
|
},
|
|
error: function () {
|
|
return false;
|
|
},
|
|
async: false
|
|
});
|
|
}
|
|
else { $.messager.alert('提示', '请选择一行数据!'); }
|
|
}
|
|
$('#resbilitytable').datagrid({
|
|
url: 'api/getresbilitydata?a=listall',
|
|
rownumbers: true,
|
|
singleSelect: true,
|
|
striped: true,
|
|
fitColumns: true,
|
|
method: 'get',
|
|
pagination: 'true',
|
|
pageSize: 20,
|
|
border: false,
|
|
toolbar:'#resbilitytablebar',
|
|
columns: [[
|
|
{ field: 'id', title: 'ID', hidden: true },
|
|
{ field: 'title', title: '制度名称', width: 100 },
|
|
{ field: 'jobs__groupname', title: '岗位', width: 100 },
|
|
{ field: 'homeworktype__dickeyname', title: '作业许可类型', width: 100 },
|
|
{ field: 'department__partname', title: '部门', width: 100 },
|
|
{ field: 'createdate', title: '上传时间', width: 100 },
|
|
{ field: 'createuser__name', title: '创建人', width: 100 },
|
|
|
|
{field: 'reads', title: '查看次数', width: 100,},
|
|
|
|
|
|
|
|
]]
|
|
});
|
|
|
|
|
|
function deledu() {
|
|
var row = $('#resbilitytable').datagrid('getSelected');
|
|
if (row) {
|
|
$.messager.confirm('提示', '确定删除吗?', function (r) {
|
|
if (r) {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: 'api/getresbilitydata?a=del',
|
|
data: { 'id': row.id },
|
|
datatype: "json",
|
|
beforeSend: function () { },
|
|
success: function (data) {
|
|
if (data.code == 1) {
|
|
$("#resbilitytable").datagrid('reload');
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '你无权删除该条责任制度!');
|
|
}
|
|
},
|
|
complete: function (XMLHttpRequest, textStatus) {
|
|
},
|
|
error: function () {
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '请选择一行数据!');
|
|
}
|
|
}
|
|
|
|
function jydetail() {
|
|
var row = $('#resbilitytable').datagrid('getSelected');
|
|
if (row) {
|
|
var url = 'html/resbility/detail/' + row.id
|
|
|
|
opendg('观看详情', url)
|
|
|
|
}
|
|
else { $.messager.alert('提示', '请选择一行数据!'); }
|
|
}
|
|
</script> |