272 lines
13 KiB
HTML
272 lines
13 KiB
HTML
<div class="easyui-layout" style="width:100%;height:100%;">
|
|
|
|
<div data-options="region:'west', title:'排放口', split:true, border:false" style="width: 300px;height:100%;">
|
|
<div id="drainTableBar">
|
|
<a onclick="addDrain()" class="easyui-linkbutton" data-options="iconCls: 'fa-plus',plain: true">新增</a>
|
|
<a onclick="editDrain()" class="easyui-linkbutton" data-options="iconCls: 'fa-pencil',plain: true">编辑</a>
|
|
<a onclick="delDrain()" class="easyui-linkbutton" data-options="iconCls: 'fa-trash',plain: true">删除</a>
|
|
</div>
|
|
<table id="drainTable" style="height:100%"></table>
|
|
</div>
|
|
<div data-options="region:'center',title:'监测记录',split:true,border:false" style="height:100%;">
|
|
<div id="gasEmitTableBar">
|
|
<a onclick="addGasEmitRecord()" class="easyui-linkbutton"
|
|
data-options="iconCls: 'fa-plus',plain: true">新增</a>
|
|
<a onclick="delGasEmitRecord()" class="easyui-linkbutton"
|
|
data-options="iconCls: 'fa-trash',plain: true">删除</a>
|
|
</div>
|
|
<table id="gasEmitTable" style="height:100%"></table>
|
|
</div>
|
|
</div>
|
|
<div id="drainDialog" class="easyui-dialog" style="width:400px;height:200px;padding:5px 15px;"
|
|
data-options="resizable:true,modal:true,closed:true,border:false">
|
|
<form method="post" id="drainForm">
|
|
<input name="id" type="hidden">
|
|
<div style="margin-bottom:10px">
|
|
<input name="number" data-options="label:'排放口编号'" class="easyui-textbox" style="width:300px;" required></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="name" data-options="label:'排放口名称'" class="easyui-textbox" style="width:300px;"
|
|
required></input>
|
|
</div>
|
|
<div style="text-align: center;">
|
|
<a class="easyui-linkbutton" iconCls="fa-floppy-o" onclick="saveDrain()">保存</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div id="gasEmitDialog" class="easyui-dialog" style="width:400px;height:800px;padding:5px 15px;"
|
|
data-options="resizable:true,modal:true,closed:true,border:false">
|
|
<form method="post" id="gasEmitForm">
|
|
<input name="id" type="hidden">
|
|
<input name="drain" type="hidden" id="gasEmitForm_drain">
|
|
<div style="margin-bottom:10px">
|
|
<input name="watch_time" data-options="label:'监测时间', editable:false, labelWidth:120" class="easyui-datetimebox" style="width:300px;" required ></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="out_smoke" data-options="label:'出:标态干烟气量', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" required></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="out_o2" data-options="label:'出:氧含量', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" required></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="out_so2" data-options="label:'出:二氧化硫', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" required></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="out_so2_s" data-options="label:'出:二氧化硫:折标', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" required></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="out_particle" data-options="label:'出:颗粒物', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" required></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="out_particle_s" data-options="label:'出:颗粒物:折标', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" required></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="out_nox" data-options="label:'出:氮氧化物', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" required></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="out_nox_s" data-options="label:'出:氮氧化物:折标', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" required></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="in_smoke" data-options="label:'入:标态干烟气量', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" required></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="in_o2" data-options="label:'入:氧含量', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" required></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="in_so2" data-options="label:'入:二氧化硫', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" required></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="in_so2_s" data-options="label:'入:二氧化硫:折标', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" required></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="in_particle" data-options="label:'入:颗粒物', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" required></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="in_particle_s" data-options="label:'入:颗粒物:折标', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" required></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="in_nox" data-options="label:'入:氮氧化物', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" required></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="in_nox_s" data-options="label:'入:氮氧化物:折标', labelWidth:120, min:0,precision:2" class="easyui-numberbox" style="width:300px;" required></input>
|
|
</div>
|
|
<div style="text-align: center;">
|
|
<a class="easyui-linkbutton" iconCls="fa-floppy-o" onclick="saveGasEmitRecord()">保存</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<script>
|
|
function aaa(x) {
|
|
if (x == "operator") {
|
|
$('#operatorFormItem').attr('value', top.$('#in').val());
|
|
$('#operator__nameFormItem').textbox('setValue', top.$('#in').attr('show'));
|
|
}
|
|
}
|
|
var drain_action_url = '/api/enp/drain/create/';
|
|
var record_action_url = '/api/enp/gasemit/create/';
|
|
$('#drainTable').datagrid({
|
|
url: '/api/enp/drain/list/',
|
|
rownumbers: true,
|
|
singleSelect: true,
|
|
striped: true,
|
|
method: 'get',
|
|
toolbar: '#drainTableBar',
|
|
border: false,
|
|
fitColumns: true,
|
|
columns: [[
|
|
{ field: 'id', title: 'ID', hidden: true },
|
|
{ field: 'number', title: '排放口编号', width: 100 },
|
|
{ field: 'name', title: '排放口名称', width: 100 },
|
|
]],
|
|
onClickRow: function (index, row) {
|
|
$('#gasEmitTable').datagrid({
|
|
url: '/api/enp/gasemit/list/?drain=' + row.id
|
|
})
|
|
}
|
|
});
|
|
$('#gasEmitTable').datagrid({
|
|
url: '/api/enp/gasemit/list/',
|
|
rownumbers: true,
|
|
singleSelect: true,
|
|
striped: true,
|
|
method: 'get',
|
|
toolbar: '#gasEmitTableBar',
|
|
border: false,
|
|
fitColumns: true,
|
|
columns: [[
|
|
{ field: 'id', title: 'ID', hidden: true },
|
|
{ field: 'drain', title: 'drain', hidden: true },
|
|
{ field: 'drain__name', title: '排放口 ', width: 100 },
|
|
{ field: 'watch_time', title: '监测时间', width: 100 },
|
|
{ field: 'out_smoke', title: '出:干烟含量', width: 100 },
|
|
{ field: 'out_o2', title: '出:氧含量', width: 100 },
|
|
{ field: 'out_so2', title: '出:二氧化硫', width: 100 },
|
|
{ field: 'out_so2_s', title: '出:二氧化硫折标', width: 100 },
|
|
{ field: 'out_particle', title: '出:颗粒物', width: 100 },
|
|
{ field: 'out_particle_s', title: '出:颗粒物折标', width: 100 },
|
|
{ field: 'out_nox', title: '出:氮氧化物', width: 100 },
|
|
{ field: 'out_nox_s', title: '出:氮氧化物折标', width: 100 },
|
|
]],
|
|
onClickRow: function (index, row) {
|
|
|
|
}
|
|
});
|
|
function addDrain() {
|
|
$('#drainDialog').dialog('open').dialog('setTitle', '新增排放口').window('center');
|
|
$('#drainForm').form('clear');
|
|
drain_action_url = '/api/enp/drain/create/'
|
|
}
|
|
function addGasEmitRecord() {
|
|
|
|
var row = $('#drainTable').datagrid('getSelected');
|
|
if(row){
|
|
$('#gasEmitDialog').dialog('open').dialog('setTitle', '新增记录').window('center');
|
|
$('#gasEmitForm').form('clear');
|
|
$('#gasEmitForm_drain').attr('value', row.id);
|
|
record_action_url = '/api/enp/gasemit/create/';
|
|
}else{
|
|
$.messager.alert('提示', '请先选择左侧排放口!');
|
|
}
|
|
|
|
}
|
|
function editDrain(){
|
|
var row = $('#draineTable').datagrid('getSelected');
|
|
if(row){
|
|
$('#drainDialog').dialog('open').dialog('setTitle', '编辑排放口').window('center');
|
|
$('#drainForm').form('load', row);
|
|
drain_action_url = '/api/enp/drain/update/'}
|
|
else{
|
|
$.messager.alert('提示', '请选择一条数据!');
|
|
}
|
|
}
|
|
function saveDrain() {
|
|
var data = $('#drainForm').serializeJSON();
|
|
$.ajax({
|
|
type: "POST",
|
|
url: drain_action_url,
|
|
data: JSON.stringify(data),
|
|
datatype: "json",
|
|
processData: false,
|
|
contentType: "application/json;charset=utf-8",
|
|
beforeSend: function () {
|
|
return $('#drainForm').form('validate')
|
|
},
|
|
success: function (data) {
|
|
$("#drainTable").datagrid('reload');
|
|
$("#drainDialog").dialog("close");
|
|
},
|
|
});
|
|
}
|
|
function saveGasEmitRecord() {
|
|
var data = $('#gasEmitForm').serializeJSON();
|
|
$.ajax({
|
|
type: "POST",
|
|
url: record_action_url,
|
|
data: JSON.stringify(data),
|
|
datatype: "json",
|
|
processData: false,
|
|
contentType: "application/json;charset=utf-8",
|
|
beforeSend: function () {
|
|
return $('#gasEmitForm').form('validate')
|
|
},
|
|
success: function (data) {
|
|
$("#gasEmitTable").datagrid('reload');
|
|
$("#gasEmitDialog").dialog("close");
|
|
},
|
|
});
|
|
}
|
|
function delDrain() {
|
|
var row = $('#drainTable').datagrid('getSelected');
|
|
if (row) {
|
|
$.messager.confirm('提示', '确定删除吗?', function (r) {
|
|
if (r) {
|
|
var data = { id: row.id }
|
|
$.ajax({
|
|
type: "POST",
|
|
url: '/api/enp/drain/delete/',
|
|
data: JSON.stringify(data),
|
|
datatype: "json",
|
|
beforeSend: function () { },
|
|
success: function (data) {
|
|
if (data.code == 1) {
|
|
$("#drainTable").datagrid('reload');
|
|
// $("#gasEmitTable").datagrid('reload');
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '操作失败!');
|
|
}
|
|
},
|
|
});
|
|
}
|
|
});
|
|
}
|
|
else { $.messager.alert('提示', '请选择一条数据!'); }
|
|
}
|
|
function delGasEmitRecord() {
|
|
var row = $('#gasEmitTable').datagrid('getSelected');
|
|
if (row) {
|
|
$.messager.confirm('提示', '确定删除吗?', function (r) {
|
|
if (r) {
|
|
var data = { id: row.id }
|
|
$.ajax({
|
|
type: "POST",
|
|
url: '/api/enp/gasemit/delete/',
|
|
data: JSON.stringify(data),
|
|
datatype: "json",
|
|
beforeSend: function () { },
|
|
success: function (data) {
|
|
if (data.code == 1) {
|
|
$("#gasEmitTable").datagrid('reload');
|
|
// $("#gasEmitTable").datagrid('reload');
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '操作失败!');
|
|
}
|
|
},
|
|
});
|
|
}
|
|
});
|
|
}
|
|
else { $.messager.alert('提示', '请选择一条数据!'); }
|
|
}
|
|
</script> |