Files
SIPAIIS_WMS_JSSW/bin/WebRoot/jsp/material/boardbatchEdit.jsp
2026-01-16 14:13:44 +08:00

305 lines
9.3 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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"%>
<%request.setAttribute("Flag_UNUSE",com.sipai.entity.material.Boardbatch.Flag_UNUSE);%>
<%request.setAttribute("Flag_INUSE",com.sipai.entity.material.Boardbatch.Flag_INUSE);%>
<%request.setAttribute("Flag_USED",com.sipai.entity.material.Boardbatch.Flag_USED);%>
<html>
<head>
<title></title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
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 getGriddata(){
var gridrows= $('#grid').datagrid("getRows");
var griddata= '[';
$.each(gridrows, function(index, item){
if(index == 0){
griddata+='{"equipmentcardid":"'+item.id+'","status":"'+item.ibmstatus+'"}';
}
else{
griddata+=',{"equipmentcardid":"'+item.id+'","status":"'+item.ibmstatus+'"}';
}
});
griddata+= ']';
return griddata;
}
//获取已选的工位id
function getMids(){
var mrows= $('#grid').datagrid("getRows");
var mids="";
$.each(mrows, function(index, item){
mids+=item.id+",";
});
mids=mids.replace(/,$/gi,"");
return mids;
}
function dosave(dialog,grid) {
if ($(".form").form('validate')) {
$.post(ext.contextPath + "/material/boardbatch/update.do", $(".form").serialize(), function(data) {
if (data.res == 1) {
$.post(ext.contextPath + "/material/boardbatch/updateMachine.do",{no:$('#id').val(),griddata:getGriddata()},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 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=boardbatchEdit',
buttons : [ {
iconCls:'icon-ok',
text : '确认',
handler : function() {
var data = dialog.find('iframe').get(0).contentWindow.selectFun(dialog, grid);
var datas= $.parseJSON(data);
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,
equipmentclassid:datas[i].equipmentclass,
areaid: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() {
$('#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',
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();
},
columns : [ [
{checkbox:true , field : 'ck'},
{width : '140', title : '设备编号', field : 'equipmentcardid', sortable : true, halign:'center'},
{width : '90', title : '设备名称', field : 'equipmentname', sortable : true, halign:'center'},
{width : '105', title : '设备油墨使用状态', field : 'ibmstatus', sortable : true,formatter:function(value,row){
switch (value) {
case '${Flag_UNUSE}':
return '未使用';
case '${Flag_INUSE}':
return '使用中';
case '${Flag_USED}':
return '使用完毕';
default:
return '';
}
},editor:{
type:'combobox',
options:{
data: [{
name: '未使用',
status: '${Flag_UNUSE}'
},{
name: '使用中',
status: '${Flag_INUSE}'
},{
name: '使用完毕',
status: '${Flag_USED}'
}],
valueField:'status',
textField:'name',
required:true
}
}},
{width : '90', title : '设备型号', field : 'equipmentmodel', sortable : true, halign:'center'},
{width : '90', title : '设备类型', field : 'equipmentclassid', sortable : true,halign:'center'},
{width : '90', title : '存放位置', field : 'areaid', sortable : true,halign:'center'}
] ],
data:${equipmentcardList}
});
});
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();
});
});
</script>
</head>
<body>
<input id="mids" name="mids" type="hidden" value="" />
<form method="post" class="form">
<input type="hidden" id = "id" name="id" value="${boardbatch.id }"/>
<table class="table">
<tr>
<th>批次号</th>
<td><input name="no" class="easyui-textbox"
disabled="disabled" value="${boardbatch.no }" /></td>
</tr>
<tr>
<th>网板类别</th>
<td><input name="type" class="easyui-textbox"
data-options="required:true,validType:'isBlank'" value="${boardbatch.type }" /></td>
</tr>
<tr>
<th>网板名称</th>
<td>
<input name="name" class="easyui-textbox"
data-options="required:true,validType:'isBlank'" value="${boardbatch.name }" />
</td>
</tr>
<tr>
<th>物料状态</th>
<td><select id="status" name="status" class="easyui-combobox"
data-options="panelHeight:'auto'">
<option value="0" <c:if test="${boardbatch.status=='0'}">selected</c:if>>未使用</option>
<option value="1" <c:if test="${boardbatch.status=='1'}">selected</c:if>>使用中</option>
<option value="2" <c:if test="${boardbatch.status=='2'}">selected</c:if>>使用完毕</option>
</select></td>
</tr>
<tr>
<th>产品工艺路线</th>
<td><input id="processrealid" name="processrealid" class="easyui-textbox"
data-options="required:true,validType:'isBlank'" value="${boardbatch.processrealid }" /></td>
</tr>
<tr>
<th>开始时间</th>
<td><input id="starttime" name="starttime" class="Wdate"
value="${fn:substring(boardbatch.starttime,0,19)}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"readonly/>
</td>
</tr>
<%--<tr>
<th>结束时间</th>
<td>
<input id="endtime"name="endtime" class="Wdate"
value="${fn:substring(boardbatch.endtime,0,19)}" 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>