隐患、建议布茨纳
This commit is contained in:
parent
e4d32db4d2
commit
fcea021379
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 2.1.5 on 2019-09-25 11:13
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('safesite', '0270_auto_20190920_1200'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='trouble',
|
||||
name='shresult',
|
||||
field=models.IntegerField(blank=True, choices=[(1, '通过'), (2, '审核未通过'), (3, '复查未通过'), (4, '已修改'), (5, '评估未通过'), (6, '未采纳')], null=True),
|
||||
),
|
||||
]
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 2.1.5 on 2019-09-25 16:57
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('safesite', '0271_auto_20190925_1113'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='suggest',
|
||||
name='accept',
|
||||
field=models.IntegerField(default=1),
|
||||
),
|
||||
]
|
|
@ -120,6 +120,7 @@ class Trouble(models.Model):#隐患排查
|
|||
(3, '复查未通过'),
|
||||
(4, '已修改'),
|
||||
(5,'评估未通过'),
|
||||
(6,'未采纳'),
|
||||
)
|
||||
deletemark=models.IntegerField(default='1')
|
||||
troubleid = models.AutoField(primary_key=True)
|
||||
|
@ -409,6 +410,7 @@ class Suggest(models.Model):#合理化建议
|
|||
yjwcsj = models.DateTimeField(null=True,blank=True) #预计完成时间
|
||||
sjwcsj = models.DateTimeField(null=True,blank=True) #实际完成时间
|
||||
shyj = models.CharField(max_length=1000,null=True,blank=True) #审核意见
|
||||
accept = models.IntegerField(default=1)
|
||||
|
||||
class Suggestflow(models.Model):#建议流程
|
||||
id = models.AutoField(primary_key=True)
|
||||
|
|
|
@ -116,12 +116,13 @@
|
|||
{ field: 'todouser__userid', hidden: true },
|
||||
{ field: 'sybzt', hidden: true },
|
||||
{
|
||||
field: 'shresult', title: '整改结果状态', width: 100, styler: function (value, row, index) {
|
||||
field: 'shresult', title: '隐患状态', width: 100, styler: function (value, row, index) {
|
||||
switch (value) {
|
||||
case 1: return ''; break;
|
||||
case 2: return 'background-color:red;'; break;
|
||||
case 3: return 'background-color:red;'; break;
|
||||
case 4: return 'background-color:yellow;'; break;
|
||||
case 6: return 'background-color:yellow;'; break;
|
||||
}
|
||||
}, formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
|
@ -130,6 +131,7 @@
|
|||
case 3: return '复查未通过'; break;
|
||||
case 4: return '已修改'; break;
|
||||
case 5: return '评估未通过'; break;
|
||||
case 6: return '未采纳'; break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -945,29 +945,55 @@ def accessyh(req):
|
|||
return JsonResponse({"code":1})
|
||||
elif a.yhzt==1:
|
||||
if yhdata['shresult'] == 'reject':
|
||||
a.shresult = 5
|
||||
a.yhzt = 0
|
||||
a.sybzt = 1
|
||||
a.todouser = a.fxr
|
||||
a.pgyj = yhdata['pgyj']
|
||||
a.save()
|
||||
m=TroubleAccess(troubleid=a,clr=a.pgr,yhzt=0,action='请'+a.fxr.name+'重新填报',result=0)
|
||||
m.save()
|
||||
postdict={
|
||||
'touser':'oPGqkweX75QtLmgehUN-ipR4hcyc',
|
||||
'template_id':'lOuwSE67vZC3ZVFYPZvz2eb7JdFxqx7ysMFkXrYmYh0',
|
||||
"miniprogram":{"appid":"wx5c39b569f01c27db","path":"pages/trouble/accesstrouble?troubleid="+str(a.troubleid)},
|
||||
'data':{
|
||||
'first':{'value':a.yhdj.dickeyname + '被退出需重新上报:'},
|
||||
'keyword1':{'value':a.yhms},
|
||||
'keyword2':{'value':a.fxsj},
|
||||
'keyword3':{'value':a.yhdd},
|
||||
'remark':{'value':'请查看评估意见并修改后上传。'}
|
||||
if 'accept' in yhdata:
|
||||
if yhdata['accept'] == 'no':
|
||||
a.shresult = 6
|
||||
a.yhzt = 6
|
||||
a.sybzt = 1
|
||||
a.todouser = None
|
||||
a.pgyj = yhdata['pgyj']
|
||||
a.save()
|
||||
m=TroubleAccess(troubleid=a,clr=a.pgr,yhzt=6,action='未采纳',opinion=yhdata['pgyj'])
|
||||
m.save()
|
||||
postdict={
|
||||
'touser':'oPGqkweX75QtLmgehUN-ipR4hcyc',
|
||||
'template_id':'lOuwSE67vZC3ZVFYPZvz2eb7JdFxqx7ysMFkXrYmYh0',
|
||||
"miniprogram":{"appid":"wx5c39b569f01c27db","path":"pages/trouble/accesstrouble?troubleid="+str(a.troubleid)},
|
||||
'data':{
|
||||
'first':{'value':a.yhdj.dickeyname + '未被采纳:'},
|
||||
'keyword1':{'value':a.yhms},
|
||||
'keyword2':{'value':a.fxsj},
|
||||
'keyword3':{'value':a.yhdd},
|
||||
'remark':{'value':'请查看未采纳原因'}
|
||||
}
|
||||
}
|
||||
postdict['touser']=a.fxr.openid
|
||||
send_wechatmsg.delay(postdict)
|
||||
return JsonResponse({"code":1})
|
||||
else:
|
||||
a.shresult = 5
|
||||
a.yhzt = 0
|
||||
a.sybzt = 1
|
||||
a.todouser = a.fxr
|
||||
a.pgyj = yhdata['pgyj']
|
||||
a.save()
|
||||
m=TroubleAccess(troubleid=a,clr=a.pgr,yhzt=0,action='请'+a.fxr.name+'重新填报',result=0)
|
||||
m.save()
|
||||
postdict={
|
||||
'touser':'oPGqkweX75QtLmgehUN-ipR4hcyc',
|
||||
'template_id':'lOuwSE67vZC3ZVFYPZvz2eb7JdFxqx7ysMFkXrYmYh0',
|
||||
"miniprogram":{"appid":"wx5c39b569f01c27db","path":"pages/trouble/accesstrouble?troubleid="+str(a.troubleid)},
|
||||
'data':{
|
||||
'first':{'value':a.yhdj.dickeyname + '被退出需重新上报:'},
|
||||
'keyword1':{'value':a.yhms},
|
||||
'keyword2':{'value':a.fxsj},
|
||||
'keyword3':{'value':a.yhdd},
|
||||
'remark':{'value':'请查看评估意见并修改后上传。'}
|
||||
}
|
||||
}
|
||||
}
|
||||
postdict['touser']=a.todouser.openid
|
||||
send_wechatmsg.delay(postdict)
|
||||
return JsonResponse({"code":1})
|
||||
postdict['touser']=a.todouser.openid
|
||||
send_wechatmsg.delay(postdict)
|
||||
return JsonResponse({"code":1})
|
||||
elif 'zppg' in yhdata and yhdata['zppg']=='yes':
|
||||
a.yhzt=1
|
||||
a.sybzt=1
|
||||
|
@ -2551,9 +2577,10 @@ def gchandle(req):
|
|||
if 'unsafe' in gcdata:
|
||||
olist = gcdata['unsafe']
|
||||
for i in olist:
|
||||
dickey = Dickey.objects.get(dickeyid=i)
|
||||
m = Unsafes(observe = obj,unsafedickey=dickey,unsafedicclass=dickey.dicparent)
|
||||
m.save()
|
||||
if i != 0:
|
||||
dickey = Dickey.objects.get(dickeyid=i)
|
||||
m = Unsafes(observe = obj,unsafedickey=dickey,unsafedicclass=dickey.dicparent)
|
||||
m.save()
|
||||
yjjs_gc.delay(companyid)
|
||||
return JsonResponse({"code":1})
|
||||
elif a == 'listall':
|
||||
|
@ -3692,11 +3719,23 @@ def apitool(req):
|
|||
newpart = req.GET.get('part')
|
||||
username = req.GET.get('username')
|
||||
user = User.objects.get(username=username)
|
||||
oldpart = user.ubelongpart
|
||||
oldpart.aqy = oldpart.aqy.replace(','+str(user.userid)+',','')
|
||||
oldpart.bmzg = oldpart.bmzg.replace(','+str(user.userid)+',','')
|
||||
oldpart.bsq = oldpart.bsq.replace(','+str(user.userid)+',','')
|
||||
oldpart.save()
|
||||
part = Partment.objects.get(partid=newpart)
|
||||
companyid = part.partlink.split(',')[1]
|
||||
if part.iscompany==1:
|
||||
usecomp = part
|
||||
else:
|
||||
usecomp = Partment.objects.get(partid=part.partlink.split(',')[1])
|
||||
user.ubelongpart = part
|
||||
user.usecomp = Partment.objects.get(partid=companyid)
|
||||
user.usecomp = usecomp
|
||||
user.save()
|
||||
for i in Group.objects.filter(usecomp=usecomp):
|
||||
i.users.remove(user)
|
||||
groupobj = Group.objects.filter(usecomp=usecomp,grouptype=3).first()
|
||||
groupobj.users.add(user)
|
||||
return JsonResponse({"code":1})
|
||||
elif a == 'correctionzs':
|
||||
objs = Socertificate.objects.all()
|
||||
|
|
Loading…
Reference in New Issue