修改在线考试详情

This commit is contained in:
shilixia 2019-12-11 09:31:30 +08:00
commit 08565de0e3
12 changed files with 4553 additions and 3486 deletions

View File

@ -0,0 +1,21 @@
# Generated by Django 2.2.8 on 2019-12-06 15:59
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('safesite', '0295_auto_20191205_1702'),
]
operations = [
# migrations.RemoveField(
# model_name='companyinfo',
# name='liaison_fax',
# ),
migrations.RemoveField(
model_name='operation',
name='issimple',
),
]

File diff suppressed because it is too large Load Diff

View File

@ -349,6 +349,22 @@ function choseusers(x) {
}); });
$('#userdd').window('center'); $('#userdd').window('center');
} }
function choseuser(x) {
var x = x || 'lecturer';
var myh = screen.availHeight * 0.7;
$('#userdd').dialog({
maximizable: true,
title: '选择人员',
width: 900,
height: myh,
closed: false,
cache: false,
href: 'getuserf?a=' + x,
modal: true,
border: false,
});
$('#userdd').window('center');
}
//导出excel //导出excel
function JSONToCSVConvertor(JSONData, ReportTitle, ShowLabel) { function JSONToCSVConvertor(JSONData, ReportTitle, ShowLabel) {
//If JSONData is not an object then JSON.parse will parse the JSON string in an Object //If JSONData is not an object then JSON.parse will parse the JSON string in an Object

View File

@ -1,24 +1,49 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>绑定微信号</title>
<style>
*{margin:0;padding:0;outline:0;}
#p{ margin:10px 10px;font-size: 18px;}
</style>
</head>
<body>
<p id = "p">{{msg}}</p>
{% if code == 1 %}
<p>您已可接受微信通知</p>
<p>可识别下方二维码打开小程序</p>
<img src="/static/safesite/mystatic/images/weixinmp.jpg" width="80%" height="80%" style="margin-top:10px;text-align: center" />
{% endif %}
{% if code != 1 %}
<img src="/static/safesite/mystatic/images/ctcgzh.jpg" width="80%" height="80%" style="margin-top:10px;text-align: center" />
{% endif %} <head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<title>绑定微信号</title>
<style>
* {
margin: 0;
padding: 0;
outline: 0;
}
#p {
margin: 10px 10px;
font-size: 18px;
}
</style>
</head>
<body>
<p id="p">{{msg}}</p>
{% if code == 1 %}
<p>您已可接受微信通知</p>
<div id="mpdiv">
<p>可识别下方二维码打开小程序</p>
<img src="/static/safesite/mystatic/images/weixinmp.jpg" width="80%" height="80%"
style="margin-top:10px;text-align: center" />
</div>
{% endif %}
{% if code != 1 %}
<img src="/static/safesite/mystatic/images/ctcgzh.jpg" width="80%" height="80%"
style="margin-top:10px;text-align: center" />
{% endif %}
<script>
if(window.__wxjs_environment === 'miniprogram'){document.getElementById("mpdiv").innerHTML = "<input onclick='back()' type='button' value='返回小程序'></input>"
}
function back(){
wx.miniProgram.reLaunch({url:'/pages/main/main'})
}
</script>
</body> </body>
</html> </html>

View File

@ -1,7 +1,8 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv='refresh' content='1800'>
<title>数据大屏</title> <title>数据大屏</title>
<link rel="stylesheet" href="/static/safesite/mystatic/css/bigdata/style.css" /> <link rel="stylesheet" href="/static/safesite/mystatic/css/bigdata/style.css" />

View File

@ -89,6 +89,7 @@
{{each cjrydetail}} {{each cjrydetail}}
<tr> <tr>
<td>{{$index+1}}</td> <td>{{$index+1}}</td>
<td id="examdlid" style="display:none">{{$value.id}}</td>
<td>{{$value.user__name}}</td> <td>{{$value.user__name}}</td>
<td>{{$value.user__ubelongpart__partname}}</td> <td>{{$value.user__ubelongpart__partname}}</td>
{{if $value.ison==0}} {{if $value.ison==0}}
@ -98,10 +99,10 @@
{{/if}} {{/if}}
<td>{{$value.score}}</td> <td>{{$value.score}}</td>
<td>{{$value.took}}</td> <td>{{$value.took}}</td>
<td id="examdlid" style="display:none">{{$value.id}}</td>
<td><a target="_blank" href="/html/examhistory/{{$value.id}}">点击查看</a></td> <td><a target="_blank" href="/html/examhistory/{{$value.id}}">点击查看</a></td>
{{if $value.passcode==0&&$value.ison==1&&state==1}} {{if $value.passcode==0&&$value.ison==1&&state==1}}
<td><button style="background-color: #00ff5a;color: #004eff;" onclick="updateIson()">重新发布试卷</button></td> <td><button style="background-color: #00ff5a;color: #004eff;" onclick="showzhi(this)">重新发布试卷</button></td>
{{else}} {{else}}
<td><font color="green"></font></td> <td><font color="green"></font></td>
{{/if}} {{/if}}
@ -196,20 +197,24 @@
} }
}); });
} }
function updateIson() {
var examdlid = document.getElementById("examdlid").innerHTML; function showzhi(obj) {
var x = $(obj).parent().parent().find("td");
var examdlid = x.eq(1).text()
$.ajax({ $.ajax({
type: "get", type: "get",
url: "api/examtestdetail?a=updateison", url: "api/examtestdetail?a=updateison",
contentType: 'application/json; charset=utf-8', contentType: 'application/json; charset=utf-8',
data: { id: ksid, examdlid: examdlid}, data: { id: ksid, examdlid: examdlid},
success: function (data) { success: function (data) {
alert(data.msg); alert(data.msg);
$("#dd").dialog("close"); $("#dd").dialog("close");
} }
}); });
} };
</script> </script>

