diff --git a/safesite/static/safesite/easyui/themes/icon.css b/safesite/static/safesite/easyui/themes/icon.css index 33786e43..82778c70 100644 --- a/safesite/static/safesite/easyui/themes/icon.css +++ b/safesite/static/safesite/easyui/themes/icon.css @@ -175,6 +175,9 @@ .icon-zeren { background: url('icons/zeren.png') no-repeat center center; } +.icon-inspectitem { + background: url('icons/inspectitem.png') no-repeat center center; +} diff --git a/safesite/static/safesite/easyui/themes/icons/inspectitem.png b/safesite/static/safesite/easyui/themes/icons/inspectitem.png new file mode 100644 index 00000000..d65c428a Binary files /dev/null and b/safesite/static/safesite/easyui/themes/icons/inspectitem.png differ diff --git a/safesite/templates/inspect.html b/safesite/templates/inspect.html index 99bb9098..c9b0fa73 100644 --- a/safesite/templates/inspect.html +++ b/safesite/templates/inspect.html @@ -102,51 +102,52 @@ { field: 'id', title: 'ID', hidden: true }, { field: 'user__ubelongpart__partname', title: '巡检部门', width: 100 }, { field: 'user__name', title: '巡检人', width: 80 }, + { field: 'type__dickeyname', title: '巡检类型', width: 80 }, { field: 'equipment__num', title: '编号', width: 80 }, { field: 'equipment__name', title: '设备名称', width: 80 }, { field: 'equipment__area__name', title: '区域', width: 80 }, - { field: 'state', title: '设备状态', width: 80 , styler: function (value, row, index) { - if (value == 1) { - return 'background-color:green;color:white'; - }else{ return 'background-color:red;'; } - }, formatter: function (value, row, index) { - if (value == 1) { - return '正常'; - }else{return '异常'} - } - }, - { field: 'trouble__yhzt', title: '隐患处理', width: 80 , styler: function (value, row, index) { - switch (value) { - case 0: return 'background-color:yellow;'; break; - case 1: return 'background-color:yellow;'; break; - case 2: return 'background-color:yellow;'; break; - case 3: return 'background-color:yellow;'; break; - case 4: return 'background-color:yellow;'; break; - case 5: return 'background-color:yellow;'; break; - case 6: return 'background-color:green;'; break; - case 7: return 'background-color:yellow;'; break; - } - if(row.zgqx){ + // { field: 'state', title: '设备状态', width: 80 , styler: function (value, row, index) { + // if (value == 1) { + // return 'background-color:green;color:white'; + // }else{ return 'background-color:red;'; } + // }, formatter: function (value, row, index) { + // if (value == 1) { + // return '正常'; + // }else{return '异常'} + // } + // }, + // { field: 'trouble__yhzt', title: '隐患处理', width: 80 , styler: function (value, row, index) { + // switch (value) { + // case 0: return 'background-color:yellow;'; break; + // case 1: return 'background-color:yellow;'; break; + // case 2: return 'background-color:yellow;'; break; + // case 3: return 'background-color:yellow;'; break; + // case 4: return 'background-color:yellow;'; break; + // case 5: return 'background-color:yellow;'; break; + // case 6: return 'background-color:green;'; break; + // case 7: return 'background-color:yellow;'; break; + // } + // if(row.zgqx){ - } - }, formatter: function (value, row, index) { - switch (value) { - case 0: return '待新增'; break; - case 1: return '待评估'; break; - case 2: return '措施/方案待确认'; break; - case 3: return '待整改'; break; - case 4: return '待审核'; break; - case 5: return '待复查'; break; - case 6: return '已归档'; break; - case 7: return '措施/方案待提交'; break; - } - } - }, - { field: 'content', title: '巡检结论', width: 200 , formatter: function (value, row, index) { - if(value==null){ - return row.trouble__yhms - } - }}, + // } + // }, formatter: function (value, row, index) { + // switch (value) { + // case 0: return '待新增'; break; + // case 1: return '待评估'; break; + // case 2: return '措施/方案待确认'; break; + // case 3: return '待整改'; break; + // case 4: return '待审核'; break; + // case 5: return '待复查'; break; + // case 6: return '已归档'; break; + // case 7: return '措施/方案待提交'; break; + // } + // } + // }, + // { field: 'content', title: '巡检结论', width: 200 , formatter: function (value, row, index) { + // if(value==null){ + // return row.trouble__yhms + // } + // }}, { field: 'creattime', title: '提交时间', width: 100 }, ]] diff --git a/safesite/templates/inspectitem.html b/safesite/templates/inspectitem.html new file mode 100644 index 00000000..d339f694 --- /dev/null +++ b/safesite/templates/inspectitem.html @@ -0,0 +1,161 @@ +
+ +
+ + +
+ + +
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+ 查询 +
+ +
+
+
+ \ No newline at end of file diff --git a/safesite/urls.py b/safesite/urls.py index 6cd88058..cacd30bc 100644 --- a/safesite/urls.py +++ b/safesite/urls.py @@ -75,6 +75,7 @@ urlpatterns = [ path('html/area/add',views.areaadd), path('html/area/edit//',views.areaedit), path('html/equipment',views.equipment), + path('html/inspectitem',views.inspectitem), path('html/inspect',views.inspect), path('html/risk',views.risk), path('html/riskact/add',views.riskactadd), diff --git a/safesite/views.py b/safesite/views.py index f623cb4c..0701bc63 100644 --- a/safesite/views.py +++ b/safesite/views.py @@ -211,6 +211,8 @@ def risk(req): def inspect(req): return render(req, 'inspect.html') +def inspectitem(req): + return render(req, 'inspectitem.html') def equipment(req): return render(req, 'equipment.html') @@ -6841,7 +6843,13 @@ def apiinspectitem(req): startnum, endnum = fenye(req) objs = objs.order_by('-id')[startnum:endnum].values('id', 'state', 'inspect', 'checkitem', 'inspect__equipment__name', 'checkitem__name','inspect__user__name', 'inspect__creattime', 'inspect__equipment__num', 'inspect__type__dickeyname','todouser__name') return HttpResponse(transjson(total, objs), content_type="application/json") - elif a == 'listall':#我已处理的异常 + elif a == 'listyc':#全部异常 + objs = InspectItem.objects.filter(inspect__usecomp__partid=companyid).exclude(state='正常') + total = objs.count() + startnum, endnum = fenye(req) + objs = objs.order_by('-id')[startnum:endnum].values('id', 'state', 'inspect', 'checkitem', 'inspect__equipment__name', 'checkitem__name','inspect__user__name', 'inspect__creattime', 'inspect__equipment__num', 'inspect__type__dickeyname','todouser__name') + return HttpResponse(transjson(total, objs), content_type="application/json") + elif a == 'listall':#全部 objs = InspectItem.objects if req.GET.get('inspect'): objs = objs.filter(inspect__id=req.GET.get('inspect'))