diff --git a/safesite/edu/views.py b/safesite/edu/views.py
index 506eb3ba..73f4c662 100644
--- a/safesite/edu/views.py
+++ b/safesite/edu/views.py
@@ -80,10 +80,10 @@ def api(req):
startnum,endnum=fenye(req)
a = a.order_by('-downnum','-modifytime')[startnum:endnum].values('id','num','title','user__name','user__ubelongpart__partname','desciption','submittime','type','cate__name','url','downnum','modifytime')
return HttpResponse(transjson(total,a),content_type="application/json")
- elif a == 'detail':
- id = req.GET.get('id')
- obj = Edulesson.objects.filter(id=id).values('id','num','title','user__name','user__ubelongpart__partname','desciption','submittime','type','cate__name','url','downnum','modifytime')
- return JsonResponse(list(obj)[0])
+ # elif a == 'detail':
+ # id = req.GET.get('eduid')
+ # obj = Edulesson.objects.filter(id=id).values('id','num','title','user__name','user__ubelongpart__partname','desciption','submittime','type','cate__name','url','downnum','modifytime')
+ # return JsonResponse(list(obj)[0])
#视频
elif a=='add':
userid = req.session['userid']#用户ID
@@ -168,7 +168,11 @@ def api(req):
return JsonResponse({"code":1,"url": a.url})
#观看详情
elif a=='detail':
- id=req.GET.get('zrid')
- a = EdulessonWatch.objects.filter(edulesson=id).values('id','user__name','submittime')
- total = a.count()
- return HttpResponse(transjson(total,a),content_type="application/json")
\ No newline at end of file
+ id=req.GET.get('eduid')
+ userid = req.session['userid']
+ companyid = getcompany(userid)#公司ID
+ objs = EdulessonWatch.objects.filter(edulesson=id, user__usecomp=companyid)
+ total = objs.count()
+ startnum, endnum = fenye(req)
+ objs_data = objs.order_by('-submittime')[startnum:endnum].values('id','user__name','submittime')
+ return HttpResponse(transjson(total, objs_data), content_type="application/json")
\ No newline at end of file
diff --git a/safesite/templates/edulessondetail.html b/safesite/templates/edulessondetail.html
index 9a2382d5..d6de5d5b 100644
--- a/safesite/templates/edulessondetail.html
+++ b/safesite/templates/edulessondetail.html
@@ -1,6 +1,6 @@
-
-
+
@@ -9,7 +9,7 @@
var eduid = {{ jyid }};
var html;
- $('#zytable').datagrid({
+ $('#eduwatchtable').datagrid({
url: 'edu/api?a=detail&eduid=' + eduid,
rownumbers: true,
singleSelect: true,
@@ -17,7 +17,8 @@
fitColumns: true,
method: 'get',
pageSize: 20,
- toolbar: '#zytablebar',
+ pagination: 'true',
+ toolbar: '#eduwatchtablebar',
columns: [[
{ field: 'id', title: 'ID', hidden: true },
{ field: 'user__name', title: '观看人', width: 80 },
diff --git a/safesite/templates/edulessonindex.html b/safesite/templates/edulessonindex.html
index ec8e37d7..d4a174a0 100644
--- a/safesite/templates/edulessonindex.html
+++ b/safesite/templates/edulessonindex.html
@@ -30,9 +30,9 @@
{% if request|has_permission:'b_edu_study' %}
下载/查看
{% endif %}
-
+ {% if request|has_permission:'b_edu_addfile' %}
+
观看历史
+ {% endif %}
@@ -159,7 +159,7 @@
$.messager.alert('提示', '请选择一行数据!');
}
}
- function jydetail() {
+ function edudetail() {
var row = $('#edutab').datagrid('getSelected');
if (row) {
var url = 'edu/html/edulessondetail/detail/' + row.id
diff --git a/safesite/templates/trouble.html b/safesite/templates/trouble.html
index 86d15f3a..d6fd83d4 100644
--- a/safesite/templates/trouble.html
+++ b/safesite/templates/trouble.html
@@ -34,6 +34,9 @@
{% if request|has_permission:'b_trouble_exportxls' %}
导出无图Excel
{% endif %}
+ {% if request|has_permission:'b_trouble_exportxls' %}
+ 导出选中
+ {% endif %}
@@ -98,7 +101,6 @@
$('#yhtable').datagrid({
rownumbers: true,
- singleSelect: true,
striped: true,
method: 'get',
url: '',
@@ -109,9 +111,10 @@
border: false,
columns: [[
{ field: 'troubleid', hidden: true },
+ { field: 'ck', checkbox: true , width: 20},
{ field: 'yhnum', title: '编号', width: 100 },
{
- field: 'yhzt', title: '流程状态', width: 100, styler: function (value, row, index) {
+ field: 'yhzt', title: '流程状态', width: 60, styler: function (value, row, index) {
switch (value) {
case 0: return 'background-color:yellow;'; break;
case 1: return 'background-color:yellow;'; break;
@@ -147,7 +150,7 @@
{ field: 'todouser__userid', hidden: true },
{ field: 'sybzt', hidden: true },
{
- field: 'shresult', title: '隐患状态', width: 100, styler: function (value, row, index) {
+ field: 'shresult', title: '隐患状态', width: 80, styler: function (value, row, index) {
switch (value) {
case 1: return ''; break;
case 2: return 'color:red;font-weight:bold'; break;
@@ -338,6 +341,21 @@
window.open(url);
// $('').appendTo('body').submit().remove();
}
+ function exportyhexcel3() {
+ var rows = $('#yhtable').datagrid('getSelections');
+ if(rows.length>0){
+ var data = {'ids':[]}
+ for(var i=0;i