shangchuren
This commit is contained in:
parent
43142aac7a
commit
a989bd1d5a
|
@ -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),
|
||||
),
|
||||
]
|
|
@ -1254,7 +1254,8 @@ class Checkjob(models.Model):
|
|||
checktask=models.ForeignKey(Checktask,on_delete=models.CASCADE)#关联任务表
|
||||
checkname=models.ForeignKey(User,related_name='jianchas',on_delete=models.CASCADE)#检查人员
|
||||
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,)#整改人
|
||||
createuser = models.ForeignKey(User,related_name='chuangjian',on_delete=models.CASCADE,null=True)#创建人
|
||||
createdate = models.DateTimeField(default = timezone.now)#创建时间
|
||||
|
|
|
@ -282,7 +282,7 @@ def riskacttask():
|
|||
@shared_task
|
||||
def checktask():
|
||||
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.checktime:
|
||||
|
||||
|
|
|
@ -13,8 +13,21 @@
|
|||
<tr>
|
||||
<td style="font-weight: bold;">检查表名:</td>
|
||||
<td>{{checktype__checktitle}}</td>
|
||||
<td style="font-weight: bold;">检查时间:</td>
|
||||
<td>{{checktime| dateFormat 'yyyy-MM-dd hh:mm:ss'}}</td>
|
||||
<td style="font-weight: bold;">排查频率:</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 style="height:80px">
|
||||
|
@ -27,24 +40,12 @@
|
|||
</tr>
|
||||
<tr style="height:80px">
|
||||
<td style="font-weight: bold;">执行情况:</td>
|
||||
<td >{{zxstate==1?'同时执行':'单人执行'}}</td>
|
||||
|
||||
<td>{{zxstate==1?'同时执行':'单人执行'}}</td>
|
||||
|
||||
|
||||
<td style="font-weight: bold;">更新时间:</td>
|
||||
<td>{{checktime| dateFormat 'yyyy-MM-dd hh:mm:ss'}}</td>
|
||||
|
||||
<td style="font-weight: bold;">排查频率:</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>
|
||||
|
||||
|
|
|
@ -12,15 +12,6 @@
|
|||
<input id="checktaskname" class="easyui-textbox" name="checktaskname" style="width:480px">
|
||||
</td>
|
||||
</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>
|
||||
<td>检查人:</td>
|
||||
<td>
|
||||
|
@ -39,6 +30,22 @@
|
|||
<input id="checkcontent" class="easyui-textbox" name="checkcontent" style="width:480px;height:100px" data-options="multiline:true">
|
||||
</td>
|
||||
</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>
|
||||
<td>检查问题:</td>
|
||||
<td>
|
||||
|
@ -49,6 +56,7 @@
|
|||
<td>检查图片:</td>
|
||||
<td> <input type="file" id="file" name="" accept="image/*" style="margin-left:30px;" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><input type="hidden" name="yhtp" id="yhtp" /></td>
|
||||
<td>
|
||||
|
@ -63,33 +71,33 @@
|
|||
<td colspan="2"><ul id="addImage" class="imgul"></ul></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" required=true />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>整改人:</td>
|
||||
<td>
|
||||
<input id="zguser" class="easyui-textbox" name="zguser" style="width:480px" required=true />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>整改要求:</td>
|
||||
<td>
|
||||
<input id="zgyq" class="easyui-textbox" name="zgyq" style="width:480px;height:60px" data-options="multiline:true" required=true>
|
||||
</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" required=true />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>整改人:</td>
|
||||
<td>
|
||||
<input id="zguser" class="easyui-textbox" name="zguser" style="width:480px" required=true />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>整改要求:</td>
|
||||
<td>
|
||||
<input id="zgyq" class="easyui-textbox" name="zgyq" style="width:480px;height:60px" data-options="multiline:true" required=true>
|
||||
</td>
|
||||
</tr></tr>-->
|
||||
|
||||
<tr>
|
||||
<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>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -114,7 +122,7 @@
|
|||
<td>检查状态:</td>
|
||||
<td>
|
||||
|
||||
<input type="radio" name="taskstate" value="2">已整改完成</input>
|
||||
<input type="radio" name="taskstate" value="2">已整改完成</input>
|
||||
<input type="radio" name="taskstate" checked="true" value="1">正在整改中</input>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -123,7 +131,7 @@
|
|||
</table>
|
||||
<div id="chufa" style="margin-top:10px;margin-bottom:5px;">
|
||||
<input class="easyui-textbox" id="participantname" style="width:480px;height:60px" editable="false"
|
||||
data-options="label:'涉及人员:',multiline:true,prompt:'没有涉及人员可以不选'" >
|
||||
data-options="label:'涉及人员:',multiline:true,prompt:'没有涉及人员可以不选'">
|
||||
<input type="hidden" id="participant" name="participant" />
|
||||
<a id="chooserys" class='easyui-linkbutton' onclick="choseusers()" style="width:auto">选择</a>
|
||||
</div>
|
||||
|
@ -144,27 +152,30 @@
|
|||
$('#participantnum').textbox('setValue', top.$('#in').attr('total'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(function () {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$.get('api/checkproject?a=jobdetail&id=' + jobid, function (res) {
|
||||
var data = res.data
|
||||
console.log(data.yhtp)
|
||||
$('#checktaskname').textbox('setValue', data.checktask__checktaskname)
|
||||
$('#checktabtitle').textbox('setValue', data.checkname__name)
|
||||
$('#starttime').datetimebox('setValue', data.checktask__checktime)
|
||||
$('#checkcontent').textbox('setValue', data.checktask__checktype__checkcontent)
|
||||
$('#checkplace').textbox('setValue', data.checktask__checkplace)
|
||||
$('#checkquestion').textbox('setValue', data.checkquestion)
|
||||
$('#zgjg').textbox('setValue', data.zgjg)
|
||||
$('#content').textbox('setValue', data.content)
|
||||
$('#jctime').datetimebox('setValue', data.jctime)
|
||||
$('#zgtime').datetimebox('setValue', data.zgtime)
|
||||
|
||||
var yhtp = data.yhtp;
|
||||
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>');
|
||||
}
|
||||
if (yhtp == []) { $("#addImage").append('<b >无图片</b>') }
|
||||
if (yhtp == []) { $("#addImage").append('<b >无图片</b>') }
|
||||
|
||||
// if (data.taskstate == 1) {
|
||||
// $("input[name='taskstate'][value=1]").attr("checked",true);
|
||||
|
@ -173,7 +184,7 @@
|
|||
// $("input[name='taskstate'][value=2]").attr("checked",true);
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
//检查问题上传图片
|
||||
document.getElementById('file').onchange = function () {
|
||||
var fileObj = this.files[0];
|
||||
|
@ -262,7 +273,7 @@
|
|||
//if(bspeed==0) time.innerHTML = '上传已取消';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
document.getElementById('file2').onchange = function () {
|
||||
var fileObj = this.files[0];
|
||||
var url = 'upfile'
|
||||
|
@ -348,9 +359,9 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function wssubmitForm() {
|
||||
|
||||
|
||||
var wsdata = $('#wsff').serializeJSON();
|
||||
var yhtp = new Array();
|
||||
$(".yhtpimg").each(function () {
|
||||
|
@ -386,6 +397,6 @@
|
|||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
|
@ -8,12 +8,36 @@
|
|||
<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>
|
||||
<table class='detailtable' style="text-align:center;">
|
||||
|
||||
<tr>
|
||||
<td style="font-weight: bold;">检查人员:</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>{{checktask__checktime| dateFormat 'yyyy-MM-dd hh:mm:ss'}}</td>
|
||||
<td>{{jctime}}</td>
|
||||
<td style="font-weight: bold;">整改时间:</td>
|
||||
<td>{{zgtime}}</td>
|
||||
|
||||
</tr>
|
||||
<tr style="height:80px">
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
{ field: 'id', title: 'ID', hidden: true },
|
||||
{ field: 'checktaskname', title: '任务名称', width: 150 },
|
||||
{ field: 'checktype__checktitle', title: '检查表', width: 100 },
|
||||
{ field: 'checktime', title: '检查时间', width: 300 },
|
||||
{ field: 'checktime', title: '更新时间', width: 300 },
|
||||
{ field: 'createuser__name', title: '创建人', width: 300 },
|
||||
{ field: 'createdate', title: '创建时间', width: 300 },
|
||||
|
||||
|
|
|
@ -59,7 +59,6 @@
|
|||
url: 'api/checkproject?a=checktablist',
|
||||
valueField: 'value',
|
||||
textField: 'text',
|
||||
panelHeight:'auto',
|
||||
editable: false,
|
||||
});
|
||||
|
||||
|
|
|
@ -7813,7 +7813,7 @@ def checkprojects(req):
|
|||
|
||||
elif a == 'jobdetail':
|
||||
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']:
|
||||
obj['yhtp'] = obj['yhtp'].split('?')
|
||||
|
||||
|
@ -7832,6 +7832,8 @@ def checkprojects(req):
|
|||
obj.taskstate =int(data['taskstate'])
|
||||
obj.createuser = User.objects.get(userid=userid)
|
||||
obj.content=data['content']
|
||||
obj.jctime=data['jctime']
|
||||
obj.zgtime=data['zgtime']
|
||||
if yhtp:
|
||||
obj.yhtp=yhtp
|
||||
obj.zghtp=zghtp
|
||||
|
@ -8001,7 +8003,7 @@ def checkprojects(req):
|
|||
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',
|
||||
'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
|
||||
if x['yhtp']:
|
||||
x['yhtp'] = x['yhtp'].split('?')
|
||||
|
|
Loading…
Reference in New Issue