View File

@ -1,7 +1,8 @@
<table id="zytable" style="width:auto;height:100%;"></table> <table id="zytable" style="width:auto;height:100%;"></table>
<div id="zytablebar" style="padding:6px;height:auto"> <div id="zytablebar" style="padding:6px;height:auto">
<div style="margin-bottom:2px;margin-top:2px"> <div style="margin-bottom:2px;margin-top:2px">
<!-- <a class="easyui-menubutton" data-options="menu:'#mm1',iconCls: 'fa-plus',plain:true">申请</a> --> <a class="easyui-linkbutton" data-options="iconCls: 'fa-plus',plain:true" onclick="javascript:opendg('申请作业','html/operation/add')">申请作业(无审批)</a>
<a id="gbzy" class="easyui-linkbutton" onclick="gbzy()" data-options="iconCls: 'fa-close',plain:true">关闭作业</a>
<a onclick="javascript:$('#sdg_zy').dialog('open')" class="easyui-linkbutton" data-options="iconCls: 'fa-search',plain:true">详细筛选</a> <a onclick="javascript:$('#sdg_zy').dialog('open')" class="easyui-linkbutton" data-options="iconCls: 'fa-search',plain:true">详细筛选</a>
<a id="delzy" class="easyui-linkbutton" onclick="delzy()" data-options="iconCls: 'fa-trash',plain:true">删除</a> <a id="delzy" class="easyui-linkbutton" onclick="delzy()" data-options="iconCls: 'fa-trash',plain:true">删除</a>
<a id="zydetail" onclick="zydetail()" class="easyui-linkbutton" data-options="iconCls: 'fa-info-circle',plain:true">查看详情</a> <a id="zydetail" onclick="zydetail()" class="easyui-linkbutton" data-options="iconCls: 'fa-info-circle',plain:true">查看详情</a>
@ -74,12 +75,23 @@
border:false, border:false,
columns: [[ columns: [[
{ field: 'zyid', title: 'ID', hidden: true }, { field: 'zyid', title: 'ID', hidden: true },
{ field: 'zynum', title: '编号', width: 120 }, { field: 'zynum', title: '编号', width: 100 },
{ field: 'zyzt', title: '作业状态', width: 120 ,formatter: function (value, row, index) { { field: 'zyzt', title: '作业状态', width: 60 ,formatter: function (value, row, index) {
return value.zyzt; if(value.splc==0){
} }, return value.zyzt + '(无流程)'
{ field: 'zylx__dickeyname', title: '作业类型', width: 120 }, }else{
{ field: 'zyfzr__name', title: '作业负责人', width: 120 }, return value.zyzt;
}
}, styler: function (value, row, index) {
switch (value.zyzt) {
case '已关闭': return 'background-color:green;color:white'; break;
case '待关闭': return 'background-color:orange;'; break;
}
}},
{ field: 'zyqy__name', title: '作业区域', width: 100 },
{ field: 'zylx__dickeyname', title: '作业类型', width: 100 },
{ field: 'zyfzr__name', title: '作业负责人', width: 100 },
{ field: 'zynr', title: '作业内容', width: 200 }, { field: 'zynr', title: '作业内容', width: 200 },
{ field: 'submittime', title: '提交时间', width: 100 }, { field: 'submittime', title: '提交时间', width: 100 },
]] ]]
@ -136,5 +148,37 @@
let url = 'api/operation?a=exportexcel' let url = 'api/operation?a=exportexcel'
$('<form method="post" action="' + url + '"></form>').appendTo('body').submit().remove(); $('<form method="post" action="' + url + '"></form>').appendTo('body').submit().remove();
} }
function gbzy(){
var row = $('#zytable').datagrid('getSelected');
if (row) {
$.messager.confirm('提示', '确定关闭该作业吗?', function (r) {
if (r) {
$.ajax({
type: "POST",
url: 'api/operation?a=gbzy',
data: JSON.stringify({ 'zyid': row.zyid }),
datatype: "json",
contentType: "application/json;charset=utf-8",
beforeSend: function () { },
success: function (data) {
if (data.code == 1) {
$("#zytable").datagrid('reload');
}
else {
$.messager.alert('提示', '你无权关闭该作业!');
}
},
complete: function (XMLHttpRequest, textStatus) {
},
error: function () {
}
});
}
});
}
else {
$.messager.alert('提示', '请选择一行数据!');
}
}
</script> </script>

