300 lines
8.9 KiB
Plaintext
300 lines
8.9 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/inkbatch/save.do", $(".form").serialize(), function(data) {
|
||
if (data.res == 1) {
|
||
$.post(ext.contextPath + "/material/inkbatch/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 getMids(){
|
||
var mrows= $('#grid').datagrid("getRows");
|
||
var mids="";
|
||
$.each(mrows, function(index, item){
|
||
mids+=item.id+",";
|
||
});
|
||
mids=mids.replace(/,$/gi,"");
|
||
return mids;
|
||
}
|
||
|
||
//获取当前时间
|
||
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 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=inkbatchAdd',
|
||
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() {
|
||
document.getElementById('starttime').value=getNowFormatDate();//设置默认时间
|
||
$("#processrealid").textbox('textbox').bind("click", function () {
|
||
selectProcess();
|
||
});
|
||
});
|
||
$(function() {
|
||
$('#unit').combobox({
|
||
url:ext.contextPath + '/material/materialunit/getJsonUnit.do',
|
||
valueField:'unit',
|
||
textField:'unit',
|
||
editable:false,
|
||
panelHeight:'auto'
|
||
});
|
||
$('#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'}
|
||
] ]
|
||
});
|
||
$('#tname').combotree({
|
||
url : ext.contextPath + '/material/materialtype/getMenusJsonActive.do?random=' + Math.random(),
|
||
parentField : 'pid',
|
||
method:'get',
|
||
required:true,
|
||
onBeforeSelect:function(node){
|
||
if(node.id=="-1"){
|
||
$("#tname").tree("unselect");
|
||
}
|
||
},
|
||
onClick : function(node) {
|
||
$("#typeid").val(node.id);
|
||
var materialcode=$("#materialcode").textbox('getValue');
|
||
var oldmaterialcode=$("#mtypetemp").val();//删除旧的物料编码前缀
|
||
if(oldmaterialcode!=null && oldmaterialcode!=""){
|
||
materialcode=materialcode.substring(oldmaterialcode.length,materialcode.length);
|
||
}
|
||
materialcode=node.attributes.typecode+materialcode;
|
||
$("#mtypetemp").val(node.attributes.typecode);
|
||
$("#materialcode").textbox('setValue',materialcode);
|
||
}
|
||
});
|
||
|
||
$("#figurenumber").textbox("textbox").bind("click",function(){
|
||
selectDrawing();
|
||
});
|
||
});
|
||
|
||
|
||
|
||
</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>
|
||
<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> -->
|
||
|
||
</table>
|
||
</form>
|
||
<div id="m">
|
||
<table id="grid" data-options="border:false"></table>
|
||
</div>
|
||
</body>
|
||
</html>
|