shangchuren

This commit is contained in:
shilixia 2020-04-22 10:00:02 +08:00
parent 43142aac7a
commit a989bd1d5a
9 changed files with 132 additions and 70 deletions

View File

@ -0,0 +1,24 @@
# Generated by Django 2.2.8 on 2020-04-21 13:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('safesite', '0331_auto_20200414_1009'),
]
operations = [
migrations.AddField(
model_name='checkjob',
name='jctime',
field=models.DateTimeField(blank=True, null=True),
),
migrations.AlterField(
model_name='checkjob',
name='zgtime',
field=models.DateTimeField(blank=True, null=True),
),
]

View File

@ -1254,7 +1254,8 @@ class Checkjob(models.Model):
checktask=models.ForeignKey(Checktask,on_delete=models.CASCADE)#关联任务表 checktask=models.ForeignKey(Checktask,on_delete=models.CASCADE)#关联任务表
checkname=models.ForeignKey(User,related_name='jianchas',on_delete=models.CASCADE)#检查人员 checkname=models.ForeignKey(User,related_name='jianchas',on_delete=models.CASCADE)#检查人员
checkquestion=models.CharField(max_length=1000,null=True)#检查发现的问题 checkquestion=models.CharField(max_length=1000,null=True)#检查发现的问题
zgtime=models.DateTimeField(default = timezone.now)#整改期限 zgtime=models.DateTimeField(null=True, blank=True)#整改时间
jctime=models.DateTimeField(null=True, blank=True)#检查时间
zguser=models.ForeignKey(User,on_delete=models.CASCADE,null=True,)#整改人 zguser=models.ForeignKey(User,on_delete=models.CASCADE,null=True,)#整改人
createuser = models.ForeignKey(User,related_name='chuangjian',on_delete=models.CASCADE,null=True)#创建人 createuser = models.ForeignKey(User,related_name='chuangjian',on_delete=models.CASCADE,null=True)#创建人
createdate = models.DateTimeField(default = timezone.now)#创建时间 createdate = models.DateTimeField(default = timezone.now)#创建时间

View File

@ -282,7 +282,7 @@ def riskacttask():
@shared_task @shared_task
def checktask(): def checktask():
nowtime = datetime.datetime.now() nowtime = datetime.datetime.now()
for i in Checktask.objects.exclude(deletemark=0): for i in Checktask.objects.filter(deletemark=1):
if i.tasktype==1: if i.tasktype==1:
if i.checktime: if i.checktime:

View File

@ -13,8 +13,21 @@
<tr> <tr>
<td style="font-weight: bold;">检查表名:</td> <td style="font-weight: bold;">检查表名:</td>
<td>{{checktype__checktitle}}</td> <td>{{checktype__checktitle}}</td>
<td style="font-weight: bold;">检查时间:</td> <td style="font-weight: bold;">排查频率:</td>
<td>{{checktime| dateFormat 'yyyy-MM-dd hh:mm:ss'}}</td> {{if tasktype==1}}
<td>每天一次</td>
{{else if tasktype==2}}
<td>每周一次</td>
{{else if tasktype==3}}
<td>每月一次</td>
{{else if tasktype==4}}
<td>每季度一次</td>
{{else if tasktype==5}}
<td>每半年一次</td>
{{else if tasktype==6}}
<td>每年一次</td>
{{/if}}
</tr> </tr>
<tr style="height:80px"> <tr style="height:80px">
@ -30,20 +43,8 @@
<td>{{zxstate==1?'同时执行':'单人执行'}}</td> <td>{{zxstate==1?'同时执行':'单人执行'}}</td>
<td style="font-weight: bold;">排查频率:</td> <td style="font-weight: bold;">更新时间:</td>
{{if tasktype==1}} <td>{{checktime| dateFormat 'yyyy-MM-dd hh:mm:ss'}}</td>
<td >每天一次</td>
{{else if tasktype==2}}
<td>每周一次</td>
{{else if tasktype==3}}
<td>每月一次</td>
{{else if tasktype==4}}
<td>每季度一次</td>
{{else if tasktype==5}}
<td>每半年一次</td>
{{else if tasktype==6}}
<td>每年一次</td>
{{/if}}
</tr> </tr>
<tr> <tr>

View File