View File

@ -6,9 +6,56 @@
</div> </div>
<div data-options="region:'center'" style="height:100%;padding:15px 15px;"> <div data-options="region:'center'" style="height:100%;padding:15px 15px;">
<form id="zyff" method="post" name="zyff" enctype="multipart/form-data"> <form id="zyff" method="post" name="zyff" enctype="multipart/form-data">
<div style="margin-bottom:5px">
<input editable="false" class="easyui-combobox" required=true name="zylx" id="zylx" style="width:480px" data-options="
label:'作业类型',
url:'getdickey?dicclass=33&a=combobox',
method: 'get',
valueField:'value',
textField:'text',
" />
</div>
<div style="margin-bottom:5px">
<input id="zyqy" class="easyui-combotree" name="zyqy" style="width:480px" data-options="
label:'作业区域',
url: 'api/area?a=tree',
method: 'get',
editable: false,
loadFilter: function (rows) {
return convert(rows);
},
formatter: function (node) {
var s = node.text;
if (node.children) {
s += '&nbsp;<span style=\'color:blue\'>(' + node.children.length + ')</span>';
}
return s;
},"
required=true>
</div>
<div style="margin-top:10px;margin-bottom:5px"> <div style="margin-top:10px;margin-bottom:5px">
<input id="zydd" class="easyui-textbox" name="zydd" style="width:480px" data-options="label:'作业地点'" <input id="zydd" class="easyui-textbox" name="zydd" style="width:480px" data-options="label:'具体地点'" />
</div>
<div style="margin-bottom:5px">
<input id="zybm" name="zybm" style="width:480px;" class="easyui-combotree" data-options="label:'作业部门',"
required=true /> required=true />
<script>
$("#zybm").combotree({
url: 'parthandle?a=tree',
method: 'get',
loadFilter: function (rows) {
return convert(rows);
},
formatter: function (node) {
var s = node.text;
if (node.children) {
s += '&nbsp;<span style=\'color:blue\'>(' + node.children.length + ')</span>';
}
return s;
},
editable: false,
});
</script>
</div> </div>
<div style="margin-bottom:5px"> <div style="margin-bottom:5px">
<input id="sdbm" name="sdbm" style="width:480px;" class="easyui-combotree" data-options="label:'属地部门'," <input id="sdbm" name="sdbm" style="width:480px;" class="easyui-combotree" data-options="label:'属地部门',"
@ -32,16 +79,10 @@
</script> </script>
</div> </div>
<div style="margin-bottom:5px"> <div style="margin-bottom:5px">
<input id="zynr" class="easyui-textbox" name="zynr" style="width:480px;height:100px" <input class="easyui-textbox" id="zyfzrname" style="width:480px;" editable="false"
data-options="label:'作业内容',multiline:true" required=true /> data-options="label:'作业负责人',prompt:'请选择'" required=true>
</div> <input type="hidden" id="zyfzr" name="zyfzr" />
<div style="margin-bottom:5px;"> <a class='easyui-linkbutton' onclick="choseuser('zyfzr')" style="width:auto">选择</a>
<input id="kssj" editable="false" name="kssj" class="easyui-datetimebox" style="width:480px"
data-options="label:'开始时间',currentText:'今天',closeText:'关闭',showSeconds:false" required=true />
</div>
<div style="margin-bottom:5px;">
<input id="jssj" editable="false" name="jssj" class="easyui-datetimebox" style="width:480px"
data-options="label:'结束时间',currentText:'今天',closeText:'关闭',showSeconds:false" required=true />
</div> </div>
<div style="margin-bottom:5px"> <div style="margin-bottom:5px">
<input class="easyui-textbox" id="zyryname" style="width:480px;height:60px" editable="false" <input class="easyui-textbox" id="zyryname" style="width:480px;height:60px" editable="false"
@ -49,7 +90,20 @@
<input type="hidden" id="zyry" name="zyry" /> <input type="hidden" id="zyry" name="zyry" />
<a class='easyui-linkbutton' onclick="choseusers('zyry')" style="width:auto">选择</a> <a class='easyui-linkbutton' onclick="choseusers('zyry')" style="width:auto">选择</a>
</div> </div>
<div style="margin-bottom:5px;">
<input id="kssj" editable="false" name="kssj" class="easyui-datetimebox" style="width:480px"
data-options="label:'开始时间',currentText:'今天',closeText:'关闭',showSeconds:false" required=true />
</div>
<div style="margin-bottom:5px;">
<input id="jssj" editable="false" name="jssj" class="easyui-datetimebox" style="width:480px"
data-options="label:'预计结束',currentText:'今天',closeText:'关闭',showSeconds:false" required=true />
</div>
<div style="margin-bottom:5px"> <div style="margin-bottom:5px">
<input id="zynr" class="easyui-textbox" name="zynr" style="width:480px;height:100px"
data-options="label:'作业内容',multiline:true" required=true />
</div>
<!-- <div style="margin-bottom:5px">
<input type="hidden" name="zyimg" id="zyimg" /> <input type="hidden" name="zyimg" id="zyimg" />
<label>现场图片</label><input type="file" id="file" name="" accept="image/*" style="margin-left:30px;" /> <label>现场图片</label><input type="file" id="file" name="" accept="image/*" style="margin-left:30px;" />
<span id='ps' style="display:none"> <span id='ps' style="display:none">
@ -66,50 +120,54 @@
<p>安全措施:{{x.aqcs}}</p> <p>安全措施:{{x.aqcs}}</p>
<p>措施类型:{{x.cslx}}</p> <p>措施类型:{{x.cslx}}</p>
</div> </div>
</div> </div> -->
</form> </form>
</div> </div>
</div> </div>
<script> <script>
$.get('api/fxcs?a=listall&zylx='+{{zyid}}, function (data) { // $.get('api/fxcs?a=listall&zylx='+{{zyid}}, function (data) {
let html ='' // let html =''
for (var x = 0, len = data.length; x < len; x++) { // for (var x = 0, len = data.length; x < len; x++) {
html += '<div><input type="checkbox" name="fxcs" value="' + data[x].id + '">' + '</input></div>' // html += '<div><input type="checkbox" name="fxcs" value="' + data[x].id + '">' + '</input></div>'
} // }
$('#fxfxdiv').append(html) // $('#fxfxdiv').append(html)
}); // });
function aaa(x) { function aaa(x) {
if (x == "zyry") { if (x == "zyry") {
$('#zyry').attr('value', top.$('#in').val()); $('#zyry').attr('value', top.$('#in').val());
$('#zyryname').textbox('setValue', top.$('#in').attr('show')); $('#zyryname').textbox('setValue', top.$('#in').attr('show'));
$('#zyrynum').textbox('setValue', top.$('#in').attr('total')); $('#zyrynum').textbox('setValue', top.$('#in').attr('total'));
}else if(x == "zyfzr"){
$('#zyfzr').attr('value', top.$('#in').val());
$('#zyfzrname').textbox('setValue', top.$('#in').attr('show'));
} }
} }
function getfxcs() { // function getfxcs() {
obj = document.getElementsByName("fxfx"); // obj = document.getElementsByName("fxfx");
obj2 = document.getElementsByName("aqcs"); // obj2 = document.getElementsByName("aqcs");
check_val = {'fxfx':[],'aqcs':[]}; // check_val = {'fxfx':[],'aqcs':[]};
for (k in obj) { // for (k in obj) {
if (obj[k].checked) // if (obj[k].checked)
check_val['fxfx'].push(obj[k].value); // check_val['fxfx'].push(obj[k].value);
} // }
for (k in obj2) { // for (k in obj2) {
if (obj2[k].checked) // if (obj2[k].checked)
check_val['aqcs'].push(obj2[k].value); // check_val['aqcs'].push(obj2[k].value);
} // }
return check_val; // return check_val;
} // }
function zysubmitForm() { function zysubmitForm() {
var zyimg = new Array(); // var zyimg = new Array();
$(".zyimg").each(function () { // $(".zyimg").each(function () {
zyimg.push($(this).attr("filepath")); // zyimg.push($(this).attr("filepath"));
}); // });
var zydata = $('#zyff').serializeJSON(); var zydata = $('#zyff').serializeJSON();
zydata['zylx'] = {{zyid}} // zydata['zylx'] = {{zyid}}
zydata['zyimg'] = zyimg // zydata['zyimg'] = zyimg
zydata['fxcs'] = getfxcs() // zydata['fxcs'] = getfxcs()
zydata['zyry'] = zydata['zyry'].split(',') zydata['zyry'] = zydata['zyry'].split(',')
zydata['splc'] = 0
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: 'api/operation?a=add', url: 'api/operation?a=add',
@ -134,94 +192,94 @@
}, },
}); });
} }
document.getElementById('file').onchange = function () { // document.getElementById('file').onchange = function () {
var fileObj = this.files[0]; // var fileObj = this.files[0];
var url = 'upfile' // var url = 'upfile'
var form = new FormData(); // var form = new FormData();
if (fileObj.size / 1024 > 500) { //大于500k进行压缩上传 // if (fileObj.size / 1024 > 500) { //大于500k进行压缩上传
$("#file").after('<span id="tip" style="color:blue">图片大于500k,正在压缩...</span>'); // $("#file").after('<span id="tip" style="color:blue">图片大于500k,正在压缩...</span>');
photoCompress(fileObj, { // photoCompress(fileObj, {
quality: 0.2 // quality: 0.2
}, function (base64Codes) { // }, function (base64Codes) {
//console.log("压缩后:" + base.length / 1024 + " " + base); // //console.log("压缩后:" + base.length / 1024 + " " + base);
var bl = convertBase64UrlToBlob(base64Codes); // var bl = convertBase64UrlToBlob(base64Codes);
form.append("upfile", bl, fileObj.name); // 文件对象 // form.append("upfile", bl, fileObj.name); // 文件对象
xhr = new XMLHttpRequest(); // XMLHttpRequest 对象 // xhr = new XMLHttpRequest(); // XMLHttpRequest 对象
xhr.open("post", url, true); //post方式url为服务器请求地址true 该参数规定请求是否异步处理。 // xhr.open("post", url, true); //post方式url为服务器请求地址true 该参数规定请求是否异步处理。
$("#tip").remove(); // $("#tip").remove();
$('#ps').show(); // $('#ps').show();
xhr.onload = function (evt) { //服务断接收完文件返回的结果 // xhr.onload = function (evt) { //服务断接收完文件返回的结果
var data = JSON.parse(evt.target.responseText); // var data = JSON.parse(evt.target.responseText);
if (data.code = 1) { // if (data.code = 1) {
$('#ps').hide(); // $('#ps').hide();
$("#addImage").append('<li ><img title="点击放大" style="display:block;" onclick="bigger(this)" class = "zyimg" width="120" height="120" filepath="' + data.filepath + '" src="http://' + window.location.host + '/' + data.filepath + '"/><button onclick="removep(this)" >删除</button></li>'); // $("#addImage").append('<li ><img title="点击放大" style="display:block;" onclick="bigger(this)" class = "zyimg" width="120" height="120" filepath="' + data.filepath + '" src="http://' + window.location.host + '/' + data.filepath + '"/><button onclick="removep(this)" >删除</button></li>');
document.getElementById('file').value = ''; // document.getElementById('file').value = '';
} else { alert("上传失败!"); } // } else { alert("上传失败!"); }
}; //请求完成 // }; //请求完成
xhr.onerror = function (evt) { alert("上传失败!"); $('#ps').hide(); };; //请求失败 // xhr.onerror = function (evt) { alert("上传失败!"); $('#ps').hide(); };; //请求失败
xhr.upload.onprogress = progressFunction;//【上传进度调用方法实现】 // xhr.upload.onprogress = progressFunction;//【上传进度调用方法实现】
xhr.upload.onloadstart = function () {//上传开始执行方法 // xhr.upload.onloadstart = function () {//上传开始执行方法
ot = new Date().getTime(); //设置上传开始时间 // ot = new Date().getTime(); //设置上传开始时间
oloaded = 0;//设置上传开始时以上传的文件大小为0 // oloaded = 0;//设置上传开始时以上传的文件大小为0
}; // };
xhr.send(form); //开始上传发送form数据 // xhr.send(form); //开始上传发送form数据
}); // });
} else { //小于等于500k 原图上传 // } else { //小于等于500k 原图上传
form.append("upfile", fileObj); // 文件对象 // form.append("upfile", fileObj); // 文件对象
xhr = new XMLHttpRequest(); // XMLHttpRequest 对象 // xhr = new XMLHttpRequest(); // XMLHttpRequest 对象
xhr.open("post", url, true); //post方式url为服务器请求地址true 该参数规定请求是否异步处理。 // xhr.open("post", url, true); //post方式url为服务器请求地址true 该参数规定请求是否异步处理。
xhr.onload = function (evt) { //服务断接收完文件返回的结果 // xhr.onload = function (evt) { //服务断接收完文件返回的结果
var data = JSON.parse(evt.target.responseText); // var data = JSON.parse(evt.target.responseText);
if (data.code = 1) { // if (data.code = 1) {
$('#ps').hide(); // $('#ps').hide();
$("#addImage").append('<li ><img title="点击放大" style="display:block;" onclick="bigger(this)" class = "zyimg" width="120" height="120" filepath="' + data.filepath + '" src="http://' + window.location.host + '/' + data.filepath + '"/><button onclick="removep(this)" >删除</button></li>'); // $("#addImage").append('<li ><img title="点击放大" style="display:block;" onclick="bigger(this)" class = "zyimg" width="120" height="120" filepath="' + data.filepath + '" src="http://' + window.location.host + '/' + data.filepath + '"/><button onclick="removep(this)" >删除</button></li>');
document.getElementById('file').value = ''; // document.getElementById('file').value = '';
} else { alert("上传失败!"); } // } else { alert("上传失败!"); }
}; //请求完成 // }; //请求完成
xhr.onerror = function (evt) { alert("上传失败!"); $('#ps').hide(); };; //请求失败 // xhr.onerror = function (evt) { alert("上传失败!"); $('#ps').hide(); };; //请求失败
xhr.upload.onprogress = progressFunction;//【上传进度调用方法实现】 // xhr.upload.onprogress = progressFunction;//【上传进度调用方法实现】
xhr.upload.onloadstart = function () {//上传开始执行方法 // xhr.upload.onloadstart = function () {//上传开始执行方法
ot = new Date().getTime(); //设置上传开始时间 // ot = new Date().getTime(); //设置上传开始时间
oloaded = 0;//设置上传开始时以上传的文件大小为0 // oloaded = 0;//设置上传开始时以上传的文件大小为0
}; // };
xhr.send(form); //开始上传发送form数据 // xhr.send(form); //开始上传发送form数据
} // }
function progressFunction(evt) { // function progressFunction(evt) {
var progressBar = document.getElementById("progressBar"); // var progressBar = document.getElementById("progressBar");
var percentageDiv = document.getElementById("percentage"); // var percentageDiv = document.getElementById("percentage");
// event.total是需要传输的总字节event.loaded是已经传输的字节。如果event.lengthComputable不为真则event.total等于0 // // event.total是需要传输的总字节event.loaded是已经传输的字节。如果event.lengthComputable不为真则event.total等于0
if (evt.lengthComputable) {// // if (evt.lengthComputable) {//
progressBar.max = evt.total; // progressBar.max = evt.total;
progressBar.value = evt.loaded; // progressBar.value = evt.loaded;
percentageDiv.innerHTML = Math.round(evt.loaded / evt.total * 100) + "%"; // percentageDiv.innerHTML = Math.round(evt.loaded / evt.total * 100) + "%";
} // }
var time = document.getElementById("time"); // var time = document.getElementById("time");
var nt = new Date().getTime();//获取当前时间 // var nt = new Date().getTime();//获取当前时间
var pertime = (nt - ot) / 1000; //计算出上次调用该方法时到现在的时间差单位为s // var pertime = (nt - ot) / 1000; //计算出上次调用该方法时到现在的时间差单位为s
ot = new Date().getTime(); //重新赋值时间,用于下次计算 // ot = new Date().getTime(); //重新赋值时间,用于下次计算
var perload = evt.loaded - oloaded; //计算该分段上传的文件大小单位b // var perload = evt.loaded - oloaded; //计算该分段上传的文件大小单位b
oloaded = evt.loaded;//重新赋值已上传文件大小,用以下次计算 // oloaded = evt.loaded;//重新赋值已上传文件大小,用以下次计算
//上传速度计算 // //上传速度计算
var speed = perload / pertime;//单位b/s // var speed = perload / pertime;//单位b/s
var bspeed = speed; // var bspeed = speed;
var units = 'b/s';//单位名称 // var units = 'b/s';//单位名称
if (speed / 1024 > 1) { // if (speed / 1024 > 1) {
speed = speed / 1024; // speed = speed / 1024;
units = 'k/s'; // units = 'k/s';
} // }
if (speed / 1024 > 1) { // if (speed / 1024 > 1) {
speed = speed / 1024; // speed = speed / 1024;
units = 'M/s'; // units = 'M/s';
} // }
speed = speed.toFixed(1); // speed = speed.toFixed(1);
//剩余时间 // //剩余时间
var resttime = ((evt.total - evt.loaded) / bspeed).toFixed(1); // var resttime = ((evt.total - evt.loaded) / bspeed).toFixed(1);
time.innerHTML = ',速度:' + speed + units + ',剩余时间:' + resttime + 's'; // time.innerHTML = ',速度:' + speed + units + ',剩余时间:' + resttime + 's';
//if(bspeed==0) time.innerHTML = '上传已取消'; // //if(bspeed==0) time.innerHTML = '上传已取消';
} // }
} // }
</script> </script>

