286 lines
10 KiB
Plaintext
286 lines
10 KiB
Plaintext
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
|
<%@ page import="com.sipai.tools.SessionManager"%>
|
|
<%
|
|
SessionManager sessionManager = new SessionManager();
|
|
%>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title></title>
|
|
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
|
<script type="text/javascript">
|
|
var grid;
|
|
var editFun = function(id) {
|
|
var dialog = parent.ext.modalDialog({
|
|
title : '编辑设备信息',
|
|
url : ext.contextPath + '/material/cutterstandard/edit.do?id=' + id,
|
|
buttons : [ {
|
|
text : '保存',
|
|
handler : function() {
|
|
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
|
}
|
|
} ]
|
|
});
|
|
};
|
|
|
|
var addFun = function() {
|
|
var dialog = parent.ext.modalDialog({
|
|
width: 780,
|
|
height:550,
|
|
title : '添加专家库刀具信息',
|
|
url : ext.contextPath + '/material/cutterstandard/add.do',
|
|
buttons : [ {
|
|
text : '保存',
|
|
handler : function() {
|
|
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
|
}
|
|
} ]
|
|
});
|
|
};
|
|
|
|
var cutterStandardIssuedFun = function() {
|
|
var dialog = parent.ext.modalDialog({
|
|
width: 780,
|
|
height:550,
|
|
title : '下发专家库刀具信息',
|
|
url : ext.contextPath + '/material/cutterstandard/issued.do',
|
|
});
|
|
};
|
|
function dosave(datarow) {
|
|
$.post(ext.contextPath + "/material/cutterstandard/saveGridData.do",{datarow:datarow},function(data1){
|
|
if(JSON.parse(data1).res>0)
|
|
{
|
|
}
|
|
else if(JSON.parse(data1).res == 0){
|
|
top.$.messager.alert('提示', "保存失败", 'info');
|
|
}else{
|
|
top.$.messager.alert('提示', data1.res, 'info');
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
var deleteFun = function() {
|
|
var checkedItems = $('#grid').datagrid('getChecked');
|
|
var datas="";
|
|
$.each(checkedItems, function(index, item){
|
|
datas+=item.id+",";
|
|
});
|
|
if(datas==""){
|
|
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
|
}else{
|
|
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
|
if (r) {
|
|
$.post(ext.contextPath + '/material/cutterstandard/delete.do', {ids:datas} , function(data) {
|
|
if(data>0){
|
|
parent.$.messager.alert('提示','成功删除'+data+'条记录','info');
|
|
grid.datagrid('reload');
|
|
grid.datagrid('clearChecked');
|
|
}else{
|
|
parent.$.messager.alert('提示','删除失败','info');
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
};
|
|
|
|
|
|
var editIndex = undefined;//定义编辑列的索引
|
|
function endEditing(){//清除editor
|
|
if (editIndex == undefined){return true;}
|
|
if ($('#grid').datagrid('validateRow', editIndex)){
|
|
$('#grid').datagrid('endEdit', editIndex);
|
|
editIndex = undefined;
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
$(function() {
|
|
/*$.extend($.fn.datagrid.methods, {
|
|
editCell: function(jq,param){
|
|
return jq.each(function(){
|
|
var opts = $(this).datagrid('options');
|
|
var fields = $(this).datagrid('getColumnFields',true).concat($(this).datagrid('getColumnFields'));
|
|
for(var i=0; i<fields.length; i++){
|
|
var col = $(this).datagrid('getColumnOption', fields[i]);
|
|
col.editor1 = col.editor;
|
|
if (fields[i] != param.field){
|
|
col.editor = null;
|
|
}
|
|
}
|
|
$(this).datagrid('beginEdit', param.index);
|
|
for(var i=0; i<fields.length; i++){
|
|
var col = $(this).datagrid('getColumnOption', fields[i]);
|
|
col.editor = col.editor1;
|
|
}
|
|
});
|
|
}
|
|
});*/
|
|
grid = $('#grid').datagrid({
|
|
view: detailview,
|
|
detailFormatter:function(index,row){
|
|
return '<div style="padding:2px"><table class="ddv"></table></div>';
|
|
},
|
|
title : '',
|
|
url : ext.contextPath + '/material/cutterstandard/getlist.do',
|
|
striped : true,
|
|
rownumbers : true,
|
|
pagination : true,
|
|
singleSelect: true,
|
|
ctrlSelect: true,
|
|
selectOnCheck: false,
|
|
checkOnSelect: false,
|
|
idField : 'id',
|
|
pageSize : 50,
|
|
pageList : [ 20, 50, 100],
|
|
frozenColumns:[[
|
|
{checkbox:true , field : 'ck'},
|
|
{width : '130', title : '设备编号', field : 'equipmentcardid', sortable : true, align:'center',halign:'center'},
|
|
{width : '100', title : '设备名称', field : 'equipmentname', sortable : true,align:'center', halign:'center'},
|
|
{width : '100', title : '物料长代码', field : 'materialcode', sortable : true,align:'center', halign:'center'},
|
|
] ],
|
|
columns : [ [
|
|
{width : '100', title : 'G1进给速度', field : 'stequgospeedvalue', sortable : true,align:'center', halign:'center',editor:'textbox'},
|
|
{width : '100', title : '主轴转速', field : 'stequcaspeedvalue', sortable : true,align:'center', halign:'center',editor:'textbox'},
|
|
{width : '100', title : '加工累计数', field : 'stprocesscumnovalue', sortable : true,align:'center', halign:'center',editor:'textbox'},
|
|
{width : '100', title : '机械手计数', field : 'stmechandnovalue', sortable : true, align:'center',halign:'center',editor:'textbox'},
|
|
{width : '100', title : '刀损计数', field : 'stcutterlossnovalue', sortable : true, align:'center',halign:'center',editor:'textbox'},
|
|
{width : '100', title : '刀损设定', field : 'stcutterlosssetvalue', sortable : true, align:'center',halign:'center',editor:'textbox'},
|
|
{width : '125', title : '操作时间', field : 'insdt', sortable : true, align:'center',halign:'center',formatter : function(value, row){
|
|
return value.substring(0,19);
|
|
} }
|
|
] ],
|
|
toolbar : '#toolbar',
|
|
onLoadSuccess : function(data) {
|
|
$('.iconImg').attr('src', ext.pixel_0);
|
|
|
|
},
|
|
onClickCell:function(index){
|
|
endEditing();
|
|
},
|
|
onDblClickCell : function(index,field){
|
|
/*if (endEditing()) {
|
|
$('#grid').datagrid('selectRow', index).datagrid('editCell', {index:index,field:field});
|
|
editIndex = index;
|
|
}*/
|
|
if(!endEditing()){
|
|
return false;
|
|
}
|
|
|
|
editIndex = index;
|
|
$('#grid').datagrid('selectRow', editIndex).datagrid('beginEdit', editIndex);
|
|
|
|
var ed = $('#grid').datagrid('getEditor', {index:editIndex,field:'name'});
|
|
($(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target)).focus();
|
|
},
|
|
onAfterEdit:function(index,row){
|
|
//保存行
|
|
var datarow = "["+JSON.stringify(row)+"]";
|
|
dosave(datarow);
|
|
},
|
|
onExpandRow: function(index,prow){
|
|
ddv = $(this).datagrid('getRowDetail',index).find('table.ddv');
|
|
ddv.datagrid({
|
|
url:ext.contextPath + '/material/cutterstandard/getCutterStandard.do?pid='+prow.id,
|
|
fitColumns:true,
|
|
singleSelect: true,
|
|
selectOnCheck: false,
|
|
checkOnSelect: false,
|
|
striped: true,
|
|
idField : 'id',
|
|
rownumbers:true,
|
|
//loadMsg:'',
|
|
height:'auto',
|
|
columns : [ [
|
|
{width : '100', title : '刀具编号', field : 'cutterno', sortable : true,align:'center', halign:'center', formatter : function(value, row) {
|
|
return "刀具";
|
|
}
|
|
},
|
|
{width : '100', title : '刀补量', field : 'stcutteramountvalue', sortable : true,align:'center', halign:'center',editor:'textbox'},
|
|
{width : '100', title : '首补片数', field : 'stfirstpiecenovalue', sortable : true, align:'center',halign:'center'},
|
|
{width : '100', title : '首补量', field : 'stfirstamountvalue', sortable : true, align:'center',align:'center', halign:'center'},
|
|
{width : '100', title : '自补频率', field : 'stautofreqvalue', sortable : true, align:'center',halign:'center'},
|
|
{width : '100', title : '自补量', field : 'stautoamountvalue', sortable : true, align:'center', halign:'center'},
|
|
{title : '操作', field : 'action', width : '100', halign:'center', align:'center', formatter : function(value, row) {
|
|
var str = '';
|
|
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
|
return str;
|
|
}
|
|
}
|
|
] ],
|
|
onResize:function(){
|
|
$('#grid').datagrid('fixDetailRowHeight',index);
|
|
},
|
|
onLoadSuccess:function(){
|
|
$('.iconImg').attr('src', ext.pixel_0);
|
|
setTimeout(function(){
|
|
$('#grid').datagrid('fixDetailRowHeight',index);
|
|
},0);
|
|
|
|
}
|
|
});
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
</head>
|
|
<body class="easyui-layout" data-options="fit:true,border:false">
|
|
<div id="toolbar" style="display: none;">
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
<table>
|
|
<tr>
|
|
<%if (sessionManager.havePermission(session,"material/cutterstandard/add.do")) {%>
|
|
<td>
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
|
onclick="addFun();">添加</a>
|
|
</td>
|
|
<%}%>
|
|
<%if (sessionManager.havePermission(session,"material/cutterstandard/delete.do")) {%>
|
|
<td>
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
|
onclick="deleteFun();">删除</a>
|
|
</td>
|
|
<%}%>
|
|
<td><div class="datagrid-btn-separator"></div></td>
|
|
<td>
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-bullet_go',plain:true"
|
|
onclick="cutterStandardIssuedFun();">下发</a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<form id="searchForm">
|
|
<input name="idStr" type="hidden" />
|
|
<table class="tooltable">
|
|
<tr>
|
|
<td>设备编号</td>
|
|
<td><input name="search_equipmentcardid" class="easyui-textbox" /></td>
|
|
<td>物料长代码</td>
|
|
<td><input name="search_materialcode" class="easyui-textbox" /></td>
|
|
<td>
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
|
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
|
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div data-options="region:'center',fit:true,border:false">
|
|
<table id="grid" data-options="fit:true,border:false"></table>
|
|
</div>
|
|
</body>
|
|
</html> |