202 lines
		
	
	
		
			9.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
			
		
		
	
	
			202 lines
		
	
	
		
			9.3 KiB
		
	
	
	
		
			HTML
		
	
	
	
| <div class="easyui-layout" style="width:100%;height:100%;">
 | |
| 
 | |
|    
 | |
|     <div data-options="region:'center',title:'废水防治设施表',split:true,border:false" style="height:100%;">
 | |
|         <div id="wpreventionTableBar">
 | |
|             <a onclick="addwprevention()" class="easyui-linkbutton" data-options="iconCls: 'fa-plus',plain: true">新增</a>
 | |
|                 <a onclick="ediwprevention()" class="easyui-linkbutton" data-options="iconCls: 'fa-pencil',plain: true">编辑</a>
 | |
|             <a onclick="delwprevention()" class="easyui-linkbutton" data-options="iconCls: 'fa-trash',plain: true">删除</a>
 | |
|         </div>
 | |
|         <table id="wpreventionTable" style="height:100%"></table>
 | |
|     </div>
 | |
| </div>
 | |
| 
 | |
| <div id="wpreventionDialog" 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="wpreventionForm">
 | |
|         <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="ckll" data-options="label:'出口流量',  labelWidth:100" 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="pqfx" data-options="label:'排放去向',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
 | |
|         </div>
 | |
|    
 | |
|         <div style="margin-bottom:10px">
 | |
|             <input name="wncsl" data-options="label:'污泥产生量', labelWidth:100" class="easyui-textbox" style="width:300px;"  ></input>
 | |
|             
 | |
|             <select class="easyui-combobox" data-options="label:'处理方式' " name="clfs" style="width:300px;">
 | |
|                 <option value="1">自行利用</option>
 | |
|                 <option value="2">委托处置</option>
 | |
|                 <option value="3">自行处置</option>
 | |
|             </select>
 | |
|           
 | |
|         </div>
 | |
|        
 | |
|         <div style="margin-bottom:10px">
 | |
|             <input name="hdl" data-options="label:'耗电量kWh', labelWidth:100" class="easyui-numberbox" style="width:300px;" ></input>
 | |
|             <input name="yjname" data-options="label:'药剂名称',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
 | |
|       
 | |
|             
 | |
|        </div>
 | |
|        <div style="margin-bottom:10px">
 | |
|         <input name="tjtime" data-options="label:'添加时间', editable:false, labelWidth:100" class="easyui-datebox" style="width:300px;"  ></input>
 | |
|         <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="savewprevention()">保存</a>
 | |
|         </div>
 | |
|     </form>
 | |
| </div>
 | |
| <script>
 | |
|    
 | |
|     var wprevention_action_url = '/api/enp/wprevention/create/';
 | |
|     
 | |
|     $('#wpreventionTable').datagrid({
 | |
|         url: '/api/enp/wprevention/list/',
 | |
|         rownumbers: true,
 | |
|         singleSelect: true,
 | |
|         striped: true,
 | |
|         method: 'get',
 | |
|         toolbar: '#wpreventionTableBar',
 | |
|         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: 'ckll', title: '出口流量', width: 200 },
 | |
|             { field: 'wryz', title: '污染因子', width: 200 },
 | |
|             { field: 'zlxl', title: '治理效率', width: 200 },
 | |
|             { field: 'sjly', title: '数据来源', width: 200 },
 | |
|             { field: 'pqfx', title: '排放去向', width: 200 },
 | |
|             { field: 'wncsl', title: '污泥产生量', width: 200 },
 | |
|             {field:'clfs',title:'处理方式', width:200,
 | |
| 			formatter: function(value,row,index){
 | |
| 				if (value=='1'){
 | |
| 					return '自行利用';
 | |
| 				} 
 | |
|                  else if (value=='2')  {
 | |
| 					return '委托处置';
 | |
| 				}
 | |
|                 else{
 | |
|                     return '自行处置';
 | |
|                 }
 | |
| 			}
 | |
| 		},
 | |
|             { field: 'hdl', title: '耗电量kWh', width: 200 },
 | |
|             { field: 'yjname', title: '药剂名称', width: 200 },
 | |
|             { field: 'tjtime', title: '添加时间', width: 200 },
 | |
|             { field: 'tjl', title: '添加量', width: 200 },
 | |
|            
 | |
|             
 | |
|         ]],
 | |
|         onClickRow: function (index, row) {
 | |
| 
 | |
|         }
 | |
|     });
 | |
|    
 | |
|     //新增
 | |
|     function addwprevention() {
 | |
|         $('#wpreventionDialog').dialog('open').dialog('setTitle', '新增生产设施工况表').window('center');
 | |
|         $('#wpreventionForm').form('clear');
 | |
|         wprevention_action_url = '/api/enp/wprevention/create/'
 | |
|     }
 | |
|     //保存数据
 | |
|     function savewprevention() {
 | |
|         var data = $('#wpreventionForm').serializeJSON();
 | |
|         $.ajax({
 | |
|             type: "POST",
 | |
|             url: wprevention_action_url,
 | |
|             data: JSON.stringify(data),
 | |
|             datatype: "json",
 | |
|             processData: false,
 | |
|             contentType: "application/json;charset=utf-8",
 | |
|             beforeSend: function () {
 | |
|                 return $('#wpreventionForm').form('validate')
 | |
|             },
 | |
|             success: function (data) {
 | |
|                 $("#wpreventionTable").datagrid('reload');
 | |
|                 $("#wpreventionDialog").dialog("close");
 | |
|                
 | |
|             },
 | |
|         });
 | |
|     }
 | |
|     //编辑数据
 | |
|     function ediwprevention(){
 | |
|           var row = $('#wpreventionTable').datagrid('getSelected');
 | |
|         if(row){
 | |
|             $('#wpreventionDialog').dialog('open').dialog('setTitle', '编辑生产设施工况表').window('center');
 | |
|         $('#wpreventionForm').form('load', row);
 | |
|         wprevention_action_url = '/api/enp/wprevention/update/'}
 | |
|         else{
 | |
|             $.messager.alert('提示', '请选择一条数据!');
 | |
|         }
 | |
|     }
 | |
|     //删除数据
 | |
|     function delwprevention(){
 | |
|         var row = $('#wpreventionTable').datagrid('getSelected');
 | |
|         if (row) {
 | |
|             $.messager.confirm('提示', '确定删除吗?', function (r) {
 | |
|                 if (r) {
 | |
|                     var data = { id: row.id }
 | |
|                     $.ajax({
 | |
|                         type: "POST",
 | |
|                         url: '/api/enp/wprevention/delete/',
 | |
|                         data: JSON.stringify(data),
 | |
|                         datatype: "json",
 | |
|                         beforeSend: function () { },
 | |
|                         success: function (data) {
 | |
|                             if (data.code == 1) {
 | |
|                                 $("#wpreventionTable").datagrid('reload');
 | |
|                                 $("#wpreventionTable").datagrid('reload');
 | |
|                             }
 | |
|                             else {
 | |
|                                 $.messager.alert('提示', '操作失败!');
 | |
|                             }
 | |
|                         },
 | |
|                     });
 | |
|                 }
 | |
|             });
 | |
|         }
 | |
|         else { $.messager.alert('提示', '请选择一条数据!'); }
 | |
| 
 | |
|     }
 | |
| </script> |