safesite/enp/templates/wwater.html

271 lines
12 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<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="detectionTableBar">
<a onclick="adddetection()" class="easyui-linkbutton" data-options="iconCls: 'fa-plus',plain: true">新增</a>
<a onclick="deldetection()" class="easyui-linkbutton" data-options="iconCls: 'fa-trash',plain: true">删除</a>
</div>
<table id="detectionTable" 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="detectionDialog" class="easyui-dialog" style="width:700px;height:600px;padding:20px 25px;"
data-options="resizable:true,modal:true,closed:true,border:false">
<form method="post" id="detectionForm">
<input name="id" type="hidden">
<input name="drain" type="hidden" id="gasEmitForm_drain">
<div style="margin-bottom:10px">
<input name="number" data-options="label:'排放口编码', labelWidth:100" class="easyui-textbox" style="width:600px;" ></input>
</div>
<div style="margin-bottom:10px">
<input name="jcDate" data-options="label:'监测日期', editable:false, labelWidth:100" class="easyui-datebox" style="width:300px;" ></input>
<input name="jctime" data-options="label:'监测时间', editable:false, labelWidth:100" class="easyui-datetimespinner" style="width:300px;" ></input>
</div>
<div style="margin-bottom:10px">
<input name="ckhxxyl" data-options="label:'出口化学需氧量mg/L',labelWidth:180" class="easyui-numberbox" style="width:300px;" ></input>
<input name="ckshxll" data-options="label:'出口生化需氧量mg/L', labelWidth:180" class="easyui-numberbox" style="width:300px;" ></input>
</div>
<div style="margin-bottom:10px">
<input name="ckad" data-options="label:'出口氨氮mg/L',labelWidth:180" class="easyui-numberbox" style="width:300px;" ></input>
<input name="ckxfw" data-options="label:'出口悬浮物mg/L', labelWidth:180" class="easyui-numberbox" style="width:300px;" ></input>
</div>
<div style="margin-bottom:10px">
<input name="jkhxxyl" data-options="label:'进口化学需氧量mg/L',labelWidth:180" class="easyui-numberbox" style="width:300px;" ></input>
<input name="jkshxll" data-options="label:'进口生化需氧量mg/L', labelWidth:180" class="easyui-numberbox" style="width:300px;" ></input>
</div>
<div style="margin-bottom:10px">
<input name="jkad" data-options="label:'进口氨氮mg/L',labelWidth:180" class="easyui-numberbox" style="width:300px;" ></input>
<input name="jkxfw" data-options="label:'进口悬浮物mg/L', labelWidth:180" class="easyui-numberbox" style="width:300px;" ></input>
</div>
<div style="text-align: center;">
<a class="easyui-linkbutton" iconCls="fa-floppy-o" onclick="savedetection()">保存</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/drains/create/';
var record_action_url = '/api/enp/gasemit/create/';
$('#drainTable').datagrid({
url: '/api/enp/drains/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) {
$('#detectionTable').datagrid({
url: '/api/enp/detection/list/?drain=' + row.id
})
}
});
$('#detectionTable').datagrid({
url: '/api/enp/detection/list/',
rownumbers: true,
singleSelect: true,
striped: true,
method: 'get',
toolbar: '#detectionTableBar',
border: false,
columns: [[
{ field: 'id', title: 'ID', hidden: true },
{ field: 'drain', title: 'drain', hidden: true },
{ field: 'drain__name', title: '排放口 ', width: 200 },
{ field: 'jcDate', title: '监测日期', width: 200 },
{ field: 'jctime', title: '监测时间', width: 200 },
{ field: 'ckhxxyl', title: '出:化学需氧量mg/L', width: 200 },
{ field: 'ckshxll', title: '出:生化需氧量mg/L', width: 200 },
{ field: 'ckad', title: '出:氨氮mg/L', width: 200 },
{ field: 'ckxfw', title: '出:悬浮物mg/L', width: 200 },
{ field: 'jkhxxyl', title: '进:化学需氧量mg/L', width: 200 },
{ field: 'jkshxll', title: '进:生化需氧量mg/L', width: 200 },
{ field: 'jkad', title: '进:氨氮mg/L', width: 200 },
{ field: 'jkxfw', title: '进:悬浮物mg/L', width: 200 },
]],
onClickRow: function (index, row) {
}
});
function addDrain() {
$('#drainDialog').dialog('open').dialog('setTitle', '新增排放口').window('center');
$('#drainForm').form('clear');
drain_action_url = '/api/enp/drains/create/'
}
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/drains/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 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/drains/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 adddetection() {
var row = $('#drainTable').datagrid('getSelected');
if(row){
$('#detectionDialog').dialog('open').dialog('setTitle', '新增记录').window('center');
$('#detectionForm').form('clear');
$('#gasEmitForm_drain').attr('value', row.id);
record_action_url = '/api/enp/detection/create/';
}else{
$.messager.alert('提示', '请先选择左侧排放口!');
}
}
var detection_action_url = '/api/enp/detection/create/';
//保存数据
function savedetection() {
var data = $('#detectionForm').serializeJSON();
$.ajax({
type: "POST",
url: detection_action_url,
data: JSON.stringify(data),
datatype: "json",
processData: false,
contentType: "application/json;charset=utf-8",
beforeSend: function () {
return $('#detectionForm').form('validate')
},
success: function (data) {
$("#detectionTable").datagrid('reload');
$("#detectionDialog").dialog("close");
},
});
}
//编辑数据
function edidetection(){
var row = $('#detectionTable').datagrid('getSelected');
if(row){
$('#detectionDialog').dialog('open').dialog('setTitle', '编辑废水污染物检测结').window('center');
$('#detectionForm').form('load', row);
detection_action_url = '/api/enp/detection/update/'}
else{
$.messager.alert('提示', '请选择一条数据!');
}
}
//删除数据
function deldetection(){
var row = $('#detectionTable').datagrid('getSelected');
if (row) {
$.messager.confirm('提示', '确定删除吗?', function (r) {
if (r) {
var data = { id: row.id }
$.ajax({
type: "POST",
url: '/api/enp/detection/delete/',
data: JSON.stringify(data),
datatype: "json",
beforeSend: function () { },
success: function (data) {
if (data.code == 1) {
$("#detectionTable").datagrid('reload');
$("#detectionTable").datagrid('reload');
}
else {
$.messager.alert('提示', '操作失败!');
}
},
});
}
});
}
else { $.messager.alert('提示', '请选择一条数据!'); }
}
</script>