View File

@ -13,6 +13,10 @@
<td>作业编号:{{zynum}}</td> <td>作业编号:{{zynum}}</td>
<td>提交时间:{{submittime| dateFormat 'yyyy-MM-dd hh:mm'}}</td> <td>提交时间:{{submittime| dateFormat 'yyyy-MM-dd hh:mm'}}</td>
</tr> </tr>
<tr>
<td>作业区域:{{zyqy__name}}</td>
<td>作业地点:{{zydd}}</td>
</tr>
<tr> <tr>
<td colspan="2">作业类型:{{zylx__dickeyname}}</td> <td colspan="2">作业类型:{{zylx__dickeyname}}</td>
</tr> </tr>
@ -27,7 +31,11 @@
<td style="width:50%">开始时间:{{kssj| dateFormat 'yyyy-MM-dd hh:mm'}}</td> <td style="width:50%">开始时间:{{kssj| dateFormat 'yyyy-MM-dd hh:mm'}}</td>
<td style="width:50%">结束时间:{{jssj| dateFormat 'yyyy-MM-dd hh:mm'}}</td> <td style="width:50%">结束时间:{{jssj| dateFormat 'yyyy-MM-dd hh:mm'}}</td>
</tr> </tr>
<tr>
<td colspan="2">作业人员:{{zyry}}</td>
</tr>
</table> </table>
<div class="labeldiv">作业人员确认详情</div>
<table class='detailtable'> <table class='detailtable'>
<thead> <thead>
<tr> <tr>
@ -65,7 +73,7 @@
</tr> </tr>
{{/each}} {{/each}}
</table> </table>
<div class="labeldiv">流程详情</div> <div class="labeldiv">作业审批详情</div>
<table class='detailtable'> <table class='detailtable'>
<thead> <thead>
<tr> <tr>