@ -12,15 +12,6 @@
<input id="checktaskname" class="easyui-textbox" name="checktaskname" style="width:480px"> <input id="checktaskname" class="easyui-textbox" name="checktaskname" style="width:480px">
</td> </td>
</tr> </tr>
<tr>
<td>检查时间:</td>
<td>
<input id="starttime" editable="false" name="starttime" class="easyui-datetimebox" style="width:480px"
data-options="currentText:'今天',closeText:'关闭',showSeconds:false" />
</td>
</tr>
<tr> <tr>
<td>检查人:</td> <td>检查人:</td>
<td> <td>
@ -39,6 +30,22 @@
<input id="checkcontent" class="easyui-textbox" name="checkcontent" style="width:480px;height:100px" data-options="multiline:true"> <input id="checkcontent" class="easyui-textbox" name="checkcontent" style="width:480px;height:100px" data-options="multiline:true">
</td> </td>
</tr> </tr>
<tr>
<td>检查时间:</td>
<td>
<input id="jctime" editable="false" name="jctime" class="easyui-datetimebox" style="width:480px"
data-options="currentText:'今天',closeText:'关闭',showSeconds:false" />
</td>
</tr>
<tr>
<td>整改时间:</td>
<td>
<input id="zgtime" editable="false" name="zgtime" class="easyui-datetimebox" style="width:480px"
data-options="currentText:'今天',closeText:'关闭',showSeconds:false" />
</td>
</tr>
<tr> <tr>
<td>检查问题:</td> <td>检查问题:</td>
<td> <td>
@ -49,6 +56,7 @@
<td>检查图片:</td> <td>检查图片:</td>
<td> <input type="file" id="file" name="" accept="image/*" style="margin-left:30px;" /></td> <td> <input type="file" id="file" name="" accept="image/*" style="margin-left:30px;" /></td>
</tr> </tr>
<tr> <tr>
<td><input type="hidden" name="yhtp" id="yhtp" /></td> <td><input type="hidden" name="yhtp" id="yhtp" /></td>
<td> <td>
@ -89,7 +97,7 @@
<tr> <tr>
<td>需要整改:</td> <td>需要整改:</td>
<td> <td>
<input id="zgjg" class="easyui-textbox" name="zgjg" style="width:480px;height:60px" data-options="multiline:true" required=true> <input id="zgjg" class="easyui-textbox" name="zgjg" style="width:480px;height:60px" data-options="multiline:true">
</td> </td>
</tr> </tr>
<tr> <tr>
@ -155,11 +163,14 @@
console.log(data.yhtp) console.log(data.yhtp)
$('#checktaskname').textbox('setValue', data.checktask__checktaskname) $('#checktaskname').textbox('setValue', data.checktask__checktaskname)
$('#checktabtitle').textbox('setValue', data.checkname__name) $('#checktabtitle').textbox('setValue', data.checkname__name)
$('#starttime').datetimebox('setValue', data.checktask__checktime)
$('#checkcontent').textbox('setValue', data.checktask__checktype__checkcontent) $('#checkcontent').textbox('setValue', data.checktask__checktype__checkcontent)
$('#checkplace').textbox('setValue', data.checktask__checkplace) $('#checkplace').textbox('setValue', data.checktask__checkplace)
$('#checkquestion').textbox('setValue', data.checkquestion) $('#checkquestion').textbox('setValue', data.checkquestion)
$('#zgjg').textbox('setValue', data.zgjg) $('#zgjg').textbox('setValue', data.zgjg)
$('#content').textbox('setValue', data.content)
$('#jctime').datetimebox('setValue', data.jctime)
$('#zgtime').datetimebox('setValue', data.zgtime)
var yhtp = data.yhtp; var yhtp = data.yhtp;
for (var i = 0; i < yhtp.length; i++) { for (var i = 0; i < yhtp.length; i++) {
$("#addImage").append('<li ><img title="点击放大" style="display:block;" onclick="bigger(this)" class = "yhtpimg" width="120" height="120" filepath="' + yhtp[i] + '" src="http://' + window.location.host + '/' + yhtp[i] + '"/></li>'); $("#addImage").append('<li ><img title="点击放大" style="display:block;" onclick="bigger(this)" class = "yhtpimg" width="120" height="120" filepath="' + yhtp[i] + '" src="http://' + window.location.host + '/' + yhtp[i] + '"/></li>');

View File

@ -8,12 +8,36 @@
<div data-options="region:'center'" style="height:100%;padding:15px 15px;"> <div data-options="region:'center'" style="height:100%;padding:15px 15px;">
<div style="text-align:center;font-size: 24px;font-weight: bold;margin-bottom: 20px;">{{checktask__checktaskname}}</div> <div style="text-align:center;font-size: 24px;font-weight: bold;margin-bottom: 20px;">{{checktask__checktaskname}}</div>
<table class='detailtable' style="text-align:center;"> <table class='detailtable' style="text-align:center;">
<tr> <tr>
<td style="font-weight: bold;">检查人员:</td> <td style="font-weight: bold;">检查人员:</td>
<td>{{checkname__username}}</td> <td>{{checkname__username}}</td>
<td style="font-weight: bold;">检查频率:</td>
{{if checktask__tasktype==1}}
<td>每天一次</td>
{{else if checktask__tasktype==2}}
<td>每周一次</td>
{{else if checktask__tasktype==3}}
<td>每月一次</td>
{{else if checktask__tasktype==4}}
<td>每季度一次</td>
{{else if checktask__tasktype==5}}
<td>每半年一次</td>
{{else if checktask__tasktype==6}}
<td>每年一次</td>
{{/if}}
</tr>
<tr>
<td style="font-weight: bold;">检查时间段:</td>
<td colspan="3">{{starttime| dateFormat 'yyyy-MM-dd hh:mm:ss'}}到{{endtime| dateFormat 'yyyy-MM-dd hh:mm:ss'}}</td>
</tr>
<tr>
<td style="font-weight: bold;">检查时间:</td> <td style="font-weight: bold;">检查时间:</td>
<td>{{checktask__checktime| dateFormat 'yyyy-MM-dd hh:mm:ss'}}</td> <td>{{jctime}}</td>
<td style="font-weight: bold;">整改时间:</td>
<td>{{zgtime}}</td>
</tr> </tr>
<tr style="height:80px"> <tr style="height:80px">

View File

@ -37,7 +37,7 @@
{ field: 'id', title: 'ID', hidden: true }, { field: 'id', title: 'ID', hidden: true },
{ field: 'checktaskname', title: '任务名称', width: 150 }, { field: 'checktaskname', title: '任务名称', width: 150 },
{ field: 'checktype__checktitle', title: '检查表', width: 100 }, { field: 'checktype__checktitle', title: '检查表', width: 100 },
{ field: 'checktime', title: '检查时间', width: 300 }, { field: 'checktime', title: '更新时间', width: 300 },
{ field: 'createuser__name', title: '创建人', width: 300 }, { field: 'createuser__name', title: '创建人', width: 300 },
{ field: 'createdate', title: '创建时间', width: 300 }, { field: 'createdate', title: '创建时间', width: 300 },

View File

@ -59,7 +59,6 @@
url: 'api/checkproject?a=checktablist', url: 'api/checkproject?a=checktablist',
valueField: 'value', valueField: 'value',
textField: 'text', textField: 'text',
panelHeight:'auto',
editable: false, editable: false,
}); });

