215 lines
7.0 KiB
Plaintext
215 lines
7.0 KiB
Plaintext
<%@ 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> |