212 lines
9.0 KiB
HTML
212 lines
9.0 KiB
HTML
<table id="zytable" style="width:auto;height:100%;"></table>
|
|
<div id="zytablebar" style="padding:6px;height:auto">
|
|
<div style="margin-bottom:2px;margin-top:2px">
|
|
{% load myfilter %}
|
|
{% if request|has_permission:'b_operation_add' %}
|
|
<a class="easyui-linkbutton" data-options="iconCls: 'fa-plus',plain:true" onclick="javascript:opendg('申请作业','html/operation/add')">申请作业(无审批)</a>
|
|
{% endif %}
|
|
<a id="gbzy" class="easyui-linkbutton" onclick="gbzy()" data-options="iconCls: 'fa-close',plain:true">关闭作业</a>
|
|
<a onclick="javascript:$('#sdg_zy').dialog('open')" class="easyui-linkbutton" data-options="iconCls: 'fa-search',plain:true">详细筛选</a>
|
|
{% if request|has_permission:'b_operation_del' %}
|
|
<a id="delzy" class="easyui-linkbutton" onclick="delzy()" data-options="iconCls: 'fa-trash',plain:true">删除</a>
|
|
{% endif %}
|
|
{% if request|has_permission:'b_operation_detail' %}
|
|
<a id="zydetail" onclick="zydetail()" class="easyui-linkbutton" data-options="iconCls: 'fa-info-circle',plain:true">查看详情</a>
|
|
{% endif %}
|
|
{% if request|has_permission:'b_operation_exportdoc' %}
|
|
<a id="exportzyword" onclick="exportzyword()" class="easyui-linkbutton" data-options="iconCls: 'fa-download',plain:true">导出Word</a>
|
|
{% endif %}
|
|
{% if request|has_permission:'b_operation_exportxls' %}
|
|
<a id="exportzyexcel" onclick="exportzyexcel()" class="easyui-linkbutton" data-options="iconCls: 'fa-download',plain:true">导出Excel</a>
|
|
{% endif %}
|
|
|
|
</div>
|
|
<!-- <div id="mm1" style="width:150px;">
|
|
<div>Cut</div>
|
|
<div>Copy</div>
|
|
<div>Paste</div>
|
|
</div> -->
|
|
<div id="sdg_zy" 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='searchzyff'>
|
|
<div style="margin-top:6px"><label>起始时间</label><input name='qssj' style="width:300px"
|
|
class="easyui-datebox" editable=false></div>
|
|
<div style="margin-top:6px"><label>结束时间</label><input name='jssj' style="width:300px"
|
|
class="easyui-datebox" editable=false></div>
|
|
</form>
|
|
</div>
|
|
<div id='southdiv' data-options="region:'south'" style="height:46px;text-align:center;padding:6px">
|
|
<a id="zysearch" onclick="zysearch()" class="easyui-linkbutton" data-options="iconCls: 'fa-search'">查询</a>
|
|
<a id="searchreset" onclick="reset()" class="easyui-linkbutton">重置</a>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
$(function(){
|
|
var searchStr = sessionStorage.getItem("operation");
|
|
|
|
var queryParams = {'a':'listall'}
|
|
if(searchStr){
|
|
var lls = JSON.parse(searchStr)
|
|
queryParams = Object.assign(queryParams, lls)
|
|
sessionStorage.removeItem("operation")
|
|
}
|
|
$('#zytable').datagrid({url:'api/operation',queryParams:queryParams});
|
|
$.get('getdickey?dicclass=33&a=combobox',function(data){
|
|
let html=''
|
|
for (var x = 0, len = data.length; x < len; x++) {
|
|
html +='<div class="easyui-linkbutton" onclick="addzy(this)" value="'+ data[x].value +'">'+data[x].text+'</div>'
|
|
}
|
|
$('#mm1').html(html)
|
|
})
|
|
})
|
|
function addzy(obj){
|
|
opendg('申请作业','html/operation/add/'+obj.getAttribute("value"))
|
|
}
|
|
$('#kjcxzy').combobox({
|
|
editable:false,
|
|
onSelect: function (node) {
|
|
if(node.value != 0){
|
|
$('#zytable').datagrid({url:'api/suggest',queryParams:{a:node.value}});
|
|
}
|
|
}
|
|
});
|
|
function zysearch() {
|
|
var querydata = $('#searchzyff').serializeJSON();
|
|
querydata['a'] = 'listall'
|
|
$("#sdg_zy").dialog("close");
|
|
$('#zytable').datagrid('load',querydata);
|
|
}
|
|
function reset() {
|
|
$('#searchzyff').form('clear')
|
|
$('#zytable').datagrid('options').queryParams = {
|
|
a:'listall'
|
|
}
|
|
$('#zytable').datagrid('load');
|
|
|
|
}
|
|
$('#zytable').datagrid({
|
|
url: '',
|
|
rownumbers: true,
|
|
singleSelect: true,
|
|
striped: true,
|
|
fitColumns: true,
|
|
method: 'get',
|
|
pagination: 'true',
|
|
pageSize: 20,
|
|
toolbar: '#zytablebar',
|
|
border:false,
|
|
columns: [[
|
|
{ field: 'zyid', title: 'ID', hidden: true },
|
|
{ field: 'zynum', title: '编号', width: 100 },
|
|
{ field: 'zyzt', title: '作业状态', width: 60 ,formatter: function (value, row, index) {
|
|
if(value.splc==0){
|
|
return value.zyzt + '(无流程)'
|
|
}else{
|
|
return value.zyzt;
|
|
}
|
|
|
|
}, styler: function (value, row, index) {
|
|
switch (value.zyzt) {
|
|
case '已关闭': return 'background-color:green;color:white'; break;
|
|
case '待关闭': return 'background-color:orange;'; break;
|
|
}
|
|
}},
|
|
{ field: 'zyqy__name', title: '作业区域', width: 100 },
|
|
{ field: 'zylx__dickeyname', title: '作业类型', width: 100 },
|
|
{ field: 'zyfzr__name', title: '作业负责人', width: 100 },
|
|
{ field: 'zynr', title: '作业内容', width: 200 },
|
|
{ field: 'submittime', title: '提交时间', width: 100 },
|
|
]]
|
|
});
|
|
function delzy(){
|
|
var row = $('#zytable').datagrid('getSelected');
|
|
if (row) {
|
|
$.messager.confirm('提示', '确定删除吗?', function (r) {
|
|
if (r) {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: 'api/operation?a=del',
|
|
data: { 'zyid': row.zyid },
|
|
datatype: "json",
|
|
beforeSend: function () { },
|
|
success: function (data) {
|
|
if (data.code == 1) {
|
|
$("#zytable").datagrid('reload');
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '你无权删除该条记录!');
|
|
}
|
|
},
|
|
complete: function (XMLHttpRequest, textStatus) {
|
|
},
|
|
error: function () {
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '请选择一行数据!');
|
|
}
|
|
}
|
|
function zydetail(){
|
|
var row = $('#zytable').datagrid('getSelected');
|
|
if (row) {
|
|
var url = 'html/operation/detail/' + row.zyid
|
|
opendg('查看详情',url)
|
|
}
|
|
else { $.messager.alert('提示', '请选择一行数据!'); }
|
|
}
|
|
function exportzyword(){
|
|
var row = $('#zytable').datagrid('getSelected');
|
|
if (row) {
|
|
let url = 'api/operation?a=exportword&id='+row.zyid
|
|
$('<form method="post" action="' + url + '"></form>').appendTo('body').submit().remove();
|
|
}
|
|
else { $.messager.alert('提示', '请选择一行数据!'); }
|
|
}
|
|
function exportzyexcel() {
|
|
var querydata = $('#searchzyff').serializeJSON();
|
|
let url = 'api/operation?a=exportexcel&'+ parseParams(querydata)
|
|
window.open(url);
|
|
}
|
|
function gbzy(){
|
|
var row = $('#zytable').datagrid('getSelected');
|
|
if (row) {
|
|
$.messager.confirm('提示', '确定关闭该作业吗?', function (r) {
|
|
if (r) {
|
|
$.ajax({
|
|
type: "POST",
|
|
url: 'api/operation?a=gbzy',
|
|
data: JSON.stringify({ 'zyid': row.zyid }),
|
|
datatype: "json",
|
|
contentType: "application/json;charset=utf-8",
|
|
beforeSend: function () { },
|
|
success: function (data) {
|
|
if (data.code == 1) {
|
|
$("#zytable").datagrid('reload');
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '你无权关闭该作业!');
|
|
}
|
|
},
|
|
complete: function (XMLHttpRequest, textStatus) {
|
|
},
|
|
error: function () {
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '请选择一行数据!');
|
|
}
|
|
}
|
|
</script> |