197 lines
6.1 KiB
Plaintext
197 lines
6.1 KiB
Plaintext
|
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||
|
|
<%@page import="com.sipai.entity.process.TaskProcedure"%>
|
||
|
|
<%@ page import="com.sipai.tools.SessionManager"%>
|
||
|
|
<%request.setAttribute("Type_Inspect",TaskProcedure.Type_Inspect);%>
|
||
|
|
<%request.setAttribute("Type_Produce",TaskProcedure.Type_Produce);%>
|
||
|
|
<%request.setAttribute("Flag_Semi",TaskProcedure.Flag_Semi);%>
|
||
|
|
<%@page import="com.sipai.tools.CommString"%>
|
||
|
|
|
||
|
|
<%
|
||
|
|
SessionManager sessionManager = new SessionManager();
|
||
|
|
%>
|
||
|
|
<!DOCTYPE html>
|
||
|
|
<html>
|
||
|
|
<head>
|
||
|
|
<title></title>
|
||
|
|
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||
|
|
<script type="text/javascript">
|
||
|
|
var grid;
|
||
|
|
|
||
|
|
function dosave(dialog,grid) {
|
||
|
|
$.post(ext.contextPath + "/process/taskprocedure/saveERPGridData.do",{griddata:getGriddata()},function(data1){
|
||
|
|
if(JSON.parse(data1).res == 1)
|
||
|
|
{
|
||
|
|
top.$.messager.alert('提示', "顺序保存成功", 'info', function() {
|
||
|
|
});
|
||
|
|
}else if(JSON.parse(data1).res == -1)
|
||
|
|
{
|
||
|
|
top.$.messager.alert('提示', '顺序保存失败', 'info');
|
||
|
|
}else
|
||
|
|
{
|
||
|
|
top.$.messager.alert('提示', data1.delres, 'info');
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
function getGriddata(){
|
||
|
|
var gridrows= $('#grid').datagrid('getRows');
|
||
|
|
//console.log("gridrows",gridrows);
|
||
|
|
var griddata= '[';
|
||
|
|
$.each(gridrows, function(index, item){
|
||
|
|
//console.log("item",item);
|
||
|
|
if(index == 0){
|
||
|
|
griddata+='{"id":"'+item.id +
|
||
|
|
'","priorityorder":"'+index+'","sorttype":"'+$('#sorttype').combobox('getValue') +'"}';
|
||
|
|
}
|
||
|
|
else{
|
||
|
|
griddata+=',{"id":"'+item.id +
|
||
|
|
'","priorityorder":"'+index+'","sorttype":"'+$('#sorttype').combobox('getValue') +'"}';
|
||
|
|
}
|
||
|
|
});
|
||
|
|
griddata+= ']';
|
||
|
|
return griddata;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
function getProcedids(){
|
||
|
|
var procedrows= $('#grid').datagrid("getRows");
|
||
|
|
var procedids="";
|
||
|
|
$.each(procedrows, function(index, item){
|
||
|
|
procedids+=item.id+",";
|
||
|
|
});
|
||
|
|
procedids=procedids.replace(/,$/gi,"");
|
||
|
|
return procedids;
|
||
|
|
}
|
||
|
|
|
||
|
|
function doadd_Proced(){
|
||
|
|
$("#procedids").val(getProcedids());
|
||
|
|
localStorage.setItem("procedids",$("#procedids").val());
|
||
|
|
var dialog = parent.ext.modalDialog({
|
||
|
|
title : '添加工序',
|
||
|
|
height:500,
|
||
|
|
url : ext.contextPath + '/process/taskprocedure/showTaskProcedureForSelects.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,
|
||
|
|
procedurecode:data.res[i].procedurecode,
|
||
|
|
procedurename:data.res[i].procedurename,
|
||
|
|
keywords:data.res[i].keywords,
|
||
|
|
type:data.res[i].type,
|
||
|
|
semiflag:data.res[i].semiflag
|
||
|
|
});
|
||
|
|
}
|
||
|
|
}
|
||
|
|
dialog.dialog('destroy');
|
||
|
|
$('#grid').datagrid('enableDnd');
|
||
|
|
}
|
||
|
|
} ]
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
function dodel_Proced(){
|
||
|
|
var checkedItems = $('#grid').datagrid('getChecked');
|
||
|
|
console.log("checked",checkedItems);
|
||
|
|
$.each(checkedItems, function(index, item){
|
||
|
|
grid.datagrid('deleteRow', index);
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
$(function() {
|
||
|
|
$("#sorttype").combobox({
|
||
|
|
url : ext.contextPath + '/process/taskprocedure/getTaskProcedureOrderType4Combo.do',
|
||
|
|
valueField : 'id',
|
||
|
|
textField : 'name',
|
||
|
|
method:'get',
|
||
|
|
panelHeight:'auto',
|
||
|
|
onSelect:function(){
|
||
|
|
grid = $('#grid').datagrid({
|
||
|
|
title : '',
|
||
|
|
url : ext.contextPath + '/process/taskprocedure/getTaskProcedureOrderList.do?sorttype='+$('#sorttype').combobox('getValue'),
|
||
|
|
striped : true,
|
||
|
|
rownumbers : true,
|
||
|
|
//pagination : true,
|
||
|
|
singleSelect: false,
|
||
|
|
ctrlSelect: true,
|
||
|
|
selectOnCheck: false,
|
||
|
|
checkOnSelect: false,
|
||
|
|
idField : 'id',
|
||
|
|
columns : [ [
|
||
|
|
{checkbox:true , field : 'ck'},
|
||
|
|
{width : '150', title : '工序名称', field : 'procedurename', sortable : true, halign:'center'},
|
||
|
|
{width : '150', title : '工序编号', field : 'procedurecode', sortable : true, halign:'center'},
|
||
|
|
{width : '150', title : '关键字', field : 'keywords', sortable : true, halign:'center'},
|
||
|
|
{width : '150', title : '类型', field : 'type', sortable : true, halign:'center',formatter : function(value, row) {
|
||
|
|
if(row.type=='${Type_Inspect}'){
|
||
|
|
return '检测工序';
|
||
|
|
}else{
|
||
|
|
return '生产工序';
|
||
|
|
}
|
||
|
|
}},
|
||
|
|
{width : '150', title : '半成品工序', field : 'semiflag', sortable : true, halign:'center',formatter : function(value, row) {
|
||
|
|
if(row.semiflag=='${Flag_Semi}'){
|
||
|
|
return '是';
|
||
|
|
}else{
|
||
|
|
return '否';
|
||
|
|
}
|
||
|
|
}},
|
||
|
|
] ],
|
||
|
|
toolbar : '#toolbar',
|
||
|
|
onLoadSuccess : function(data) {
|
||
|
|
$('.iconImg').attr('src', ext.pixel_0);
|
||
|
|
$('#grid').datagrid('enableDnd');
|
||
|
|
}
|
||
|
|
});
|
||
|
|
},
|
||
|
|
onLoadSuccess: function () {
|
||
|
|
var data = $('#sorttype').combobox('getData');
|
||
|
|
$("#sorttype").combobox('select',data[0].id);
|
||
|
|
}
|
||
|
|
|
||
|
|
});
|
||
|
|
|
||
|
|
});
|
||
|
|
</script>
|
||
|
|
</head>
|
||
|
|
<body class="easyui-layout" data-options="fit:true,border:false">
|
||
|
|
<div id="toolbar" style="display: none;">
|
||
|
|
<table>
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||
|
|
onclick="doadd_Proced();">编辑</a>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-disk',plain:true"
|
||
|
|
onclick="dosave();">保存顺序</a>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div id="maindiv" class="easyui-layout" data-options="fit:true">
|
||
|
|
<input id="procedids" name="procedids" type="hidden" value="" />
|
||
|
|
<div data-options="region:'north',split:true" style="width:45%;height:60px;padding:10px;background:#fafafa;">
|
||
|
|
<table>
|
||
|
|
<tr>
|
||
|
|
<td>排序类型:</td>
|
||
|
|
<td>
|
||
|
|
<select id="sorttype" class="easyui-combobox" data-options="panelHeight:'auto'" style="width:200px;">
|
||
|
|
</select>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
<br />
|
||
|
|
<div id="downdiv" data-options="region:'west'" title="" style="width:100%;padding:0;">
|
||
|
|
<table id="grid" data-options="fit:true,border:false"></table>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</body>
|
||
|
|
</html>
|