View File

@ -119,10 +119,14 @@
field: 'shresult', title: '隐患状态', width: 100, styler: function (value, row, index) { field: 'shresult', title: '隐患状态', width: 100, styler: function (value, row, index) {
switch (value) { switch (value) {
case 1: return ''; break; case 1: return ''; break;
case 2: return 'background-color:red;'; break; case 2: return 'color:red;font-weight:bold'; break;
case 3: return 'background-color:red;'; break; case 3: return 'color:red;font-weight:bold'; break;
case 4: return 'background-color:yellow;'; break; case 4: return 'color:orange;font-weight:bold'; break;
case 6: return 'background-color:yellow;'; break; case 6: return 'color:orange;font-weight:bold'; break;
}
let zgqx = new Date(row.zgqx);
if(new Date()>zgqx&&row.yhzt==3){
return 'color:red;font-weight:bold'
} }
}, formatter: function (value, row, index) { }, formatter: function (value, row, index) {
switch (value) { switch (value) {
@ -133,8 +137,13 @@
case 5: return '评估未通过'; break; case 5: return '评估未通过'; break;
case 6: return '未采纳'; break; case 6: return '未采纳'; break;
} }
let zgqx = new Date(row.zgqx);
if(new Date()>zgqx&&row.yhzt==3){
return '超期未整改'
}
} }
}, },
{ field: 'tbsj', title: '提交时间', width: 100 },
]] ]]
}); });
$('#kjcxyh').combobox({ $('#kjcxyh').combobox({

View File

@ -47,7 +47,7 @@ urlpatterns = [
path('html/notice/detail/<int:id>/', views.noticedetail), path('html/notice/detail/<int:id>/', views.noticedetail),
path('html/zuoyepeizhi', views.zuoyepeizhi), path('html/zuoyepeizhi', views.zuoyepeizhi),
path('html/operation', views.operation), path('html/operation', views.operation),
path('html/operation/add/<int:zyid>/', views.operationadd), path('html/operation/add', views.operationadd),
path('html/operation/detail/<int:zyid>/', views.operationdetail), path('html/operation/detail/<int:zyid>/', views.operationdetail),
path('html/fxcs/add', views.fxcsadd), path('html/fxcs/add', views.fxcsadd),
path('html/operationspjd/add', views.operationspjdadd), path('html/operationspjd/add', views.operationspjdadd),

File diff suppressed because it is too large Load Diff