隐患跟踪part1
This commit is contained in:
parent
cf354982a9
commit
628676d28e
|
|
@ -0,0 +1,43 @@
|
|||
# Generated by Django 2.2.8 on 2021-01-25 21:20
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('safesite', '0374_auto_20210104_2147'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='gridtaskset',
|
||||
name='trouble',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='gridtaskset_trouble', to='safesite.Trouble'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='gridtaskset',
|
||||
name='note',
|
||||
field=models.TextField(null=True, verbose_name='备注'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='gridtaskset',
|
||||
name='riskact',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='gridtaskset_riskact', to='safesite.RiskAct'),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='TroubleFollowTask',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('taskadd', models.DateTimeField(blank=True, null=True, verbose_name='任务创建时间')),
|
||||
('taskdo', models.DateTimeField(blank=True, null=True, verbose_name='任务执行时间')),
|
||||
('taskexpire', models.DateTimeField(blank=True, null=True, verbose_name='任务过期时间')),
|
||||
('desc', models.TextField(blank=True, null=True, verbose_name='跟踪描述')),
|
||||
('tasknote', models.TextField(blank=True, null=True, verbose_name='任务执行说明')),
|
||||
('taskset', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='safesite.GridTaskSet', verbose_name='由哪个设置派发')),
|
||||
('trouble', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='safesite.Trouble')),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='safesite.User', verbose_name='跟踪人')),
|
||||
],
|
||||
),
|
||||
]
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
<div id="yhtablebar">
|
||||
<form id='searchyhff'>
|
||||
<a class="easyui-textbox" name="search" data-options="prompt:'隐患编号或描述', width:'300px'" ></a>
|
||||
<a onclick="yhsearch()" class="easyui-linkbutton">查询</a>
|
||||
<a onclick="yhreset()" class="easyui-linkbutton">重置</a>
|
||||
</form>
|
||||
</div>
|
||||
<table id="yhtable" style="width:100%;height:100%;"></table>
|
||||
<script>
|
||||
$(function () {
|
||||
$('#yhtable').datagrid({ url: 'troublehandle', queryParams: { a: 'listall' } });
|
||||
$("#searchyhff").form('clear');
|
||||
})
|
||||
|
||||
$('#yhtable').datagrid({
|
||||
rownumbers: true,
|
||||
singleSelect: true,
|
||||
striped: true,
|
||||
method: 'get',
|
||||
url: '',
|
||||
fitColumns: true,
|
||||
pagination: true,
|
||||
pageSize: 20,
|
||||
toolbar: '#yhtablebar',
|
||||
border: false,
|
||||
columns: [[
|
||||
{ field: 'troubleid', hidden: true },
|
||||
{ field: 'yhnum', title: '编号', width: 100 },
|
||||
{
|
||||
field: 'yhzt', title: '流程状态', width: 100, 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: 'todouser__name', title: '下一步处理人', width: 80 },
|
||||
{ field: 'yhdj__dickeyname', title: '隐患等级', width: 80 },
|
||||
{ field: 'yhlb__dickeyname', title: '隐患类别', width: 80 },
|
||||
{ field: 'yhpg__dickeyname', title: '隐患评估', width: 80 },
|
||||
{ field: 'fxr__name', title: '发现人', width: 80 },
|
||||
{ field: 'yhms', title: '隐患描述', width: 150 },
|
||||
{ field: 'todouser__userid', hidden: true },
|
||||
{ field: 'sybzt', hidden: true },
|
||||
{
|
||||
field: 'shresult', title: '隐患状态', width: 100, styler: function (value, row, index) {
|
||||
switch (value) {
|
||||
case 1: return ''; break;
|
||||
case 2: return 'color:red;font-weight:bold'; break;
|
||||
case 3: return 'color:red;font-weight:bold'; break;
|
||||
case 4: return 'color:orange;font-weight:bold'; 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) {
|
||||
switch (value) {
|
||||
case 1: return ''; break;
|
||||
case 2: return '审核未通过'; break;
|
||||
case 3: return '复查未通过'; break;
|
||||
case 4: return '已修改'; break;
|
||||
case 5: 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 },
|
||||
]],
|
||||
onClickRow: function (index, item) {
|
||||
var id = item.troubleid;
|
||||
var name = item.yhnum + '-' + item.yhms.substring(0,8) + '...'
|
||||
var a = GetQueryString2("a");
|
||||
top.$('#in').attr('value', id);
|
||||
top.$('#in').attr('show', name);
|
||||
top.$('#in').attr('target', a);
|
||||
aaa(a);
|
||||
closeForm2()
|
||||
},
|
||||
});
|
||||
function yhsearch() {
|
||||
var querydata = $('#searchyhff').serializeJSON();
|
||||
querydata.a = 'listall'
|
||||
$('#yhtable').datagrid('load', querydata);
|
||||
|
||||
}
|
||||
function yhreset() {
|
||||
$('#searchyhff').form('clear')
|
||||
$('#yhtable').datagrid('options').queryParams={
|
||||
a:'listall'
|
||||
}
|
||||
$('#yhtable').datagrid('load');
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -1,92 +1,18 @@
|
|||
<div id="yhtablebar" style="padding:4px;">
|
||||
<div id="yhgzrwtablebar" style="padding:4px;">
|
||||
<div>
|
||||
<label>快捷查询</label>
|
||||
<select id='kjcxyh' style='width:150px;'>
|
||||
<option value="">请选择</option>
|
||||
<option value="listself">我的隐患</option>
|
||||
<option value="listtodo">待办隐患</option>
|
||||
<option value="listall">全部隐患</option>
|
||||
</select>
|
||||
<a onclick="javascript:$('#sdg_yh').dialog('open')" class="easyui-linkbutton" data-options="iconCls: 'fa-search',plain:true">详细筛选</a>
|
||||
</div>
|
||||
<div>
|
||||
{% load myfilter %}
|
||||
{% if request|has_permission:'b_trouble_add' %}
|
||||
<a id="addyh" onclick="javascript:opendg('新增隐患','addtrouble?a=addyh')">新增</a>
|
||||
{% endif %}
|
||||
<a id="doyh" onclick="doyh()">处理</a>
|
||||
<a id="delyh" onclick="delyh()">删除</a>
|
||||
<a id="duibiao" class='easyui-linkbutton' onclick="duibiao()" data-options="iconCls: 'fa-thumb-tack',plain:true">对标</a>
|
||||
|
||||
<a id="detailyh2" onclick="detailyh()">查看详情</a>
|
||||
|
||||
{% if request|has_permission:'b_trouble_import' %}
|
||||
<a onclick="javascript:$('#drtroubledg').dialog('open').window('center');" class="easyui-linkbutton"
|
||||
data-options="iconCls:'fa-upload',plain:true">导入待整改隐患</a>
|
||||
{% endif %}
|
||||
{% if request|has_permission:'b_trouble_exportdoc' %}
|
||||
<a id="exportword" onclick="exportyhword()">导出Word</a>
|
||||
{% endif %}
|
||||
|
||||
{% if request|has_permission:'b_trouble_exportxls' %}
|
||||
<a id="exportexcel" onclick="exportyhexcel()">导出Excel</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div id="sdg_yh" class="easyui-dialog" title="筛选条件" style="width:400px;height:420px;"
|
||||
data-options="iconCls:'fa-search',resizable:true,modal:true,closed:true,border:false">
|
||||
<div class="easyui-layout" style="width:100%;height:100%;">
|
||||
<div data-options="region:'center'" style="height:100%;text-align:right;">
|
||||
<form id='searchyhff' style="margin-right: 10px">
|
||||
<div style="margin-top:4px"><label>起始时间</label><input name='qssj' id='qssjyh' style="width:300px"></div>
|
||||
<div style="margin-top:4px"><label>结束时间</label><input name='jssj' id='jssjyh' style="width:300px"></div>
|
||||
<div style="margin-top:4px">
|
||||
<label>流程状态</label>
|
||||
<select name='yhzt' id='syhzt' style="width:300px">
|
||||
<option value="">请选择</option>
|
||||
<option value="0">待新增</option>
|
||||
<option value="1">待评估</option>
|
||||
<option value="7">措施/方案待提交</option>
|
||||
<option value="2">措施/方案待确认</option>
|
||||
<option value="3">待整改</option>
|
||||
<option value="4">待审核</option>
|
||||
<option value="5">待复查</option>
|
||||
<option value="6">已归档</option>
|
||||
</select>
|
||||
</div>
|
||||
<div style="margin-top:4px"><label>隐患大类</label><input name='yhlx' id="syhlx" style="width:300px;" /></div>
|
||||
<div style="margin-top:4px"><label>隐患类别</label><input name='yhlb' id="syhlb" style="width:300px;" /></div>
|
||||
<div style="margin-top:4px"><label>检查类型</label><input name='jclx' id="sjclx" style="width:300px;" /></div>
|
||||
<div style="margin-top:4px"><label>隐患评估</label><input name='yhpg' id="syhpg" style="width:300px;" /></div>
|
||||
<div style="margin-top:4px"><label>发现部门</label><input id="sfxbm" name="fxbm" style="width:300px;" /></div>
|
||||
<div style="margin-top:4px"><label>发现人</label><input name="fxrname" style="width:300px" class="easyui-textbox"/></div>
|
||||
<div style="margin-top:4px"><label>整改部门</label><input id="szgbm" name="zgbm" style="width:300px" /></div>
|
||||
</form>
|
||||
</div>
|
||||
<div id='southdiv' data-options="region:'south'" style="height:44px;text-align:center;padding:4px">
|
||||
<a id="yhsearch" onclick="yhsearch()">查询</a>
|
||||
<a id="searchreset" onclick="reset()" class="easyui-linkbutton">重置</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<a id="addyhgzrw" onclick="javascript:opendg('创建隐患跟踪任务','/html/troublefollowtaskset/add')" class="easyui-linkbutton" data-options="iconCls: 'fa-plus',
|
||||
plain: true">创建隐患跟踪任务</a>
|
||||
<a id="delyhgzrw" onclick="delyhgzrw()" class="easyui-linkbutton" data-options="iconCls: 'fa-trash',
|
||||
plain: true">删除</a>
|
||||
</div>
|
||||
</div>
|
||||
<table id="yhtable" style="width:100%;height:100%;"></table>
|
||||
<div id="drtroubledg" class="easyui-dialog" title="导入隐患" style="width:400px;height:200px;"
|
||||
data-options="iconCls:'fa-upload',resizable:true,modal:true,closed:true,border:false">
|
||||
<p style="color:red;margin-left: 10px">请按模板录入后导入</p>
|
||||
<p style="margin-left: 10px"><a href="/static/safesite/muban/trouble.xlsx" target="_blank">点击下载模板</a></p>
|
||||
<p style="margin-left: 10px">录入完成后点击下方按钮上传文件</p>
|
||||
<input type="file" id="drfile" name="" accept=".xls,.xlsx" style="margin-left: 10px" />
|
||||
</div>
|
||||
<!-- <a id="downa" href="" target="_blank" style="display:none"></a> -->
|
||||
<table id="yhgzrwtable" style="width:100%;height:100%;"></table>
|
||||
<script>
|
||||
$(function () {
|
||||
var option = $('#main').attr('value')
|
||||
$('#yhtable').datagrid({ url: 'troublehandle', queryParams: { a: option } });
|
||||
$("#searchyhff").form('clear');
|
||||
$('#yhgzrwtable').datagrid({ url: 'api/gridtaskset', queryParams: { a: 'list1' } });
|
||||
})
|
||||
|
||||
$('#yhtable').datagrid({
|
||||
$('#yhgzrwtable').datagrid({
|
||||
rownumbers: true,
|
||||
singleSelect: true,
|
||||
striped: true,
|
||||
|
|
@ -95,13 +21,13 @@
|
|||
fitColumns: true,
|
||||
pagination: true,
|
||||
pageSize: 20,
|
||||
toolbar: '#yhtablebar',
|
||||
toolbar: '#yhgzrwtablebar',
|
||||
border: false,
|
||||
columns: [[
|
||||
{ field: 'troubleid', hidden: true },
|
||||
{ field: 'yhnum', title: '编号', width: 100 },
|
||||
{ field: 'id', hidden: true },
|
||||
{ field: 'trouble__yhnum', title: '隐患编号', width: 100 },
|
||||
{
|
||||
field: 'yhzt', title: '流程状态', width: 100, styler: function (value, row, index) {
|
||||
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;
|
||||
|
|
@ -128,202 +54,30 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
{ field: 'todouser__name', title: '下一步处理人', width: 80 },
|
||||
{ field: 'yhdj__dickeyname', title: '隐患等级', width: 80 },
|
||||
{ field: 'yhlb__dickeyname', title: '隐患类别', width: 80 },
|
||||
{ field: 'yhpg__dickeyname', title: '隐患评估', width: 80 },
|
||||
{ field: 'fxr__name', title: '发现人', width: 80 },
|
||||
{ field: 'yhms', title: '隐患描述', width: 150 },
|
||||
{ field: 'todouser__userid', hidden: true },
|
||||
{ field: 'sybzt', hidden: true },
|
||||
{
|
||||
field: 'shresult', title: '隐患状态', width: 100, styler: function (value, row, index) {
|
||||
{ field: 'gridlevel__dickeyname', title: '网格层级', width: 80 },
|
||||
{ field: 'user__name', title: '跟踪人', width: 80 },
|
||||
{ field: 'myschedule__name', title: '任务策略', width: 100},
|
||||
{ field: 'last_run_at', title: '最近派发时间', width: 100 },
|
||||
{ field: 'periodictask__enabled', title: '派发状态', width: 50,
|
||||
formatter: function (value, row, index) {
|
||||
switch (value) {
|
||||
case 1: return ''; break;
|
||||
case 2: return 'color:red;font-weight:bold'; break;
|
||||
case 3: return 'color:red;font-weight:bold'; break;
|
||||
case 4: return 'color:orange;font-weight:bold'; break;
|
||||
case 6: return 'color:orange;font-weight:bold'; break;
|
||||
case true: return '正常'; break;
|
||||
case false: return '暂停'; 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) {
|
||||
},
|
||||
styler: function (value, row, index) {
|
||||
switch (value) {
|
||||
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 true: return 'font-weight:bold;color:green'; break;
|
||||
case false: return 'color:red;font-weight:bold'; break;
|
||||
}
|
||||
let zgqx = new Date(row.zgqx);
|
||||
if (new Date() > zgqx && row.yhzt == 3) {
|
||||
return '超期未整改'
|
||||
}
|
||||
}
|
||||
},
|
||||
{ field: 'tbsj', title: '提交时间', width: 100 },
|
||||
}
|
||||
},
|
||||
{ field: 'count', title: '已派发次数', width: 50 },
|
||||
{ field: 'note', title: '执行备注', width: 100 },
|
||||
]]
|
||||
});
|
||||
$('#kjcxyh').combobox({
|
||||
editable: false,
|
||||
onSelect: function (node) {
|
||||
if (node.value != '') {
|
||||
$('#yhtable').datagrid({ url: 'troublehandle', queryParams: { a: node.value } });
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
$('#wdyh').linkbutton({
|
||||
iconCls: 'icon-man',
|
||||
plain: true
|
||||
});
|
||||
$('#detailyh2').linkbutton({
|
||||
iconCls: 'fa-info-circle',
|
||||
plain: true
|
||||
});
|
||||
$('#yhsearch').linkbutton({
|
||||
iconCls: 'fa-search',
|
||||
});
|
||||
$('#exportword').linkbutton({
|
||||
iconCls: 'fa-download',
|
||||
plain: true
|
||||
});
|
||||
$('#exportexcel').linkbutton({
|
||||
iconCls: 'fa-download',
|
||||
plain: true
|
||||
});
|
||||
$('#addyh').linkbutton({
|
||||
iconCls: 'fa-plus',
|
||||
plain: true
|
||||
});
|
||||
$('#delyh').linkbutton({
|
||||
iconCls: 'fa-trash',
|
||||
plain: true
|
||||
});
|
||||
$('#doyh').linkbutton({
|
||||
iconCls: 'fa-flash',
|
||||
plain: true
|
||||
});
|
||||
$("#qssjyh").datebox({
|
||||
editable: false
|
||||
});
|
||||
$("#jssjyh").datebox({
|
||||
editable: false
|
||||
});
|
||||
$("#syhzt").combobox({
|
||||
editable: false
|
||||
});
|
||||
$("#syhlb").combobox({
|
||||
editable: false
|
||||
});
|
||||
$("#sfxr").combobox({
|
||||
editable: false
|
||||
});
|
||||
$("#syhlx").combobox({
|
||||
url: 'getdicclass?dicid=15',
|
||||
editable: false,
|
||||
onSelect: function (node) {
|
||||
$('#syhlb').combobox({
|
||||
url: 'getdickey?dicclass=' + node.value + '&a=combobox',
|
||||
editable: false,
|
||||
});
|
||||
}
|
||||
});
|
||||
$("#sjclx").combobox({
|
||||
url: 'getdickey?dicclass=14&a=combobox',
|
||||
valueField: 'value',
|
||||
textField: 'text',
|
||||
editable: false,
|
||||
});
|
||||
$("#syhpg").combobox({
|
||||
url: 'getdickey?dicclass=19&a=combobox',
|
||||
editable: false,
|
||||
});
|
||||
// $.get('parthandle?a=tree',function(res){
|
||||
// var data = convert(res);
|
||||
// $('#sfxbm,#szgbm').combotree();
|
||||
// $("#sfxbm").combotree('loadData',data);
|
||||
// $("#szgbm").combotree('loadData',data);
|
||||
// })
|
||||
$("#sfxbm").combotree({
|
||||
url: 'parthandle?a=tree',
|
||||
editable: false,
|
||||
loadFilter: function (rows) {
|
||||
return convert(rows);
|
||||
},
|
||||
});
|
||||
$("#szgbm").combotree({
|
||||
url: 'parthandle?a=tree',
|
||||
editable: false,
|
||||
loadFilter: function (rows) {
|
||||
return convert(rows);
|
||||
},
|
||||
});
|
||||
function detailyh() {
|
||||
var row = $('#yhtable').datagrid('getSelected');
|
||||
if (row) {
|
||||
url = 'troublehandle?a=detailhtml&troubleid=' + row.troubleid
|
||||
opendg('查看详情', url)
|
||||
}
|
||||
else { $.messager.alert('提示', '请选择一行数据!'); }
|
||||
}
|
||||
|
||||
function exportyhword() {
|
||||
var row = $('#yhtable').datagrid('getSelected');
|
||||
if (row) {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: 'troublehandle?a=exportword&troubleid=' + row.troubleid,
|
||||
datatype: "json",
|
||||
async: false,
|
||||
beforeSend: function () {
|
||||
loading()
|
||||
},
|
||||
success: function (data) {
|
||||
removeLoading();
|
||||
if (data.code == 1) {
|
||||
//$('#downa').attr('href', downloadurl);
|
||||
//document.getElementById("downa").click();
|
||||
window.open(data.downloadurl);
|
||||
}
|
||||
else {
|
||||
$.messager.alert('提示', '导出Word失败!');
|
||||
}
|
||||
},
|
||||
complete: function (XMLHttpRequest, textStatus) {
|
||||
},
|
||||
error: function () {
|
||||
}
|
||||
});
|
||||
}
|
||||
else { $.messager.alert('提示', '请选择一行数据!'); }
|
||||
}
|
||||
function yhsearch() {
|
||||
var querydata = $('#searchyhff').serializeJSON();
|
||||
querydata.a = 'listall'
|
||||
$('#sdg_yh').dialog('close')
|
||||
$('#yhtable').datagrid('load', querydata);
|
||||
|
||||
}
|
||||
function reset() {
|
||||
$('#searchyhff').form('clear')
|
||||
$('#yhtable').datagrid('options').queryParams={
|
||||
a:'listall'
|
||||
}
|
||||
$('#yhtable').datagrid('load');
|
||||
|
||||
}
|
||||
function exportyhexcel() {
|
||||
var querydata = $('#searchyhff').serializeJSON();
|
||||
let url = 'troublehandle?a=exportexcel&' + parseParams(querydata)
|
||||
window.open(url);
|
||||
// $('<form method="post" action="' + url + '"></form>').appendTo('body').submit().remove();
|
||||
}
|
||||
function delyh() {
|
||||
var row = $('#yhtable').datagrid('getSelected');
|
||||
function delyhgzrw() {
|
||||
var row = $('#yhgzrwtable').datagrid('getSelected');
|
||||
if (row) {
|
||||
$.messager.confirm('提示', '确定删除吗?', function (r) {
|
||||
if (r) {
|
||||
|
|
@ -335,7 +89,7 @@
|
|||
beforeSend: function () { },
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#yhtable").datagrid('reload');
|
||||
$("#yhgzrwtable").datagrid('reload');
|
||||
}
|
||||
else {
|
||||
$.messager.alert('提示', '流程已进行,您无权删除!');
|
||||
|
|
@ -347,87 +101,6 @@
|
|||
}
|
||||
else { $.messager.alert('提示', '请选择一条数据!'); }
|
||||
}
|
||||
function doyh() {
|
||||
var row = $('#yhtable').datagrid('getSelected');
|
||||
if (row) {
|
||||
if (row.yhzt != 6) {
|
||||
if ($("#userindex").attr('userid') == row.todouser__userid) {
|
||||
if (row.yhzt == 0) {
|
||||
opendg('编辑隐患', 'addtrouble?a=edityh&troubleid=' + row.troubleid)
|
||||
} else {
|
||||
var troubleid = row.troubleid;
|
||||
var yhzt = row.yhzt;
|
||||
var url = 'accesstrouble?troubleid=' + troubleid + '&yhzt=' + yhzt;
|
||||
opendg('处理隐患', url)
|
||||
}
|
||||
} else { $.messager.alert('提示', '该条您无权操作!'); }
|
||||
|
||||
|
||||
} else { $.messager.alert('提示', '无需处理!'); }
|
||||
}
|
||||
else { $.messager.alert('提示', '请选择一条数据!'); }
|
||||
|
||||
}
|
||||
function duibiao() {
|
||||
var row = $('#yhtable').datagrid('getSelected');
|
||||
if (row) {
|
||||
loading('正在比对,请稍等..');
|
||||
$.post('api/duibiao', { 'yhms': row.yhms }, function (result, status) {
|
||||
if (result.code = 1) {
|
||||
html = '<p style="color:red;margin-left: 10px">根据您的描述,搜索到以下安标结果:</p>'
|
||||
for (var j = 0, len = result.data.length; j < len; j++) {
|
||||
html = html + '<p style="margin-left: 10px;margin-right: 10px">' + result.data[j] + '</p>'
|
||||
}
|
||||
$("<div/>").dialog({
|
||||
title: '对标结果',
|
||||
width: 800,
|
||||
height: 400,
|
||||
closed: false,
|
||||
cache: false,
|
||||
content: html,
|
||||
modal: true,
|
||||
border: false,
|
||||
onClose: function () {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
});
|
||||
}
|
||||
removeLoading()
|
||||
});
|
||||
}
|
||||
else { $.messager.alert('提示', '请选择一行数据!'); }
|
||||
}
|
||||
document.getElementById('drfile').onchange = function () {
|
||||
var fileObj = this.files[0];
|
||||
var url = 'drapi?a=todotrouble'
|
||||
var form = new FormData();
|
||||
form.append("upfile", fileObj); // 文件对象
|
||||
xhr = new XMLHttpRequest(); // XMLHttpRequest 对象
|
||||
xhr.open("post", url, true); //post方式,url为服务器请求地址,true 该参数规定请求是否异步处理。
|
||||
xhr.send(form)
|
||||
$('#drtroubledg').dialog('close')
|
||||
loading('导入中。。');
|
||||
xhr.onload = function (evt) { //服务断接收完文件返回的结果
|
||||
var data = JSON.parse(evt.target.responseText);
|
||||
removeLoading();
|
||||
if (data.code == 1) {
|
||||
$.messager.alert('提示', '上传成功!', 'info', function () {
|
||||
$("#yhtable").datagrid('reload');
|
||||
});
|
||||
}
|
||||
else if (data.code == 2) {
|
||||
$.messager.alert('警告', data.msg, 'info', function () {
|
||||
$("#yhtable").datagrid('reload');
|
||||
});
|
||||
}
|
||||
else {
|
||||
$.messager.alert('提示', '失败!文件内容有误');
|
||||
}
|
||||
document.getElementById('drfile').value = '';
|
||||
|
||||
}; //请求完成
|
||||
xhr.onerror = function (evt) { $.messager.alert('提示', '失败!文件内容有误'); document.getElementById('drfile').value = ''; }; //请求失败
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,121 @@
|
|||
<div class="easyui-layout" style="width:100%;height:100%">
|
||||
<div id='southdiv' data-options="region:'south'" style="width:100%;height:50px;padding:5px">
|
||||
<div style="text-align:center;padding:2px">
|
||||
<a id="submitb" class="easyui-linkbutton" iconCls="fa-floppy-o" onclick="submitform()">保存</a>
|
||||
<a class="easyui-linkbutton" iconCls="fa-close" onclick="javascript:$('#dd').dialog('close')">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
<div data-options="region:'center'" style="width:100%;height:100%;padding:5px 15px;">
|
||||
<form method="post" id="gridtasksetff">
|
||||
<div style="margin-bottom:10px">
|
||||
<input id="troublenum" name="troublenum" class="easyui-textbox" style="width:480px" data-options="label:'隐患', editable:false"
|
||||
required=true >
|
||||
<input type="hidden" name="trouble" id="trouble"/>
|
||||
<a class='easyui-linkbutton' onclick="javascript:opendg2('选择隐患','html/trouble/chose/', 'trouble')" style="width:auto">选择</a>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input id="gridlevel" class="easyui-combobox" name="gridlevel" style="width:480px" data-options="
|
||||
label:'网格类型',
|
||||
url: 'getdickey?a=combobox&dicclass=58',
|
||||
method: 'get',
|
||||
editable: false,"
|
||||
required=true>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input id="username" name="username" class="easyui-textbox" style="width:480px" data-options="label:'执行人', editable:false"
|
||||
required=true >
|
||||
<input type="hidden" name="user" id="user"/>
|
||||
<a class='easyui-linkbutton' onclick="choseuser()" style="width:auto">选择</a>
|
||||
</div>
|
||||
<div style="margin-bottom:5px">
|
||||
<input id="note" name="note" class="easyui-textbox" style="width:480px;height:80px" data-options="label:'跟踪备注',multiline:true,">
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input id="myschedule" class="easyui-combobox" name="myschedule" style="width:480px" data-options="
|
||||
label:'定时策略',
|
||||
url: 'api/myschedule/?a=listcombobox',
|
||||
method: 'get',
|
||||
editable: false,"
|
||||
required=true>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input id="expire" name="expire" type="text" class="easyui-numberbox" data-options="label:'有效期(小时)'"/>
|
||||
</div>
|
||||
<!-- <div style="margin-bottom:5px">
|
||||
<label style='display:inline-block;'>定时配置</label>
|
||||
<span style="font-weight:bold">每隔</span>
|
||||
<input id="setnumber" name="setnumber" type="text" class="easyui-numberbox" value="1" data-options="min:1,max:31"/>
|
||||
<select id="unit" class="easyui-combobox" style="width:80px">
|
||||
<option value="seconds">秒</option>
|
||||
<option value="hours">小时</option>
|
||||
<option value="days">天</option>
|
||||
<option value="weeks">周</option>
|
||||
<option value="months">月</option>
|
||||
<option value="years">年</option>
|
||||
</select>
|
||||
</div> -->
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
var riskact = {{riskact}}
|
||||
function choseuser() {
|
||||
var myh = screen.availHeight * 0.5;
|
||||
$('#userdd').dialog({
|
||||
maximizable: true,
|
||||
title: '选择人员',
|
||||
width: 700,
|
||||
height: myh,
|
||||
closed: false,
|
||||
cache: false,
|
||||
href: 'getuserf?a=user',
|
||||
modal: true,
|
||||
border:false,
|
||||
});
|
||||
$('#userdd').window('center');
|
||||
}
|
||||
function aaa(x) {
|
||||
if (x == "user") {
|
||||
$('#user').attr('value', top.$('#in').val());
|
||||
$('#username').textbox('setValue', top.$('#in').attr('show'));
|
||||
}
|
||||
else if (x == "trouble") {
|
||||
$('#trouble').attr('value', top.$('#in').val());
|
||||
$('#troublenum').textbox('setValue', top.$('#in').attr('show'));
|
||||
}
|
||||
}
|
||||
function submitform() {
|
||||
var data = $('#gridtasksetff').serializeJSON();
|
||||
data['riskact'] = riskact
|
||||
// var mm = $('#setnumber').numberbox('getValue')+','+$('#unit').val()
|
||||
// data['schedule'] = {'interval':mm}
|
||||
$.messager.confirm('提示', '确定创建并开始派发任务吗?', function (r) {
|
||||
if (r) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: 'api/gridtaskset/?a=add',
|
||||
data: JSON.stringify(data),
|
||||
datatype: "json",
|
||||
processData: false,
|
||||
contentType: "application/json;charset=utf-8",
|
||||
beforeSend: function () {
|
||||
var bo = $('#gridtasksetff').form('validate')
|
||||
if (bo == false) {
|
||||
return bo
|
||||
} else {
|
||||
$('#submitb').linkbutton('disable');
|
||||
}
|
||||
},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#girdtasksettable").datagrid('reload');
|
||||
$("#dd").dialog("close");
|
||||
} else { $.messager.alert('提示', '失败!'); }
|
||||
$('#submitb').linkbutton('enable');
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
<div class="easyui-layout" style="width:100%;height:100%">
|
||||
<div id='southdiv' data-options="region:'south'" style="width:100%;height:50px;padding:5px">
|
||||
<div style="text-align:center;padding:2px">
|
||||
<a id="submitb" class="easyui-linkbutton" iconCls="fa-floppy-o" onclick="submitform()">保存</a>
|
||||
<a class="easyui-linkbutton" iconCls="fa-close" onclick="javascript:$('#dd').dialog('close')">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
<div data-options="region:'center'" style="width:100%;height:100%;padding:5px 15px;">
|
||||
<form method="post" id="gridtasksetff">
|
||||
<div style="margin-bottom:10px">
|
||||
<input id="gridlevel" class="easyui-combobox" name="gridlevel" style="width:480px" data-options="
|
||||
label:'网格类型',
|
||||
url: 'getdickey?a=combobox&dicclass=58',
|
||||
method: 'get',
|
||||
editable: false,"
|
||||
required=true>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input id="username" name="username" class="easyui-textbox" style="width:480px" data-options="label:'执行人', editable:false"
|
||||
required=true >
|
||||
<input type="hidden" name="user" id="user"/>
|
||||
<a class='easyui-linkbutton' onclick="choseuser()" style="width:auto">选择</a>
|
||||
</div>
|
||||
<div style="margin-bottom:5px">
|
||||
<input id="note" name="note" class="easyui-textbox" style="width:480px;height:80px" data-options="label:'检查备注',multiline:true,">
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input id="myschedule" class="easyui-combobox" name="myschedule" style="width:480px" data-options="
|
||||
label:'策略',
|
||||
url: 'api/myschedule/?a=listcombobox',
|
||||
method: 'get',
|
||||
editable: false,"
|
||||
required=true>
|
||||
</div>
|
||||
<div style="margin-bottom:10px">
|
||||
<input id="expire" name="expire" type="text" class="easyui-numberbox" data-options="label:'有效期(小时)'" />
|
||||
</div>
|
||||
<!-- <div style="margin-bottom:5px">
|
||||
<label style='display:inline-block;'>定时配置</label>
|
||||
<span style="font-weight:bold">每隔</span>
|
||||
<input id="setnumber" name="setnumber" type="text" class="easyui-numberbox" value="1" data-options="min:1,max:31"/>
|
||||
<select id="unit" class="easyui-combobox" style="width:80px">
|
||||
<option value="seconds">秒</option>
|
||||
<option value="hours">小时</option>
|
||||
<option value="days">天</option>
|
||||
<option value="weeks">周</option>
|
||||
<option value="months">月</option>
|
||||
<option value="years">年</option>
|
||||
</select>
|
||||
</div> -->
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
var girdtasksetid = {{id}}
|
||||
$.get('api/gridtaskset?a=detail&id='+girdtasksetid,function(res){
|
||||
var data = res.data
|
||||
$('#gridlevel').combobox('setValue', data.gridlevel__dickeyid)
|
||||
$('#username').textbox('setValue',data.user__name)
|
||||
$('#user').val(data.user__userid)
|
||||
$('#note').textbox('setValue',data.note)
|
||||
$('#expire').numberbox('setValue',data.expire)
|
||||
$('#myschedule').combobox('setValue',data.myschedule__id)
|
||||
$('#start_time').datetimebox('setValue', data.periodictask__start_time)
|
||||
// if(data.schedule.hasOwnProperty('interval')){
|
||||
// var interval = data.schedule.interval.split(',')
|
||||
// $('#setnumber').numberbox('setValue', interval[0])
|
||||
// $('#unit').val(interval[1])
|
||||
// }
|
||||
})
|
||||
function choseuser() {
|
||||
var myh = screen.availHeight * 0.5;
|
||||
$('#userdd').dialog({
|
||||
maximizable: true,
|
||||
title: '选择人员',
|
||||
width: 700,
|
||||
height: myh,
|
||||
closed: false,
|
||||
cache: false,
|
||||
href: 'getuserf?a=user',
|
||||
modal: true,
|
||||
border:false,
|
||||
});
|
||||
$('#userdd').window('center');
|
||||
}
|
||||
function aaa(x) {
|
||||
if (x == "user") {
|
||||
$('#user').attr('value', top.$('#in').val());
|
||||
$('#username').textbox('setValue', top.$('#in').attr('show'));
|
||||
}
|
||||
}
|
||||
function submitform() {
|
||||
var data = $('#gridtasksetff').serializeJSON();
|
||||
data['id']=girdtasksetid
|
||||
// var mm = $('#setnumber').numberbox('getValue')+','+$('#unit').val()
|
||||
// data['schedule'] = {'interval':mm}
|
||||
$.messager.confirm('提示', '确定修改吗?', function (r) {
|
||||
if (r) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: 'api/gridtaskset/?a=edit',
|
||||
data: JSON.stringify(data),
|
||||
datatype: "json",
|
||||
processData: false,
|
||||
contentType: "application/json;charset=utf-8",
|
||||
beforeSend: function () {
|
||||
var bo = $('#gridtasksetff').form('validate')
|
||||
if (bo == false) {
|
||||
return bo
|
||||
} else {
|
||||
$('#submitb').linkbutton('disable');
|
||||
}
|
||||
},
|
||||
success: function (data) {
|
||||
if (data.code == 1) {
|
||||
$("#girdtasksettable").datagrid('reload');
|
||||
$("#dd").dialog("close");
|
||||
} else { $.messager.alert('提示', '失败!'); }
|
||||
$('#submitb').linkbutton('enable');
|
||||
},
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
|
|
@ -134,8 +134,10 @@ urlpatterns = [
|
|||
path('html/scheduleset/', views.scheduleset),
|
||||
path('html/scheduleset/add/', views.schedulesetadd),
|
||||
path('html/scheduleset/edit/<int:id>/',views.schedulesetedit),
|
||||
|
||||
path('html/trouble/chose/',views.troublechose),
|
||||
path('html/troublefollow/',views.troublefollow),
|
||||
path('html/troublefollowtaskset/add/', views.troublefollowsetadd),
|
||||
path('html/troublefollowtaskset/edit/<int:id>/', views.troublefollowsetedit),
|
||||
path('html/trainplan/', views.trainplanhtml),
|
||||
path('html/trainplan/add/', views.trainplanaddhtml),
|
||||
path('html/trainplan/edit/<int:id>/', views.trainplanedithtml),
|
||||
|
|
|
|||
|
|
@ -171,9 +171,16 @@ class EquipmentCheckFormView(TemplateView):
|
|||
def riskas(req):
|
||||
return render(req, 'riskas.html')
|
||||
|
||||
def troublechose(req):
|
||||
return render(req, 'troublechose.html')
|
||||
def troublefollow(req):
|
||||
return render(req, 'troublefollow.html')
|
||||
|
||||
def troublefollowsetadd(req):
|
||||
return render(req, 'troublefollowtasksetadd.html')
|
||||
|
||||
def troublefollowsetedit(req, id):
|
||||
return render(req, 'troublefollowtasksetedit.html', {'id':id})
|
||||
def reportedit(req):
|
||||
return render(req, 'reportedit.html', {'year': req.GET.get('year'), 'month': req.GET.get('month'), 'part': req.GET.get('part')})
|
||||
|
||||
|
|
@ -2079,6 +2086,9 @@ def troublehandle(req):
|
|||
yhqy = req.GET.get('yhqy')
|
||||
zgbm = req.GET.get('zgbm')
|
||||
fxrname = req.GET.get('fxrname',None)
|
||||
search = req.GET.get('search', None)
|
||||
if search:
|
||||
a = a.filter(Q(yhnum__contains=search)|Q(yhms__contains=search))
|
||||
if yhzt != '' and yhzt != None:
|
||||
a = a.filter(yhzt=yhzt)
|
||||
if yhlx:
|
||||
|
|
@ -7442,6 +7452,7 @@ def apimyschedule(req):
|
|||
return JsonResponse({'code': 1})
|
||||
else:
|
||||
return JsonResponse({'code': 0})
|
||||
|
||||
def apigridtaskset(req):
|
||||
a = req.GET.get('a')
|
||||
userid = req.session['userid']
|
||||
|
|
@ -7457,6 +7468,16 @@ def apigridtaskset(req):
|
|||
objs = objs.order_by('-pk')[startnum:endnum].values('id', 'gridlevel__dickeyname', 'user__name',
|
||||
'myschedule__name', 'note', 'periodictask__enabled','last_run_at','count')
|
||||
return HttpResponse(transjson(total, objs), content_type="application/json")
|
||||
elif a == 'list1':
|
||||
"""
|
||||
隐患跟踪任务配置
|
||||
"""
|
||||
objs = GridTaskSet.objects.filter(trouble__usecomp__partid=companyid)
|
||||
total = objs.count()
|
||||
startnum, endnum = fenye(req)
|
||||
objs = objs.order_by('-pk')[startnum:endnum].values('id', 'gridlevel__dickeyname', 'user__name',
|
||||
'myschedule__name', 'note', 'periodictask__enabled','last_run_at','count', 'trouble__yhnum', 'trouble__yhms', 'trouble__yhzt')
|
||||
return HttpResponse(transjson(total, objs), content_type="application/json")
|
||||
elif a == 'add':
|
||||
data = json.loads(req.body.decode('utf-8'))
|
||||
if 'myschedule' in data and data['myschedule']:
|
||||
|
|
|
|||
Loading…
Reference in New Issue