164 lines
		
	
	
		
			7.0 KiB
		
	
	
	
		
			HTML
		
	
	
	
			
		
		
	
	
			164 lines
		
	
	
		
			7.0 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="fuelTableBar">
 | ||
|             <a onclick="addfuel()" class="easyui-linkbutton" data-options="iconCls: 'fa-plus',plain: true">新增</a>
 | ||
|                 <a onclick="edifuel()" class="easyui-linkbutton" data-options="iconCls: 'fa-pencil',plain: true">编辑</a>
 | ||
|             <a onclick="delfuel()" class="easyui-linkbutton" data-options="iconCls: 'fa-trash',plain: true">删除</a>
 | ||
|         </div>
 | ||
|         <table id="fuelTable" style="height:100%"></table>
 | ||
|     </div>
 | ||
| </div>
 | ||
| 
 | ||
| <div id="fuelDialog" 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="fuelForm">
 | ||
|         <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="count" data-options="label:'用量', labelWidth:100" class="easyui-numberbox" style="width:300px;"></input>
 | ||
|         </div>
 | ||
|         <div style="margin-bottom:10px">
 | ||
|             <input name="dwcount" data-options="label:'低位热值',labelWidth:100" class="easyui-numberbox" style="width:300px;" ></input>
 | ||
|       
 | ||
|             <input name="unit" data-options="label:'单位', labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
 | ||
|         </div>
 | ||
|         <div style="margin-bottom:10px">
 | ||
|             <input name="rmhll" data-options="label:'燃煤含硫量(%)',labelWidth:150" class="easyui-numberbox" style="width:300px;" ></input>
 | ||
|       
 | ||
|             <input name="rmhff" data-options="label:'燃煤挥发分(%)', labelWidth:150" class="easyui-numberbox" style="width:300px;" ></input>
 | ||
|         </div>
 | ||
|         <div style="margin-bottom:10px">
 | ||
|             <input name="rmqt" data-options="label:'燃煤其他',labelWidth:150" class="easyui-textbox" style="width:600px;" ></input>
 | ||
|       
 | ||
|         </div>
 | ||
|         <div style="margin-bottom:10px">
 | ||
|           
 | ||
|             <input name="ryhll" data-options="label:'燃油含硫量(%)', labelWidth:150" class="easyui-numberbox" style="width:600px;" ></input>
 | ||
|         </div>
 | ||
|         <div style="margin-bottom:10px">
 | ||
|             <input name="ryqt" data-options="label:'燃油其他',labelWidth:150" class="easyui-textbox" style="width:600px;" ></input>
 | ||
|       
 | ||
|         </div>
 | ||
|         <div style="margin-bottom:10px">
 | ||
|           
 | ||
|       
 | ||
|             <input name="rqlhqhl" data-options="label:'燃气硫化氢含量(%)', labelWidth:150" class="easyui-numberbox" style="width:600px;" ></input>
 | ||
|         </div>
 | ||
|         <div style="margin-bottom:10px">
 | ||
|             <input name="rqqt" data-options="label:'燃气其他',  labelWidth:150" class="easyui-textbox" style="width:600px;"  ></input>
 | ||
|        
 | ||
|           
 | ||
|         </div>
 | ||
|         <div style="margin-bottom:10px">
 | ||
|           
 | ||
|        
 | ||
|             <input name="qtrlxgwzhl" data-options="label:'其他燃料相关物质含量', labelWidth:150" class="easyui-textbox" style="width:300px;"  ></input>
 | ||
|         </div>
 | ||
|         <div style="text-align: center;">
 | ||
|             <a class="easyui-linkbutton" iconCls="fa-floppy-o" onclick="savefuel()">保存</a>
 | ||
|         </div>
 | ||
|     </form>
 | ||
| </div>
 | ||
| <script>
 | ||
|    
 | ||
|     var fuel_action_url = '/api/enp/fuel/create/';
 | ||
|     
 | ||
