Merge branch 'master' of https://e.coding.net/ctcdevteam/safesite
This commit is contained in:
commit
7a13275eea
|
@ -0,0 +1,14 @@
|
|||
# Generated by Django 2.2.8 on 2020-01-08 12:11
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('safesite', '0298_auto_20191216_1700'),
|
||||
('safesite', '0304_trouble_submituser'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
]
|
|
@ -0,0 +1,106 @@
|
|||
# Generated by Django 2.2.8 on 2020-01-08 14:01
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('safesite', '0305_merge_20200108_1211'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Checkproject',
|
||||
fields=[
|
||||
('id', models.AutoField(primary_key=True, serialize=False)),
|
||||
('checktitle', models.CharField(max_length=1000)),
|
||||
('checkcontent', models.CharField(max_length=1000)),
|
||||
('requirements', models.CharField(max_length=500)),
|
||||
('createdate', models.DateTimeField(default=django.utils.timezone.now)),
|
||||
('deletemark', models.IntegerField(default=1)),
|
||||
('checkstate', models.IntegerField(default=1)),
|
||||
('createuser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='safesite.User')),
|
||||
('usecomp', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='checkcomp', to='safesite.Partment')),
|
||||
],
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='menu',
|
||||
options={'verbose_name': '菜单&按钮', 'verbose_name_plural': '菜单&按钮'},
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='menu',
|
||||
name='deletemark',
|
||||
field=models.IntegerField(default=1, verbose_name='删除标记'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='menu',
|
||||
name='detail',
|
||||
field=models.CharField(blank=True, max_length=100, null=True, verbose_name='描述'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='menu',
|
||||
name='icon',
|
||||
field=models.CharField(blank=True, max_length=100, null=True, verbose_name='图标'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='menu',
|
||||
name='menucode',
|
||||
field=models.CharField(blank=True, max_length=30, null=True, verbose_name='菜单标识'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='menu',
|
||||
name='menuid',
|
||||
field=models.AutoField(primary_key=True, serialize=False, verbose_name='ID'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='menu',
|
||||
name='menuname',
|
||||
field=models.CharField(blank=True, max_length=30, null=True, verbose_name='名称'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='menu',
|
||||
name='parentid',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='safesite.Menu', verbose_name='上级'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='menu',
|
||||
name='sortnum',
|
||||
field=models.IntegerField(default=1, verbose_name='排序号'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='menu',
|
||||
name='type',
|
||||
field=models.IntegerField(choices=[(1, '菜单'), (2, '按钮')], default=1, verbose_name='类型'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='menu',
|
||||
name='url',
|
||||
field=models.CharField(blank=True, max_length=30, null=True, verbose_name='操作地址'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Checktask',
|
||||
fields=[
|
||||
('id', models.AutoField(primary_key=True, serialize=False)),
|
||||
('checktaskname', models.CharField(max_length=300)),
|
||||
('checktime', models.DateTimeField(default=django.utils.timezone.now)),
|
||||
('checkplace', models.CharField(max_length=200)),
|
||||
('checkquestion', models.CharField(max_length=200)),
|
||||
('zgtime', models.DateTimeField(default=django.utils.timezone.now)),
|
||||
('createdate', models.DateTimeField(default=django.utils.timezone.now)),
|
||||
('deletemark', models.IntegerField(default=1)),
|
||||
('taskstate', models.IntegerField(default=1)),
|
||||
('zgyq', models.CharField(max_length=200)),
|
||||
('zgjg', models.CharField(max_length=200)),
|
||||
('yanshou', models.DateTimeField(default=django.utils.timezone.now)),
|
||||
('checkname', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='jiancha', to='safesite.User')),
|
||||
('checktype', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='safesite.Checkproject')),
|
||||
('createuser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='chuangjian', to='safesite.User')),
|
||||
('usecomp', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='taskcomps', to='safesite.Partment')),
|
||||
('yanshouren', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='yanshouren', to='safesite.User')),
|
||||
('zguser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='safesite.User')),
|
||||
],
|
||||
),
|
||||
]
|
|
@ -0,0 +1,36 @@
|
|||
# Generated by Django 2.2.8 on 2020-01-10 16:24
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('safesite', '0306_auto_20200108_1401'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Checktable',
|
||||
fields=[
|
||||
('id', models.AutoField(primary_key=True, serialize=False)),
|
||||
('checktitle', models.CharField(max_length=1000)),
|
||||
('checkprjtype', models.CharField(max_length=1000)),
|
||||
('createdate', models.DateTimeField(default=django.utils.timezone.now)),
|
||||
('deletemark', models.IntegerField(default=1)),
|
||||
('createuser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='safesite.User')),
|
||||
('usecomp', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='checktabcomp', to='safesite.Partment')),
|
||||
],
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='checkproject',
|
||||
name='checkstate',
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='checktask',
|
||||
name='checktype',
|
||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='safesite.Checktable'),
|
||||
),
|
||||
]
|
|
@ -0,0 +1,31 @@
|
|||
# Generated by Django 2.2.8 on 2020-01-13 11:50
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('safesite', '0307_auto_20200110_1624'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='checktable',
|
||||
name='checkprjtype',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='checktable',
|
||||
name='checkprjtype',
|
||||
field=models.ManyToManyField(to='safesite.Checkproject'),
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='checktask',
|
||||
name='checkname',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='checktask',
|
||||
name='checkname',
|
||||
field=models.ManyToManyField(related_name='jiancha', to='safesite.User'),
|
||||
),
|
||||
]
|
|
@ -0,0 +1,19 @@
|
|||
# Generated by Django 2.2.8 on 2020-01-14 15:36
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('safesite', '0308_auto_20200113_1150'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='checktable',
|
||||
name='checkcontent',
|
||||
field=models.CharField(default=2, max_length=1000),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
|
@ -0,0 +1,19 @@
|
|||
# Generated by Django 2.2.8 on 2020-01-14 17:31
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('safesite', '0309_checktable_checkcontent'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='checktask',
|
||||
name='zguser',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='safesite.User'),
|
||||
),
|
||||
]
|
|
@ -0,0 +1,82 @@
|
|||
# Generated by Django 2.2.8 on 2020-01-15 11:01
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('safesite', '0310_auto_20200114_1731'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='checktask',
|
||||
name='checkquestion',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='checktask',
|
||||
name='createdate',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='checktask',
|
||||
name='createuser',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='checktask',
|
||||
name='deletemark',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='checktask',
|
||||
name='taskstate',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='checktask',
|
||||
name='usecomp',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='checktask',
|
||||
name='yanshou',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='checktask',
|
||||
name='yanshouren',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='checktask',
|
||||
name='zgjg',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='checktask',
|
||||
name='zgtime',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='checktask',
|
||||
name='zguser',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='checktask',
|
||||
name='zgyq',
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='checkjob',
|
||||
fields=[
|
||||
('id', models.AutoField(primary_key=True, serialize=False)),
|
||||
('checkquestion', models.CharField(max_length=200)),
|
||||
('zgtime', models.DateTimeField(default=django.utils.timezone.now)),
|
||||
('createdate', models.DateTimeField(default=django.utils.timezone.now)),
|
||||
('deletemark', models.IntegerField(default=1)),
|
||||
('taskstate', models.IntegerField(default=1)),
|
||||
('zgyq', models.CharField(max_length=200)),
|
||||
('zgjg', models.CharField(max_length=200)),
|
||||
('yanshou', models.DateTimeField(default=django.utils.timezone.now)),
|
||||
('checktask', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='safesite.Checktask')),
|
||||
('createuser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='chuangjian', to='safesite.User')),
|
||||
('usecomp', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='taskcomps', to='safesite.Partment')),
|
||||
('yanshouren', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='yanshouren', to='safesite.User')),
|
||||
('zguser', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='safesite.User')),
|
||||
],
|
||||
),
|
||||
]
|
|
@ -0,0 +1,36 @@
|
|||
# Generated by Django 2.2.8 on 2020-01-15 11:12
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('safesite', '0311_auto_20200115_1101'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='checktask',
|
||||
name='createdate',
|
||||
field=models.DateTimeField(default=django.utils.timezone.now),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='checktask',
|
||||
name='createuser',
|
||||
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='chuangjians', to='safesite.User'),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='checktask',
|
||||
name='deletemark',
|
||||
field=models.IntegerField(default=1),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='checktask',
|
||||
name='usecomp',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='taskscomp', to='safesite.Partment'),
|
||||
),
|
||||
]
|
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 2.2.8 on 2020-01-15 14:03
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('safesite', '0312_auto_20200115_1112'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='checkjob',
|
||||
name='checkname',
|
||||
field=models.ManyToManyField(related_name='jianchas', to='safesite.User'),
|
||||
),
|
||||
]
|
|
@ -0,0 +1,39 @@
|
|||
# Generated by Django 2.2.8 on 2020-01-15 14:14
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('safesite', '0313_checkjob_checkname'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='checkjob',
|
||||
name='checkquestion',
|
||||
field=models.CharField(max_length=200, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='checkjob',
|
||||
name='createuser',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='chuangjian', to='safesite.User'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='checkjob',
|
||||
name='yanshouren',
|
||||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='yanshouren', to='safesite.User'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='checkjob',
|
||||
name='zgjg',
|
||||
field=models.CharField(max_length=200, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='checkjob',
|
||||
name='zgyq',
|
||||
field=models.CharField(max_length=200, null=True),
|
||||
),
|
||||
]
|
|
@ -0,0 +1,24 @@
|
|||
# Generated by Django 2.2.8 on 2020-01-15 14:21
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('safesite', '0314_auto_20200115_1414'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='checkjob',
|
||||
name='checkname',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='checkjob',
|
||||
name='checkname',
|
||||
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='jianchas', to='safesite.User'),
|
||||
preserve_default=False,
|
||||
),
|
||||
]
|
|
@ -0,0 +1,23 @@
|
|||
# Generated by Django 2.2.8 on 2020-03-06 14:44
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('safesite', '0315_auto_20200115_1421'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='checkjob',
|
||||
name='yanshou',
|
||||
field=models.DateTimeField(blank=True, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='checktask',
|
||||
name='checktime',
|
||||
field=models.DateTimeField(blank=True, null=True),
|
||||
),
|
||||
]
|
|
@ -1212,6 +1212,52 @@ class ReaderOperproce(models.Model):
|
|||
num = models.CharField(max_length=50)
|
||||
readeruser = models.ForeignKey(User,on_delete=models.CASCADE)
|
||||
readertime = models.DateTimeField(default = timezone.now)
|
||||
#检查项目
|
||||
class Checkproject(models.Model):
|
||||
id =models.AutoField(primary_key=True)#主键
|
||||
checktitle=models.CharField(max_length=1000)#检查项目标题
|
||||
checkcontent=models.CharField(max_length=1000)#检查内容
|
||||
requirements=models.CharField(max_length=500)#检查要求
|
||||
createuser = models.ForeignKey(User,on_delete=models.CASCADE)#创建人
|
||||
createdate = models.DateTimeField(default = timezone.now)#创建时间
|
||||
usecomp = models.ForeignKey(Partment,related_name='checkcomp',on_delete=models.CASCADE,null=True,blank=True)#创建公司
|
||||
deletemark = models.IntegerField(default=1)#是否删除
|
||||
#检查表
|
||||
class Checktable(models.Model):
|
||||
id =models.AutoField(primary_key=True)#主键
|
||||
checktitle=models.CharField(max_length=1000)#检查表名
|
||||
checkprjtype=models.ManyToManyField(Checkproject)#检查项目多选
|
||||
checkcontent=models.CharField(max_length=1000)#检查内容
|
||||
createuser = models.ForeignKey(User,on_delete=models.CASCADE)#创建人
|
||||
createdate = models.DateTimeField(default = timezone.now)#创建时间
|
||||
usecomp = models.ForeignKey(Partment,related_name='checktabcomp',on_delete=models.CASCADE,null=True,blank=True)#创建公司
|
||||
deletemark = models.IntegerField(default=1)#是否删除
|
||||
|
||||
|
||||
|
||||
#检查任务
|
||||
class Checktask(models.Model):
|
||||
id=models.AutoField(primary_key=True)#主键
|
||||
checktaskname=models.CharField(max_length=300)#任务名
|
||||
checktype=models.ForeignKey(Checktable,on_delete=models.CASCADE)#关联检查表
|
||||
checkname=models.ManyToManyField(User,related_name='jiancha')#检查人员
|
||||
checktime= models.DateTimeField(null=True, blank=True)#检查时间
|
||||
checkplace=models.CharField(max_length=200)#检查地点
|
||||
createuser = models.ForeignKey(User,related_name='chuangjians',on_delete=models.CASCADE)#创建人
|
||||
createdate = models.DateTimeField(default = timezone.now)#创建时间
|
||||
usecomp = models.ForeignKey(Partment,related_name='taskscomp',on_delete=models.CASCADE,null=True,blank=True)#创建公司
|
||||
deletemark = models.IntegerField(default=1)#是否删除
|
||||
class Checkjob(models.Model):
|
||||
id=models.AutoField(primary_key=True)#主键
|
||||
checktask=models.ForeignKey(Checktask,on_delete=models.CASCADE)#关联任务表
|
||||
checkname=models.ForeignKey(User,related_name='jianchas',on_delete=models.CASCADE)#检查人员
|
||||
checkquestion=models.CharField(max_length=200,null=True)#检查发现的问题
|
||||
zgtime=models.DateTimeField(default = timezone.now)#整改期限
|
||||
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)#创建时间
|
||||
usecomp = models.ForeignKey(Partment,related_name='taskcomps',on_delete=models.CASCADE,null=True,blank=True)#创建公司
|
||||
deletemark = models.IntegerField(default=1)#是否删除
|
||||
taskstate = models.IntegerField(default=1)#检查任务状态,1正在检查,2检查完毕
|
||||
zgyq=models.CharField(max_length=200,null=True)#整改要求
|
||||
zgjg=models.CharField(max_length=200,null=True)#整改结果
|
||||
yanshou=models.DateTimeField(null=True, blank=True)#验收时间
|
||||
yanshouren=models.ForeignKey(User,related_name='yanshouren',on_delete=models.CASCADE,null=True)#验收人员
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
|
@ -0,0 +1,101 @@
|
|||
|
||||
<div id="taskbar" style="padding: 4px;">
|
||||
|
||||
<div>
|
||||
<label>快捷查询</label>
|
||||
<select id='kjcxyh' style='width:150px;'>
|
||||
<option value="">请选择</option>
|
||||
<option value="listself">我的任务</option>
|
||||
<option value="listchuli">验收任务</option>
|
||||
<option value="listallx">全部任务</option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
{% load myfilter %}
|
||||
{% if request|has_permission:'b_checkjob_add' %}
|
||||
<a id="addtask" class="easyui-linkbutton" onclick="addcheckrw()" data-options="iconCls: 'fa-plus',plain:true">执行任务</a>
|
||||
{% endif %}
|
||||
{% if request|has_permission:'b_checkjob_detail' %}
|
||||
<a id="detailprg" class="easyui-linkbutton" onclick="detailtask()" data-options="iconCls: 'fa-info-circle',plain:true">详情</a>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<table id="jobtab" style="width:100%;height:100%;text-align: center;"></table>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
})
|
||||
$('#kjcxyh').combobox({
|
||||
editable: false,
|
||||
onSelect: function (node) {
|
||||
if (node.value != '') {
|
||||
$('#jobtab').datagrid({ url: 'api/checkproject', queryParams: { a: node.value } });
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
$('#jobtab').datagrid({
|
||||
url: 'api/checkproject?a=listall4',
|
||||
rownumbers: true,
|
||||
singleSelect: true,
|
||||
striped: true,
|
||||
fitColumns: true,
|
||||
method: 'get',
|
||||
pagination: 'true',
|
||||
pageSize: 20,
|
||||
border: false,
|
||||
toolbar:'#taskbar',
|
||||
columns: [[
|
||||
{ field: 'id', title: 'ID', hidden: true },
|
||||
{ field: 'checktask__checktaskname', title: '任务名称', width: 100 },
|
||||
{ field: 'checktask__checktype__checktitle', title: '检查表', width: 100 },
|
||||
{ field: 'checktask__checktime', title: '检查时间', width: 100 },
|
||||
{ field: 'checkname__username', title: '检查人员', width: 100 },
|
||||
{ field: 'createdate', title: '创建时间', width: 100 },
|
||||
//{ field: 'zguser__username', title: '整改人', width: 100 },
|
||||
//{ field: 'zgtime', title: '整改时间', width: 100 },
|
||||
|
||||
{
|
||||
field: 'taskstate', title: '执行状态', width: 100, formatter: function (value, row, index) {
|
||||
if (value == 1) {
|
||||
return '正在检查';
|
||||
}
|
||||
else if (value == 2) {
|
||||
return '检查完毕'
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{ field: 'yanshou', title: '验收时间', width: 100 },
|
||||
//
|
||||
//{ field: 'zguser__name', title: '整改人', width: 100 },
|
||||
//{ field: 'zgtime', title: '整改时间', width: 100 },
|
||||
|
||||
|
||||
]]
|
||||
});
|
||||
function addcheckrw() {
|
||||
var row = $('#jobtab').datagrid('getSelected');
|
||||
if (row) {
|
||||
opendg('查看检查任务','html/addcheckjob/'+row.id.toString())
|
||||
}
|
||||
else {
|
||||
$.messager.alert('提示', '请先选择一条数据!');
|
||||
}
|
||||
|
||||
}
|
||||
function detailtask() {
|
||||
var row = $('#jobtab').datagrid('getSelected');
|
||||
if (row) {
|
||||
opendg('任务详情','html/detailjob/'+row.id.toString())
|
||||
}
|
||||
else {
|
||||
$.messager.alert('提示', '请先选择一条数据!');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
|
@ -0,0 +1,137 @@
|
|||
<div class="easyui-layout" style="width:100%;height:100%;">
|
||||
<div id='southdiv' data-options="region:'south'" style="height:50px;text-align:center;padding:5px">
|
||||
<a href="javascript:void(0)" iconCls="fa-check" class="easyui-linkbutton" onclick="wssubmitForm()" id="submitb">提交</a>
|
||||
<a href="javascript:void(0)" iconCls="fa-close" class="easyui-linkbutton" onclick="closeForm()">取消</a>
|
||||
</div>
|
||||
<div data-options="region:'center'" style="height:100%;padding:15px 15px;">
|
||||
<form id="wsff" method="post" name="wsff" enctype="multipart/form-data">
|
||||
<table class="listTab">
|
||||
<tr>
|
||||
<td>任务名称:</td>
|
||||
<td>
|
||||
<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>
|
||||
<input id="checktabtitle" class="easyui-textbox" name="checktabtitle" style="width:480px" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>检查地点:</td>
|
||||
<td>
|
||||
<input id="checkplace" class="easyui-textbox" name="checkplace" style="width:480px" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>检查内容:</td>
|
||||
<td>
|
||||
<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="checkquestion" class="easyui-textbox" name="checkquestion" style="width:480px;height:100px" 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>
|
||||
<td>整改结果:</td>
|
||||
<td>
|
||||
<input id="zgjg" class="easyui-textbox" name="zgjg" style="width:480px;height:60px" data-options="multiline:true" required=true>
|
||||
</td>
|
||||
</tr>-->
|
||||
<tr>
|
||||
<td>检查状态:</td>
|
||||
<td>
|
||||
|
||||
<input type="radio" name="taskstate" value="1" checked="true">正在检查</input>
|
||||
<input type="radio" name="taskstate" value="2">检查完成</input>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
var jobid = {{ id }}
|
||||
|
||||
|
||||
$(function () {
|
||||
|
||||
|
||||
$.get('api/checkproject?a=jobdetail&id=' + jobid, function (res) {
|
||||
var data = res.data
|
||||
console.log(data)
|
||||
$('#checktaskname').textbox('setValue', data.checktask__checktaskname)
|
||||
$('#checktabtitle').textbox('setValue', data.checkname__username)
|
||||
$('#starttime').datetimebox('setValue', data.checktask__checktime)
|
||||
$('#checkcontent').textbox('setValue', data.checktask__checktype__checkcontent)
|
||||
$('#checkplace').textbox('setValue', data.checktask__checkplace)
|
||||
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
|
||||
function wssubmitForm() {
|
||||
|
||||
var wsdata = $('#wsff').serializeJSON();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: 'api/checkproject?a=addjob&jobid='+jobid,
|
||||
data: JSON.stringify(wsdata),
|
||||
datatype: "json",
|
||||
processData: false,
|
||||
contentType: "application/json;charset=utf-8",
|
||||
beforeSend: function () {
|
||||
var bo = $('#wsff').form('validate')
|
||||
if (bo == false) {
|
||||
return bo
|
||||
} else {
|
||||
$('#submitb').linkbutton('disable');
|
||||
}
|
||||
},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$('#jobtab').datagrid('reload');
|
||||
$("#dd").dialog("close");
|
||||
} else { $.messager.alert('提示', '失败!'); }
|
||||
$('#submitb').linkbutton('enable');
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
|
@ -0,0 +1,136 @@
|
|||
<div class="easyui-layout" id="result" style="width:100%;height:100%"></div>
|
||||
<script type="text/html" id="text">
|
||||
{% verbatim %}
|
||||
<div id='southdiv' data-options="region:'south'" style="height:50px;text-align:center;padding:5px">
|
||||
<a id="yanshou" onclick="yanshou()" class="easyui-linkbutton" data-options="iconCls: 'fa-download'">验收</a>
|
||||
<a iconCls="fa-close" class="easyui-linkbutton" onclick="closeForm()">关闭</a>
|
||||
</div>
|
||||
<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>
|
||||
<td>{{checktask__checktime| dateFormat 'yyyy-MM-dd hh:mm:ss'}}</td>
|
||||
|
||||
</tr>
|
||||
<tr style="height:80px">
|
||||
<td style="font-weight: bold;">检查内容:</td>
|
||||
<td colspan="3">{{checktask__checktype__checkcontent}}</td>
|
||||
</tr>
|
||||
<tr style="height:80px">
|
||||
<td style="font-weight: bold;">检查发现的问题:</td>
|
||||
<td colspan="3">{{checkquestion}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-weight: bold;">检查状态:</td>
|
||||
<td>{{taskstate==1?'正在检查':'检查完毕'}}</td>
|
||||
|
||||
<td style="font-weight: bold;">检查地点:</td>
|
||||
<td>{{checktask__checkplace}}</td>
|
||||
|
||||
|
||||
</tr>
|
||||
<!--<tr style="height:80px">
|
||||
<td style="font-weight: bold;">整改要求:</td>
|
||||
<td colspan="3">{{zgyq}}</td>
|
||||
|
||||
</tr>
|
||||
<tr style="height:80px">
|
||||
<td style="font-weight: bold;">整改结果:</td>
|
||||
<td colspan="3">{{zgjg}}</td>
|
||||
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="font-weight: bold;">整改人:</td>
|
||||
<td>{{zguser__username}}</td>
|
||||
|
||||
<td style="font-weight: bold;">整改时间:</td>
|
||||
<td>{{zgtime| dateFormat 'yyyy-MM-dd hh:mm:ss'}}</td>
|
||||
|
||||
</tr>-->
|
||||
|
||||
<tr>
|
||||
<td style="font-weight: bold;">填报人:</td>
|
||||
<td>{{createuser__username}}</td>
|
||||
|
||||
<td style="font-weight: bold;">填报时间:</td>
|
||||
<td>{{zgtime| dateFormat 'yyyy-MM-dd hh:mm:ss'}}</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div style="font-size:25px;background-color:aquamarine;margin-top:30px;">
|
||||
{{yanshou==null?'本任务还没有验收,需要发布人验收':'该任务已经验收完毕,验收人是:'}}{{yanshouren__username}}
|
||||
</div>
|
||||
</div>
|
||||
{% endverbatim %}
|
||||
</script>
|
||||
<script type="text/javascript" src="/static/safesite/mystatic/js/template-web.js"></script>
|
||||
<script>
|
||||
var html;
|
||||
var state;
|
||||
var id = {{ id }};
|
||||
template.defaults.imports.dateFormat = function (date, format) {
|
||||
date = new Date(date);
|
||||
var map = {
|
||||
"M": date.getMonth() + 1, //月份
|
||||
"d": date.getDate(), //日
|
||||
"h": date.getHours(), //小时
|
||||
"m": date.getMinutes(), //分
|
||||
"s": date.getSeconds(), //秒
|
||||
"q": Math.floor((date.getMonth() + 3) / 3), //季度
|
||||
"S": date.getMilliseconds() //毫秒
|
||||
};
|
||||
format = format.replace(/([yMdhmsqS])+/g, function (all, t) {
|
||||
var v = map[t];
|
||||
if (v !== undefined) {
|
||||
if (all.length > 1) {
|
||||
v = '0' + v;
|
||||
v = v.substr(v.length - 2);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
else if (t === 'y') {
|
||||
return (date.getFullYear() + '').substr(4 - all.length);
|
||||
}
|
||||
return all;
|
||||
});
|
||||
return format;
|
||||
};
|
||||
template.defaults.imports.gfilename = function(value){
|
||||
x = value.split('/').pop();
|
||||
return x;
|
||||
}
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "api/checkproject?a=checkjobdetail",
|
||||
data: { id: id },
|
||||
async: false, // ajax同步使用false
|
||||
success: function (data) {
|
||||
html = template('text', data);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$('#result').html(html);
|
||||
function yanshou() {
|
||||
$.ajax({
|
||||
type: "get",
|
||||
url: "api/checkproject?a=yanshou",
|
||||
data: { id: id },
|
||||
async: false, // ajax同步使用false
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$('#jobtab').datagrid('reload');
|
||||
$("#dd").dialog("close");
|
||||
} else { $.messager.alert('提示', '失败!'); }
|
||||
$('#submitb').linkbutton('enable');
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
|
@ -0,0 +1,53 @@
|
|||
|
||||
<div id="taskbar" style="padding: 4px;">
|
||||
|
||||
<div >
|
||||
|
||||
|
||||
</div>
|
||||
<div>
|
||||
{% load myfilter %}
|
||||
{% if request|has_permission:'b_checklist_add' %}
|
||||
<a id="addtask" class="easyui-linkbutton" onclick="addcheckrw()" data-options="iconCls: 'fa-plus',plain:true">发布任务</a>
|
||||
{% endif %}
|
||||
|
||||
<!-- <a id="delprg" class="easyui-linkbutton" onclick="deltask()" data-options="iconCls: 'fa-trash',plain:true">删除</a>-->
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<table id="tasktab" style="width:100%;height:100%;text-align: center;"></table>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
})
|
||||
|
||||
$('#tasktab').datagrid({
|
||||
url: 'api/checkproject?a=listall3',
|
||||
rownumbers: true,
|
||||
singleSelect: true,
|
||||
striped: true,
|
||||
fitColumns: true,
|
||||
method: 'get',
|
||||
pagination: 'true',
|
||||
pageSize: 20,
|
||||
border: false,
|
||||
toolbar:'#taskbar',
|
||||
columns: [[
|
||||
{ field: 'id', title: 'ID', hidden: true },
|
||||
{ field: 'checktaskname', title: '任务名称', width: 100 },
|
||||
{ field: 'checktype__checktitle', title: '检查表', width: 100 },
|
||||
{ field: 'checktime', title: '检查时间', width: 300 },
|
||||
{ field: 'createuser__name', title: '创建人', width: 300 },
|
||||
{ field: 'createdate', title: '创建时间', width: 300 },
|
||||
{ field: 'checkplace', title: '检查地点', width: 300 },
|
||||
|
||||
|
||||
]]
|
||||
});
|
||||
function addcheckrw(){
|
||||
opendg('发布检查任务','html/addcheckrw')
|
||||
}
|
||||
|
||||
|
||||
</script>
|
|
@ -0,0 +1,87 @@
|
|||
<div class="easyui-layout" style="width:100%;height:100%;">
|
||||
<div id='southdiv' data-options="region:'south'" style="height:50px;text-align:center;padding:5px">
|
||||
<a href="javascript:void(0)" iconCls="fa-check" class="easyui-linkbutton" onclick="wssubmitForm()" id="submitb">提交</a>
|
||||
<a href="javascript:void(0)" iconCls="fa-close" class="easyui-linkbutton" onclick="closeForm()">取消</a>
|
||||
</div>
|
||||
<div data-options="region:'center'" style="height:100%;padding:15px 15px;">
|
||||
<form id="wsff" method="post" name="wsff" enctype="multipart/form-data">
|
||||
|
||||
<div style="margin-top:10px;margin-bottom:5px">
|
||||
<input id="checktaskname" class="easyui-textbox" name="checktaskname" style="width:480px;height:40px" data-options="label:'任务名称'"
|
||||
required=true />
|
||||
</div>
|
||||
<div 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:'请选择'" required=true>
|
||||
<input type="hidden" id="participant" name="participant" />
|
||||
<a id="chooserys" class='easyui-linkbutton' onclick="choseusers()" style="width:auto">选择</a>
|
||||
</div>
|
||||
<div style="margin-top:10px;margin-bottom:5px">
|
||||
<input id="starttime" editable="false" name="starttime" class="easyui-datetimebox" style="width:480px;height:40px"
|
||||
data-options="label:'检查时间',currentText:'今天',closeText:'关闭',showSeconds:false" required=true />
|
||||
</div>
|
||||
<div style="margin-bottom:5px">
|
||||
<input id="checktabtitle" class="easyui-textbox" name="checktabtitle" style="width:480px;height:40px" data-options="label:'检查项目'" required=true />
|
||||
</div>
|
||||
<div style="margin-top:10px;margin-bottom:5px">
|
||||
<input id="checkplace" class="easyui-textbox" name="checkplace" style="width:480px;height:40px" data-options="label:'检查地点'"
|
||||
required=true />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
|
||||
$(function () {
|
||||
$("#checktabtitle").combobox({
|
||||
url: 'api/checkproject?a=checktablist',
|
||||
valueField: 'value',
|
||||
textField: 'text',
|
||||
panelHeight:'auto',
|
||||
editable: false,
|
||||
});
|
||||
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
function aaa(x) {
|
||||
if (x == "participant") {
|
||||
$('#participant').attr('value', top.$('#in').val());
|
||||
$('#participantname').textbox('setValue', top.$('#in').attr('show'));
|
||||
$('#participantnum').textbox('setValue', top.$('#in').attr('total'));
|
||||
}
|
||||
}
|
||||
|
||||
function wssubmitForm() {
|
||||
|
||||
var wsdata = $('#wsff').serializeJSON();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: 'api/checkproject?a=addchecklist',
|
||||
data: JSON.stringify(wsdata),
|
||||
datatype: "json",
|
||||
processData: false,
|
||||
contentType: "application/json;charset=utf-8",
|
||||
beforeSend: function () {
|
||||
var bo = $('#wsff').form('validate')
|
||||
if (bo == false) {
|
||||
return bo
|
||||
} else {
|
||||
$('#submitb').linkbutton('disable');
|
||||
}
|
||||
},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$('#tasktab').datagrid('reload');
|
||||
$("#dd").dialog("close");
|
||||
} else { $.messager.alert('提示', '失败!'); }
|
||||
$('#submitb').linkbutton('enable');
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
|
@ -0,0 +1,74 @@
|
|||
<div class="easyui-layout" style="width:100%;height:100%;">
|
||||
<div id='southdiv' data-options="region:'south'" style="height:50px;text-align:center;padding:5px">
|
||||
<a href="javascript:void(0)" iconCls="fa-check" class="easyui-linkbutton" onclick="wssubmitForm()" id="submitb">提交</a>
|
||||
<a href="javascript:void(0)" iconCls="fa-close" class="easyui-linkbutton" onclick="closeForm()">取消</a>
|
||||
</div>
|
||||
<div data-options="region:'center'" style="height:100%;padding:15px 15px;">
|
||||
<form id="wsff" method="post" name="wsff" enctype="multipart/form-data">
|
||||
|
||||
<div style="margin-top:10px;margin-bottom:5px">
|
||||
<input id="checktaskname" class="easyui-textbox" name="checktaskname" style="width:480px;height:40px" data-options="label:'任务名称'"
|
||||
required=true />
|
||||
</div>
|
||||
<!--<div style="margin-bottom:5px">
|
||||
<input id="checktype" class="easyui-textbox" name="checktype" style="width:480px;height:40px" data-options="label:'检查项目',multiline:true" required=true />
|
||||
</div>-->
|
||||
<div style="margin-bottom:5px">
|
||||
<input id="checkcontent" class="easyui-textbox" name="checkcontent" style="width:480px;height:500px" data-options="label:'检查内容',multiline:true" required=true />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
|
||||
//$(function () {
|
||||
// $("#checktype").combobox({
|
||||
// url: 'api/checkproject?a=project',
|
||||
// valueField: 'value',
|
||||
// textField: 'text',
|
||||
// multiple:true,
|
||||
// panelHeight:'auto',
|
||||
// editable: false,
|
||||
// });
|
||||
|
||||
|
||||
|
||||
//})
|
||||
|
||||
|
||||
|
||||
|
||||
function wssubmitForm() {
|
||||
|
||||
var wsdata = $('#wsff').serializeJSON();
|
||||
//var checkvalue = $("#checktype").combobox('getValues');
|
||||
|
||||
//wsdata['checkprjtype'] =checkvalue;
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: 'api/checkproject?a=addcheck',
|
||||
data: JSON.stringify(wsdata),
|
||||
datatype: "json",
|
||||
processData: false,
|
||||
contentType: "application/json;charset=utf-8",
|
||||
beforeSend: function () {
|
||||
var bo = $('#wsff').form('validate')
|
||||
if (bo == false) {
|
||||
return bo
|
||||
} else {
|
||||
$('#submitb').linkbutton('disable');
|
||||
}
|
||||
},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$('#tasktab').datagrid('reload');
|
||||
$("#dd").dialog("close");
|
||||
} else { $.messager.alert('提示', '失败!'); }
|
||||
$('#submitb').linkbutton('enable');
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
|
@ -0,0 +1,53 @@
|
|||
|
||||
<div id="taskbar" style="padding: 4px;">
|
||||
|
||||
<div >
|
||||
|
||||
|
||||
</div>
|
||||
<div>
|
||||
|
||||
{% load myfilter %}
|
||||
{% if request|has_permission:'b_checktable_add' %}
|
||||
<a id="addtask" class="easyui-linkbutton" onclick="addtask()" data-options="iconCls: 'fa-plus',plain:true">新增</a>
|
||||
{% endif %}
|
||||
{% if request|has_permission:'b_checktable_del' %}
|
||||
<a id="delprg" class="easyui-linkbutton" onclick="deltask()" data-options="iconCls: 'fa-trash',plain:true">删除</a>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<table id="tasktab" style="width:100%;height:100%;text-align: center;"></table>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
})
|
||||
|
||||
$('#tasktab').datagrid({
|
||||
url: 'api/checkproject?a=listall2',
|
||||
rownumbers: true,
|
||||
singleSelect: true,
|
||||
striped: true,
|
||||
fitColumns: true,
|
||||
method: 'get',
|
||||
pagination: 'true',
|
||||
pageSize: 20,
|
||||
border: false,
|
||||
toolbar:'#taskbar',
|
||||
columns: [[
|
||||
{ field: 'id', title: 'ID', hidden: true },
|
||||
{ field: 'checktitle', title: '检查名称', width: 100 },
|
||||
{ field: 'checkcontent', title: '检查内容', width: 100 },
|
||||
|
||||
{ field: 'createuser__name', title: '创建人', width: 300 },
|
||||
{ field: 'createdate', title: '创建时间', width: 300 },
|
||||
|
||||
|
||||
]]
|
||||
});
|
||||
function addtask(){
|
||||
opendg('新增检查任务','html/addchecktask?a=addcheck')
|
||||
}
|
||||
|
||||
|
||||
</script>
|
|
@ -1,4 +1,4 @@
|
|||
<!DOCTYPE html>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
@ -25,7 +25,7 @@
|
|||
<script type="text/javascript" src="/static/safesite/mystatic/js/jquery-qrcode-0.17.0.min.js"></script>
|
||||
<script src="https://cdn.bootcss.com/ckeditor/4.8.0/ckeditor.js"></script>
|
||||
<script type="text/javascript" src="/static/safesite/mystatic/openlayer/ol.js"></script>
|
||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
|
||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?zfeatures=requestAnimationFrame,Element.prototype.classList,URL"></script>
|
||||
<style type="text/css">
|
||||
.easyui-linkbutton:hover
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
switch (value) {
|
||||
case 1: return 'color:white;background-color:green'; break;
|
||||
}}},
|
||||
{ field: 'user__userid', title: '执行状态', width: 80, formatter: function (value, row, index) {
|
||||
{ field: 'user__userid', title: '执行状态', width: 80, formatter: function (value, row, index) {
|
||||
if(value==null){
|
||||
return '未执行';
|
||||
}else{
|
||||
|
|
|
@ -103,6 +103,17 @@ urlpatterns = [
|
|||
path('html/equipmentcheckform/',views.EquipmentCheckFormView.as_view()),
|
||||
path('html/equipmentcheckform/add',views.EquipmentCheckFormAddView.as_view()),
|
||||
path('html/equipmentcheckform/update/<int:pk>',views.EquipmentCheckFormUpdateView.as_view()),
|
||||
|
||||
|
||||
|
||||
|
||||
path('html/checktask',views.checktask),#检查任务
|
||||
path('html/addchecktask',views.addchecktask),#检查任务
|
||||
path('html/checklist',views.checklist),#检查任务
|
||||
path('html/addcheckrw',views.addcheckrw),#检查任务
|
||||
path('html/checkjob',views.checkjob),#检查任务
|
||||
path('html/addcheckjob/<int:id>/',views.addcheckjob),#检查任务
|
||||
path('html/detailjob/<int:id>/',views.detailjob),#任务详情
|
||||
#html页面
|
||||
|
||||
|
||||
|
@ -178,14 +189,6 @@ urlpatterns = [
|
|||
|
||||
path('api/examtestrate',views.apiexamtestrate),
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#path('api/rights/group/<int:groupid>',views.rightsgroup),
|
||||
path('api/main',views.mainapi),
|
||||
path('bindwechat', views.bwlogin,name='bwlogin'), #微信登陆绑定相关
|
||||
|
@ -194,7 +197,7 @@ urlpatterns = [
|
|||
path('unbindwechat', views.unbindwechat),
|
||||
path('unbindmp', views.unbindmp),
|
||||
path('mplogin',views.mplogin),
|
||||
|
||||
path('api/checkproject',views.checkprojects),#检查
|
||||
path('importusers',views.importusers),#其他
|
||||
path('test',views.test),
|
||||
path('.well-known/pki-validation/fileauth.txt',views.vewechat),#验证
|
||||
|
|
|
@ -3,7 +3,7 @@ from captcha.helpers import captcha_image_url
|
|||
from captcha.models import CaptchaStore
|
||||
from django.shortcuts import render, redirect, render_to_response
|
||||
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse
|
||||
from .models import User, Trouble, Dickey, Partment, Dicclass, Train, Drill, TroubleAccess, Group, Yjyc, Trainuser, Drilluser, Yjsetup, Menu, Observe, Observeto, Unsafes, Miss, Socertificate, Userprofile, Suggest, Notice, Noticeto, Operation, Operzyry, Fxcs, Operationspjd, Operspxq, Question, ExamPaper, ExamTest, ExamPaperDetail, ExamTestDetail, Questioncat, Safecert, Map, Area, Missto, Suggestflow, Equipment, Inspect, Risk, RiskAct, Risktask, Riskcheck, Report, RiskActTask, Riskcheck2,Resbility,Operproce,Readerblility,ReaderOperproce,Role,EquipmentCheckForm,EquipmentCheckItem
|
||||
from .models import User, Trouble, Dickey, Partment, Dicclass, Train, Drill, TroubleAccess, Group, Yjyc,Checktable, Trainuser, Drilluser, Yjsetup, Menu, Observe, Observeto, Unsafes, Miss, Socertificate, Userprofile, Suggest, Notice, Noticeto, Operation, Operzyry, Fxcs, Operationspjd, Operspxq, Question, ExamPaper, ExamTest, ExamPaperDetail, ExamTestDetail, Questioncat, Safecert, Map, Area, Missto, Suggestflow, Equipment, Inspect, Risk, RiskAct, Risktask, Riskcheck, Report, RiskActTask, Riskcheck2,Resbility,Operproce,Readerblility,ReaderOperproce,Role,EquipmentCheckForm,EquipmentCheckItem,Checkproject,Checktask,Checkjob
|
||||
from django.template import RequestContext
|
||||
from django.views.decorators.csrf import csrf_exempt
|
||||
from django.core import serializers
|
||||
|
@ -503,9 +503,20 @@ def operprocedetail(req, id):
|
|||
def datashow2(req):
|
||||
return render(req,'datashow2.html')
|
||||
|
||||
|
||||
|
||||
|
||||
def checktask(req):#检查项目
|
||||
return render(req, 'checktable.html')
|
||||
def addchecktask(req):#责任制
|
||||
return render(req,'checktabadd.html')
|
||||
def checkjob(req):
|
||||
return render(req,'checkjob.html')
|
||||
def addcheckjob(req,id):
|
||||
return render(req,'checkjobadd.html', {'id': id})
|
||||
def checklist(req):
|
||||
return render(req,'checklist.html')
|
||||
def addcheckrw(req):
|
||||
return render(req,'checklistadd.html')
|
||||
def detailjob(req,id):
|
||||
return render(req,'checkjobdetail.html',{'id':id})
|
||||
def mainhtml(req):
|
||||
# 计算一些数据
|
||||
userid = req.session['userid']
|
||||
|
@ -7630,3 +7641,180 @@ def getprodata(req):
|
|||
a = ReaderOperproce.objects.filter(readid=id).values('id','readeruser__name','readertime')
|
||||
total = a.count()
|
||||
return HttpResponse(transjson(total,a),content_type="application/json")
|
||||
def checkprojects(req):
|
||||
a = req.GET.get('a')
|
||||
userid = req.session['userid']
|
||||
companyid = getcompany(userid)
|
||||
if a == 'add':
|
||||
data = json.loads(req.body.decode('utf-8'))
|
||||
if data['id']==0:
|
||||
|
||||
|
||||
obj = Checkproject()
|
||||
|
||||
obj.checktitle = data['checktitle']
|
||||
obj.checkcontent = data['checkcontent']
|
||||
obj.createuser = User.objects.get(userid=userid)
|
||||
obj.requirements = data['requirements']
|
||||
obj.usecomp=Partment.objects.get(partid=companyid)
|
||||
obj.save()
|
||||
else:
|
||||
obj = Checkproject.objects.get(id=data['id'])
|
||||
|
||||
obj.checktitle = data['checktitle']
|
||||
obj.checkcontent = data['checkcontent']
|
||||
obj.requirements = data['requirements']
|
||||
obj.save()
|
||||
|
||||
|
||||
return JsonResponse({"code": 1})
|
||||
elif a == 'detail':
|
||||
obj = Checkproject.objects.filter(id=req.GET.get('id'))
|
||||
obj = obj.values('checktitle', 'checkcontent', 'requirements')[0]
|
||||
|
||||
return JsonResponse({'code': 1, 'data': obj})
|
||||
|
||||
elif a == 'project':
|
||||
projectlist = Checkproject.objects.filter(usecomp__partid=companyid).values('id', 'checktitle', 'checkcontent')
|
||||
return HttpResponse(transstr(projectlist,'id','checktitle'),content_type="application/json")
|
||||
elif a == 'listall':
|
||||
startnum,endnum = fenye(req)
|
||||
a = Checkproject.objects.filter(usecomp=Partment.objects.get(partid=companyid), deletemark=1)
|
||||
|
||||
total = a.count()
|
||||
startnum, endnum = fenye(req)
|
||||
a = a[startnum:endnum].values('id','checktitle', 'checkcontent', 'requirements', 'createuser__name', 'createdate')
|
||||
|
||||
return HttpResponse(transjson(total, a), content_type="application/json")
|
||||
#任务表保存
|
||||
elif a == 'addcheck':
|
||||
data = json.loads(req.body.decode('utf-8'))
|
||||
obj = Checktable()
|
||||
obj.checktitle = data['checktaskname']
|
||||
obj.checkcontent=data['checkcontent']
|
||||
obj.createuser = User.objects.get(userid=userid)
|
||||
obj.usecomp=Partment.objects.get(partid=companyid)
|
||||
obj.save()
|
||||
#list = data['checkprjtype']
|
||||
#for i in list:
|
||||
# x = Checkproject.objects.get(id=i)
|
||||
# obj.checkprjtype.add(x)
|
||||
return JsonResponse({"code": 1})
|
||||
#任务列表
|
||||
elif a == 'listall2':
|
||||
startnum,endnum = fenye(req)
|
||||
a = Checktable.objects.filter(usecomp=Partment.objects.get(partid=companyid), deletemark=1)
|
||||
total = a.count()
|
||||
startnum, endnum = fenye(req)
|
||||
|
||||
a = a[startnum:endnum].values('id','checktitle','checkcontent', 'createuser__name','createdate')
|
||||
|
||||
return HttpResponse(transjson(total, a), content_type="application/json")
|
||||
elif a == 'listall3':
|
||||
startnum,endnum = fenye(req)
|
||||
a = Checktask.objects.filter(usecomp=Partment.objects.get(partid=companyid), deletemark=1)
|
||||
total = a.count()
|
||||
startnum, endnum = fenye(req)
|
||||
|
||||
a = a[startnum:endnum].values('id','checktaskname','checktype__checktitle','checkplace', 'checktime','createuser__name','createdate')
|
||||
|
||||
return HttpResponse(transjson(total, a), content_type="application/json")
|
||||
elif a == 'listall4':
|
||||
startnum,endnum = fenye(req)
|
||||
a = Checkjob.objects.filter(usecomp=Partment.objects.get(partid=companyid),checkname__userid=userid,deletemark=1)
|
||||
total = a.count()
|
||||
startnum, endnum = fenye(req)
|
||||
|
||||
a = a[startnum:endnum].values('id','checktask__checktaskname','yanshou','checkquestion','zguser__username','zgtime','checktask__checktype__checktitle','checkname__username', 'taskstate','checktask__checktime','createuser__username','createdate')
|
||||
|
||||
return HttpResponse(transjson(total, a), content_type="application/json")
|
||||
|
||||
|
||||
elif a == 'listchuli':
|
||||
a = Checkjob.objects.filter(usecomp=Partment.objects.get(partid=companyid),taskstate=2,checktask__createuser__userid=userid).exclude(deletemark=0)
|
||||
total = a.count()
|
||||
startnum, endnum = fenye(req)
|
||||
a = a[startnum:endnum].values('id','checktask__checktaskname','checkquestion','zguser__username','zgtime','checktask__checktype__checktitle','checkname__username', 'taskstate','checktask__checktime','createuser__username','createdate')
|
||||
|
||||
return HttpResponse(transjson(total, a), content_type="application/json")
|
||||
elif a == 'listself':
|
||||
a = Checkjob.objects.filter(usecomp=Partment.objects.get(partid=companyid),checkname__userid=userid,deletemark=1)
|
||||
total = a.count()
|
||||
startnum, endnum = fenye(req)
|
||||
|
||||
a = a[startnum:endnum].values('id','checktask__checktaskname','checkquestion','zguser__username','zgtime','checktask__checktype__checktitle','checkname__username', 'taskstate','checktask__checktime','createuser__username','createdate')
|
||||
|
||||
return HttpResponse(transjson(total, a), content_type="application/json")
|
||||
elif a == 'listallx':
|
||||
a = Checkjob.objects.filter(usecomp=Partment.objects.get(
|
||||
partid=companyid),deletemark=1)
|
||||
total = a.count()
|
||||
startnum, endnum = fenye(req)
|
||||
a = a[startnum:endnum].values('id','checktask__checktaskname','checkquestion','zguser__username','zgtime','checktask__checktype__checktitle','checkname__username', 'taskstate','checktask__checktime','createuser__username','createdate')
|
||||
|
||||
return HttpResponse(transjson(total, a), content_type="application/json")
|
||||
|
||||
elif a == 'jobdetail':
|
||||
obj = Checkjob.objects.filter(id=req.GET.get('id'))
|
||||
obj = obj.values('checktask__checktaskname','zguser','checkplace','checktask__checktype__checkcontent','checkname__username','checktask__checktime')[0]
|
||||
|
||||
return JsonResponse({'code': 1, 'data': obj})
|
||||
elif a == 'addjob':
|
||||
data = json.loads(req.body.decode('utf-8'))
|
||||
obj = Checkjob.objects.get(id=req.GET.get('jobid'))
|
||||
obj.checkquestion = data['checkquestion']
|
||||
|
||||
obj.taskstate = data['taskstate']
|
||||
obj.createuser = User.objects.get(userid=userid)
|
||||
obj.save()
|
||||
return JsonResponse({'code': 1})
|
||||
elif a == 'yanshou':
|
||||
obj = Checkjob.objects.get(id=req.GET.get('id'))
|
||||
obj.yanshou = datetime.now()
|
||||
obj.yanshouren = User.objects.get(userid=userid)
|
||||
obj.save()
|
||||
return JsonResponse({'code': 1})
|
||||
elif a=='checktablist':
|
||||
projectlist = Checktable.objects.filter(usecomp__partid=companyid).values('id', 'checktitle')
|
||||
return HttpResponse(transstr(projectlist,'id','checktitle'),content_type="application/json")
|
||||
elif a=='addchecklist':
|
||||
data = json.loads(req.body.decode('utf-8'))
|
||||
obj = Checktask()
|
||||
obj.checktaskname = data['checktaskname']
|
||||
obj.checktime=data['starttime']
|
||||
obj.checkplace=data['checkplace']
|
||||
obj.checktype =Checktable.objects.get(id=data['checktabtitle'])
|
||||
obj.createuser = User.objects.get(userid=userid)
|
||||
obj.usecomp=Partment.objects.get(partid=companyid)
|
||||
obj.save()
|
||||
|
||||
list = data['participant'].split(',')
|
||||
for i in list:
|
||||
x = User.objects.get(userid=i)
|
||||
obj.checkname.add(x)
|
||||
objs = Checkjob()
|
||||
objs.checktask=obj
|
||||
objs.checkname=x
|
||||
objs.usecomp=Partment.objects.get(partid=companyid)
|
||||
objs.save()
|
||||
|
||||
return JsonResponse({"code": 1})
|
||||
#删除
|
||||
elif a == 'del':
|
||||
id =req.GET.get('id')
|
||||
a = Checkproject.objects.get(id=id)
|
||||
if a.createuser==User.objects.get(userid=userid):
|
||||
a.deletemark=0
|
||||
a.save()
|
||||
return JsonResponse({"code":1})
|
||||
|
||||
else:
|
||||
|
||||
return JsonResponse({"code":0})
|
||||
elif a == 'checkjobdetail':
|
||||
id = req.GET.get('id')
|
||||
a = Checkjob.objects.filter(id=id)
|
||||
x = a.values('checktask__checktaskname','zguser__username','checktask__checktype__checkcontent','checktask__checkplace','checktask__checktime' ,'checkname__username', 'checkquestion', 'zgtime', 'zguser__username', 'createuser__username',
|
||||
'createdate', 'taskstate', 'zgyq','zgjg', 'yanshou', 'yanshouren__username')[0]
|
||||
|
||||
return HttpResponse(json.dumps(x, cls=MyEncoder), content_type="application/json")
|
Loading…
Reference in New Issue