safesite/enp/templates/gprevention.html

193 lines
9.6 KiB
HTML
Raw 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:'center',title:'废气防治设施表',split:true,border:false" style="height:100%;">
<div id="gpreventionTableBar">
<a onclick="addgprevention()" class="easyui-linkbutton" data-options="iconCls: 'fa-plus',plain: true">新增</a>
<a onclick="edigprevention()" class="easyui-linkbutton" data-options="iconCls: 'fa-pencil',plain: true">编辑</a>
<a onclick="delgprevention()" class="easyui-linkbutton" data-options="iconCls: 'fa-trash',plain: true">删除</a>
</div>
<table id="gpreventionTable" style="height:100%"></table>
</div>
</div>
<div id="gpreventionDialog" class="easyui-dialog" style="width:800px;height:600px;padding:20px 25px;"
data-options="resizable:true,modal:true,closed:true,border:false">
<form method="post" id="gpreventionForm">
<input name="id" type="hidden">
<div style="margin-bottom:10px">
<input name="name" data-options="label:'设施名称', labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
<input name="number" data-options="label:'编码', labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
</div>
<div style="margin-bottom:10px">
<input name="type" data-options="label:'设施型号',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
<input name="cs_name" data-options="label:'参数名称', labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
</div>
<div style="margin-bottom:10px">
<input name="desig_nnumber" data-options="label:'设计值',labelWidth:100" class="easyui-numberbox" style="width:300px;" ></input>
<input name="em_unit" data-options="label:'单位',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
</div>
<div style="margin-bottom:10px">
<input name="start_time" data-options="label:'运行开始时间', editable:false, labelWidth:100" class="easyui-datebox" style="width:300px;" ></input>
<input name="end_time" data-options="label:'运行结束日期', editable:false, labelWidth:100" class="easyui-datebox" style="width:300px;" ></input>
</div>
<div style="margin-bottom:10px">
<input name="state" data-options="label:'运行状态',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
<input name="pfyql" data-options="label:'排放烟气量(m3/h)', labelWidth:130" class="easyui-numberbox" style="width:300px;" ></input>
</div>
<div style="margin-bottom:10px">
<input name="wryz" data-options="label:'污染因子',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
<input name="zlxl" data-options="label:'治理效率', labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
</div>
<div style="margin-bottom:10px">
<input name="sjly" data-options="label:'数据来源',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
<input name="pqtgd" data-options="label:'排气筒高度m', labelWidth:110" class="easyui-numberbox" style="width:300px;" ></input>
</div>
<div style="margin-bottom:10px">
<input name="pkwd" data-options="label:'排口温度℃',labelWidth:100" class="easyui-numberbox" style="width:300px;" ></input>
<input name="yl" data-options="label:'压力kPa', labelWidth:100" class="easyui-numberbox" style="width:300px;" ></input>
</div>
<div style="margin-bottom:10px">
<input name="pfsj" data-options="label:'排放时间h',labelWidth:100" class="easyui-numberbox" style="width:300px;" ></input>
<input name="hdl" data-options="label:'耗电率kWh', labelWidth:100" class="easyui-numberbox" style="width:300px;" ></input>
</div>
<div style="margin-bottom:10px">
<input name="fcpname" data-options="label:'副产品名称',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
<input name="fcwcl" data-options="label:'副产物产生量(t)', labelWidth:110" class="easyui-numberbox" style="width:300px;" ></input>
</div>
<div style="margin-bottom:10px">
<input name="yjname" data-options="label:'药剂名称',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
<input name="tjtime" data-options="label:'添加时间', editable:false, labelWidth:100" class="easyui-datebox" style="width:300px;" ></input>
</div>
<div style="margin-bottom:10px">
<input name="tjl" data-options="label:'添加量',labelWidth:100" class="easyui-numberbox" style="width:300px;" ></input>
</div>
<div style="text-align: center;">
<a class="easyui-linkbutton" iconCls="fa-floppy-o" onclick="savegprevention()">保存</a>
</div>
</form>
</div>
<script>
var gprevention_action_url = '/api/enp/gprevention/create/';
$('#gpreventionTable').datagrid({
url: '/api/enp/gprevention/list/',
rownumbers: true,
singleSelect: true,
striped: true,
method: 'get',
toolbar: '#gpreventionTableBar',
border: false,
columns: [[
{ field: 'id', title: 'ID', hidden: true },
{ field: 'name', title: '防治设施名称', width: 200 },
{ field: 'number', title: '编码', width: 200 },
{ field: 'type', title: '防治设施型号', width: 200 },
{ field: 'cs_name', title: '参数名', width: 200 },
{ field: 'desig_nnumber', title: '设计值', width: 200 },
{ field: 'em_unit', title: '单位', width: 200 },
{ field: 'start_time', title: '运行开始时间', width: 200 },
{ field: 'end_time', title: '运行结束时间', width: 200 },
{ field: 'state', title: '运行状态', width: 200 },
{ field: 'pfyql', title: '排放烟气量m3/h', width: 200 },
{ field: 'wryz', title: '污染因子', width: 200 },
{ field: 'zlxl', title: '治理效率', width: 200 },
{ field: 'sjly', title: '数据来源', width: 200 },
{ field: 'pqtgd', title: '排气筒高度m', width: 200 },
{ field: 'pkwd', title: '排口温度℃', width: 200 },
{ field: 'yl', title: '压力kPa', width: 200 },
{ field: 'pfsj', title: '排放时间h', width: 200 },
{ field: 'hdl', title: '耗电率kWh', width: 200 },
{ field: 'fcpname ', title: '副产品名称', width: 200 },
{ field: 'fcwcl', title: '副产物产生量t', width: 200 },
{ field: 'yjname', title: '药剂名称', width: 200 },
{ field: 'tjtime', title: '添加时间', width: 200 },
{ field: 'tjl', title: '添加量', width: 200 },
]],
onClickRow: function (index, row) {
}
});
//新增
function addgprevention() {
$('#gpreventionDialog').dialog('open').dialog('setTitle', '新增废气防治设施').window('center');
$('#gpreventionForm').form('clear');
gprevention_action_url = '/api/enp/gprevention/create/'
}
//保存数据
function savegprevention() {
var data = $('#gpreventionForm').serializeJSON();
$.ajax({
type: "POST",
url: gprevention_action_url,
data: JSON.stringify(data),
datatype: "json",
processData: false,
contentType: "application/json;charset=utf-8",
beforeSend: function () {
return $('#gpreventionForm').form('validate')
},
success: function (data) {
$("#gpreventionTable").datagrid('reload');
$("#gpreventionDialog").dialog("close");
},
});
}
//编辑数据
function edigprevention(){
var row = $('#gpreventionTable').datagrid('getSelected');
if(row){
$('#gpreventionDialog').dialog('open').dialog('setTitle', '编辑废气防治设施').window('center');
$('#gpreventionForm').form('load', row);
gprevention_action_url = '/api/enp/gprevention/update/'}
else{
$.messager.alert('提示', '请选择一条数据!');
}
}
//删除数据
function delgprevention(){
var row = $('#gpreventionTable').datagrid('getSelected');
if (row) {
$.messager.confirm('提示', '确定删除吗?', function (r) {
if (r) {
var data = { id: row.id }
$.ajax({
type: "POST",
url: '/api/enp/gprevention/delete/',
data: JSON.stringify(data),
datatype: "json",
beforeSend: function () { },
success: function (data) {
if (data.code == 1) {
$("#gpreventionTable").datagrid('reload');
$("#gpreventionTable").datagrid('reload');
}
else {
$.messager.alert('提示', '操作失败!');
}
},
});
}
});
}
else { $.messager.alert('提示', '请选择一条数据!'); }
}
</script>