登陆修改

This commit is contained in:
caoqianming 2019-11-06 17:41:57 +08:00
parent 37799315bd
commit 98a14eb044
3 changed files with 33 additions and 7 deletions

View File

@ -2,16 +2,35 @@
<div id="zytablebar" style="padding:6px;height:auto">
<div style="margin-bottom:2px;margin-top:2px">
<!-- <a class="easyui-menubutton" data-options="menu:'#mm1',iconCls: 'fa-plus',plain:true">申请</a> -->
<a onclick="javascript:$('#sdg_zy').dialog('open')" class="easyui-linkbutton" data-options="iconCls: 'fa-search',plain:true">详细筛选</a>
<a id="delzy" class="easyui-linkbutton" onclick="delzy()" data-options="iconCls: 'fa-trash',plain:true">删除</a>
<a id="zydetail" onclick="zydetail()" class="easyui-linkbutton" data-options="iconCls: 'fa-info-circle',plain:true">查看详情</a>
<a id="exportzyword" onclick="exportzyword()" class="easyui-linkbutton" data-options="iconCls: 'fa-download',plain:true">导出Word</a>
<a id="exportzyexcel" onclick="exportzyexcel()" class="easyui-linkbutton" data-options="iconCls: 'fa-download',plain:true">导出Excel</a>
</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>
</div>
</div>
</div>
</div>
<script>
$(function(){
@ -38,7 +57,7 @@
});
function zysearch() {
var querydata = $('#searchzyff').serializeJSON();
querydata['a'] = 'listsearch'
querydata['a'] = 'listall'
$("#sdg_zy").dialog("close");
$('#zytable').datagrid('load',querydata);
}

View File

@ -313,7 +313,6 @@
var row = $('#yhtable').datagrid('getSelected');
if (row) {
if (row.yhzt != 6) {
//alert(row.todouser__userid);
if ($("#userindex").attr('userid') == row.todouser__userid) {
if (row.yhzt == 0) {
opendg('编辑隐患','addtrouble?a=edityh&troubleid=' + row.troubleid)

View File

@ -348,11 +348,12 @@ def logout(req):
#del req.session['username']
# if "userid" in req.session:
# del req.session['userid']
logger.info('method: %s user: %s 登出' % (req.method,req.session['userid']))
req.session.flush()
if req.session.get('userid',None):
logger.info('method: %s user: %s 登出' % (req.method,req.session['userid']))
req.session.flush()
#req.session.flush()
#req.session.delete("session_key")
return render(req,'login.html')
return redirect('login')
@check_login
def changepwd(req):
@ -636,7 +637,7 @@ def addyh(req):
zgms = yhdata['zgms'] if 'zgms' in yhdata else ''
sybzt=0
if troubleid!='':
a=Trouble.objects.get(troubleid=troubleid)
a = Trouble.objects.get(troubleid=troubleid)
else:
a = Trouble()
companyid=getcompany(userid)
@ -676,6 +677,9 @@ def addyh(req):
a.csqrr = user
a.shr = user
a.sybzt=0
if zgbm and zgr:
a.zgbm = Partment.objects.get(partid=zgbm)
a.zgr = User.objects.get(userid=zgr)
a.save()
m=TroubleAccess(troubleid=a,clr=user,yhzt=0,action='新增隐患已整改',result=1)
m.save()
@ -1667,7 +1671,7 @@ def troublehandle(req):
a = a.filter(Q(zgbm__in=parts) | Q(fxbm__in=parts,zgbm=None))
total = a.count()
startnum,endnum=fenye(req)
obj = a.order_by('-xgsj')[startnum:endnum].values('troubleid','fxr__userid','fxr__name','yhms','yhzt','fxsj','tbsj','yhlb__dickeyname','todouser__name','yhpg__dickeyname','yhnum','yhdj__dickeyname','shresult','zgqx','yhtp','zghtp')
obj = a.order_by('-xgsj')[startnum:endnum].values('troubleid','fxr__userid','fxr__name','yhms','yhzt','fxsj','tbsj','yhlb__dickeyname','todouser__name','yhpg__dickeyname','yhnum','yhdj__dickeyname','shresult','zgqx','yhtp','zghtp','todouser__userid')
return HttpResponse(transjson(total,obj),content_type="application/json")
elif a == 'listarea':
userid = req.session['userid']
@ -4336,6 +4340,10 @@ def apioperation(req):
a = Operation.objects.filter(usecomp=usecomp,deletemark=1).order_by('-submittime')
if req.GET.get('zyqy',False):
a = a.filter(zyqy__id=req.GET.get('zyqy'))
if req.GET.get('qssj',None):
a = a.filter(kssj__gte = req.GET.get('qssj'))
if req.GET.get('jssj',None):
a = a.filter(jssj__lte = req.GET.get('jssj'))
total = a.count()
startnum,endnum=fenye(req)
a = a[startnum:endnum].values('zyid','zylx__dickeyname','zynum','zyfzr__name','zynr','zyzt','submittime','todouser__name')