从新发布考试
This commit is contained in:
parent
b388dce777
commit
f87b25db35
|
|
@ -60,16 +60,16 @@
|
|||
<table class='detailtable'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:10%">
|
||||
<th style="width:5%">
|
||||
序号
|
||||
</th>
|
||||
<th style="width:20%">
|
||||
<th style="width:15%">
|
||||
姓名
|
||||
</th>
|
||||
<th style="width:20%">
|
||||
<th style="width:10%">
|
||||
部门
|
||||
</th>
|
||||
<th style="width:15%">
|
||||
<th style="width:10%">
|
||||
状态
|
||||
</th>
|
||||
<th style="width:10%">
|
||||
|
|
@ -81,6 +81,9 @@
|
|||
<th style="width:15%">
|
||||
答题详情
|
||||
</th>
|
||||
<th style="width:20%">
|
||||
重新考试
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{{each cjrydetail}}
|
||||
|
|
@ -95,7 +98,13 @@
|
|||
{{/if}}
|
||||
<td>{{$value.score}}</td>
|
||||
<td>{{$value.took}}</td>
|
||||
<td><a target="_blank" href="/html/examhistory/{{$value.id}}" >点击查看</a></td>
|
||||
<td id="examdlid" style="display:none">{{$value.id}}</td>
|
||||
<td><a target="_blank" href="/html/examhistory/{{$value.id}}">点击查看</a></td>
|
||||
{{if $value.passcode==0&&$value.ison==1&&state==1}}
|
||||
<td><button style="background-color: #00ff5a;color: #004eff;" onclick="updateIson()">重新发布试卷</button></td>
|
||||
{{else}}
|
||||
<td><font color="green"></font></td>
|
||||
{{/if}}
|
||||
</tr>
|
||||
{{/each}}
|
||||
</table>
|
||||
|
|
@ -187,6 +196,19 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateIson() {
|
||||
var examdlid = document.getElementById("examdlid").innerHTML;
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "api/examtestdetail?a=updateison",
|
||||
contentType: 'application/json; charset=utf-8',
|
||||
data: { id: ksid, examdlid: examdlid},
|
||||
success: function (data) {
|
||||
|
||||
alert(data.message);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
@ -126,110 +126,110 @@ def upfile(req):
|
|||
return JsonResponse({"code":1,"filename":file_name,"filepath":filepath})
|
||||
|
||||
#html页面
|
||||
|
||||
@check_login
|
||||
def riskas(req):
|
||||
return render(req,'riskas.html')
|
||||
|
||||
@check_login
|
||||
def reportedit(req):
|
||||
return render(req,'reportedit.html',{'year':req.GET.get('year'),'month':req.GET.get('month'),'part':req.GET.get('part')})
|
||||
|
||||
@check_login
|
||||
def riskedit(req,id):
|
||||
return render(req,'riskedit.html',{'id':id})
|
||||
|
||||
@check_login
|
||||
def riskcheck(req):#风险点排查记录
|
||||
return render(req,'riskactcheck.html')
|
||||
|
||||
@check_login
|
||||
def taskdo(req):
|
||||
return render(req,'taskdo.html')
|
||||
|
||||
@check_login
|
||||
def task(req):
|
||||
return render(req,'task.html')
|
||||
|
||||
@check_login
|
||||
def riskactchose(req):
|
||||
area = 0
|
||||
if req.GET.get('area',None):
|
||||
area = req.GET.get('area')
|
||||
return render(req,'riskactchose.html',locals())
|
||||
|
||||
@check_login
|
||||
def riskactedit(req,id):
|
||||
return render(req,'riskactedit.html',{'id':id})
|
||||
|
||||
@check_login
|
||||
def riskactadd(req):
|
||||
return render(req,'riskactadd.html')
|
||||
|
||||
@check_login
|
||||
def riskadd(req,id):
|
||||
return render(req,'riskadd.html',{'id':id})
|
||||
|
||||
@check_login
|
||||
def risk(req):
|
||||
return render(req,'risk.html')
|
||||
|
||||
@check_login
|
||||
def inspect(req):
|
||||
return render(req,'inspect.html')
|
||||
|
||||
@check_login
|
||||
def equipment(req):
|
||||
return render(req,'equipment.html')
|
||||
|
||||
@check_login
|
||||
def areaedit(req,id):
|
||||
return render(req,'areaedit.html',{'id':id})
|
||||
|
||||
@check_login
|
||||
def areaadd(req):
|
||||
return render(req,'areaadd.html')
|
||||
|
||||
@check_login
|
||||
def areadetail(req):
|
||||
id = req.GET.get('id')
|
||||
return render(req,'areadetail.html',{'id':id})
|
||||
|
||||
@check_login
|
||||
def mapshow(req):
|
||||
return render(req,'mapshow.html')
|
||||
|
||||
@check_login
|
||||
def area(req):
|
||||
return render(req,'area.html')
|
||||
|
||||
@check_login
|
||||
def personaltrain(req):
|
||||
return render(req,'personaltrain.html')
|
||||
|
||||
@check_login
|
||||
def examtest(req):
|
||||
return render(req,'examtest.html')
|
||||
|
||||
@check_login
|
||||
def safecert(req):
|
||||
return render(req,'safecert.html')
|
||||
|
||||
@check_login
|
||||
def safecertadd(req):
|
||||
return render(req,'safecertadd.html')
|
||||
|
||||
@check_login
|
||||
def examtestdetail(req,id):
|
||||
return render(req,'examtestdetail.html',{'id':id})
|
||||
|
||||
@check_login
|
||||
def examtestadd(req):
|
||||
return render(req,'examtestadd.html')
|
||||
|
||||
@check_login
|
||||
def examtestadd2(req):
|
||||
return render(req,'examtestadd2.html')
|
||||
|
||||
@check_login
|
||||
def questionchoose(req):
|
||||
return render(req,'questionchoose.html')
|
||||
|
||||
@check_login
|
||||
def exampaperedit(req,id):
|
||||
return render(req,'exampaperedit.html',{'id':id})
|
||||
|
||||
@check_login
|
||||
def exampaperadd(req):
|
||||
return render(req,'exampaperadd.html')
|
||||
|
||||
@check_login
|
||||
def exampaper(req):
|
||||
return render(req,'exampaper.html')
|
||||
|
||||
@check_login
|
||||
def examhistory(req,id):
|
||||
return render(req,'examhistory.html',{'id':id})
|
||||
|
||||
@check_login
|
||||
def questionadd(req):
|
||||
return render(req,'questionadd.html')
|
||||
|
||||
@check_login
|
||||
def questionadd2(req):
|
||||
return render(req,'questionadd2.html')
|
||||
|
||||
@check_login
|
||||
def questionadd3(req):
|
||||
return render(req,'questionadd3.html')
|
||||
|
||||
@check_login
|
||||
def questionedit(req,id):
|
||||
obj = Question.objects.get(id=id)
|
||||
if obj.type==1:
|
||||
|
|
@ -238,140 +238,140 @@ def questionedit(req,id):
|
|||
return render(req,'questionedit2.html',{'id':id})
|
||||
elif obj.type==3:
|
||||
return render(req,'questionedit3.html',{'id':id})
|
||||
|
||||
@check_login
|
||||
def question(req):
|
||||
return render(req,'question.html')
|
||||
|
||||
@check_login
|
||||
def questioncatadd(req):
|
||||
return render(req,'questioncatadd.html')
|
||||
|
||||
@check_login
|
||||
def questioncatedit(req,id):
|
||||
return render(req,'questioncatedit.html',{'id':id})
|
||||
|
||||
@check_login
|
||||
def operationspjdadd(req):
|
||||
return render(req,'operationspjdadd.html')
|
||||
|
||||
@check_login
|
||||
def fxcsadd(req):
|
||||
return render(req,'fxcsadd.html')
|
||||
|
||||
@check_login
|
||||
def operationadd(req,zyid):
|
||||
return render(req,'operationadd.html',{'zyid':zyid})
|
||||
|
||||
@check_login
|
||||
def operationdetail(req,zyid):
|
||||
return render(req,'operationdetail.html',{'zyid':zyid})
|
||||
|
||||
@check_login
|
||||
def operation(req):
|
||||
return render(req,'operation.html')
|
||||
|
||||
@check_login
|
||||
def zuoyepeizhi(req):
|
||||
return render(req,'zuoyepeizhi.html')
|
||||
|
||||
@check_login
|
||||
def notice(req):
|
||||
return render(req,'notice.html')
|
||||
|
||||
@check_login
|
||||
def noticeadd(req):
|
||||
return render(req,'noticeadd.html')
|
||||
|
||||
@check_login
|
||||
def noticedetail(req,id):
|
||||
return render(req,'noticedetail.html',{'id':id})
|
||||
|
||||
@check_login
|
||||
def noticeedit(req,id):
|
||||
return render(req,'noticeedit.html',{'id':id})
|
||||
|
||||
@check_login
|
||||
def suggestupdate(req,jyid):
|
||||
return render(req,'suggestupdate.html',{'jyid':jyid})
|
||||
|
||||
@check_login
|
||||
def suggestdetail(req,jyid):
|
||||
return render(req,'suggestdetail.html',{'jyid':jyid})
|
||||
|
||||
@check_login
|
||||
def suggestadd(req):
|
||||
return render(req,'suggestadd.html')
|
||||
|
||||
@check_login
|
||||
def suggest(req):
|
||||
return render(req,'suggest.html')
|
||||
|
||||
@check_login
|
||||
def medetail(req):
|
||||
return render(req,'medetail.html')
|
||||
|
||||
@check_login
|
||||
def socerthtml(req):
|
||||
return render(req,'socert.html')
|
||||
|
||||
@check_login
|
||||
def socertadd(req):
|
||||
return render(req,'socertadd.html')
|
||||
|
||||
@check_login
|
||||
def rightshtml(req):
|
||||
groupid = req.GET.get('groupid')
|
||||
return render(req,'rights.html',{'groupid':groupid})
|
||||
|
||||
@check_login
|
||||
def misshtml(req):
|
||||
return render(req,'miss.html')
|
||||
|
||||
@check_login
|
||||
def missadd(req):
|
||||
return render(req,'missadd.html')
|
||||
|
||||
@check_login
|
||||
def missdetail(req,missid):
|
||||
return render(req,'missdetail.html',{'missid':missid})
|
||||
|
||||
@check_login
|
||||
def troublehtml(req):
|
||||
return render(req,'trouble.html')
|
||||
|
||||
@check_login
|
||||
def observehtml(req):
|
||||
return render(req,'observe.html')
|
||||
|
||||
@check_login
|
||||
def addobserve(req):
|
||||
return render(req,'addobserve.html')
|
||||
|
||||
@check_login
|
||||
def accesstrouble(req):
|
||||
return render(req,'accesstrouble.html')
|
||||
|
||||
@check_login
|
||||
def addtrouble(req):
|
||||
return render(req,'addtrouble.html')
|
||||
|
||||
@check_login
|
||||
def dichtml(req):
|
||||
return render(req,'dichtml.html')
|
||||
|
||||
@check_login
|
||||
def putreehtml(req):
|
||||
return render(req,'putree.html')
|
||||
|
||||
@check_login
|
||||
def usergroup(req):
|
||||
return render(req,'usergroup.html')
|
||||
|
||||
@check_login
|
||||
def getuserf(req):
|
||||
return render(req,'getuser.html')
|
||||
|
||||
@check_login
|
||||
def getusersf(req):
|
||||
return render(req,'getusers.html')
|
||||
|
||||
@check_login
|
||||
def trainhtml(req):
|
||||
return render(req,'train.html')
|
||||
|
||||
@check_login
|
||||
def abtrain(req):
|
||||
return render(req,'abtrain.html')
|
||||
|
||||
@check_login
|
||||
def drillhtml(req):
|
||||
return render(req,'drill.html')
|
||||
|
||||
@check_login
|
||||
def abdrill(req):
|
||||
return render(req,'abdrill.html')
|
||||
|
||||
@check_login
|
||||
def reporthtml(req):
|
||||
return render(req,'report.html')
|
||||
|
||||
@check_login
|
||||
def troubleashtml(req):
|
||||
return render(req,'troubleashtml.html')
|
||||
|
||||
@check_login
|
||||
def userhtml(req):
|
||||
return render(req,'userhtml.html')
|
||||
|
||||
@check_login
|
||||
def bhrhtml(req):
|
||||
return render(req,'behavior.html')
|
||||
|
||||
@check_login
|
||||
def trainfigure(req):
|
||||
return render(req,'trainfigure.html')
|
||||
|
||||
@check_login
|
||||
def equipmentfigure(req):
|
||||
return render(req,'equipmentfigure.html')
|
||||
|
||||
@check_login
|
||||
def mainhtml(req):
|
||||
#计算一些数据
|
||||
userid = req.session['userid']
|
||||
|
|
@ -403,7 +403,6 @@ def login(req):
|
|||
if user.exists():
|
||||
if check_password(password,user[0].epassword):
|
||||
req.session['userid'] = user[0].userid
|
||||
req.session.set_expiry(60*40)
|
||||
return redirect('index')
|
||||
else:
|
||||
msg = '密码错误'
|
||||
|
|
@ -579,53 +578,48 @@ def getspr(ubp):
|
|||
|
||||
def getsprs(userid,ubp):
|
||||
currentpart=ubp
|
||||
a=getsprs_ubp(userid,currentpart)
|
||||
a=getsprs_ubp2(userid,currentpart)
|
||||
while a==False:
|
||||
currentpart=currentpart.parentid #已找不到上级部门
|
||||
if currentpart:
|
||||
a=getsprs_ubp(userid,currentpart)
|
||||
a=getsprs_ubp2(userid,currentpart)
|
||||
else:
|
||||
return User.objects.get(ubelongpart=currentpart,issuper=1)
|
||||
return a
|
||||
|
||||
def getsprs_ubp(userid,ubp):#主管和被授权人员
|
||||
def getsprs_ubp(userid,ubp):
|
||||
a=ubp
|
||||
# if a.aqy !=',':
|
||||
# aqystr = a.aqy
|
||||
# aqylist = aqystr.split(',')
|
||||
# aqylist = list(map(int, list(filter(None, aqylist))))
|
||||
# if userid in aqylist:
|
||||
# return [userid]
|
||||
# else:
|
||||
# if ',' + str(userid) + ',' in a.bmzg:
|
||||
# return [userid]
|
||||
# else:
|
||||
# return aqylist
|
||||
if a.aqy !=',':
|
||||
aqystr = a.aqy
|
||||
aqylist = aqystr.split(',')
|
||||
aqylist = list(map(int, list(filter(None, aqylist))))
|
||||
if userid in aqylist:
|
||||
return [userid]
|
||||
else:
|
||||
if ',' + str(userid) + ',' in a.bmzg:
|
||||
return [userid]
|
||||
else:
|
||||
return aqylist
|
||||
if a.bmzg !=',':
|
||||
zgstr = a.bmzg
|
||||
zglist = zgstr.split(',')
|
||||
zglist = list(map(int, list(filter(None, zglist))))
|
||||
bsqstr = a.bsq
|
||||
bsqlist = list(map(int, list(filter(None, bsqstr.split(',')))))
|
||||
if userid in zglist:
|
||||
return [userid]
|
||||
elif userid in bsqlist:
|
||||
zglist.append(userid)
|
||||
return zglist
|
||||
else:
|
||||
return zglist
|
||||
else:
|
||||
return False
|
||||
|
||||
# def getsprs_ubp2(userid,ubp):
|
||||
# a=ubp
|
||||
# if a.aqy !=',' or a.bmzg !=',':
|
||||
# allstr = a.aqy + a.bmzg
|
||||
# alllist = allstr.split(',')
|
||||
# alist = list(map(int, list(filter(None, alllist))))
|
||||
# return alist
|
||||
# else:
|
||||
# return False
|
||||
def getsprs_ubp2(userid,ubp):
|
||||
a=ubp
|
||||
if a.aqy !=',' or a.bmzg !=',':
|
||||
allstr = a.aqy + a.bmzg
|
||||
alllist = allstr.split(',')
|
||||
alist = list(map(int, list(filter(None, alllist))))
|
||||
return alist
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
def menutree(req):
|
||||
|
|
@ -1361,7 +1355,7 @@ def getdickey(req):
|
|||
if req.GET.get('dicclass')=='33':
|
||||
for i in a:
|
||||
objs = Operationspjd.objects.filter(zylx=Dickey.objects.get(dickeyid=i['dickeyid']),usecomp=Partment.objects.get(partid=companyid))
|
||||
str='作业负责人-作业部门-属地部门'
|
||||
str='作业负责人-作业部门安全员-属地部门安全员'
|
||||
for x in objs:
|
||||
str = str + '-' + x.jdmc
|
||||
i['splcdetail'] = str
|
||||
|
|
@ -1736,7 +1730,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('-fxsj')[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')
|
||||
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']
|
||||
|
|
@ -2587,7 +2581,7 @@ def pxhandle(req):
|
|||
a = a.filter(starttime__lte=jssj)
|
||||
total=a.count()
|
||||
startnum,endnum=fenye(req)
|
||||
obj=a.order_by('-starttime')[startnum:endnum].values('trainnum','trainid','state','trainplace','starttime','trainname','traintype__dickeyname','teacher','lecturer__name','submituser__name','submituser__userid')
|
||||
obj=a.order_by('-modifytime')[startnum:endnum].values('trainnum','trainid','state','trainplace','starttime','trainname','traintype__dickeyname','teacher','lecturer__name','submituser__name','submituser__userid')
|
||||
return HttpResponse(transjson(total,obj),content_type="application/json")
|
||||
elif req.GET.get('a')=='detailhtml':
|
||||
trainid = req.GET.get('trainid')
|
||||
|
|
@ -2793,7 +2787,7 @@ def ylhandle(req):
|
|||
a = a.filter(starttime__lte=jssj)
|
||||
total=a.count()
|
||||
startnum,endnum=fenye(req)
|
||||
obj=a.order_by('-starttime')[startnum:endnum].values('drillnum','drillid','state','drillplace','starttime','drillname','drilltype__dickeyname','chief__name','submituser__name','submituser__userid')
|
||||
obj=a.order_by('-modifytime')[startnum:endnum].values('drillnum','drillid','state','drillplace','starttime','drillname','drilltype__dickeyname','chief__name','submituser__name','submituser__userid')
|
||||
return HttpResponse(transjson(total,a),content_type="application/json")
|
||||
|
||||
def gchandle(req):
|
||||
|
|
@ -3201,7 +3195,7 @@ def importusers(req):
|
|||
|
||||
@apicheck_login
|
||||
def apicompany(req):
|
||||
if int(req.session.get('userid'))==8:
|
||||
if int(request.session.get('userid'))==8:
|
||||
a = req.GET.get('a')
|
||||
menurights = '11,1,2,3,4,5,6,7,8,9,10,12,13,15,16,17,18,19,20,21,22,23,24,28,29,32,36,46,47,48,50'#菜单编码
|
||||
if a=='add':
|
||||
|
|
@ -3907,7 +3901,7 @@ def apisuggest(req):
|
|||
if req.GET.get('jssj'):
|
||||
a = a.filter(submittime__lte=req.GET.get('jssj'))
|
||||
total = a.count()
|
||||
a = a.order_by('-submittime')[startnum:endnum].values('jyid','jylb__dickeyname','jyr__name','jybm__partname','dqxz','jynr','jynum','jyzt','todouser__userid','todouser__name','jyqy__name','jydd','submittime','accept')
|
||||
a = a[startnum:endnum].values('jyid','jylb__dickeyname','jyr__name','jybm__partname','dqxz','jynr','jynum','jyzt','todouser__userid','todouser__name','jyqy__name','jydd','submittime','accept')
|
||||
return HttpResponse(transjson(total,a),content_type="application/json")
|
||||
elif a == 'exportexcel':
|
||||
userid = req.session['userid']
|
||||
|
|
@ -4165,13 +4159,6 @@ def apitool(req):
|
|||
i.epassword = make_password(i.password)
|
||||
i.save()
|
||||
return JsonResponse({"code":1})
|
||||
elif a == 'correct_operation':
|
||||
for i in Operation.objects.all():
|
||||
if i.zyzt['zyzt'] == '待关闭' or i.zyzt['zyzt'] == '已关闭':
|
||||
if 'jdmc' in i.zyzt:
|
||||
i.zyzt['jdmc'] =''
|
||||
i.save()
|
||||
return JsonResponse({"code":1})
|
||||
|
||||
|
||||
|
||||
|
|
@ -4365,7 +4352,6 @@ def apinotice(req):
|
|||
|
||||
def apioperation(req):
|
||||
a = req.GET.get('a')
|
||||
userid = req.session['userid']
|
||||
if a == 'add':
|
||||
userid = req.session['userid']
|
||||
oneuser = User.objects.get(userid=userid)
|
||||
|
|
@ -4389,9 +4375,9 @@ def apioperation(req):
|
|||
obj.zyzt = {'zyzt':'确认中','index':0}
|
||||
obj.save()
|
||||
splc = []
|
||||
splc.append({'jdmc':'作业负责人审批','sprs':[userid]})
|
||||
splc.append({'jdmc':'作业部门审批','sprs':getsprs(userid,obj.zybm)})
|
||||
splc.append({'jdmc':'属地部门审批','sprs':getsprs(userid,obj.sdbm)})
|
||||
splc.append({'jdmc':'作业负责人','sprs':[userid]})
|
||||
splc.append({'jdmc':'作业部门审批中','sprs':getsprs(userid,obj.zybm)})
|
||||
splc.append({'jdmc':'属地部门审批中','sprs':getsprs(userid,obj.sdbm)})
|
||||
for i in Operationspjd.objects.filter(zylx=obj.zylx,usecomp=Partment.objects.get(partid=getcompany(userid))).order_by('id'):
|
||||
splc.append({'jdmc':i.jdmc,'sprs':i.sprs})
|
||||
obj.zyzt['splc']=splc
|
||||
|
|
@ -4400,50 +4386,7 @@ def apioperation(req):
|
|||
b=[]#发送通知
|
||||
for i in data['zyry']:
|
||||
x=User.objects.get(userid=i)
|
||||
if int(userid)==int(i):#申请人包含作业人直接确认
|
||||
m = Operzyry.objects.create(oper=obj,operzyry=x,checked=1)
|
||||
if Operzyry.objects.filter(oper=obj,checked=0).exists():
|
||||
pass
|
||||
else:#工作人员全部确认
|
||||
obj.zyzt['zyzt'] = '审批中'
|
||||
obj.zyzt['index'] = 0
|
||||
index = obj.zyzt['index']
|
||||
sprs = [] #初始化审批人列表
|
||||
if 'sprs' in obj.zyzt['splc'][index]:
|
||||
sprs = obj.zyzt['splc'][index]['sprs']
|
||||
else:
|
||||
sprs = [obj.zyzt['splc'][index]['spr']]
|
||||
jdmc = obj.zyzt['splc'][index]['jdmc']
|
||||
obj.zyzt['jdmc'] = jdmc
|
||||
obj.todousers = sprs
|
||||
obj.save()
|
||||
postdict={
|
||||
'touser':'',
|
||||
'template_id':'lOuwSE67vZC3ZVFYPZvz2eb7JdFxqx7ysMFkXrYmYh0',
|
||||
'miniprogram':{'appid':'wx5c39b569f01c27db'},
|
||||
'data':{
|
||||
'first':{
|
||||
'value':obj.zylx.dickeyname + '作业审批,审批节点:' + obj.zyzt['jdmc']
|
||||
},
|
||||
'keyword1':{
|
||||
'value':obj.zynr
|
||||
},
|
||||
'keyword2':{
|
||||
'value':obj.kssj
|
||||
},
|
||||
'keyword3':{
|
||||
'value':obj.zydd
|
||||
},
|
||||
'remark':{
|
||||
'value':'请您及时完成审批!'
|
||||
}
|
||||
}
|
||||
}
|
||||
tolist = list(User.objects.filter(userid__in=sprs).values_list('openid',flat=True))
|
||||
send_wechatmsgs.delay(postdict,tolist)
|
||||
return JsonResponse({"code":1})
|
||||
else:
|
||||
m = Operzyry.objects.create(oper=obj,operzyry=x)
|
||||
m = Operzyry(oper=obj,operzyry=x)
|
||||
m.save()
|
||||
b.append(x.openid)
|
||||
|
||||
|
|
@ -4516,8 +4459,6 @@ def apioperation(req):
|
|||
zyid=req.GET.get('zyid')
|
||||
a = Operation.objects.filter(zyid=zyid)
|
||||
x = a.values('zyid','zydd','zylx__dickeyname','zynum','zyfzr__name','zynr','zyzt','zyimg','submittime','zybm__partname','sdbm__partname','kssj','jssj','fxcs','zyimg2')[0]
|
||||
for i in x['zyzt']['splc']:
|
||||
i['sprs'] = ','.join(list(User.objects.filter(userid__in=i['sprs']).values_list('name',flat=True)))
|
||||
if x['zyimg']!='':
|
||||
x['zyimg'] = x['zyimg'].split('?')
|
||||
else:
|
||||
|
|
@ -4528,10 +4469,8 @@ def apioperation(req):
|
|||
x['zyimg2']=[]
|
||||
x['fxcs'] = list(Fxcs.objects.filter(id__in=x['fxcs'].split('?')).values('id','fxfx','aqcs','cslx'))
|
||||
#确认详情
|
||||
qrxqobjs = Operzyry.objects.filter(oper=Operation.objects.get(zyid=zyid))
|
||||
qrxq = qrxqobjs.values('operzyry__name','checked')
|
||||
qrxq = Operzyry.objects.filter(oper=Operation.objects.get(zyid=zyid)).values('operzyry__name','checked')
|
||||
x['qrxq'] = list(qrxq)
|
||||
x['zyry'] = ','.join(list(qrxqobjs.values_list('operzyry__name',flat=True)))
|
||||
#审批详情
|
||||
spxq = Operspxq.objects.filter(oper=Operation.objects.get(zyid=zyid)).order_by('submittime').values('jdmc','spbm__partname','spr__name','submittime','checked')
|
||||
x['spxq'] = list(spxq)
|
||||
|
|
@ -4544,32 +4483,30 @@ def apioperation(req):
|
|||
userid = req.session['userid']
|
||||
data = json.loads(req.body.decode('utf-8'))
|
||||
zyid = data['zyid']
|
||||
obj = Operation.objects.get(zyid=zyid)
|
||||
Operzyry.objects.filter(oper__zyid=zyid,operzyry__userid=userid).update(checked=1)
|
||||
if Operzyry.objects.filter(oper__zyid=zyid,checked=0).exists():
|
||||
pass
|
||||
else:#工作人员全部确认
|
||||
else:
|
||||
obj = Operation.objects.get(zyid=zyid)
|
||||
nowzt = obj.zyzt
|
||||
obj.zyzt['zyzt'] = '审批中'
|
||||
obj.zyzt['index'] = 0
|
||||
index = obj.zyzt['index']
|
||||
spruser = User.objects.get(userid=userid)
|
||||
sprs = [] #初始化审批人列表
|
||||
obj.zyzt['jdmc'] = obj.zyzt['splc'][index]['jdmc']
|
||||
if 'sprs' in obj.zyzt['splc'][index]:
|
||||
sprs = obj.zyzt['splc'][index]['sprs']
|
||||
else:
|
||||
sprs = [obj.zyzt['splc'][index]['spr']]
|
||||
jdmc = obj.zyzt['splc'][index]['jdmc']
|
||||
obj.zyzt['jdmc'] = jdmc
|
||||
obj.todousers = sprs
|
||||
obj.save()
|
||||
postdict={
|
||||
for i in sprs:
|
||||
postdict={
|
||||
'touser':'',
|
||||
'template_id':'lOuwSE67vZC3ZVFYPZvz2eb7JdFxqx7ysMFkXrYmYh0',
|
||||
'miniprogram':{'appid':'wx5c39b569f01c27db'},
|
||||
'template_id':User.objects.get(userid=i).openid,
|
||||
"miniprogram":{"appid":"wx5c39b569f01c27db"},
|
||||
'data':{
|
||||
'first':{
|
||||
'value':obj.zylx.dickeyname + '作业审批,审批节点:' + obj.zyzt['jdmc']
|
||||
'value':obj.zylx.dickeyname + '作业审批:'
|
||||
},
|
||||
'keyword1':{
|
||||
'value':obj.zynr
|
||||
|
|
@ -4585,83 +4522,30 @@ def apioperation(req):
|
|||
}
|
||||
}
|
||||
}
|
||||
tolist = list(User.objects.filter(userid__in=sprs).values_list('openid',flat=True))
|
||||
send_wechatmsgs.delay(postdict,tolist)
|
||||
return JsonResponse({"code":1})
|
||||
send_wechatmsg.delay(postdict)
|
||||
return JsonResponse({"code":1})
|
||||
elif a == 'spzy':
|
||||
userid = req.session['userid']
|
||||
data = json.loads(req.body.decode('utf-8'))
|
||||
zyid = data['zyid']
|
||||
obj = Operation.objects.get(zyid=zyid)
|
||||
oldtodo = obj.todousers
|
||||
oldjdmc = obj.zyzt['jdmc']
|
||||
oldindex = obj.zyzt['index']
|
||||
nextindex = obj.zyzt['index']+1
|
||||
spruser = User.objects.get(userid=userid)
|
||||
if oldindex == 0:
|
||||
Operspxq.objects.create(oper=obj,jdmc=obj.zyzt['splc'][0]['jdmc'],spr=spruser,checked=1,spbm=spruser.ubelongpart)
|
||||
spr1 = data['spr1'] if 'spr1' in data else None
|
||||
spr2 = data['spr2'] if 'spr2' in data else None
|
||||
if spr1:
|
||||
obj.zyzt['splc'][1]['sprs'] = [spr1] #作业部门审批人
|
||||
if spr2:
|
||||
obj.zyzt['splc'][2]['sprs'] = [spr2] #属地部门审批人
|
||||
while nextindex<len(obj.zyzt['splc']):
|
||||
nextsplc = obj.zyzt['splc'][nextindex]
|
||||
if userid in nextsplc['sprs']:#本人可审批直接跳过
|
||||
Operspxq.objects.create(oper=obj,jdmc=nextsplc['jdmc'],spr=spruser,checked=1,spbm=spruser.ubelongpart)
|
||||
else:
|
||||
obj.zyzt['zyzt'] = '审批中'
|
||||
obj.zyzt['index'] = nextindex
|
||||
obj.zyzt['jdmc'] = nextsplc['jdmc']
|
||||
obj.todousers = nextsplc['sprs']
|
||||
obj.save()
|
||||
tolist = list(User.objects.filter(userid__in=nextsplc['sprs']).values_list('openid',flat=True))
|
||||
toliststr = ','.join(list(User.objects.filter(userid__in=nextsplc['sprs']).values_list('name',flat=True)))
|
||||
postdict={
|
||||
'touser':'',
|
||||
'template_id':'lOuwSE67vZC3ZVFYPZvz2eb7JdFxqx7ysMFkXrYmYh0',
|
||||
'miniprogram':{'appid':'wx5c39b569f01c27db'},
|
||||
'data':{
|
||||
'first':{
|
||||
'value':obj.zylx.dickeyname + '作业审批,审批节点:' + obj.zyzt['jdmc']
|
||||
},
|
||||
'keyword1':{
|
||||
'value':obj.zynr
|
||||
},
|
||||
'keyword2':{
|
||||
'value':obj.kssj
|
||||
},
|
||||
'keyword3':{
|
||||
'value':obj.zydd
|
||||
},
|
||||
'remark':{
|
||||
'value':'请您及时完成审批!可审批人:'+toliststr
|
||||
}
|
||||
}
|
||||
}
|
||||
send_wechatmsgs.delay(postdict,tolist)
|
||||
return JsonResponse({"code":1})
|
||||
nextindex = nextindex + 1
|
||||
if 'zjsp' in data:#转交上级审批
|
||||
if spruser.ubelongpart.parentid:
|
||||
newsprs = getsprs(userid,spruser.ubelongpart.parentid)
|
||||
else:
|
||||
newsprs = getsprs(userid,spruser.usecomp)
|
||||
#newsprs = data['newsprs']#新审批人
|
||||
obj.zyzt['jdmc'] = '上级审批'
|
||||
obj.zyzt['index'] = nextindex
|
||||
obj.todousers = newsprs
|
||||
obj.zyzt['splc'].insert(nextindex,{'jdmc':'上级审批','sprs':newsprs})
|
||||
if 'zzsp' in data:#关闭审批
|
||||
obj.zyzt['zyzt'] = '待关闭'
|
||||
obj.todouser = obj.zyfzr
|
||||
obj.todousers = None
|
||||
obj.save()
|
||||
tolist = list(User.objects.filter(userid__in=newsprs).values_list('openid',flat=True))
|
||||
toliststr = ','.join(list(User.objects.filter(userid__in=newsprs).values_list('name',flat=True)))
|
||||
Operspxq.objects.create(oper=Operation.objects.get(zyid=zyid),jdmc=oldjdmc,spr=spruser,checked=1,spbm=spruser.ubelongpart)
|
||||
postdict={
|
||||
'touser':'',
|
||||
'template_id':'lOuwSE67vZC3ZVFYPZvz2eb7JdFxqx7ysMFkXrYmYh0',
|
||||
'miniprogram':{'appid':'wx5c39b569f01c27db'},
|
||||
'template_id':obj.zyfzr.openid,
|
||||
"miniprogram":{"appid":"wx5c39b569f01c27db"},
|
||||
'data':{
|
||||
'first':{
|
||||
'value':obj.zylx.dickeyname + '作业审批,审批节点:' + obj.zyzt['jdmc']
|
||||
'value':obj.zylx.dickeyname + '作业审批通过:'
|
||||
},
|
||||
'keyword1':{
|
||||
'value':obj.zynr
|
||||
|
|
@ -4673,43 +4557,104 @@ def apioperation(req):
|
|||
'value':obj.zydd
|
||||
},
|
||||
'remark':{
|
||||
'value':'请您及时完成审批!可审批人:'+toliststr
|
||||
'value':'你是作业负责人,可以开始作业,作业完成请及时关闭!'
|
||||
}
|
||||
}
|
||||
}
|
||||
send_wechatmsgs.delay(postdict,tolist)
|
||||
Operspxq.objects.create(oper=obj,jdmc=obj.zyzt['splc'][nextindex-1]['jdmc'],spr=spruser,checked=2,spbm=spruser.ubelongpart)
|
||||
send_wechatmsg.delay(postdict)
|
||||
return JsonResponse({"code":1})
|
||||
obj.zyzt['zyzt'] = '待关闭'
|
||||
obj.zyzt['jdmc'] = ''
|
||||
obj.zyzt['index'] = nextindex
|
||||
obj.todouser = None
|
||||
obj.todousers = [obj.zyfzr.userid]
|
||||
obj.save()
|
||||
postdict={
|
||||
'touser':obj.zyfzr.openid,
|
||||
'template_id':'lOuwSE67vZC3ZVFYPZvz2eb7JdFxqx7ysMFkXrYmYh0',
|
||||
'miniprogram':{'appid':'wx5c39b569f01c27db'},
|
||||
'data':{
|
||||
'first':{
|
||||
'value':obj.zylx.dickeyname + '作业审批通过:'
|
||||
},
|
||||
'keyword1':{
|
||||
'value':obj.zynr
|
||||
},
|
||||
'keyword2':{
|
||||
'value':obj.kssj
|
||||
},
|
||||
'keyword3':{
|
||||
'value':obj.zydd
|
||||
},
|
||||
'remark':{
|
||||
'value':'你是作业负责人,可以开始作业,作业完成请及时关闭!'
|
||||
if 'zjsp' in data:#转交审批
|
||||
newsprs = data['newsprs']#新审批人
|
||||
obj.todousers = newsprs
|
||||
obj.save()
|
||||
for i in newsprs:
|
||||
postdict={
|
||||
'touser':'',
|
||||
'template_id':User.objects.get(userid=i).openid,
|
||||
"miniprogram":{"appid":"wx5c39b569f01c27db"},
|
||||
'data':{
|
||||
'first':{
|
||||
'value':obj.zylx.dickeyname + '作业审批:'
|
||||
},
|
||||
'keyword1':{
|
||||
'value':obj.zynr
|
||||
},
|
||||
'keyword2':{
|
||||
'value':obj.kssj
|
||||
},
|
||||
'keyword3':{
|
||||
'value':obj.zydd
|
||||
},
|
||||
'remark':{
|
||||
'value':'请您及时完成审批!'
|
||||
}
|
||||
}
|
||||
}
|
||||
send_wechatmsg.delay(postdict)
|
||||
Operspxq.objects.create(oper=Operation.objects.get(zyid=zyid),jdmc=oldjdmc,spr=spruser,checked=2,spbm=spruser.ubelongpart)
|
||||
return JsonResponse({"code":1})
|
||||
try:
|
||||
nextsplc = obj.zyzt['splc'][nextindex]
|
||||
obj.zyzt['zyzt'] = '审批中'
|
||||
obj.zyzt['index'] = nextindex
|
||||
obj.zyzt['jdmc'] = nextsplc['jdmc']
|
||||
obj.todousers = nextsplc['sprs']
|
||||
obj.save()
|
||||
for i in nextsplc['sprs']:
|
||||
postdict={
|
||||
'touser':'',
|
||||
'template_id':User.objects.get(userid=i).openid,
|
||||
"miniprogram":{"appid":"wx5c39b569f01c27db"},
|
||||
'data':{
|
||||
'first':{
|
||||
'value':obj.zylx.dickeyname + '作业审批:'
|
||||
},
|
||||
'keyword1':{
|
||||
'value':obj.zynr
|
||||
},
|
||||
'keyword2':{
|
||||
'value':obj.kssj
|
||||
},
|
||||
'keyword3':{
|
||||
'value':obj.zydd
|
||||
},
|
||||
'remark':{
|
||||
'value':'请您及时完成审批!'
|
||||
}
|
||||
}
|
||||
}
|
||||
send_wechatmsg.delay(postdict)
|
||||
|
||||
Operspxq.objects.create(oper=Operation.objects.get(zyid=zyid),jdmc=oldjdmc,spr=spruser,checked=1,spbm=spruser.ubelongpart)
|
||||
except :
|
||||
obj.zyzt['zyzt'] = '待关闭'
|
||||
obj.todouser = None
|
||||
obj.todousers = [obj.zyfzr.userid]
|
||||
obj.save()
|
||||
Operspxq.objects.create(oper=Operation.objects.get(zyid=zyid),jdmc=oldjdmc,spr=spruser,checked=1,spbm=spruser.ubelongpart)
|
||||
postdict={
|
||||
'touser':'',
|
||||
'template_id':obj.zyfzr.openid,
|
||||
"miniprogram":{"appid":"wx5c39b569f01c27db"},
|
||||
'data':{
|
||||
'first':{
|
||||
'value':obj.zylx.dickeyname + '作业审批通过:'
|
||||
},
|
||||
'keyword1':{
|
||||
'value':obj.zynr
|
||||
},
|
||||
'keyword2':{
|
||||
'value':obj.kssj
|
||||
},
|
||||
'keyword3':{
|
||||
'value':obj.zydd
|
||||
},
|
||||
'remark':{
|
||||
'value':'你是作业负责人,可以开始作业,作业完成请及时关闭!'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Operspxq.objects.create(oper=obj,jdmc=obj.zyzt['splc'][nextindex-1]['jdmc'],spr=spruser,checked=1,spbm=spruser.ubelongpart)
|
||||
send_wechatmsg.delay(postdict)
|
||||
send_wechatmsg.delay(postdict)
|
||||
return JsonResponse({"code":1})
|
||||
elif a == 'gbzy':#关闭作业
|
||||
data = json.loads(req.body.decode('utf-8'))
|
||||
|
|
@ -4719,7 +4664,6 @@ def apioperation(req):
|
|||
obj = Operation.objects.get(zyid=zyid)
|
||||
obj.zyimg2 = '?'.join(zyimg2)
|
||||
obj.zyzt['zyzt']='已关闭'
|
||||
obj.zyzt['jdmc']=''
|
||||
obj.todouser = None
|
||||
obj.todousers = None
|
||||
obj.save()
|
||||
|
|
@ -5332,18 +5276,30 @@ def apiexamtestdetail(req):
|
|||
obj = ExamTestDetail.objects.filter(id=id)
|
||||
data = obj.values('id','starttime','took','score','passcode','testdetail','examtest__name','user__headimgurl','user__name')[0]
|
||||
return JsonResponse(data)
|
||||
|
||||
elif a=='updateison':
|
||||
id = req.GET.get('id')
|
||||
examdlid = req.GET.get('examdlid')
|
||||
user = User.objects.get(userid=userid)
|
||||
a = ExamTest.objects.get(id=id)
|
||||
if a.createuser==user:
|
||||
objss = ExamTestDetail.objects.get(id=examdlid)
|
||||
objss.ison=0
|
||||
objss.testnum=objss.testnum+1
|
||||
objss.save()
|
||||
return JsonResponse({"code":1,"message":"发布成功!"})
|
||||
else:
|
||||
return JsonResponse({"code":2,"message":"您没有发布权限!"})
|
||||
def apitrain(req):
|
||||
if req.GET.get('a')=='listjoin':
|
||||
userid = req.session['userid']
|
||||
objs = Trainuser.objects.filter(train__deletemark=1)
|
||||
objs = Trainuser.objects
|
||||
if req.GET.get('sry'):
|
||||
objs = objs.filter(participant__userid=req.GET.get('sry'))
|
||||
else:
|
||||
objs = objs.filter(participant__userid=userid)
|
||||
total= objs.count()
|
||||
startnum,endnum=fenye(req)
|
||||
objs=objs[startnum:endnum].values('train__trainnum','train__trainid','train__state','train__trainplace','train__starttime','train__trainname','train__teacher','train__lecturer__name','participant__name','participant__name','checked','train__duration','examtestdetail')
|
||||
objs=objs[startnum:endnum].values('train__trainnum','train__trainid','train__state','train__trainplace','train__starttime','train__trainname','train__teacher','train__lecturer__name','participant__name','participant__name','checked')
|
||||
return HttpResponse(transjson(total,objs),content_type="application/json")
|
||||
|
||||
def apiquestioncat(req):
|
||||
|
|
@ -5597,7 +5553,7 @@ def apiinspect(req):
|
|||
a = a.filter(state=state)
|
||||
total=a.count()
|
||||
startnum,endnum=fenye(req)
|
||||
a = a.order_by('-creattime')[startnum:endnum].values('id','state','content','creattime','equipment__num','equipment__name','equipment__area__name','user__name','user__ubelongpart__partname','trouble__yhzt','trouble__yhnum','trouble__yhms')
|
||||
a = a.order_by('-id')[startnum:endnum].values('id','state','content','creattime','equipment__num','equipment__name','equipment__area__name','user__name','user__ubelongpart__partname','trouble__yhzt','trouble__yhnum','trouble__yhms')
|
||||
return HttpResponse(transjson(total,a),content_type="application/json")
|
||||
elif a == 'exportexcel':
|
||||
objs = Inspect.objects.filter(usecomp__partid=companyid)
|
||||
|
|
|
|||
Loading…
Reference in New Issue