异常处理新增查询
This commit is contained in:
parent
1b9d40e6df
commit
694a9411d7
|
@ -2,15 +2,23 @@
|
|||
<a id="downa" href="" target="_blank" style="display:none"></a>
|
||||
<div id="xjtablebar" style="padding: 4px">
|
||||
|
||||
<!-- <div >
|
||||
<label>快捷查询</label>
|
||||
<select id='kjcxxj' style='width:150px'>
|
||||
<option value="">请选择</option>
|
||||
<option value="listself">我的巡检</option>
|
||||
<option value="listall">全部记录</option>
|
||||
</select>
|
||||
<a onclick="javascript:$('#sdg_xj').dialog('open')" class="easyui-linkbutton" data-options="iconCls: 'fa-search',plain:true">详细筛选</a>
|
||||
</div> -->
|
||||
<div >
|
||||
<form id='searchxjff'>
|
||||
<!-- <label>巡检部门</label><input id="sxjbm" name="xjbm" editable=false /> -->
|
||||
<label>巡检人</label><input id="sxjr" name="xjr" class="easyui-textbox"/>
|
||||
<label>发现时间</label><input name='qssj' id='sqssj' class="easyui-datebox" editable=false>-<input name='jssj' id='sjssj'
|
||||
class="easyui-datebox" editable=false>
|
||||
<label>设备状态</label>
|
||||
<select name='state' id='sstate' style="width:100px" class="easyui-combobox" editable=false>
|
||||
<option value="">请选择</option>
|
||||
<option value="异常待处理">异常待处理</option>
|
||||
<option value="异常已处理">异常已处理</option>
|
||||
</select>
|
||||
<a id="xjsearch" onclick="xjsearch()" class="easyui-linkbutton" data-options="iconCls: 'fa-search'">查询</a>
|
||||
<a id="searchreset" onclick="reset()" class="easyui-linkbutton">重置</a>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<div >
|
||||
<!-- <a id="xjdetail" onclick="xjdetail()" class="easyui-linkbutton" data-options="iconCls: 'fa-info-circle',plain:true">查看详情</a> -->
|
||||
<!-- {% load myfilter %}
|
||||
|
@ -21,35 +29,7 @@
|
|||
<a id="delxj" onclick="delxj()" class="easyui-linkbutton" data-options="iconCls: 'fa-trash',plain:true">删除</a>
|
||||
{% endif %} -->
|
||||
<a id="xjdetail2" onclick="xjdetail2()" class="easyui-linkbutton" data-options="iconCls: 'fa-info-circle',plain:true">查看详情</a>
|
||||
</div>
|
||||
<div id="sdg_xj" 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='searchxjff'>
|
||||
<div style="margin-top:6px"><label>巡检部门</label><input id="sxjbm" name="xjbm" style="width:300px;"
|
||||
editable=false /></div>
|
||||
<div style="margin-top:6px"><label>巡检人</label><input id="sxjr" name="xjr" style="width:300px;" class="easyui-combobox"
|
||||
editable=false /></div>
|
||||
<div style="margin-top:6px"><label>起始时间</label><input name='qssj' id='sqssj' style="width:300px"
|
||||
class="easyui-datebox" editable=false></div>
|
||||
<div style="margin-top:6px"><label>结束时间</label><input name='jssj' id='sjssj' style="width:300px"
|
||||
class="easyui-datebox" editable=false></div>
|
||||
<div style="margin-top:6px"><label>设备状态</label>
|
||||
<select name='state' id='sstate' style="width:300px" class="easyui-combobox" editable=false>
|
||||
<option value="">请选择</option>
|
||||
<option value="1">正常</option>
|
||||
<option value="0">异常</option>
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div id='southdiv' data-options="region:'south'" style="height:46px;text-align:center;padding:6px">
|
||||
<a id="xjsearch" onclick="xjsearch()" class="easyui-linkbutton" data-options="iconCls: 'fa-search'">查询</a>
|
||||
<a id="searchreset" onclick="reset()" class="easyui-linkbutton">重置</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
@ -84,14 +64,13 @@
|
|||
});
|
||||
function xjsearch() {
|
||||
var querydata = $('#searchxjff').serializeJSON();
|
||||
querydata['a'] = 'listsearch'
|
||||
$("#sdg_xj").dialog("close");
|
||||
querydata['a'] = 'listyc'
|
||||
$('#xjtable').datagrid('load',querydata);
|
||||
}
|
||||
function reset() {
|
||||
$('#searchxjff').form('clear')
|
||||
$('#xjtable').datagrid('options').queryParams = {
|
||||
a:'listall'
|
||||
a:'listyc'
|
||||
}
|
||||
$('#xjtable').datagrid('load');
|
||||
|
||||
|
@ -135,6 +114,7 @@
|
|||
// return row.trouble__yhms
|
||||
// }
|
||||
// }},
|
||||
{ field: 'inspect__user__name', title: '巡检人', width: 80 },
|
||||
{ field: 'todouser__name', title: '处理人', width: 80 },
|
||||
{ field: 'inspect__creattime', title: '提交时间', width: 100 },
|
||||
|
||||
|
|
|
@ -7256,6 +7256,24 @@ def apiinspectitem(req):
|
|||
return HttpResponse(transjson(total, objs), content_type="application/json")
|
||||
elif a == 'listyc':#全部异常
|
||||
objs = InspectItem.objects.filter(inspect__usecomp__partid=companyid).exclude(state='正常')
|
||||
if req.GET.get("state", None):
|
||||
objs = objs.filter(state=req.GET.get('state'))
|
||||
if req.GET.get("qssj", None):
|
||||
objs = objs.filter(inspect__creattime__gte=req.GET.get("qssj"))
|
||||
if req.GET.get("jssj", None):
|
||||
objs = objs.filter(inspect__creattime__lte=req.GET.get("jssj"))
|
||||
# xjbm = req.GET.get('xjbm',None)
|
||||
xjr = req.GET.get('xjr',None)
|
||||
if xjr:
|
||||
objs = objs.filter(inspect__user__name__contains=xjr)
|
||||
# if xjbm or xjr:
|
||||
# if xjr:
|
||||
# objs = objs.filter(inspect__user__userid=xjr)
|
||||
# else:
|
||||
# parts = Partment.objects.filter(partid=xjbm) | Partment.objects.filter(
|
||||
# partlink__contains=','+xjbm+',')
|
||||
# objs = objs.filter(inspect__user__ubelongpart__in=parts)
|
||||
|
||||
total = objs.count()
|
||||
startnum, endnum = fenye(req)
|
||||
objs = objs.order_by('-id')[startnum:endnum].values('id', 'state', 'inspect', 'checkitem', 'inspect__equipment__name', 'checkitem__name','inspect__user__name', 'inspect__creattime', 'inspect__equipment__num', 'inspect__type__dickeyname','todouser__name')
|
||||
|
|
Loading…
Reference in New Issue