first commit
This commit is contained in:
289
bin/WebRoot/jsp/work/clientTasks.jsp
Normal file
289
bin/WebRoot/jsp/work/clientTasks.jsp
Normal file
@ -0,0 +1,289 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.plan.DailyPlanTaskDemand"%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
|
||||
|
||||
<%request.setAttribute("Flag_Start",DailyPlanTaskDemand.Flag_Start);%>
|
||||
<%request.setAttribute("Flag_Report",DailyPlanTaskDemand.Flag_Report);%>
|
||||
<%request.setAttribute("Flag_CarryOver",DailyPlanTaskDemand.Flag_CarryOver);%>
|
||||
|
||||
<%request.setAttribute("resp_pass",CommString.Resp_Success);%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workorder/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
var districtwork = function(planid,workorderid,processid){
|
||||
//alert(planid+workorderid+processid)
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '任务调度',
|
||||
url : ext.contextPath + '/work/workorder/districtwork.do?planid='+planid+'&workorderid='+workorderid+'&processid='+processid,
|
||||
width:1000,
|
||||
height:500,
|
||||
onClose:function(){
|
||||
var res=dialog.find('iframe').get(0).contentWindow.returnVal;
|
||||
if(res=="refresh"){
|
||||
$('#grid').datagrid("reload");
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var searchgrid = function() {
|
||||
grid.datagrid('load',ext.contextPath + '/work/workorder/getClientTasks.do?'+$('#searchForm').serialize());
|
||||
};
|
||||
|
||||
function onchangedate(){
|
||||
var date=$("#nowdate").val();
|
||||
loadworkorders(date);
|
||||
}
|
||||
function loadProcedures(){
|
||||
$("#procedureno").combobox({
|
||||
url : ext.contextPath + '/process/taskprocedure/getAllProcedurelist4Select.do',
|
||||
valueField : 'procedurecode',
|
||||
textField : 'procedurename',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onLoadSuccess: function(record){
|
||||
if($("#procedureno").combobox('getData').length>0){
|
||||
var procedure=getCookie("wo_procedure");
|
||||
$("#procedureno").combobox('select',procedure);
|
||||
}
|
||||
},
|
||||
onSelect: function () {
|
||||
delCookie("wo_procedure");
|
||||
setCookie("wo_procedure",$("#procedureno").combobox('getValue'));
|
||||
searchgrid();
|
||||
}
|
||||
});
|
||||
}
|
||||
//开工
|
||||
var dostart = function(id) {
|
||||
$.post(ext.contextPath + '/work/workorder/doupdate_taskdemand.do', {id : id,status:'${Flag_Start}'}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','开工成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','开工失败','info');
|
||||
}
|
||||
});
|
||||
};
|
||||
//报工
|
||||
var doreport=function(workorderno,taskcode){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '工单报工',
|
||||
width: 400,
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workorder/showworkorder_carryover.do?taskcode='+taskcode+'&workorderno='+workorderno+'&status=${Flag_Report}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
||||
//dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
//工单结转
|
||||
var docarryover=function(workorderno,taskcode){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '工单结转',
|
||||
width: 400,
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workorder/showworkorder_carryover.do?taskcode='+taskcode+'&workorderno='+workorderno+'&status=${Flag_CarryOver}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
||||
//dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
//查看工单
|
||||
var doview=function(workorderno,taskcode){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看工单',
|
||||
width: 400,
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workorder/showworkorder_view.do?taskcode='+taskcode+'&workorderno='+workorderno,
|
||||
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
loadProcedures();
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workorder/getClientTasks.do?'+$('#searchForm').serialize(),
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{width : '180', title : '工单编号', field : '_taskName', halign:'center', formatter : function(value, row){
|
||||
return row.workOrder.workorderno;
|
||||
}
|
||||
},
|
||||
{width : '80', title : '计划良率', field : 'preyield', halign:'center'},
|
||||
{width : '80', title : '实际良率', field : 'actyield', halign:'center'},
|
||||
{width : '80', title : '计划产量', field : 'preamount', halign:'center'},
|
||||
{width : '80', title : '实际产量', field : 'actamount', halign:'center'},
|
||||
{width : '180', title : '良率未达标原因', field : 'yieldreason', halign:'center', align:'center'},
|
||||
{width : '180', title : '产量未达标原因', field : 'amountreason', halign:'center', align:'center'},
|
||||
{width : '100', title : '工单状态', field : 'status', align:'center', formatter : function(value, row){
|
||||
switch(value){
|
||||
case '${Flag_Start}': return "已开工";
|
||||
case '${Flag_Report}': return "已报工";
|
||||
case '${Flag_CarryOver}': return "已结转";
|
||||
default:return "待开工";
|
||||
|
||||
}
|
||||
} ,sortable:false},
|
||||
{width : '130', title : '操作', field : 'action', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="doview(\''+row.workOrder.workorderno+'\',\''+row.taskcode+'\');"/> ';
|
||||
if(row.status=='${Flag_Start}'){
|
||||
str += '<img class="iconImg ext-icon-table_row_insert" title="报工" onclick="doreport(\''+row.workOrder.workorderno+'\',\''+row.taskcode+'\');"/> ';
|
||||
}else if(row.status=='${Flag_Report}'){
|
||||
str += '<img class="iconImg ext-icon-table_relationship" title="结转" onclick="docarryover(\''+row.workOrder.workorderno+'\',\''+row.taskcode+'\');"/> ';
|
||||
}else if(row.status!='${Flag_CarryOver}'){
|
||||
str += '<img class="iconImg ext-icon-table_go" title="开工" onclick="dostart(\''+row.id+'\');"/> ';
|
||||
}
|
||||
return str;
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
//写cookies
|
||||
function setCookie(name,value) {
|
||||
var Days = 365;
|
||||
var exp = new Date();
|
||||
exp.setTime(exp.getTime() + Days*24*60*60*1000);
|
||||
document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
|
||||
}
|
||||
|
||||
//读取cookies
|
||||
function getCookie(name) {
|
||||
var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
|
||||
if(arr=document.cookie.match(reg)) return unescape(arr[2]);
|
||||
else return null;
|
||||
}
|
||||
|
||||
//删除cookies
|
||||
function delCookie(name) {
|
||||
var exp = new Date();
|
||||
exp.setTime(exp.getTime() - 1*24*60*60*1000);
|
||||
var cval=getCookie(name);
|
||||
if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%-- <%if (sessionManager.havePermission(session,"work/workorder/add.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/workorder/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%> --%>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td><input id="dt" name="dt" type="hidden" value="${dt }" ></td>
|
||||
<td>工序</td>
|
||||
<td><input id="procedureno" name="procedureno" class="easyui-combobox" style="width: 180px;" panelMaxHeight="400px" data-options="panelHeight:'auto'" value=""/></td>
|
||||
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="searchgrid();">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');searchgrid();">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
215
bin/WebRoot/jsp/work/districtmaterial.jsp
Normal file
215
bin/WebRoot/jsp/work/districtmaterial.jsp
Normal file
@ -0,0 +1,215 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '添加物料',
|
||||
url : ext.contextPath + '/process/realDetailsMaterial/add.do?processrealdetailid=${param.processrealdetailid}',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '编辑物料',
|
||||
url : ext.contextPath + '/process/realDetailsMaterial/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var dosave = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
var amounts="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.materialid+",";
|
||||
if(item.amount==null || item.amount==""){
|
||||
amounts+="0,";
|
||||
}else{
|
||||
var editor = $('#grid').datagrid('getEditor', {index:index,field:"amount"});
|
||||
if(editor!=null&&editor!=undefined){
|
||||
var editAmount = editor.target.val();
|
||||
amounts+=editAmount+",";
|
||||
}else{
|
||||
amounts+=item.amount+",";
|
||||
}
|
||||
}
|
||||
});
|
||||
//if(datas==""){
|
||||
//top.$.messager.alert('提示', '请选择物料','info');
|
||||
//}else{
|
||||
$.post(ext.contextPath + '/work/workTaskMaterial/save.do', {ids:datas,taskid:'${param.taskid}',processrealdetailid:'${param.processrealdetailid}',amounts:amounts,workstationid:'${param.workstationid}'} , function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','保存成功','info');
|
||||
}else{
|
||||
top.$.messager.alert('提示','保存失败','info');
|
||||
}
|
||||
});
|
||||
//}
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
top.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/process/realDetailsMaterial/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
top.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/process/realDetailsMaterial/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
top.$.messager.alert('提示','成功删除'+data+'条记录','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workTaskMaterial/getlist.do?processrealdetailid=${param.processrealdetailid}&taskid=${param.taskid}&workstationid=${param.workstationid}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '物料编码', field : 'materialcode', sortable : false, halign:'center',formatter:function(value,row){
|
||||
return row.materialinfo.materialcode;
|
||||
}},
|
||||
{width : '150', title : '物料名称', field : 'materialname', sortable : false, halign:'center',formatter:function(value,row){
|
||||
return row.materialinfo.materialname;
|
||||
}},
|
||||
{width : '150', title : '物料规格', field : 'materialspec', sortable : false, halign:'center',formatter:function(value,row){
|
||||
return row.materialinfo.spec;
|
||||
}},
|
||||
{width : '150', title : '数量', field : 'amount', sortable : false, halign:'center',
|
||||
editor:{type:'numberbox',options:{precision:1 }}
|
||||
}
|
||||
] ],
|
||||
onClickCell: function (rowIndex, field, value) {
|
||||
beginEditing(rowIndex, field, value);
|
||||
},
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(data){
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item._checked){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
var editIndex = undefined;
|
||||
var beginEditing = function (rowIndex, field, value) {
|
||||
if (field != "amount" )
|
||||
{
|
||||
if(editIndex!=undefined)
|
||||
{
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
editIndex = undefined;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (rowIndex != editIndex) {
|
||||
if (endEditing()) {
|
||||
$('#grid').datagrid('beginEdit', rowIndex);
|
||||
//alert("行号:"+rowIndex);
|
||||
editIndex = rowIndex;
|
||||
|
||||
var ed = $('#grid').datagrid('getEditor', { index: rowIndex, field: 'amount' });
|
||||
$(ed.target).focus().bind('blur', function () {
|
||||
endEditing();
|
||||
});
|
||||
} else {
|
||||
$('#grid').datagrid('selectRow', editIndex);
|
||||
}
|
||||
}
|
||||
};
|
||||
var endEditing = function () {
|
||||
if (editIndex == undefined)
|
||||
{ return true; }
|
||||
if ($('#grid').datagrid('validateRow', editIndex)) {
|
||||
var ed = $('#grid').datagrid('getEditor', { index: editIndex, field: 'amount' });
|
||||
var number = $(ed.target).numberbox('getValue');
|
||||
$('#grid').datagrid('getRows')[editIndex]['amount'] = number;
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
editIndex = undefined;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<table id="toolbar" style="width:100%">
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%if (sessionManager.havePermission(session,"work/workTaskMaterial/save.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
|
||||
onclick="dosave();">分配</a>
|
||||
</td>
|
||||
<%}%>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</body>
|
||||
</html>
|
||||
146
bin/WebRoot/jsp/work/districtwork.jsp
Normal file
146
bin/WebRoot/jsp/work/districtwork.jsp
Normal file
@ -0,0 +1,146 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var returnVal = "";//用于传递是否需要刷新页面refresh
|
||||
|
||||
var dosave = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
var realid=checkedItems[0].processRealid;
|
||||
var realdetailid=checkedItems[0].processRealdetailid;
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.workstationid+",";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请选择工位','info');
|
||||
}else{
|
||||
$.post(ext.contextPath + '/work/worktaskworkstation/save.do', {ids:datas,taskid:'${param.taskid}',processrealid:realid,processrealdetailid:realdetailid} , function(data) {
|
||||
if(data.res==1){
|
||||
top.$.messager.alert('提示','保存成功','info',function(){
|
||||
grid.datagrid('selectRecord',grid.datagrid('getSelected'));
|
||||
returnVal=data.refresh;
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('提示','保存失败','info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
};
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workorder/getlist_detail.do?planid=${planid}&processid=${processid}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{width : '100', field:'name',title:'工序名称',halign:'center'},
|
||||
{width : '100', field:'id',title:'工序编码',halign:'center'},
|
||||
{width : '60', field:'preamount',title:'计划产量',halign:'center',formatter:function(value,row){
|
||||
return row.dailyPlanTaskDemand.preamount;
|
||||
}},
|
||||
{width : '60', field:'preyield',title:'良率',halign:'center',formatter:function(value,row){
|
||||
return row.dailyPlanTaskDemand.preyield;
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
|
||||
|
||||
if(data){
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item._checked){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
}
|
||||
if(grid.datagrid('getSelected')==null){
|
||||
grid.datagrid('selectRow',0);
|
||||
}
|
||||
|
||||
//$("#name_search").combobox("select",data.lineid);
|
||||
},
|
||||
onSelect:function(index,row){
|
||||
showdetailsFun('${workorderid}','${processid}',row.id);
|
||||
}
|
||||
});
|
||||
|
||||
/* $("#name_search").combobox({
|
||||
url : ext.contextPath + '/process/real/getLineListByRealid.do?realid=${workorder.processrealid}&random=' + Math.random(),
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto'
|
||||
}); */
|
||||
});
|
||||
|
||||
var showdetailsFun = function(workorderid,processid,taskid) {
|
||||
//$("#rightFrameScheduling").attr("src",ext.contextPath+"/work/workscheduling/showlist.do?processrealdetailid="+id+"&taskid="+taskid+"&workstationid="+workstationid);
|
||||
$("#rightFrameEquipment").attr("src",ext.contextPath+"/work/workorder/showdistrictwork_equ.do?workorderid="+workorderid+"&processid="+processid+"&taskid="+taskid);
|
||||
$("#rightFrameScheduling").attr("src",ext.contextPath+"/work/workorder/showdistrictwork_group.do?workorderid="+workorderid+"&processid="+processid+"&taskid="+taskid);
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="maindiv" class="easyui-layout" data-options="fit:true">
|
||||
<div id="leftdiv" data-options="region:'west',split:true" title="按工序分配 " style="width:400px;padding:0;">
|
||||
<!-- <table id="toolbar" style="width:100%">
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table>
|
||||
<tr>
|
||||
<td>工序</td>
|
||||
<td><input id="name_search" name="name_search" class="easyui-combobox"/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table> -->
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
<div id="rightdiv" data-options="region:'center'">
|
||||
<div id="tt" class="easyui-tabs" data-options="fit:true">
|
||||
|
||||
<div title="相关设备">
|
||||
<iframe id="rightFrameEquipment" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div>
|
||||
<div title="排班管理">
|
||||
<iframe id="rightFrameScheduling" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div>
|
||||
<!-- <div title="相关物料">
|
||||
<iframe id="rightFrameMaterial" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
215
bin/WebRoot/jsp/work/districtwork_equ.jsp
Normal file
215
bin/WebRoot/jsp/work/districtwork_equ.jsp
Normal file
@ -0,0 +1,215 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
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 selectEquipment(){
|
||||
//alert('${requestScope.plandate}')
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择设备',
|
||||
width : 850,
|
||||
height : 450,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/showEquipCardForDistrictWork.do?plandate=${requestScope.plandate}&workorderid=${workorderid}&processid=${processid}&taskid=${taskid}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
$.post(ext.contextPath + '/work/workorder/save_task_equ.do', {datas:res,workorderid:'${workorderid}',taskid:'${taskid}',processid:'${processid}',arrangementdate:'${requestScope.plandate}'}, function(data) {
|
||||
if(data==1){
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
top.$.messager.alert('提示','添加失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择设备',
|
||||
width : 850,
|
||||
height : 450,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/doeditEquipCardForDistrictWork.do?plandate=${requestScope.plandate}&workorderid=${workorderid}&processid=${processid}&taskid=${taskid}&equipmentid='+id,
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.updateFun();
|
||||
if(res!=null){
|
||||
$.post(ext.contextPath + '/work/workorder/update_task_equ.do', {datas:res,workorderid:'${workorderid}',taskid:'${taskid}',processid:'${processid}',arrangementdate:'${requestScope.plandate}'}, function(data) {
|
||||
if(data==1){
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
top.$.messager.alert('提示','添加失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=',';
|
||||
}
|
||||
datas+="'"+item.id+"'";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
top.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workorder/deletes_task_equ.do', {ids:datas,workorderid:'${workorderid}',taskid:'${taskid}',arrangementdate:'${requestScope.plandate}'} , function(data) {
|
||||
if(data>0){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosave = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.equipmentid+",";
|
||||
});
|
||||
//if(datas==""){
|
||||
//top.$.messager.alert('提示', '请选择设备','info');
|
||||
//}else{
|
||||
$.post(ext.contextPath + '/work/workTaskEquipment/save.do', {ids:datas,taskid:'${param.taskid}',processrealdetailid:'${param.processrealdetailid}',workstationid:'${param.workstationid}'} , function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','保存成功','info');
|
||||
}else{
|
||||
top.$.messager.alert('提示','保存失败','info');
|
||||
}
|
||||
});
|
||||
//}
|
||||
};
|
||||
function getInfoFromArrangement(arrangement){
|
||||
var str ="";
|
||||
$.each(arrangement, function(index, item){
|
||||
if(str !=""){
|
||||
str+="\n";
|
||||
}
|
||||
|
||||
if(item.checkFlag){
|
||||
str+= item.gt_name+": "+ item.stdt.substring(11,16)+" ~ "+item.enddt.substring(11,16);
|
||||
}
|
||||
});
|
||||
//alert(JSON.stringify(arrangement))
|
||||
//alert(str)
|
||||
//console.info(arrangement)
|
||||
return str;
|
||||
}
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
fit: true,
|
||||
url : ext.contextPath + '/work/workorder/getlist_detail_equ.do?workorderid=${workorderid}&processid=${processid}&taskid=${taskid}&plandate=${requestScope.plandate}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
nowrap:false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '150', title : '设备编码', field : 'equipmentcardid', sortable : false, halign:'center',formatter:function(value,row){
|
||||
return row.equipmentCard.equipmentcardid;
|
||||
}},
|
||||
{width : '150', title : '设备名称', field : 'equipmentname', sortable : false, halign:'center',formatter:function(value,row){
|
||||
return row.equipmentCard.equipmentname;
|
||||
}},
|
||||
{width : '130', title : '分配时段', field : 'remark', sortable : true, halign:'center',formatter:function(value,row){
|
||||
|
||||
return getInfoFromArrangement(row.equipmentCard.equipmentArrangements);
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '90', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
|
||||
<%if (sessionManager.havePermission(session,"equipment/editEquipmentCard.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.equipmentCard.id+'\');"/> ';
|
||||
<%}%>
|
||||
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(data){
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item._checked){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
}
|
||||
$("#capacity").html(data.statistic);
|
||||
grid.datagrid('resize',{
|
||||
height:($(window).height())
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body data-options="fit:true,border:false">
|
||||
<table id="toolbar" style="width:100%" data-options="fit:true">
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%if (sessionManager.havePermission(session,"work/workTaskEquipment/save.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" style="width:68px;"
|
||||
onclick="selectEquipment();">添加</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td >
|
||||
<span id ='capacity'></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="grid" data-options="region:'center',fit:true,border:false"></table>
|
||||
</body>
|
||||
</html>
|
||||
216
bin/WebRoot/jsp/work/districtwork_group.jsp
Normal file
216
bin/WebRoot/jsp/work/districtwork_group.jsp
Normal file
@ -0,0 +1,216 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
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 selectEquipment(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择班组',
|
||||
width : 800,
|
||||
height : 450,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/work/group/showlistForSelectByGroup.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
$.post(ext.contextPath + '/work/workorder/save_task_group.do', {datas:res,workorderid:'${workorderid}',taskid:'${taskid}',processid:'${processid}'}, function(data) {
|
||||
if(data==1){
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
top.$.messager.alert('提示','添加失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
var editFun = function(id) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '编辑设备',
|
||||
url : ext.contextPath + '/process/realDetailsEquipment/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
|
||||
var viewSkillFun = function(groupId) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '资质一览',
|
||||
url : ext.contextPath + '/process/staffskill/viewStaffSkill.do?groupId=' + groupId,
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function(id) {
|
||||
top.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/process/realDetailsEquipment/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=',';
|
||||
}
|
||||
datas+="'"+item.id+"'";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
top.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workorder/deletes_task_group.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosave = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.equipmentid+",";
|
||||
});
|
||||
//if(datas==""){
|
||||
//top.$.messager.alert('提示', '请选择设备','info');
|
||||
//}else{
|
||||
$.post(ext.contextPath + '/work/workTaskEquipment/save.do', {ids:datas,taskid:'${param.taskid}',processrealdetailid:'${param.processrealdetailid}',workstationid:'${param.workstationid}'} , function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','保存成功','info');
|
||||
}else{
|
||||
top.$.messager.alert('提示','保存失败','info');
|
||||
}
|
||||
});
|
||||
//}
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workorder/getlist_detail_group.do?workorderid=${workorderid}&processid=${processid}&taskid=${taskid}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '班组名称', field : 'equipmentcardid', sortable : false, halign:'center',formatter:function(value,row){
|
||||
return row.group.name;
|
||||
}} ,
|
||||
{width : '100', title : '课长', field : 'chief', sortable : false, halign:'center',formatter:function(value,row){
|
||||
var str="";
|
||||
$.each(row.group.groupmembers, function(index, item){
|
||||
if(item.usertype=="chief"){
|
||||
str= item.username;
|
||||
return;
|
||||
}
|
||||
});
|
||||
return str;
|
||||
|
||||
}} ,
|
||||
{width : '100', title : '组长', field : 'leader', sortable : false, halign:'center',formatter:function(value,row){
|
||||
var str="";
|
||||
$.each(row.group.groupmembers, function(index, item){
|
||||
if(item.usertype=="leader"){
|
||||
str= item.username;
|
||||
return;
|
||||
}
|
||||
});
|
||||
return str;
|
||||
|
||||
}} ,
|
||||
{width : '150', title : '人数(双击修改)', field : 'num', sortable : false, halign:'center'},
|
||||
{width : '130', title : '资质一览', field : 'action', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-chart_organisation" title="资历一览" onclick="viewSkillFun(\''+row.groupid+'\');"/>';
|
||||
return str;
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(data){
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item._checked){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onDblClickRow :function(rowIndex, rowData){
|
||||
$.messager.prompt('提示', '请填写('+rowData.group.name+')人员数量', function(r){
|
||||
if (parseInt(r)==r && r.length<4){
|
||||
$.post(ext.contextPath + '/work/workorder/update_task_group.do', {id:rowData.id,num:r} , function(data) {
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
$.messager.alert('提示','请输入3位内整数','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<table id="toolbar" style="width:100%">
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%if (sessionManager.havePermission(session,"work/workTaskEquipment/save.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="selectEquipment();">添加</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</body>
|
||||
</html>
|
||||
43
bin/WebRoot/jsp/work/districtworkstationSnakerList.jsp
Normal file
43
bin/WebRoot/jsp/work/districtworkstationSnakerList.jsp
Normal file
@ -0,0 +1,43 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<html>
|
||||
<head>
|
||||
<title>工艺流程</title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script src="<%=contextPath%>/JS/raphael-min.js" type="text/javascript"></script>
|
||||
<script src="<%=contextPath%>/JS/snaker/extends/snaker.designer.select.js" type="text/javascript"></script>
|
||||
<script src="<%=contextPath%>/JS/snaker/snaker.model.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var returnVal = "";//用于传递是否需要刷新页面refresh
|
||||
|
||||
$(function() {
|
||||
var json="${process }";
|
||||
var model;
|
||||
if(json) {
|
||||
model=eval("(" + json + ")");
|
||||
} else {
|
||||
model="";
|
||||
}
|
||||
$('#snakerflow').snakerflow({
|
||||
basePath : ext.contextPath+"/JS/snaker/",
|
||||
restore : model,
|
||||
title:"${processrealname} - ",
|
||||
modalDialogWidth:"1000",
|
||||
modalDialogHeight:"600",
|
||||
url:ext.contextPath + "/work/worktaskworkstation/districtworkstation.do?taskid=${param.id}"
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="snakerflow"></div>
|
||||
</body>
|
||||
</html>
|
||||
37
bin/WebRoot/jsp/work/districtworkstationSnakerViewList.jsp
Normal file
37
bin/WebRoot/jsp/work/districtworkstationSnakerViewList.jsp
Normal file
@ -0,0 +1,37 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<html>
|
||||
<head>
|
||||
<title>工艺流程</title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script src="<%=contextPath%>/JS/raphael-min.js" type="text/javascript"></script>
|
||||
<script src="<%=contextPath%>/JS/snaker/extends/snaker.designer.select.js" type="text/javascript"></script>
|
||||
<script src="<%=contextPath%>/JS/snaker/snaker.model.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var returnVal = "";//用于传递是否需要刷新页面refresh
|
||||
|
||||
$(function() {
|
||||
$('#snakerflow').snakerflow($.extend(true,{
|
||||
basePath : ext.contextPath+"/JS/snaker/",
|
||||
restore : eval("(${process})"),
|
||||
title:"${processrealname} - ",
|
||||
modalDialogWidth:"1000",
|
||||
modalDialogHeight:"600",
|
||||
url:ext.contextPath + "/work/worktaskworkstation/districtworkstation.do?taskid=${param.id}"
|
||||
},eval("(${state})")
|
||||
));
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="snakerflow"></div>
|
||||
</body>
|
||||
</html>
|
||||
116
bin/WebRoot/jsp/work/groupAdd.jsp
Normal file
116
bin/WebRoot/jsp/work/groupAdd.jsp
Normal file
@ -0,0 +1,116 @@
|
||||
<!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 + "/work/group/save.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
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() {
|
||||
$('#deptid').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
onBeforeSelect:function(node){
|
||||
if(node.id=="-1"){
|
||||
$("#deptid").tree("unselect");
|
||||
}
|
||||
},
|
||||
onClick : function(node) {
|
||||
$("#deptid").val(node.id);
|
||||
}
|
||||
});
|
||||
|
||||
$('#chiefname').textbox({
|
||||
required:true,
|
||||
editable:false
|
||||
});
|
||||
$('#chiefname').textbox('textbox').bind("click",function(){
|
||||
selectUsers("chiefname","chiefid","${param.iframeId}");
|
||||
});
|
||||
|
||||
$('#leadername').textbox({
|
||||
required:true,
|
||||
editable:false
|
||||
});
|
||||
$('#leadername').textbox('textbox').bind("click",function(){
|
||||
selectUsers("leadername","leaderid","${param.iframeId}");
|
||||
});
|
||||
|
||||
$('#membername').textbox({
|
||||
required:true,
|
||||
editable:false
|
||||
});
|
||||
$('#membername').textbox('textbox').bind("click",function(){
|
||||
selectUsers("membername","memberid","${param.iframeId}");
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>班组名称</th>
|
||||
<td><input name="name" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>所属车间</th>
|
||||
<td><input id="deptid" name="deptid" class="easyui-combobox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>科长</th>
|
||||
<td>
|
||||
<input id="chiefname" name="chiefname" class="easyui-textbox"/>
|
||||
<input id="chiefid" name="chiefid" type="hidden"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>组长</th>
|
||||
<td>
|
||||
<input id="leadername" name="leadername" class="easyui-textbox"/>
|
||||
<input id="leaderid" name="leaderid" type="hidden"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>组员</th>
|
||||
<td>
|
||||
<textarea id="membername" name="membername" class="easyui-textbox" data-options="multiline:true"
|
||||
style="height:100px;width:100%"></textarea>
|
||||
<input id="memberid" name="memberid" type="hidden"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td>
|
||||
<input name="remark" class="easyui-textbox" style="width:100%;height:100px" value=""
|
||||
data-options="multiline:true" validtype="length[0,250]" invalidMessage="有效长度0-250" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
141
bin/WebRoot/jsp/work/groupEdit.jsp
Normal file
141
bin/WebRoot/jsp/work/groupEdit.jsp
Normal file
@ -0,0 +1,141 @@
|
||||
<!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 + "/work/group/update.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
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() {
|
||||
$('#deptid').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
onBeforeSelect:function(node){
|
||||
if(node.id=="-1"){
|
||||
$("#deptid").tree("unselect");
|
||||
}
|
||||
},
|
||||
onLoadSuccess:function(){
|
||||
$('#deptid').combotree('setValue','${group.deptid}');
|
||||
}
|
||||
});
|
||||
|
||||
var leadernames="",leaderids="",membernames="",memberids="",chiefnames="",chiefids="";
|
||||
<c:forEach var="obj" items="${group.groupmembers}">
|
||||
if("${obj.usertype}"=="leader"){
|
||||
leadernames+="${obj.username}"+",";
|
||||
leaderids+="${obj.userid}"+",";
|
||||
}
|
||||
if("${obj.usertype}"=="member"){
|
||||
membernames+="${obj.username}"+",";
|
||||
memberids+="${obj.userid}"+",";
|
||||
}
|
||||
if("${obj.usertype}"=="chief"){
|
||||
chiefnames+="${obj.username}"+",";
|
||||
chiefids+="${obj.userid}"+",";
|
||||
}
|
||||
</c:forEach>
|
||||
leadernames=leadernames.substring(0,leadernames.length-1);
|
||||
chiefnames=chiefnames.substring(0,chiefnames.length-1);
|
||||
membernames=membernames.substring(0,membernames.length-1);
|
||||
$('#leadername').textbox({
|
||||
required:true,
|
||||
editable:false,
|
||||
value:leadernames
|
||||
});
|
||||
$('#leadername').textbox('textbox').bind("click",function(){
|
||||
selectUsers("leadername","leaderid","${param.iframeId}");
|
||||
});
|
||||
$('#leaderid').val(leaderids);
|
||||
|
||||
$('#chiefname').textbox({
|
||||
required:true,
|
||||
editable:false,
|
||||
value:chiefnames
|
||||
});
|
||||
$('#chiefname').textbox('textbox').bind("click",function(){
|
||||
selectUsers("chiefname","chiefid","${param.iframeId}");
|
||||
});
|
||||
$('#chiefid').val(chiefids);
|
||||
|
||||
$('#membername').textbox({
|
||||
required:true,
|
||||
editable:false,
|
||||
value:membernames
|
||||
});
|
||||
$('#membername').textbox('textbox').bind("click",function(){
|
||||
selectUsers("membername","memberid","${param.iframeId}");
|
||||
});
|
||||
$('#memberid').val(memberids);
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${group.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>班组名称</th>
|
||||
<td><input name="name" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${group.name}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>所属车间</th>
|
||||
<td><input id="deptid" name="deptid" class="easyui-combobox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>科长</th>
|
||||
<td>
|
||||
<input id="chiefname" name="chiefname" class="easyui-textbox"/>
|
||||
<input id="chiefid" name="chiefid" type="hidden"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>组长</th>
|
||||
<td>
|
||||
<input id="leadername" name="leadername" class="easyui-textbox"/>
|
||||
<input id="leaderid" name="leaderid" type="hidden"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>组员</th>
|
||||
<td>
|
||||
<textarea id="membername" name="membername" class="easyui-textbox" data-options="multiline:true"
|
||||
style="height:100px;width:100%"></textarea>
|
||||
<input id="memberid" name="memberid" type="hidden"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td>
|
||||
<textarea name="remark" class="easyui-textbox" data-options="multiline:true" style="height:100px;width:100%"
|
||||
validtype="length[0,250]" invalidMessage="有效长度0-250">${group.remark}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
212
bin/WebRoot/jsp/work/groupList.jsp
Normal file
212
bin/WebRoot/jsp/work/groupList.jsp
Normal file
@ -0,0 +1,212 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加班组',
|
||||
url : ext.contextPath + '/work/group/add.do?iframeId=iframeadd',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeedit',
|
||||
title : '编辑班组',
|
||||
url : ext.contextPath + '/work/group/edit.do?iframeId=iframeedit&id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var viewFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看用户信息',
|
||||
url : ext.contextPath + '/work/group/view.do?id=' + id
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/group/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
//alert(datas);
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/group/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','成功删除'+data+'条记录','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/group/getlist.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
nowrap:false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '班组名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '180', title : '所属车间', field : 'deptname', sortable : true, halign:'center'},
|
||||
{width : '380', title : '班组成员', field : 'groupmembers', sortable : false, halign:'center',formatter:function(value, row){
|
||||
var res="";
|
||||
for(var i=0;i<value.length;i++){
|
||||
if(value[i].usertype=='leader'){
|
||||
res+=value[i].username+", ";
|
||||
}
|
||||
}
|
||||
var reschief="";
|
||||
for(var i=0;i<value.length;i++){
|
||||
if(value[i].usertype=='chief'){
|
||||
reschief+=value[i].username+", ";
|
||||
}
|
||||
}
|
||||
var res1="";
|
||||
for(var i=0;i<value.length;i++){
|
||||
if(value[i].usertype=='member'){
|
||||
res1+=value[i].username+", ";
|
||||
}
|
||||
}
|
||||
res1=res1.substring(0, res1.length-2);
|
||||
return "<font color='red'><strong>"+reschief+"</strong></font>"+"<b>"+res+"</b>"+res1;
|
||||
}},
|
||||
{width : '180', title : '备注', field : 'remark', sortable : true, halign:'center'},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
<%if (sessionManager.havePermission(session,"work/group/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/group/delete.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
|
||||
$('#search_pid').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
width:200,
|
||||
onBeforeSelect:function(node){
|
||||
if(node.id=="-1"){
|
||||
$("#search_pid").tree("search_pid");
|
||||
}
|
||||
},
|
||||
editable:false
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%if (sessionManager.havePermission(session,"work/group/add.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/group/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>班组名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" /></td>
|
||||
<td>所属车间</td>
|
||||
<td><input id="search_pid" name="search_pid" class="easyui-combotree"/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
175
bin/WebRoot/jsp/work/groupListForScheduling.jsp
Normal file
175
bin/WebRoot/jsp/work/groupListForScheduling.jsp
Normal file
@ -0,0 +1,175 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript" src="json2.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
var grid;
|
||||
var editFun = function(id,index) {
|
||||
//alert(index);
|
||||
var row=$('#grid').datagrid('getRows')[index];
|
||||
var userids="";
|
||||
var workstationids="";
|
||||
$.each(row.groupmembers, function(index, item){
|
||||
userids=userids+item.userid+",";
|
||||
workstationids=workstationids+item.workstationid+",";
|
||||
});
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '组员指派',
|
||||
url : ext.contextPath + '/work/group/edit4scheduling.do?id=' + id+"&userids="+userids+"&workstationids="+workstationids,
|
||||
buttons : [ {
|
||||
text : '确认',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
||||
changerow(res);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var changerow =function( res){
|
||||
//alert(index);
|
||||
var row=$('#grid').datagrid('getSelected');
|
||||
var editIndex=$('#grid').datagrid('getRowIndex',row);
|
||||
var members=JSON.parse(res);
|
||||
$('#grid').datagrid('getRows')[editIndex]['groupmembers'] = members;
|
||||
$('#grid').datagrid('refreshRow',editIndex);
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
url : ext.contextPath + '/work/workscheduling/getlist.do?querytype=select&dt=${dt}&groupManageid=${groupManageid}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: false,
|
||||
nowrap:false,
|
||||
idField : 'id',
|
||||
pageSize : 20,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '班组名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '180', title : '所属车间', field : 'deptname', sortable : true, halign:'center'},
|
||||
{width : '380', title : '班组当班人员', field : 'groupmembers', sortable : false, halign:'center',formatter:function(value, row){
|
||||
var res="";
|
||||
for(var i=0;i<value.length;i++){
|
||||
if(value[i].usertype=='leader'){
|
||||
res+=value[i].username+"("+value[i].workstationname+"), ";
|
||||
}
|
||||
}
|
||||
var res1="";
|
||||
for(var i=0;i<value.length;i++){
|
||||
if(value[i].usertype=='member'){
|
||||
res1+=value[i].username+"("+value[i].workstationname+"), ";
|
||||
}
|
||||
}
|
||||
return "<b>"+res+"</b>"+res1;
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row,index) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="组员指派" onclick="editFun(\''+row.id+'\',\''+index+'\');"/>';
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(data){
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item.schedulingflag){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#search_pid').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
width:200,
|
||||
editable:false
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
var dosave = function(dialog,parentWin) {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
if(checkedItems==""){
|
||||
top.$.messager.alert('提示', '请选择班组','info');
|
||||
}else{
|
||||
var errflag="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
var groupmembers=item.groupmembers;
|
||||
$.each(groupmembers, function(index, item_m){
|
||||
if(item_m.workstationid==null||item_m.workstationid==""){
|
||||
top.$.messager.alert('提示',item.name+"中的“"+item_m.username+"”未安排工位!",'info');
|
||||
errflag="1";
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if(errflag!=""){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if(errflag!=""){
|
||||
return false;
|
||||
}
|
||||
var res=JSON.stringify(checkedItems);
|
||||
$.post(ext.contextPath + '/work/workscheduling/save.do', {res:res,dt:'${dt}',groupManageid:'${groupManageid}'} , function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','保存成功','info');
|
||||
parentWin.refreshcalerdar();//更新父窗体
|
||||
dialog.dialog('destroy');
|
||||
}else{
|
||||
top.$.messager.alert('提示','保存失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false" >
|
||||
<table id="toolbar" style="display: none;width:100%">
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>班组名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" /></td>
|
||||
<td>所属车间</td>
|
||||
<td><input id="search_pid" name="search_pid" class="easyui-combotree"/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="easyui-panel" data-options="fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
<!-- <div id="ft" style="padding:5px;">
|
||||
选择需排班的班组,点击保存,完成排班。
|
||||
</div> -->
|
||||
</body>
|
||||
</html>
|
||||
112
bin/WebRoot/jsp/work/groupListForSelect.jsp
Normal file
112
bin/WebRoot/jsp/work/groupListForSelect.jsp
Normal file
@ -0,0 +1,112 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function selectFun() {
|
||||
var checkedItems = $('#grid1').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas += '{"userid":"'+item.userid +'","usertype":"'+item.usertype +'","username":"'+item.username +'"},';
|
||||
});
|
||||
return $.parseJSON('{"result":['+datas.replace(/,$/g,"")+']}');
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '班组选择',
|
||||
url : ext.contextPath + '/work/group/getlist.do?querytype=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
idField : 'id',
|
||||
height:300,
|
||||
pageSize : 20,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{width : '100', title : '班组名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '180', title : '所属车间', field : 'deptname', sortable : true, halign:'center'},
|
||||
{width : '180', title : '备注', field : 'remark', sortable : true, halign:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onSelect:function(index,row){
|
||||
loadMembers(row.id);
|
||||
}
|
||||
});
|
||||
|
||||
$('#search_pid').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
width:200,
|
||||
editable:false
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function loadMembers(groupid){
|
||||
$('#grid1').datagrid({
|
||||
title : '人员选择',
|
||||
url : ext.contextPath + '/work/group/getMemberListByGroupId.do?groupid='+groupid,
|
||||
height:400,
|
||||
striped : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 20,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '人员类型', field : 'usertype', sortable : false, halign:'center',formatter:function(value){
|
||||
if(value=='leader'){
|
||||
return "组长";
|
||||
}else{
|
||||
return "组员";
|
||||
}
|
||||
}},
|
||||
{width : '180', title : '人员名称', field : 'username', sortable : false, halign:'center'}
|
||||
] ]
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false" style="padding:5px;">
|
||||
<table id="toolbar" style="display: none;width:100%">
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>班组名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" /></td>
|
||||
<td>所属车间</td>
|
||||
<td><input id="search_pid" name="search_pid" class="easyui-combotree"/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="grid"></table>
|
||||
<div style="height:10px"></div>
|
||||
<table id="grid1"></table>
|
||||
</body>
|
||||
</html>
|
||||
147
bin/WebRoot/jsp/work/groupListForSelectByGroup.jsp
Normal file
147
bin/WebRoot/jsp/work/groupListForSelectByGroup.jsp
Normal file
@ -0,0 +1,147 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function selectFun() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
if(datas !=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas += '{"id":"'+item.id +'","name":"'+item.name +'"}';
|
||||
});
|
||||
datas="["+datas+"]";
|
||||
//alert(datas)
|
||||
return datas;//$.parseJSON(datas);
|
||||
}
|
||||
var viewSkillFun = function(groupId) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '资质一览',
|
||||
url : ext.contextPath + '/process/staffskill/viewStaffSkill.do?groupId=' + groupId,
|
||||
});
|
||||
};
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/group/getlist.do?querytype=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '班组名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '180', title : '所属车间', field : 'deptname', sortable : true, halign:'center'},
|
||||
{width : '180', title : '课长', field : 'chief', sortable : true, halign:'center',formatter:function(value,row){
|
||||
var str="";
|
||||
$.each(row.groupmembers, function(index, item){
|
||||
if(item.usertype=="chief"){
|
||||
str= item.username;
|
||||
return;
|
||||
}
|
||||
});
|
||||
return str;
|
||||
}},
|
||||
{width : '180', title : '组长', field : 'leader', sortable : true, halign:'center',formatter:function(value,row){
|
||||
var str="";
|
||||
$.each(row.groupmembers, function(index, item){
|
||||
if(item.usertype=="leader"){
|
||||
str= item.username;
|
||||
return;
|
||||
}
|
||||
});
|
||||
return str;
|
||||
}},
|
||||
{width : '100', title : '资质一览', field : 'action', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-chart_organisation" title="" onclick="viewSkillFun(\''+row.id+'\');"/>';
|
||||
return str;
|
||||
}},
|
||||
{width : '180', title : '备注', field : 'remark', sortable : true, halign:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onSelect:function(index,row){
|
||||
//loadMembers(row.id);
|
||||
}
|
||||
});
|
||||
|
||||
$('#search_pid').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
width:200,
|
||||
editable:false
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function loadMembers(groupid){
|
||||
$('#grid1').datagrid({
|
||||
title : '人员选择',
|
||||
url : ext.contextPath + '/work/group/getMemberListByGroupId.do?groupid='+groupid,
|
||||
height:400,
|
||||
striped : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 20,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '人员类型', field : 'usertype', sortable : false, halign:'center',formatter:function(value){
|
||||
if(value=='leader'){
|
||||
return "组长";
|
||||
}else{
|
||||
return "组员";
|
||||
}
|
||||
}},
|
||||
{width : '180', title : '人员名称', field : 'username', sortable : false, halign:'center'}
|
||||
|
||||
] ]
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false" >
|
||||
<table id="toolbar" style="display: none;width:100%">
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>班组名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" /></td>
|
||||
<td>所属车间</td>
|
||||
<td><input id="search_pid" name="search_pid" class="easyui-combotree"/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</body>
|
||||
</html>
|
||||
193
bin/WebRoot/jsp/work/groupMemberListForScheduling.jsp
Normal file
193
bin/WebRoot/jsp/work/groupMemberListForScheduling.jsp
Normal file
@ -0,0 +1,193 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript" src="json2.js"></script>
|
||||
<script type="text/javascript">
|
||||
function selectFun() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas += '{"userid":"'+item.userid +'","usertype":"'+item.usertype +'","username":"'+item.username +'"},';
|
||||
});
|
||||
return $.parseJSON('{"result":['+datas.replace(/,$/g,"")+']}');
|
||||
}
|
||||
|
||||
var grid;
|
||||
var stationlist;
|
||||
var getworkstationFun = function() {
|
||||
$.post(ext.contextPath + '/work/group/getworkstation.do', {} , function(data) {
|
||||
stationlist=eval(data);
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
getworkstationFun();
|
||||
$('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/group/getMemberListByGroupId.do?groupid=${groupid}&userids=${userids}&workstationids=${workstationids}',
|
||||
striped : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 20,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '人员类型', field : 'usertype', sortable : false, halign:'center',formatter:function(value){
|
||||
if(value=='leader'){
|
||||
return "组长";
|
||||
}else{
|
||||
return "组员";
|
||||
}
|
||||
}},
|
||||
{width : '180', title : '人员名称', field : 'username', sortable : false, halign:'center'},
|
||||
{width : '180', title : '人员工位', field : 'workstationid', sortable : false, halign:'center',
|
||||
formatter:function(value,row){
|
||||
var te;
|
||||
for(var i=0;i<stationlist.length;i++){
|
||||
if(value==stationlist[i].id){
|
||||
te=stationlist[i].name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return te;
|
||||
},
|
||||
editor:{type:'combobox',
|
||||
options:{url:ext.contextPath + '/work/group/getworkstation.do',
|
||||
valueField:'id',
|
||||
textField:'name',
|
||||
method:'get',
|
||||
required:false,
|
||||
}
|
||||
}
|
||||
}
|
||||
] ],
|
||||
onClickCell: function (rowIndex, field, value) {
|
||||
beginEditing(rowIndex, field, value);
|
||||
},
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(data){
|
||||
var userids='${userids}';
|
||||
var userid;
|
||||
if(userids!=""){
|
||||
userid=userids.split(',');
|
||||
}
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item._checkflag){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
}
|
||||
//if(grid.datagrid('getSelected')==null){
|
||||
// grid.datagrid('selectRow',0);
|
||||
//}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
var editIndex = undefined;
|
||||
var beginEditing = function (rowIndex, field, value) {
|
||||
if (field != "workstationid" )
|
||||
{
|
||||
if(editIndex!=undefined)
|
||||
{
|
||||
endEditing();
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
editIndex = undefined;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (rowIndex != editIndex) {
|
||||
if (endEditing()) {
|
||||
$('#grid').datagrid('beginEdit', rowIndex);
|
||||
//alert("行号:"+rowIndex);
|
||||
editIndex = rowIndex;
|
||||
|
||||
var ed = $('#grid').datagrid('getEditor', { index: rowIndex, field: 'workstationid' });
|
||||
$(ed.target).focus().bind('blur', function () {
|
||||
endEditing();
|
||||
});
|
||||
} else {
|
||||
$('#grid').datagrid('selectRow', editIndex);
|
||||
}
|
||||
}
|
||||
};
|
||||
var endEditing = function () {
|
||||
if (editIndex == undefined)
|
||||
{ return true; }
|
||||
if ($('#grid').datagrid('validateRow', editIndex)) {
|
||||
var ed = $('#grid').datagrid('getEditor', { index: editIndex, field: 'workstationid' });
|
||||
var number = $(ed.target).combobox('getValue');
|
||||
//alert();
|
||||
$('#grid').datagrid('getRows')[editIndex]['workstationid'] = number;
|
||||
var numbern = $(ed.target).combobox('getText');
|
||||
$('#grid').datagrid('getRows')[editIndex]['workstationname'] = numbern;
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
editIndex = undefined;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
var dosave = function(dialog,grid) {
|
||||
//若用户未确认编辑状态,则自动完成编辑
|
||||
var row=$('#grid').datagrid('getSelected');
|
||||
var editIndex=$('#grid').datagrid('getRowIndex',row);
|
||||
var ed = $('#grid').datagrid('getEditor', { index: editIndex, field: 'workstationid' });
|
||||
if(ed!=null){
|
||||
var number = $(ed.target).combobox('getValue');
|
||||
$('#grid').datagrid('getRows')[editIndex]['workstationid'] = number;
|
||||
var numbern = $(ed.target).combobox('getText');
|
||||
$('#grid').datagrid('getRows')[editIndex]['workstationname'] = numbern;
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
}
|
||||
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
var stationids="";
|
||||
var errorflag="";//标记是否勾选选人员未设置工位
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.userid+",";
|
||||
stationids+=item.workstationid+",";
|
||||
if(item.workstationid==""){
|
||||
errorflag="error";
|
||||
}
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请选择至少一名成员','info');
|
||||
}else if(errorflag!=""){
|
||||
top.$.messager.alert('提示', '已选的人员中有人员未设置工位!','info');
|
||||
}else{
|
||||
var res=JSON.stringify(checkedItems);
|
||||
//alert(res);
|
||||
$.post(ext.contextPath + '/work/group/saveuserworkstation.do', {ids:datas,stationids:stationids} , function(data) {
|
||||
if(data==1){
|
||||
//top.$.messager.alert('提示','保存成功','info');
|
||||
dialog.dialog('destroy');
|
||||
}else{
|
||||
top.$.messager.alert('提示','信息提交失败','info');
|
||||
}
|
||||
});
|
||||
return res;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false" >
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
81
bin/WebRoot/jsp/work/grouptypeAdd.jsp
Normal file
81
bin/WebRoot/jsp/work/grouptypeAdd.jsp
Normal file
@ -0,0 +1,81 @@
|
||||
<!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 + "/work/groupManage/save.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
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() {
|
||||
/* $('#lineid').combobox({
|
||||
url : ext.contextPath + '/work/line/getSelectList.do?random=' + Math.random(),
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
width:250,
|
||||
panelHeight:'auto'
|
||||
});
|
||||
|
||||
$('#typeid').combobox({
|
||||
url : ext.contextPath + '/work/workstationType/getselectlist.do?random=' + Math.random(),
|
||||
valueField:'id',
|
||||
textField:'name',
|
||||
method:'get'
|
||||
}); */
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>班次名称</th>
|
||||
<td><input name="name" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>开始时间</th>
|
||||
<td><input id="sdt" name="sdt" class="Wdate"
|
||||
value="" onfocus="WdatePicker({dateFmt:'HH:mm'})"
|
||||
readonly>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>结束时间</th>
|
||||
<td><input id="edt" name="edt" class="Wdate" value=""
|
||||
onfocus="WdatePicker({dateFmt:'HH:mm'})"
|
||||
readonly>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td><input name="remark" class="easyui-textbox" style="overflow:auto;height:80px;width:100%" value=""
|
||||
data-options="multiline:true" validtype="length[0,250]" invalidMessage="有效长度0-250" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
67
bin/WebRoot/jsp/work/grouptypeEdit.jsp
Normal file
67
bin/WebRoot/jsp/work/grouptypeEdit.jsp
Normal file
@ -0,0 +1,67 @@
|
||||
<!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 + "/work/groupManage/update.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
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() {
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${groupManage.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>班次名称</th>
|
||||
<td><input name="name" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${groupManage.name}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>开始时间</th>
|
||||
<td><input id="sdt" name="sdt" class="Wdate"
|
||||
value="${groupManage.sdt.length()>5?groupManage.sdt.substring(0,5):groupManage.sdt}" onfocus="WdatePicker({dateFmt:'HH:mm'})"
|
||||
readonly>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>结束时间</th>
|
||||
<td><input id="edt" name="edt" class="Wdate" value="${groupManage.edt.length()>5?groupManage.edt.substring(0,5):groupManage.edt}"
|
||||
onfocus="WdatePicker({dateFmt:'HH:mm'})"
|
||||
readonly>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td><input id="remark" name="remark" class="easyui-textbox"
|
||||
data-options="multiline:true"
|
||||
style="overflow:auto;height:80px;width:100%" value="${groupManage.remark}"
|
||||
validtype="length[0,250]" invalidMessage="有效长度0-250" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
172
bin/WebRoot/jsp/work/grouptypeList.jsp
Normal file
172
bin/WebRoot/jsp/work/grouptypeList.jsp
Normal file
@ -0,0 +1,172 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function(){
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '添加班次',
|
||||
width : 600,
|
||||
height : 400,
|
||||
resizable:true,
|
||||
url : ext.contextPath + '/work/groupManage/add.do',
|
||||
buttons : [{
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑班次',
|
||||
url : ext.contextPath + '/work/groupManage/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/groupManage/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
//alert(datas);
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/groupManage/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','成功删除'+data+'条记录','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/groupManage/getlist.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '100', title : '开始时间', field : 'sdt', sortable : true, halign:'center',align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
if(value.length>6){
|
||||
str = value.substring(0,5);
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{width : '100', title : '结束时间', field : 'edt', sortable : true, halign:'center',align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
if(value.length>6){
|
||||
str = value.substring(0,5);
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{width : '300', title : '备注', field : 'remark', sortable : true, halign:'center'},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
<%if (sessionManager.havePermission(session,"work/workscheduling/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/workscheduling/delete.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%if (sessionManager.havePermission(session,"work/groupManage/add.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/groupManage/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<input id="userids" name="userids" type="hidden" />
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
84
bin/WebRoot/jsp/work/grouptypeListForSelect.jsp
Normal file
84
bin/WebRoot/jsp/work/grouptypeListForSelect.jsp
Normal file
@ -0,0 +1,84 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
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 selectFun() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas = '{"id":"'+item.id+'"}';
|
||||
});
|
||||
//alert(datas);
|
||||
return $.parseJSON('{"result":['+datas.replace(/,$/g,"")+']}');
|
||||
}
|
||||
var groupManage = function(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '工段维护',
|
||||
url : ext.contextPath + '/work/groupManage/showlist.do',
|
||||
width:1200,
|
||||
height:600
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/groupManage/getlistForSelect.do?querytype=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : false,
|
||||
singleSelect: true,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{width : '100', title : '名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '100', title : '开始时间', field : 'sdt', sortable : true, halign:'center',align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
if(value.length>6){
|
||||
str = value.substring(0,5);
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{width : '100', title : '结束时间', field : 'edt', sortable : true, halign:'center',align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
if(value.length>6){
|
||||
str = value.substring(0,5);
|
||||
}else{
|
||||
return value;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(grid.datagrid('getSelected')==null){
|
||||
grid.datagrid('selectRow',0);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<input id="userids" name="userids" type="hidden" />
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
297
bin/WebRoot/jsp/work/lineAdd.jsp
Normal file
297
bin/WebRoot/jsp/work/lineAdd.jsp
Normal file
@ -0,0 +1,297 @@
|
||||
<!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>xxx</title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
//获取已选的工位id
|
||||
function getWids(){
|
||||
var wrows= $('#grid').datagrid("getRows");
|
||||
var wids="";
|
||||
$.each(wrows, function(index, item){
|
||||
wids+=item.id+",";
|
||||
});
|
||||
wids=wids.replace(/,$/gi,"");
|
||||
return wids;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getQids(){
|
||||
var qrows= $('#gridp').datagrid("getRows");
|
||||
var qids="";
|
||||
$.each(qrows, function(index, item){
|
||||
qids+=item.id+",";
|
||||
});
|
||||
qids=qids.replace(/,$/gi,"");
|
||||
return qids;
|
||||
}
|
||||
|
||||
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/work/line/save.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
|
||||
|
||||
|
||||
$.post(ext.contextPath + "/work/line/saveWorkstation.do",{lineid:data.id,wids:getWids(),qids:getQids()},function(data1){
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
grid.datagrid('reload');
|
||||
gridp.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function doadd_Q(){
|
||||
$("#mids").val(getQids());
|
||||
|
||||
localStorage.setItem("mids",$("#mids").val());
|
||||
|
||||
/* var qrows= gridp.datagrid("getRows");
|
||||
//复制rows,否则deleteRow的index会出错
|
||||
var copyRows = [];
|
||||
for ( var j= 0; j < qrows.length; j++) {
|
||||
copyRows.push(qrows[j]);
|
||||
}
|
||||
$.each(copyRows, function(index, item){
|
||||
gridp.datagrid('deleteRow', gridp.datagrid('getRowIndex',copyRows[index]));
|
||||
});
|
||||
var checkedItems = $('#gridp').datagrid('getChecked'); */
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加设备',
|
||||
height:500,
|
||||
url : ext.contextPath + '/equipment/showEquipmentCardForSelects.do?iframeId=lineAdd',
|
||||
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++){
|
||||
gridp.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_Q(){
|
||||
var rows = $('#gridp').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){
|
||||
$('#gridp').datagrid('deleteRow',$('#gridp').datagrid('getRowIndex',copyRows[index]));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function doadd_W(){
|
||||
|
||||
$("#wids").val(getWids());
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加工位',
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workstation/showlistForSelects.do?iframeId=lineAdd',
|
||||
|
||||
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() {
|
||||
$("#workshopid").combobox({
|
||||
url : ext.contextPath + '/work/workshop/getlist4Combo.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto'
|
||||
});
|
||||
|
||||
$('#insertp').panel({
|
||||
width:"100%",
|
||||
height:"165",
|
||||
title: '相关设备',
|
||||
tools: [{
|
||||
iconCls:'icon-add',
|
||||
handler:function(){doadd_Q();}
|
||||
},{
|
||||
iconCls:'icon-remove',
|
||||
handler:function(){dodelete_Q();}
|
||||
}]
|
||||
});
|
||||
|
||||
gridp = $('#gridp').datagrid({
|
||||
title : '',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '120', title : '设备编号', field : 'equipmentcardid', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '120', title : '设备名称', field : 'equipmentname', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '120', title : '设备型号', field : 'equipmentmodel', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '120', title : '设备类型', field : 'equipmentclassid', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '120', title : '存放位置', field : 'areaid', sortable : true, editor:'textbox',halign:'center'}
|
||||
] ]
|
||||
});
|
||||
|
||||
$('#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,
|
||||
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="mids" name="mids" type="hidden" value="" />
|
||||
<input id="wids" name="wids" type="hidden" value="" />
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>产线名称</th>
|
||||
<td><input name="name" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产线工序编号</th>
|
||||
<td><input name="serial" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>车间</th>
|
||||
<td ><input id="workshopid" name="workshopid" class="easyui-combobox" data-options="required:true,validType:'isBlank'" style="width: 180px;"/></td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td>
|
||||
<input name="remark" class="easyui-textbox" style="width:100%;height:25px" value=""
|
||||
data-options="multiline:true" validtype="length[0,250]" invalidMessage="有效长度0-250" />
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br/>
|
||||
<div id="insertp">
|
||||
<table id="gridp" data-options="border:false"></table>
|
||||
</div>
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
295
bin/WebRoot/jsp/work/lineEdit.jsp
Normal file
295
bin/WebRoot/jsp/work/lineEdit.jsp
Normal file
@ -0,0 +1,295 @@
|
||||
<!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">
|
||||
//获取已选的工位id
|
||||
function getWids(){
|
||||
var rows= $('#grid').datagrid("getRows");
|
||||
var wids="";
|
||||
$.each(rows, function(index, item){
|
||||
wids+=item.id+",";
|
||||
});
|
||||
wids=wids.replace(/,$/gi,"");
|
||||
return wids;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getQids(){
|
||||
var qrows= $('#gridp').datagrid("getRows");
|
||||
var qids="";
|
||||
$.each(qrows, function(index, item){
|
||||
qids+=item.id+",";
|
||||
});
|
||||
qids=qids.replace(/,$/gi,"");
|
||||
return qids;
|
||||
}
|
||||
|
||||
function doupdate(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/work/line/update.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
$.post(ext.contextPath + "/work/line/saveWorkstation.do",{lineid:data.id,wids:getWids(),qids:getQids()},function(data1){
|
||||
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_Q(){
|
||||
|
||||
$("#mids").val(getQids());
|
||||
|
||||
/* localStorage.setItem("mids",$("#mids").val());
|
||||
var rows= gridp.datagrid("getRows");
|
||||
//复制rows,否则deleteRow的index会出错
|
||||
var copyRows = [];
|
||||
for ( var j= 0; j < rows.length; j++) {
|
||||
copyRows.push(rows[j]);
|
||||
}
|
||||
$.each(copyRows, function(index, item){
|
||||
gridp.datagrid('deleteRow', gridp.datagrid('getRowIndex',copyRows[index]));
|
||||
});
|
||||
var checkedItems = $('#gridp').datagrid('getChecked'); */
|
||||
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加设备',
|
||||
height:500,
|
||||
url : ext.contextPath + '/equipment/showEquipmentCardForSelects.do?',
|
||||
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++){
|
||||
gridp.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_Q(){
|
||||
var rows = $('#gridp').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){
|
||||
$('#gridp').datagrid('deleteRow',$('#gridp').datagrid('getRowIndex',copyRows[index]));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function doadd_W(){
|
||||
$("#wids").val(getWids());
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加工位',
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workstation/showlistForSelects.do?iframeId=lineEdit',
|
||||
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() {
|
||||
$("#workshopid").combobox({
|
||||
url : ext.contextPath + '/work/workshop/getlist4Combo.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onLoadSuccess:function(){
|
||||
var value ="${line.workshopid}";
|
||||
if(value!=null && value!=""){
|
||||
$("#workshopid").combobox('setValue',value);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
$('#insertp').panel({
|
||||
width:"100%",
|
||||
height:"165",
|
||||
title: '相关设备',
|
||||
tools: [{
|
||||
iconCls:'icon-add',
|
||||
handler:function(){doadd_Q();}
|
||||
},{
|
||||
iconCls:'icon-remove',
|
||||
handler:function(){dodelete_Q();}
|
||||
}]
|
||||
});
|
||||
|
||||
gridp = $('#gridp').datagrid({
|
||||
title : '',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '120', title : '设备编号', field : 'equipmentcardid', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '120', title : '设备名称', field : 'equipmentname', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '120', title : '设备型号', field : 'equipmentmodel', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '100', title : '设备类型', field : 'equipmentclassid', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '100', title : '存放位置', field : 'areaid', sortable : true, editor:'textbox',halign:'center'}
|
||||
] ],
|
||||
data:${equipmentcardList}
|
||||
|
||||
});
|
||||
|
||||
$('#p').panel({
|
||||
width:"100%",
|
||||
height:"150px",
|
||||
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 : '130', title : '工位编号', field : 'serial', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '100', title : '工位名称', field : 'name', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '100', title : '工位类型', field : 'typename', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '170', title : '所属车间', field : 'deptname', sortable : true, editor:'textbox',halign:'center'}
|
||||
] ],
|
||||
data:${workstationList}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<input id="wids" name="wids" type="hidden" value="" />
|
||||
<input id="mids" name="mids" type="hidden" value="" />
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${line.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>产线名称</th>
|
||||
<td><input name="name" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${line.name}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产线工序编号</th>
|
||||
<td><input name="serial" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${line.serial}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>车间</th>
|
||||
<td ><input id="workshopid" name="workshopid" class="easyui-combobox" data-options="required:true,validType:'isBlank'" style="width: 180px;"/></td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td>
|
||||
<textarea name="remark" class="easyui-textbox" data-options="multiline:true" style="height:25px;width:100%" validtype="length[0,250]" invalidMessage="有效长度0-250">${line.remark}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br/>
|
||||
<div id="insertp">
|
||||
<table id="gridp" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</div>
|
||||
</P>
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
190
bin/WebRoot/jsp/work/lineList.jsp
Normal file
190
bin/WebRoot/jsp/work/lineList.jsp
Normal file
@ -0,0 +1,190 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加产线',
|
||||
iframeId:"lineAdd",
|
||||
url : ext.contextPath + '/work/line/add.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑产线',
|
||||
iframeId:"lineEdit",
|
||||
url : ext.contextPath + '/work/line/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doupdate(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var viewFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看用户信息',
|
||||
url : ext.contextPath + '/work/line/view.do?id=' + id
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/line/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
//alert(datas);
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/line/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','成功删除'+data+'条记录','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/line/getlist.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '产线名称', field : 'name', halign:'center'},
|
||||
{width : '100', title : '产线工序编号', field : 'serial', halign:'center'},
|
||||
{width : '100', title : '产线工序编号', field : 'workshopname', halign:'center', formatter : function(value, row) {
|
||||
return row.workShop.name;
|
||||
}},
|
||||
{width : '180', title : '备注', field : 'remark', sortable : true, halign:'center'},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
<%if (sessionManager.havePermission(session,"work/line/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/line/delete.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
|
||||
$('#search_pid').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
width:200,
|
||||
onBeforeSelect:function(node){
|
||||
if(node.id=="-1"){
|
||||
$("#search_pid").tree("search_pid");
|
||||
}
|
||||
},
|
||||
editable:false
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%if (sessionManager.havePermission(session,"work/line/add.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/line/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>产线名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" /></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
262
bin/WebRoot/jsp/work/mPointAdd.jsp
Normal file
262
bin/WebRoot/jsp/work/mPointAdd.jsp
Normal file
@ -0,0 +1,262 @@
|
||||
<!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.scada.MPoint"%>
|
||||
<%@ 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_Enable",MPoint.Flag_Enable);%>
|
||||
<%request.setAttribute("Flag_Disable",MPoint.Flag_Disable);%>
|
||||
|
||||
<%request.setAttribute("Flag_Sql",MPoint.Flag_Sql);%>
|
||||
<%request.setAttribute("Flag_Modbus",MPoint.Flag_Modbus);%>
|
||||
<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 + "/work/mpoint/save.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
|
||||
$.post(ext.contextPath + "/work/mpoint/savep.do",{no:data.id,mids:getMids()},function(data1){
|
||||
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 doadd_M(){
|
||||
|
||||
$("#mids").val(getMids());
|
||||
localStorage.setItem("mids",$("#mids").val().split(","));
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加设备',
|
||||
height:500,
|
||||
url : ext.contextPath + '/equipment/showEquipmentCardForSelects.do?iframeId=mPointAdd',
|
||||
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() {
|
||||
$("#scdtype").combobox({
|
||||
url : ext.contextPath + '/equipment/getGeographyArea4Combo.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
});
|
||||
$('#m').panel({
|
||||
width:"98%",
|
||||
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 : '150', title : '设备编号', field : 'equipmentcardid', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '150', 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'}
|
||||
] ]
|
||||
});
|
||||
$("#modbusfigid").combobox({
|
||||
url : ext.contextPath + '/work/modbusfig/getlist4combo.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
});
|
||||
|
||||
$("#pointfunctiondefinition").combobox({
|
||||
url : ext.contextPath + '/work/mpoint/getMPointFunType4Combo.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<input id="mids" name="mids" type="hidden" value="" />
|
||||
<tr>
|
||||
<th>测量点ID</th>
|
||||
<td><input id="id" name="id" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
<th>测量点Code</th>
|
||||
<td><input id="mpointcode" name="mpointcode" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>测量点名称</th>
|
||||
<td><input id="parmname" name="parmname" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
<th>测量点启用</th>
|
||||
<td>
|
||||
<select name="active" class="easyui-combobox" data-options="panelHeight:'auto',editable:false,value:'${Flag_Enable}',validType:'isBlank'">
|
||||
<option value="${Flag_Enable}">启用</option>
|
||||
<option value="${Flag_Disable}">禁用</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>信号类型</th>
|
||||
<td>
|
||||
<select name="signaltype" class="easyui-combobox" data-options="panelHeight:'auto',editable:false,value:'AI',validType:'isBlank'">
|
||||
<option value="AI">AI</option>
|
||||
<option value="DI">DI</option>
|
||||
</select>
|
||||
</td>
|
||||
<th>信号源</th>
|
||||
<td>
|
||||
<select name="valuetype" class="easyui-combobox" data-options="panelHeight:'auto',editable:false,value:'${Flag_Sql}'">
|
||||
<option value="${Flag_Sql}">数据库</option>
|
||||
<option value="${Flag_Modbus}">Modbus</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>单位</th>
|
||||
<td>
|
||||
<input id="unit" name="unit" class="easyui-textbox"/>
|
||||
</td>
|
||||
<th>精度位数</th>
|
||||
<td>
|
||||
<input id="rate" name="rate" class="easyui-textbox"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>作用定义(可自定义)</th>
|
||||
<td>
|
||||
<input id="pointfunctiondefinition" name="pointfunctiondefinition" class="easyui-combobox" />
|
||||
</td>
|
||||
<th>表达式(例:>1,=1,(1-2))</th>
|
||||
<td>
|
||||
<input id="exp" name="exp" class="easyui-textbox" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
<table class="table">
|
||||
|
||||
<tr>
|
||||
<th>报警上限</th>
|
||||
<td>
|
||||
<input id="alarmmax" name="alarmmax" class="easyui-textbox"/>
|
||||
</td>
|
||||
<th>报警下限</th>
|
||||
<td>
|
||||
<input id="alarmmin" name="alarmmin" class="easyui-textbox"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
<th>报警启用</th>
|
||||
<td>
|
||||
<select name="TriggerAlarm" class="easyui-combobox" data-options="panelHeight:'auto',editable:false,value:'${Flag_Disable}',validType:'isBlank'">
|
||||
<option value="${Flag_Enable}">启用</option>
|
||||
<option value="${Flag_Disable}">禁用</option>
|
||||
</select>
|
||||
</td>
|
||||
<th>所属车间</th>
|
||||
<td>
|
||||
<input id="scdtype" name="scdtype" class="easyui-combobox" data-options="validType:'isBlank'"/>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Modbus服务器</th>
|
||||
<td>
|
||||
<input id="modbusfigid" name="modbusfigid" class="easyui-combobox" data-options="validType:'isBlank'"/>
|
||||
</td>
|
||||
<th>寄存器地址</th>
|
||||
<td>
|
||||
<input id="register" name="register" class="easyui-textbox"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</br>
|
||||
<div id="m" style="width:80%;">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
275
bin/WebRoot/jsp/work/mPointEdit.jsp
Normal file
275
bin/WebRoot/jsp/work/mPointEdit.jsp
Normal file
@ -0,0 +1,275 @@
|
||||
<!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.scada.MPoint"%>
|
||||
<%@ 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_Enable",MPoint.Flag_Enable);%>
|
||||
<%request.setAttribute("Flag_Disable",MPoint.Flag_Disable);%>
|
||||
|
||||
<%request.setAttribute("Flag_Sql",MPoint.Flag_Sql);%>
|
||||
<%request.setAttribute("Flag_Modbus",MPoint.Flag_Modbus);%>
|
||||
<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 + "/work/mpoint/update.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
$.post(ext.contextPath + "/work/mpoint/savep.do",{no:data.id,mids:getMids()},function(data1){
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearSelections');
|
||||
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 doadd_M(){
|
||||
$("#mids").val(getMids());
|
||||
localStorage.setItem("mids",$("#mids").val().split(","));
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加设备',
|
||||
height:500,
|
||||
url : ext.contextPath + '/equipment/showEquipmentCardForSelects.do?iframeId=MPointAdd',
|
||||
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,
|
||||
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
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() {
|
||||
|
||||
$("#scdtype").combobox({
|
||||
url : ext.contextPath + '/equipment/getGeographyArea4Combo.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
});
|
||||
$('#m').panel({
|
||||
width:"98%",
|
||||
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 : '200', title : '设备编号', field : 'equipmentcardid', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '200', title : '设备名称', field : 'equipmentname', sortable : true, editor:'textbox',halign:'center'},
|
||||
|
||||
] ],
|
||||
data:${equipmentcardList}
|
||||
});
|
||||
$("#modbusfigid").combobox({
|
||||
url : ext.contextPath + '/work/modbusfig/getlist4combo.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
});
|
||||
$("#pointfunctiondefinition").combobox({
|
||||
url : ext.contextPath + '/work/mpoint/getMPointFunType4Combo.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onLoadSuccess:function(){
|
||||
var value ="${mPoint.pointfunctiondefinition}";
|
||||
if(value!=null && value!=""){
|
||||
$("#pointfunctiondefinition").combobox('setValue',value);
|
||||
}
|
||||
|
||||
}
|
||||
/* onSelect: function () {
|
||||
contentdiv.empty();
|
||||
|
||||
var son='<img id="img" ondragstart="return false" style="width:100%;height:98%;"></img>'
|
||||
contentdiv.append(son);
|
||||
var workshopid = $("#pointfunctiondefinition").combobox('getValue');
|
||||
var dates = $("#pointfunctiondefinition").combobox('getData');
|
||||
|
||||
|
||||
} */
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<input id="mids" name="mids" type="hidden" value="" />
|
||||
<tr>
|
||||
<th>测量点ID</th>
|
||||
<td><span >${mPoint.id } </span>
|
||||
<input name="id" type="hidden" value="${mPoint.id }" />
|
||||
</td>
|
||||
<th>测量点Code</th>
|
||||
<td><input id="mpointcode" name="mpointcode" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${mPoint.mpointcode }" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>测量点名称</th>
|
||||
<td><input id="parmname" name="parmname" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${mPoint.parmname }" />
|
||||
</td>
|
||||
<th>测量点启用</th>
|
||||
<td>
|
||||
<select name="active" class="easyui-combobox" data-options="panelHeight:'auto',editable:false,value:'${mPoint.active }',validType:'isBlank'">
|
||||
<option value="${Flag_Enable}">启用</option>
|
||||
<option value="${Flag_Disable}">禁用</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>信号类型</th>
|
||||
<td>
|
||||
<select name="signaltype" class="easyui-combobox" data-options="panelHeight:'auto',editable:false,value:'${mPoint.signaltype }',validType:'isBlank'">
|
||||
<option value="AI">AI</option>
|
||||
<option value="DI">DI</option>
|
||||
</select>
|
||||
</td>
|
||||
<th>信号源</th>
|
||||
<td>
|
||||
<select name="valuetype" class="easyui-combobox" data-options="panelHeight:'auto',editable:false,value:'${mPoint.valuetype }'">
|
||||
<option value="${Flag_Sql}">数据库</option>
|
||||
<option value="${Flag_Modbus}">Modbus</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>单位</th>
|
||||
<td>
|
||||
<input id="unit" name="unit" class="easyui-textbox" value="${mPoint.unit }"/>
|
||||
</td>
|
||||
<th>精度位数</th>
|
||||
<td>
|
||||
<input id="rate" name="rate" class="easyui-textbox" value="${mPoint.rate }"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>作用定义(可自定义)</th>
|
||||
<td>
|
||||
<input id="pointfunctiondefinition" name="pointfunctiondefinition" class="easyui-combobox" />
|
||||
</td>
|
||||
<th>表达式(例:>1,=1,(1-2))</th>
|
||||
<td>
|
||||
<input id="exp" name="exp" class="easyui-textbox" value="${mPoint.exp }"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
<table class="table">
|
||||
|
||||
<tr>
|
||||
<th>报警上限</th>
|
||||
<td>
|
||||
<input id="alarmmax" name="alarmmax" class="easyui-textbox" value="${mPoint.alarmmax }"/>
|
||||
</td>
|
||||
<th>报警下限</th>
|
||||
<td>
|
||||
<input id="alarmmin" name="alarmmin" class="easyui-textbox" value="${mPoint.alarmmin }"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>报警启用</th>
|
||||
<td>
|
||||
<select name="triggeralarm" class="easyui-combobox" data-options="panelHeight:'auto',editable:false,value:'${mPoint.triggeralarm }',validType:'isBlank'">
|
||||
<option value="${Flag_Enable}">启用</option>
|
||||
<option value="${Flag_Disable}">禁用</option>
|
||||
</select>
|
||||
</td>
|
||||
<th>所属车间</th>
|
||||
<td>
|
||||
<input id="scdtype" name="scdtype" class="easyui-combobox" data-options="validType:'isBlank'" value="${mPoint.scdtype }"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Modbus服务器</th>
|
||||
<td>
|
||||
<input id="modbusfigid" name="modbusfigid" class="easyui-combobox" data-options="validType:'isBlank'"value="${mPoint.modbusfigid }"/>
|
||||
</td>
|
||||
<th>寄存器地址</th>
|
||||
<td>
|
||||
<input id="register" name="register" class="easyui-textbox" value="${mPoint.register }"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</br>
|
||||
<div id="m">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
109
bin/WebRoot/jsp/work/mPointForSignalTest.jsp
Normal file
109
bin/WebRoot/jsp/work/mPointForSignalTest.jsp
Normal file
@ -0,0 +1,109 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%@page import="com.sipai.entity.scada.MPoint"%>
|
||||
<%request.setAttribute("Flag_Modbus",MPoint.Flag_Modbus);%>
|
||||
<%request.setAttribute("Flag_Sql",MPoint.Flag_Sql);%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var testFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getRows');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
$('#grid').datagrid({
|
||||
url:ext.contextPath +'/work/mpoint/getvaluefunc.do',
|
||||
queryParams:{ids:datas },
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
/* $.post(ext.contextPath + '/work/mpoint/getvaluefunc.do', {ids : datas}, function(data) {
|
||||
$('#grid').datagrid("loadData",data);
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','通讯成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','通讯失败','info');
|
||||
}
|
||||
}); */
|
||||
};
|
||||
function FormatDate (strTime) {
|
||||
var date = new Date(strTime);
|
||||
return date.Format("yyyy-MM-dd hh:mm:ss");
|
||||
}
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath +'/work/mpoint/getvaluefunc.do',
|
||||
queryParams:{ids:'${ids}' },
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
idField : 'ID',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{width : '100', title : '测量点ID', field : 'id', sortable : true, halign:'center'},
|
||||
{width : '100', title : '测量点Code', field : 'mpointcode', sortable : true, halign:'center'},
|
||||
{width : '150', title : '名称', field : 'parmname', sortable : false, halign:'center'},
|
||||
{width : '120', title : '测量时间', field : 'measuredt', sortable : true, halign:'center', formatter : function(value, row) {
|
||||
return row.measuredt.substring(0,19);
|
||||
|
||||
}},
|
||||
{width : '60', title : '值', field : 'parmvalue', sortable : false, align:'center'},
|
||||
{width : '60', title : '信号源', field : 'valuetype', sortable : true, align:'center', formatter : function(value, row) {
|
||||
if(row.valuetype=='${Flag_Modbus}'){
|
||||
return "Modbus";
|
||||
}else{
|
||||
return "数据库";
|
||||
}
|
||||
|
||||
}},
|
||||
{width : '80', title : '信号类型', field : 'signaltype', sortable : false, align:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
//testFun();
|
||||
}
|
||||
});
|
||||
|
||||
$('#search_pid').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
width:200,
|
||||
onBeforeSelect:function(node){
|
||||
if(node.id=="-1"){
|
||||
$("#search_pid").tree("search_pid");
|
||||
}
|
||||
},
|
||||
editable:false
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
217
bin/WebRoot/jsp/work/mPointList.jsp
Normal file
217
bin/WebRoot/jsp/work/mPointList.jsp
Normal file
@ -0,0 +1,217 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%@page import="com.sipai.entity.scada.MPoint"%>
|
||||
<%request.setAttribute("Flag_Enable",MPoint.Flag_Enable);%>
|
||||
<%request.setAttribute("Flag_Disable",MPoint.Flag_Disable);%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加测量点',
|
||||
width:750,
|
||||
url : ext.contextPath + '/work/mpoint/add.do?iframeId=iframeadd',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeedit',
|
||||
title : '编辑测量点',
|
||||
width:750,
|
||||
url : ext.contextPath + '/work/mpoint/edit.do?iframeId=iframeedit&id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var viewFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
//alert(datas);
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要测试的数据','info');
|
||||
}else{
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '测试信号',
|
||||
url : ext.contextPath + '/work/mpoint/showForSignalTest.do?ids='+datas
|
||||
});
|
||||
}
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/mpoint/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas+=item.id;
|
||||
});
|
||||
//alert(datas);
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/mpoint/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','成功删除'+data+'条记录','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
function FormatDate (strTime) {
|
||||
var date = new Date(strTime);
|
||||
return date.Format("yyyy-MM-dd hh:mm:ss");
|
||||
}
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/mpoint/getlist.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
idField : 'ID',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '测量点ID', field : 'id', sortable : true, halign:'center'},
|
||||
{width : '100', title : '测量点Code', field : 'mpointcode', sortable : true, halign:'center'},
|
||||
{width : '180', title : '名称', field : 'parmname', sortable : false, halign:'center'},
|
||||
{width : '180', title : '测量时间', field : 'measuredt', sortable : true, halign:'center', formatter : function(value, row) {
|
||||
return row.measuredt.substring(0,19);
|
||||
|
||||
}},
|
||||
|
||||
{width : '80', title : '值', field : 'parmvalue', sortable : false, align:'center'},
|
||||
{width : '80', title : '信号类型', field : 'signaltype', sortable : false, align:'center'},
|
||||
{width : '80', title : '启用状态', field : 'active', sortable : false, align:'center', formatter : function(value, row) {
|
||||
if('${Flag_Enable}'==value){
|
||||
return "启用";
|
||||
}else{
|
||||
return "禁用";
|
||||
}
|
||||
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
<%if (sessionManager.havePermission(session,"work/mpoint/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/mpoint/delete.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%if (sessionManager.havePermission(session,"work/group/add.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/group/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true"
|
||||
onclick="viewFun();">测试信号</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>点位名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" /></td>
|
||||
<td>点位编码</td>
|
||||
<td><input id="search_mpointcode" name="search_mpointcode" class="easyui-textbox"/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
95
bin/WebRoot/jsp/work/mPointListForSelect.jsp
Normal file
95
bin/WebRoot/jsp/work/mPointListForSelect.jsp
Normal file
@ -0,0 +1,95 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%@page import="com.sipai.entity.scada.MPoint"%>
|
||||
<%request.setAttribute("Flag_Enable",MPoint.Flag_Enable);%>
|
||||
<%request.setAttribute("Flag_Disable",MPoint.Flag_Disable);%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
function selectOK() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas = '{"id":"'+item.id +'","parmname":"'+item.parmname +'"}';
|
||||
});
|
||||
return JSON.parse(datas);
|
||||
}
|
||||
function FormatDate (strTime) {
|
||||
var date = new Date(strTime);
|
||||
return date.Format("yyyy-MM-dd hh:mm:ss");
|
||||
}
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/mpoint/getlist.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
idField : 'ID',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '测量点ID', field : 'id', sortable : true, halign:'center'},
|
||||
{width : '100', title : '测量点Code', field : 'mpointcode', sortable : true, halign:'center'},
|
||||
{width : '180', title : '名称', field : 'parmname', sortable : false, halign:'center'},
|
||||
{width : '80', title : '信号类型', field : 'signaltype', sortable : false, align:'center'},
|
||||
{width : '80', title : '启用状态', field : 'active', sortable : false, align:'center', formatter : function(value, row) {
|
||||
if('${Flag_Enable}'==value){
|
||||
return "启用";
|
||||
}else{
|
||||
return "禁用";
|
||||
}
|
||||
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>点位名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" /></td>
|
||||
<td>点位编码</td>
|
||||
<td><input id="search_mpointcode" name="search_mpointcode" class="easyui-textbox"/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
139
bin/WebRoot/jsp/work/mPointListForSelects.jsp
Normal file
139
bin/WebRoot/jsp/work/mPointListForSelects.jsp
Normal file
@ -0,0 +1,139 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%@page import="com.sipai.entity.scada.MPoint"%>
|
||||
<%request.setAttribute("Flag_Enable",MPoint.Flag_Enable);%>
|
||||
<%request.setAttribute("Flag_Disable",MPoint.Flag_Disable);%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
function selectFun(dialog, grid) {
|
||||
//清除旧数据
|
||||
var wrows= grid.datagrid("getRows");
|
||||
//复制rows,否则deleteRow的index会出错
|
||||
var copyRows = [];
|
||||
for ( var j= 0; j < wrows.length; j++) {
|
||||
copyRows.push(wrows[j]);
|
||||
}
|
||||
$.each(copyRows, function(index, item){
|
||||
grid.datagrid('deleteRow', grid.datagrid('getRowIndex',copyRows[index]));
|
||||
});
|
||||
var datas = [];
|
||||
//获取选择的元素
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
|
||||
//用数组得到元素对对应的值
|
||||
$.each(checkedItems,function(index, item){
|
||||
datas.push({
|
||||
id: item.id,
|
||||
parmname: item.parmname
|
||||
});
|
||||
});
|
||||
//console.log("dfff",JSON.stringify(datas));
|
||||
//用字符串获取对应的值
|
||||
/*var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
if(datas !=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas = '{"id":"'+item.id +'","parmname":"'+item.parmname +'"}';
|
||||
});
|
||||
datas="["+datas+"]";
|
||||
console.log("dfff",datas); */
|
||||
//把字符串转换成对应的数组
|
||||
return JSON.stringify(datas);
|
||||
}
|
||||
function FormatDate (strTime) {
|
||||
var date = new Date(strTime);
|
||||
return date.Format("yyyy-MM-dd hh:mm:ss");
|
||||
}
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/mpoint/getlist.do?querytype=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '测量点ID', field : 'id', sortable : true, halign:'center'},
|
||||
{width : '100', title : '测量点Code', field : 'mpointcode', sortable : true, halign:'center'},
|
||||
{width : '180', title : '名称', field : 'parmname', sortable : false, halign:'center'},
|
||||
{width : '180', title : '测量时间', field : 'measuredt', sortable : true, halign:'center', formatter : function(value, row) {
|
||||
if(row.measuredt!=null){
|
||||
return FormatDate(row.measuredt.time);
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
|
||||
}},
|
||||
{width : '80', title : '值', field : 'parmvalue', sortable : false, align:'center'},
|
||||
{width : '80', title : '信号类型', field : 'signaltype', sortable : false, align:'center'},
|
||||
{width : '80', title : '启用状态', field : 'active', sortable : false, align:'center', formatter : function(value, row) {
|
||||
if('${Flag_Enable}'==value){
|
||||
return "启用";
|
||||
}else{
|
||||
return "禁用";
|
||||
}
|
||||
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
var mids = localStorage.getItem("mids").split(",");
|
||||
localStorage.removeItem("mids");
|
||||
//console.log("q",mids);
|
||||
$.each(mids, function(index, item){
|
||||
if(item != ""){
|
||||
$('#grid').datagrid("checkRow",$('#grid').datagrid("getRowIndex",item));
|
||||
}
|
||||
});
|
||||
// $('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>点位名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" /></td>
|
||||
<td>点位编码</td>
|
||||
<td><input id="search_mpointcode" name="search_mpointcode" class="easyui-textbox"/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
84
bin/WebRoot/jsp/work/modbusfigAdd.jsp
Normal file
84
bin/WebRoot/jsp/work/modbusfigAdd.jsp
Normal file
@ -0,0 +1,84 @@
|
||||
<!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 + "/work/modbusfig/save.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
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() {
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>服务器名称</th>
|
||||
<td><input name="name" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
<th>启用</th>
|
||||
<td>
|
||||
<select name="flag" class="easyui-combobox" data-options="panelHeight:'auto',editable:false,value:'启用'">
|
||||
<option value="启用">启用</option>
|
||||
<option value="禁用">禁用</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>服务器IP</th>
|
||||
<td><input name="ipsever" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
<th>端口号</th>
|
||||
<td><input name="port" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="502" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>站地址</th>
|
||||
<td><input name="slaveid" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
<th>数据高低位存储方式</th>
|
||||
<td>
|
||||
<select name="order32" class="easyui-combobox" data-options="panelHeight:'auto',editable:false,value:'4321'">
|
||||
<option value="4321">FFH4 FFH3 FFH2 FFH1</option>
|
||||
<option value="3412">FFH3 FFH4 FFH1 FFH2</option>
|
||||
<option value="1234">FFH1 FFH2 FFH3 FFH4</option>
|
||||
<option value="2143">FFH2 FFH1 FFH4 FFH3</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td colspan="3">
|
||||
<input name="remarks" class="easyui-textbox" style="width:100%;height:100px" value=""
|
||||
data-options="multiline:true" validtype="length[0,250]" invalidMessage="有效长度0-250" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
85
bin/WebRoot/jsp/work/modbusfigEdit.jsp
Normal file
85
bin/WebRoot/jsp/work/modbusfigEdit.jsp
Normal file
@ -0,0 +1,85 @@
|
||||
<!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 + "/work/modbusfig/update.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
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() {
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" name="id" value="${modbusFig.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>服务器名称</th>
|
||||
<td><input name="name" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${modbusFig.name}" />
|
||||
</td>
|
||||
<th>启用</th>
|
||||
<td>
|
||||
<select name="flag" class="easyui-combobox" data-options="panelHeight:'auto',editable:false,value:'${modbusFig.flag}'">
|
||||
<option value="启用">启用</option>
|
||||
<option value="禁用">禁用</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>服务器IP</th>
|
||||
<td><input name="ipsever" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${modbusFig.ipsever}" />
|
||||
</td>
|
||||
<th>端口号</th>
|
||||
<td><input name="port" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${modbusFig.port}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>站地址</th>
|
||||
<td><input name="slaveid" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${modbusFig.slaveid}" />
|
||||
</td>
|
||||
<th>数据高低位存储方式</th>
|
||||
<td>
|
||||
<select name="order32" class="easyui-combobox" data-options="panelHeight:'auto',editable:false,value:'${modbusFig.order32}'">
|
||||
<option value="4321">FFH4 FFH3 FFH2 FFH1</option>
|
||||
<option value="3412">FFH3 FFH4 FFH1 FFH2</option>
|
||||
<option value="1234">FFH1 FFH2 FFH3 FFH4</option>
|
||||
<option value="2143">FFH2 FFH1 FFH4 FFH3</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td colspan="3">
|
||||
<textarea name="remarks" class="easyui-textbox" data-options="multiline:true"
|
||||
style="width:100%;height:100px" validtype="length[0,250]" invalidMessage="有效长度0-250">${modbusFig.remarks}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
182
bin/WebRoot/jsp/work/modbusfigList.jsp
Normal file
182
bin/WebRoot/jsp/work/modbusfigList.jsp
Normal file
@ -0,0 +1,182 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加Modbus服务器信息',
|
||||
url : ext.contextPath + '/work/modbusfig/add.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑Modbus服务器信息',
|
||||
url : ext.contextPath + '/work/modbusfig/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/modbusfig/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var testFun = function(id) {
|
||||
$.post(ext.contextPath + '/work/modbusfig/testfun.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','通讯成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','通讯失败','info');
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
//alert(datas);
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/modbusfig/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','成功删除'+data+'条记录','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/modbusfig/getlist.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '名称', field : 'name', sortable : true, halign:'center',align:'center'},
|
||||
{width : '180', title : '服务器地址', field : 'ipsever', sortable : true, halign:'center',align:'center'},
|
||||
{width : '100', title : '站地址', field : 'slaveid', sortable : true, halign:'center',align:'center'},
|
||||
{width : '180', title : '寄存器数据存储方式', field : 'order32', sortable : true, halign:'center',align:'center'},
|
||||
{width : '180', title : '备注', field : 'remarks', sortable : true, halign:'center',align:'center'},
|
||||
{width : '100', title : '启动', field : 'flag', halign:'center',align:'center'},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
<%if (sessionManager.havePermission(session,"work/modbusfig/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/modbusfig/delete.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
str += '<img class="iconImg ext-icon-wrench" title="测试" onclick="testFun(\''+row.id+'\');"/>';
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%if (sessionManager.havePermission(session,"work/workstation/add.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/workstation/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>服务器名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" /></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
89
bin/WebRoot/jsp/work/modbusfigListForSelect.jsp
Normal file
89
bin/WebRoot/jsp/work/modbusfigListForSelect.jsp
Normal file
@ -0,0 +1,89 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function selectFun() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas = '{"id":"'+item.id +'","serial":"'+item.serial +'",'+
|
||||
'"name":"'+item.name +'","typename":"'+item.typename +'",'+
|
||||
'"deptname":"'+item.deptname +'","linename":"'+item.linename +'"}';
|
||||
});
|
||||
return $.parseJSON(datas);
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workstation/getlist.do?querytype=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '工位编号', field : 'serial', sortable : true, halign:'center'},
|
||||
{width : '100', title : '工位名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '180', title : '工位类型', field : 'typename', sortable : true, halign:'center'},
|
||||
{width : '180', title : '所属车间', field : 'deptname', sortable : true, halign:'center'},
|
||||
{width : '180', title : '所属产线', field : 'linename', sortable : true, halign:'center'},
|
||||
{width : '180', title : '工位概述', field : 'intro', halign:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar'
|
||||
});
|
||||
|
||||
$('#search_line').combobox({
|
||||
url : ext.contextPath + '/work/line/getSelectList.do?random=' + Math.random(),
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
width:250,
|
||||
panelHeight:'auto',
|
||||
editable:false
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>工位名称</td>
|
||||
<td><input id="search_name" name="search_name" class="easyui-textbox" /></td>
|
||||
<td>所属产线</td>
|
||||
<td><input id="search_line" name="search_line" class="easyui-combobox"/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#search_name').textbox('setValue','');$('#search_line').combobox('setValue','');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
108
bin/WebRoot/jsp/work/procedWorkstationListForSelects.jsp
Normal file
108
bin/WebRoot/jsp/work/procedWorkstationListForSelects.jsp
Normal file
@ -0,0 +1,108 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function selectFun(dialog, grid) {
|
||||
//清除旧数据
|
||||
var wrows= grid.datagrid("getRows");
|
||||
//复制rows,否则deleteRow的index会出错
|
||||
var copyRows = [];
|
||||
for ( var j= 0; j < wrows.length; j++) {
|
||||
copyRows.push(wrows[j]);
|
||||
}
|
||||
$.each(copyRows, function(index, item){
|
||||
grid.datagrid('deleteRow', grid.datagrid('getRowIndex',copyRows[index]));
|
||||
});
|
||||
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas += '{"id":"'+item.id +'","serial":"'+item.serial +'",'+
|
||||
'"name":"'+item.name +'","typename":"'+item.typename +'",'+
|
||||
'"deptname":"'+item.deptname +'","linename":"'+item.linename +'"},';
|
||||
});
|
||||
datas = '{"res":['+datas.replace(/,$/gi,"")+']}';
|
||||
return $.parseJSON(datas);
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workstation/getlist.do?querytype=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '160', title : '工位编号', field : 'serial', sortable : true, halign:'center'},
|
||||
{width : '240', title : '工位名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '80', title : '工位类型', field : 'typename', sortable : true, halign:'center'},
|
||||
{width : '180', title : '所属车间', field : 'deptname', sortable : true, halign:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess:function(data){
|
||||
var wids = localStorage.getItem("wids").split(",");
|
||||
localStorage.removeItem("wids");
|
||||
$.each(wids, function(index, item){
|
||||
if(item != ""){
|
||||
$('#grid').datagrid("checkRow",$('#grid').datagrid("getRowIndex",item));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#search_dept').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
onBeforeSelect:function(node){
|
||||
if(node.id=="-1"){
|
||||
$("#deptid").tree("unselect");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>工位名称</td>
|
||||
<td><input id="search_name" name="search_name" class="easyui-textbox" /></td>
|
||||
<td>所属车间</td>
|
||||
<td><input id="search_dept" name="search_dept" class="easyui-combotree"/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#search_name').textbox('setValue','');$('#search_line').combobox('setValue','');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
121
bin/WebRoot/jsp/work/procedureListForSelects.jsp
Normal file
121
bin/WebRoot/jsp/work/procedureListForSelects.jsp
Normal file
@ -0,0 +1,121 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function selectFun(dialog, grid) {
|
||||
//清除旧数据
|
||||
var wrows= grid.datagrid("getRows");
|
||||
//复制rows,否则deleteRow的index会出错
|
||||
var copyRows = [];
|
||||
for ( var j= 0; j < wrows.length; j++) {
|
||||
copyRows.push(wrows[j]);
|
||||
}
|
||||
$.each(copyRows, function(index, item){
|
||||
grid.datagrid('deleteRow', grid.datagrid('getRowIndex',copyRows[index]));
|
||||
});
|
||||
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas += '{"id":"'+item.id +'","procedurename":"'+item.procedurename +'",'+
|
||||
'"procedurecode":"'+item.procedurecode +'","keywords":"'+item.keywords +'",'+
|
||||
'"type":"'+item.type +'","semiflag":"'+item.semiflag +'"},';
|
||||
});
|
||||
datas = '{"res":['+datas.replace(/,$/gi,"")+']}';
|
||||
return $.parseJSON(datas);
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/process/taskprocedure/getlist.do?querytype=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
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){
|
||||
var wids = localStorage.getItem("wids").split(",");
|
||||
localStorage.removeItem("wids");
|
||||
$.each(wids, function(index, item){
|
||||
if(item != ""){
|
||||
$('#grid').datagrid("checkRow",$('#grid').datagrid("getRowIndex",item));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#search_dept').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
onBeforeSelect:function(node){
|
||||
if(node.id=="-1"){
|
||||
$("#deptid").tree("unselect");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>工位名称</td>
|
||||
<td><input id="search_name" name="search_name" class="easyui-textbox" /></td>
|
||||
<td>所属车间</td>
|
||||
<td><input id="search_dept" name="search_dept" class="easyui-combotree"/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#search_name').textbox('setValue','');$('#search_line').combobox('setValue','');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
41
bin/WebRoot/jsp/work/realDetailsSnakerList.jsp
Normal file
41
bin/WebRoot/jsp/work/realDetailsSnakerList.jsp
Normal file
@ -0,0 +1,41 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<html>
|
||||
<head>
|
||||
<title>工艺流程</title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script src="<%=contextPath%>/JS/raphael-min.js" type="text/javascript"></script>
|
||||
<script src="<%=contextPath%>/JS/snaker/extends/snaker.designer.select.js" type="text/javascript"></script>
|
||||
<script src="<%=contextPath%>/JS/snaker/snaker.model.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
var json="${process }";
|
||||
var model;
|
||||
if(json) {
|
||||
model=eval("(" + json + ")");
|
||||
} else {
|
||||
model="";
|
||||
}
|
||||
$('#snakerflow').snakerflow({
|
||||
basePath : ext.contextPath+"/JS/snaker/",
|
||||
restore : model,
|
||||
title:"工序",
|
||||
modalDialogWidth:"1000",
|
||||
modalDialogHeight:"600",
|
||||
url:ext.contextPath + "/process/realDetails/editSnaker.do?pid=${param.id}"
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="snakerflow"></div>
|
||||
</body>
|
||||
</html>
|
||||
269
bin/WebRoot/jsp/work/report/dailyReport.jsp
Normal file
269
bin/WebRoot/jsp/work/report/dailyReport.jsp
Normal file
@ -0,0 +1,269 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" import="java.util.*" pageEncoding="UTF-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%@page import="com.sipai.entity.plan.DailyPlanTaskDemand"%>
|
||||
<%request.setAttribute("Flag_Start",DailyPlanTaskDemand.Flag_Start);%>
|
||||
<%request.setAttribute("Flag_Report",DailyPlanTaskDemand.Flag_Report);%>
|
||||
<%request.setAttribute("Flag_CarryOver",DailyPlanTaskDemand.Flag_CarryOver);%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<script type="text/javascript" src="<%=contextPath%>/JS/print.js" charset="utf-8"></script>
|
||||
<%-- 引入js --%>
|
||||
<%-- <script type="javascript" src="<%=contextPath%>/JS/jquery.jqprint-0.3.js" charset="utf-8"></script> --%>
|
||||
<style type="text/css">
|
||||
.subtotal { font-weight: bold; }/*合计单元格样式*/
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var viewFun = function(id) {
|
||||
grid.datagrid('clearChecked');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看检验单信息',
|
||||
width:950,
|
||||
url : ext.contextPath + '/quality/statistics_CI/viewCISub.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑',
|
||||
width:950,
|
||||
url : ext.contextPath + '/quality/statistics_CI/editCISub.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/quality/statistics_CI/deleteCISub.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','删除成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
top.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/quality/statistics_CI/deletesCISub.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
top.$.messager.alert('提示','成功删除'+data+'条记录','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
// 日期,在原有日期基础上,增加days天数,默认增加1天
|
||||
function addDate(date, hours) {
|
||||
if (hours == undefined || hours == '') {
|
||||
hours = 2;
|
||||
}
|
||||
var date = new Date(date);
|
||||
date.setHours(date.getHours() + hours);
|
||||
var month = date.getMonth() + 1;
|
||||
var day = date.getDate();
|
||||
var h = date.getHours();
|
||||
var mm = date.getMinutes();
|
||||
return date.getFullYear() + '-' + getFormatDate(month) + '-' + getFormatDate(day)+' '+getFormatDate(h)+':'+getFormatDate(mm);
|
||||
}
|
||||
|
||||
// 日期月份/天的显示,如果是1位数,则在前面加上'0'
|
||||
function getFormatDate(arg) {
|
||||
if (arg == undefined || arg == '') {
|
||||
return '00';
|
||||
}
|
||||
|
||||
var re = arg + '';
|
||||
if (re.length < 2) {
|
||||
re = '0' + re;
|
||||
}
|
||||
|
||||
return re;
|
||||
}
|
||||
function onchangedate(){
|
||||
var date=$("#nowdate").val();
|
||||
}
|
||||
function printFun(){
|
||||
var caption="("+$("#nowdate").val()+")生产日报"
|
||||
CreateFormPage(caption,$("#grid"));
|
||||
/* $("#print").jqprint({debug: false,
|
||||
importCSS: true,
|
||||
printContainer: true,
|
||||
operaSupport: false }); */
|
||||
}
|
||||
//工单结转
|
||||
var docarryover=function(workorderno,taskcode){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '工单结转',
|
||||
width: 400,
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workorder/showworkorder_carryover.do?taskcode='+taskcode+'&workorderno='+workorderno+'&status=${Flag_CarryOver}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
||||
//dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
function loadgridItems(){
|
||||
var dt=$('#nowdate').val();
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/report/getDailyReport.do?dt='+dt,
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{width : '100', title : '工单编号', field: 'workorderno', halign:'center' , align:'center',formatter :function(value,row){
|
||||
var rowvalue=row.workOrder.workorderno;
|
||||
row.workorderno=rowvalue;
|
||||
return rowvalue;
|
||||
}},
|
||||
{width : '160', title : '产品编码', field: 'materialcode', halign:'center' , align:'center',formatter :function(value,row){
|
||||
var rowvalue=row.prodtask.materialcode;
|
||||
row.materialcode=rowvalue;
|
||||
return rowvalue;
|
||||
}},
|
||||
{width : '180', title : '产品名称', field : 'materialname', halign:'center' , align:'center',formatter :function(value,row){
|
||||
var rowvalue=row.prodtask.materialname;
|
||||
row.materialname=rowvalue;
|
||||
return rowvalue;
|
||||
}},
|
||||
{width : '80', title : '计划产量', field: 'preamount', halign:'center' , align:'center'},
|
||||
{width : '80', title : '计划良率', field: 'preyield', halign:'center', align:'center'},
|
||||
{width : '80', title : '实际产量', field: 'actamount', halign:'center',align:'center' },
|
||||
{width : '80', title : '实际良率', field: 'actyield', halign:'center', align:'center'},
|
||||
{width : '120', title : '计划完成时间', field: 'proeddt', halign:'center', align:'center',formatter :function(value,row){
|
||||
var rowvalue=row.workOrder.eddt.substring(0,10);
|
||||
row.proeddt=rowvalue;
|
||||
return rowvalue;
|
||||
}},
|
||||
{width : '120', title : '实际完成时间', field: 'acteddt', halign:'center', align:'center',formatter :function(value,row){
|
||||
var rowvalue="";
|
||||
|
||||
if('${Flag_CarryOver}'==row.status){
|
||||
rowvalue=row.workOrder.eddt.substring(0,10);
|
||||
}
|
||||
row.acteddt=rowvalue;
|
||||
return rowvalue;
|
||||
|
||||
}},
|
||||
{width : '80', title : '状态', field: 'status', halign:'center', align:'center', formatter : function(value, row){
|
||||
var rowvalue="";
|
||||
switch(value){
|
||||
case '${Flag_Start}': rowvalue= "已开工";break;
|
||||
case '${Flag_Report}': rowvalue ="已报工";break;
|
||||
case '${Flag_CarryOver}': rowvalue ="已结转";break;
|
||||
default:rowvalue= "待开工";
|
||||
}
|
||||
row.status=rowvalue;
|
||||
return rowvalue;
|
||||
} ,sortable:false},
|
||||
{width : '80', title : '结转', field : 'action', align:'center', formatter : function(value, row) {
|
||||
row.action="";
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table_relationship" title="结转" onclick="docarryover(\''+row.workOrder.workorderno+'\',\''+row.taskcode+'\');"/> ';
|
||||
return str;
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
}
|
||||
$(function() {
|
||||
|
||||
loadgridItems();
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table>
|
||||
<tr>
|
||||
<td>日期</td>
|
||||
<td><input id="nowdate" name="nowdate" class="Wdate" value="${dt }" style="width: 180px;"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',onpicked:onchangedate})"
|
||||
></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="loadgridItems('','');">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-print',plain:true"
|
||||
onclick="printFun();">打印</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="print" data-options="region:'center',border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
564
bin/WebRoot/jsp/work/scadapic/picView.jsp
Normal file
564
bin/WebRoot/jsp/work/scadapic/picView.jsp
Normal file
@ -0,0 +1,564 @@
|
||||
<%@page import="com.sipai.entity.work.ScadaPic_Txt"%>
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCard"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<% request.setAttribute("Flag_Txt", ScadaPic_Txt.Flag_Txt);%>
|
||||
<% request.setAttribute("Flag_MPoint", ScadaPic_Txt.Flag_MPoint);%>
|
||||
<% request.setAttribute("Flag_EM", ScadaPic_Txt.Flag_EM);%>
|
||||
|
||||
|
||||
<%request.setAttribute("Status_Fault",EquipmentCard.Status_Fault);%>
|
||||
<%request.setAttribute("Status_OFF",EquipmentCard.Status_OFF);%>
|
||||
<%request.setAttribute("Status_ON",EquipmentCard.Status_ON);%>
|
||||
<%request.setAttribute("Status_StandBy",EquipmentCard.Status_StandBy);%>
|
||||
<%request.setAttribute("Status_UnMathch",EquipmentCard.Status_UnMathch);%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
//为保存布局
|
||||
function setdata() {
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
for(var i=0;i<obj.length;i++){
|
||||
//console.info(obj[i].className.indexOf("easyui-draggable"));
|
||||
if(obj[i].className.indexOf("easyui-draggable")>=0){
|
||||
console.info(obj[i].style.width);
|
||||
$.post(ext.contextPath + '/work/scadaPic/updateLayout.do', {type:obj[i].getAttribute("type"), id:obj[i].id , posx:obj[i].style.left , posy:obj[i].style.top,
|
||||
containerWidth:obj[i].parentNode.style.width,containerHeight:obj[i].parentNode.style.height,
|
||||
width:obj[i].style.width,height:obj[i].style.height}, function(data) {
|
||||
if(data.res!=1){
|
||||
top.$.messager.alert('提示','更新失败','info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addmp(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加测量点',
|
||||
width:600,
|
||||
height:400,
|
||||
url : ext.contextPath + '/work/scadaPic/addMPoint.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showMPoint();
|
||||
}
|
||||
});
|
||||
}
|
||||
function addequ(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加设备',
|
||||
width:600,
|
||||
height:400,
|
||||
url : ext.contextPath + '/work/scadaPic/addEM.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showEM();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addtext(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加文本',
|
||||
url : ext.contextPath + '/work/scadaPic/addTxt.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showTxt();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<input type="hidden" name="clientWidth" value="${clientWidth}">
|
||||
<input type="hidden" name="picid" value="${clientWidth}">
|
||||
<div id="toolbar" style="display: none;" data-options="region:'north',border:false">
|
||||
<table >
|
||||
<tr >
|
||||
<th>车间</th>
|
||||
<td ><input id="workshopid" name="workshopid" class="easyui-combobox" data-options="required:true,validType:'isBlank'" style="width: 180px;"/></td>
|
||||
<td style="vertical-align: middle">
|
||||
<div id="result">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td align="right" style="padding-left:10px;padding-right:10px">
|
||||
</td>
|
||||
<td width="5">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div >
|
||||
<div id ="content" data-options="region:'center',fit:true,border:false" >
|
||||
|
||||
</div>
|
||||
<div id="mTxt" class="easyui-menu" data-options="onClick:txtMenuHandler" style="width:120px;">
|
||||
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
||||
<div data-options="name:'help',iconCls:'icon-help'">属性</div>
|
||||
</div>
|
||||
<div id="mPoint" class="easyui-menu" data-options="onClick:mPointMenuHandler" style="width:120px;">
|
||||
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
||||
<div data-options="name:'help',iconCls:'icon-help'">属性</div>
|
||||
</div>
|
||||
<div id="mEM" class="easyui-menu" data-options="onClick:mEMMenuHandler" style="width:120px;">
|
||||
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
||||
<div data-options="name:'help',iconCls:'icon-help'">属性</div>
|
||||
</div>
|
||||
<script>
|
||||
var contentdiv=$("#content");
|
||||
$(function(){
|
||||
window.onresize = changesize;
|
||||
$("#workshopid").combobox({
|
||||
url : ext.contextPath + '/work/workshop/getlist4Combo.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onSelect: function () {
|
||||
contentdiv.empty();
|
||||
|
||||
var son='<img id="img" ondragstart="return false" style="width:100%;height:98%;"></img>'
|
||||
contentdiv.append(son);
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dates = $("#workshopid").combobox('getData');
|
||||
|
||||
for (var i=0;i< dates.length;i++) {
|
||||
//console.info(dates[i].id)
|
||||
if (dates[i].id == workshopid) {
|
||||
var abspath=dates[i].commonFile.abspath;
|
||||
abspath=abspath.substring(abspath.indexOf("webapps")+8);
|
||||
//abspath.replace("//","/");
|
||||
//alert(abspath)
|
||||
$("#img").attr("src","../../../"+abspath);
|
||||
showTxt();
|
||||
showMPoint();
|
||||
showEM();
|
||||
//showEMInfo();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
//开启定时器刷新
|
||||
startClock();
|
||||
MpPics =JSON.parse(getMpPic());
|
||||
|
||||
});
|
||||
function startClock(){
|
||||
myrefresh();
|
||||
setTimeout('startClock()',5000);
|
||||
}
|
||||
|
||||
function myrefresh()
|
||||
{
|
||||
//contentdiv.empty();
|
||||
showTxt();
|
||||
showMPoint();
|
||||
showEM();
|
||||
}
|
||||
|
||||
//清除原先点
|
||||
function clearItem(type) {
|
||||
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
//循环逆序删除
|
||||
for(var i=obj.length-1;i>0;i--){
|
||||
//console.info(obj[i].className.indexOf("easyui-draggable"));
|
||||
//console.info(obj[i].getAttribute("type"));
|
||||
if(obj[i].className.indexOf("easyui-draggable")>=0 && obj[i].getAttribute("type")==type){
|
||||
//console.info(obj[i]);
|
||||
obj[i].remove();
|
||||
}
|
||||
}
|
||||
//console.log(obj.length)
|
||||
}
|
||||
|
||||
var firstOnResizeFire = true;//谷歌浏览器onresize事件会执行2次,这里加个标志位控制
|
||||
var containerWidth = 0;
|
||||
var containerHeight = 0;
|
||||
var selectid=""; //记录右键时,指向的对象
|
||||
function changesize(){
|
||||
if (firstOnResizeFire) {
|
||||
firstOnResizeFire = false;
|
||||
adjuest();
|
||||
//0.5秒之后将标志位重置(Chrome的window.onresize默认执行两次)
|
||||
setTimeout(function() {
|
||||
firstOnResizeFire = true;
|
||||
}, 500);
|
||||
}
|
||||
|
||||
}
|
||||
function adjuest(){
|
||||
var obj = contentdiv.find("div");
|
||||
var width =document.body.clientWidth;//onresize方法测试时,只有body的clientwidth是改变后的值
|
||||
var height =document.body.clientHeight// $("#content").height();
|
||||
for(var i=0;i<obj.length;i++){
|
||||
if(obj[i].className.indexOf("easyui-draggable")>=0){
|
||||
|
||||
var jobj=$("#"+obj[i].id);
|
||||
//console.info("新对象",jobj.position().left);
|
||||
var left=width*jobj.position().left/containerWidth;
|
||||
var top=height*jobj.position().top/containerHeight;
|
||||
//console.info("新左距离",left);
|
||||
jobj.css("left",left);
|
||||
jobj.css("top",top);
|
||||
//console.info("文本的左距离",jobj.position().left);
|
||||
//console.info("容器的宽度",width);
|
||||
//console.info("body的宽度",);
|
||||
|
||||
}
|
||||
if(obj[i].className.indexOf("easyui-resizable")>=0){
|
||||
|
||||
var jobj=$("#"+obj[i].id);
|
||||
//console.info("新对象",jobj.width());
|
||||
var w=width*jobj.width()/containerWidth;
|
||||
var h=height*jobj.height()/containerHeight;
|
||||
//console.info("新左距离",left);
|
||||
jobj.css("width",w);
|
||||
jobj.css("height",h);
|
||||
//console.info("文本的左距离",jobj.position().left);
|
||||
//console.info("容器的宽度",width);
|
||||
//console.info("body的宽度",);
|
||||
|
||||
}
|
||||
}
|
||||
//
|
||||
containerWidth =width;
|
||||
containerHeight=height;
|
||||
}
|
||||
function showTxt(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
$.post(ext.contextPath + "/work/scadaPic/getTxtList.do", {pid:workshopid}, function(data) {
|
||||
clearItem("${Flag_Txt}");
|
||||
//console.info(data)
|
||||
if (data.length>0) {
|
||||
for(i=0 ;i<data.length;i++){
|
||||
var item= data[i];
|
||||
containerWidth = contentdiv.width();
|
||||
containerHeight = contentdiv.height();
|
||||
|
||||
var left=containerWidth*item.posx/item.containerwidth;
|
||||
var top=containerHeight*item.posy/item.containerheight;
|
||||
var son= '<div class="easyui-draggable" style="background-color:green;width:100px;height:20px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_Txt}">'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
item.content+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
|
||||
/* $('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mTxt').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
}); */
|
||||
//$('#'+item.id).draggable()
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
function txtMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteTxt.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
$('#'+selectid).remove();
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
var MpPics;
|
||||
function showMPoint(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
$.post(ext.contextPath + "/work/scadaPic/getMPointList.do", {pid:workshopid}, function(data) {
|
||||
//console.info(data)
|
||||
clearItem("${Flag_MPoint}");
|
||||
if (data.length>0) {
|
||||
for(i=0 ;i<data.length;i++){
|
||||
var item= data[i];
|
||||
containerWidth = contentdiv.width();
|
||||
containerHeight = contentdiv.height();
|
||||
|
||||
var left=containerWidth*item.posx/item.containerwidth;
|
||||
var top=containerHeight*item.posy/item.containerheight;
|
||||
var son="";
|
||||
//console.log((item.mPoint.exp))
|
||||
if(item.expressionflag!=null && item.expressionflag ){
|
||||
var path;
|
||||
if(item.mPoint==null || item.mPoint.exp ==null || item.mPoint.exp==""){
|
||||
path="";
|
||||
}else{
|
||||
path= MpPics[parseInt(item.mPoint.exp)].path;
|
||||
}
|
||||
son= '<div class="easyui-draggable" style="width:40px;height:40px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_MPoint}">'+
|
||||
'<img src=../../'+path+' style="width:20px;height:20px;" ></img>'+
|
||||
'</div>';
|
||||
}else{
|
||||
var value ="";
|
||||
if(item.mPoint!=null){
|
||||
value=item.mPoint.parmvalue
|
||||
}
|
||||
son= '<div class="easyui-draggable" style="background-color:blue;width:150px;height:40px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_MPoint}">'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
item.txt+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
value+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
}
|
||||
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
|
||||
/* $('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mPoint').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
}); */
|
||||
//$('#'+item.id).draggable()
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
function mPointMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteMPoint.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
$('#'+selectid).remove();
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
function showEM(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
|
||||
$.post(ext.contextPath + "/work/scadaPic/getEMList.do", {pid:workshopid}, function(data) {
|
||||
//console.info(data)
|
||||
clearItem("${Flag_EM}");
|
||||
if (data.length>0) {
|
||||
for(i=0 ;i<data.length;i++){
|
||||
var item= data[i];
|
||||
containerWidth = contentdiv.width();
|
||||
containerHeight = contentdiv.height();
|
||||
|
||||
var left=containerWidth*item.posx/item.containerwidth;
|
||||
var top=containerHeight*item.posy/item.containerheight;
|
||||
var w=containerWidth*item.width/item.containerwidth;
|
||||
var h=containerHeight*item.height/item.containerheight;
|
||||
var son= '<div class="easyui-draggable easyui-resizable" style="border:1px solid yellow;width:'+w+'px;height:'+h+'px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_EM}" equipid='+item.equipid+'>'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
''+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
/* $('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mEM').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
}); */
|
||||
//$('#'+item.id).draggable()
|
||||
//$('#'+item.id).resizable()
|
||||
$('#'+item.id).click(function(){
|
||||
//console.info(this)
|
||||
showEMInfo(this.getAttribute("equipid"));
|
||||
//console.info(this)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
};
|
||||
function showEMInfo(str){
|
||||
$.post(ext.contextPath + "/equipment/getEquipmentCardInfo.do", {id:str}, function(data) {
|
||||
//console.info(data)
|
||||
var sons;
|
||||
if (data !=null) {
|
||||
sons= '<div id ="equipInfo" style="border:1px solid yellow;background-color:black;position:absolute;width: 180px;height:200px;top:0px;left:0px">'+
|
||||
'<table id="info" style="font-size:12px" >'+
|
||||
'<tr align="left">'+
|
||||
'<td ><span style="color:white;">设备名称:'+data.equipmentname+'</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="left">'+
|
||||
'<td ><span style="color:white;">状态:'+getEquStatus(data.equipmentstatus)+'</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="left">'+
|
||||
'<td ><span style="color:white;">排产情况:</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="left">'+
|
||||
'<td ><span style="color:white;">'+
|
||||
getInfoFromArrangement(data.equipmentArrangements)+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'<div id ="arrangeInfo" >'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
|
||||
}
|
||||
//console.info(sons)
|
||||
//if(!$("#equipInfo")){
|
||||
$("#equipInfo").remove();
|
||||
//}
|
||||
contentdiv.append(sons);
|
||||
//showArrangeGrid(data.id,"2017-10-13");
|
||||
},'json');
|
||||
|
||||
|
||||
};
|
||||
function getEquStatus(statuscode){
|
||||
switch(statuscode){
|
||||
case '${Status_Fault}':
|
||||
return '故障';
|
||||
break;
|
||||
case '${Status_OFF}':
|
||||
return '停机';
|
||||
break;
|
||||
case '${Status_ON}':
|
||||
return '运行中';
|
||||
break;
|
||||
case '${Status_StandBy}':
|
||||
return '待机';
|
||||
break;
|
||||
case '${Status_UnMathch}':
|
||||
return '未匹配测量点';
|
||||
break;
|
||||
}
|
||||
}
|
||||
function mEMMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteEM.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
$('#'+selectid).remove();
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
||||
function getInfoFromArrangement(arrangement){
|
||||
var str ="";
|
||||
var workorderno="";
|
||||
$.each(arrangement, function(index, item){
|
||||
//console.log(item);
|
||||
if(str !=""){
|
||||
str+="<br />";
|
||||
}
|
||||
if(workorderno!=item._workorderno){
|
||||
workorderno=item._workorderno;
|
||||
str=str+"工单:"+workorderno+"<br />";
|
||||
}
|
||||
|
||||
|
||||
if(item.checkFlag){
|
||||
str+= item.gt_name+": "+ item.stdt.substring(11,16)+" ~ "+item.enddt.substring(11,16);
|
||||
}
|
||||
});
|
||||
//alert(JSON.stringify(arrangement))
|
||||
//alert(str)
|
||||
//console.info(arrangement)
|
||||
return str;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
752
bin/WebRoot/jsp/work/scadapic/picView111.jsp
Normal file
752
bin/WebRoot/jsp/work/scadapic/picView111.jsp
Normal file
@ -0,0 +1,752 @@
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
function getme(id,pid,name,type){
|
||||
if(type=='m3'){
|
||||
window.location="scadapicaction.do?method=picdesign&type=0&picid="+id+"&bizid="+pid+"&clientWidth=${clientWidth+20}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getdataV2() {
|
||||
mpxmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
//var cobj= document.getElementById(obj[i].name);
|
||||
mpxmlhttp.open("POST",encodeURI(encodeURI("UnitPointAction.do?method=updatepic&type=1&clientWidth=${clientWidth}&picid=${cp.id}")),true);
|
||||
mpxmlhttp.setrequestheader("content-length", 0);
|
||||
mpxmlhttp.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
mpxmlhttp.send(true);
|
||||
mpxmlhttp.onreadystatechange = function(){
|
||||
phasex();
|
||||
}
|
||||
}
|
||||
|
||||
/* updateall();
|
||||
setInterval("updateall()",30000); */
|
||||
|
||||
|
||||
function getdataV2() {
|
||||
mpxmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
//var cobj= document.getElementById(obj[i].name);
|
||||
mpxmlhttp.open("POST",encodeURI(encodeURI("UnitPointAction.do?method=updatepic&type=0&clientWidth=${clientWidth}&picid=${cp.id}")),true);
|
||||
mpxmlhttp.setrequestheader("content-length", 0);
|
||||
mpxmlhttp.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
mpxmlhttp.send(true);
|
||||
mpxmlhttp.onreadystatechange = function(){
|
||||
phasex();
|
||||
}
|
||||
}
|
||||
|
||||
function phasex(){
|
||||
if(mpxmlhttp.readyState==4){
|
||||
if(mpxmlhttp.status==200){
|
||||
var res = mpxmlhttp.responseText;
|
||||
//alert(res);
|
||||
var aa = res.split("|");
|
||||
//alert(aa);
|
||||
for(var i=0;i<aa.length;i++){
|
||||
if(aa[i].Trim().length>0){
|
||||
var bb = aa[i].split(",");
|
||||
//alert(bb);
|
||||
var divo = document.getElementById(bb[0]);
|
||||
//alert(divo.name);
|
||||
var mpid=document.getElementsByName(divo.id+divo.name);
|
||||
for(var j=0;j<mpid.length;j++){
|
||||
//alert(mpid[j].tagName);
|
||||
if(mpid[j].tagName=="DIV"){
|
||||
//alert(j);
|
||||
mpid[j].innerHTML=bb[1];
|
||||
|
||||
}
|
||||
}
|
||||
if(divo.className=='equdiv'){
|
||||
//alert(bb[2]);
|
||||
//var cc = bb[2].split("$");
|
||||
//alert(cc[2]);
|
||||
if(bb[3]){
|
||||
//alert('a');
|
||||
mpid[0].parentElement.parentElement.nextSibling.firstChild.innerText=bb[3];
|
||||
divo.firstChild.style.backgroundColor="#FFFF00"
|
||||
}else{
|
||||
//alert('b');
|
||||
//alert(mpid[0].parentElement.tagName);
|
||||
//alert(mpid);
|
||||
mpid[0].parentElement.parentElement.nextSibling.firstChild.innerText="";
|
||||
divo.firstChild.style.backgroundColor="#c5c5c5";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function searchSelect(o){
|
||||
window.location="scadapicaction.do?method=picdesign&type=0&picid="+o+"&bizid=${bizid}&clientWidth=${clientWidth+20}";
|
||||
}
|
||||
|
||||
function mpcopy(){
|
||||
var xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var se = document.getElementById('frompicid');
|
||||
var post = " ";
|
||||
xmlobj.open("POST","scadapicaction.do?method=piccopy&topicid=${cp.id}&frompicid="+se.value,true);
|
||||
xmlobj.setrequestheader("content-length", post.length);
|
||||
xmlobj.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xmlobj.send(post);
|
||||
}
|
||||
|
||||
//为保存布局
|
||||
function setdata() {
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
for(var i=0;i<obj.length;i++){
|
||||
if(obj[i].className=="easyui-draggable"){
|
||||
console.info(obj[i].parentNode);
|
||||
$.post(ext.contextPath + '/work/scadaPic/updateLayout.do', {type:'1', id:obj[i].id , posx:obj[i].style.left , posy:obj[i].style.top,
|
||||
containerWidth:obj[i].parentNode.style.width,containerHeight:obj[i].parentNode.style.height}, function(data) {
|
||||
if(data.res!=1){
|
||||
top.$.messager.alert('提示','更新失败','info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//为恢复布局
|
||||
function returndata(){
|
||||
if(confirm("布局将被恢复到初始状态,请问是否要执行该操作?")){
|
||||
var xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var post = " ";
|
||||
xmlobj.open("POST","scadapicaction.do?method=returndata&id=${cp.id}",false);
|
||||
xmlobj.setrequestheader("content-length", post.length);
|
||||
xmlobj.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xmlobj.send(post);
|
||||
var res = xmlobj.responseText;
|
||||
if(res=="suc"){
|
||||
window.location="scadapicaction.do?method=picdesign&type=0&picid=${cp.id}&bizid=${bizid}&clientWidth=${clientWidth+20}";
|
||||
alert("布局恢复完成!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//为设置本布局为默认图,既进去时首选此图片进入
|
||||
function setpicdata(){
|
||||
var xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var post = " ";
|
||||
xmlobj.open("POST","scadapicaction.do?method=setpicdata&picid=${cp.id}&bizid=${bizid}",false);
|
||||
xmlobj.setrequestheader("content-length", post.length);
|
||||
xmlobj.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xmlobj.send(post);
|
||||
var res = xmlobj.responseText;
|
||||
if(res=="suc"){
|
||||
//window.location="scadapicaction.do?method=picdesign&type=0&picid=${cp.id}&bizid=${bizid}&clientWidth=${clientWidth+20}";
|
||||
alert("已设置为默认图!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function getdata() {
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
for(var i=0;i<obj.length;i++){
|
||||
if(obj[i].className=="mpdiv"){
|
||||
|
||||
var xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var post = " ";
|
||||
|
||||
xmlobj.open("POST",encodeURI(encodeURI("UnitPointAction.do?method=updatevalue&id="+obj[i].name)),false);
|
||||
xmlobj.setrequestheader("content-length", post.length);
|
||||
xmlobj.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xmlobj.send(post);
|
||||
var res = xmlobj.responseText;
|
||||
//alert(res);
|
||||
var cobj= document.getElementById(obj[i].name);
|
||||
if(cobj){
|
||||
cobj.innerText=res;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addmp(){
|
||||
//openx();
|
||||
window.location="scadapicaction.do?method=addmp&picid=${cp.id}&bizid=${bizid}&clientWidth=${clientWidth+20}";
|
||||
}
|
||||
function addequ(){
|
||||
//openx();
|
||||
window.location="scadapicaction.do?method=addequ&picid=${cp.id}&bizid=${bizid}&clientWidth=${clientWidth+20}";
|
||||
}
|
||||
|
||||
function addsyb(){
|
||||
//openx();
|
||||
window.location="scadapicaction.do?method=addsyb&picid=${cp.id}&bizid=${bizid}&clientWidth=${clientWidth+20}";
|
||||
}
|
||||
function addtext(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加文本',
|
||||
url : ext.contextPath + '/work/scadaPic/addTxt.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showTxt();
|
||||
}
|
||||
});
|
||||
}
|
||||
function closex(){
|
||||
$('divmid').style.display = "none";
|
||||
$('divtop').style.display = "none";
|
||||
}
|
||||
|
||||
function setandclosex(mpd,title,tag,u){
|
||||
|
||||
var so= $('sltmp');
|
||||
if(so.disabled){
|
||||
closex();
|
||||
gdobj.name=mpd;
|
||||
gdobj.innerHTML="<table bgcolor='c5c5c5' title='"+tag+"' onmousemove='Drag(this);' onmousedown='StartDrag(this);' onmouseup='StopDrag(this);' onmouseover='this.style.cursor=\"pointer\";' oncontextmenu='contxtmenu();return false;'><tr align='center' bgcolor='#888888'><td colspan='2'>"
|
||||
+title+"</td></tr><tr height=\"20\"><td bgcolor=\"#000000\" style=\"color:#00FF00\" align=\"center\">"
|
||||
+"</td><td width=\"30%\">"+u+"</td></tr></table>";
|
||||
}
|
||||
//alert(divx.innerHTML);
|
||||
}
|
||||
function mutclose(){
|
||||
alert("a");
|
||||
var so=$('sltmp');
|
||||
for(var i=0;i<so.length;i++ ){
|
||||
creatediv(so.options(i).value,so.options(i).innerText,'','');
|
||||
}
|
||||
closex();
|
||||
//alert(divx.innerHTML);
|
||||
}
|
||||
function hisview(o){
|
||||
//window.open("UnitPointAction.do?method=hisview&mpd="+o.name,"_blank");
|
||||
window.open(encodeURI(encodeURI("UnitPointAction.do?method=hisnewview&mpid="+o+"&dpdn=${biz.defaultprddbname}")),"_blank");
|
||||
}
|
||||
function creatediv(mpd,title,tag,u){
|
||||
var divx = document.createElement("div");
|
||||
document.body.appendChild(divx);
|
||||
divx.name=mpd;
|
||||
divx.ondblclick="hisview(this);";
|
||||
divx.innerHTML="<table bgcolor='c5c5c5' title='"+tag+"' onmousemove='Drag(this);' onmousedown='StartDrag(this);' onmouseup='StopDrag(this);' onmouseover='this.style.cursor=\"pointer\";' oncontextmenu='contxtmenu();return false;'><tr align='center' bgcolor='#888888'><td colspan='2'>"
|
||||
+title+"</td></tr><tr height=\"20\"><td bgcolor=\"#000000\" style=\"color:#00FF00\" align=\"center\">"
|
||||
+"</td><td width=\"30%\">"+u+"</td></tr></table>";
|
||||
|
||||
divx.className="mpdiv";
|
||||
with (divx.style) {
|
||||
zIndex=19;
|
||||
position = "absolute";
|
||||
top="70px";
|
||||
left="70px";
|
||||
display="";
|
||||
}
|
||||
}
|
||||
|
||||
function setslt(mpd,title,tag){
|
||||
var so=$('sltmp');
|
||||
var oOption = document.createElement("OPTION");
|
||||
so.options.add(oOption);
|
||||
oOption.innerText = title;
|
||||
oOption.value = mpd;
|
||||
|
||||
}
|
||||
|
||||
function openx(flg){
|
||||
function isIE(){
|
||||
return (document.all && window.ActiveXObject && !window.opera) ? true : false;
|
||||
}
|
||||
var bgcolor="#FFFFFF";
|
||||
var trans=80;
|
||||
var body = document.body;
|
||||
var bodyWidth = parseInt((body.scrollWidth<body.clientWidth)?body.clientWidth:body.scrollWidth);
|
||||
var bodyHeight = body.clientWidth; parseInt((body.scrollHeight<body.clientHeight)?body.clientHeight:body.scrollHeight);
|
||||
var clientWidth=body.clientWidth;
|
||||
var clientHeight=body.clientHeight;
|
||||
if($('divtop')){
|
||||
var DivTop = $('divtop');
|
||||
}else{
|
||||
var DivTop = document.createElement("div");
|
||||
DivTop.id = "divtop";
|
||||
body.appendChild(DivTop);
|
||||
xml = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var post = " ";
|
||||
xml.open("POST", "UnitPointAction.do?method=getmplist&picid=<c:out value='${cp.id}' />&flg="+flg, false);
|
||||
xml.setrequestheader("content-length", post.length);
|
||||
xml.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xml.send(post);
|
||||
var res = xml.responseText;
|
||||
alert(res);
|
||||
DivTop.innerHTML = res;
|
||||
}
|
||||
with(DivTop.style)
|
||||
{
|
||||
display = "none";
|
||||
zIndex = 30;
|
||||
position = "absolute";
|
||||
border = "thin";
|
||||
}
|
||||
if($('divmid')){
|
||||
var DivMid = $('divmid');
|
||||
}else{
|
||||
var DivMid = document.createElement("div");
|
||||
DivMid.id = "divmid";
|
||||
body.appendChild(DivMid);
|
||||
}
|
||||
with(DivMid.style){
|
||||
display = "none";
|
||||
zIndex = 20;
|
||||
position = "absolute";
|
||||
top = "0px";
|
||||
left = "0px";
|
||||
border = "0px";
|
||||
backgroundColor = bgcolor;
|
||||
}
|
||||
with(body.style){
|
||||
width = clientWidth;
|
||||
height = clientHeight;
|
||||
overflow = "hidden";
|
||||
}
|
||||
with(DivMid.style){
|
||||
width = "100%";
|
||||
height = "100%";
|
||||
overflow = "hidden";
|
||||
display = "";
|
||||
if (isIE()){
|
||||
filter = " Alpha(Opacity="+trans+")";
|
||||
}else{
|
||||
opacity = trans/100;
|
||||
}
|
||||
}
|
||||
with(DivTop.style){
|
||||
display = "";
|
||||
}
|
||||
DivTop.style.top="50px";
|
||||
DivTop.style.left="100px";
|
||||
var so= $('sltmp')
|
||||
if(flg=='chg'){
|
||||
so.disabled=true;
|
||||
}else{
|
||||
so.disabled=false;
|
||||
}
|
||||
so= $('mutadd')
|
||||
if(flg=='chg'){
|
||||
so.disabled=true;
|
||||
}else{
|
||||
so.disabled=false;
|
||||
}
|
||||
}
|
||||
|
||||
var move = false;
|
||||
var ox, oy;
|
||||
|
||||
function settop(obj) {
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
for(var i=0;i<obj.length;i++){
|
||||
if((obj[i].className=="mpdiv" || obj[i].parentElement.className=="equdiv" || obj[i].parentElement.className=="sybdiv" || obj[i].parentElement.className=="txtdiv")&&obj[i].style.zIndex>9){
|
||||
document.all[i].style.zIndex = 9;
|
||||
}
|
||||
}
|
||||
while(obj.parentElement){
|
||||
if(obj.parentElement.className=="mpdiv" || obj.parentElement.className=="equdiv" || obj.parentElement.className=="sybdiv" || obj.parentElement.className=="txtdiv"){
|
||||
obj=obj.parentElement;
|
||||
break;
|
||||
}else{
|
||||
obj=obj.parentElement;
|
||||
}
|
||||
}
|
||||
if(obj.className=="mpdiv" || obj.className=="equdiv" || obj.className=="sybdiv" || obj.className=="txtdiv"){
|
||||
obj.style.zIndex = 10;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function chgmp(){
|
||||
oPopup.hide();
|
||||
openx('chg');
|
||||
}
|
||||
function mpedit(id){
|
||||
//window.open(encodeURI(encodeURI("measurepointaction.do?method=doedit&id="+gdobj.name)));
|
||||
//window.open(encodeURI(encodeURI("mponpicaction.do?method=doedit&id="+gdobj.id)));
|
||||
window.showModalDialog(encodeURI(encodeURI("mponpicaction.do?method=doedit&type=0&clientWidth=${clientWidth}&id="+id)),window);
|
||||
}
|
||||
function mpview(){
|
||||
window.showModalDialog(encodeURI(encodeURI("mponpicaction.do?method=doedit&type=0&clientWidth=${clientWidth}&id="+gdobj.id)),window);
|
||||
}
|
||||
function txtedit(){
|
||||
//window.open(encodeURI(encodeURI("txtonpicaction.do?method=doedit&id="+gdobj.id)));
|
||||
window.showModalDialog(encodeURI(encodeURI("txtonpicaction.do?method=doedit&type=0&clientWidth=${clientWidth}&id="+gdobj.id)),window);
|
||||
}
|
||||
var oPopup; //= window.createPopup();
|
||||
var gdobj;
|
||||
function contxtmenump(){
|
||||
//alert(event.srcElement.innerHTML);
|
||||
gdobj=event.srcElement;
|
||||
while(gdobj.parentElement){
|
||||
if(gdobj.parentElement.className=="mpdiv"){
|
||||
gdobj=gdobj.parentElement;
|
||||
break;
|
||||
}else{
|
||||
gdobj=gdobj.parentElement;
|
||||
}
|
||||
}
|
||||
oPopup.document.body.innerHTML=""
|
||||
+"<table cellpadding='1' cellspacing='1' border='1' bgcolor='#c5c5c5' width='100%' style='font-size:12px;'>"
|
||||
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.delmp();'>删除</td></tr>"
|
||||
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.mpview();'>属性</td></tr>"
|
||||
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.hisview();'>历史记录</td></tr><table>";
|
||||
oPopup.show(event.x, event.y, 90, 65,document.body);
|
||||
//alert(oPopup.document.body.innerHTML);
|
||||
}
|
||||
function contxtmenusyb(){
|
||||
//alert(event.srcElement.innerHTML);
|
||||
gdobj=event.srcElement;
|
||||
while(gdobj.parentElement){
|
||||
if(gdobj.parentElement.className=="sybdiv"){
|
||||
gdobj=gdobj.parentElement;
|
||||
break;
|
||||
}else{
|
||||
gdobj=gdobj.parentElement;
|
||||
}
|
||||
}
|
||||
oPopup.document.body.innerHTML=""
|
||||
+"<table cellpadding='1' cellspacing='1' border='1' bgcolor='#c5c5c5' width='100%' style='font-size:12px;'>"
|
||||
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.delsyb();'>删除</td></tr>"
|
||||
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.sybview();'>属性</td></tr><table>";
|
||||
oPopup.show(event.x, event.y, 90, 24,document.body);
|
||||
//alert(oPopup.document.body.innerHTML);
|
||||
}
|
||||
function contxtmenuequ(){
|
||||
//alert(event.srcElement.innerHTML);
|
||||
gdobj=event.srcElement;
|
||||
while(gdobj.parentElement){
|
||||
if(gdobj.parentElement.className=="equdiv"){
|
||||
gdobj=gdobj.parentElement;
|
||||
break;
|
||||
}else{
|
||||
gdobj=gdobj.parentElement;
|
||||
}
|
||||
}
|
||||
oPopup.document.body.innerHTML=""
|
||||
+"<table cellpadding='1' cellspacing='1' border='1' bgcolor='#c5c5c5' width='100%' style='font-size:12px;'>"
|
||||
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.delequ();'>删除</td></tr>"
|
||||
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.equview();'>属性</td></tr><table>";
|
||||
oPopup.show(event.x, event.y, 90, 24,document.body);
|
||||
//alert(oPopup.document.body.innerHTML);
|
||||
}
|
||||
function contxtmenutxt(){
|
||||
//alert(event.srcElement.innerHTML);
|
||||
gdobj=event.srcElement;
|
||||
while(gdobj.parentElement){
|
||||
if(gdobj.parentElement.className=="txtdiv"){
|
||||
gdobj=gdobj.parentElement;
|
||||
break;
|
||||
}else{
|
||||
gdobj=gdobj.parentElement;
|
||||
}
|
||||
}
|
||||
oPopup.document.body.innerHTML=""
|
||||
+"<table cellpadding='1' cellspacing='1' border='1' bgcolor='#c5c5c5' width='100%' style='font-size:12px;'>"
|
||||
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.deltxt();'>删除</td></tr>"
|
||||
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.txtedit();'>属性</td></tr><table>";
|
||||
oPopup.show(event.x, event.y, 90, 45,document.body);
|
||||
//alert(oPopup.document.body.innerHTML);
|
||||
}
|
||||
function sybedit(o){
|
||||
window.open("sybonpicaction.do?method=doedit&id="+o);
|
||||
}
|
||||
//getdataV2();
|
||||
|
||||
function gb(){
|
||||
window.location="navigatepro.do?method=showlist";
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<input type="hidden" name="clientWidth" value="${clientWidth}">
|
||||
<input type="hidden" name="picid" value="${clientWidth}">
|
||||
<div id="toolbar" style="display: none;" data-options="region:'north',border:false">
|
||||
<table >
|
||||
<tr >
|
||||
<th>车间</th>
|
||||
<td ><input id="workshopid" name="workshopid" class="easyui-combobox" data-options="required:true,validType:'isBlank'" style="width: 180px;"/></td>
|
||||
<td style="vertical-align: middle">
|
||||
<div id="result">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td align="right" style="padding-left:10px;padding-right:10px">
|
||||
</td>
|
||||
<td width="5">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div >
|
||||
<div id ="content" data-options="region:'center',fit:true,border:false" >
|
||||
<%-- <div
|
||||
style="background-image: url('D:\Tomcat 7.0\webapps\UploadFile\document.DocFileMapper\69b73e6785124cf483721fff9f9dcf71_lct.jpg'); width:${cp._iconWidth }px; height:${cp._iconHeight }px;background-repeat:no-repeat;"
|
||||
id="<c:out value="${cp.picurl}" />"> --%>
|
||||
<!-- <div
|
||||
style="background-image: url('D:\Tomcat 7.0\/webapps\UploadFile\/document.DocFileMapper\/69b73e6785124cf483721fff9f9dcf71_lct.jpg'); width:800px; height:400px;background-repeat:no-repeat;"
|
||||
id="aaa"> </div> -->
|
||||
|
||||
|
||||
|
||||
<%-- <c:forEach items="${mplist}" var="cmp">
|
||||
<div
|
||||
style="font-size:12px;z-index:9;position:absolute;top:${cmp._cleposy};left:${cmp._cleposx};"
|
||||
class="mpdiv" id="${cmp.id}" name="${cmp.mpid}">
|
||||
<c:if test="${empty cmp._icon}">
|
||||
<table bgcolor="#c5c5c5" style="font-size:12px"
|
||||
title="${cmp.name}"
|
||||
onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
||||
onmouseup="StopDrag(this);"
|
||||
onmouseover="this.style.cursor='pointer';"
|
||||
oncontextmenu="contxtmenump();return false;">
|
||||
<tr>
|
||||
<td bgcolor="#000000" style="color: #00FF00" align="center"
|
||||
ID="${cmp.mpid}" onDBLclick="mpedit('${cmp.id }');">
|
||||
<div id="${cmp.id}${cmp.mpid}" >
|
||||
${cmp.scadacode } ${cmp.cvalue }
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</c:if>
|
||||
<c:if test="${not empty cmp._icon}">
|
||||
<div id="${cmp.id}${cmp.mpid}" onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
||||
onmouseup="StopDrag(this);"
|
||||
onmouseover="this.style.cursor='pointer';" oncontextmenu="contxtmenump();return false;">
|
||||
${cmp.scadacode } <img ondblclick="hisview('${cmp.mpid }');" name="${cmp.mpid}" src="${cmp._icon}">
|
||||
</div>
|
||||
|
||||
</c:if>
|
||||
</div>
|
||||
</c:forEach>
|
||||
|
||||
<c:forEach items="${syblist}" var="csyb">
|
||||
<div
|
||||
style="font-size:12px;z-index:9;position:absolute;top:${csyb._cleposy};left:${csyb._cleposx};"
|
||||
class="sybdiv" id="${csyb.id}"
|
||||
name="${csyb.id}" ondblclick="sybedit('${csyb.id}')";>
|
||||
<c:if test="${empty csyb._icon}">
|
||||
<table bgcolor="#c5c5c5" style="font-size:12px"
|
||||
title="${csyb.title}"
|
||||
onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
||||
onmouseup="StopDrag(this);"
|
||||
onmouseover="this.style.cursor='pointer';"
|
||||
oncontextmenu="contxtmenusyb();return false;">
|
||||
<tr>
|
||||
<td bgcolor="#000000" style="color: #00FF00" align="center"
|
||||
ID="${cmp.mpid}">
|
||||
<div id="${csyb.id}${csyb.id}" >
|
||||
${csyb.cvalue }
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</c:if>
|
||||
<c:if test="${not empty csyb._icon}">
|
||||
<div id="${csyb.id}" onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
||||
onmouseup="StopDrag(this);"
|
||||
onmouseover="this.style.cursor='pointer';" oncontextmenu="contxtmenusyb();return false;">
|
||||
<img src="${csyb._icon}">
|
||||
</div>
|
||||
|
||||
</c:if>
|
||||
</div>
|
||||
</c:forEach>
|
||||
|
||||
<c:forEach items="${equlist}" var="cmp">
|
||||
<div
|
||||
style="background-image: url('${cmp.logo}');font-size:12px;z-index:9;position:absolute;top:${cmp._cleposy};left:${cmp._cleposx};height:100px;background-repeat:no-repeat;"
|
||||
class="equdiv" id="${cmp.id}"
|
||||
name="${cmp.equid}" ondblclick="hisview(this);">
|
||||
<table bgcolor="#c5c5c5" width="100" style="font-size:12px"
|
||||
title="${cmp.name}"
|
||||
onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
||||
onmouseup="StopDrag(this);"
|
||||
onmouseover="this.style.cursor='pointer';"
|
||||
oncontextmenu="contxtmenuequ();return false;">
|
||||
<tr align="center" bgcolor="#888888">
|
||||
<td colspan="2">
|
||||
<c:out value="${cmp.name}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" bgcolor="#000000" style="color: #00FF00" align="center"
|
||||
ID="<c:out value="${cmp.name}" />">
|
||||
<div id="${cmp.id}${cmp.equid}" >
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</c:forEach> --%>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div id="mTxt" class="easyui-menu" data-options="onClick:txtMenuHandler" style="width:120px;">
|
||||
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
||||
<div data-options="name:'help',iconCls:'icon-help'">属性</div>
|
||||
</div>
|
||||
<script>
|
||||
var contentdiv=$("#content");
|
||||
$(function(){
|
||||
window.onresize = changesize;
|
||||
$("#workshopid").combobox({
|
||||
url : ext.contextPath + '/work/workshop/getlist4Combo.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onSelect: function () {
|
||||
contentdiv.empty();
|
||||
|
||||
var son='<img id="img" ondragstart="return false" style="width:100%;height:98%;"></img>'
|
||||
contentdiv.append(son);
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dates = $("#workshopid").combobox('getData');
|
||||
|
||||
for (var i=0;i< dates.length;i++) {
|
||||
//console.info(dates[i].id)
|
||||
if (dates[i].id == workshopid) {
|
||||
var abspath=dates[i].commonFile.abspath;
|
||||
abspath=abspath.substring(abspath.indexOf("webapps")+8);
|
||||
//abspath.replace("//","/");
|
||||
//alert(abspath)
|
||||
$("#img").attr("src","../../../"+abspath);
|
||||
showTxt();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
})
|
||||
var firstOnResizeFire = true;//谷歌浏览器onresize事件会执行2次,这里加个标志位控制
|
||||
var containerWidth = 0;
|
||||
var containerHeight = 0;
|
||||
var selectid=""; //记录右键时,指向的对象
|
||||
function changesize(){
|
||||
if (firstOnResizeFire) {
|
||||
firstOnResizeFire = false;
|
||||
adjuest();
|
||||
//0.5秒之后将标志位重置(Chrome的window.onresize默认执行两次)
|
||||
setTimeout(function() {
|
||||
firstOnResizeFire = true;
|
||||
}, 500);
|
||||
}
|
||||
|
||||
}
|
||||
function adjuest(){
|
||||
var obj = contentdiv.find("div");
|
||||
var width =document.body.clientWidth;//onresize方法测试时,只有body的clientwidth是改变后的值
|
||||
var height =document.body.clientHeight// $("#content").height();
|
||||
for(var i=0;i<obj.length;i++){
|
||||
if(obj[i].className=="easyui-draggable"){
|
||||
|
||||
var jobj=$("#"+obj[i].id);
|
||||
//console.info("新对象",jobj.position().left);
|
||||
var left=width*jobj.position().left/containerWidth;
|
||||
var top=height*jobj.position().top/containerHeight;
|
||||
//console.info("新左距离",left);
|
||||
jobj.css("left",left);
|
||||
jobj.css("top",top);
|
||||
//console.info("文本的左距离",jobj.position().left);
|
||||
//console.info("容器的宽度",width);
|
||||
//console.info("body的宽度",);
|
||||
|
||||
}
|
||||
}
|
||||
//
|
||||
containerWidth =width;
|
||||
containerHeight=height;
|
||||
}
|
||||
function showTxt(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
$.post(ext.contextPath + "/work/scadaPic/getTxtList.do", {pid:workshopid}, function(data) {
|
||||
//console.info(data)
|
||||
if (data.length>0) {
|
||||
for(i=0 ;i<data.length;i++){
|
||||
var item= data[i];
|
||||
containerWidth = contentdiv.width();
|
||||
containerHeight = contentdiv.height();
|
||||
|
||||
var left=containerWidth*item.posx/item.containerwidth;
|
||||
var top=containerHeight*item.posy/item.containerheight;
|
||||
var son= '<div class="easyui-draggable" style="background-color:green;width:100px;height:20px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'">'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
item.content+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
|
||||
$('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mTxt').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
});
|
||||
$('#'+item.id).draggable()
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
function txtMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteTxt.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
$('#'+selectid).remove();
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
237
bin/WebRoot/jsp/work/scadapic/picaddequ.jsp
Normal file
237
bin/WebRoot/jsp/work/scadapic/picaddequ.jsp
Normal file
@ -0,0 +1,237 @@
|
||||
<%@page contentType="text/html"%>
|
||||
<%@page pageEncoding="UTF-8"%>
|
||||
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
|
||||
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
|
||||
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<link rel="StyleSheet" href="CSS/comm2.css" type="text/css" />
|
||||
<script type="text/javascript" src="JS/comm.js"></script>
|
||||
</head>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosave(){
|
||||
var selid="";
|
||||
var obj=document.getElementsByTagName("input");
|
||||
for(var i=0;i<obj.length;i++){
|
||||
if(obj[i].type == "checkbox" && obj[i].checked && obj[i].name=="cids"){
|
||||
selid+=obj[i].value+",";
|
||||
}
|
||||
}
|
||||
//alert(selid);
|
||||
window.location="scadapicaction.do?method=addequsave&type=0&clientWidth=${clientWidth}&picid=${picid}&selid="+selid;
|
||||
}
|
||||
|
||||
function dofresh(){
|
||||
ListForm.submit();
|
||||
}
|
||||
function doback(){
|
||||
window.location="scadapicaction.do?method=picdesign&clientWidth=${clientWidth}&type=${type}&picid=${picid}&bizid=${bizid}";
|
||||
}
|
||||
</script>
|
||||
|
||||
<body>
|
||||
<form id="ListForm" action="scadapicaction.do?method=addequ&clientWidth=${clientWidth}&type=${type}"
|
||||
method="post">
|
||||
<input type="hidden" name="sort" value="${pageinfo.sort}">
|
||||
<input type="hidden" name="dirt" value="${pageinfo.dirt}">
|
||||
<input type="hidden" name="bizid" value="${bizid}">
|
||||
<input type="hidden" name="picid" value="${picid}">
|
||||
<input type="hidden" name="pageNum" value="${pageinfo.pageNum}">
|
||||
|
||||
<table cellpadding="0" CELLSPACING="0"
|
||||
class="toolbartable">
|
||||
<tr class="toolbartableline1">
|
||||
<td width="20"></td>
|
||||
<td width="70">
|
||||
<span class="btnleft" onmouseover="btnleftmouseover();"
|
||||
onclick="dosave();" onmouseout="btnleftmouseout();"
|
||||
onmousedown="btnleftmousedown();"> <img alt=""
|
||||
src="IMG/button/save.gif" style="vertical-align: middle">
|
||||
保存 </span>
|
||||
<span onclick="dosave();" class="btnright"> </span>
|
||||
</td>
|
||||
<td width="150" style="vertical-align: middle" align="center">
|
||||
<input type="text" name="code" class="inputtext" value="${param.code}">
|
||||
</td>
|
||||
<td width="70">
|
||||
<span class="btnleft" onmouseover="btnleftmouseover();"
|
||||
onclick="dofresh();" onmouseout="btnleftmouseout();"
|
||||
onmousedown="btnleftmousedown();"> <img alt=""
|
||||
src="IMG/button/search.gif" style="vertical-align: middle">
|
||||
检索 </span>
|
||||
<span onclick="dofresh();" class="btnright"> </span>
|
||||
</td>
|
||||
<td width="70">
|
||||
<span class="btnleft" onmouseover="btnleftmouseover();"
|
||||
onclick="doback();" onmouseout="btnleftmouseout();"
|
||||
onmousedown="btnleftmousedown();"> <img alt=""
|
||||
src="IMG/button/undo.gif" style="vertical-align: middle">
|
||||
返回 </span>
|
||||
<span onclick="doback();" class="btnright"> </span>
|
||||
</td>
|
||||
<td style="vertical-align: middle">
|
||||
<div id="result">
|
||||
</div>
|
||||
</td>
|
||||
<td width="10px" style="vertical-align: middle" align="center">
|
||||
<select name="geographyAreaField" onchange="dofresh();">
|
||||
<option value="">
|
||||
全部安装地点
|
||||
</option>
|
||||
<c:forEach items="${geographyAreaArray}" var="gaaObj">
|
||||
<c:choose>
|
||||
<c:when test="${gaaObj.id==param.geographyAreaField}">
|
||||
<option value="${gaaObj.id}" selected>
|
||||
<c:out value="${gaaObj.name}"></c:out>
|
||||
</option>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<option value="${gaaObj.id}">
|
||||
<c:out value="${gaaObj.name}"></c:out>
|
||||
</option>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</td>
|
||||
<td width="10px" style="vertical-align: middle" align="center">
|
||||
<select name="currentManageFlagsearch" onchange="dofresh();">
|
||||
<option value="-1">
|
||||
全部管理状态
|
||||
</option>
|
||||
<c:forEach items="${currentManageFlagArray}" var="etnObj">
|
||||
<option value="${etnObj.id}"
|
||||
<c:if test="${etnObj.id==param.currentManageFlagsearch}">selected</c:if>>
|
||||
<c:out value="${etnObj.name}"></c:out>
|
||||
</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</td>
|
||||
<td width="10px" style="vertical-align: middle" align="center">
|
||||
<select name="equipmentLevelsearch" onchange="dofresh();">
|
||||
<option value="-1">
|
||||
全部设备等级
|
||||
</option>
|
||||
<c:forEach items="${equipmentLevelArray}" var="etnObj">
|
||||
<option value="${etnObj.id}"
|
||||
<c:if test="${etnObj.id==param.equipmentLevelsearch}">selected</c:if>>
|
||||
<c:out value="${etnObj.name}"></c:out>
|
||||
</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</td>
|
||||
<td width="10px" style="vertical-align: middle" align="center">
|
||||
<select name="fcsearch" onchange="dofresh();">
|
||||
<option value="-1">
|
||||
全部资产分类
|
||||
</option>
|
||||
<c:forEach items="${fclist}" var="etnObj">
|
||||
<option value="${etnObj.id}"
|
||||
<c:if test="${etnObj.id==param.fcsearch}">selected</c:if>>
|
||||
<c:out value="${etnObj.name}"></c:out>
|
||||
</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br>
|
||||
<table cellpadding="0" CELLSPACING="0"
|
||||
class="tablenameline">
|
||||
<tr>
|
||||
<td>
|
||||
设备卡片
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table class="listtable" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="30">
|
||||
<input type="checkbox" name="checkall"
|
||||
onClick="selectAll('cids',this.checked);" />
|
||||
</th>
|
||||
<th>
|
||||
编号
|
||||
</th>
|
||||
<th>
|
||||
名称
|
||||
</th>
|
||||
<th width="15%">
|
||||
所在工段
|
||||
</th>
|
||||
<th width="10%">
|
||||
类型
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<c:set var="rowcount" value="${0}" />
|
||||
<c:forEach var="current" items="${list}">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<input type="checkbox" name="cids"
|
||||
value='<c:out value="${current.id}"/>'
|
||||
onclick="selectsingle('cids','checkall',this.checked)" />
|
||||
</td>
|
||||
<td>
|
||||
${current.equipmentCardID}
|
||||
</td>
|
||||
<td>
|
||||
${current.equipmentName}
|
||||
</td>
|
||||
<td>
|
||||
${current._areaName}
|
||||
</td>
|
||||
<td>
|
||||
${current._equipmentClassName}
|
||||
</td>
|
||||
</tr>
|
||||
<c:set var="rowcount" value="${rowcount+1}" />
|
||||
</c:forEach>
|
||||
<c:if test="${rowcount<12}">
|
||||
<c:forEach var="i" begin="${rowcount+1}" end="12">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
|
||||
</table>
|
||||
<br>
|
||||
<table style="font-size: 12px" class="foottable" >
|
||||
<tr>
|
||||
<td>
|
||||
${pageinfo.pageInfo }
|
||||
</td>
|
||||
<td align="right">
|
||||
<c:out value="${pageinfo.pageNav }" escapeXml="false" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
254
bin/WebRoot/jsp/work/scadapic/picaddmp.jsp
Normal file
254
bin/WebRoot/jsp/work/scadapic/picaddmp.jsp
Normal file
@ -0,0 +1,254 @@
|
||||
<%@page contentType="text/html"%>
|
||||
<%@page pageEncoding="UTF-8"%>
|
||||
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<link rel="StyleSheet" href="CSS/comm2.css" type="text/css" />
|
||||
<script type="text/javascript" src="JS/comm.js"></script>
|
||||
</head>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function dosave(){
|
||||
var selid="";
|
||||
var obj=document.getElementsByTagName("input");
|
||||
for(var i=0;i<obj.length;i++){
|
||||
if(obj[i].type == "checkbox" && obj[i].checked && obj[i].name=="cids"){
|
||||
selid+=obj[i].value+",";
|
||||
}
|
||||
}
|
||||
//alert(selid);
|
||||
window.location=encodeURI(encodeURI("scadapicaction.do?method=addmpsave&type=0&clientWidth=${clientWidth}&picid=${picid}&selid="+selid));
|
||||
}
|
||||
|
||||
function dofresh(){
|
||||
ListForm.submit();
|
||||
}
|
||||
|
||||
function doback(){
|
||||
window.location="scadapicaction.do?method=picdesign&clientWidth=${clientWidth}&type=${type}&picid=${picid}&bizid=${bizid}";
|
||||
}
|
||||
</script>
|
||||
|
||||
<body>
|
||||
<form id="ListForm" action="scadapicaction.do?method=addmp&clientWidth=${clientWidth}&type=${type}"
|
||||
method="post">
|
||||
<input type="hidden" name="sort" value="${pageinfo.sort}">
|
||||
<input type="hidden" name="dirt" value="${pageinfo.dirt}">
|
||||
<input type="hidden" name="bizid" value="${bizid}">
|
||||
<input type="hidden" name="picid" value="${picid}">
|
||||
<input type="hidden" name="pageNum" value="${pageinfo.pageNum}">
|
||||
|
||||
<table cellpadding="0" CELLSPACING="0"
|
||||
class="toolbartable">
|
||||
<tr class="toolbartableline1">
|
||||
<td width="20"></td>
|
||||
<td width="70">
|
||||
<span class="btnleft" onmouseover="btnleftmouseover();"
|
||||
onclick="dosave();" onmouseout="btnleftmouseout();"
|
||||
onmousedown="btnleftmousedown();"> <img alt=""
|
||||
src="IMG/button/save.gif" style="vertical-align: middle">
|
||||
保存 </span>
|
||||
<span onclick="dosave();" class="btnright"> </span>
|
||||
</td>
|
||||
<%-- <td width="56" style="vertical-align: middle" align="center"--%>
|
||||
<%-- onmouseover="this.className='over';"--%>
|
||||
<%-- onmouseout="this.className='';" onclick="dosave();">--%>
|
||||
<%-- <img alt="" src="IMG/button/save.gif"--%>
|
||||
<%-- style="vertical-align: middle">--%>
|
||||
<%-- 保存--%>
|
||||
<%-- </td>--%>
|
||||
<td width="120" style="vertical-align: middle" align="center">
|
||||
<select name="colname">
|
||||
<option value="scadacode" <c:if test="${colname=='scadacode' }">selected</c:if>>SCADA代码</option>
|
||||
<option value="name" <c:if test="${colname=='name' }">selected</c:if>>名称</option>
|
||||
</select>
|
||||
</td>
|
||||
<td width="150" style="vertical-align: middle" align="center">
|
||||
<input type="text" name="searchvalue" class="inputtext" value="${searchvalue}">
|
||||
</td>
|
||||
<td width="70">
|
||||
<span class="btnleft" onmouseover="btnleftmouseover();"
|
||||
onclick="dofresh();" onmouseout="btnleftmouseout();"
|
||||
onmousedown="btnleftmousedown();"> <img alt=""
|
||||
src="IMG/button/search.gif" style="vertical-align: middle">
|
||||
检索 </span>
|
||||
<span onclick="dofresh();" class="btnright"> </span>
|
||||
</td>
|
||||
<%-- <td width="56" style="vertical-align: middle" align="center"--%>
|
||||
<%-- onmouseover="this.className='over';"--%>
|
||||
<%-- onmouseout="this.className='';" onclick="dofresh();">--%>
|
||||
<%-- <img alt="" src="IMG/button/search.gif"--%>
|
||||
<%-- style="vertical-align: middle">--%>
|
||||
<%-- 检索--%>
|
||||
<%-- </td> --%>
|
||||
<td style="vertical-align: middle">
|
||||
<div id="result">
|
||||
</div>
|
||||
</td>
|
||||
<%-- <td width="56" style="vertical-align: middle" align="center"--%>
|
||||
<%-- onmouseover="this.className='over';"--%>
|
||||
<%-- onmouseout="this.className='';" onclick="history.back();">--%>
|
||||
<%-- <img alt="" src="IMG/button/undo.gif"--%>
|
||||
<%-- style="vertical-align: middle">--%>
|
||||
<%-- 返回--%>
|
||||
<%-- </td>--%>
|
||||
<td width="70">
|
||||
<span class="btnleft" onmouseover="btnleftmouseover();"
|
||||
onclick="doback();" onmouseout="btnleftmouseout();"
|
||||
onmousedown="btnleftmousedown();"> <img alt=""
|
||||
src="IMG/button/undo.gif" style="vertical-align: middle">
|
||||
返回 </span>
|
||||
<span onclick="doback();" class="btnright"> </span>
|
||||
</td>
|
||||
<td width="100">
|
||||
<select name="areascope" id="areascope" onchange="ListForm.submit();">
|
||||
<option value="" <c:if test="${param.areascope=='' }">selected</c:if>>
|
||||
全部区域
|
||||
</option>
|
||||
<c:forEach items="${arealist}" var="obj">
|
||||
<option value="${obj.area}"
|
||||
<c:if test="${param.areascope == obj.area }">selected</c:if>>
|
||||
${obj.area}
|
||||
</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</td>
|
||||
<td width="100">
|
||||
<select name="sourcescope" id="sourcescope" onchange="ListForm.submit();">
|
||||
<option value="" <c:if test="${param.sourcescope=='' }">selected</c:if>>
|
||||
全部数据来源
|
||||
</option>
|
||||
<option value="SCADA"
|
||||
<c:if test="${param.sourcescope=='SCADA' }">selected</c:if>>
|
||||
自控系统
|
||||
</option>
|
||||
<option value="MENUAL"
|
||||
<c:if test="${param.sourcescope=='MENUAL' }">selected</c:if>>
|
||||
手工输入
|
||||
</option>
|
||||
</select>
|
||||
</td>
|
||||
<td width="60">
|
||||
<select name="typescope" id="typescope" onchange="ListForm.submit();">
|
||||
<option value="" <c:if test="${typescope=='' }">selected</c:if>>
|
||||
全部信号输入
|
||||
</option>
|
||||
<option value="AI"
|
||||
<c:if test="${typescope=='AI' }">selected</c:if>>
|
||||
模拟量输入(AI)
|
||||
</option>
|
||||
<option value="DI"
|
||||
<c:if test="${typescope=='DI' }">selected</c:if>>
|
||||
数字量输入(DI)
|
||||
</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br>
|
||||
<table class="tablenameline">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<table class="listtable" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="30">
|
||||
<input type="checkbox" name="checkall" onClick="selectAll('cids',this.checked);"/>
|
||||
</th>
|
||||
<th width="25%" onclick="sort('name');">
|
||||
名称
|
||||
</th>
|
||||
<th width="15%" onclick="sort('scadacode');">
|
||||
变量名
|
||||
</th>
|
||||
<th width="10%" onclick="sort('type');">
|
||||
类型
|
||||
</th>
|
||||
<th width="10%" onclick="sort('unit');">
|
||||
单位
|
||||
</th>
|
||||
<th>
|
||||
所属设备
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<c:set var="rowcount" value="${0}" />
|
||||
<c:forEach var="current" items="${mplist}">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<input type="checkbox" name="cids"
|
||||
value='<c:out value="${current.id}"/>'
|
||||
onclick="selectsingle('cids','checkall',this.checked)" />
|
||||
</td>
|
||||
<td>
|
||||
${current.name}
|
||||
</td>
|
||||
<td>
|
||||
${current.scadacode}
|
||||
</td>
|
||||
<td>
|
||||
${current.type}
|
||||
</td>
|
||||
<td>
|
||||
${current.unit}
|
||||
</td>
|
||||
<td>
|
||||
${current.equid}
|
||||
</td>
|
||||
</tr>
|
||||
<c:set var="rowcount" value="${rowcount+1}" />
|
||||
</c:forEach>
|
||||
<c:if test="${rowcount<12}">
|
||||
<c:forEach var="i" begin="${rowcount+1}" end="12">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
|
||||
</table>
|
||||
<br>
|
||||
<table style="font-size: 12px" class="foottable" >
|
||||
<tr>
|
||||
<td>
|
||||
${pageinfo.pageInfo }
|
||||
</td>
|
||||
<td align="right">
|
||||
<c:out value="${pageinfo.pageNav }" escapeXml="false" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
102
bin/WebRoot/jsp/work/scadapic/picaddsyb.jsp
Normal file
102
bin/WebRoot/jsp/work/scadapic/picaddsyb.jsp
Normal file
@ -0,0 +1,102 @@
|
||||
<%@page contentType="text/html"%>
|
||||
<%@page pageEncoding="UTF-8"%>
|
||||
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<link rel="StyleSheet" href="CSS/comm2.css" type="text/css" />
|
||||
<script type="text/javascript" src="JS/comm.js"></script>
|
||||
</head>
|
||||
|
||||
<script type="text/javascript">
|
||||
function dosave(){
|
||||
//alert('a');
|
||||
document.SybOnPicForm.submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
<body>
|
||||
|
||||
<table cellpadding="0" CELLSPACING="0"
|
||||
class="toolbartable">
|
||||
<tr class="toolbartableline1">
|
||||
<td width="20"></td>
|
||||
<td width="56" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="dosave();">
|
||||
<img alt="" src="IMG/button/save.gif"
|
||||
style="vertical-align: middle">
|
||||
保存
|
||||
</td>
|
||||
<td width="56" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="history.back();">
|
||||
<img alt="" src="IMG/button/undo.gif"
|
||||
style="vertical-align: middle">
|
||||
返回
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
|
||||
<table class="tablenameline">
|
||||
<tr>
|
||||
<td width="5%">
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<form id="SybOnPicForm" action="sybonpicaction.do?method=dosave&type=0&clientWidth=${clientWidth}" name="SybOnPicForm"
|
||||
method="post">
|
||||
<input type="hidden" name="picid" value="${sop.picid}">
|
||||
<input type="hidden" name="id" value="${sop.id}">
|
||||
<table class="inputtable" cellspacing="2" cellspacing="2">
|
||||
<tr>
|
||||
<td>
|
||||
名称
|
||||
</td>
|
||||
<td>
|
||||
<input name="title" value="${sop.title }" class="inputtext">
|
||||
</td>
|
||||
<td>
|
||||
精度
|
||||
</td>
|
||||
<td>
|
||||
<input name="accuracy" value="${sop.accuracy }" class="inputtext">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
表达式
|
||||
</td>
|
||||
<td colspan="3">
|
||||
<input name="express" value="${sop.express }" class="inputtext">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
posx
|
||||
</td>
|
||||
<td>
|
||||
<input name="posx" value="${sop.posx }" class="inputtext">
|
||||
</td>
|
||||
<td>
|
||||
posy
|
||||
</td>
|
||||
<td>
|
||||
<input name="posy" value="${sop.posy }" class="inputtext">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
519
bin/WebRoot/jsp/work/scadapic/picdesign.jsp
Normal file
519
bin/WebRoot/jsp/work/scadapic/picdesign.jsp
Normal file
@ -0,0 +1,519 @@
|
||||
<%@page import="com.sipai.entity.work.ScadaPic_Txt"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<% request.setAttribute("Flag_Txt", ScadaPic_Txt.Flag_Txt);%>
|
||||
<% request.setAttribute("Flag_MPoint", ScadaPic_Txt.Flag_MPoint);%>
|
||||
<% request.setAttribute("Flag_EM", ScadaPic_Txt.Flag_EM);%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
//为保存布局
|
||||
function setdata() {
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
for(var i=0;i<obj.length;i++){
|
||||
//console.info(obj[i].className.indexOf("easyui-draggable"));
|
||||
if(obj[i].className.indexOf("easyui-draggable")>=0){
|
||||
console.info(obj[i].style.width);
|
||||
$.post(ext.contextPath + '/work/scadaPic/updateLayout.do', {type:obj[i].getAttribute("type"), id:obj[i].id , posx:obj[i].style.left , posy:obj[i].style.top,
|
||||
containerWidth:obj[i].parentNode.style.width,containerHeight:obj[i].parentNode.style.height,
|
||||
width:obj[i].style.width,height:obj[i].style.height}, function(data) {
|
||||
if(data.res!=1){
|
||||
top.$.messager.alert('提示','更新失败','info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addmp(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加测量点',
|
||||
width:700,
|
||||
height:550,
|
||||
url : ext.contextPath + '/work/scadaPic/addMPoint.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showMPoint();
|
||||
}
|
||||
});
|
||||
}
|
||||
function addequ(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加设备',
|
||||
width:600,
|
||||
height:400,
|
||||
url : ext.contextPath + '/work/scadaPic/addEM.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showEM();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addtext(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加文本',
|
||||
url : ext.contextPath + '/work/scadaPic/addTxt.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showTxt();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<input type="hidden" name="clientWidth" value="${clientWidth}">
|
||||
<input type="hidden" name="picid" value="${clientWidth}">
|
||||
<div id="toolbar" style="display: none;" data-options="region:'north',border:false">
|
||||
<table >
|
||||
<tr >
|
||||
<th>车间</th>
|
||||
<td ><input id="workshopid" name="workshopid" class="easyui-combobox" data-options="required:true,validType:'isBlank'" style="width: 180px;"/></td>
|
||||
<td width="80">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addmp();" >测量点</a>
|
||||
</td>
|
||||
<td width="70">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addequ();">设备</a>
|
||||
</td>
|
||||
<!-- <td width="70">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addsyb();">标识</a>
|
||||
</td> -->
|
||||
<td width="70">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addtext();">文本</a>
|
||||
</td>
|
||||
<td width="100">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
|
||||
onclick="setdata();">保存布局</a>
|
||||
|
||||
</td>
|
||||
<%-- <c:if test="${cu.empid!='emp01'}">
|
||||
<td width="100">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
|
||||
onclick="returndata();">恢复布局</a>
|
||||
</td>
|
||||
</c:if> --%>
|
||||
<!-- <td width="120">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
|
||||
onclick="setpicdata();">设为默认图</a>
|
||||
</td> -->
|
||||
<td style="vertical-align: middle">
|
||||
<div id="result">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td align="right" style="padding-left:10px;padding-right:10px">
|
||||
</td>
|
||||
<td width="5">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div >
|
||||
<div id ="content" data-options="region:'center',fit:true,border:false" >
|
||||
|
||||
</div>
|
||||
<div id="mTxt" class="easyui-menu" data-options="onClick:txtMenuHandler" style="width:120px;">
|
||||
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
||||
</div>
|
||||
<div id="mPoint" class="easyui-menu" data-options="onClick:mPointMenuHandler" style="width:120px;">
|
||||
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
||||
<div data-options="name:'edit',iconCls:'ext-icon-cog_edit'">编辑</div>
|
||||
<div data-options="name:'help',iconCls:'icon-help'">属性</div>
|
||||
</div>
|
||||
<div id="mEM" class="easyui-menu" data-options="onClick:mEMMenuHandler" style="width:120px;">
|
||||
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
||||
<div data-options="name:'help',iconCls:'icon-help'">属性</div>
|
||||
</div>
|
||||
<script>
|
||||
var contentdiv=$("#content");
|
||||
$(function(){
|
||||
window.onresize = changesize;
|
||||
$("#workshopid").combobox({
|
||||
url : ext.contextPath + '/work/workshop/getlist4Combo.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onSelect: function () {
|
||||
contentdiv.empty();
|
||||
|
||||
var son='<img id="img" ondragstart="return false" style="width:100%;height:98%;cursor:default;"></img>'
|
||||
contentdiv.append(son);
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dates = $("#workshopid").combobox('getData');
|
||||
|
||||
for (var i=0;i< dates.length;i++) {
|
||||
//console.info(dates[i].id)
|
||||
if (dates[i].id == workshopid) {
|
||||
var abspath=dates[i].commonFile.abspath;
|
||||
abspath=abspath.substring(abspath.indexOf("webapps")+8);
|
||||
//abspath.replace("//","/");
|
||||
//alert(abspath)
|
||||
$("#img").attr("src","../../../"+abspath);
|
||||
showTxt();
|
||||
showMPoint();
|
||||
showEM();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
MpPics =JSON.parse(getMpPic());
|
||||
|
||||
});
|
||||
//清除原先点
|
||||
function clearItem(type) {
|
||||
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
//循环逆序删除
|
||||
for(var i=obj.length-1;i>0;i--){
|
||||
//console.info(obj[i].className.indexOf("easyui-draggable"));
|
||||
//console.info(obj[i].getAttribute("type"));
|
||||
if(obj[i].className.indexOf("easyui-draggable")>=0 && obj[i].getAttribute("type")==type){
|
||||
//console.info(obj[i]);
|
||||
obj[i].remove();
|
||||
}
|
||||
}
|
||||
//console.log(obj.length)
|
||||
}
|
||||
var firstOnResizeFire = true;//谷歌浏览器onresize事件会执行2次,这里加个标志位控制
|
||||
var containerWidth = 0;
|
||||
var containerHeight = 0;
|
||||
var selectid=""; //记录右键时,指向的对象
|
||||
function changesize(){
|
||||
if (firstOnResizeFire) {
|
||||
firstOnResizeFire = false;
|
||||
adjuest();
|
||||
//0.5秒之后将标志位重置(Chrome的window.onresize默认执行两次)
|
||||
setTimeout(function() {
|
||||
firstOnResizeFire = true;
|
||||
}, 500);
|
||||
}
|
||||
|
||||
}
|
||||
function adjuest(){
|
||||
var obj = contentdiv.find("div");
|
||||
var width =document.body.clientWidth;//onresize方法测试时,只有body的clientwidth是改变后的值
|
||||
var height =document.body.clientHeight// $("#content").height();
|
||||
for(var i=0;i<obj.length;i++){
|
||||
if(obj[i].className.indexOf("easyui-draggable")>=0){
|
||||
|
||||
var jobj=$("#"+obj[i].id);
|
||||
//console.info("新对象",jobj.position().left);
|
||||
var left=width*jobj.position().left/containerWidth;
|
||||
var top=height*jobj.position().top/containerHeight;
|
||||
//console.info("新左距离",left);
|
||||
jobj.css("left",left);
|
||||
jobj.css("top",top);
|
||||
//console.info("文本的左距离",jobj.position().left);
|
||||
//console.info("容器的宽度",width);
|
||||
//console.info("body的宽度",);
|
||||
|
||||
}
|
||||
if(obj[i].className.indexOf("easyui-resizable")>=0){
|
||||
|
||||
var jobj=$("#"+obj[i].id);
|
||||
//console.info("新对象",jobj.width());
|
||||
var w=width*jobj.width()/containerWidth;
|
||||
var h=height*jobj.height()/containerHeight;
|
||||
//console.info("新左距离",left);
|
||||
jobj.css("width",w);
|
||||
jobj.css("height",h);
|
||||
//console.info("文本的左距离",jobj.position().left);
|
||||
//console.info("容器的宽度",width);
|
||||
//console.info("body的宽度",);
|
||||
|
||||
}
|
||||
}
|
||||
//
|
||||
containerWidth =width;
|
||||
containerHeight=height;
|
||||
}
|
||||
function showTxt(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
$.post(ext.contextPath + "/work/scadaPic/getTxtList.do", {pid:workshopid}, function(data) {
|
||||
clearItem("${Flag_Txt}");
|
||||
//console.info(data)
|
||||
if (data.length>0) {
|
||||
for(i=0 ;i<data.length;i++){
|
||||
var item= data[i];
|
||||
containerWidth = contentdiv.width();
|
||||
containerHeight = contentdiv.height();
|
||||
|
||||
var left=containerWidth*item.posx/item.containerwidth;
|
||||
var top=containerHeight*item.posy/item.containerheight;
|
||||
var son= '<div class="easyui-draggable" style="background-color:green;width:100px;height:20px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_Txt}">'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
item.content+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
|
||||
$('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mTxt').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
});
|
||||
$('#'+item.id).draggable()
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
function txtMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteTxt.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
$('#'+selectid).remove();
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
var MpPics;
|
||||
function showMPoint(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
$.post(ext.contextPath + "/work/scadaPic/getMPointList.do", {pid:workshopid}, function(data) {
|
||||
console.info(data)
|
||||
clearItem("${Flag_MPoint}");
|
||||
if (data.length>0) {
|
||||
for(i=0 ;i<data.length;i++){
|
||||
var item= data[i];
|
||||
containerWidth = contentdiv.width();
|
||||
containerHeight = contentdiv.height();
|
||||
|
||||
var left=containerWidth*item.posx/item.containerwidth;
|
||||
var top=containerHeight*item.posy/item.containerheight;
|
||||
var son="";
|
||||
//console.log((item.mPoint.exp))
|
||||
if(item.expressionflag!=null && item.expressionflag ){
|
||||
var path;
|
||||
if(item.mPoint==null || item.mPoint.exp ==null || item.mPoint.exp==""){
|
||||
path="";
|
||||
}else{
|
||||
path= MpPics[parseInt(item.mPoint.exp)].path;
|
||||
}
|
||||
son= '<div class="easyui-draggable" style="width:40px;height:40px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_MPoint}">'+
|
||||
'<img src=../../'+path+' style="width:20px;height:20px;" ></img>'+
|
||||
'</div>';
|
||||
}else{
|
||||
var value ="";
|
||||
if(item.mPoint!=null){
|
||||
value=item.mPoint.parmvalue
|
||||
}
|
||||
son= '<div class="easyui-draggable" style="background-color:blue;width:150px;height:40px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_MPoint}">'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
item.txt+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
value+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
}
|
||||
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
$('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mPoint').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
});
|
||||
$('#'+item.id).draggable()
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
function mPointMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteMPoint.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
$('#'+selectid).remove();
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
break;
|
||||
case'edit':
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '编辑测量点',
|
||||
width:700,
|
||||
height:550,
|
||||
url : ext.contextPath + '/work/scadaPic/editMPoint.do?id='+selectid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showMPoint();
|
||||
}
|
||||
});
|
||||
break;
|
||||
case'help':
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '测量点信息',
|
||||
width:700,
|
||||
height:550,
|
||||
url : ext.contextPath + '/work/scadaPic/showMPoint.do?id='+selectid,
|
||||
buttons : [ {
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
function showEM(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
$.post(ext.contextPath + "/work/scadaPic/getEMList.do", {pid:workshopid}, function(data) {
|
||||
//console.info(data)
|
||||
clearItem("${Flag_EM}");
|
||||
if (data.length>0) {
|
||||
for(i=0 ;i<data.length;i++){
|
||||
var item= data[i];
|
||||
containerWidth = contentdiv.width();
|
||||
containerHeight = contentdiv.height();
|
||||
|
||||
var left=containerWidth*item.posx/item.containerwidth;
|
||||
var top=containerHeight*item.posy/item.containerheight;
|
||||
var w=containerWidth*item.width/item.containerwidth;
|
||||
var h=containerHeight*item.height/item.containerheight;
|
||||
var equipmentname="未查询到设备信息";
|
||||
if(item.equipmentCard!=null){
|
||||
equipmentname=item.equipmentCard.equipmentname;
|
||||
}
|
||||
var son= '<div class="easyui-draggable easyui-resizable" style="border:1px solid yellow;width:'+w+'px;height:'+h+'px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_EM}">'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
equipmentname+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
|
||||
$('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mEM').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
});
|
||||
$('#'+item.id).draggable()
|
||||
$('#'+item.id).resizable()
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
function mEMMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteEM.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
$('#'+selectid).remove();
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
651
bin/WebRoot/jsp/work/scadapic/picdesignmainpic.jsp
Normal file
651
bin/WebRoot/jsp/work/scadapic/picdesignmainpic.jsp
Normal file
@ -0,0 +1,651 @@
|
||||
<%@page contentType="text/html"%>
|
||||
<%@page pageEncoding="UTF-8"%>
|
||||
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<link rel="StyleSheet" href="CSS/comm2.css" type="text/css" />
|
||||
<script type="text/javascript" src="JS/comm.js"></script>
|
||||
</head>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function searchSelect(o){
|
||||
window.location="scadapicaction.do?method=picdesign&picid="+o+"&bizid=${bizid}";
|
||||
}
|
||||
|
||||
function mpcopy(){
|
||||
var xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var se = document.getElementById('frompicid');
|
||||
var post = " ";
|
||||
xmlobj.open("POST","scadapicaction.do?method=piccopy&topicid=${cp.id}&frompicid="+se.value,true);
|
||||
xmlobj.setrequestheader("content-length", post.length);
|
||||
xmlobj.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xmlobj.send(post);
|
||||
}
|
||||
function setdata() {
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
for(var i=0;i<obj.length;i++){
|
||||
if(obj[i].className=="mpdiv"){
|
||||
var xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var post = " ";
|
||||
xmlobj.open("POST","scadapicaction.do?method=updatemponpic&id="+obj[i].id+"&posx="+obj[i].style.left+"&posy="+obj[i].style.top,true);
|
||||
xmlobj.setrequestheader("content-length", post.length);
|
||||
xmlobj.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xmlobj.send(post);
|
||||
//var res = xmlobj.responseText;
|
||||
//alert(res);
|
||||
//result.innerHTML=res;
|
||||
}
|
||||
if(obj[i].className=="equdiv"){
|
||||
var xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var post = " ";
|
||||
xmlobj.open("POST","scadapicaction.do?method=updateequonpic&id="+obj[i].id+"&posx="+obj[i].style.left+"&posy="+obj[i].style.top,true);
|
||||
xmlobj.setrequestheader("content-length", post.length);
|
||||
xmlobj.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xmlobj.send(post);
|
||||
//var res = xmlobj.responseText;
|
||||
//alert(res);
|
||||
//result.innerHTML=res;
|
||||
}
|
||||
if(obj[i].className=="sybdiv"){
|
||||
var xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var post = " ";
|
||||
xmlobj.open("POST","scadapicaction.do?method=updatesybonpic&id="+obj[i].id+"&posx="+obj[i].style.left+"&posy="+obj[i].style.top,true);
|
||||
xmlobj.setrequestheader("content-length", post.length);
|
||||
xmlobj.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xmlobj.send(post);
|
||||
//var res = xmlobj.responseText;
|
||||
//alert(res);
|
||||
//result.innerHTML=res;
|
||||
}
|
||||
}
|
||||
}
|
||||
function getdata() {
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
for(var i=0;i<obj.length;i++){
|
||||
if(obj[i].className=="mpdiv"){
|
||||
|
||||
var xmlobj = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var post = " ";
|
||||
|
||||
xmlobj.open("POST",encodeURI(encodeURI("UnitPointAction.do?method=updatevalue&id="+obj[i].name)),false);
|
||||
xmlobj.setrequestheader("content-length", post.length);
|
||||
xmlobj.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xmlobj.send(post);
|
||||
var res = xmlobj.responseText;
|
||||
//alert(res);
|
||||
var cobj= document.getElementById(obj[i].name);
|
||||
if(cobj){
|
||||
cobj.innerText=res;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<%-- function opensubpic(picid){--%>
|
||||
<%-- window.showModalDialog('scadapicaction.do?method=picdesignsubpic&bizid=${bizid}&picid='+picid,'window','help:off;status:on;dialogWidth:1024px;dialogHeight:768px;dialogTop:0px;dialogLeft:0px')--%>
|
||||
<%-- }--%>
|
||||
|
||||
function addmp(){
|
||||
//openx();
|
||||
window.location="scadapicaction.do?method=addmp&picid=${cp.id}&bizid=${bizid}";
|
||||
}
|
||||
function addequ(){
|
||||
//openx();
|
||||
window.location="scadapicaction.do?method=addequ&picid=${cp.id}&bizid=${bizid}";
|
||||
}
|
||||
|
||||
function addsyb(){
|
||||
//openx();
|
||||
window.location="scadapicaction.do?method=addsyb&picid=${cp.id}&bizid=${bizid}";
|
||||
}
|
||||
function closex(){
|
||||
$('divmid').style.display = "none";
|
||||
$('divtop').style.display = "none";
|
||||
}
|
||||
|
||||
function setandclosex(mpd,title,tag,u){
|
||||
|
||||
var so= $('sltmp');
|
||||
if(so.disabled){
|
||||
closex();
|
||||
gdobj.name=mpd;
|
||||
gdobj.innerHTML="<table bgcolor='c5c5c5' title='"+tag+"' onmousemove='Drag(this);' onmousedown='StartDrag(this);' onmouseup='StopDrag(this);' onmouseover='this.style.cursor=\"pointer\";' oncontextmenu='contxtmenu();return false;'><tr align='center' bgcolor='#888888'><td colspan='2'>"
|
||||
+title+"</td></tr><tr height=\"20\"><td bgcolor=\"#000000\" style=\"color:#00FF00\" align=\"center\">"
|
||||
+"</td><td width=\"30%\">"+u+"</td></tr></table>";
|
||||
}
|
||||
//alert(divx.innerHTML);
|
||||
}
|
||||
function mutclose(){
|
||||
alert("a");
|
||||
var so=$('sltmp');
|
||||
for(var i=0;i<so.length;i++ ){
|
||||
creatediv(so.options(i).value,so.options(i).innerText,'','');
|
||||
}
|
||||
closex();
|
||||
//alert(divx.innerHTML);
|
||||
}
|
||||
function hisview(o){
|
||||
window.open("UnitPointAction.do?method=hisview&mpd="+o.name,"_blank");
|
||||
}
|
||||
function creatediv(mpd,title,tag,u){
|
||||
var divx = document.createElement("div");
|
||||
document.body.appendChild(divx);
|
||||
divx.name=mpd;
|
||||
divx.ondblclick="hisview(this);";
|
||||
divx.innerHTML="<table bgcolor='c5c5c5' title='"+tag+"' onmousemove='Drag(this);' onmousedown='StartDrag(this);' onmouseup='StopDrag(this);' onmouseover='this.style.cursor=\"pointer\";' oncontextmenu='contxtmenu();return false;'><tr align='center' bgcolor='#888888'><td colspan='2'>"
|
||||
+title+"</td></tr><tr height=\"20\"><td bgcolor=\"#000000\" style=\"color:#00FF00\" align=\"center\">"
|
||||
+"</td><td width=\"30%\">"+u+"</td></tr></table>";
|
||||
|
||||
divx.className="mpdiv";
|
||||
with (divx.style) {
|
||||
zIndex=19;
|
||||
position = "absolute";
|
||||
top="70px";
|
||||
left="70px";
|
||||
display="";
|
||||
}
|
||||
}
|
||||
|
||||
function setslt(mpd,title,tag){
|
||||
var so=$('sltmp');
|
||||
var oOption = document.createElement("OPTION");
|
||||
so.options.add(oOption);
|
||||
oOption.innerText = title;
|
||||
oOption.value = mpd;
|
||||
|
||||
}
|
||||
|
||||
function openx(flg){
|
||||
function isIE(){
|
||||
return (document.all && window.ActiveXObject && !window.opera) ? true : false;
|
||||
}
|
||||
var bgcolor="#FFFFFF";
|
||||
var trans=80;
|
||||
var body = document.body;
|
||||
var bodyWidth = parseInt((body.scrollWidth<body.clientWidth)?body.clientWidth:body.scrollWidth);
|
||||
var bodyHeight = body.clientWidth; parseInt((body.scrollHeight<body.clientHeight)?body.clientHeight:body.scrollHeight);
|
||||
var clientWidth=body.clientWidth;
|
||||
var clientHeight=body.clientHeight;
|
||||
if($('divtop')){
|
||||
var DivTop = $('divtop');
|
||||
}else{
|
||||
var DivTop = document.createElement("div");
|
||||
DivTop.id = "divtop";
|
||||
body.appendChild(DivTop);
|
||||
xml = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var post = " ";
|
||||
xml.open("POST", "UnitPointAction.do?method=getmplist&picid=<c:out value='${cp.id}' />&flg="+flg, false);
|
||||
xml.setrequestheader("content-length", post.length);
|
||||
xml.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xml.send(post);
|
||||
var res = xml.responseText;
|
||||
alert(res);
|
||||
DivTop.innerHTML = res;
|
||||
}
|
||||
with(DivTop.style)
|
||||
{
|
||||
display = "none";
|
||||
zIndex = 30;
|
||||
position = "absolute";
|
||||
border = "thin";
|
||||
}
|
||||
if($('divmid')){
|
||||
var DivMid = $('divmid');
|
||||
}else{
|
||||
var DivMid = document.createElement("div");
|
||||
DivMid.id = "divmid";
|
||||
body.appendChild(DivMid);
|
||||
}
|
||||
with(DivMid.style){
|
||||
display = "none";
|
||||
zIndex = 20;
|
||||
position = "absolute";
|
||||
top = "0px";
|
||||
left = "0px";
|
||||
border = "0px";
|
||||
backgroundColor = bgcolor;
|
||||
}
|
||||
with(body.style){
|
||||
width = clientWidth;
|
||||
height = clientHeight;
|
||||
overflow = "hidden";
|
||||
}
|
||||
with(DivMid.style){
|
||||
width = "100%";
|
||||
height = "100%";
|
||||
overflow = "hidden";
|
||||
display = "";
|
||||
if (isIE()){
|
||||
filter = " Alpha(Opacity="+trans+")";
|
||||
}else{
|
||||
opacity = trans/100;
|
||||
}
|
||||
}
|
||||
with(DivTop.style){
|
||||
display = "";
|
||||
}
|
||||
DivTop.style.top="50px";
|
||||
DivTop.style.left="100px";
|
||||
var so= $('sltmp')
|
||||
if(flg=='chg'){
|
||||
so.disabled=true;
|
||||
}else{
|
||||
so.disabled=false;
|
||||
}
|
||||
so= $('mutadd')
|
||||
if(flg=='chg'){
|
||||
so.disabled=true;
|
||||
}else{
|
||||
so.disabled=false;
|
||||
}
|
||||
}
|
||||
|
||||
var move = false;
|
||||
var ox, oy;
|
||||
|
||||
function settop(obj) {
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
for(var i=0;i<obj.length;i++){
|
||||
if((obj[i].className=="mpdiv" || obj[i].parentElement.className=="equdiv" || obj[i].parentElement.className=="sybdiv")&&obj[i].style.zIndex>9){
|
||||
document.all[i].style.zIndex = 9;
|
||||
}
|
||||
}
|
||||
while(obj.parentElement){
|
||||
if(obj.parentElement.className=="mpdiv" || obj.parentElement.className=="equdiv" || obj.parentElement.className=="sybdiv"){
|
||||
obj=obj.parentElement;
|
||||
break;
|
||||
}else{
|
||||
obj=obj.parentElement;
|
||||
}
|
||||
}
|
||||
if(obj.className=="mpdiv" || obj.className=="equdiv" || obj.className=="sybdiv"){
|
||||
obj.style.zIndex = 10;
|
||||
}
|
||||
}
|
||||
|
||||
function StartDrag(obj) {
|
||||
settop(event.srcElement);
|
||||
obj.setCapture();
|
||||
move = true;
|
||||
ox = event.clientX;
|
||||
oy = event.clientY;
|
||||
}
|
||||
|
||||
function Drag(obj) {
|
||||
if (move) {
|
||||
var oldwin =event.srcElement;
|
||||
while(oldwin.parentElement){
|
||||
if(oldwin.parentElement.className=="mpdiv" || oldwin.parentElement.className=="equdiv" || oldwin.parentElement.className=="sybdiv"){
|
||||
oldwin=oldwin.parentElement;
|
||||
break;
|
||||
}else{
|
||||
oldwin=oldwin.parentElement;
|
||||
}
|
||||
}
|
||||
if(oldwin.className=="mpdiv" || oldwin.className=="equdiv" || oldwin.className=="sybdiv"){
|
||||
oldwin.style.left = event.clientX - ox + parseInt(oldwin.style.left);
|
||||
if(parseInt(oldwin.style.left)<0){
|
||||
oldwin.style.left=0;
|
||||
}
|
||||
oldwin.style.top = event.clientY - oy + parseInt(oldwin.style.top);
|
||||
if(parseInt(oldwin.style.top)<0){
|
||||
oldwin.style.top=0;
|
||||
}
|
||||
ox = event.clientX;
|
||||
oy = event.clientY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function StopDrag(obj) {
|
||||
obj.releaseCapture();
|
||||
move = false;
|
||||
}
|
||||
|
||||
function $(Id) {
|
||||
return document.getElementById(Id);
|
||||
}
|
||||
|
||||
function delmp(){
|
||||
if(gdobj.id!=""){
|
||||
xml = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var post = " ";
|
||||
xml.open("POST", "scadapicaction.do?method=deletemponpic&id="+gdobj.id, false);
|
||||
xml.setrequestheader("content-length", post.length);
|
||||
xml.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xml.send(post);
|
||||
var res = xml.responseText;
|
||||
result.innerHTML = res;
|
||||
gdobj.parentElement.removeChild(gdobj);
|
||||
oPopup.hide();
|
||||
}else{
|
||||
document.body.removeChild(gdobj);
|
||||
oPopup.hide();
|
||||
}
|
||||
}
|
||||
function delequ(){
|
||||
if(gdobj.id!=""){
|
||||
xml = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var post = " ";
|
||||
xml.open("POST", "scadapicaction.do?method=deleteequonpic&id="+gdobj.id, false);
|
||||
xml.setrequestheader("content-length", post.length);
|
||||
xml.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xml.send(post);
|
||||
var res = xml.responseText;
|
||||
result.innerHTML = res;
|
||||
gdobj.parentElement.removeChild(gdobj);
|
||||
oPopup.hide();
|
||||
}else{
|
||||
document.body.removeChild(gdobj);
|
||||
oPopup.hide();
|
||||
}
|
||||
}
|
||||
function delsyb(){
|
||||
if(gdobj.id!=""){
|
||||
xml = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var post = " ";
|
||||
xml.open("POST", "scadapicaction.do?method=deletesybonpic&id="+gdobj.id, false);
|
||||
xml.setrequestheader("content-length", post.length);
|
||||
xml.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xml.send(post);
|
||||
var res = xml.responseText;
|
||||
result.innerHTML = res;
|
||||
gdobj.parentElement.removeChild(gdobj);
|
||||
oPopup.hide();
|
||||
}else{
|
||||
document.body.removeChild(gdobj);
|
||||
oPopup.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function syncall(){
|
||||
xml = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var post = " ";
|
||||
xml.open("POST", "sybonpicaction.do?method=syncall", true);
|
||||
xml.setrequestheader("content-length", post.length);
|
||||
xml.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
xml.send(post);
|
||||
}
|
||||
|
||||
function chgmp(){
|
||||
oPopup.hide();
|
||||
openx('chg');
|
||||
}
|
||||
function mpedit(){
|
||||
window.open(encodeURI(encodeURI("measurepointaction.do?method=doedit&id="+gdobj.name)));
|
||||
}
|
||||
var oPopup = window.createPopup();
|
||||
var gdobj;
|
||||
function contxtmenump(){
|
||||
//alert(event.srcElement.innerHTML);
|
||||
gdobj=event.srcElement;
|
||||
while(gdobj.parentElement){
|
||||
if(gdobj.parentElement.className=="mpdiv"){
|
||||
gdobj=gdobj.parentElement;
|
||||
break;
|
||||
}else{
|
||||
gdobj=gdobj.parentElement;
|
||||
}
|
||||
}
|
||||
oPopup.document.body.innerHTML=""
|
||||
+"<table cellpadding='1' cellspacing='1' border='1' bgcolor='#c5c5c5' width='100%' style='font-size:12px;'>"
|
||||
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.delmp();'>删除</td></tr>"
|
||||
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.mpedit();'>测量点设置</td></tr><table>";
|
||||
oPopup.show(event.x, event.y, 90, 48,document.body);
|
||||
//alert(oPopup.document.body.innerHTML);
|
||||
}
|
||||
function contxtmenusyb(){
|
||||
//alert(event.srcElement.innerHTML);
|
||||
gdobj=event.srcElement;
|
||||
while(gdobj.parentElement){
|
||||
if(gdobj.parentElement.className=="sybdiv"){
|
||||
gdobj=gdobj.parentElement;
|
||||
break;
|
||||
}else{
|
||||
gdobj=gdobj.parentElement;
|
||||
}
|
||||
}
|
||||
oPopup.document.body.innerHTML=""
|
||||
+"<table cellpadding='1' cellspacing='1' border='1' bgcolor='#c5c5c5' width='100%' style='font-size:12px;'>"
|
||||
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.delsyb();'>删除</td></tr><table>";
|
||||
oPopup.show(event.x, event.y, 90, 24,document.body);
|
||||
//alert(oPopup.document.body.innerHTML);
|
||||
}
|
||||
function contxtmenuequ(){
|
||||
//alert(event.srcElement.innerHTML);
|
||||
gdobj=event.srcElement;
|
||||
while(gdobj.parentElement){
|
||||
if(gdobj.parentElement.className=="equdiv"){
|
||||
gdobj=gdobj.parentElement;
|
||||
break;
|
||||
}else{
|
||||
gdobj=gdobj.parentElement;
|
||||
}
|
||||
}
|
||||
oPopup.document.body.innerHTML=""
|
||||
+"<table cellpadding='1' cellspacing='1' border='1' bgcolor='#c5c5c5' width='100%' style='font-size:12px;'>"
|
||||
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.delequ();'>删除</td></tr><table>";
|
||||
oPopup.show(event.x, event.y, 90, 24,document.body);
|
||||
//alert(oPopup.document.body.innerHTML);
|
||||
}
|
||||
|
||||
function sybedit(o){
|
||||
window.open("sybonpicaction.do?method=doedit&id="+o);
|
||||
}
|
||||
</script>
|
||||
|
||||
<body >
|
||||
|
||||
<table cellpadding="0" CELLSPACING="0" width="1000"
|
||||
class="toolbartable">
|
||||
<tr class="toolbartableline1">
|
||||
<td width="20"></td>
|
||||
<td width="70px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="addmp();">
|
||||
<img alt="" src="IMG/button/new.gif" style="vertical-align: middle">
|
||||
测量点
|
||||
</td>
|
||||
<td width="56px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="addequ();">
|
||||
<img alt="" src="IMG/button/new.gif" style="vertical-align: middle">
|
||||
设备
|
||||
</td>
|
||||
<td width="56px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="addsyb();">
|
||||
<img alt="" src="IMG/button/new.gif" style="vertical-align: middle">
|
||||
标识
|
||||
</td>
|
||||
<td width="56px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="syncall();">
|
||||
<img alt="" src="IMG/button/new.gif" style="vertical-align: middle">
|
||||
同步
|
||||
</td>
|
||||
<td width="80px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="setdata();">
|
||||
<img alt="" src="IMG/button/save.gif"
|
||||
style="vertical-align: middle">
|
||||
保存布局
|
||||
</td>
|
||||
<td width="80px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="getdata();">
|
||||
<img alt="" src="IMG/button/undo.gif"
|
||||
style="vertical-align: middle">
|
||||
获取数据
|
||||
</td>
|
||||
<td width="56px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="mpcopy();">
|
||||
<img alt="" src="IMG/button/new.gif" style="vertical-align: middle">
|
||||
复制
|
||||
</td>
|
||||
<td>
|
||||
<select name='frompicid' id="frompicid" >
|
||||
<c:forEach items="${scadapiclist}" var="current">
|
||||
<c:if test="${current.id==cp.id}">
|
||||
<option value="<c:out value="${current.id}"/>" selected>
|
||||
<c:out value="${current.name }" />
|
||||
</option>
|
||||
</c:if>
|
||||
<c:if test="${current.id!=cp.id}">
|
||||
<option value="<c:out value="${current.id}"/>" >
|
||||
<c:out value="${current.name }" />
|
||||
</option>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</td>
|
||||
<td style="vertical-align: middle">
|
||||
<div id="result">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td align="right">
|
||||
<select name='picid' id="picid" onchange="searchSelect(this.value)">
|
||||
<c:forEach items="${scadapiclist}" var="current">
|
||||
<c:if test="${current.id==cp.id}">
|
||||
<option value="<c:out value="${current.id}"/>" selected>
|
||||
<c:out value="${current.name }" />
|
||||
</option>
|
||||
</c:if>
|
||||
<c:if test="${current.id!=cp.id}">
|
||||
<option value="<c:out value="${current.id}"/>" >
|
||||
<c:out value="${current.name }" />
|
||||
</option>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<img src="${cp.picurl}" width="1000" height="620" border="0" ISMAP USEMAP="#${cp.id }">
|
||||
<MAP NAME="${cp.id }">
|
||||
<c:out value="${cp.areas}" escapeXml="false"></c:out>
|
||||
</MAP>
|
||||
<div
|
||||
|
||||
id="<c:out value="${cp.picurl}" />">
|
||||
<c:forEach items="${mplist}" var="cmp">
|
||||
<div
|
||||
style="font-size:12px;z-index:9;position:absolute;top:${cmp.posy};left:${cmp.posx};"
|
||||
class="mpdiv" id="${cmp.id}"
|
||||
name="${cmp.mpid}" ondblclick="hisview(this);">
|
||||
<c:if test="${empty cmp._icon}">
|
||||
<table bgcolor="#c5c5c5" width="70" style="font-size:12px"
|
||||
title="${cmp.name}"
|
||||
onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
||||
onmouseup="StopDrag(this);"
|
||||
onmouseover="this.style.cursor='pointer';"
|
||||
oncontextmenu="contxtmenump();return false;">
|
||||
<tr align="center" bgcolor="#888888">
|
||||
<td colspan="2">
|
||||
<c:out value="${cmp.name}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#000000" style="color: #00FF00" align="center"
|
||||
ID="<c:out value="${cmp.name}" />">
|
||||
<c:out value="${cmp.cvalue}" />
|
||||
</td>
|
||||
<td width="30%">
|
||||
<c:out value="${cmp.unit}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</c:if>
|
||||
<c:if test="${not empty cmp._icon}">
|
||||
<div id="${cmp.mpid}" onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
||||
onmouseup="StopDrag(this);"
|
||||
onmouseover="this.style.cursor='pointer';" oncontextmenu="contxtmenump();return false;">
|
||||
<img src="${cmp._icon}">
|
||||
</div>
|
||||
|
||||
</c:if>
|
||||
</div>
|
||||
</c:forEach>
|
||||
|
||||
<c:forEach items="${syblist}" var="csyb">
|
||||
<div
|
||||
style="font-size:12px;z-index:9;position:absolute;top:${csyb.posy};left:${csyb.posx};"
|
||||
class="sybdiv" id="${csyb.id}"
|
||||
name="${csyb.id}" ondblclick="sybedit('${csyb.id}')";>
|
||||
<c:if test="${empty csyb._icon}">
|
||||
<table bgcolor="#c5c5c5" width="70" style="font-size:12px"
|
||||
title="${csyb.title}"
|
||||
onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
||||
onmouseup="StopDrag(this);"
|
||||
onmouseover="this.style.cursor='pointer';"
|
||||
oncontextmenu="contxtmenusyb();return false;">
|
||||
<tr align="center" bgcolor="#888888">
|
||||
<td colspan="2">
|
||||
<c:out value="${csyb.title}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#000000" style="color: #00FF00" align="center"
|
||||
ID="<c:out value="${csyb.title}" />">
|
||||
<c:out value="${csyb.cvalue}" />
|
||||
</td>
|
||||
<td width="30%">
|
||||
<c:out value="${csyb.unit}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</c:if>
|
||||
<c:if test="${not empty csyb._icon}">
|
||||
<div id="${csyb.id}" onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
||||
onmouseup="StopDrag(this);"
|
||||
onmouseover="this.style.cursor='pointer';" oncontextmenu="contxtmenusyb();return false;">
|
||||
<img src="${csyb._icon}">
|
||||
</div>
|
||||
|
||||
</c:if>
|
||||
</div>
|
||||
</c:forEach>
|
||||
|
||||
<c:forEach items="${equlist}" var="cmp">
|
||||
<div
|
||||
style="background-image: url('${cmp.logo}');font-size:12px;z-index:9;position:absolute;top:${cmp.posy};left:${cmp.posx};height:100px;background-repeat:no-repeat;"
|
||||
class="equdiv" id="${cmp.id}"
|
||||
name="${cmp.equid}" ondblclick="hisview(this);">
|
||||
<table bgcolor="#c5c5c5" width="100" style="font-size:12px"
|
||||
title="${cmp.name}"
|
||||
onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
||||
onmouseup="StopDrag(this);"
|
||||
onmouseover="this.style.cursor='pointer';"
|
||||
oncontextmenu="contxtmenuequ();return false;">
|
||||
<tr align="center" bgcolor="#888888">
|
||||
<td colspan="2">
|
||||
<c:out value="${cmp.name}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#000000" style="color: #00FF00" align="center"
|
||||
ID="<c:out value="${cmp.name}" />">
|
||||
|
||||
</td>
|
||||
<td width="30%">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</c:forEach>
|
||||
</div>
|
||||
<br>
|
||||
</body>
|
||||
</html>
|
||||
441
bin/WebRoot/jsp/work/scadapic/picdesignsubpic.jsp
Normal file
441
bin/WebRoot/jsp/work/scadapic/picdesignsubpic.jsp
Normal file
@ -0,0 +1,441 @@
|
||||
<%@page contentType="text/html"%>
|
||||
<%@page pageEncoding="UTF-8"%>
|
||||
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||||
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
|
||||
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta http-equiv="cache-control" content="no-cache,must-revalidate">
|
||||
<meta http-equiv="expires" content="0">
|
||||
<link rel="StyleSheet" href="CSS/comm2.css" type="text/css" />
|
||||
<script type="text/javascript" src="JS/comm.js"></script>
|
||||
</head>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function searchSelect(o){
|
||||
//alert(unitid.value);
|
||||
window.location="UnitPointAction.do?method=detail&picid="+o+"&bizid=${bizid}";
|
||||
}
|
||||
|
||||
var gmpi=0;
|
||||
var mpxmlhttp;
|
||||
|
||||
function updateall(){
|
||||
gmpi=0;
|
||||
getdata();
|
||||
//getequdata();
|
||||
}
|
||||
|
||||
function getdata() {
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
for(var i=gmpi;i<obj.length;i++){
|
||||
gmpi=gmpi+1;
|
||||
if(obj[i].className=="mpdiv"){
|
||||
mpxmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var cobj= document.getElementById(obj[i].name);
|
||||
mpxmlhttp.open("POST",encodeURI(encodeURI("UnitPointAction.do?method=updatevalue&id="+obj[i].name)),true);
|
||||
mpxmlhttp.setrequestheader("content-length", 0);
|
||||
mpxmlhttp.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
mpxmlhttp.send(true);
|
||||
mpxmlhttp.onreadystatechange = function(){
|
||||
nextmp(cobj);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if(obj[i].className=="sybdiv"){
|
||||
mpxmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var cobj= document.getElementById(obj[i].name);
|
||||
mpxmlhttp.open("POST",encodeURI(encodeURI("UnitPointAction.do?method=updatesybvalue&id="+obj[i].name)),true);
|
||||
mpxmlhttp.setrequestheader("content-length", 0);
|
||||
mpxmlhttp.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
mpxmlhttp.send(true);
|
||||
mpxmlhttp.onreadystatechange = function(){
|
||||
nextsyb(cobj);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if(obj[i].className=="equdiv"){
|
||||
mpxmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
var cobj= document.getElementById(obj[i].name);
|
||||
var dobj = obj[i];
|
||||
mpxmlhttp.open("POST",encodeURI(encodeURI("UnitPointAction.do?method=updateequvalue&equid="+obj[i].name.Trim())),true);
|
||||
mpxmlhttp.setrequestheader("content-length", 0);
|
||||
mpxmlhttp.setrequestheader("content-type", "application/x-www-form-urlencoded");
|
||||
mpxmlhttp.send(true);
|
||||
mpxmlhttp.onreadystatechange = function(){
|
||||
nextequ(cobj,dobj);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
function nextmp(cobj){
|
||||
if(mpxmlhttp.readyState==4){
|
||||
if(mpxmlhttp.status==200){
|
||||
var res = mpxmlhttp.responseText;
|
||||
if(cobj){
|
||||
cobj.innerHTML=res;
|
||||
}
|
||||
getdata();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function nextsyb(cobj){
|
||||
if(mpxmlhttp.readyState==4){
|
||||
if(mpxmlhttp.status==200){
|
||||
var res = mpxmlhttp.responseText;
|
||||
if(cobj){
|
||||
//alert(res);
|
||||
cobj.innerHTML=res;
|
||||
}
|
||||
getdata();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function nextequ(cobj,dobj){
|
||||
if(mpxmlhttp.readyState==4){
|
||||
if(mpxmlhttp.status==200){
|
||||
var res = mpxmlhttp.responseText;
|
||||
if(cobj){
|
||||
res = res.split("$");
|
||||
cobj.innerHTML=res[0];
|
||||
if(res[1]){
|
||||
|
||||
cobj.parentElement.nextSibling.firstChild.innerText=res[1];
|
||||
dobj.firstChild.style.backgroundColor="#FFFF00"
|
||||
}else{
|
||||
cobj.parentElement.nextSibling.firstChild.innerText="";
|
||||
dobj.firstChild.style.backgroundColor="#c5c5c5";
|
||||
}
|
||||
}
|
||||
getdata();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function hisview(o){
|
||||
window.open(encodeURI(encodeURI("UnitPointAction.do?method=hisview&mpid="+o)),"_blank");
|
||||
}
|
||||
|
||||
function goUpdateRecord(equipmentCardID){
|
||||
equipmentCardForm.elements['equipmentCardID'].value=equipmentCardID;
|
||||
|
||||
equipmentCardForm.submit();
|
||||
}
|
||||
var move = false;
|
||||
var ox, oy;
|
||||
|
||||
function settop(obj) {
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
for(var i=0;i<obj.length;i++){
|
||||
if(obj[i].className=="mpdiv"&&obj[i].style.zIndex>9){
|
||||
document.all[i].style.zIndex = 9;
|
||||
}
|
||||
}
|
||||
while(obj.parentElement){
|
||||
if(obj.parentElement.className=="mpdiv"){
|
||||
obj=obj.parentElement;
|
||||
break;
|
||||
}else{
|
||||
obj=obj.parentElement;
|
||||
}
|
||||
}
|
||||
if(obj.className=="mpdiv"){
|
||||
obj.style.zIndex = 10;
|
||||
}
|
||||
}
|
||||
function StartDrag(obj) {
|
||||
settop(event.srcElement);
|
||||
obj.setCapture();
|
||||
move = true;
|
||||
ox = event.clientX;
|
||||
oy = event.clientY;
|
||||
}
|
||||
|
||||
function Drag(obj) {
|
||||
if (move) {
|
||||
var oldwin =event.srcElement;
|
||||
while(oldwin.parentElement){
|
||||
if(oldwin.parentElement.className=="mpdiv" || oldwin.parentElement.className=="equdiv"){
|
||||
oldwin=oldwin.parentElement;
|
||||
break;
|
||||
}else{
|
||||
oldwin=oldwin.parentElement;
|
||||
}
|
||||
}
|
||||
if(oldwin.className=="mpdiv" || oldwin.className=="equdiv"){
|
||||
oldwin.style.left = event.clientX - ox + parseInt(oldwin.style.left);
|
||||
if(parseInt(oldwin.style.left)<0){
|
||||
oldwin.style.left=0;
|
||||
}
|
||||
oldwin.style.top = event.clientY - oy + parseInt(oldwin.style.top);
|
||||
if(parseInt(oldwin.style.top)<0){
|
||||
oldwin.style.top=0;
|
||||
}
|
||||
ox = event.clientX;
|
||||
oy = event.clientY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function StopDrag(obj) {
|
||||
obj.releaseCapture();
|
||||
move = false;
|
||||
}
|
||||
|
||||
function $(Id) {
|
||||
return document.getElementById(Id);
|
||||
}
|
||||
|
||||
function refresh(o){
|
||||
setInterval("updateall()",o);
|
||||
}
|
||||
|
||||
setInterval("updateall()",30000);
|
||||
|
||||
function mpvlist(){
|
||||
window.location="measurepointaction.do?method=datainputprepare&bizid=${bizid}";
|
||||
}
|
||||
|
||||
|
||||
function addequalarm(){
|
||||
window.location="alarmaction.do?method=doequnew&bizid=${bizid}&equid="+gdobj.name;
|
||||
}
|
||||
function addequalstatus(){
|
||||
window.location="equstatusaction.do?method=donew&bizid=${bizid}&equid="+gdobj.name;
|
||||
}
|
||||
|
||||
var oPopup = window.createPopup();
|
||||
var gdobj;
|
||||
function contxtmenuequ(){
|
||||
//alert(event.srcElement.innerHTML);
|
||||
gdobj=event.srcElement;
|
||||
while(gdobj.parentElement){
|
||||
if(gdobj.parentElement.className=="equdiv"){
|
||||
gdobj=gdobj.parentElement;
|
||||
break;
|
||||
}else{
|
||||
gdobj=gdobj.parentElement;
|
||||
}
|
||||
}
|
||||
oPopup.document.body.innerHTML=""
|
||||
+"<table cellpadding='1' cellspacing='1' border='1' bgcolor='#c5c5c5' width='100%' style='font-size:12px;'><tbody>"
|
||||
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.addequalarm();'>添加故障信息</td></tr>"
|
||||
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.addequalstatus();'>更改设备状态</td></tr></tbaody><table>";
|
||||
oPopup.show(event.x, event.y, 90, 48,document.body);
|
||||
//alert(oPopup.document.body.innerHTML);
|
||||
}
|
||||
function mpedit(){
|
||||
window.open("measurepointaction.do?method=doedit&id="+gdobj.name);
|
||||
}
|
||||
function contxtmenump(){
|
||||
//alert(event.srcElement.innerHTML);
|
||||
gdobj=event.srcElement;
|
||||
|
||||
oPopup.document.body.innerHTML=""
|
||||
+"<table cellpadding='1' cellspacing='1' border='1' bgcolor='#c5c5c5' width='100%' style='font-size:12px;'><tbody>"
|
||||
+"<tr style='cursor:pointer;'><td valign='middle' height='20' onclick='parent.mpedit();'>测量点设置</td></tr></tbaody><table>";
|
||||
oPopup.show(event.x, event.y, 90, 24,document.body);
|
||||
//alert(oPopup.document.body.innerHTML);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<body onload="updateall();">
|
||||
<img src="${cp.picurl}" width="1020" height="688" border="0">
|
||||
|
||||
<div
|
||||
|
||||
id="<c:out value="${cp.picurl}" />">
|
||||
<br>
|
||||
<c:forEach items="${mplist}" var="cmp">
|
||||
<div
|
||||
style="font-size:12px;z-index:9;position:absolute;top:${cmp.posy};left:${cmp.posx};"
|
||||
class="mpdiv" id="${cmp.id}" name="${cmp.mpid}"
|
||||
>
|
||||
<c:if test="${empty cmp._icon}">
|
||||
<table bgcolor="#c5c5c5" width="70" style="font-size: 12px;"
|
||||
title="${cmp.name}" onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
||||
onmouseup="StopDrag(this);"
|
||||
onmouseover="this.style.cursor='pointer';" >
|
||||
<tr align="center" bgcolor="#888888" >
|
||||
<td colspan="2" name="${cmp.mpid}">
|
||||
${cmp.name }
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#000000" style="color: #00FF00" align="center"
|
||||
ID="<c:out value="${cmp.mpid}" />" ondblclick="hisview('${cmp.mpid }');">
|
||||
${cmp.cvalue }
|
||||
</td>
|
||||
<td >
|
||||
|
||||
<c:out value="${cmp.unit}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</c:if>
|
||||
<c:if test="${not empty cmp._icon}">
|
||||
<div id="${cmp.mpid}" >
|
||||
<img ondblclick="hisview('${cmp.mpid }');" name="${cmp.mpid}" src="${cmp._icon}" oncontextmenu="contxtmenump('${cmp.mpid}');return false;">
|
||||
</div>
|
||||
|
||||
</c:if>
|
||||
</div>
|
||||
</c:forEach>
|
||||
|
||||
<c:forEach items="${syblist}" var="csyb">
|
||||
<div
|
||||
style="font-size:12px;z-index:9;position:absolute;top:${csyb.posy};left:${csyb.posx};"
|
||||
class="sybdiv"
|
||||
name="${csyb.id}">
|
||||
<c:if test="${empty csyb._icon}">
|
||||
<table bgcolor="#c5c5c5" width="70" style="font-size:12px"
|
||||
title="${csyb.title}" onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
||||
onmouseup="StopDrag(this);"
|
||||
onmouseover="this.style.cursor='pointer';">
|
||||
<tr align="center" bgcolor="#888888">
|
||||
<td colspan="2">
|
||||
<c:out value="${csyb.title}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="#000000" style="color: #00FF00" align="center"
|
||||
ID="<c:out value="${csyb.id}" />">
|
||||
<c:out value="${csyb.cvalue}" />
|
||||
</td>
|
||||
<td width="30%">
|
||||
<c:out value="${csyb.unit}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</c:if>
|
||||
<c:if test="${not empty csyb._icon}">
|
||||
<div id="${csyb.id}" onmouseover="this.style.cursor='pointer';">
|
||||
<img src="${csyb._icon}">
|
||||
</div>
|
||||
|
||||
</c:if>
|
||||
</div>
|
||||
</c:forEach>
|
||||
|
||||
|
||||
<c:forEach items="${equlist}" var="cmp">
|
||||
<div
|
||||
style="background-image: url('${cmp.logo}');font-size:12px;z-index:9;position:absolute;top:${cmp.posy};left:${cmp.posx};height:100px;background-repeat:no-repeat;"
|
||||
class="equdiv" id="${cmp.id}" name="${cmp.equid}"
|
||||
>
|
||||
<table <c:if test="${cmp._status!='unuseable'}">bgcolor="#c5c5c5"</c:if><c:if test="${cmp._status=='unuseable'}">bgcolor="#ffff00"</c:if> width="100" style="font-size: 12px"
|
||||
title="${cmp.name}"
|
||||
onmousemove="Drag(this);" onmousedown="StartDrag(this);"
|
||||
onmouseup="StopDrag(this);"
|
||||
onmouseover="this.style.cursor='pointer';"
|
||||
>
|
||||
<tr align="center" bgcolor="#888888" >
|
||||
<td colspan="2" ondblclick="goUpdateRecord('${cmp.equid}');" oncontextmenu="contxtmenuequ('${cmp.equid}');return false;">
|
||||
${cmp.name }
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" bgcolor="#000000" style="color: #00FF00"
|
||||
align="center" ID="<c:out value="${cmp.equid}" />">
|
||||
|
||||
<br>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<c:if test="${cmp._status=='unuseable'}">
|
||||
${cmp._memo }
|
||||
</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</c:forEach>
|
||||
</div>
|
||||
|
||||
<html:form action="equipmentCard.do?method=equipmentCardOperation"
|
||||
target="_blank">
|
||||
|
||||
<html:hidden property="equipmentCardID" />
|
||||
<html:hidden property="choice" value="goUpdateRecord" />
|
||||
</html:form>
|
||||
|
||||
<br>
|
||||
<table cellpadding="0" CELLSPACING="0" width="1000"
|
||||
class="toolbartable">
|
||||
<tr class="toolbartableline1">
|
||||
<td width="20"></td>
|
||||
<td width="70px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="addmp();">
|
||||
<img alt="" src="IMG/button/new.gif" style="vertical-align: middle">
|
||||
测量点
|
||||
</td>
|
||||
<td width="56px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="addequ();">
|
||||
<img alt="" src="IMG/button/new.gif" style="vertical-align: middle">
|
||||
设备
|
||||
</td>
|
||||
<td width="56px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="addsyb();">
|
||||
<img alt="" src="IMG/button/new.gif" style="vertical-align: middle">
|
||||
标识
|
||||
</td>
|
||||
<td width="56px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="syncall();">
|
||||
<img alt="" src="IMG/button/new.gif" style="vertical-align: middle">
|
||||
同步
|
||||
</td>
|
||||
<td width="80px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="setdata();">
|
||||
<img alt="" src="IMG/button/save.gif"
|
||||
style="vertical-align: middle">
|
||||
保存布局
|
||||
</td>
|
||||
<td width="56px" style="vertical-align: middle" align="center"
|
||||
onmouseover="this.className='over';"
|
||||
onmouseout="this.className='';" onclick="mpcopy();">
|
||||
<img alt="" src="IMG/button/new.gif" style="vertical-align: middle">
|
||||
复制
|
||||
</td>
|
||||
<td>
|
||||
<select name='frompicid' id="frompicid" >
|
||||
<c:forEach items="${scadapiclist}" var="current">
|
||||
<c:if test="${current.id==cp.id}">
|
||||
<option value="<c:out value="${current.id}"/>" selected>
|
||||
<c:out value="${current.name }" />
|
||||
</option>
|
||||
</c:if>
|
||||
<c:if test="${current.id!=cp.id}">
|
||||
<option value="<c:out value="${current.id}"/>" >
|
||||
<c:out value="${current.name }" />
|
||||
</option>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</td>
|
||||
<td style="vertical-align: middle">
|
||||
<div id="result">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
171
bin/WebRoot/jsp/work/scadapic/prodManagement.jsp
Normal file
171
bin/WebRoot/jsp/work/scadapic/prodManagement.jsp
Normal file
@ -0,0 +1,171 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var contentdiv=$("#contentDiv");
|
||||
var searchgrid = function() {
|
||||
grid.datagrid('load',ext.contextPath + '/work/workorder/getlist.do?'+$('#searchForm').serialize());
|
||||
};
|
||||
$(function() {
|
||||
$("#taskordercode").textbox('textbox').bind("click", function () {
|
||||
selectTaskOrder();
|
||||
});
|
||||
showButtons();
|
||||
});
|
||||
var showButtons = function() {
|
||||
$.post(ext.contextPath + "/work/scadaPic/getProdManagementViews4Combo.do", {}, function(data) {
|
||||
|
||||
if (data.length>0) {
|
||||
var widthtimes= 100/data.length-1;
|
||||
for(i=0 ;i<data.length;i++){
|
||||
var a = document.createElement("a");
|
||||
a.href='javascript:void(0);';
|
||||
a.id=data[i].id;
|
||||
var cd =document.getElementById('contentDiv');
|
||||
//console.info(son)
|
||||
cd.appendChild(a);
|
||||
|
||||
$('#'+data[i].id).linkbutton({
|
||||
iconCls: 'icon-add',
|
||||
text:data[i].name,
|
||||
plain:true
|
||||
});
|
||||
/* $('#'+data[i].id).css('margin-left','50px');
|
||||
$('#'+data[i].id).css('margin-right','50px'); */
|
||||
$('#'+data[i].id).css('float','left');
|
||||
$('#'+data[i].id).css('width',widthtimes+'%');
|
||||
|
||||
$('#'+data[i].id).bind('click', function(){
|
||||
showView(this.id);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
};
|
||||
var showView = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '可视化',
|
||||
width: 1000,
|
||||
height:550,
|
||||
url : ext.contextPath + '/work/scadaPic/showProdManagementItem_PIC.do?id='+id,
|
||||
buttons : [{
|
||||
text : '关闭',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
var showdetailsFun = function() {
|
||||
var taskOrderId =$("#taskorderid").val();
|
||||
var processId = $("#processId").combobox('getValue');
|
||||
$("#iframeStock").attr("src",ext.contextPath+"/work/scadaPic/showProdManagementItem.do?taskorderid="+taskOrderId+"&processid="+processId+"&type=xbk");
|
||||
$("#iframeSuspended").attr("src",ext.contextPath+"/work/scadaPic/showProdManagementItem.do?taskorderid="+taskOrderId+"&processid="+processId+"&type=kl");
|
||||
};
|
||||
function selectTaskOrder(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择任务单',
|
||||
width: 800,
|
||||
height:550,
|
||||
url : ext.contextPath + '/plan/taskorder/select.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
|
||||
if(res!=null){
|
||||
$("#taskordercode").textbox('setValue',res.tasklistcode);//easyui textbox赋值jquery不一样
|
||||
$("#taskorderid").val(res.id);
|
||||
$("#processId").combobox({
|
||||
url : ext.contextPath + '/plan/dailyplan/getProcessIds4ComboByTaskOrderId.do?taskOrderId='+res.id,
|
||||
valueField : 'processid',
|
||||
textField : 'processid',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onLoadSuccess: function(record){
|
||||
if($("#processId").combobox('getData').length>0){
|
||||
$("#processId").combobox('select',$("#processId").combobox('getData')[0].processid);
|
||||
}
|
||||
},
|
||||
onSelect: function () {
|
||||
showdetailsFun();
|
||||
}
|
||||
});
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;heigh:500px;" data-options="region:'north'" >
|
||||
<table style="width:100%">
|
||||
<caption style="padding:10px 10px;font-size:20px;align:center;">制品管理</caption>
|
||||
</table>
|
||||
<table >
|
||||
<tr style="align:center;">
|
||||
<td style="width:60px;align:center;">任务单号</td>
|
||||
<td><input id="taskordercode" name="taskordercode" class="easyui-textbox" style="width: 250px;" data-options="validType:'isBlank',prompt:'单击选择'" value=""/>
|
||||
<input id="taskorderid" name="taskorderid" type="hidden" value="" /></td>
|
||||
|
||||
<th style="width:60px;">流程ID</th>
|
||||
<td >
|
||||
<input id="processId" name="processId" class="easyui-combobox" editable="false" style="width:250px" data-options="required:true,validType:'isBlank'"/>
|
||||
</td>
|
||||
<td >
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="showdetailsFun();">搜索</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div id="rightdiv" data-options="region:'center',border:false">
|
||||
<div id="tt" class="easyui-tabs" data-options="fit:true,border:false">
|
||||
|
||||
<div title="线边库存">
|
||||
<iframe id="iframeStock" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div>
|
||||
<div title="品质扣料">
|
||||
<iframe id="iframeSuspended" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="contentDiv" style="height:30px;" data-options="region:'south'">
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
510
bin/WebRoot/jsp/work/scadapic/prodManagementDesign.jsp
Normal file
510
bin/WebRoot/jsp/work/scadapic/prodManagementDesign.jsp
Normal file
@ -0,0 +1,510 @@
|
||||
<%@page import="com.sipai.entity.work.ScadaPic_Txt"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<% request.setAttribute("Flag_Txt", ScadaPic_Txt.Flag_Txt);%>
|
||||
<% request.setAttribute("Flag_MPoint", ScadaPic_Txt.Flag_MPoint);%>
|
||||
<% request.setAttribute("Flag_EM", ScadaPic_Txt.Flag_EM);%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
//为保存布局
|
||||
function setdata() {
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
for(var i=0;i<obj.length;i++){
|
||||
//console.info(obj[i].className.indexOf("easyui-draggable"));
|
||||
if(obj[i].className.indexOf("easyui-draggable")>=0){
|
||||
console.info(obj[i].style.width);
|
||||
$.post(ext.contextPath + '/work/scadaPic/updateLayout.do', {type:obj[i].getAttribute("type"), id:obj[i].id , posx:obj[i].style.left , posy:obj[i].style.top,
|
||||
containerWidth:obj[i].parentNode.style.width,containerHeight:obj[i].parentNode.style.height,
|
||||
width:obj[i].style.width,height:obj[i].style.height}, function(data) {
|
||||
if(data.res!=1){
|
||||
top.$.messager.alert('提示','更新失败','info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addmp(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加测量点',
|
||||
width:700,
|
||||
height:550,
|
||||
url : ext.contextPath + '/work/scadaPic/addMPoint.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showMPoint();
|
||||
}
|
||||
});
|
||||
}
|
||||
function addequ(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加设备',
|
||||
width:600,
|
||||
height:400,
|
||||
url : ext.contextPath + '/work/scadaPic/addEM.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showEM();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addtext(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加文本',
|
||||
url : ext.contextPath + '/work/scadaPic/addTxt.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showTxt();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addPic(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var workshopname = $("#workshopid").combobox('getText');
|
||||
//alert(workshopid+workshopname)
|
||||
if(workshopid==null || workshopid==""){
|
||||
parent.$.messager.alert('提示','请先选择工序','info');
|
||||
return;
|
||||
}
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加底图',
|
||||
url : ext.contextPath + '/work/scadaPic/showProdManagementDesign_Pic.do?pid='+workshopid+'&pname='+workshopname,
|
||||
buttons : [ {
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
dialog.dialog("destroy");
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showTxt();
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<input type="hidden" name="clientWidth" value="${clientWidth}">
|
||||
<input type="hidden" name="picid" value="${clientWidth}">
|
||||
<div id="toolbar" style="display: none;" data-options="region:'north',border:false">
|
||||
<table >
|
||||
<tr >
|
||||
<th>工序</th>
|
||||
<td ><input id="workshopid" name="workshopid" class="easyui-combobox" data-options="required:true,validType:'isBlank'" style="width: 180px;"/></td>
|
||||
<!-- <td width="80">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addmp();" >测量点</a>
|
||||
</td> -->
|
||||
<td width="70">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addequ();">设备</a>
|
||||
</td>
|
||||
<!-- <td width="70">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addtext();">文本</a>
|
||||
</td> -->
|
||||
<td width="70">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addPic();">底图</a>
|
||||
</td>
|
||||
<td width="100">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
|
||||
onclick="setdata();">保存布局</a>
|
||||
|
||||
</td>
|
||||
<%-- <c:if test="${cu.empid!='emp01'}">
|
||||
<td width="100">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
|
||||
onclick="returndata();">恢复布局</a>
|
||||
</td>
|
||||
</c:if> --%>
|
||||
<!-- <td width="120">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
|
||||
onclick="setpicdata();">设为默认图</a>
|
||||
</td> -->
|
||||
<td style="vertical-align: middle">
|
||||
<div id="result">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td align="right" style="padding-left:10px;padding-right:10px">
|
||||
</td>
|
||||
<td width="5">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div >
|
||||
<div id ="content" data-options="region:'center',fit:true,border:false" >
|
||||
|
||||
</div>
|
||||
<div id="mTxt" class="easyui-menu" data-options="onClick:txtMenuHandler" style="width:120px;">
|
||||
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
||||
<div data-options="name:'help',iconCls:'icon-help'">属性</div>
|
||||
</div>
|
||||
<div id="mPoint" class="easyui-menu" data-options="onClick:mPointMenuHandler" style="width:120px;">
|
||||
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
||||
<div data-options="name:'help',iconCls:'icon-help'">属性</div>
|
||||
</div>
|
||||
<div id="mEM" class="easyui-menu" data-options="onClick:mEMMenuHandler" style="width:120px;">
|
||||
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
||||
<div data-options="name:'help',iconCls:'icon-help'">属性</div>
|
||||
</div>
|
||||
<script>
|
||||
var contentdiv=$("#content");
|
||||
$(function(){
|
||||
window.onresize = changesize;
|
||||
$("#workshopid").combobox({
|
||||
url : ext.contextPath + '/work/scadaPic/getProdManagementViews4Combo.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onSelect: function () {
|
||||
contentdiv.empty();
|
||||
|
||||
var son='<img id="img" ondragstart="return false" style="width:100%;height:98%;"></img>'
|
||||
contentdiv.append(son);
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dates = $("#workshopid").combobox('getData');
|
||||
|
||||
for (var i=0;i< dates.length;i++) {
|
||||
//console.info(dates[i].id)
|
||||
if (dates[i].id == workshopid) {
|
||||
if(dates[i].commonFile!=null ){
|
||||
var abspath=dates[i].commonFile.abspath;
|
||||
|
||||
abspath=abspath.substring(abspath.indexOf("webapps")+8);
|
||||
//abspath.replace("//","/");
|
||||
//alert(abspath)
|
||||
$("#img").attr("src","../../../"+abspath);
|
||||
//showTxt();
|
||||
//showMPoint();
|
||||
showEM();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
MpPics =JSON.parse(getMpPic());
|
||||
|
||||
});
|
||||
//清除原先点
|
||||
function clearItem(type) {
|
||||
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
//循环逆序删除
|
||||
for(var i=obj.length-1;i>0;i--){
|
||||
//console.info(obj[i].className.indexOf("easyui-draggable"));
|
||||
//console.info(obj[i].getAttribute("type"));
|
||||
if(obj[i].className.indexOf("easyui-draggable")>=0 && obj[i].getAttribute("type")==type){
|
||||
//console.info(obj[i]);
|
||||
obj[i].remove();
|
||||
}
|
||||
}
|
||||
//console.log(obj.length)
|
||||
}
|
||||
var firstOnResizeFire = true;//谷歌浏览器onresize事件会执行2次,这里加个标志位控制
|
||||
var containerWidth = 0;
|
||||
var containerHeight = 0;
|
||||
var selectid=""; //记录右键时,指向的对象
|
||||
function changesize(){
|
||||
if (firstOnResizeFire) {
|
||||
firstOnResizeFire = false;
|
||||
adjuest();
|
||||
//0.5秒之后将标志位重置(Chrome的window.onresize默认执行两次)
|
||||
setTimeout(function() {
|
||||
firstOnResizeFire = true;
|
||||
}, 500);
|
||||
}
|
||||
|
||||
}
|
||||
function adjuest(){
|
||||
var obj = contentdiv.find("div");
|
||||
var width =document.body.clientWidth;//onresize方法测试时,只有body的clientwidth是改变后的值
|
||||
var height =document.body.clientHeight// $("#content").height();
|
||||
for(var i=0;i<obj.length;i++){
|
||||
if(obj[i].className.indexOf("easyui-draggable")>=0){
|
||||
|
||||
var jobj=$("#"+obj[i].id);
|
||||
//console.info("新对象",jobj.position().left);
|
||||
var left=width*jobj.position().left/containerWidth;
|
||||
var top=height*jobj.position().top/containerHeight;
|
||||
//console.info("新左距离",left);
|
||||
jobj.css("left",left);
|
||||
jobj.css("top",top);
|
||||
//console.info("文本的左距离",jobj.position().left);
|
||||
//console.info("容器的宽度",width);
|
||||
//console.info("body的宽度",);
|
||||
|
||||
}
|
||||
if(obj[i].className.indexOf("easyui-resizable")>=0){
|
||||
|
||||
var jobj=$("#"+obj[i].id);
|
||||
//console.info("新对象",jobj.width());
|
||||
var w=width*jobj.width()/containerWidth;
|
||||
var h=height*jobj.height()/containerHeight;
|
||||
//console.info("新左距离",left);
|
||||
jobj.css("width",w);
|
||||
jobj.css("height",h);
|
||||
//console.info("文本的左距离",jobj.position().left);
|
||||
//console.info("容器的宽度",width);
|
||||
//console.info("body的宽度",);
|
||||
|
||||
}
|
||||
}
|
||||
//
|
||||
containerWidth =width;
|
||||
containerHeight=height;
|
||||
}
|
||||
function showTxt(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
$.post(ext.contextPath + "/work/scadaPic/getTxtList.do", {pid:workshopid}, function(data) {
|
||||
clearItem("${Flag_Txt}");
|
||||
//console.info(data)
|
||||
if (data.length>0) {
|
||||
for(i=0 ;i<data.length;i++){
|
||||
var item= data[i];
|
||||
containerWidth = contentdiv.width();
|
||||
containerHeight = contentdiv.height();
|
||||
|
||||
var left=containerWidth*item.posx/item.containerwidth;
|
||||
var top=containerHeight*item.posy/item.containerheight;
|
||||
var son= '<div class="easyui-draggable" style="background-color:green;width:100px;height:20px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_Txt}">'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
item.content+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
|
||||
$('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mTxt').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
});
|
||||
$('#'+item.id).draggable()
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
function txtMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteTxt.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
$('#'+selectid).remove();
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
var MpPics;
|
||||
function showMPoint(){
|
||||
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
$.post(ext.contextPath + "/work/scadaPic/getMPointList.do", {pid:workshopid}, function(data) {
|
||||
//console.info(data)
|
||||
clearItem("${Flag_MPoint}");
|
||||
if (data.length>0) {
|
||||
for(i=0 ;i<data.length;i++){
|
||||
var item= data[i];
|
||||
containerWidth = contentdiv.width();
|
||||
containerHeight = contentdiv.height();
|
||||
|
||||
var left=containerWidth*item.posx/item.containerwidth;
|
||||
var top=containerHeight*item.posy/item.containerheight;
|
||||
var son="";
|
||||
//console.log((item.mPoint.exp))
|
||||
if(item.expressionflag!=null && item.expressionflag ){
|
||||
var path;
|
||||
if(item.mPoint==null || item.mPoint.exp ==null || item.mPoint.exp==""){
|
||||
path="";
|
||||
}else{
|
||||
path= MpPics[parseInt(item.mPoint.exp)].path;
|
||||
}
|
||||
son= '<div class="easyui-draggable" style="width:40px;height:40px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_MPoint}">'+
|
||||
'<img src=../../'+path+' style="width:20px;height:20px;" ></img>'+
|
||||
'</div>';
|
||||
}else{
|
||||
var value ="";
|
||||
if(item.mPoint!=null){
|
||||
value=item.mPoint.parmvalue
|
||||
}
|
||||
son= '<div class="easyui-draggable" style="background-color:blue;width:150px;height:40px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_MPoint}">'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
item.txt+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
value+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
}
|
||||
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
|
||||
$('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mPoint').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
});
|
||||
$('#'+item.id).draggable()
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
function mPointMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteMPoint.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
$('#'+selectid).remove();
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
function showEM(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
$.post(ext.contextPath + "/work/scadaPic/getEMList.do", {pid:workshopid}, function(data) {
|
||||
//console.info(data)
|
||||
clearItem("${Flag_EM}");
|
||||
if (data.length>0) {
|
||||
for(i=0 ;i<data.length;i++){
|
||||
var item= data[i];
|
||||
containerWidth = contentdiv.width();
|
||||
containerHeight = contentdiv.height();
|
||||
|
||||
var left=containerWidth*item.posx/item.containerwidth;
|
||||
var top=containerHeight*item.posy/item.containerheight;
|
||||
var w=containerWidth*item.width/item.containerwidth;
|
||||
var h=containerHeight*item.height/item.containerheight;
|
||||
var son= '<div class="easyui-draggable easyui-resizable" style="border:1px solid yellow;width:'+w+'px;height:'+h+'px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_EM}">'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
item.equipmentCard.equipmentname+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
|
||||
$('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mEM').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
});
|
||||
$('#'+item.id).draggable()
|
||||
$('#'+item.id).resizable()
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
function mEMMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteEM.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
$('#'+selectid).remove();
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
54
bin/WebRoot/jsp/work/scadapic/prodManagementDesign_Pic.jsp
Normal file
54
bin/WebRoot/jsp/work/scadapic/prodManagementDesign_Pic.jsp
Normal file
@ -0,0 +1,54 @@
|
||||
<!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="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
/* function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/work/workshop/update.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
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() {
|
||||
//附件加载
|
||||
new commfile('document.DocFileMapper','${param.pid}').loadfile();
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" name="id" value="${param.pid}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>工序名称</th>
|
||||
<td colspan="3"><span >${param.pname }</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<a class="easyui-linkbutton" href="javascript:new commfile('document.DocFileMapper','${param.pid}').showUpload();">监测图片上传</a>
|
||||
</th>
|
||||
<td colspan="3">
|
||||
<div id="fileList"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
69
bin/WebRoot/jsp/work/scadapic/prodManagementViewItem.jsp
Normal file
69
bin/WebRoot/jsp/work/scadapic/prodManagementViewItem.jsp
Normal file
@ -0,0 +1,69 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script src="<%=contextPath%>/JS/activiti/workflow_xml.js" type="text/javascript"></script>
|
||||
<script src="<%=contextPath%>/JS/qtip/jquery.qtip.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
|
||||
|
||||
|
||||
var searchgrid = function() {
|
||||
grid.datagrid('load',ext.contextPath + '/work/workorder/getlist.do?'+$('#searchForm').serialize());
|
||||
};
|
||||
var viewFun = function(ppid) {
|
||||
/* var dialog = parent.ext.modalDialog({
|
||||
title : '查看用户信息',
|
||||
url : ext.contextPath + '/work/group/view.do?id=' + id
|
||||
}); */
|
||||
//alert(pid+","+ppid);
|
||||
graphTrace('${param.type}',ppid);
|
||||
};
|
||||
$(function() {
|
||||
viewFun('${param.processid}');
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="border:false" style="overflow-x:scroll;">
|
||||
<!-- <div data-options="region:'west'" style="width:250px;" >
|
||||
<table data-options="fit:true,border:false" style="margin:auto">
|
||||
<caption style="padding:10px 10px;font-size:16dp;">换架</caption>
|
||||
<tr >
|
||||
<td>RFID编码</td>
|
||||
<td style="text-align:center">
|
||||
<input id="shiftno" name="shiftno" class="easyui-textbox" style="width:170px" data-options="validType:'isBlank'"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td>玻璃片数</td>
|
||||
<td>
|
||||
<input id="amount" name="amount" class="easyui-textbox" style="width:170px" data-options="validType:'isBlank'"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align:middle; text-align:center;">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"
|
||||
onclick="saveRecord();">保存</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div> -->
|
||||
</body>
|
||||
</html>
|
||||
548
bin/WebRoot/jsp/work/scadapic/prodManagementViewPIC.jsp
Normal file
548
bin/WebRoot/jsp/work/scadapic/prodManagementViewPIC.jsp
Normal file
@ -0,0 +1,548 @@
|
||||
<%@page import="com.sipai.entity.work.ScadaPic_Txt"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<% request.setAttribute("Flag_Txt", ScadaPic_Txt.Flag_Txt);%>
|
||||
<% request.setAttribute("Flag_MPoint", ScadaPic_Txt.Flag_MPoint);%>
|
||||
<% request.setAttribute("Flag_EM", ScadaPic_Txt.Flag_EM);%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
//为保存布局
|
||||
function setdata() {
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
for(var i=0;i<obj.length;i++){
|
||||
//console.info(obj[i].className.indexOf("easyui-draggable"));
|
||||
if(obj[i].className.indexOf("easyui-draggable")>=0){
|
||||
console.info(obj[i].style.width);
|
||||
$.post(ext.contextPath + '/work/scadaPic/updateLayout.do', {type:obj[i].getAttribute("type"), id:obj[i].id , posx:obj[i].style.left , posy:obj[i].style.top,
|
||||
containerWidth:obj[i].parentNode.style.width,containerHeight:obj[i].parentNode.style.height,
|
||||
width:obj[i].style.width,height:obj[i].style.height}, function(data) {
|
||||
if(data.res!=1){
|
||||
top.$.messager.alert('提示','更新失败','info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addmp(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加测量点',
|
||||
width:600,
|
||||
height:400,
|
||||
url : ext.contextPath + '/work/scadaPic/addMPoint.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showMPoint();
|
||||
}
|
||||
});
|
||||
}
|
||||
function addequ(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加设备',
|
||||
width:600,
|
||||
height:400,
|
||||
url : ext.contextPath + '/work/scadaPic/addEM.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showEM();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function addtext(){
|
||||
var width= $("#img").width();
|
||||
var height= $("#img").height();
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加文本',
|
||||
url : ext.contextPath + '/work/scadaPic/addTxt.do?containerwidth='+width+'&containerheight='+height+"&pid="+workshopid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog);
|
||||
}
|
||||
} ],
|
||||
onDestroy:function(){
|
||||
showTxt();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<input type="hidden" name="clientWidth" value="${clientWidth}">
|
||||
<input type="hidden" name="picid" value="${clientWidth}">
|
||||
<div id="toolbar" style="display: none;" data-options="region:'north',border:false">
|
||||
<table >
|
||||
<tr >
|
||||
<th>车间</th>
|
||||
<td ><input id="workshopid" name="workshopid" class="easyui-combobox" data-options="required:true,validType:'isBlank'" style="width: 180px;"/></td>
|
||||
<td style="vertical-align: middle">
|
||||
<div id="result">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td align="right" style="padding-left:10px;padding-right:10px">
|
||||
</td>
|
||||
<td width="5">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div >
|
||||
<div id ="content" data-options="region:'center',fit:true,border:false" >
|
||||
|
||||
</div>
|
||||
<div id="mTxt" class="easyui-menu" data-options="onClick:txtMenuHandler" style="width:120px;">
|
||||
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
||||
<div data-options="name:'help',iconCls:'icon-help'">属性</div>
|
||||
</div>
|
||||
<div id="mPoint" class="easyui-menu" data-options="onClick:mPointMenuHandler" style="width:120px;">
|
||||
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
||||
<div data-options="name:'help',iconCls:'icon-help'">属性</div>
|
||||
</div>
|
||||
<div id="mEM" class="easyui-menu" data-options="onClick:mEMMenuHandler" style="width:120px;">
|
||||
<div data-options="name:'delete',iconCls:'icon-remove'">删除</div>
|
||||
<div data-options="name:'help',iconCls:'icon-help'">属性</div>
|
||||
</div>
|
||||
<script>
|
||||
var contentdiv=$("#content");
|
||||
$(function(){
|
||||
window.onresize = changesize;
|
||||
$("#workshopid").combobox({
|
||||
url : ext.contextPath + '/work/scadaPic/getProdManagementViews4Combo.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onSelect: function () {
|
||||
contentdiv.empty();
|
||||
|
||||
var son='<img id="img" ondragstart="return false" style="width:100%;height:98%;"></img>'
|
||||
contentdiv.append(son);
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
var dates = $("#workshopid").combobox('getData');
|
||||
|
||||
for (var i=0;i< dates.length;i++) {
|
||||
//console.info(dates[i].id)
|
||||
if (dates[i].id == workshopid) {
|
||||
if(dates[i].commonFile!=null ){
|
||||
var abspath=dates[i].commonFile.abspath;
|
||||
abspath=abspath.substring(abspath.indexOf("webapps")+8);
|
||||
//abspath.replace("//","/");
|
||||
//alert(abspath)
|
||||
$("#img").attr("src","../../../"+abspath);
|
||||
//showTxt();
|
||||
//showMPoint();
|
||||
showEM();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
onLoadSuccess: function () {
|
||||
$("#workshopid").combobox('select','${param.id}');
|
||||
}
|
||||
|
||||
});
|
||||
//开启定时器刷新
|
||||
startClock();
|
||||
MpPics =JSON.parse(getMpPic());
|
||||
|
||||
});
|
||||
function startClock(){
|
||||
myrefresh();
|
||||
setTimeout('startClock()',5000);
|
||||
}
|
||||
|
||||
function myrefresh()
|
||||
{
|
||||
//contentdiv.empty();
|
||||
//showTxt();
|
||||
//showMPoint();
|
||||
showEM();
|
||||
}
|
||||
|
||||
//清除原先点
|
||||
function clearItem(type) {
|
||||
|
||||
var obj = document.getElementsByTagName("DIV");
|
||||
//循环逆序删除
|
||||
for(var i=obj.length-1;i>0;i--){
|
||||
//console.info(obj[i].className.indexOf("easyui-draggable"));
|
||||
//console.info(obj[i].getAttribute("type"));
|
||||
if(obj[i].className.indexOf("easyui-draggable")>=0 && obj[i].getAttribute("type")==type){
|
||||
//console.info(obj[i]);
|
||||
obj[i].remove();
|
||||
}
|
||||
}
|
||||
//console.log(obj.length)
|
||||
}
|
||||
|
||||
var firstOnResizeFire = true;//谷歌浏览器onresize事件会执行2次,这里加个标志位控制
|
||||
var containerWidth = 0;
|
||||
var containerHeight = 0;
|
||||
var selectid=""; //记录右键时,指向的对象
|
||||
function changesize(){
|
||||
if (firstOnResizeFire) {
|
||||
firstOnResizeFire = false;
|
||||
adjuest();
|
||||
//0.5秒之后将标志位重置(Chrome的window.onresize默认执行两次)
|
||||
setTimeout(function() {
|
||||
firstOnResizeFire = true;
|
||||
}, 500);
|
||||
}
|
||||
|
||||
}
|
||||
function adjuest(){
|
||||
var obj = contentdiv.find("div");
|
||||
var width =document.body.clientWidth;//onresize方法测试时,只有body的clientwidth是改变后的值
|
||||
var height =document.body.clientHeight// $("#content").height();
|
||||
for(var i=0;i<obj.length;i++){
|
||||
if(obj[i].className.indexOf("easyui-draggable")>=0){
|
||||
|
||||
var jobj=$("#"+obj[i].id);
|
||||
//console.info("新对象",jobj.position().left);
|
||||
var left=width*jobj.position().left/containerWidth;
|
||||
var top=height*jobj.position().top/containerHeight;
|
||||
//console.info("新左距离",left);
|
||||
jobj.css("left",left);
|
||||
jobj.css("top",top);
|
||||
//console.info("文本的左距离",jobj.position().left);
|
||||
//console.info("容器的宽度",width);
|
||||
//console.info("body的宽度",);
|
||||
|
||||
}
|
||||
if(obj[i].className.indexOf("easyui-resizable")>=0){
|
||||
|
||||
var jobj=$("#"+obj[i].id);
|
||||
//console.info("新对象",jobj.width());
|
||||
var w=width*jobj.width()/containerWidth;
|
||||
var h=height*jobj.height()/containerHeight;
|
||||
//console.info("新左距离",left);
|
||||
jobj.css("width",w);
|
||||
jobj.css("height",h);
|
||||
//console.info("文本的左距离",jobj.position().left);
|
||||
//console.info("容器的宽度",width);
|
||||
//console.info("body的宽度",);
|
||||
|
||||
}
|
||||
}
|
||||
//
|
||||
containerWidth =width;
|
||||
containerHeight=height;
|
||||
}
|
||||
function showTxt(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
$.post(ext.contextPath + "/work/scadaPic/getTxtList.do", {pid:workshopid}, function(data) {
|
||||
clearItem("${Flag_Txt}");
|
||||
//console.info(data)
|
||||
if (data.length>0) {
|
||||
for(i=0 ;i<data.length;i++){
|
||||
var item= data[i];
|
||||
containerWidth = contentdiv.width();
|
||||
containerHeight = contentdiv.height();
|
||||
|
||||
var left=containerWidth*item.posx/item.containerwidth;
|
||||
var top=containerHeight*item.posy/item.containerheight;
|
||||
var son= '<div class="easyui-draggable" style="background-color:green;width:100px;height:20px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_Txt}">'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
item.content+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
|
||||
/* $('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mTxt').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
}); */
|
||||
//$('#'+item.id).draggable()
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
function txtMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteTxt.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
$('#'+selectid).remove();
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
var MpPics;
|
||||
function showMPoint(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
$.post(ext.contextPath + "/work/scadaPic/getMPointList.do", {pid:workshopid}, function(data) {
|
||||
//console.info(data)
|
||||
clearItem("${Flag_MPoint}");
|
||||
if (data.length>0) {
|
||||
for(i=0 ;i<data.length;i++){
|
||||
var item= data[i];
|
||||
containerWidth = contentdiv.width();
|
||||
containerHeight = contentdiv.height();
|
||||
|
||||
var left=containerWidth*item.posx/item.containerwidth;
|
||||
var top=containerHeight*item.posy/item.containerheight;
|
||||
var son="";
|
||||
//console.log((item.mPoint.exp))
|
||||
if(item.expressionflag!=null && item.expressionflag ){
|
||||
var path;
|
||||
if(item.mPoint==null || item.mPoint.exp ==null || item.mPoint.exp==""){
|
||||
path="";
|
||||
}else{
|
||||
path= MpPics[parseInt(item.mPoint.exp)].path;
|
||||
}
|
||||
son= '<div class="easyui-draggable" style="width:40px;height:40px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_MPoint}">'+
|
||||
'<img src=../../'+path+' style="width:20px;height:20px;" ></img>'+
|
||||
'</div>';
|
||||
}else{
|
||||
var value ="";
|
||||
if(item.mPoint!=null){
|
||||
value=item.mPoint.parmvalue
|
||||
}
|
||||
son= '<div class="easyui-draggable" style="background-color:blue;width:150px;height:40px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_MPoint}">'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
item.txt+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
value+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
}
|
||||
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
|
||||
/* $('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mPoint').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
}); */
|
||||
//$('#'+item.id).draggable()
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
function mPointMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteMPoint.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
$('#'+selectid).remove();
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
function showEM(){
|
||||
var workshopid = $("#workshopid").combobox('getValue');
|
||||
|
||||
$.post(ext.contextPath + "/work/scadaPic/getEMList.do", {pid:workshopid,type:'${param.id}'}, function(data) {
|
||||
//console.info(data)
|
||||
clearItem("${Flag_EM}");
|
||||
if (data.length>0) {
|
||||
for(i=0 ;i<data.length;i++){
|
||||
var item= data[i];
|
||||
containerWidth = contentdiv.width();
|
||||
containerHeight = contentdiv.height();
|
||||
|
||||
var left=containerWidth*item.posx/item.containerwidth;
|
||||
var top=containerHeight*item.posy/item.containerheight;
|
||||
var w=containerWidth*item.width/item.containerwidth;
|
||||
var h=containerHeight*item.height/item.containerheight;
|
||||
var son= '<div class="easyui-draggable easyui-resizable" style="border:1px solid yellow;width:'+w+'px;height:'+h+'px;position:absolute;top:'+top+'px;left:'+left+'px;" id="'+item.id+'" type="${Flag_EM}" equipid='+item.equipid+'>'+
|
||||
'<table id="title" style="font-size:12px" >'+
|
||||
'<tr align="center">'+
|
||||
'<td ><span style="color:white;font-size:'+item.fsize+'">'+
|
||||
''+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'</div>';
|
||||
|
||||
//console.info(son)
|
||||
contentdiv.append(son);
|
||||
/* $('#'+item.id).bind('contextmenu',function(e){
|
||||
selectid=this.id;
|
||||
e.preventDefault();
|
||||
$('#mEM').menu('show', {
|
||||
left: e.pageX,
|
||||
top: e.pageY
|
||||
});
|
||||
}); */
|
||||
//$('#'+item.id).draggable()
|
||||
//$('#'+item.id).resizable()
|
||||
$('#'+item.id).click(function(){
|
||||
//console.info(this)
|
||||
showEMInfo(this.getAttribute("equipid"));
|
||||
//console.info(this)
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
};
|
||||
function showEMInfo(str){
|
||||
$.post(ext.contextPath + "/equipment/getEquipmentCardInfo.do", {id:str}, function(data) {
|
||||
//console.info(data)
|
||||
var sons;
|
||||
if (data !=null) {
|
||||
sons= '<div id ="equipInfo" style="border:1px solid yellow;position:absolute;width: 180px;height:200px;top:0px;left:0px">'+
|
||||
'<table id="info" style="font-size:12px" >'+
|
||||
'<tr align="left">'+
|
||||
'<td ><span style="color:white;">设备名称:</span></td>'+
|
||||
'<td ><span style="color:white;">'+
|
||||
data.equipmentname+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="left">'+
|
||||
'<td ><span style="color:white;">状态:</span></td>'+
|
||||
'<td ><span style="color:white;">'+
|
||||
data.currentmanageflag+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="left">'+
|
||||
'<td ><span style="color:white;">排产情况:</span></td>'+
|
||||
'</tr>'+
|
||||
'<tr align="left">'+
|
||||
'<td ><span style="color:white;">'+
|
||||
getInfoFromArrangement(data.equipmentArrangements)+
|
||||
'</span></td>'+
|
||||
'</tr>'+
|
||||
'</table>'+
|
||||
'<div id ="arrangeInfo" >'+
|
||||
'</div>'+
|
||||
'</div>';
|
||||
|
||||
}
|
||||
//console.info(sons)
|
||||
//if(!$("#equipInfo")){
|
||||
$("#equipInfo").remove();
|
||||
//}
|
||||
contentdiv.append(sons);
|
||||
//showArrangeGrid(data.id,"2017-10-13");
|
||||
},'json');
|
||||
|
||||
|
||||
};
|
||||
function mEMMenuHandler(item){
|
||||
switch(item.name){
|
||||
case'delete':
|
||||
$.post(ext.contextPath + "/work/scadaPic/deleteEM.do", {id:selectid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
$('#'+selectid).remove();
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
};
|
||||
function getInfoFromArrangement(arrangement){
|
||||
var str ="";
|
||||
var workorderno="";
|
||||
$.each(arrangement, function(index, item){
|
||||
//console.log(item);
|
||||
if(str !=""){
|
||||
str+="<br />";
|
||||
}
|
||||
if(workorderno!=item._workorderno){
|
||||
workorderno=item._workorderno;
|
||||
str=str+"工单编号:"+workorderno+"<br />";
|
||||
}
|
||||
|
||||
|
||||
if(item.checkFlag){
|
||||
str+= item.gt_name+": "+ item.stdt.substring(11,16)+" ~ "+item.enddt.substring(11,16);
|
||||
}
|
||||
});
|
||||
//alert(JSON.stringify(arrangement))
|
||||
//alert(str)
|
||||
//console.info(arrangement)
|
||||
return str;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
103
bin/WebRoot/jsp/work/scadapic/scadaPic_EMAdd.jsp
Normal file
103
bin/WebRoot/jsp/work/scadapic/scadaPic_EMAdd.jsp
Normal file
@ -0,0 +1,103 @@
|
||||
<!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) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/work/scadaPic/saveEM.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("#equipname").textbox('textbox').bind("click", function () {
|
||||
selectEM();
|
||||
});
|
||||
});
|
||||
function selectEM(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择测量点',
|
||||
width: 800,
|
||||
height:550,
|
||||
url : ext.contextPath + '/equipment/showEquipmentCardForSelect.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
console.info(res)
|
||||
$("#equipname").textbox('setValue',res.equipmentname);
|
||||
$("#equipid").val(res.id);
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input name="containerwidth" type="hidden" value="${param.containerwidth}"/>
|
||||
<input name="containerheight" type="hidden" value="${param.containerheight}"/>
|
||||
<input name="pid" type="hidden" value="${param.pid}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>设备名称</th>
|
||||
<td><input id="equipname" name="equipname" class="easyui-textbox" data-options="required:true,validType:'isBlank',prompt:'单击选择'" value="" />
|
||||
<input id="equipid" name="equipid" type="hidden" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>posx</th>
|
||||
<td>
|
||||
<input id="posx" name="posx" class="easyui-textbox" value="0"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>posy</th>
|
||||
<td>
|
||||
<input id="posy" name="posy" class="easyui-textbox" value="0"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>宽度</th>
|
||||
<td>
|
||||
<input id="width" name="width" class="easyui-textbox" value="200"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>高度</th>
|
||||
<td>
|
||||
<input id="height" name="height" class="easyui-textbox" value="100"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
225
bin/WebRoot/jsp/work/scadapic/scadaPic_MPointAdd.jsp
Normal file
225
bin/WebRoot/jsp/work/scadapic/scadaPic_MPointAdd.jsp
Normal file
@ -0,0 +1,225 @@
|
||||
<!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) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/work/scadaPic/saveMPoint.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
var grid;
|
||||
var MpPics;
|
||||
$(function() {
|
||||
$("#mpid").textbox('textbox').bind("click", function () {
|
||||
selectMPint();
|
||||
});
|
||||
$('#expressionflag').switchbutton({
|
||||
onChange: function(checked){
|
||||
if(checked==true){
|
||||
$('#tool').panel('open');
|
||||
$('#expressionflag').switchbutton("setValue",1);//选中是value为1
|
||||
showExpression()
|
||||
}else{
|
||||
$('#tool').panel('close');
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#tool').panel({
|
||||
width:"100%",
|
||||
height:"250",
|
||||
title: '表达式',
|
||||
tools: [{
|
||||
iconCls:'icon-add',
|
||||
handler:function(){addFun();}
|
||||
},{
|
||||
iconCls:'icon-remove',
|
||||
handler:function(){deletesFun();}
|
||||
}]
|
||||
|
||||
});
|
||||
$('#tool').panel('close');
|
||||
MpPics =JSON.parse(getMpPic());
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/scadaPic/getMPoint_ExpressionList.do?mpid='+mpid,
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '160', title : '表达式', field : 'expression', sortable : true, halign:'center'},
|
||||
{width : '100', title : '显示图标', field : 'expressionway', sortable : true, align:'center',formatter : function(value,row){
|
||||
|
||||
//console.log(MpPics[value].path)
|
||||
var pic='<img src=../../'+MpPics[value].path+' style="width:20px;height:20px;" ></img>';
|
||||
return pic;
|
||||
}}
|
||||
] ],
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
function showExpression(){
|
||||
|
||||
var mpid =$("#mpid").textbox('getValue');
|
||||
$('#grid').datagrid({url:ext.contextPath + '/work/scadaPic/getMPoint_ExpressionList.do?mpid='+mpid});
|
||||
|
||||
}
|
||||
function selectMPint(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择测量点',
|
||||
width: 800,
|
||||
height:550,
|
||||
url : ext.contextPath + '/work/mpoint/showlistForSelect.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
$("#mpid").textbox('setValue',res.id);
|
||||
$("#txt").textbox('setValue',res.parmname);
|
||||
}
|
||||
showExpression();
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
var addFun = function() {
|
||||
var mpid =$("#mpid").textbox('getValue');
|
||||
if(mpid==null || mpid==""){
|
||||
top.$.messager.alert('提示', '请先选择测量点!','info');
|
||||
return;
|
||||
}
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'add',
|
||||
title : '新增表达式',
|
||||
width:500,
|
||||
height:200,
|
||||
url : ext.contextPath + '/work/scadaPic/addMPointExpression.do?mpid='+mpid,
|
||||
buttons : [
|
||||
{
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas+=item.id;
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '未查询到需要删除的记录','info');
|
||||
}else{
|
||||
top.$.messager.confirm('提示', '您确定要删除多条记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/scadaPic/deleteMPointExpression.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
top.$.messager.alert('提示','成功删除'+data+'条记录','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input name="containerwidth" type="hidden" value="${param.containerwidth}"/>
|
||||
<input name="containerheight" type="hidden" value="${param.containerheight}"/>
|
||||
<input name="pid" type="hidden" value="${param.pid}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>测量点编号</th>
|
||||
<td><input id="mpid" name="mpid" class="easyui-textbox" data-options="required:true,validType:'isBlank',prompt:'单击选择'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>文本内容</th>
|
||||
<td><input id ="txt" name="txt" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>字体大小</th>
|
||||
<td>
|
||||
<input id="fsize" name="fsize" class="easyui-textbox" value="12px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>posx</th>
|
||||
<td>
|
||||
<input id="posx" name="posx" class="easyui-textbox" value="0"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>posy</th>
|
||||
<td>
|
||||
<input id="posy" name="posy" class="easyui-textbox" value="0"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>精确位数</th>
|
||||
<td>
|
||||
<input id="accuracy" name="accuracy" class="easyui-textbox" value="2"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>启用表达式</th>
|
||||
<td>
|
||||
<input id="expressionflag" name ="expressionflag"
|
||||
class="easyui-switchbutton" style="height:22px;width:50px;"
|
||||
data-options="onText:'是',offText:'否'" unchecked/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/>
|
||||
<div id="tool" class="easyui-panel" style="height:200px;width:100%;" data-options="border:true" >
|
||||
<table id="grid" data-options="border:false,fit:true" ></table>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
230
bin/WebRoot/jsp/work/scadapic/scadaPic_MPointEdit.jsp
Normal file
230
bin/WebRoot/jsp/work/scadapic/scadaPic_MPointEdit.jsp
Normal file
@ -0,0 +1,230 @@
|
||||
<!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) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/work/scadaPic/updateMPoint.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
var grid;
|
||||
var MpPics;
|
||||
$(function() {
|
||||
$("#mpid").textbox('textbox').bind("click", function () {
|
||||
selectMPint();
|
||||
});
|
||||
$('#expressionflag').switchbutton({
|
||||
onChange: function(checked){
|
||||
if(checked==true){
|
||||
$('#tool').panel('open');
|
||||
$('#expressionflag').switchbutton("setValue",1);//选中是value为1
|
||||
showExpression()
|
||||
}else{
|
||||
$('#tool').panel('close');
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#tool').panel({
|
||||
width:"100%",
|
||||
height:"250",
|
||||
title: '表达式',
|
||||
tools: [{
|
||||
iconCls:'icon-add',
|
||||
handler:function(){addFun();}
|
||||
},{
|
||||
iconCls:'icon-remove',
|
||||
handler:function(){deletesFun();}
|
||||
}]
|
||||
|
||||
});
|
||||
$('#tool').panel('close');
|
||||
MpPics =JSON.parse(getMpPic());
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/scadaPic/getMPoint_ExpressionList.do?mpid='+mpid,
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '160', title : '表达式', field : 'expression', sortable : true, halign:'center'},
|
||||
{width : '100', title : '显示图标', field : 'expressionway', sortable : true, align:'center',formatter : function(value,row){
|
||||
|
||||
//console.log(MpPics[value].path)
|
||||
var pic='<img src=../../'+MpPics[value].path+' style="width:20px;height:20px;" ></img>';
|
||||
return pic;
|
||||
}}
|
||||
] ],
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
if("${scadaPic_MPoint.expressionflag}"=='1'){
|
||||
$('#expressionflag').switchbutton("check");
|
||||
}
|
||||
|
||||
});
|
||||
function showExpression(){
|
||||
|
||||
var mpid =$("#mpid").textbox('getValue');
|
||||
$('#grid').datagrid({url:ext.contextPath + '/work/scadaPic/getMPoint_ExpressionList.do?mpid='+mpid});
|
||||
|
||||
}
|
||||
function selectMPint(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择测量点',
|
||||
width: 800,
|
||||
height:550,
|
||||
url : ext.contextPath + '/work/mpoint/showlistForSelect.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
$("#mpid").textbox('setValue',res.id);
|
||||
$("#txt").textbox('setValue',res.parmname);
|
||||
}
|
||||
showExpression();
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
var addFun = function() {
|
||||
var mpid =$("#mpid").textbox('getValue');
|
||||
if(mpid==null || mpid==""){
|
||||
top.$.messager.alert('提示', '请先选择测量点!','info');
|
||||
return;
|
||||
}
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'add',
|
||||
title : '新增表达式',
|
||||
width:500,
|
||||
height:200,
|
||||
url : ext.contextPath + '/work/scadaPic/addMPointExpression.do?mpid='+mpid,
|
||||
buttons : [
|
||||
{
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
if(datas!=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas+=item.id;
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '未查询到需要删除的记录','info');
|
||||
}else{
|
||||
top.$.messager.confirm('提示', '您确定要删除多条记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/scadaPic/deleteMPointExpression.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
top.$.messager.alert('提示','成功删除'+data+'条记录','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${scadaPic_MPoint.id}"/>
|
||||
<input name="containerwidth" type="hidden" value="${scadaPic_MPoint.containerwidth}"/>
|
||||
<input name="containerheight" type="hidden" value="${scadaPic_MPoint.containerheight}"/>
|
||||
<input name="pid" type="hidden" value="${scadaPic_MPoint.pid}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>测量点编号</th>
|
||||
<td><input id="mpid" name="mpid" class="easyui-textbox" data-options="required:true,validType:'isBlank',prompt:'单击选择'" value="${scadaPic_MPoint.mpid}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>文本内容</th>
|
||||
<td><input id ="txt" name="txt" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${scadaPic_MPoint.txt}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>字体大小</th>
|
||||
<td>
|
||||
<input id="fsize" name="fsize" class="easyui-textbox" value="${scadaPic_MPoint.fsize}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>posx</th>
|
||||
<td>
|
||||
<input id="posx" name="posx" class="easyui-textbox" value="${scadaPic_MPoint.posx}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>posy</th>
|
||||
<td>
|
||||
<input id="posy" name="posy" class="easyui-textbox" value="${scadaPic_MPoint.posy}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>精确位数</th>
|
||||
<td>
|
||||
<input id="accuracy" name="accuracy" class="easyui-textbox" value="${scadaPic_MPoint.accuracy}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>启用表达式</th>
|
||||
<td>
|
||||
<input id="expressionflag" name ="expressionflag"
|
||||
class="easyui-switchbutton" style="height:22px;width:50px;"
|
||||
data-options="onText:'是',offText:'否'" unchecked/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/>
|
||||
<div id="tool" class="easyui-panel" style="height:200px;width:100%;" data-options="border:true" >
|
||||
<table id="grid" data-options="border:false,fit:true" ></table>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
122
bin/WebRoot/jsp/work/scadapic/scadaPic_MPointView.jsp
Normal file
122
bin/WebRoot/jsp/work/scadapic/scadaPic_MPointView.jsp
Normal file
@ -0,0 +1,122 @@
|
||||
<!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">
|
||||
var grid;
|
||||
var MpPics;
|
||||
$(function() {
|
||||
$('#expressionflag').switchbutton({
|
||||
onChange: function(checked){
|
||||
if(checked==true){
|
||||
$('#tool').panel('open');
|
||||
$('#expressionflag').switchbutton("setValue",1);//选中是value为1
|
||||
showExpression()
|
||||
}else{
|
||||
$('#tool').panel('close');
|
||||
}
|
||||
}
|
||||
});
|
||||
$('#tool').panel('close');
|
||||
MpPics =JSON.parse(getMpPic());
|
||||
$('#tool').panel({
|
||||
width:"100%",
|
||||
height:"250",
|
||||
title: '表达式',
|
||||
|
||||
});
|
||||
var mpid ="${scadaPic_MPoint.mpid}";
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/scadaPic/getMPoint_ExpressionList.do?mpid='+mpid,
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{width : '160', title : '表达式', field : 'expression', sortable : true, halign:'center'},
|
||||
{width : '100', title : '显示图标', field : 'expressionway', sortable : true, align:'center',formatter : function(value,row){
|
||||
|
||||
//console.log(MpPics[value].path)
|
||||
var pic='<img src=../../'+MpPics[value].path+' style="width:20px;height:20px;" ></img>';
|
||||
return pic;
|
||||
}}
|
||||
] ],
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
if("${scadaPic_MPoint.expressionflag}"=='1'){
|
||||
$('#expressionflag').switchbutton("check");
|
||||
}
|
||||
|
||||
});
|
||||
function showExpression(){
|
||||
|
||||
var mpid ="${scadaPic_MPoint.mpid}";
|
||||
$('#grid').datagrid({url:ext.contextPath + '/work/scadaPic/getMPoint_ExpressionList.do?mpid='+mpid});
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input name="mpid" type="hidden" value="${scadaPic_MPoint.mpid}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>测量点编号</th>
|
||||
<td>${scadaPic_MPoint.mpid}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>文本内容</th>
|
||||
<td>${scadaPic_MPoint.txt}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>字体大小</th>
|
||||
<td>
|
||||
${scadaPic_MPoint.fsize}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>posx</th>
|
||||
<td>
|
||||
${scadaPic_MPoint.posx}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>posy</th>
|
||||
<td>
|
||||
${scadaPic_MPoint.posy}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>精确位数</th>
|
||||
<td>
|
||||
${scadaPic_MPoint.accuracy}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>启用表达式</th>
|
||||
<td>
|
||||
<input id="expressionflag" name ="expressionflag"
|
||||
class="easyui-switchbutton" style="height:22px;width:50px;"
|
||||
data-options="onText:'是',offText:'否'" unchecked disabled/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/>
|
||||
<div id="tool" class="easyui-panel" style="height:200px;width:100%;" data-options="border:true" >
|
||||
<table id="grid" data-options="border:false,fit:true" ></table>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,60 @@
|
||||
<!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 + "/work/scadaPic/saveMPointExpression.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
dialog.dialog('destroy');
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
$(function() {
|
||||
var json =JSON.parse(getMpPic());
|
||||
//console.log(json)
|
||||
$("#expressionway").combobox({
|
||||
data : json,
|
||||
valueField : 'id',
|
||||
textField : 'id',
|
||||
panelHeight:'auto',
|
||||
formatter:function (row){
|
||||
var pic='<img src=../../'+row.path+' style="width:20px;height:20px;" ></img>';
|
||||
//console.log(row)
|
||||
return pic;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input name="mpid" type="hidden" value="${param.mpid}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>表达式</th>
|
||||
<td><input id="expression" name="expression" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
|
||||
(例:2-5,>4,<6,7)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>显示样式</th>
|
||||
<td><input id ="expressionway" name="expressionway" class="easyui-combobox" data-options="required:true,validType:'isBlank'" />
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
63
bin/WebRoot/jsp/work/scadapic/scadaPic_TxtAdd.jsp
Normal file
63
bin/WebRoot/jsp/work/scadapic/scadaPic_TxtAdd.jsp
Normal file
@ -0,0 +1,63 @@
|
||||
<!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) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/work/scadaPic/saveTxt.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data.res == 0){
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input name="containerwidth" type="hidden" value="${param.containerwidth}"/>
|
||||
<input name="containerheight" type="hidden" value="${param.containerheight}"/>
|
||||
<input name="pid" type="hidden" value="${param.pid}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>文本内容</th>
|
||||
<td><input name="content" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>字体大小</th>
|
||||
<td>
|
||||
<input id="fsize" name="fsize" class="easyui-textbox" value="12px"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>posx</th>
|
||||
<td>
|
||||
<input id="posx" name="posx" class="easyui-textbox" value="0"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>posy</th>
|
||||
<td>
|
||||
<input id="posy" name="posy" class="easyui-textbox" value="0"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
64
bin/WebRoot/jsp/work/scadapic/workShopInfos4main.jsp
Normal file
64
bin/WebRoot/jsp/work/scadapic/workShopInfos4main.jsp
Normal file
@ -0,0 +1,64 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" import="java.util.*" pageEncoding="UTF-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<script type="text/javascript">
|
||||
var fillDataFun = function(id,name) {
|
||||
var divstr='<div data-options="border:true" style="padding:5px 0 5px 0;margin:10px;border:2px solid #95b8e7;border-radius:6px;">'+
|
||||
'<div style="height:20px;font-weight:bold;">'+name+'</div>'+
|
||||
'<table id="'+id+'_info" style="height:200px;" data-options="border:true"></table>'+
|
||||
'<div id="'+id+'_equ" style="height:20px;margin:5px">设备统计:</div>'+
|
||||
'</div>'
|
||||
//console.log(divstr)
|
||||
$('#contentDiv').append(divstr)
|
||||
$.post(ext.contextPath + '/work/scadaPic/getWorkShopInfo.do', {workShopId:id}, function(data) {
|
||||
var workInfo=JSON.parse(data);
|
||||
//console.log($('#'+id+'_equ'))
|
||||
$('#'+id+'_info').datagrid({
|
||||
title : '',
|
||||
data :workInfo.res,
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
//{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '产品名称', field : 'productname', sortable : false, halign:'center'},
|
||||
{width : '150', title : '产品编码', field : 'productno', sortable : false, halign:'center'},
|
||||
{width : '100', title : '当天计划产量', field : 'preamount', sortable : false, halign:'center'},
|
||||
{width : '100', title : '当天实际产量', field: 'productno', sortable : false, halign:'center'},
|
||||
{width : '100', title : '实际良率', field : ' _actyield', sortable : false, halign:'center'}
|
||||
] ],
|
||||
/* toolbar : '#toolbar', */
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
$('#'+id+'_equ').html("设备情况:设备总数"+workInfo.equinfo.sum+"台,正在运行"+workInfo.equinfo.run_num+"台,故障"+workInfo.equinfo.fault_num+"台");
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
$.post(ext.contextPath + '/work/workshop/getlist4Combo.do', {}, function(data) {
|
||||
var workshop=JSON.parse(data);
|
||||
for(var i=0; i<workshop.length;i++){
|
||||
fillDataFun(workshop[i].id,workshop[i].name);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
<div class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="contentDiv" data-options="region:'center',fit:true,border:false" style="padding:5px;overflow :yes">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
91
bin/WebRoot/jsp/work/websockettest.jsp
Normal file
91
bin/WebRoot/jsp/work/websockettest.jsp
Normal file
@ -0,0 +1,91 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%request.setAttribute("Alarm_PRO",CommString.Alarm_PRO);%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Java后端WebSocket的Tomcat实现</title>
|
||||
</head>
|
||||
<body>
|
||||
Welcome '${Alarm_PRO}'<br/><input id="text" type="text"/>
|
||||
<button onclick="send()">发送消息</button>
|
||||
<hr/>
|
||||
<button onclick="closeWebSocket()">关闭WebSocket连接</button>
|
||||
<hr/>
|
||||
<div id="message"></div>
|
||||
</body>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script src="<%=contextPath%>/JS/reconnecting-websocket.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
var websocket = null;
|
||||
//判断当前浏览器是否支持WebSocket
|
||||
if ('WebSocket' in window) {
|
||||
var str=ext.basePath.replace("http","ws")+"/websocket/${Alarm_PRO}";
|
||||
console.info(str)
|
||||
websocket = new ReconnectingWebSocket(str);//"ws://192.168.10.3:8080/PlantEngine_RLD"
|
||||
}
|
||||
else {
|
||||
alert('当前浏览器 Not support websocket')
|
||||
}
|
||||
|
||||
//连接发生错误的回调方法
|
||||
websocket.onerror = function () {
|
||||
setMessageInnerHTML("WebSocket连接发生错误");
|
||||
};
|
||||
|
||||
//连接成功建立的回调方法
|
||||
websocket.onopen = function () {
|
||||
setMessageInnerHTML("WebSocket连接成功");
|
||||
}
|
||||
|
||||
//接收到消息的回调方法
|
||||
websocket.onmessage = function (event) {
|
||||
/* var dialog = top.ext.modalDialog({
|
||||
title : '添加班次',
|
||||
width : 600,
|
||||
height : 400,
|
||||
resizable:true,
|
||||
url : ext.contextPath + '/work/groupManage/add.do',
|
||||
buttons : [{
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
//dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
}]
|
||||
}); */
|
||||
setMessageInnerHTML(event.data);
|
||||
}
|
||||
|
||||
//连接关闭的回调方法
|
||||
websocket.onclose = function () {
|
||||
websocket.close();
|
||||
setMessageInnerHTML("WebSocket连接关闭");
|
||||
}
|
||||
|
||||
//监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。
|
||||
window.onbeforeunload = function () {
|
||||
closeWebSocket();
|
||||
}
|
||||
|
||||
//将消息显示在网页上
|
||||
function setMessageInnerHTML(innerHTML) {
|
||||
document.getElementById('message').innerHTML += innerHTML + '<br/>';
|
||||
}
|
||||
|
||||
//关闭WebSocket连接
|
||||
function closeWebSocket() {
|
||||
websocket.close();
|
||||
}
|
||||
|
||||
//发送消息
|
||||
function send() {
|
||||
var message = document.getElementById('text').value;
|
||||
websocket.send(message);
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
58
bin/WebRoot/jsp/work/wfHighCurrentTest.jsp
Normal file
58
bin/WebRoot/jsp/work/wfHighCurrentTest.jsp
Normal file
@ -0,0 +1,58 @@
|
||||
<!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 + "/work/workOrderExcute/excuteHighCurrentTest.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
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');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="tt">
|
||||
<a href="javascript:void(0)" class="icon-save" title="保存" onclick="dosave()"></a>
|
||||
</div>
|
||||
<div class="easyui-panel" title="任务" style="padding:10px;"
|
||||
data-options="tools:'#tt'">
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${workOrderExcute.id}"/>
|
||||
<input name="wftaskid" type="hidden" value="${workOrderExcute.wftaskid}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>测试结果</th>
|
||||
<td>
|
||||
<select class="easyui-combobox" name="pass" style="width:100px;">
|
||||
<option value="1">通过</option>
|
||||
<option value="0">不通过</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td>
|
||||
<input name="remark" class="easyui-textbox" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
79
bin/WebRoot/jsp/work/workOrderExcuteAdd.jsp
Normal file
79
bin/WebRoot/jsp/work/workOrderExcuteAdd.jsp
Normal file
@ -0,0 +1,79 @@
|
||||
<!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 + "/work/workorder/save.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
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() {
|
||||
/* $('#lineid').combobox({
|
||||
url : ext.contextPath + '/work/line/getSelectList.do?random=' + Math.random(),
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
width:250,
|
||||
panelHeight:'auto'
|
||||
});
|
||||
|
||||
$('#typeid').combobox({
|
||||
url : ext.contextPath + '/work/workstationType/getselectlist.do?random=' + Math.random(),
|
||||
valueField:'id',
|
||||
textField:'name',
|
||||
method:'get'
|
||||
}); */
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>产品编码</th>
|
||||
<td><input name="productno" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>生产订单号</th>
|
||||
<td><input name="taskno" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品规格</th>
|
||||
<td><input name="productformat" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>交货日期</th>
|
||||
<td><input name="eddt" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
49
bin/WebRoot/jsp/work/workOrderExcuteEdit.jsp
Normal file
49
bin/WebRoot/jsp/work/workOrderExcuteEdit.jsp
Normal file
@ -0,0 +1,49 @@
|
||||
<!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 + "/work/workOrderExcute/update.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
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');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="tt">
|
||||
<a href="javascript:void(0)" class="icon-save" title="保存" onclick="dosave()"></a>
|
||||
</div>
|
||||
<div class="easyui-panel" title="任务" style="padding:10px;"
|
||||
data-options="tools:'#tt'">
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${workOrderExcute.id}"/>
|
||||
<input name="wftaskid" type="hidden" value="${workOrderExcute.wftaskid}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td>
|
||||
<input name="remark" class="easyui-textbox" value="${workOrderExcute.remark}" validtype="length[0,250]" invalidMessage="有效长度0-250"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
62
bin/WebRoot/jsp/work/workOrderSwitchLineList.jsp
Normal file
62
bin/WebRoot/jsp/work/workOrderSwitchLineList.jsp
Normal file
@ -0,0 +1,62 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>切换产线</title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/process/real/getLineListByRealid.do?realid=${workOrder.processrealid}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
singleSelect: true,
|
||||
checkOnSelect:true,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '200', title : '产线编号', field : 'serial', sortable : true, halign:'center'},
|
||||
{width : '140', title : '部门名称', field : 'deptname', sortable : true, halign:'center'},
|
||||
{width : '180', title : '产线名称', field : 'name', sortable : true, halign:'center'}
|
||||
] ],
|
||||
onLoadSuccess:function(data){
|
||||
$('#grid').datagrid("selectRecord","${workOrder.lineid}");
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function selectOK(dialog,grid) {
|
||||
var selectLineid=$('#grid').datagrid("getChecked")[0].id;
|
||||
if(selectLineid != "${workOrder.lineid}"){//当数据有变化时才执行
|
||||
top.$.messager.confirm('提示', '切换产线后,未执行的工序需要重新配置工位,是否继续?', function(r) {
|
||||
if(r){
|
||||
$.post(ext.contextPath + '/work/workorder/updateswitchline.do?id=${param.id}&lineid='+selectLineid ,function(data){
|
||||
if(data.res=='1'){
|
||||
top.$.messager.alert('提示', '切换成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('提示', '切换失败','info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
});
|
||||
}else{
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</body>
|
||||
</html>
|
||||
280
bin/WebRoot/jsp/work/workOrderTaskList.jsp
Normal file
280
bin/WebRoot/jsp/work/workOrderTaskList.jsp
Normal file
@ -0,0 +1,280 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.plan.DailyPlanTaskDemand"%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
|
||||
|
||||
<%request.setAttribute("Flag_Start",DailyPlanTaskDemand.Flag_Start);%>
|
||||
<%request.setAttribute("Flag_Report",DailyPlanTaskDemand.Flag_Report);%>
|
||||
<%request.setAttribute("Flag_CarryOver",DailyPlanTaskDemand.Flag_CarryOver);%>
|
||||
|
||||
<%request.setAttribute("resp_pass",CommString.Resp_Success);%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workorder/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
var districtwork = function(planid,workorderid,processid){
|
||||
//alert(planid+workorderid+processid)
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '任务调度',
|
||||
url : ext.contextPath + '/work/workorder/districtwork.do?planid='+planid+'&workorderid='+workorderid+'&processid='+processid,
|
||||
width:1000,
|
||||
height:500,
|
||||
onClose:function(){
|
||||
var res=dialog.find('iframe').get(0).contentWindow.returnVal;
|
||||
if(res=="refresh"){
|
||||
$('#grid').datagrid("reload");
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var searchgrid = function() {
|
||||
grid.datagrid('load',ext.contextPath + '/work/workorder/getTaskList.do?'+$('#searchForm').serialize());
|
||||
};
|
||||
|
||||
function onchangedate(){
|
||||
var date=$("#nowdate").val();
|
||||
loadworkorders(date);
|
||||
}
|
||||
function loadworkorders(date){
|
||||
$("#workorderno").combobox({
|
||||
url : ext.contextPath + '/work/workorder/getActlist4Select.do?nowdate='+date,
|
||||
valueField : 'workorderno',
|
||||
textField : 'workorderno',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onSelect: function () {
|
||||
var workorderno = $("#workorderno").combobox('getValue');
|
||||
$("#procedureno").combobox({
|
||||
url : ext.contextPath + '/work/workorder/getProcedurelist4Select.do?workorderno='+workorderno,
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onLoadSuccess: function(record){
|
||||
if($("#procedureno").combobox('getData').length>0){
|
||||
$("#procedureno").combobox('select','${sessionScope.procedure}');
|
||||
}
|
||||
},
|
||||
onSelect: function () {
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
//开工
|
||||
var dostart = function(id) {
|
||||
$.post(ext.contextPath + '/work/workorder/doupdate_taskdemand.do', {id : id,status:'${Flag_Start}'}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','开工成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','开工失败','info');
|
||||
}
|
||||
});
|
||||
};
|
||||
//报工
|
||||
var doreport=function(taskcode){
|
||||
var workorderno = $("#workorderno").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '工单报工',
|
||||
width: 400,
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workorder/showworkorder_carryover.do?taskcode='+taskcode+'&workorderno='+workorderno+'&status=${Flag_Report}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
||||
//dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
//工单结转
|
||||
var docarryover=function(taskcode){
|
||||
var workorderno = $("#workorderno").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '工单结转',
|
||||
width: 400,
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workorder/showworkorder_carryover.do?taskcode='+taskcode+'&workorderno='+workorderno+'&status=${Flag_CarryOver}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
||||
//dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
//查看工单
|
||||
var doview=function(taskcode){
|
||||
var workorderno = $("#workorderno").combobox('getValue');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看工单',
|
||||
width: 400,
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workorder/showworkorder_view.do?taskcode='+taskcode+'&workorderno='+workorderno,
|
||||
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
loadworkorders('${dt}')
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workorder/getTaskList.do?'+$('#searchForm').serialize(),
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '180', title : '工序名称', field : '_taskName', sortable : true, halign:'center'},
|
||||
{width : '80', title : '计划良率', field : 'preyield', sortable : true, halign:'center'},
|
||||
{width : '80', title : '实际良率', field : 'actyield', sortable : true, halign:'center'},
|
||||
{width : '80', title : '计划产量', field : 'preamount', sortable : true, halign:'center'},
|
||||
{width : '80', title : '实际产量', field : 'actamount', sortable : true, halign:'center'},
|
||||
{width : '180', title : '良率未达标原因', field : 'yieldreason', sortable : true, halign:'center', align:'center'},
|
||||
{width : '180', title : '产量未达标原因', field : 'amountreason', sortable : true, halign:'center', align:'center'},
|
||||
{width : '100', title : '工单状态', field : 'status', align:'center', formatter : function(value, row){
|
||||
switch(value){
|
||||
case '${Flag_Start}': return "已开工";
|
||||
case '${Flag_Report}': return "已报工";
|
||||
case '${Flag_CarryOver}': return "已结转";
|
||||
default:return "待开工";
|
||||
|
||||
}
|
||||
} ,sortable:false},
|
||||
{width : '130', title : '操作', field : 'action', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="doview(\''+row.taskcode+'\');"/> ';
|
||||
if(row.status=='${Flag_Start}'){
|
||||
str += '<img class="iconImg ext-icon-table_row_insert" title="报工" onclick="doreport(\''+row.taskcode+'\');"/> ';
|
||||
}else if(row.status=='${Flag_Report}'){
|
||||
str += '<img class="iconImg ext-icon-table_relationship" title="结转" onclick="docarryover(\''+row.taskcode+'\');"/> ';
|
||||
}else if(row.status!='${Flag_CarryOver}'){
|
||||
str += '<img class="iconImg ext-icon-table_go" title="开工" onclick="dostart(\''+row.id+'\');"/> ';
|
||||
}
|
||||
return str;
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%-- <%if (sessionManager.havePermission(session,"work/workorder/add.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/workorder/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%> --%>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>日期</td>
|
||||
<td><input id="nowdate" name="nowdate" class="Wdate" value="${dt }" style="width: 180px;"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',onpicked:onchangedate})"
|
||||
></td>
|
||||
<td>工单</td>
|
||||
<td><input id="workorderno" name="workorderno" class="easyui-combobox" data-options="required:true" style="width: 180px;" value=""/></td>
|
||||
<td>工序</td>
|
||||
<td><input id="procedureno" name="procedureno" class="easyui-combobox" style="width: 180px;" panelMaxHeight="400px" data-options="panelHeight:'auto'" value=""/></td>
|
||||
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="searchgrid();">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');searchgrid();">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
79
bin/WebRoot/jsp/work/workorderAdd.jsp
Normal file
79
bin/WebRoot/jsp/work/workorderAdd.jsp
Normal file
@ -0,0 +1,79 @@
|
||||
<!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 + "/work/workorder/save.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
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() {
|
||||
/* $('#lineid').combobox({
|
||||
url : ext.contextPath + '/work/line/getSelectList.do?random=' + Math.random(),
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
width:250,
|
||||
panelHeight:'auto'
|
||||
});
|
||||
|
||||
$('#typeid').combobox({
|
||||
url : ext.contextPath + '/work/workstationType/getselectlist.do?random=' + Math.random(),
|
||||
valueField:'id',
|
||||
textField:'name',
|
||||
method:'get'
|
||||
}); */
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>产品编码</th>
|
||||
<td><input name="productno" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>生产订单号</th>
|
||||
<td><input name="taskno" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品规格</th>
|
||||
<td><input name="productformat" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>交货日期</th>
|
||||
<td><input name="eddt" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
151
bin/WebRoot/jsp/work/workorderCarryOver.jsp
Normal file
151
bin/WebRoot/jsp/work/workorderCarryOver.jsp
Normal file
@ -0,0 +1,151 @@
|
||||
<!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.plan.DailyPlanTaskDemand"%>
|
||||
<%@ 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_Report",DailyPlanTaskDemand.Flag_Report);%>
|
||||
<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 + "/work/workorder/updateDistricWorkDetail.do", $(".form").serialize(), function(data) {
|
||||
if (data == '1') {
|
||||
top.$.messager.alert('提示', "操作成功", 'info', function() {
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else if(data == '0'){
|
||||
top.$.messager.alert('提示', "操作失败", 'info');
|
||||
}else{
|
||||
top.$.messager.alert('提示', data, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
var showleaveamount =function(){
|
||||
var actamount =parseFloat($("#actamount").val());
|
||||
var preamount =parseFloat($("#preamount").html());
|
||||
if(isNaN(actamount)){
|
||||
actamount=0;
|
||||
}
|
||||
if(isNaN(preamount)){
|
||||
preamount=0;
|
||||
}
|
||||
if(actamount!=0 && ${param.status==Flag_Report}){
|
||||
$("#actamount").textbox('textbox').attr('readonly',true);
|
||||
}
|
||||
if(preamount!=0 && ${param.status==Flag_Report}){
|
||||
$("#preamount").textbox('textbox').attr('readonly',true);
|
||||
}
|
||||
$("#leaveamount").html(preamount-actamount);
|
||||
};
|
||||
$(function() {
|
||||
/* $('#lineid').combobox({
|
||||
url : ext.contextPath + '/work/line/getSelectList.do?random=' + Math.random(),
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
width:250,
|
||||
panelHeight:'auto'
|
||||
});
|
||||
|
||||
$('#typeid').combobox({
|
||||
url : ext.contextPath + '/work/workstationType/getselectlist.do?random=' + Math.random(),
|
||||
valueField:'id',
|
||||
textField:'name',
|
||||
method:'get'
|
||||
}); */
|
||||
$("input",$("#actamount").next("span")).blur(function(){
|
||||
showleaveamount();
|
||||
});
|
||||
showleaveamount();
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input name="status" type="hidden" value="${param.status}"/>
|
||||
<input name="planid" type="hidden" value="${WOForTask.planid}"/>
|
||||
<input name="taskcode" type="hidden" value="${WOForTask.taskcode}"/>
|
||||
<input name="prodtaskid" type="hidden" value="${WOForTask.prodtaskid}"/>
|
||||
|
||||
<input name="id" type="hidden" value="${WOForTask.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>工单编码</th>
|
||||
<td><span id="workorderno">${WOForTask.workOrder.workorderno}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品编码</th>
|
||||
<td><span id="materialcode">${WOForTask.prodtask.materialcode}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品名称</th>
|
||||
<td><span id="materialname">${WOForTask.prodtask.materialname}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>销售订单号</th>
|
||||
<td><span id="salesno" name="salesno">${WOForTask.prodtask.salesno}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>当前工序</th>
|
||||
<td><span id="_taskName" name="_taskName">${WOForTask._taskName}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>报工人</th>
|
||||
<td><span id="_reportuser" name="_reportuser">${WOForTask._reportuser}</span>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划产量</th>
|
||||
<td><span id="preamount" name="preamount">${WOForTask.preamount}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>实际产量</th>
|
||||
<td><input id="actamount" name="actamount" class="easyui-numberbox" max="100000000" precision="1" type="text"
|
||||
data-options="required:true,validType:'isBlank'" value="${WOForTask.actamount}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产量未达原因</th>
|
||||
<td>
|
||||
<input id="amountreason" name="amountreason" class="easyui-textbox" style="height:50px" value="${WOForTask.amountreason}"
|
||||
data-options="multiline:true" validtype="length[0,500]" invalidMessage="有效长度0-500" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划良率</th>
|
||||
<td><span id="preyield" name="preyield" >${WOForTask.preyield}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>实际良率</th>
|
||||
<td><input name="actyield" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${WOForTask.actyield}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>良率未达原因</th>
|
||||
<td>
|
||||
<input id="yieldreason" name="yieldreason" class="easyui-textbox" style="height:50px" value="${WOForTask.yieldreason}"
|
||||
data-options="multiline:true" validtype="length[0,500]" invalidMessage="有效长度0-500" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>剩余完成量</th>
|
||||
<td><span id="leaveamount"></span> </td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
70
bin/WebRoot/jsp/work/workorderEdit.jsp
Normal file
70
bin/WebRoot/jsp/work/workorderEdit.jsp
Normal file
@ -0,0 +1,70 @@
|
||||
<!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 + "/work/workorder/update.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
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() {
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${workorder.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>产品序列号</th>
|
||||
<td><input name="productuid" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${workorder.productuid}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>生产订单号</th>
|
||||
<td><input name="productionorderno" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${workorder.productionorderno}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品编码</th>
|
||||
<td><input name="productno" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${workorder.productno}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品规格</th>
|
||||
<td><input id="productname" name="productname" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${workorder.productname}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>交货日期</th>
|
||||
<td><input id="eddt" name="eddt" class="Wdate" value="${workorder.eddt }"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})"
|
||||
>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
540
bin/WebRoot/jsp/work/workorderList.jsp
Normal file
540
bin/WebRoot/jsp/work/workorderList.jsp
Normal file
@ -0,0 +1,540 @@
|
||||
<%@page import="com.sipai.tools.CommString"%>
|
||||
<%@page import="com.sipai.entity.work.WorkOrder"%>
|
||||
<%@page import="com.sipai.entity.plan.DailyPlanTaskDemand"%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
|
||||
<%request.setAttribute("Flag_Suspend",WorkOrder.Flag_Suspend);%>
|
||||
<%request.setAttribute("Flag_Active",WorkOrder.Flag_Active);%>
|
||||
|
||||
<%request.setAttribute("Flag_Delete",WorkOrder.Flag_Delete);%>
|
||||
<%request.setAttribute("Flag_Start",WorkOrder.Flag_Start);%>
|
||||
<%request.setAttribute("Flag_Issue",WorkOrder.Flag_Issue);%>
|
||||
<%request.setAttribute("Flag_CarryOver",WorkOrder.Flag_CarryOver);%>
|
||||
|
||||
<%request.setAttribute("Flag_Finish",WorkOrder.Flag_Finish);%>
|
||||
<%request.setAttribute("resp_pass",CommString.Resp_Success);%>
|
||||
|
||||
|
||||
<%request.setAttribute("Flag_Start_Task",DailyPlanTaskDemand.Flag_Start);%>
|
||||
<%request.setAttribute("Flag_Report_Task",DailyPlanTaskDemand.Flag_Report);%>
|
||||
<%request.setAttribute("Flag_CarryOver_Task",DailyPlanTaskDemand.Flag_CarryOver);%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加任务',
|
||||
url : ext.contextPath + '/plan/dailyplan/showlist_task.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.dosave();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
var str="";
|
||||
$.each(res.result,function(index,item){
|
||||
str+=item.productionorderno+",";
|
||||
});
|
||||
$.post(ext.contextPath + '/work/workorder/addbyplan.do', {ids:str.replace(/,$/g,"")} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','添加成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','添加失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}]
|
||||
});
|
||||
};
|
||||
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑任务',
|
||||
url : ext.contextPath + '/work/workorder/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workorder/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var discardFun = function(id) {
|
||||
top.$.messager.confirm('提示', '您确定要作废此订单?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workorder/discard.do', {id:id} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','作废成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','作废失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
var eddts="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.productionorderno+",";
|
||||
eddts+=item.eddt+",";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workorder/deletes.do', {ids:datas,eddts:eddts} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var districtwork = function(planid,workorderid,processid){
|
||||
//alert(planid+workorderid+processid)
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '任务调度',
|
||||
url : ext.contextPath + '/work/workorder/districtwork.do?planid='+planid+'&workorderid='+workorderid+'&processid='+processid,
|
||||
width:1000,
|
||||
height:500,
|
||||
onClose:function(){
|
||||
var res=dialog.find('iframe').get(0).contentWindow.returnVal;
|
||||
if(res=="refresh"){
|
||||
$('#grid').datagrid("reload");
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function selectTaskOrder(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择任务单',
|
||||
width: 800,
|
||||
height:550,
|
||||
url : ext.contextPath + '/plan/taskorder/select.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
console.log(res);
|
||||
if(res!=null){
|
||||
$("#taskordercode").textbox('setValue',res.tasklistcode);//easyui textbox赋值jquery不一样
|
||||
$("#taskorderid").val(res.taskorderid);
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
var startProcess = function(id) {
|
||||
$.post(ext.contextPath + '/work/workorder/startorder.do?id=' + id,function(data){
|
||||
if(data=='1'){
|
||||
top.$.messager.alert('提示', '启动成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('提示', '启动失败','info');
|
||||
}
|
||||
});
|
||||
};
|
||||
var searchgrid = function() {
|
||||
grid.datagrid('load',ext.contextPath + '/work/workorder/getlist.do?'+$('#searchForm').serialize());
|
||||
};
|
||||
|
||||
var suspendFun = function(id,status) {
|
||||
var tip="";
|
||||
var status_="";
|
||||
if(status=="${Flag_Suspend}"){
|
||||
tip="激活";
|
||||
status_="${Flag_Active}";
|
||||
}else {
|
||||
tip="挂起";
|
||||
status_="${Flag_Suspend}";
|
||||
}
|
||||
parent.$.messager.confirm('提示', '您确定要'+tip+'此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workorder/suspend.do', {id : id,suspended:status_}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示',tip+'成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示',tip+'失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
//工单下发
|
||||
var doissue = function(id){
|
||||
$('#YWaitDialog').show();
|
||||
$.post(ext.contextPath + "/work/workorder/doissue.do",{ids:id}, function(data) {
|
||||
$('#YWaitDialog').hide();
|
||||
if (data.res == "${resp_pass}") {
|
||||
top.$.messager.alert('提示', "下发成功", 'info', function() {
|
||||
//刷新
|
||||
//parent.$('#viewp3')[0].contentWindow.location.reload();
|
||||
//refreshbutton();
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
|
||||
}else {
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
},'json');
|
||||
};
|
||||
//工单结转
|
||||
var docarryover=function(taskcode,workorderno){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '工单结转',
|
||||
width: 400,
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workorder/showworkorder_carryover.do?taskcode='+taskcode+'&workorderno='+workorderno,
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
||||
//dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
//查看工单
|
||||
var workorderview=function(taskcode,workorderno){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看工单',
|
||||
width: 400,
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workorder/showworkorder_view.do?taskcode='+taskcode+'&workorderno='+workorderno,
|
||||
|
||||
});
|
||||
};
|
||||
//工单作废
|
||||
var invalidateFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要此记录作废?工单作废后将无法撤销。', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workorder/invalidate.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','作废成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
top.$.messager.alert('提示','作废失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
view: detailview,
|
||||
detailFormatter:function(index,row){
|
||||
return '<div style="padding:2px"><table class="ddv"></table></div>';
|
||||
},
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workorder/getlist.do?'+$('#searchForm').serialize(),
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
rowStyler: function(index,row){
|
||||
var rowstyler='';
|
||||
if(row.status=='${Flag_Delete}'){
|
||||
rowstyler+= ' background-color:#C0C0C0;color:#fff;';
|
||||
}else if(row.status=='${Flag_Finish}'){
|
||||
rowstyler+= ' font-style:ltalic;';
|
||||
}
|
||||
return rowstyler;
|
||||
},
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '150', title : '物料名称', field : 'stdt', sortable : true, halign:'center', formatter : function(value, row){
|
||||
if(row.materialBOM!=null){
|
||||
return row.materialBOM.materialname;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '150', title : '工单编号', field : 'workorderno', sortable : true, halign:'center'},
|
||||
{width : '180', title : '任务单编码', field : 'taskorderno', sortable : true, halign:'center', formatter : function(value, row){
|
||||
if(row.taskorder!=null){
|
||||
return row.taskorder.tasklistcode;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '100', title : '销售订单号', field : 'productname', halign:'center', formatter : function(value, row){
|
||||
if(row.taskorder!=null){
|
||||
return row.taskorder.salesno;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '140', title : '工单下发时间', field : 'insdt', sortable : true, halign:'center', align:'center', formatter : function(value, row){
|
||||
return value.substring(0,19);
|
||||
}},
|
||||
{width : '60', title : '优先级', field : 'porder', sortable : true, halign:'center', align:'center'},
|
||||
{width : '100', title : '工单状态', field : 'status', align:'center', formatter : function(value, row){
|
||||
var susp="";
|
||||
if(row.suspended=='${Flag_Active}'){
|
||||
susp= "";
|
||||
}else if(row.suspended=='${Flag_Suspend}'){
|
||||
susp= "/<font color='red'>已挂起</font>";
|
||||
}
|
||||
switch(value){
|
||||
case '${Flag_Start}': return "待下发至生产"+susp;
|
||||
case '${Flag_Issue}': return "已下发至生产"+susp;
|
||||
case '${Flag_CarryOver}': return "已结转"+susp;
|
||||
case '${Flag_Delete}': return "已作废"+susp;
|
||||
case '${Flag_Finish}': return "<font color='blue'>已完成</font>";
|
||||
|
||||
}
|
||||
} ,sortable:false},
|
||||
{width : '130', title : '操作', field : 'action', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
<%if (sessionManager.havePermission(session,"work/workorder/edit.do")) {%>
|
||||
if(row.updatedt!=row.issueddt ||row.status=='${Flag_Start}'){ //下发时间和更新时间不一致,则显示下发按钮
|
||||
str += '<img class="iconImg ext-icon-table_go" title="下发" onclick="doissue(\''+row.id+'\');"/> ';
|
||||
}
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/worktaskworkstation/districtworkstation.do")) {%>
|
||||
if(row.suspended=='${Flag_Suspend}'){
|
||||
str += '<img class="iconImg ext-icon-table_lightning" title="激活" onclick="suspendFun(\''+row.id+'\',\''+row.suspended+'\');"/> ';
|
||||
}else if(row.suspended=='${Flag_Active}'){
|
||||
str += '<img class="iconImg ext-icon-table_link" title="挂起" onclick="suspendFun(\''+row.id+'\',\''+row.suspended+'\');"/> ';
|
||||
}
|
||||
|
||||
str += '<img class="iconImg ext-icon-chart_organisation" title="任务调度" onclick="districtwork(\''+row.planid+'\',\''+row.id+'\',\''+row.processrealid+'\');"/>';
|
||||
str += '<img class="iconImg ext-icon-bin" title="工单作废" onclick="invalidateFun(\''+row.id+'\');"/> ';
|
||||
<%}%>
|
||||
if(row.status == '' ){
|
||||
str += '<img class="iconImg ext-icon-control_play" title="任务开始" onclick="startProcess(\''+row.id+'\');"/>';
|
||||
}
|
||||
return str;
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
|
||||
//展开所有的行
|
||||
/* for(var i=0;i<data.rows.length;i++){
|
||||
$('#grid').datagrid('expandRow',i);
|
||||
} */
|
||||
},
|
||||
|
||||
onExpandRow: function(index,prow){
|
||||
var ddv = $(this).datagrid('getRowDetail',index).find('table.ddv');
|
||||
ddv.datagrid({
|
||||
url:ext.contextPath + '/work/workorder/getlist_detail.do?planid='+prow.planid+'&processid='+prow.processrealid,
|
||||
fitColumns:false,
|
||||
singleSelect:true,
|
||||
rownumbers:true,
|
||||
loadMsg:'',
|
||||
height:'auto',
|
||||
columns:[[
|
||||
{width : '140', field:'name',title:'工序名称',halign:'center'},
|
||||
{width : '140', field:'id',title:'工序编码',halign:'center'},
|
||||
{width : '140', field:'preamount',title:'计划产量',halign:'center',formatter:function(value,row){
|
||||
return row.dailyPlanTaskDemand.preamount;
|
||||
}},
|
||||
{width : '140', field:'preyield',title:'良率',halign:'center',formatter:function(value,row){
|
||||
return row.dailyPlanTaskDemand.preyield;
|
||||
}},
|
||||
{width : '100', title : '状态', field : 'status', align:'center', formatter : function(value, row){
|
||||
switch(row.dailyPlanTaskDemand.status){
|
||||
case '${Flag_Start_Task}': return "已开工";
|
||||
case '${Flag_Report_Task}': return "已报工";
|
||||
case '${Flag_CarryOver_Task}': return "已结转";
|
||||
default:return "待开工";
|
||||
|
||||
}
|
||||
} ,sortable:false},
|
||||
{width : '130', title : '操作', field : 'action', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="workorderview(\''+row.id+'\',\''+prow.workorderno+'\');"/> ';
|
||||
<%-- <%if (sessionManager.havePermission(session,"work/workorder/edit.do")) {%>
|
||||
if(prow.status=='${Flag_Issue}'){
|
||||
str += '<img class="iconImg ext-icon-table_relationship" title="结转" onclick="docarryover(\''+row.id+'\',\''+prow.workorderno+'\');"/> ';
|
||||
}
|
||||
|
||||
<%}%> --%>
|
||||
return str;
|
||||
}}
|
||||
|
||||
]],
|
||||
onResize:function(){
|
||||
$('#grid').datagrid('fixDetailRowHeight',index);
|
||||
},
|
||||
onLoadSuccess:function(){
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
setTimeout(function(){
|
||||
$('#grid').datagrid('fixDetailRowHeight',index);
|
||||
},0);
|
||||
}
|
||||
});
|
||||
$('#grid').datagrid('fixDetailRowHeight',index);
|
||||
}
|
||||
});
|
||||
$("#taskordercode").textbox('textbox').bind("click", function () {
|
||||
selectTaskOrder();
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%-- <%if (sessionManager.havePermission(session,"work/workorder/add.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/workorder/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%> --%>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
|
||||
<td>工单编号</td>
|
||||
<td><input name="search_workorder_no" class="easyui-textbox" value=""/></td>
|
||||
<td> </td>
|
||||
<td>任务单号</td>
|
||||
<td><input id="taskordercode" name="taskordercode" class="easyui-textbox" data-options="validType:'isBlank',prompt:'单击选择'" value=""
|
||||
/>
|
||||
<input id="taskorderid" name="taskorderid" type="hidden" value="" /></td>
|
||||
<td> </td>
|
||||
<td>日期</td>
|
||||
<td><input id="dt" name="dt" class="Wdate" value="${dt}"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"
|
||||
readonly></td>
|
||||
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="searchgrid();">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');searchgrid();">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
<div id="YWaitDialog"
|
||||
style="background-color: #e0e0e0;
|
||||
position: absolute;
|
||||
margin: auto;
|
||||
top: 150px;
|
||||
left: 300px;
|
||||
display: none;
|
||||
height: 60px;
|
||||
width: 300px;
|
||||
border-radius:5px;">
|
||||
<p style="text-align: center;height:100%;">
|
||||
<img style=" position: absolute;left:50px" src="<%=request.getContextPath() %>/IMG/loading.gif" /> <span style=" width: 100%;height:100%; position: absolute; top: 22px;
|
||||
left: 30px;
|
||||
">请等待,工单正在下发...</span>
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
138
bin/WebRoot/jsp/work/workorderview.jsp
Normal file
138
bin/WebRoot/jsp/work/workorderview.jsp
Normal file
@ -0,0 +1,138 @@
|
||||
<!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">
|
||||
var showleaveamount =function(){
|
||||
var actamount =parseFloat($("#actamount").val());
|
||||
var preamount =parseFloat($("#preamount").html());
|
||||
if(isNaN(actamount)){
|
||||
actamount=0;
|
||||
}
|
||||
if(isNaN(preamount)){
|
||||
preamount=0;
|
||||
}
|
||||
$("#leaveamount").html(preamount-actamount);
|
||||
};
|
||||
//设备调度
|
||||
var showDistricEqu=function(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '设备调度',
|
||||
width: 1000,
|
||||
height:550,
|
||||
url : ext.contextPath+"/work/workorder/showdistrictwork_equ.do?workorderid=${WOForTask.workOrder.id}&processid=${WOForTask.workOrder.processrealid}&taskid=${WOForTask.taskcode}",
|
||||
buttons : [{
|
||||
text : '关闭',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
//查看bom
|
||||
var showBomInfo = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看BOM信息',
|
||||
width: 1000,
|
||||
height:550,
|
||||
url : ext.contextPath + '/material/materialbom/view.do?id=${WOForTask.workOrder.bomid}'
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
$("input",$("#actamount").next("span")).blur(function(){
|
||||
showleaveamount();
|
||||
});
|
||||
showleaveamount();
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${WOForTask.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>工单编码</th>
|
||||
<td><span id="workorderno">${WOForTask.workOrder.workorderno}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品编码</th>
|
||||
<td><span id="materialcode">${WOForTask.prodtask.materialcode}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品名称</th>
|
||||
<td><span id="materialname">${WOForTask.prodtask.materialname}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>销售订单号</th>
|
||||
<td><span id="salesno" name="salesno">${WOForTask.prodtask.salesno}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>报工人</th>
|
||||
<td><span id="reportuser" name="reportuser">${WOForTask._reportuser}</span>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>结转人</th>
|
||||
<td><span id="handleuser" name="handleuser">${WOForTask._handleuser}</span>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>计划产量</th>
|
||||
<td><span id="preamount" name="preamount">${WOForTask.preamount}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>实际产量</th>
|
||||
<td><span id="actamount" name="actamount" >${WOForTask.actamount} </span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产量未达原因</th>
|
||||
<td>
|
||||
<span id="amountreason" name="amountreason">${WOForTask.amountreason}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划良率</th>
|
||||
<td><span id="preyield" name="preyield" >${WOForTask.preyield}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>实际良率</th>
|
||||
<td><span name="actyield">${WOForTask.actyield}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>良率未达原因</th>
|
||||
<td>
|
||||
<span id="yieldreason" name="yieldreason" style="height:50px" > ${WOForTask.yieldreason}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>剩余完成量</th>
|
||||
<td><span id="leaveamount"></span> </td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div data-options="region:'center',fit:true">
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-text_list_bullets',plain:true" style="float:fit;width:32%;"
|
||||
onclick="showBomInfo();">BOM</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-chart_organisation',plain:true" style="float:fit;width:32%;"
|
||||
onclick="showDistricEqu();">调度</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-book',plain:true" style="float:fit;width:32%;"
|
||||
onclick="$('#searchForm').form('clear');searchgrid();">文档</a>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
190
bin/WebRoot/jsp/work/workprocessList.jsp
Normal file
190
bin/WebRoot/jsp/work/workprocessList.jsp
Normal file
@ -0,0 +1,190 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var grid_process;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加任务',
|
||||
url : ext.contextPath + '/work/worktask/add.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑任务',
|
||||
url : ext.contextPath + '/work/worktask/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var viewFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看用户信息',
|
||||
url : ext.contextPath + '/work/workstation/view.do?id=' + id
|
||||
});
|
||||
};
|
||||
|
||||
var refreshFun = function() {
|
||||
$.post(ext.contextPath + '/work/worktask/getnewtask.do', {}, function(data) {
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
};
|
||||
var dodel = function() {
|
||||
var checkedItems = $('#grid_process').datagrid('getSelections');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workprocess/delprocess.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','成功删除'+data+'条记录','info',function(){
|
||||
grid_process.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid_process = $('#grid_process').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workprocess/getlist_process.do?taskid='+'${taskid}',
|
||||
striped : true,
|
||||
singleSelect: false,
|
||||
rownumbers : true,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{width : '250', title : '流程名称', field : 'name', sortable : true, halign:'center',
|
||||
formatter : function(value, row) {
|
||||
return row.realDetails.name;
|
||||
}},
|
||||
{width : '150', title : '流程状态', field : 'status', sortable : true, halign:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
var datagridLength = grid_process.datagrid('getRows').length;
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(grid_process.datagrid('getSelected')==null){
|
||||
grid_process.datagrid('selectRow',datagridLength-1);
|
||||
}
|
||||
},
|
||||
onSelect:function(index,row){
|
||||
showdetailsFun('${taskid}',row.processRealdetailid,row.processRealid,row.id);
|
||||
}
|
||||
});
|
||||
grid_agency = $('#grid_agency').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workprocess/getlist_agency.do?taskid='+'${taskid}',
|
||||
striped : true,
|
||||
singleSelect: false,
|
||||
rownumbers : true,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{width : '250', title : '流程名称', field : '_processdetailname', sortable : true, halign:'center'},
|
||||
{width : '150', title : '对应工位', field : 'workstationname', sortable : true, halign:'center'},
|
||||
{width : '150', title : '操作人员', field : 'name', sortable : true, halign:'center',
|
||||
formatter : function(value, row) {
|
||||
if(row.user==null){
|
||||
}else{
|
||||
return row.user.caption;
|
||||
}
|
||||
}
|
||||
},
|
||||
{width : '150', title : '任务进展', field : 'status', sortable : true, halign:'center',
|
||||
formatter : function(value, row) {
|
||||
if(row._taskstdt==''){
|
||||
return '该工序尚未开始';
|
||||
}else if(row._taskedt==''){
|
||||
return '该工序进行中';
|
||||
}else{
|
||||
return '该工序已完成';
|
||||
}
|
||||
}}
|
||||
] ],
|
||||
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(grid_agency.datagrid('getSelected')==null){
|
||||
grid_agency.datagrid('selectRow',0);
|
||||
}
|
||||
},
|
||||
onSelect:function(index,row){
|
||||
var processdetailid=row.processRealdetailid;
|
||||
var rows=$('#grid_process').datagrid('getData').rows;
|
||||
var i=0;
|
||||
for(i=0;i<rows.length;i++){
|
||||
if(rows[i].processRealdetailid==processdetailid){
|
||||
$('#grid_process').datagrid('unselectAll');
|
||||
$('#grid_process').datagrid('selectRow',i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(i==rows.length){
|
||||
top.$.messager.alert('提示', '该任务尚未执行到属于您的流程!','info');
|
||||
}else{
|
||||
setTimeout(function () {
|
||||
$('#belowFrame')[0].contentWindow.selecttask(row.workstationid);
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
var showdetailsFun = function(taskid,processdetailid,processid,processorderid) {
|
||||
//alert(taskid+","+processdetailid+","+processid)
|
||||
$("#belowFrame").attr("src",ext.contextPath+"/work/workprocess/showlist_detail.do?taskid="+taskid+
|
||||
"&processdetailid="+processdetailid+"&processid="+processid+"&processorderid="+processorderid);
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body style="padding:5px;height:650px;">
|
||||
<div id="tt">
|
||||
<a href="javascript:void(0)" class="icon-remove" title="删除" onclick="dodel()"></a>
|
||||
</div>
|
||||
<div class="easyui-panel" title="待办条目" style="width:950px;height:150px;">
|
||||
<table id="grid_agency" data-options="border:false"></table>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="easyui-panel" title="流程信息" data-options="tools:'#tt'" style="width:950px;height:150px;">
|
||||
<table id="grid_process" data-options="border:false"></table>
|
||||
</div>
|
||||
<br/>
|
||||
<div id="belowdiv" title="流程详情" class="easyui-panel" style="width:950px;height:450px;">
|
||||
<iframe id="belowFrame" name="belowFrame" src="" allowTransparency="true" width=100% height=100%
|
||||
frameBorder="0" scrolling="no" ></iframe>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
238
bin/WebRoot/jsp/work/workprocessdetail.jsp
Normal file
238
bin/WebRoot/jsp/work/workprocessdetail.jsp
Normal file
@ -0,0 +1,238 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var grid_process;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加任务',
|
||||
url : ext.contextPath + '/work/worktask/add.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑任务',
|
||||
url : ext.contextPath + '/work/worktask/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var viewFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看用户信息',
|
||||
url : ext.contextPath + '/work/workstation/view.do?id=' + id
|
||||
});
|
||||
};
|
||||
|
||||
var refreshFun = function() {
|
||||
$.post(ext.contextPath + '/work/worktask/getnewtask.do', {}, function(data) {
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/worktask/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
//alert(datas);
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/worktask/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','成功删除'+data+'条记录','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var starttask=function(){
|
||||
var taskid='${taskid}';
|
||||
var processdetailid='${processdetailid}';
|
||||
var processid='${processid}';
|
||||
var processorderid='${processorderid}';
|
||||
var workstationid=$('#workstation').combobox('getValue');
|
||||
$.post(ext.contextPath + '/work/workprocess/starttask.do', {taskid : taskid,workstationid:workstationid,
|
||||
processdetailid:processdetailid,processid:processid,processorderid:processorderid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','任务成功接受','info',function(){
|
||||
setbutton('1');
|
||||
$('#workstation').combobox('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','任务接受失败','info');
|
||||
}
|
||||
});
|
||||
};
|
||||
var endtask=function(){
|
||||
var taskid='${taskid}';
|
||||
var processdetailid='${processdetailid}';
|
||||
var processid='${processid}';
|
||||
var workstationid=$('#workstation').combobox('getValue');
|
||||
$.post(ext.contextPath + '/work/workprocess/endtask.do', {taskid : taskid,workstationid:workstationid,
|
||||
processdetailid:processdetailid,processid:processid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','任务已保存','info',function(){
|
||||
setbutton('2');
|
||||
$('#workstation').combobox('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','任务保存失败','info');
|
||||
}
|
||||
});
|
||||
};
|
||||
var nexttask=function(){
|
||||
var taskid='${taskid}';
|
||||
var processdetailid=$('#workprocess').combobox('getValue');
|
||||
var processdetailname=$('#workprocess').combobox('getText');
|
||||
var processid='${processid}';
|
||||
//alert(taskid+","+processdetailid+","+processid);
|
||||
parent.$.messager.confirm('提示', '您确定要进入\"'+processdetailname+'\"流程?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workprocess/nexttask.do', {taskid : taskid,
|
||||
processdetailid:processdetailid,processid:processid}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','流程已进入下一步,感谢您的操作!','info',function(){
|
||||
//setbutton('2');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','流程更新失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
var setbutton =function(status){
|
||||
switch(status){
|
||||
case '0':
|
||||
$('#startbutton').show();
|
||||
$('#endbutton').hide();
|
||||
$('#nextprocess').hide();
|
||||
$('#nextbutton').hide();
|
||||
break;
|
||||
case '1':
|
||||
$('#startbutton').hide();
|
||||
$('#endbutton').show();
|
||||
$('#nextprocess').hide();
|
||||
$('#nextbutton').hide();
|
||||
break;
|
||||
case '2':
|
||||
$('#startbutton').hide();
|
||||
$('#endbutton').hide();
|
||||
$('#nextprocess').show();
|
||||
$('#nextbutton').show();
|
||||
|
||||
}
|
||||
};
|
||||
$(function() {
|
||||
$('#startbutton').hide();
|
||||
$('#endbutton').hide();
|
||||
$('#nextprocess').show();
|
||||
$('#nextbutton').show();
|
||||
$('#workstation').combobox({
|
||||
url:ext.contextPath + '/work/workprocess/getworkstation.do?taskid=${taskid}&processdetailid=${processdetailid}&processid=${processid}&processorderid=${processorderid}',
|
||||
valueField:'workstationid',
|
||||
textField:'workstationname',
|
||||
onSelect: function(rec){
|
||||
setbutton(rec._taskstatue);
|
||||
}
|
||||
|
||||
});
|
||||
$('#workprocess').combobox({
|
||||
url:ext.contextPath + '/work/workprocess/getprocess.do?taskid=${taskid}',
|
||||
valueField:'id',
|
||||
textField:'name',
|
||||
});
|
||||
});
|
||||
|
||||
function selecttask(workstationid){
|
||||
$('#workstation').combobox('select',workstationid);
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body text-align="west">
|
||||
<div class="easyui-panel" title="任务操作" style="padding:5px;height:50%">
|
||||
<form method="post" class="form" >
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>操作工位</th>
|
||||
<td>
|
||||
<select id="workstation" name="workstation" class="easyui-combobox" data-options="panelHeight:'auto',editable:false,value:''">
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
<div>操作内容</div>
|
||||
<div style="padding:5px;" >
|
||||
<a id="startbutton" class="easyui-linkbutton" data-options="iconCls:'icon-ok'"
|
||||
onclick="starttask()">开始</a>
|
||||
<a id="endbutton" class="easyui-linkbutton" data-options="iconCls:'icon-no'"
|
||||
onclick="endtask()">完成</a>
|
||||
</div>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="easyui-panel" title="工序走向" style="padding:5px;height:50%" >
|
||||
<form method="post" class="form" >
|
||||
<table class="table">
|
||||
<tr id="nextprocess">
|
||||
<th>下一步流程</th>
|
||||
<td>
|
||||
<select id="workprocess" name="workprocess" class="easyui-combobox" data-options="panelHeight:'auto',editable:false,value:''">
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<div> </div>
|
||||
<div>
|
||||
<a id="nextbutton" class="easyui-linkbutton" data-options="iconCls:'icon-save'"
|
||||
onclick="nexttask()">执行</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
210
bin/WebRoot/jsp/work/workschedulingAdd.jsp
Normal file
210
bin/WebRoot/jsp/work/workschedulingAdd.jsp
Normal file
@ -0,0 +1,210 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加工序',
|
||||
url : ext.contextPath + '/process/realDetails/add.do?pid=${param.pid}',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑工序',
|
||||
url : ext.contextPath + '/process/realDetails/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/process/realDetails/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
top.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/process/realDetails/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
top.$.messager.alert('提示','成功删除'+data+'条记录','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var dosave = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
var realid="";
|
||||
var realdetailid=""
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.workstationid+",";
|
||||
realid+=item.processRealid+",";
|
||||
realdetailid+=item.processRealdetailid+",";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请选择工位','info');
|
||||
}else{
|
||||
$.post(ext.contextPath + '/work/worktaskworkstation/save.do', {ids:datas,taskid:'${param.taskid}',processrealid:realid,processrealdetailid:realdetailid} , function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','保存成功','info');
|
||||
}else{
|
||||
top.$.messager.alert('提示','保存失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
function getNextFormatDate() {
|
||||
var nowdate = new Date();
|
||||
var seperator1 = "-";
|
||||
var seperator2 = ":";
|
||||
nowdate=nowdate.valueOf()+1000*60*60*24;
|
||||
var date = new Date(nowdate);
|
||||
var year = date.getFullYear();
|
||||
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 nextdate = year + seperator1 + month + seperator1 + strDate;
|
||||
return nextdate;
|
||||
}
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workscheduling/getstationlist.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '工位编号', field : 'serial', sortable : true, halign:'center'},
|
||||
{width : '100', title : '工位名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '80', title : '工位类型', field : 'typename', sortable : true, halign:'center'},
|
||||
{width : '100', title : '所属车间', field : 'deptname', sortable : true, halign:'center'},
|
||||
{width : '100', title : '所属产线', field : 'linename', sortable : true, halign:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(grid.datagrid('getSelected')==null){
|
||||
grid.datagrid('selectRow',0);
|
||||
}
|
||||
},
|
||||
onSelect:function(index,row){
|
||||
var date=$('#wdt').val();
|
||||
showdetailsFun(date,row.id);
|
||||
}
|
||||
});
|
||||
var nextdate=getNextFormatDate();
|
||||
$('#wdt').val(nextdate);
|
||||
});
|
||||
var showValue = function(workdate) {
|
||||
var row = $("#grid").datagrid("getSelected");
|
||||
showdetailsFun(workdate,row.id);
|
||||
};
|
||||
var showdetailsFun = function(workdate,workstationid) {
|
||||
//alert(workdate);
|
||||
$("#rightFrameScheduling").attr("src",ext.contextPath+"/work/workscheduling/showuserlist.do?workdate="+workdate+"&workstationid="+workstationid);
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="datediv" data-options="region:'center'" title="排班日期" style="padding:5px;">
|
||||
<table id="datetable" class="tooltable">
|
||||
<tr>
|
||||
<td>排班日期</td>
|
||||
<td><input id="wdt" name="wdt" class="Wdate" value="${param.workdate }"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"
|
||||
onPropertyChange="showValue(this.value)"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="maindiv" class="easyui-layout" data-options="fit:true">
|
||||
<div id="leftdiv" data-options="region:'west',split:true" title="工位选择" style="width:400px;padding:0;">
|
||||
<table id="toolbar" style="width:100%">
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table>
|
||||
<tr>
|
||||
<td>名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" style="width: 180px;" /></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
<div id="rightdiv" data-options="region:'center'">
|
||||
<div id="tt" class="easyui-tabs" data-options="fit:true">
|
||||
<div title="选择人员">
|
||||
<iframe id="rightFrameScheduling" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;"
|
||||
frameBorder="0" scrolling="auto"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
204
bin/WebRoot/jsp/work/workschedulingList.jsp
Normal file
204
bin/WebRoot/jsp/work/workschedulingList.jsp
Normal file
@ -0,0 +1,204 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript" src="http://sandbox.runjs.cn/uploads/rs/233/bkf2ntm7/jquery.fullcalendar.js?v=0.7"></script>
|
||||
<style scoped="scoped">
|
||||
.md{
|
||||
background-position:2px center;
|
||||
text-align:center;
|
||||
font-weight:bold;
|
||||
font-size:20px;
|
||||
padding:0 2px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript" src="json2.js"></script>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var doSchedulingFun = function(dt,groupManageid,groupManagename){
|
||||
var tdt = new Date(Date.parse(dt.replace("-","/")));
|
||||
var myDate=new Date();//取今天的时间
|
||||
var year=myDate.getFullYear();
|
||||
var month=myDate.getMonth()+1;
|
||||
var day=myDate.getDate();
|
||||
var ndt = new Date(Date.parse(year+"/"+month+"/"+day));
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '排班管理('+dt+','+groupManagename+')注:过期日期不能修改排班',
|
||||
width : 1000,
|
||||
height : 600,
|
||||
resizable:true,
|
||||
url : ext.contextPath + '/work/workscheduling/schedulingtogroup.do?dt='+dt+'&groupManageid='+groupManageid,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
if(tdt<ndt){
|
||||
parent.$.messager.alert('提示','日期已过期,无法保存!','info');
|
||||
}else{
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, window);
|
||||
}
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var addFun = function(){
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '选择排班人',
|
||||
width : 800,
|
||||
height : 600,
|
||||
resizable:true,
|
||||
url : ext.contextPath + '/work/group/showlistForSelect.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
var str="";
|
||||
$.each(res.result,function(index,item){
|
||||
str+=item.userid+",";
|
||||
});
|
||||
$.post(ext.contextPath + '/work/workscheduling/save.do', {ids:str.replace(/,$/g,""),taskid:'${param.taskid}',workstationid:'${param.workstationid}'} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','添加成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','添加失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}]
|
||||
});
|
||||
};
|
||||
var groupManage = function(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '工段维护',
|
||||
url : ext.contextPath + '/work/groupManage/showlist.do',
|
||||
width:1200,
|
||||
height:600
|
||||
});
|
||||
};
|
||||
var groupManageid="";
|
||||
var groupManagename="";
|
||||
var dosheduling = function(d,dname){
|
||||
groupManageid=d;
|
||||
groupManagename=dname;
|
||||
};
|
||||
function getNextFormatDate() {
|
||||
var nowdate = new Date();
|
||||
var seperator1 = "-";
|
||||
var seperator2 = ":";
|
||||
nowdate=nowdate.valueOf()+1000*60*60*24;
|
||||
var date = new Date(nowdate);
|
||||
var year = date.getFullYear();
|
||||
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 nextdate = year + seperator1 + month + seperator1 + strDate;
|
||||
return nextdate;
|
||||
}
|
||||
var refreshcalerdar=function(){
|
||||
var month=$('#cc').calendar('options')['month'];
|
||||
var year=$('#cc').calendar('options')['year'];
|
||||
var btext="";
|
||||
$.post(ext.contextPath + '/work/workscheduling/getGTScheduling.do',{year:year,month:month}, function(data) {
|
||||
var obj = JSON.parse(data);
|
||||
|
||||
var obj_gt=obj.groupManage;
|
||||
|
||||
var obj_ws=obj.workscheduling;
|
||||
$('#cc').calendar({
|
||||
formatter: function(date){
|
||||
btext="";
|
||||
var d = date.getDate();
|
||||
var m = date.getMonth()+1;
|
||||
|
||||
for(var i=0;i<obj_gt.length;i++){
|
||||
var j=0;
|
||||
for(j=0;j<obj_ws.length;j++)
|
||||
{
|
||||
var workstdt=obj_ws[j].workstdt;
|
||||
//alert(workstdt);
|
||||
wsmonth=String(parseInt(workstdt.substring(5,7)));//去除数据库查询日期中的"0'
|
||||
wsday=String(parseInt(workstdt.substring(8,10)));
|
||||
if(m==wsmonth && d==wsday && obj_gt[i].id==obj_ws[j].groupManageid){
|
||||
btext=btext+'  '+'<a class="easyui-linkbutton" style="font-weight:bold;color:blue;font-size:16px;" onmouseover="changeback1(this)" onmouseout="changeback2(this)" onclick="dosheduling(\''+obj_gt[i].id+'\',\''+obj_gt[i].name+'\')">'+obj_gt[i].name+ '</a>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(j==obj_ws.length){
|
||||
btext=btext+'  '+'<a class="easyui-linkbutton" style="color:black;font-size:16px;" onmouseover="changeback1(this)" onmouseout="changeback2(this)" onclick="dosheduling(\''+obj_gt[i].id+'\',\''+obj_gt[i].name+'\')">'+obj_gt[i].name+ '</a>';
|
||||
}
|
||||
}
|
||||
var bt='<div class="md" style="font-size:26px;" >'+d+'</div>';
|
||||
bt=bt+btext;
|
||||
return bt;
|
||||
},
|
||||
onSelect: function(date){
|
||||
var dt=date.getFullYear()+"-";
|
||||
if(date.getMonth()+1<10){
|
||||
dt=dt+"0";
|
||||
}
|
||||
dt=dt+(date.getMonth()+1)+"-";
|
||||
if(date.getDate()<10){
|
||||
dt=dt+"0";
|
||||
}
|
||||
dt=dt+date.getDate();
|
||||
|
||||
if(groupManageid!=""){
|
||||
doSchedulingFun(dt,groupManageid,groupManagename);
|
||||
}
|
||||
groupManageid="";
|
||||
groupManagename="";
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
var lastcolor;
|
||||
var changeback1=function(obj){
|
||||
|
||||
lastcolor=obj.style.color.toLowerCase();
|
||||
//alert(lastcolor);
|
||||
obj.style.color=obj.style.color.toLowerCase()=='red'?lastcolor:'red';
|
||||
};
|
||||
var changeback2=function(obj){
|
||||
obj.style.color=obj.style.color.toLowerCase()=='red'?lastcolor:'red';
|
||||
};
|
||||
$(function() {
|
||||
|
||||
refreshcalerdar();
|
||||
|
||||
$('#cc div.calendar-nav').click(function () {
|
||||
setTimeout("refreshcalerdar()",0);//setTimeout产生异步效果
|
||||
});
|
||||
$('#cc div.calendar-menu-month-inner').click(function () {
|
||||
setTimeout("refreshcalerdar()",0);
|
||||
});
|
||||
|
||||
$(".calendar-title .calendar-text").css("fontSize","18px");
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false" style="font-family:微软雅黑">
|
||||
<div class="easyui-panel" data-options="fit:true" style="padding:2px;">
|
||||
<div id="cc" class="easyui-calendar" data-options="fit:true" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
244
bin/WebRoot/jsp/work/workschedulinguserList.jsp
Normal file
244
bin/WebRoot/jsp/work/workschedulinguserList.jsp
Normal file
@ -0,0 +1,244 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function(){
|
||||
var workdate= '${param.workdate}';
|
||||
if(workdate==""){
|
||||
parent.$.messager.alert('提示','请先选择需要排班的日期','info',function(){
|
||||
});
|
||||
}else{
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '选择工段',
|
||||
width : 400,
|
||||
height : 300,
|
||||
resizable:true,
|
||||
url : ext.contextPath + '/work/groupManage/showlistforselect.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
var str="";
|
||||
$.each(res.result,function(index,item){
|
||||
str=item.id;
|
||||
});
|
||||
selectFun(str);
|
||||
}
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
var selectFun = function(groupManageid) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '选择排班人',
|
||||
width : 800,
|
||||
height : 600,
|
||||
resizable:true,
|
||||
url : ext.contextPath + '/work/group/showlistForSelect.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
var str="";
|
||||
$.each(res.result,function(index,item){
|
||||
str+=item.userid+",";
|
||||
});
|
||||
$.post(ext.contextPath + '/work/workscheduling/save.do',
|
||||
{ids:str.replace(/,$/g,""),groupManageid:groupManageid,workdate:'${param.workdate}',
|
||||
workstationid:'${param.workstationid}'} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','添加成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','添加失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}]
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑任务',
|
||||
url : ext.contextPath + '/work/worktask/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var viewFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看用户信息',
|
||||
url : ext.contextPath + '/work/workstation/view.do?id=' + id
|
||||
});
|
||||
};
|
||||
|
||||
var refreshFun = function() {
|
||||
$.post(ext.contextPath + '/work/worktask/getnewtask.do', {}, function(data) {
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workscheduling/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
//alert(datas);
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workscheduling/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','成功删除'+data+'条记录','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var groupManage = function(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '工段维护',
|
||||
url : ext.contextPath + '/work/groupManage/showlist.do',
|
||||
width:1200,
|
||||
height:600
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workscheduling/getlist.do?wdt=${param.workdate}&workstationid=${param.workstationid}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '姓名', field : '_username', sortable : true, halign:'center'},
|
||||
{width : '100', title : '工段', field : '_groupManagename', sortable : true, halign:'center'},
|
||||
{width : '100', title : '班组', field : '_groupname', sortable : true, halign:'center'},
|
||||
{width : '100', title : '工种', field : '_jobname', sortable : true, halign:'center'},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
<%if (sessionManager.havePermission(session,"work/workscheduling/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/workscheduling/delete.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%if (sessionManager.havePermission(session,"work/workscheduling/add.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/workscheduling/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>人员姓名</td>
|
||||
<td><input name="search_username" class="easyui-textbox" /></td>
|
||||
<td> </td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<input id="userids" name="userids" type="hidden" />
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
173
bin/WebRoot/jsp/work/workshopAdd.jsp
Normal file
173
bin/WebRoot/jsp/work/workshopAdd.jsp
Normal file
@ -0,0 +1,173 @@
|
||||
<!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"%>
|
||||
<%@page import="com.sipai.entity.process.TaskProcedure"%>
|
||||
<%request.setAttribute("Type_Inspect",TaskProcedure.Type_Inspect);%>
|
||||
<%request.setAttribute("Type_Produce",TaskProcedure.Type_Produce);%>
|
||||
<%request.setAttribute("Flag_Semi",TaskProcedure.Flag_Semi);%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$("#procedids").val(getGriddata());
|
||||
$.post(ext.contextPath + "/work/workshop/save.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
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 getGriddata(){
|
||||
var gridrows= $('#grid').datagrid('getRows');
|
||||
var griddata= '';
|
||||
$.each(gridrows, function(index, item){
|
||||
if(griddata!=""){
|
||||
griddata+=",";
|
||||
}
|
||||
griddata+=item.id;
|
||||
});
|
||||
return griddata;
|
||||
}
|
||||
function doadd_Proced(){
|
||||
localStorage.setItem("procedids",getProcedids());
|
||||
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 getProcedids(){
|
||||
var procedrows= $('#grid').datagrid("getRows");
|
||||
console.info(procedrows)
|
||||
var procedids="";
|
||||
$.each(procedrows, function(index, item){
|
||||
procedids+=item.id+",";
|
||||
});
|
||||
procedids=procedids.replace(/,$/gi,"");
|
||||
return procedids;
|
||||
}
|
||||
var grid;
|
||||
$(function() {
|
||||
$('#griddiv').panel({
|
||||
width:"100%",
|
||||
height:"350",
|
||||
title: '车间工序(请按工序先后顺序排序)',
|
||||
tools: [{
|
||||
iconCls:'icon-add',
|
||||
handler:function(){doadd_Proced();}
|
||||
}]
|
||||
});
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
data : null,
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect: true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{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');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" name="id" value="${requestScope.id}"/>
|
||||
<input id="procedids" name="procedids" type="hidden" value="" />
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>车间名称</th>
|
||||
<td colspan="3"><input name="name" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>楼层区域</th>
|
||||
<td colspan="3"><input id="areas" name="areas" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<a class="easyui-linkbutton" href="javascript:new commfile('document.DocFileMapper','${requestScope.id}').showUpload();">监测图片上传</a>
|
||||
</th>
|
||||
<td colspan="3">
|
||||
<div id="fileList"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br />
|
||||
<div id="griddiv" data-options="region:'center'" title="" style="padding:0;" >
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
177
bin/WebRoot/jsp/work/workshopEdit.jsp
Normal file
177
bin/WebRoot/jsp/work/workshopEdit.jsp
Normal file
@ -0,0 +1,177 @@
|
||||
<!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"%>
|
||||
<%@page import="com.sipai.entity.process.TaskProcedure"%>
|
||||
<%request.setAttribute("Type_Inspect",TaskProcedure.Type_Inspect);%>
|
||||
<%request.setAttribute("Type_Produce",TaskProcedure.Type_Produce);%>
|
||||
<%request.setAttribute("Flag_Semi",TaskProcedure.Flag_Semi);%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$("#procedids").val(getGriddata());
|
||||
$.post(ext.contextPath + "/work/workshop/update.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
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 getGriddata(){
|
||||
var gridrows= $('#grid').datagrid('getRows');
|
||||
var griddata= '';
|
||||
$.each(gridrows, function(index, item){
|
||||
if(griddata!=""){
|
||||
griddata+=",";
|
||||
}
|
||||
griddata+=item.id;
|
||||
});
|
||||
return griddata;
|
||||
}
|
||||
function doadd_Proced(){
|
||||
localStorage.setItem("procedids",getProcedids());
|
||||
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 getProcedids(){
|
||||
var procedrows= $('#grid').datagrid("getRows");
|
||||
var procedids="";
|
||||
$.each(procedrows, function(index, item){
|
||||
procedids+=item.id+",";
|
||||
});
|
||||
procedids=procedids.replace(/,$/gi,"");
|
||||
return procedids;
|
||||
}
|
||||
var grid;
|
||||
|
||||
$(function() {
|
||||
//附件加载
|
||||
new commfile('document.DocFileMapper','${workshop.id}').loadfile();
|
||||
|
||||
$('#griddiv').panel({
|
||||
width:"100%",
|
||||
height:"350",
|
||||
title: '车间工序(请按工序先后顺序排序)',
|
||||
tools: [{
|
||||
iconCls:'icon-add',
|
||||
handler:function(){doadd_Proced();}
|
||||
}]
|
||||
});
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
data : ${procedures},
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect: true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{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');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" name="id" value="${workshop.id}"/>
|
||||
<input id="procedids" name="procedids" type="hidden" value="" />
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>车间名称</th>
|
||||
<td colspan="3"><input name="name" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${workshop.name}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>楼层区域</th>
|
||||
<td colspan="3"><input id="areas" name="areas" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${workshop.areas}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<a class="easyui-linkbutton" href="javascript:new commfile('document.DocFileMapper','${workshop.id}').showUpload();">监测图片上传</a>
|
||||
</th>
|
||||
<td colspan="3">
|
||||
<div id="fileList"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</form>
|
||||
<br />
|
||||
<div id="griddiv" data-options="region:'center'" title="" style="padding:0;" >
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
176
bin/WebRoot/jsp/work/workshopList.jsp
Normal file
176
bin/WebRoot/jsp/work/workshopList.jsp
Normal file
@ -0,0 +1,176 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '新增车间',
|
||||
url : ext.contextPath + '/work/workshop/add.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeedit',
|
||||
title : '编辑车间',
|
||||
url : ext.contextPath + '/work/workshop/edit.do?iframeId=iframeedit&id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var viewFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看用户信息',
|
||||
url : ext.contextPath + '/work/group/view.do?id=' + id
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workshop/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
//alert(datas);
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workshop/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','成功删除'+data+'条记录','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workshop/getlist.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
nowrap:false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '车间名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '180', title : '楼层区域', field : 'areas', sortable : true, halign:'center'},
|
||||
{width : '180', title : '备注', field : 'remark', sortable : true, halign:'center'},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
<%if (sessionManager.havePermission(session,"work/workshop/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/workshop/delete.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%if (sessionManager.havePermission(session,"work/group/add.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/group/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>车间名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" /></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
258
bin/WebRoot/jsp/work/workstationAdd.jsp
Normal file
258
bin/WebRoot/jsp/work/workstationAdd.jsp
Normal file
@ -0,0 +1,258 @@
|
||||
<!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 + "/work/workstation/save.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
console.log("getWids()",getWids());
|
||||
$.post(ext.contextPath + "/work/workstation/saveProcedure.do",{workstationid: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() {
|
||||
$("#equipmentname").textbox('textbox').bind("click", function () {
|
||||
selectId("equipmentname","equipmentid");
|
||||
});
|
||||
});
|
||||
|
||||
function selectId(equipmentname,equipmentid){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择设备id',
|
||||
width: 700,
|
||||
height:420,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/showEquipmentForSelect.do?',
|
||||
toolbar:'',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectID();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
$("#"+equipmentname).textbox("setValue",res.equipmentcard);
|
||||
$("#"+equipmentid).val(res.id);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$('#deptid').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
onBeforeSelect:function(node){
|
||||
if(node.id=="-1"){
|
||||
$("#deptid").combotree("unselect");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#typeid').combobox({
|
||||
url : ext.contextPath + '/work/workstationType/getselectlist.do?random=' + Math.random(),
|
||||
valueField:'id',
|
||||
textField:'name',
|
||||
method:'get'
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
$("#tr").hide();
|
||||
$("#typeid").combobox({
|
||||
onSelect: function () {
|
||||
var typeid = $('#typeid').combobox('getText');
|
||||
if(typeid == '自动工位'){
|
||||
$("#tr").show();
|
||||
}else{
|
||||
$("#tr").hide();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
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(){
|
||||
$("#wids").val(getWids());
|
||||
localStorage.setItem("wids",$("#wids").val().split(","));
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加工序',
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workstation/showProcedurelistForSelects.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,
|
||||
procedurename:data.res[i].procedurename,
|
||||
procedurecode:data.res[i].procedurecode,
|
||||
keywords:data.res[i].keywords,
|
||||
type:data.res[i].type,
|
||||
semiflag:data.res[i].semiflag
|
||||
});
|
||||
}
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
}
|
||||
function dodelete(){
|
||||
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();}
|
||||
},{
|
||||
iconCls:'icon-remove',
|
||||
handler:function(){dodelete();}
|
||||
}]
|
||||
|
||||
});
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '工序名称', field : 'procedurename', sortable : true, halign:'center'},
|
||||
{width : '100', title : '工序编号', field : 'procedurecode', sortable : true, halign:'center'},
|
||||
{width : '100', title : '关键字', field : 'keywords', sortable : true, halign:'center'},
|
||||
{width : '100', title : '类型', field : 'type', sortable : true, halign:'center',formatter : function(value, row) {
|
||||
if(row.type=='${Type_Inspect}'){
|
||||
return '检测工序';
|
||||
}else{
|
||||
return '生产工序';
|
||||
}
|
||||
}},
|
||||
{width : '80', title : '半成品工序', field : 'semiflag', sortable : true, halign:'center',formatter : function(value, row) {
|
||||
if(row.semiflag=='${Flag_Semi}'){
|
||||
return '是';
|
||||
}else{
|
||||
return '否';
|
||||
}
|
||||
}},
|
||||
]]
|
||||
});
|
||||
|
||||
});
|
||||
</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="typeid" name="typeid" class="easyui-combobox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="tr">
|
||||
<th>关联设备</th>
|
||||
<td><input id="equipmentname" name="equipmentname" class="easyui-textbox" value="" />
|
||||
<input id="equipmentid" name="equipmentid" type="hidden" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>工位编号</th>
|
||||
<td><input name="serial" 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><input name="intro" class="easyui-textbox" style="width:100%;height:100px" value=""
|
||||
data-options="multiline:true" validtype="length[0,250]" invalidMessage="有效长度0-250" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</br></br>
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
274
bin/WebRoot/jsp/work/workstationEdit.jsp
Normal file
274
bin/WebRoot/jsp/work/workstationEdit.jsp
Normal file
@ -0,0 +1,274 @@
|
||||
<!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 + "/work/workstation/update.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
console.log("getWids()",getWids());
|
||||
$.post(ext.contextPath + "/work/workstation/saveProcedure.do",{workstationid: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() {
|
||||
$("#equipmentname").textbox('textbox').bind("click", function () {
|
||||
selectId("equipmentname","equipmentid");
|
||||
});
|
||||
});
|
||||
|
||||
function selectId(equipmentname,equipmentid){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择设备id',
|
||||
width: 700,
|
||||
height:420,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/showEquipmentForSelect.do?',
|
||||
toolbar:'',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectID();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
$("#"+equipmentname).textbox("setValue",res.equipmentcard);
|
||||
$("#"+equipmentid).val(res.id);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$('#deptid').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
onBeforeSelect:function(node){
|
||||
if(node.id=="-1"){
|
||||
$("#deptid").combotree("unselect");
|
||||
}
|
||||
},
|
||||
onLoadSuccess:function(){
|
||||
$('#deptid').combotree('setValue','${workstation.deptid}');
|
||||
}
|
||||
});
|
||||
|
||||
$('#typeid').combobox({
|
||||
url : ext.contextPath + '/work/workstationType/getselectlist.do?random=' + Math.random(),
|
||||
valueField:'id',
|
||||
textField:'name',
|
||||
method:'get',
|
||||
onLoadSuccess:function(){
|
||||
$('#typeid').combobox('setValue','${workstation.typeid}');
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
var typename = '${workstation.typename}';
|
||||
if (typename!= '自动工位'){
|
||||
$("#tr").hide();
|
||||
}
|
||||
$("#typeid").combobox({
|
||||
onSelect: function () {
|
||||
var typeid = $('#typeid').combobox('getText');
|
||||
if(typeid == '自动工位'){
|
||||
$("#tr").show();
|
||||
}else{
|
||||
$("#tr").hide();
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
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(){
|
||||
$("#wids").val(getWids());
|
||||
localStorage.setItem("wids",$("#wids").val().split(","));
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加工序',
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workstation/showProcedurelistForSelects.do?iframeId=workstationEdit',
|
||||
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,
|
||||
procedurename:data.res[i].procedurename,
|
||||
procedurecode:data.res[i].procedurecode,
|
||||
keywords:data.res[i].keywords,
|
||||
type:data.res[i].type,
|
||||
semiflag:data.res[i].semiflag
|
||||
});
|
||||
}
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
}
|
||||
function dodelete(){
|
||||
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();}
|
||||
},{
|
||||
iconCls:'icon-remove',
|
||||
handler:function(){dodelete();}
|
||||
}]
|
||||
|
||||
});
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '工序名称', field : 'procedurename', sortable : true, halign:'center'},
|
||||
{width : '100', title : '工序编号', field : 'procedurecode', sortable : true, halign:'center'},
|
||||
{width : '100', title : '关键字', field : 'keywords', sortable : true, halign:'center'},
|
||||
{width : '100', title : '类型', field : 'type', sortable : true, halign:'center',formatter : function(value, row) {
|
||||
if(row.type=='${Type_Inspect}'){
|
||||
return '检测工序';
|
||||
}else{
|
||||
return '生产工序';
|
||||
}
|
||||
}},
|
||||
{width : '80', title : '半成品工序', field : 'semiflag', sortable : true, halign:'center',formatter : function(value, row) {
|
||||
if(row.semiflag=='${Flag_Semi}'){
|
||||
return '是';
|
||||
}else{
|
||||
return '否';
|
||||
}
|
||||
}},
|
||||
]],
|
||||
data:${ProcedureList}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<input id="wids" name="wids" type="hidden" value="" />
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${workstation.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>工位类型</th>
|
||||
<td><input id="typeid" name="typeid" class="easyui-combobox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="tr">
|
||||
<th>关联设备</th>
|
||||
<td><input id="equipmentname" name="equipmentname" class="easyui-textbox"
|
||||
value="${workstation.equipmentname}" />
|
||||
<input id="equipmentid" name="equipmentid" type="hidden" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>工位编号</th>
|
||||
<td><input name="serial" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${workstation.serial}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>工位名称</th>
|
||||
<td><input name="name" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${workstation.name}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>工位概述</th>
|
||||
<td>
|
||||
<textarea name="intro" class="easyui-textbox" data-options="multiline:true" validtype="length[0,250]" invalidMessage="有效长度0-250"
|
||||
style="width:100%;height:100px">${workstation.intro}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</br></br>
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
180
bin/WebRoot/jsp/work/workstationList.jsp
Normal file
180
bin/WebRoot/jsp/work/workstationList.jsp
Normal file
@ -0,0 +1,180 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加工位',
|
||||
url : ext.contextPath + '/work/workstation/add.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑工位',
|
||||
url : ext.contextPath + '/work/workstation/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workstation/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
//alert(datas);
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workstation/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','成功删除'+data+'条记录','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workstation/getlist.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '160', title : '工位编号', field : 'serial', sortable : true, halign:'center'},
|
||||
{width : '200', title : '工位名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '100', title : '工位类型', field : 'typename', sortable : true, halign:'center'},
|
||||
{width : '180', title : '工位概述', field : 'intro', halign:'center'},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
<%if (sessionManager.havePermission(session,"work/workstation/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/workstation/delete.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
|
||||
$('#search_dept').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
onBeforeSelect:function(node){
|
||||
if(node.id=="-1"){
|
||||
$("#deptid").tree("unselect");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%if (sessionManager.havePermission(session,"work/workstation/add.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/workstation/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>工位名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" /></td>
|
||||
<td>所属车间</td>
|
||||
<td><input id="search_dept" name="search_dept" class="easyui-combotree"/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
88
bin/WebRoot/jsp/work/workstationListForSelect.jsp
Normal file
88
bin/WebRoot/jsp/work/workstationListForSelect.jsp
Normal file
@ -0,0 +1,88 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function selectFun(dialog, grid) {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas = '{"id":"'+item.id +'","serial":"'+item.serial +'",'+
|
||||
'"name":"'+item.name +'","typename":"'+item.typename +'",'+
|
||||
'"deptname":"'+item.deptname +'","linename":"'+item.linename +'"}';
|
||||
});
|
||||
return $.parseJSON(datas);
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workstation/getlist.do?querytype=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '160', title : '工位编号', field : 'serial', sortable : true, halign:'center'},
|
||||
{width : '240', title : '工位名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '80', title : '工位类型', field : 'typename', sortable : true, halign:'center'},
|
||||
{width : '180', title : '所属车间', field : 'deptname', sortable : true, halign:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar'
|
||||
});
|
||||
|
||||
$('#search_dept').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
onBeforeSelect:function(node){
|
||||
if(node.id=="-1"){
|
||||
$("#deptid").tree("unselect");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>工位名称</td>
|
||||
<td><input id="search_name" name="search_name" class="easyui-textbox" /></td>
|
||||
<td>所属车间</td>
|
||||
<td><input id="search_dept" name="search_dept" class="easyui-combotree"/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#search_name').textbox('setValue','');$('#search_line').combobox('setValue','');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
107
bin/WebRoot/jsp/work/workstationListForSelects.jsp
Normal file
107
bin/WebRoot/jsp/work/workstationListForSelects.jsp
Normal file
@ -0,0 +1,107 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function selectFun(dialog, grid) {
|
||||
//清除旧数据
|
||||
var wrows= grid.datagrid("getRows");
|
||||
//复制rows,否则deleteRow的index会出错
|
||||
var copyRows = [];
|
||||
for ( var j= 0; j < wrows.length; j++) {
|
||||
copyRows.push(wrows[j]);
|
||||
}
|
||||
$.each(copyRows, function(index, item){
|
||||
grid.datagrid('deleteRow', grid.datagrid('getRowIndex',copyRows[index]));
|
||||
});
|
||||
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas += '{"id":"'+item.id +'","serial":"'+item.serial +'",'+
|
||||
'"name":"'+item.name +'","typename":"'+item.typename +'",'+
|
||||
'"deptname":"'+item.deptname +'","linename":"'+item.linename +'"},';
|
||||
});
|
||||
datas = '{"res":['+datas.replace(/,$/gi,"")+']}';
|
||||
return $.parseJSON(datas);
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workstation/getlist.do?querytype=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '160', title : '工位编号', field : 'serial', sortable : true, halign:'center'},
|
||||
{width : '240', title : '工位名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '80', title : '工位类型', field : 'typename', sortable : true, halign:'center'},
|
||||
{width : '180', title : '所属车间', field : 'deptname', sortable : true, halign:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess:function(data){
|
||||
var wids = parent.$("#${param.iframeId}")[0].contentWindow.$("#wids").val().split(",");
|
||||
$.each(wids, function(index, item){
|
||||
if(item != ""){
|
||||
$('#grid').datagrid("checkRow",$('#grid').datagrid("getRowIndex",item));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#search_dept').combotree({
|
||||
url : ext.contextPath + '/user/getUnitsJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
onBeforeSelect:function(node){
|
||||
if(node.id=="-1"){
|
||||
$("#deptid").tree("unselect");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>工位名称</td>
|
||||
<td><input id="search_name" name="search_name" class="easyui-textbox" /></td>
|
||||
<td>所属车间</td>
|
||||
<td><input id="search_dept" name="search_dept" class="easyui-combotree"/></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#search_name').textbox('setValue','');$('#search_line').combobox('setValue','');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
54
bin/WebRoot/jsp/work/workstationTypeAdd.jsp
Normal file
54
bin/WebRoot/jsp/work/workstationTypeAdd.jsp
Normal file
@ -0,0 +1,54 @@
|
||||
<!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 + "/work/workstationType/save.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
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');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>工位类型编号</th>
|
||||
<td><input name="serial" 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>
|
||||
<input name="intro" class="easyui-textbox" style="width:100%;height:100px" value=""
|
||||
data-options="multiline:true" validtype="length[0,250]" invalidMessage="有效长度0-250" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
56
bin/WebRoot/jsp/work/workstationTypeEdit.jsp
Normal file
56
bin/WebRoot/jsp/work/workstationTypeEdit.jsp
Normal file
@ -0,0 +1,56 @@
|
||||
<!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 + "/work/workstationType/update.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
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');
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${workstationType.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>工位类型编号</th>
|
||||
<td><input name="serial" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${workstationType.serial}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>工位类型名称</th>
|
||||
<td><input name="name" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${workstationType.name}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>工位类型描述</th>
|
||||
<td>
|
||||
<textarea name="intro" class="easyui-textbox" data-options="multiline:true"
|
||||
validtype="length[0,250]" invalidMessage="有效长度0-250"
|
||||
style="width:100%;height:100px">${workstationType.intro}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
173
bin/WebRoot/jsp/work/workstationTypeList.jsp
Normal file
173
bin/WebRoot/jsp/work/workstationTypeList.jsp
Normal file
@ -0,0 +1,173 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加工位类型',
|
||||
url : ext.contextPath + '/work/workstationType/add.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑工位类型',
|
||||
url : ext.contextPath + '/work/workstationType/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var viewFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看用户信息',
|
||||
url : ext.contextPath + '/work/workstationType/view.do?id=' + id
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workstationType/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var deletesFun = function() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas+=item.id+",";
|
||||
});
|
||||
//alert(datas);
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/work/workstationType/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','成功删除'+data+'条记录','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/workstationType/getlist.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '工位类型编号', field : 'serial', sortable : true, halign:'center'},
|
||||
{width : '100', title : '工位类型名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '180', title : '工位类型描述', field : 'intro', halign:'center'},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
<%if (sessionManager.havePermission(session,"work/workstationType/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/workstationType/delete.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%if (sessionManager.havePermission(session,"work/workstationType/add.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"work/workstationType/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>工位类型名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" /></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="grid.datagrid('load',ext.serializeObject($('#searchForm')));">搜索</a>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true"
|
||||
onclick="$('#searchForm').form('clear');grid.datagrid('load',{});">重置</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user