View File

@ -7813,7 +7813,7 @@ def checkprojects(req):
elif a == 'jobdetail': elif a == 'jobdetail':
obj = Checkjob.objects.filter(id=req.GET.get('id')) obj = Checkjob.objects.filter(id=req.GET.get('id'))
obj = obj.values('checktask__checktaskname','zguser','yhtp','checkname__name','zgjg','jobstate','taskstate','checkquestion','checktask__checkplace','checktask__checktype__checkcontent','checkname__username','checktask__checktime')[0] obj = obj.values('checktask__checktaskname','zguser','yhtp','content','jctime','zgtime','checkname__name','zgjg','jobstate','taskstate','checkquestion','checktask__checkplace','checktask__checktype__checkcontent','checkname__username','checktask__checktime')[0]
if obj['yhtp']: if obj['yhtp']:
obj['yhtp'] = obj['yhtp'].split('?') obj['yhtp'] = obj['yhtp'].split('?')
@ -7832,6 +7832,8 @@ def checkprojects(req):
obj.taskstate =int(data['taskstate']) obj.taskstate =int(data['taskstate'])
obj.createuser = User.objects.get(userid=userid) obj.createuser = User.objects.get(userid=userid)
obj.content=data['content'] obj.content=data['content']
obj.jctime=data['jctime']
obj.zgtime=data['zgtime']
if yhtp: if yhtp:
obj.yhtp=yhtp obj.yhtp=yhtp
obj.zghtp=zghtp obj.zghtp=zghtp
@ -8001,7 +8003,7 @@ def checkprojects(req):
uselist.append(item.name) uselist.append(item.name)
x = a.values('checktask__checktaskname','starttime','zgjg','checktask__tasktype','endtime','jobstate','zguser__username','checktask__checktype__checkcontent','checktask__checkplace','checktask__checktime' ,'checkname__username','checkname__name', 'checkquestion', 'zgtime', 'zguser__username', 'createuser__username', x = a.values('checktask__checktaskname','starttime','zgjg','checktask__tasktype','endtime','jobstate','zguser__username','checktask__checktype__checkcontent','checktask__checkplace','checktask__checktime' ,'checkname__username','checkname__name', 'checkquestion', 'zgtime', 'zguser__username', 'createuser__username',
'createdate', 'taskstate','zghtp','content','yhtp','pmpeople', 'zgyq','zgjg', 'yanshou', 'yanshouren__name')[0] 'createdate', 'taskstate','zghtp','jctime','content','yhtp','pmpeople', 'zgyq','zgjg', 'yanshou', 'yanshouren__name')[0]
x['bcfr'] = uselist x['bcfr'] = uselist
if x['yhtp']: if x['yhtp']:
x['yhtp'] = x['yhtp'].split('?') x['yhtp'] = x['yhtp'].split('?')