249 lines
7.4 KiB
Plaintext
249 lines
7.4 KiB
Plaintext
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|||
|
|
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
|||
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
|||
|
|
<html>
|
|||
|
|
<head>
|
|||
|
|
<title></title>
|
|||
|
|
<jsp:include page="../inc.jsp"></jsp:include>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
function dosave(dialog,grid) {
|
|||
|
|
if ($(".form").form('validate')) {
|
|||
|
|
$.post(ext.contextPath + "/material/boardbatch/save.do", $(".form").serialize(), function(data) {
|
|||
|
|
if (data.res == 1) {
|
|||
|
|
|
|||
|
|
$.post(ext.contextPath + "/material/boardbatch/saveMachine.do",{no:data.id,mids:getMids(),status:$('#status').textbox('getValue')},function(data1){
|
|||
|
|
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
|||
|
|
grid.datagrid('reload');
|
|||
|
|
dialog.dialog('destroy');
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
/* top.$.messager.alert('提示', "保存成功", 'info', function() {
|
|||
|
|
//刷新列表
|
|||
|
|
grid.datagrid('reload');
|
|||
|
|
dialog.dialog('destroy');
|
|||
|
|
}); */
|
|||
|
|
|
|||
|
|
}else if(data.res == 0){
|
|||
|
|
top.$.messager.alert('提示', "保存失败", 'info');
|
|||
|
|
}else{
|
|||
|
|
top.$.messager.alert('提示', data.res, 'info');
|
|||
|
|
}
|
|||
|
|
},'json');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//获取当前时间
|
|||
|
|
function getNowFormatDate() {
|
|||
|
|
var date = new Date();
|
|||
|
|
var seperator1 = "-";
|
|||
|
|
var seperator2 = ":";
|
|||
|
|
var month = date.getMonth() + 1;
|
|||
|
|
var strDate = date.getDate();
|
|||
|
|
if (month >= 1 && month <= 9) {
|
|||
|
|
month = "0" + month;
|
|||
|
|
}
|
|||
|
|
if (strDate >= 0 && strDate <= 9) {
|
|||
|
|
strDate = "0" + strDate;
|
|||
|
|
}
|
|||
|
|
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
|
|||
|
|
+ " " + date.getHours() + seperator2 + date.getMinutes()
|
|||
|
|
/*+ seperator2 + date.getSeconds();*/
|
|||
|
|
return currentdate;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function getMids(){
|
|||
|
|
var mrows= $('#grid').datagrid("getRows");
|
|||
|
|
var mids="";
|
|||
|
|
$.each(mrows, function(index, item){
|
|||
|
|
mids+=item.id+",";
|
|||
|
|
});
|
|||
|
|
mids=mids.replace(/,$/gi,"");
|
|||
|
|
return mids;
|
|||
|
|
}
|
|||
|
|
function doadd_M(){
|
|||
|
|
$("#mids").val(getMids());
|
|||
|
|
|
|||
|
|
localStorage.setItem("mids",$("#mids").val());
|
|||
|
|
//清除旧数据
|
|||
|
|
|
|||
|
|
var dialog = parent.ext.modalDialog({
|
|||
|
|
title : '添加参数设置中的设备',
|
|||
|
|
height:500,
|
|||
|
|
url : ext.contextPath + '/material/inkinfo/showEquipmentcardForSelects.do?iframeId=boardbatchAdd',
|
|||
|
|
buttons : [ {
|
|||
|
|
iconCls:'icon-ok',
|
|||
|
|
text : '确认',
|
|||
|
|
handler : function() {
|
|||
|
|
var data = dialog.find('iframe').get(0).contentWindow.selectFun(dialog, grid);
|
|||
|
|
var datas= $.parseJSON(data);
|
|||
|
|
console.log('enter',datas);
|
|||
|
|
if(datas.length>0){
|
|||
|
|
for(var i=0;i<datas.length;i++){
|
|||
|
|
grid.datagrid('appendRow',{
|
|||
|
|
id:datas[i].id,
|
|||
|
|
equipmentcardid:datas[i].equipmentcardid,
|
|||
|
|
equipmentname:datas[i].equipmentname,
|
|||
|
|
equipmentmodel:datas[i].equipmentmodel,
|
|||
|
|
equipmentclass:datas[i].equipmentclass,
|
|||
|
|
geographyarea:datas[i].geographyarea
|
|||
|
|
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
dialog.dialog('destroy');
|
|||
|
|
}
|
|||
|
|
} ]
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
function dodelete_M(){
|
|||
|
|
var rows = $('#grid').datagrid('getChecked');
|
|||
|
|
if(rows.length==0){
|
|||
|
|
top.$.messager.alert("提示","请选择需要删除的数据","info");
|
|||
|
|
}else{
|
|||
|
|
top.$.messager.confirm("提示", "确定删除这些数据?", function(r) {
|
|||
|
|
if (r) {
|
|||
|
|
//复制rows,否则deleteRow的index会出错
|
|||
|
|
var copyRows = [];
|
|||
|
|
for ( var j= 0; j < rows.length; j++) {
|
|||
|
|
copyRows.push(rows[j]);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$.each(copyRows, function(index, item){
|
|||
|
|
$('#grid').datagrid('deleteRow',$('#grid').datagrid('getRowIndex',copyRows[index]));
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
function selectProcess(){
|
|||
|
|
var dialog = parent.ext.modalDialog({
|
|||
|
|
title : '选择工艺路线',
|
|||
|
|
width: 800,
|
|||
|
|
height:550,
|
|||
|
|
url : ext.contextPath + '/activiti/workflow/getProcessForSelect.do',
|
|||
|
|
buttons : [{
|
|||
|
|
text : '确定',
|
|||
|
|
iconCls:'icon-ok',
|
|||
|
|
handler : function() {
|
|||
|
|
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
|||
|
|
if(res!=null){
|
|||
|
|
$("#processrealid").textbox('setValue',res.id);
|
|||
|
|
$("#processrealid").textbox('setText',res.name);
|
|||
|
|
}
|
|||
|
|
dialog.dialog('destroy');
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
text : '取消',
|
|||
|
|
iconCls:'icon-cancel',
|
|||
|
|
handler : function() {
|
|||
|
|
dialog.dialog('destroy');
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
]
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
$(function() {
|
|||
|
|
$("#processrealid").textbox('textbox').bind("click", function () {
|
|||
|
|
selectProcess();
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
|
|||
|
|
$(function() {
|
|||
|
|
document.getElementById('starttime').value=getNowFormatDate();//设置默认时间
|
|||
|
|
$('#m').panel({
|
|||
|
|
width:"100%",
|
|||
|
|
height:"300",
|
|||
|
|
title: '使用设备',
|
|||
|
|
tools: [{
|
|||
|
|
iconCls:'icon-add',
|
|||
|
|
handler:function(){doadd_M();}
|
|||
|
|
},{
|
|||
|
|
iconCls:'icon-remove',
|
|||
|
|
handler:function(){dodelete_M();}
|
|||
|
|
}]
|
|||
|
|
});
|
|||
|
|
grid = $('#grid').datagrid({
|
|||
|
|
title : '',
|
|||
|
|
striped : true,
|
|||
|
|
rownumbers : true,
|
|||
|
|
idField : 'id',
|
|||
|
|
columns : [ [
|
|||
|
|
{checkbox:true , field : 'ck'},
|
|||
|
|
{width : '145', title : '设备编号', field : 'equipmentcardid', sortable : true, editor:'textbox',halign:'center'},
|
|||
|
|
{width : '90', title : '设备名称', field : 'equipmentname', sortable : true, editor:'textbox',halign:'center'},
|
|||
|
|
{width : '90', title : '设备型号', field : 'equipmentmodel', sortable : true, editor:'textbox',halign:'center'},
|
|||
|
|
{width : '90', title : '设备类型', field : 'equipmentclass', sortable : true, editor:'textbox',halign:'center'},
|
|||
|
|
{width : '90', title : '存放位置', field : 'geographyarea', sortable : true, editor:'textbox',halign:'center'}
|
|||
|
|
] ],
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
</script>
|
|||
|
|
</head>
|
|||
|
|
<body>
|
|||
|
|
<input id="mids" name="mids" type="hidden" value="" />
|
|||
|
|
<form method="post" class="form">
|
|||
|
|
<input id="mtypetemp" type="hidden" value=""/>
|
|||
|
|
<table class="table">
|
|||
|
|
<tr>
|
|||
|
|
<th>网板批次号</th>
|
|||
|
|
<td><input name="no" class="easyui-textbox"
|
|||
|
|
data-options="required:true,validType:'isBlank'" value="" /></td>
|
|||
|
|
</tr>
|
|||
|
|
|
|||
|
|
<tr>
|
|||
|
|
<th>网板类别</th>
|
|||
|
|
<td>
|
|||
|
|
<input name="type" class="easyui-textbox"
|
|||
|
|
data-options="required:true,validType:'isBlank'" value="" />
|
|||
|
|
</td>
|
|||
|
|
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<th>网板名称</th>
|
|||
|
|
<td>
|
|||
|
|
<input name="name" class="easyui-textbox"
|
|||
|
|
data-options="required:true,validType:'isBlank'" value=""/>
|
|||
|
|
</td>
|
|||
|
|
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<th>物料状态</th>
|
|||
|
|
<td><select id="status" name="status" class="easyui-combobox"
|
|||
|
|
data-options="panelHeight:'auto'">
|
|||
|
|
<option value="0">未使用</option>
|
|||
|
|
<option value="1">使用中</option>
|
|||
|
|
<option value="2">使用完毕</option>
|
|||
|
|
</select></td>
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<th>使用开始时间</th>
|
|||
|
|
<td><input id="starttime" name="starttime" class="Wdate"
|
|||
|
|
value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"readonly/>
|
|||
|
|
</td>
|
|||
|
|
</tr>
|
|||
|
|
<!-- <tr>
|
|||
|
|
<th>使用开始时间</th>
|
|||
|
|
<td><input id="endtime" name="endtime" class="Wdate"
|
|||
|
|
value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"readonly/>
|
|||
|
|
</td>
|
|||
|
|
</tr> -->
|
|||
|
|
<tr>
|
|||
|
|
<th>产品工艺路线</th>
|
|||
|
|
<td><input id="processrealid" name="processrealid" class="easyui-textbox"
|
|||
|
|
data-options="required:true,validType:'isBlank'"/></td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
</form>
|
|||
|
|
<div id="m">
|
|||
|
|
<table id="grid" data-options="border:false"></table>
|
|||
|
|
</div>
|
|||
|
|
</body>
|
|||
|
|
</html>
|