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

185 lines
5.8 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 import="com.sipai.entity.process.TaskProcedure"%>
<%@ 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"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%request.setAttribute("Type_Inspect",TaskProcedure.Type_Inspect);%>
<%request.setAttribute("Type_Produce",TaskProcedure.Type_Produce);%>
<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 + "/process/taskprocedure/save.do", $(".form").serialize(), function(data) {
if (data.res == 1) {
console.log("getWids()",getWids());
$.post(ext.contextPath + "/process/taskprocedure/saveWorkstation.do",{procedureid:data.id,wids:getWids()},function(data1){
if(JSON.parse(data1).res>0)
{
top.$.messager.alert('提示', "保存成功", 'info', function() {
grid.datagrid('reload');
dialog.dialog('destroy');
});
}
else if(JSON.parse(data1).res == 0){
top.$.messager.alert('提示', "工序已保存,工位未添加", 'info');
grid.datagrid('reload');
dialog.dialog('destroy');
}else{
top.$.messager.alert('提示', data1.res, 'info');
}
});
}else if(data.res == 0){
top.$.messager.alert('提示', "保存失败", 'info');
}else{
top.$.messager.alert('提示', data.res, 'info');
}
},'json');
}
}
function getWids(){
var wrows= $('#grid').datagrid("getRows");
var wids="";
$.each(wrows, function(index, item){
wids+=item.id+",";
});
wids=wids.replace(/,$/gi,"");
return wids;
}
function doadd_W(){
$("#wids").val(getWids());
localStorage.setItem("wids",$("#wids").val().split(","));
var dialog = parent.ext.modalDialog({
title : '添加工位',
height:500,
url : ext.contextPath + '/process/taskprocedure/showlistForSelects.do',
buttons : [ {
iconCls:'icon-ok',
text : '确认',
handler : function() {
var data = dialog.find('iframe').get(0).contentWindow.selectFun(dialog, grid);
if(data.res.length>0){
for(var i=0;i<data.res.length;i++){
grid.datagrid('appendRow',{
id:data.res[i].id,
serial:data.res[i].serial,
name:data.res[i].name,
typename:data.res[i].typename,
deptname:data.res[i].deptname
});
}
}
dialog.dialog('destroy');
}
} ]
});
}
function dodelete_W(){
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() {
$('#p').panel({
width:"100%",
height:"170",
title: '相关工位',
tools: [{
iconCls:'icon-add',
handler:function(){doadd_W();}
},{
iconCls:'icon-remove',
handler:function(){dodelete_W();}
}]
});
grid = $('#grid').datagrid({
title : '',
striped : true,
rownumbers : true,
idField : 'id',
columns : [ [
{checkbox:true , field : 'ck'},
{width : '140', title : '工位编号', field : 'serial', sortable : true, editor:'textbox',halign:'center'},
{width : '180', title : '工位名称', field : 'name', sortable : true, editor:'textbox',halign:'center'},
{width : '100', title : '工位类型', field : 'typename', sortable : true, editor:'textbox',halign:'center'},
{width : '180', title : '所属车间', field : 'deptname', sortable : true, editor:'textbox',halign:'center'}
] ]
});
});
</script>
</head>
<body>
<input id="wids" name="wids" type="hidden" value="" />
<form method="post" class="form">
<table class="table">
<tr>
<th>工序名称</th>
<td><input id="procedurename" name="procedurename" class="easyui-textbox"
data-options="required:true,validType:'isBlank'" value="" /></td>
</tr>
<tr><td> </td></tr>
<tr>
<th>工序编码(必须以字母开头)</th>
<td>
<input id="procedurecode" name="procedurecode" class="easyui-textbox"
data-options="required:true,validType:'isBlank'" value="" />
</td>
</tr>
<tr>
<th>关键字(用“;”隔开)</th>
<td>
<input name="keywords" class="easyui-textbox" style="height:100px;width:300px"
value=""data-options="multiline:true" validtype="length[0,250]" invalidMessage="有效长度0-250" />
</td>
</tr>
<tr>
<th>type</th>
<td>
<select name="type" class="easyui-combobox" data-options="panelHeight:'auto',editable:false,value:'${Type_Produce}'">
<option value="${Type_Produce}">生产</option>
<option value="${Type_Inspect}">检测</option>
</select>
</td>
</tr>
<tr>
<th>半成品生成工序</th>
<td>
<select name="semiflag" class="easyui-combobox" data-options="panelHeight:'auto',editable:false,value:'0'">
<option value="1">是</option>
<option value="0">否</option>
</select>
</td>
</tr>
</table>
</form>
<div id="p">
<table id="grid" data-options="border:false"></table>
</div>
</body>
</html>