192 lines
9.7 KiB
HTML
192 lines
9.7 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="facilitiesTableBar">
|
|
<a onclick="addfacilities()" class="easyui-linkbutton" data-options="iconCls: 'fa-plus',plain: true">新增</a>
|
|
<a onclick="edifacilities()" class="easyui-linkbutton" data-options="iconCls: 'fa-pencil',plain: true">编辑</a>
|
|
<a onclick="delfacilities()" class="easyui-linkbutton" data-options="iconCls: 'fa-trash',plain: true">删除</a>
|
|
</div>
|
|
<table id="facilitiesTable" style="height:100%"></table>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="facilitiesDialog" 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="facilitiesForm">
|
|
<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="actual_number" data-options="label:'实际值', labelWidth:100" class="easyui-numberbox" style="width:300px;" ></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="em_unit" data-options="label:'参数单位',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
|
|
|
<input name="ability" data-options="label:'生产能力', labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="al_unit" data-options="label:'能力单位',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
|
|
|
<input name="pdc_Load" 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="zj_product" data-options="label:'中间产品',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
|
|
|
<input name="zj_unit" data-options="label:'中间产品单位', labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="zz_product" data-options="label:'最终产品',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
|
|
|
<input name="zz_unit" data-options="label:'最终产品单位', labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="material_name" data-options="label:'原辅料名称',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
|
|
|
<input name="material_type" data-options="label:'原辅料种类', labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="material_count" data-options="label:'原辅料用量',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
|
|
|
<input name="material_unit" data-options="label:'原辅料单位', labelWidth:100" class="easyui-textbox" style="width:300px;"></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="material_composition" data-options="label:'有毒有害成分',labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
|
|
|
<input name="material_account" data-options="label:'有毒有害占比', labelWidth:100" class="easyui-textbox" style="width:300px;" ></input>
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="material_address" data-options="label:'来源地',labelWidth:100" class="easyui-textbox" style="width:600px;" ></input>
|
|
|
|
|
|
</div>
|
|
<div style="text-align: center;">
|
|
<a class="easyui-linkbutton" iconCls="fa-floppy-o" onclick="savefacilities()">保存</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<script>
|
|
|
|
var facilities_action_url = '/api/enp/facilities/create/';
|
|
|
|
$('#facilitiesTable').datagrid({
|
|
url: '/api/enp/facilities/list/',
|
|
rownumbers: true,
|
|
singleSelect: true,
|
|
striped: true,
|
|
method: 'get',
|
|
toolbar: '#facilitiesTableBar',
|
|
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: 'actual_number', title: '实际值', width: 200 },
|
|
{ field: 'em_unit', title: '参数单位', width: 200 },
|
|
{ field: 'ability', title: '生产能力', width: 200 },
|
|
{ field: 'al_unit', title: '能力单位', width: 200 },
|
|
{ field: 'start_time', title: '运行开始时间', width: 200 },
|
|
{ field: 'end_time', title: '运行结束时间', width: 200 },
|
|
{ field: 'pdc_Load', title: '生产负荷', width: 200 },
|
|
{ field: 'zj_product', title: '中间产品', width: 200 },
|
|
{ field: 'zj_unit', title: '单位', width: 200 },
|
|
{ field: 'zz_product', title: '最终产品', width: 200 },
|
|
{ field: 'zz_unit', title: '单位', width: 200 },
|
|
{ field: 'material_name', title: '原辅料名称', width: 200 },
|
|
{ field: 'material_type', title: '原辅料种类', width: 200 },
|
|
{ field: 'material_count', title: '原辅料用量', width: 200 },
|
|
{ field: 'material_unit', title: '原辅料单位', width: 200 },
|
|
{ field: 'material_composition', title: '有毒有害成分', width: 200 },
|
|
{ field: 'material_account', title: '有毒有害占比', width: 200 },
|
|
{ field: 'material_address', title: '来源地', width: 200 }
|
|
]],
|
|
onClickRow: function (index, row) {
|
|
|
|
}
|
|
});
|
|
|
|
//新增
|
|
function addfacilities() {
|
|
$('#facilitiesDialog').dialog('open').dialog('setTitle', '新增生产设施工况表').window('center');
|
|
$('#facilitiesForm').form('clear');
|
|
facilities_action_url = '/api/enp/facilities/create/'
|
|
}
|
|
//保存数据
|
|
function savefacilities() {
|
|
var data = $('#facilitiesForm').serializeJSON();
|
|
$.ajax({
|
|
type: "POST",
|
|
url: facilities_action_url,
|
|
data: JSON.stringify(data),
|
|
datatype: "json",
|
|
processData: false,
|
|
contentType: "application/json;charset=utf-8",
|
|
beforeSend: function () {
|
|
return $('#facilitiesForm').form('validate')
|
|
},
|
|
success: function (data) {
|
|
$("#facilitiesTable").datagrid('reload');
|
|
$("#facilitiesDialog").dialog("close");
|
|
|
|
},
|
|
});
|
|
}
|
|
//编辑数据
|
|
function edifacilities(){
|
|
var row = $('#facilitiesTable').datagrid('getSelected');
|
|
if(row){
|
|
$('#facilitiesDialog').dialog('open').dialog('setTitle', '编辑生产设施工况表').window('center');
|
|
$('#facilitiesForm').form('load', row);
|
|
facilities_action_url = '/api/enp/facilities/update/'}
|
|
else{
|
|
$.messager.alert('提示', '请选择一条数据!');
|
|
}
|
|
}
|
|
//删除数据
|
|
function delfacilities(){
|
|
var row = $('#facilitiesTable').datagrid('getSelected');
|
|
if (row) {
|
|
$.messager.confirm('提示', '确定删除吗?', function (r) {
|
|
if (r) {
|
|
var data = { id: row.id }
|
|
$.ajax({
|
|
type: "POST",
|
|
url: '/api/enp/facilities/delete/',
|
|
data: JSON.stringify(data),
|
|
datatype: "json",
|
|
beforeSend: function () { },
|
|
success: function (data) {
|
|
if (data.code == 1) {
|
|
$("#facilitiesTable").datagrid('reload');
|
|
$("#facilitiesTable").datagrid('reload');
|
|
}
|
|
else {
|
|
$.messager.alert('提示', '操作失败!');
|
|
}
|
|
},
|
|
});
|
|
}
|
|
});
|
|
}
|
|
else { $.messager.alert('提示', '请选择一条数据!'); }
|
|
|
|
}
|
|
</script> |