216 lines
6.6 KiB
Plaintext
216 lines
6.6 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(){
|
||
|
|
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>
|