|     $('#fuelTable').datagrid({
 | ||
|         url: '/api/enp/fuel/list/',
 | ||
|         rownumbers: true,
 | ||
|         singleSelect: true,
 | ||
|         striped: true,
 | ||
|         method: 'get',
 | ||
|         toolbar: '#fuelTableBar',
 | ||
|         border: false,
 | ||
|         columns: [[
 | ||
|             { field: 'id', title: 'ID', hidden: true },
 | ||
|             { field: 'name', title: '燃料名称', width: 200 },
 | ||
|             { field: 'count', title: '用量', width: 200 },
 | ||
|             { field: 'dwcount', title: '低位热值', width: 200 },
 | ||
|             { field: 'unit', title: '单位', width: 200 },
 | ||
|             { field: 'rmhll', title: '燃煤含硫量(%)', width: 200 },
 | ||
|             { field: 'rmhff', title: '燃煤挥发分(%)', width: 200 },
 | ||
|             { field: 'rmqt', title: '燃煤其他', width: 200 },
 | ||
|             { field: 'ryhll', title: '燃油含硫量(%)', width: 200 },
 | ||
|             { field: 'ryqt', title: '燃油其他', width: 200 },
 | ||
|             { field: 'rqlhqhl', title: '燃气硫化氢含量(%)', width: 200 },
 | ||
|             { field: 'rqqt', title: '燃气其他', width: 200 },
 | ||
|             { field: 'qtrlxgwzhl', title: '其他燃料相关物质含量', width: 200 },
 | ||
|             
 | ||
|         ]],
 | ||
|         onClickRow: function (index, row) {
 | ||
| 
 | ||
|         }
 | ||
|     });
 | ||
|    
 | ||
|     //新增
 | ||
|     function addfuel() {
 | ||
|         $('#fuelDialog').dialog('open').dialog('setTitle', '新增燃料信息').window('center');
 | ||
|         $('#fuelForm').form('clear');
 | ||
|         fuel_action_url = '/api/enp/fuel/create/'
 | ||
|     }
 | ||
|     //保存数据
 | ||
|     function savefuel() {
 | ||
|         var data = $('#fuelForm').serializeJSON();
 | ||
|         $.ajax({
 | ||
|             type: "POST",
 | ||
|             url: fuel_action_url,
 | ||
|             data: JSON.stringify(data),
 | ||
|             datatype: "json",
 | ||
|             processData: false,
 | ||
|             contentType: "application/json;charset=utf-8",
 | ||
|             beforeSend: function () {
 | ||
|                 return $('#fuelForm').form('validate')
 | ||
|             },
 | ||
|             success: function (data) {
 | ||
|                 $("#fuelTable").datagrid('reload');
 | ||
|                 $("#fuelDialog").dialog("close");
 | ||
|                
 | ||
|             },
 | ||
|         });
 | ||
|     }
 | ||
|     //编辑数据
 | ||
|     function edifuel(){
 | ||
|           var row = $('#fuelTable').datagrid('getSelected');
 | ||
|         if(row){
 | ||
|             $('#fuelDialog').dialog('open').dialog('setTitle', '编辑燃料信息表').window('center');
 | ||
|         $('#fuelForm').form('load', row);
 | ||
|         fuel_action_url = '/api/enp/fuel/update/'}
 | ||
|         else{
 | ||
|             $.messager.alert('提示', '请选择一条数据!');
 | ||
|         }
 | ||
|     }
 | ||
|     //删除数据
 | ||
|     function delfuel(){
 | ||
|         var row = $('#fuelTable').datagrid('getSelected');
 | ||
|         if (row) {
 | ||
|             $.messager.confirm('提示', '确定删除吗?', function (r) {
 | ||
|                 if (r) {
 | ||
|                     var data = { id: row.id }
 | ||
|                     $.ajax({
 | ||
|                         type: "POST",
 | ||
|                         url: '/api/enp/fuel/delete/',
 | ||
|                         data: JSON.stringify(data),
 | ||
|                         datatype: "json",
 | ||
|                         beforeSend: function () { },
 | ||
|                         success: function (data) {
 | ||
|                             if (data.code == 1) {
 | ||
|                                 $("#fuelTable").datagrid('reload');
 | ||
|                                 $("#fuelTable").datagrid('reload');
 | ||
|                             }
 | ||
|                             else {
 | ||
|                                 $.messager.alert('提示', '操作失败!');
 | ||
|                             }
 | ||
|                         },
 | ||
|                     });
 | ||
|                 }
 | ||
|             });
 | ||
|         }
 | ||
|         else { $.messager.alert('提示', '请选择一条数据!'); }
 | ||
| 
 | ||
|     }
 | ||
| </script> |