199 lines
8.4 KiB
HTML
199 lines
8.4 KiB
HTML
<table id="jytable" style="width:auto;height:100%;"></table>
|
|
<div id="jytablebar" style="padding: 4px;">
|
|
|
|
<div>
|
|
<label>快捷查询</label>
|
|
<select id='kjcxjy' style='width:150px'>
|
|
<option value="">请选择</option>
|
|
<option value="listself">我的建议</option>
|
|
<option value="listall">全部建议</option>
|
|
</select>
|
|
<a onclick="javascript:$('#sdg_jy').dialog('open')" class="easyui-linkbutton" data-options="iconCls: 'fa-search',plain:true">详细筛选</a>
|
|
</div>
|
|
<div>
|
|
{% load myfilter %}
|
|
{% if request|has_permission:'b_suggest_add' %}
|
|
<a id="addjy" class="easyui-linkbutton" onclick="addjy()" data-options="iconCls: 'fa-plus',plain:true">新增</a>
|
|
{% endif %}
|
|
<a id="updatejy" onclick="updatejy()" class="easyui-linkbutton" data-options="iconCls: 'fa-flash',plain:true">处理</a>
|
|
{% if request|has_permission:'b_suggest_del' %}
|
|
<a id="deljy" class="easyui-linkbutton" onclick="deljy()" data-options="iconCls: 'fa-trash',plain:true">删除</a>
|
|
{% endif %}
|
|
{% if request|has_permission:'b_suggest_detail' %}
|
|
<a id="jydetail" onclick="jydetail()" class="easyui-linkbutton" data-options="iconCls: 'fa-info-circle',plain:true">查看详情</a>
|
|
{% endif %}
|
|
{% if request|has_permission:'b_suggest_exportxls' %}
|
|
<a id="exportjyexcel" onclick="exportjyexcel()" class="easyui-linkbutton" data-options="iconCls: 'fa-download',plain:true">导出Excel</a>
|
|
{% endif %}
|
|
</div>
|
|
<div id="sdg_jy" 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='searchjyff'>
|
|
<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="jysearch" onclick="jysearch()" 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 option = $('#main').attr('value')
|
|
$('#jytable').datagrid({url:'api/suggest',queryParams:{a:option}});
|
|
$("#searchjyff").form('clear');
|
|
})
|
|
$('#kjcxjy').combobox({
|
|
editable:false,
|
|
onSelect: function (node) {
|
|
if(node.value != 0){
|
|
$('#jytable').datagrid({url:'api/suggest',queryParams:{a:node.value}});
|
|
}
|
|
}
|
|
});
|
|
function jysearch() {
|
|
var querydata = $('#searchjyff').serializeJSON();
|
|
querydata['a'] = 'listsearch'
|
|
$("#sdg_jy").dialog("close");
|
|
$('#jytable').datagrid('load',querydata);
|
|
}
|
|
function reset() {
|
|
$('#searchjyff').form('clear')
|
|
$('#jytable').datagrid('options').queryParams = {
|
|
a:'listall'
|
|
}
|
|
$('#jytable').datagrid('load');
|
|
|
|
}
|
|
$('#jytable').datagrid({
|
|
url: '',
|
|
rownumbers: true,
|
|
singleSelect: true,
|
|
striped: true,
|
|
fitColumns: true,
|
|
method: 'get',
|
|
pagination: 'true',
|
|
pageSize: 20,
|
|
toolbar: '#jytablebar',
|
|
border:false,
|
|
columns: [[
|
|
{ field: 'jyid', title: 'ID', hidden: true },
|
|
{ field: 'jynum', title: '编号', width: 180 },
|
|
{
|
|
field: 'jyzt', title: '流程状态', width: 80, styler: function (value, row, index) {
|
|
switch (value) {
|
|
case 1: return 'background-color:yellow;'; break;
|
|
case 2: return 'background-color:yellow;'; break;
|
|
case 3: return 'background-color:yellow;'; break;
|
|
case 4: return 'background-color:green;'; break;
|
|
}
|
|
}, formatter: function (value, row, index) {
|
|
switch (value) {
|
|
case 1: return '待评估'; break;
|
|
case 2: return '处理中'; break;
|
|
case 3: return '待审核'; break;
|
|
case 4: return '已关闭'; break;
|
|
}
|
|
}
|
|
},
|
|
{ field: 'todouser__name', title: '下一步处理人', width: 120 },
|
|
{ field: 'jyr__name', title: '建议人', width: 120 },
|
|
{ field: 'jybm__partname', title: '所属部门', width: 150 },
|
|
{ field: 'jydd', title: '建议地点', width: 150 },
|
|
{ field: 'jylb__dickeyname', title: '建议类别', width: 120 },
|
|
{ field: 'dqxz', title: '当前现状', width: 200 },
|
|
{ field: 'jynr', title: '建议内容', width: 400 },
|
|
{
|
|
field: 'accept', title: '建议状态', width: 80, styler: function (value, row, index) {
|
|
switch (value) {
|
|
case 1: return 'background-color:green;'; break;
|
|
case 0: return 'background-color:red;'; break;
|
|
|
|
}
|
|
}, formatter: function (value, row, index) {
|
|
switch (value) {
|
|
case 1: return '已采纳'; break;
|
|
case 0: return '未采纳'; break;
|
|
}
|
|
}
|
|
},
|
|
{ field: 'submittime', title: '提出时间', width: 120 },
|
|
]]
|
|
});
|
|
function addjy(){
|
|
opendg('新增合理化建议','html/suggest/add')
|
|
}
|
|
function deljy(){
|
|
var row = $('#jytable').datagrid('getSelected');
|
|
if (row) {
|
|
$.messager.confirm('提示', '确定删除吗?', function (r) {
|
|
if (r) {
|
|
$.ajax({
|
|
type: "GET",
|
|
url: 'api/suggest?a=del',
|
|
data: { 'jyid': row.jyid },
|
|
datatype: "json",
|
|
beforeSend: function () { },
|
|
success: function (data) {
|
|
if (data.code == 1) {
|
|
$("#jytable").datagrid('reload');
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '你无权删除该条记录!');
|
|
}
|
|
},
|
|
complete: function (XMLHttpRequest, textStatus) {
|
|
},
|
|
error: function () {
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '请选择一行数据!');
|
|
}
|
|
}
|
|
function jydetail(){
|
|
var row = $('#jytable').datagrid('getSelected');
|
|
if (row) {
|
|
var url = 'html/suggest/detail/' + row.jyid
|
|
opendg('查看详情',url)
|
|
}
|
|
else { $.messager.alert('提示', '请选择一行数据!'); }
|
|
}
|
|
function exportjyexcel() {
|
|
var querydata = $('#searchjyff').serializeJSON();
|
|
let url = 'api/suggest?a=exportexcel&'+parseParams(querydata)
|
|
window.open(url);
|
|
|
|
}
|
|
function updatejy(){
|
|
var row = $('#jytable').datagrid('getSelected');
|
|
if(row){
|
|
if (row.jyzt != 4) {
|
|
//alert(row.todouser__userid);
|
|
if ($("#userindex").attr('userid') == row.todouser__userid) {
|
|
var id = row.jyid;
|
|
var url = 'html/suggest/update/' + id;
|
|
opendg('处理建议',url)
|
|
|
|
} else { $.messager.alert('提示', '该条您无权操作!'); }
|
|
|
|
|
|
} else { $.messager.alert('提示', '无需处理!'); }
|
|
}else{
|
|
$.messager.alert('提示', '请选择一行数据!')
|
|
}
|
|
}
|
|
|
|
</script> |