隐患增加选中导出
This commit is contained in:
parent
a3dc2bf923
commit
aebad83d27
|
@ -34,6 +34,9 @@
|
||||||
{% if request|has_permission:'b_trouble_exportxls' %}
|
{% if request|has_permission:'b_trouble_exportxls' %}
|
||||||
<a id="exportexcel" onclick="exportyhexcel2()" class='easyui-linkbutton' data-options="iconCls: 'fa-download',plain:true">导出无图Excel</a>
|
<a id="exportexcel" onclick="exportyhexcel2()" class='easyui-linkbutton' data-options="iconCls: 'fa-download',plain:true">导出无图Excel</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% if request|has_permission:'b_trouble_exportxls' %}
|
||||||
|
<a id="exportexcel" onclick="exportyhexcel3()" class='easyui-linkbutton' data-options="iconCls: 'fa-download',plain:true">导出选中</a>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div id="sdg_yh" class="easyui-dialog" title="筛选条件" style="width:400px;height:420px;"
|
<div id="sdg_yh" class="easyui-dialog" title="筛选条件" style="width:400px;height:420px;"
|
||||||
data-options="iconCls:'fa-search',resizable:true,modal:true,closed:true,border:false">
|
data-options="iconCls:'fa-search',resizable:true,modal:true,closed:true,border:false">
|
||||||
|
@ -98,7 +101,6 @@
|
||||||
|
|
||||||
$('#yhtable').datagrid({
|
$('#yhtable').datagrid({
|
||||||
rownumbers: true,
|
rownumbers: true,
|
||||||
singleSelect: true,
|
|
||||||
striped: true,
|
striped: true,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
url: '',
|
url: '',
|
||||||
|
@ -109,6 +111,7 @@
|
||||||
border: false,
|
border: false,
|
||||||
columns: [[
|
columns: [[
|
||||||
{ field: 'troubleid', hidden: true },
|
{ field: 'troubleid', hidden: true },
|
||||||
|
{ field: 'ck', checkbox: true , width: 20},
|
||||||
{ field: 'yhnum', title: '编号', width: 100 },
|
{ field: 'yhnum', title: '编号', width: 100 },
|
||||||
{
|
{
|
||||||
field: 'yhzt', title: '流程状态', width: 100, styler: function (value, row, index) {
|
field: 'yhzt', title: '流程状态', width: 100, styler: function (value, row, index) {
|
||||||
|
@ -338,6 +341,21 @@
|
||||||
window.open(url);
|
window.open(url);
|
||||||
// $('<form method="post" action="' + url + '"></form>').appendTo('body').submit().remove();
|
// $('<form method="post" action="' + url + '"></form>').appendTo('body').submit().remove();
|
||||||
}
|
}
|
||||||
|
function exportyhexcel3() {
|
||||||
|
var rows = $('#yhtable').datagrid('getSelections');
|
||||||
|
if(rows.length>0){
|
||||||
|
var data = {'ids':[]}
|
||||||
|
for(var i=0;i<rows.length;i++){
|
||||||
|
data.ids.push(rows[i].troubleid)
|
||||||
|
}
|
||||||
|
let url = 'troublehandle?a=exportexcel2&' + parseParams(data)
|
||||||
|
window.open(url);
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$.messager.alert('提示', '未选择数据!');
|
||||||
|
}
|
||||||
|
}
|
||||||
function delyh() {
|
function delyh() {
|
||||||
var row = $('#yhtable').datagrid('getSelected');
|
var row = $('#yhtable').datagrid('getSelected');
|
||||||
if (row) {
|
if (row) {
|
||||||
|
|
|
@ -2097,6 +2097,14 @@ def troublehandle(req):
|
||||||
else:
|
else:
|
||||||
res = exportxlsx('yh', a)
|
res = exportxlsx('yh', a)
|
||||||
return res
|
return res
|
||||||
|
elif a == 'exportexcel2':
|
||||||
|
userid = req.session['userid']
|
||||||
|
companyid = getcompany(userid)
|
||||||
|
ids_l = req.GET.get('ids').split(',')
|
||||||
|
objs = Trouble.objects.filter(
|
||||||
|
usecomp=Partment.objects.get(partid=companyid), deletemark=1, troubleid__in=ids_l)
|
||||||
|
res = exportxlsx('yh', objs)
|
||||||
|
return res
|
||||||
elif a == 'del':
|
elif a == 'del':
|
||||||
userid = req.session['userid']
|
userid = req.session['userid']
|
||||||
if User.objects.get(userid=userid).issuper == 1:
|
if User.objects.get(userid=userid).issuper == 1:
|
||||||
|
|
Loading…
Reference in New Issue