first commit
This commit is contained in:
78
bin/WebRoot/jsp/activiti/importAutoActiviti.jsp
Normal file
78
bin/WebRoot/jsp/activiti/importAutoActiviti.jsp
Normal file
@ -0,0 +1,78 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>导入人员</title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script>
|
||||
var uploader,state;
|
||||
$(function() {
|
||||
var $ = jQuery,
|
||||
$list = $('#thelist'),
|
||||
state = 'pending';
|
||||
|
||||
uploader = WebUploader.create({
|
||||
// swf文件路径
|
||||
swf: ext.contextPath+'/JS/webuploader-0.1.5/Uploader.swf',
|
||||
// 文件接收服务端。
|
||||
server: ext.contextPath+'/activiti/auto/saveImportActiviti.do',
|
||||
// 选择文件的按钮。可选。
|
||||
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
|
||||
pick: {
|
||||
id: '#picker',
|
||||
multiple: false
|
||||
},
|
||||
// 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传!
|
||||
resize: false,
|
||||
accept: {
|
||||
title: 'Excel',
|
||||
extensions: 'xls,xlsx',
|
||||
mimeTypes: 'excel/*'
|
||||
}
|
||||
});
|
||||
//当有文件被添加进队列的时候
|
||||
uploader.on( 'fileQueued', function( file ) {
|
||||
$list.append( '<div id="' + file.id + '" class="item">' +
|
||||
'<h4 class="info">' + file.name + '</h4>' +
|
||||
'<p class="state">等待上传...</p>' +
|
||||
'</div>' );
|
||||
});
|
||||
});
|
||||
|
||||
var doimport = function(dialog, grid){
|
||||
//执行上传功能
|
||||
if ( state === 'uploading' ) {
|
||||
alert("文件正在上传中,请稍等");
|
||||
} else {
|
||||
uploader.upload();
|
||||
}
|
||||
|
||||
uploader.on( 'uploadError', function( file ) {
|
||||
$( '#'+file.id ).find('p.state').text('上传出错');
|
||||
});
|
||||
|
||||
uploader.on( 'uploadSuccess', function( file,response ) {
|
||||
$( '#'+file.id ).find('p.state').text('已上传');
|
||||
if(response=="1"){
|
||||
grid.datagrid('reload');
|
||||
alert("导入成功!");
|
||||
dialog.dialog('destroy');
|
||||
}else{
|
||||
alert("导入未完成!");
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="uploader" class="wu-example">
|
||||
<div class="btns">
|
||||
<div id="picker">选择文件</div>
|
||||
</div>
|
||||
<!--用来存放文件信息-->
|
||||
<div id="thelist" class="uploader-list"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
78
bin/WebRoot/jsp/activiti/importExcel4Model.jsp
Normal file
78
bin/WebRoot/jsp/activiti/importExcel4Model.jsp
Normal file
@ -0,0 +1,78 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>导入人员</title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script>
|
||||
var uploader,state;
|
||||
$(function() {
|
||||
var $ = jQuery,
|
||||
$list = $('#thelist'),
|
||||
state = 'pending';
|
||||
|
||||
uploader = WebUploader.create({
|
||||
// swf文件路径
|
||||
swf: ext.contextPath+'/JS/webuploader-0.1.5/Uploader.swf',
|
||||
// 文件接收服务端。
|
||||
server: ext.contextPath+'${param.dest}?param=${param.param}',
|
||||
// 选择文件的按钮。可选。
|
||||
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
|
||||
pick: {
|
||||
id: '#picker',
|
||||
multiple: false
|
||||
},
|
||||
// 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传!
|
||||
resize: false,
|
||||
accept: {
|
||||
title: 'Excel',
|
||||
extensions: 'xls,xlsx',
|
||||
mimeTypes: 'excel/*'
|
||||
}
|
||||
});
|
||||
//当有文件被添加进队列的时候
|
||||
uploader.on( 'fileQueued', function( file ) {
|
||||
$list.append( '<div id="' + file.id + '" class="item">' +
|
||||
'<h4 class="info">' + file.name + '</h4>' +
|
||||
'<p class="state">等待上传...</p>' +
|
||||
'</div>' );
|
||||
});
|
||||
});
|
||||
|
||||
var doimport = function(dialog, grid){
|
||||
//执行上传功能
|
||||
if ( state === 'uploading' ) {
|
||||
alert("文件正在上传中,请稍等");
|
||||
} else {
|
||||
uploader.upload();
|
||||
}
|
||||
|
||||
uploader.on( 'uploadError', function( file ) {
|
||||
$( '#'+file.id ).find('p.state').text('上传出错');
|
||||
});
|
||||
|
||||
uploader.on( 'uploadSuccess', function( file,response ) {
|
||||
$( '#'+file.id ).find('p.state').text('已上传');
|
||||
if(response.res=="1"){
|
||||
grid.datagrid('reload');
|
||||
top.$.messager.alert('导入成功!', "以下工序:"+response.unmatch+",未查询到匹配工序,若需要,请手动编辑模型添加工序!");
|
||||
dialog.dialog('destroy');
|
||||
}else{
|
||||
alert("导入未完成!");
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="uploader" class="wu-example">
|
||||
<div class="btns">
|
||||
<div id="picker">选择文件</div>
|
||||
</div>
|
||||
<!--用来存放文件信息-->
|
||||
<div id="thelist" class="uploader-list"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
96
bin/WebRoot/jsp/activiti/leaveAdd.jsp
Normal file
96
bin/WebRoot/jsp/activiti/leaveAdd.jsp
Normal file
@ -0,0 +1,96 @@
|
||||
<!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')) {
|
||||
var g = $('#leaveDefinition').combogrid('grid'); // get datagrid object
|
||||
var r = g.datagrid('getSelected'); // get the selected row
|
||||
if(r){
|
||||
$.post(ext.contextPath + "/activiti/leavew/start.do?processId="+r.id, $(".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');
|
||||
}else{
|
||||
alert("请选择请假流程");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$('#leaveDefinition').combogrid({
|
||||
panelWidth: 400,
|
||||
idField: 'id',
|
||||
textField: 'id',
|
||||
url: ext.contextPath +'/activiti/workflow/getProcessListForSelect.do',
|
||||
columns: [[
|
||||
{field:'id',title:'流程ID',width:50},
|
||||
{field:'name',title:'名称',width:50},
|
||||
{field:'description',title:'描述',width:80},
|
||||
{field:'revision',title:'版本号',width:30}
|
||||
]],
|
||||
fitColumns: true
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td>请假流程:</td>
|
||||
<td>
|
||||
<select id="leaveDefinition" name="leaveDefinition" class="easyui-combogrid" >
|
||||
</select>
|
||||
<input name="processDefinitionId" type="hidden" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>请假类型:</td>
|
||||
<td>
|
||||
<select id="leaveType" name="leaveType" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option>公休</option>
|
||||
<option>病假</option>
|
||||
<option>调休</option>
|
||||
<option>事假</option>
|
||||
<option>婚假</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>开始时间:</td>
|
||||
<td><input id="startTime" name="startTime" class="Wdate"
|
||||
value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
|
||||
readonly/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>结束时间:</td>
|
||||
<td><input id="endTime" name="endTime" class="Wdate"
|
||||
value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
|
||||
readonly/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>请假原因:</td>
|
||||
<td>
|
||||
<input id="reason" name="reason" 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>
|
||||
140
bin/WebRoot/jsp/activiti/leaveDetail.jsp
Normal file
140
bin/WebRoot/jsp/activiti/leaveDetail.jsp
Normal file
@ -0,0 +1,140 @@
|
||||
<!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.*" contentType="text/html; charset=UTF-8" 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"%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript" src="json2.js"></script>
|
||||
<script src="<%=contextPath%>/JS/activiti/leave-complete.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
function dosave(dialog,grid) {
|
||||
|
||||
}
|
||||
function doreject(dialog,taskId) {
|
||||
// 设置流程变量
|
||||
$.messager.prompt('提示', '请填写驳回原因', function(r){
|
||||
if (r){
|
||||
complete(dialog,taskId, [{
|
||||
key: 'deptLeaderPass',
|
||||
value: false,
|
||||
type: 'B',
|
||||
comment:r
|
||||
}]);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
function docomplete(dialog,taskId) {
|
||||
// 设置流程变量
|
||||
complete(dialog,taskId, [{
|
||||
key: 'deptLeaderPass',
|
||||
value: true,
|
||||
type: 'B'
|
||||
}]);
|
||||
}
|
||||
function docompleteToSub(dialog,taskId) {
|
||||
// 设置流程变量
|
||||
var list=["dept1","dept2"];
|
||||
var liststr="";
|
||||
$.each(list, function() {
|
||||
if (liststr != "") {
|
||||
liststr += "-";
|
||||
}
|
||||
liststr += this;
|
||||
});
|
||||
complete(dialog,taskId, [{
|
||||
key: 'deptLeaderPass',
|
||||
value: true,
|
||||
type: 'B'
|
||||
},{
|
||||
key: 'CodeList',
|
||||
value: liststr,
|
||||
type: 'A'
|
||||
}]);
|
||||
}
|
||||
function doreApply(dialog,taskId) {
|
||||
// 设置流程变量
|
||||
complete(dialog,taskId, [{
|
||||
key: 'reApply',
|
||||
value: true,
|
||||
type: 'B'
|
||||
}]);
|
||||
}
|
||||
function dounApply(dialog,taskId) {
|
||||
// 设置流程变量
|
||||
complete(dialog,taskId, [{
|
||||
key: 'reApply',
|
||||
value: false,
|
||||
type: 'B'
|
||||
}]);
|
||||
}
|
||||
function doPass(dialog,taskId) {
|
||||
// 设置流程变量
|
||||
complete(dialog,taskId, null);
|
||||
}
|
||||
function docompleteToCA(dialog,taskId,leaveid) {
|
||||
complete(dialog,taskId, [{
|
||||
key: 'deptLeaderPass',
|
||||
value: true,
|
||||
type: 'B'
|
||||
},{
|
||||
key: 'leaveId',
|
||||
value: leaveid,
|
||||
type: 'S'
|
||||
}]);
|
||||
}
|
||||
var advicestr="hrpass";//除了comment其它地方含中文会产生乱码
|
||||
function docompleteFinishCA(dialog,taskId,advice) {
|
||||
complete(dialog,taskId, [{
|
||||
key: 'advice',
|
||||
value: advicestr,
|
||||
type: 'S'
|
||||
}]);
|
||||
}
|
||||
$(function() {
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${leave.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>请假类型</th>
|
||||
<td>
|
||||
${leave.leaveType}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>请假开始时间</th>
|
||||
<td>
|
||||
${leave.startTime}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>请假结束时间</th>
|
||||
<td>
|
||||
${leave.endTime}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>请假人员</th>
|
||||
<td>
|
||||
${leave.userId}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>请假原因</th>
|
||||
<td>
|
||||
${leave.reason}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
86
bin/WebRoot/jsp/activiti/leaveDetailwithComment.jsp
Normal file
86
bin/WebRoot/jsp/activiti/leaveDetailwithComment.jsp
Normal file
@ -0,0 +1,86 @@
|
||||
<!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"%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript" src="json2.js"></script>
|
||||
<script src="<%=contextPath%>/JS/activiti/leave-complete.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
function doreApply(dialog,taskId) {
|
||||
// 设置流程变量
|
||||
complete(dialog,taskId, [{
|
||||
key: 'reApply',
|
||||
value: true,
|
||||
type: 'B'
|
||||
}],$(".form").serialize());
|
||||
}
|
||||
function dounApply(dialog,taskId) {
|
||||
// 设置流程变量
|
||||
complete(dialog,taskId, [{
|
||||
key: 'reApply',
|
||||
value: false,
|
||||
type: 'B'
|
||||
}]);
|
||||
}
|
||||
$(function() {
|
||||
$('#leaveType').combobox("setValue",'${leave.leaveType}');
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${leave.id}"/>
|
||||
<div class="easyui-panel" title="审批信息" style="padding:10px;">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>领导意见</th>
|
||||
<td>
|
||||
${leave.comments[0].message}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="easyui-panel" title="请假信息" style="padding:10px;">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td>请假类型:</td>
|
||||
<td>
|
||||
<select id="leaveType" name="leaveType" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option>公休</option>
|
||||
<option>病假</option>
|
||||
<option>调休</option>
|
||||
<option>事假</option>
|
||||
<option>婚假</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>开始时间:</td>
|
||||
<td><input id="startTime" name="startTime" class="Wdate"
|
||||
value="${leave.startTime}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
|
||||
readonly/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>结束时间:</td>
|
||||
<td><input id="endTime" name="endTime" class="Wdate"
|
||||
value="${leave.endTime}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
|
||||
readonly/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>请假原因:</td>
|
||||
<td>
|
||||
<input id="reason" name="reason" class="easyui-textbox" style="width:100%;height:100px" value="${leave.reason}"
|
||||
data-options="multiline:true" validtype="length[0,250]" invalidMessage="有效长度0-250" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
119
bin/WebRoot/jsp/activiti/leaveEdit.jsp
Normal file
119
bin/WebRoot/jsp/activiti/leaveEdit.jsp
Normal file
@ -0,0 +1,119 @@
|
||||
<!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="";
|
||||
<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}"+",";
|
||||
}
|
||||
</c:forEach>
|
||||
leadernames=leadernames.substring(0,leadernames.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);
|
||||
|
||||
$('#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="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>
|
||||
223
bin/WebRoot/jsp/activiti/leaveList.jsp
Normal file
223
bin/WebRoot/jsp/activiti/leaveList.jsp
Normal file
@ -0,0 +1,223 @@
|
||||
<%@page import="org.apache.poi.ss.usermodel.Row"%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%
|
||||
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.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加班组',
|
||||
url : ext.contextPath + '/activiti/leavew/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/group/edit.do?iframeId=iframeedit&id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var viewFun = function(pid,ppid) {
|
||||
/* var dialog = parent.ext.modalDialog({
|
||||
title : '查看用户信息',
|
||||
url : ext.contextPath + '/work/group/view.do?id=' + id
|
||||
}); */
|
||||
//alert(pid+","+ppid);
|
||||
graphTrace("",pid,ppid);
|
||||
};
|
||||
|
||||
var suspendFun = function(id,status) {
|
||||
var tip="";
|
||||
if(status=="active"){
|
||||
tip="激活";
|
||||
}else{
|
||||
tip="挂起";
|
||||
}
|
||||
parent.$.messager.confirm('提示', '您确定要'+tip+'此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/activiti/workflow/processinstance/update.do', {processInstanceId : id,state:status}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示',tip+'成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示',tip+'失败','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 + '/activiti/leavew/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 : 'leaveType', sortable : true, halign:'center'},
|
||||
{width : '180', title : '申请时间', field : 'applyTime', sortable : true, halign:'center'},
|
||||
{width : '280', title : '申请原因', field : 'reason', sortable : false, halign:'center'},
|
||||
{width : '80', title : '用户名', field : 'userId', sortable : true, halign:'center'},
|
||||
{width : '150', title : '流程ID', field : 'processDefinitionId', sortable : true, halign:'center',formatter : function(value, row) {
|
||||
return row.processDefinition.id;
|
||||
}},
|
||||
{width : '150', title : '是否挂起', field : 'suspended', sortable : true, halign:'center',formatter : function(value, row) {
|
||||
var suspend=row.processInstance.suspended;
|
||||
if(suspend=='2'){
|
||||
return "已挂起";
|
||||
}else{
|
||||
return "未挂起";
|
||||
}
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
|
||||
|
||||
<%if (sessionManager.havePermission(session,"activiti/leavew/showlist.do?scope=all")) {%>
|
||||
//alert(!row.task.assignee);
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.processInstanceId+'\',\''+row.processDefinition.id+'\');"/>';
|
||||
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"activiti/leavew/edit.do")) {%>
|
||||
if(row.processInstance.suspended=="2")
|
||||
str += '<img class="iconImg ext-icon-table_lightning" title="激活" onclick="suspendFun(\''+row.processInstanceId+'\',\'active\');"/>';
|
||||
else
|
||||
str += '<img class="iconImg ext-icon-table_link" title="挂起" onclick="suspendFun(\''+row.processInstanceId+'\',\'suspend\');"/>';
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
//var pi;
|
||||
var pager = grid.datagrid('getPager'); // get the pager of datagrid
|
||||
pager.pagination({
|
||||
beforePageText: '第', //页数文本框前显示的汉字
|
||||
afterPageText: '页 共 {pages} 页',
|
||||
displayMsg: '显示 {from}到{to},共 {total} 条记录',
|
||||
});
|
||||
|
||||
$('#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>
|
||||
<%}%>
|
||||
</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>
|
||||
341
bin/WebRoot/jsp/activiti/leavetaskList.jsp
Normal file
341
bin/WebRoot/jsp/activiti/leavetaskList.jsp
Normal file
@ -0,0 +1,341 @@
|
||||
<%@ 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/leave-todo.js" type="text/javascript"></script> --%>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加班组',
|
||||
url : ext.contextPath + '/activiti/leavew/add.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var completeFun = function(leaveid,taskId,tdkey,name) {
|
||||
switch(tdkey)
|
||||
{
|
||||
case 'deptLeaderAudit':
|
||||
deptLeaderAuditFun(leaveid,taskId);
|
||||
break;
|
||||
case 'deptLeaderAuditToSub':
|
||||
deptLeaderAuditFunToSub(leaveid,taskId);
|
||||
break;
|
||||
case 'deptLeaderAuditToCA':
|
||||
deptLeaderAuditFunToCA(leaveid,taskId);
|
||||
break;
|
||||
case 'modifyApply':
|
||||
modifyApplyFun(leaveid,taskId,'deptLeaderAudit');
|
||||
break;
|
||||
case 'hrAudit':
|
||||
hrAuditFun(leaveid,taskId);
|
||||
break;
|
||||
case 'hrAuditCA':
|
||||
hrAuditCAFun(leaveid,taskId);
|
||||
break;
|
||||
default:
|
||||
alert("未查询到“"+tdkey+"”任务模块!");
|
||||
}
|
||||
|
||||
};
|
||||
var deptLeaderAuditFunToSub = function(leaveid,taskId) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '任务办理',
|
||||
width : 500,
|
||||
height : 300,
|
||||
resizable:true,
|
||||
url : ext.contextPath + '/activiti/leavew/getleavedetail.do?id='+leaveid,
|
||||
buttons : [ {
|
||||
text : '通过',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.docompleteToSub(dialog, taskId);
|
||||
}
|
||||
},{
|
||||
text : '驳回',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doreject(dialog,taskId);
|
||||
}
|
||||
},{
|
||||
text : '取消',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
dialog.dialog({
|
||||
onDestroy:function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}
|
||||
});
|
||||
};
|
||||
var deptLeaderAuditFunToCA = function(leaveid,taskId) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '任务办理',
|
||||
width : 500,
|
||||
height : 300,
|
||||
resizable:true,
|
||||
url : ext.contextPath + '/activiti/leavew/getleavedetail.do?id='+leaveid,
|
||||
buttons : [ {
|
||||
text : '通过',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.docompleteToCA(dialog, taskId,leaveid);
|
||||
}
|
||||
},{
|
||||
text : '驳回',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doreject(dialog,taskId);
|
||||
}
|
||||
},{
|
||||
text : '取消',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
dialog.dialog({
|
||||
onDestroy:function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}
|
||||
});
|
||||
};
|
||||
var deptLeaderAuditFun = function(leaveid,taskId) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '任务办理',
|
||||
width : 500,
|
||||
height : 300,
|
||||
resizable:true,
|
||||
url : ext.contextPath + '/activiti/leavew/getleavedetail.do?id='+leaveid,
|
||||
buttons : [ {
|
||||
text : '通过',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.docomplete(dialog, taskId);
|
||||
}
|
||||
},{
|
||||
text : '驳回',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doreject(dialog,taskId);
|
||||
}
|
||||
},{
|
||||
text : '取消',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
dialog.dialog({
|
||||
onDestroy:function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}
|
||||
});
|
||||
};
|
||||
var modifyApplyFun = function(leaveid,taskId,taskKey) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : '任务办理',
|
||||
width : 500,
|
||||
height : 500,
|
||||
resizable:true,
|
||||
url : ext.contextPath + '/activiti/leavew/detail-with-vars.do?id='+leaveid+'&taskId='+taskId+'&taskKey='+taskKey,
|
||||
buttons : [ {
|
||||
text : '调整申请',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doreApply(dialog, taskId);
|
||||
}
|
||||
},{
|
||||
text : '取消申请',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dounApply(dialog,taskId);
|
||||
}
|
||||
},{
|
||||
text : '取消',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
dialog.dialog({
|
||||
onDestroy:function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}
|
||||
});
|
||||
};
|
||||
var hrAuditFun = function(leaveid,taskId) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : 'HR审批',
|
||||
width : 500,
|
||||
height : 500,
|
||||
resizable:true,
|
||||
url : ext.contextPath + '/activiti/leavew/getleavedetail.do?id='+leaveid,
|
||||
buttons : [ {
|
||||
text : '通过',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doPass(dialog, taskId);
|
||||
}
|
||||
},{
|
||||
text : '取消',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
dialog.dialog({
|
||||
onDestroy:function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}
|
||||
});
|
||||
};
|
||||
var hrAuditCAFun = function(leaveid,taskId) {
|
||||
var dialog = top.ext.modalDialog({
|
||||
title : 'HR审批',
|
||||
width : 500,
|
||||
height : 500,
|
||||
resizable:true,
|
||||
url : ext.contextPath + '/activiti/leavew/getleavedetail.do?id='+leaveid,
|
||||
buttons : [ {
|
||||
text : '通过',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.docompleteFinishCA(dialog, taskId);
|
||||
}
|
||||
},{
|
||||
text : '取消',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
dialog.dialog({
|
||||
onDestroy:function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}
|
||||
});
|
||||
};
|
||||
var claimFun = function(id) {
|
||||
$.post(ext.contextPath + '/activiti/leavew/task/claim.do', {taskId : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','签收成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','签收失败','info');
|
||||
}
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/activiti/leavew/gettasklist.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 : 'leaveType', sortable : true, halign:'center'},
|
||||
{width : '180', title : '申请时间', field : 'applyTime', sortable : true, halign:'center'},
|
||||
{width : '280', title : '申请原因', field : 'reason', sortable : false, halign:'center'},
|
||||
{width : '180', title : '任务下发时间', field : 'createTime', sortable : false, halign:'center', formatter : function(value, row) {
|
||||
return row.task.createTime;
|
||||
}},
|
||||
{width : '180', title : '任务节点', field : 'taskName', sortable : false, halign:'center', formatter : function(value, row) {
|
||||
return row.task.name;
|
||||
}},
|
||||
{width : '80', title : '用户名', field : 'userId', sortable : true, halign:'center'},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
<%if (sessionManager.havePermission(session,"activiti/leavew/edit.do")) {%>
|
||||
if(!row.task.assignee){
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="签收" onclick="claimFun(\''+row.task.id+'\');"/>';
|
||||
}else{
|
||||
str += '<img class="iconImg ext-icon-table_go" title="办理" onclick="completeFun(\''+row.id+'\',\''+row.task.id+'\',\''+row.task.taskDefinitionKey+'\',\''+row.task.name+'\');"/>';
|
||||
}
|
||||
<%}%>
|
||||
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>
|
||||
</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>
|
||||
<!-- 部门领导审批 -->
|
||||
<div id="deptLeaderAudit" style="display: none">
|
||||
|
||||
<!-- table用来显示信息,方便办理任务 -->
|
||||
<%@include file="view-form.jsp" %>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
66
bin/WebRoot/jsp/activiti/modelAdd.jsp
Normal file
66
bin/WebRoot/jsp/activiti/modelAdd.jsp
Normal file
@ -0,0 +1,66 @@
|
||||
<!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(fdialog,grid) {
|
||||
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + '/activiti/workflow/model/create.do', $(".form").serialize(), function(data) {
|
||||
if(data!=''){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeedit',
|
||||
title : '编辑模型',
|
||||
url : ext.contextPath + '/modeler.html?modelId='+data,
|
||||
buttons : [ {
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
fdialog.dialog('destroy');
|
||||
|
||||
}
|
||||
} ]
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','未查询到模型Id','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(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>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<th>流程模型代码</th>
|
||||
<td><input name="key" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<th>描述</th>
|
||||
<td>
|
||||
<input name="description" 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>
|
||||
325
bin/WebRoot/jsp/activiti/modelList.jsp
Normal file
325
bin/WebRoot/jsp/activiti/modelList.jsp
Normal file
@ -0,0 +1,325 @@
|
||||
<%@page import="org.apache.poi.ss.usermodel.Row"%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%
|
||||
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.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeedit',
|
||||
title : '新增模型',
|
||||
width: 500,
|
||||
height:250,
|
||||
url : ext.contextPath + '/activiti/workflow/model/addModel.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
||||
grid.datagrid('reload');
|
||||
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeedit',
|
||||
title : '编辑模型',
|
||||
width:1000,
|
||||
url : ext.contextPath + '/modeler.html?modelId=' + id,
|
||||
buttons : [ {
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var copyFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要为该模型生成副本?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/activiti/workflow/model/copycreat.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 deployFun = function(id) {
|
||||
$.post(ext.contextPath + '/activiti/workflow/model/deploy.do',{modelId:id}, function(data) {
|
||||
if(data.res=="1"){
|
||||
if(data.restr!=""){
|
||||
parent.$.messager.alert('部署成功',data.restr,'info');
|
||||
}else{
|
||||
parent.$.messager.alert('提示','部署成功','info');
|
||||
}
|
||||
|
||||
}else{
|
||||
parent.$.messager.alert('提示','部署失败','info');
|
||||
}
|
||||
},'json');
|
||||
};
|
||||
var viewFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeedit',
|
||||
title : '模型管控',
|
||||
url : ext.contextPath + '/activiti/workflow/model/showProcessTechnicsList.do?modelid=' + id,
|
||||
buttons : [ {
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
//grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此模型?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/activiti/workflow/model/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){
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var suspendFun = function(id,status) {
|
||||
var tip="";
|
||||
if(status=="active"){
|
||||
tip="激活";
|
||||
}else{
|
||||
tip="挂起";
|
||||
}
|
||||
parent.$.messager.confirm('提示', '您确定要'+tip+'此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/activiti/workflow/processdefinition/update.do', {processDefinitionId : id,state:status}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示',tip+'成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示',tip+'失败','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 + '/activiti/workflow/model/getModelList.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 : '模型ID', field : 'id', sortable : false, halign:'center'},
|
||||
{width : '180', title : '模型名称', field : 'name', sortable : false, halign:'center'},
|
||||
{width : '200', title : '模型key', field : 'key', sortable : false, halign:'center'},
|
||||
{width : '180', title : '创建时间', field : 'createTime', sortable : false, halign:'center', formatter : function(value, row) {
|
||||
return FormatDate(value.time);
|
||||
}},
|
||||
/* {width : '180', title : '流程描述', field : 'description', sortable : true, halign:'center'}, */
|
||||
{width : '100', title : '版本号', field : 'version', sortable : false, halign:'center'},
|
||||
{title : '操作', field : 'action', width : '160', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
|
||||
<%if (sessionManager.havePermission(session,"activiti/workflow/model/showlist.do?scope=all")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_sort" title="查看管控内容" onclick="viewFun(\''+row.id+'\');"/>';
|
||||
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"activiti/workflow/model/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
str += '<img class="iconImg ext-icon-table_multiple" title="复制" onclick="copyFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"activiti/workflow/model/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_go" title="部署" onclick="deployFun(\''+row.id+'\');"/>';
|
||||
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"activiti/workflow/model/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);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
var importFun = function() {
|
||||
var dest='/activiti/workflow/model/saveImportModel.do';
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择文件',
|
||||
width: 600,
|
||||
height:300,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/activiti/workflow/model/doimportExcel.do?dest='+dest,
|
||||
buttons : [ {
|
||||
text : '上传',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doimport(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
//同步
|
||||
var synchroFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择产品',
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/material/materialinfo/showPLMProducts.do',
|
||||
buttons : [ {
|
||||
text : '确认',
|
||||
handler : function() {
|
||||
var data =dialog.find('iframe').get(0).contentWindow.selectOK(dialog, grid);
|
||||
//console.log(data.materialcode)
|
||||
dialog.dialog("destroy");
|
||||
$.post(ext.contextPath + '/activiti/workflow/model/savePLMProcess.do', {code : data.materialcode}, function(data) {
|
||||
if(data.res=="1"){
|
||||
if(data.unmatch==""){
|
||||
parent.$.messager.alert('提示','同步成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('导入成功!', "以下工序:"+data.unmatch+",未查询到匹配工序,若需要,请手动编辑模型添加工序!");
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
}else{
|
||||
if(data.reason!=null && data.reason!=""){
|
||||
parent.$.messager.alert('同步失败',data.reason,'info');
|
||||
}else{
|
||||
parent.$.messager.alert('提示','同步失败','info');
|
||||
}
|
||||
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">新增</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true"
|
||||
onclick="importFun();">导入</a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_save',plain:true"
|
||||
onclick="synchroFun();">同步</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>
|
||||
103
bin/WebRoot/jsp/activiti/processForSelect.jsp
Normal file
103
bin/WebRoot/jsp/activiti/processForSelect.jsp
Normal file
@ -0,0 +1,103 @@
|
||||
<%@ 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() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/activiti/workflow/getProcessDefinitionListForSelect.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
singleSelect:true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '流程名称', field : 'name', sortable : true, halign:'center',formatter:function(value, row){
|
||||
return row.processDefinition.name;
|
||||
}},
|
||||
{width : '180', title : '流程描述', field : 'description', sortable : true, halign:'center',formatter:function(value, row){
|
||||
return row.processDefinition.description;
|
||||
}},
|
||||
{width : '180', title : '流程ID', field : 'id', sortable : false, halign:'center',formatter:function(value, row){
|
||||
return row.processDefinition.id;
|
||||
}},
|
||||
{width : '180', title : '部署时间', field : 'deploymentTime', sortable : true, halign:'center',formatter:function(value, row){
|
||||
return row.deployment.deploymentTime;
|
||||
}},
|
||||
{width : '100', title : '版本号', field : 'revision', sortable : true, halign:'center',formatter:function(value, row){
|
||||
return row.processDefinition.revision;
|
||||
}}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
function selectOK() {
|
||||
//以json格式返回数据
|
||||
var jsonstr = "";
|
||||
var idstr = "";
|
||||
var idname = "";
|
||||
var rows = $('#grid').datagrid('getSelections');
|
||||
for(var i=0; i<rows.length; i++){
|
||||
idstr += rows[i].processDefinition.id+",";
|
||||
idname+= rows[i].processDefinition.name+",";
|
||||
}
|
||||
if(idstr.length>0){
|
||||
idstr = idstr.substring(0,idstr.length-1);
|
||||
idname = idname.substring(0,idname.length-1);
|
||||
}
|
||||
jsonstr = '{"id":"'+idstr+'","name":"'+idname+'"}';
|
||||
var dataset = $.parseJSON(jsonstr);
|
||||
return dataset;
|
||||
}
|
||||
function datagridload() {
|
||||
$('#searchForm').serialize() // alert(弹出提示框)
|
||||
grid.datagrid('load',ext.contextPath + '/activiti/workflow/getProcessDefinitionListForSelect.do?'+$('#searchForm').serialize());
|
||||
}
|
||||
</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>流程ID</td>
|
||||
<td><input id="search_code" name="search_code" class="easyui-textbox" /></td>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="datagridload();">搜索</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>
|
||||
344
bin/WebRoot/jsp/activiti/processInstanceList.jsp
Normal file
344
bin/WebRoot/jsp/activiti/processInstanceList.jsp
Normal file
@ -0,0 +1,344 @@
|
||||
<%@page import="com.sipai.service.plan.DailyPlanService"%>
|
||||
<%@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();
|
||||
%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<% request.setAttribute("Type_Produce", DailyPlanService.processDefKey);%>
|
||||
<%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>
|
||||
<%-- <script src="<%=contextPath%>/JS/activiti/leave-todo.js" type="text/javascript"></script> --%>
|
||||
<script src="<%=contextPath%>/JS/activiti/workflow.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加班组',
|
||||
url : ext.contextPath + '/activiti/leavew/add.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var completeFun = function(leaveid,taskId,tdkey,name) {
|
||||
switch(tdkey)
|
||||
{
|
||||
case 'deptLeaderAudit':
|
||||
deptLeaderAuditFun(leaveid,taskId);
|
||||
break;
|
||||
case 'deptLeaderAuditToSub':
|
||||
deptLeaderAuditFunToSub(leaveid,taskId);
|
||||
break;
|
||||
case 'deptLeaderAuditToCA':
|
||||
deptLeaderAuditFunToCA(leaveid,taskId);
|
||||
break;
|
||||
case 'modifyApply':
|
||||
modifyApplyFun(leaveid,taskId,'deptLeaderAudit');
|
||||
break;
|
||||
case 'hrAudit':
|
||||
hrAuditFun(leaveid,taskId);
|
||||
break;
|
||||
case 'hrAuditCA':
|
||||
hrAuditCAFun(leaveid,taskId);
|
||||
break;
|
||||
default:
|
||||
alert("未查询到“"+tdkey+"”任务模块!");
|
||||
}
|
||||
|
||||
};
|
||||
var gotoTaskFun = function(type,tdkey,taskId) {
|
||||
if(type=='${Type_Produce}'){
|
||||
switch(tdkey)
|
||||
{
|
||||
case 'DrawDailyPlan':
|
||||
doLook();
|
||||
break;
|
||||
case 'deptLeaderAudit':
|
||||
doLookOperate();
|
||||
break;
|
||||
case 'IssueWorkOrder':
|
||||
showWorkOrders();
|
||||
break;
|
||||
case 'StartWork':
|
||||
dostart(taskId);
|
||||
break;
|
||||
case 'HandUp':
|
||||
doreport(taskId);
|
||||
break;
|
||||
case 'CarryOver':
|
||||
docarryover(taskId);
|
||||
break;
|
||||
default:
|
||||
alert("未查询到任务模块!");
|
||||
}
|
||||
}else{
|
||||
alert("未查询到任务模块!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
var doLook = function() {
|
||||
var nowdate = new Date();
|
||||
var dt=nowdate.Format('yyyy-MM-dd');//月日必须都是两位
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
id:'viewDialog',
|
||||
iframeId:'view',
|
||||
title : '查看计划',
|
||||
height:"90%",
|
||||
width:"90%",
|
||||
url : ext.contextPath + '/plan/dailyplansummary/showlist.do?dt='+dt,
|
||||
onDestroy:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var doLookOperate = function() {
|
||||
var nowdate = new Date();
|
||||
var dt=nowdate.Format('yyyy-MM-dd');//月日必须都是两位
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
id:'viewDialog',
|
||||
iframeId:'view',
|
||||
title : '查看计划',
|
||||
height:"90%",
|
||||
width:"90%",
|
||||
url : ext.contextPath + '/plan/dailyplansummary/showlistoperate.do?dt='+dt,
|
||||
onDestroy:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var showWorkOrders = function() {
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
id:'viewDialog',
|
||||
iframeId:'view',
|
||||
title : '任务调度',
|
||||
height:"90%",
|
||||
width:"90%",
|
||||
url : ext.contextPath + '/work/workorder/showlist.do',
|
||||
onDestroy:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
//开工 taskId为activiti的taskid
|
||||
var dostart = function(taskId) {
|
||||
$.post(ext.contextPath + '/work/workorder/doupdate_taskdemand.do', {taskId : taskId,status:'${Flag_Start}'}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','开工成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('unselectAll');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','开工失败','info');
|
||||
}
|
||||
});
|
||||
};
|
||||
//报工
|
||||
var doreport=function(taskId){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '工单报工',
|
||||
width: 400,
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workorder/showworkorder_carryover.do?taskId='+taskId+'&status=${Flag_Report}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
||||
grid.datagrid('unselectAll');
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
//工单结转
|
||||
var docarryover=function(taskId){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '工单结转',
|
||||
width: 400,
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workorder/showworkorder_carryover.do?taskId='+taskId+'&status=${Flag_CarryOver}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
||||
grid.datagrid('unselectAll');
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
var claimFun = function(id) {
|
||||
$.post(ext.contextPath + '/activiti/leavew/task/claim.do', {taskId : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','签收成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('unselectAll');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','签收失败','info');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var viewFun = function(pid,ppid,taskId) {
|
||||
graphTrace(pid,ppid,taskId);
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?流程删除后将无法恢复。', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/activiti/workflow/process/delProcessInstance.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','删除成功','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('unselectAll');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var searchgrid = function() {
|
||||
grid.datagrid('reload',ext.contextPath + '/activiti/workflow/getAllProcessInstaces.do?type='+$('#key').combobox('getValue'));
|
||||
};
|
||||
|
||||
$(function() {
|
||||
|
||||
$("#key").combobox({
|
||||
url : ext.contextPath + '/activiti/workflow/getProcessTypes4Combo.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onSelect:function(){
|
||||
//var value= $('#key').combobox('getValue');
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/activiti/workflow/getAllProcessInstaces.do?type='+$('#key').combobox('getValue'),
|
||||
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 : '150', title : '流程名称', field : 'name', sortable : false, halign:'center'},
|
||||
{width : '180', title : '最新任务处理时间', field : 'createTime', sortable : false, halign:'center', formatter : function(value, row) {
|
||||
return row.task.createTime;
|
||||
}},
|
||||
{width : '180', title : '最新任务节点', field : 'taskName', sortable : false, halign:'center', formatter : function(value, row) {
|
||||
return row.task.name;
|
||||
}},
|
||||
{width : '180', title : '流程定义Id', field : 'processDefinitionId', sortable : false, halign:'center', formatter : function(value, row) {
|
||||
return row.processDefinition.id;
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.processInstance.id+'\',\''+row.processDefinition.id+'\',\''+row.task.id+'\');"/>';
|
||||
/* if(!row.task.assignee){
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="签收" onclick="claimFun(\''+row.task.id+'\');"/>';
|
||||
}else{
|
||||
str += '<img class="iconImg ext-icon-table_go" title="办理" onclick="gotoTaskFun(\''+row.type+'\',\''+row.task.taskDefinitionKey+'\',\''+row.task.id+'\');"/>';
|
||||
} */
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.processInstance.id+'\');"/>';
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
},
|
||||
onLoadSuccess : function() {
|
||||
var data = $('#key').combobox('getData');
|
||||
if (data.length > 0) {
|
||||
$('#key').combobox('select', data[0].id);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>流程类型</td>
|
||||
<td><input id="key" name="key" class="easyui-combobox" data-options="required:false" style="width: 180px;" /></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="deptLeaderAudit" style="display: none">
|
||||
|
||||
<!-- table用来显示信息,方便办理任务 -->
|
||||
<%@include file="view-form.jsp" %>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
259
bin/WebRoot/jsp/activiti/processList.jsp
Normal file
259
bin/WebRoot/jsp/activiti/processList.jsp
Normal file
@ -0,0 +1,259 @@
|
||||
<%@page import="org.apache.poi.ss.usermodel.Row"%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%
|
||||
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.js" type="text/javascript"></script>
|
||||
<script src="<%=contextPath%>/JS/qtip/jquery.qtip.min.js" type="text/javascript"></script>
|
||||
<%-- 引入CSS --%>
|
||||
<link rel="stylesheet" href="<%=contextPath%>/JS/qtip/jquery.qtip.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="<%=contextPath%>/CSS/style-activiti.css" type="text/css">
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
$.post(ext.contextPath + '/activiti/auto/autoCreat.do', {} , 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({
|
||||
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(ppid) {
|
||||
/* var dialog = parent.ext.modalDialog({
|
||||
title : '查看用户信息',
|
||||
url : ext.contextPath + '/work/group/view.do?id=' + id
|
||||
}); */
|
||||
//alert(pid+","+ppid);
|
||||
graphTrace("",ppid,"");
|
||||
};
|
||||
var viewTechnicsFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeedit',
|
||||
title : '模型管控',
|
||||
url : ext.contextPath + '/activiti/workflow/model/showProcessTechnicsList.do?processid=' + id,
|
||||
buttons : [ {
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
//grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '删除此记录会将该流程关联的所有记录删除,您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/activiti/workflow/process/delete.do', {deploymentId : 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){
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}; */
|
||||
var suspendFun = function(id,status) {
|
||||
var tip="";
|
||||
if(status=="active"){
|
||||
tip="激活";
|
||||
}else{
|
||||
tip="挂起";
|
||||
}
|
||||
parent.$.messager.confirm('提示', '您确定要'+tip+'此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/activiti/workflow/processdefinition/update.do', {processDefinitionId : id,state:status}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示',tip+'成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示',tip+'失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/activiti/workflow/getProcessList.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 : '工艺名称', field : 'name', sortable : true, halign:'center',formatter:function(value, row){
|
||||
return row.processDefinition.name;
|
||||
}},
|
||||
{width : '180', title : '工艺描述', field : 'description', sortable : true, halign:'center',formatter:function(value, row){
|
||||
return row.processDefinition.description;
|
||||
}},
|
||||
{width : '180', title : '工艺ID', field : 'id', sortable : false, halign:'center',formatter:function(value, row){
|
||||
return row.processDefinition.id;
|
||||
}},
|
||||
{width : '180', title : '部署时间', field : 'deploymentTime', sortable : true, halign:'center',formatter:function(value, row){
|
||||
return row.deployment.deploymentTime;
|
||||
}},
|
||||
{width : '100', title : '版本号', field : 'revision', sortable : true, halign:'center',formatter:function(value, row){
|
||||
return row.processDefinition.revision;
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '160', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
|
||||
<%if (sessionManager.havePermission(session,"activiti/workflow/showlist.do?scope=all")) {%>
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.processDefinition.id+'\');"/>';
|
||||
str += '<img class="iconImg ext-icon-table_sort" title="查看管控内容" onclick="viewTechnicsFun(\''+row.processDefinition.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"activiti/workflow/edit.do")) {%>
|
||||
if(row.processDefinition.suspended=="2")
|
||||
str += '<img class="iconImg ext-icon-table_lightning" title="激活" onclick="suspendFun(\''+row.processDefinition.id+'\',\'active\');"/>';
|
||||
else
|
||||
str += '<img class="iconImg ext-icon-table_link" title="挂起" onclick="suspendFun(\''+row.processDefinition.id+'\',\'suspend\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"activiti/workflow/delete.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.processDefinition.deploymentId+'\');"/>';
|
||||
<%}%>
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
var importFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择文件',
|
||||
width: 600,
|
||||
height:300,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/activiti/auto/doimport.do',
|
||||
buttons : [ {
|
||||
text : '上传',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doimport(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<br/>请从模型“配置界面”部署工艺路线
|
||||
<!--
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true"
|
||||
onclick="importFun();">自动添加</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>工艺ID</td>
|
||||
<td><input id="search_code" name="search_code" 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>
|
||||
221
bin/WebRoot/jsp/activiti/processTechnicsList.jsp
Normal file
221
bin/WebRoot/jsp/activiti/processTechnicsList.jsp
Normal file
@ -0,0 +1,221 @@
|
||||
<%@page import="org.apache.poi.ss.usermodel.Row"%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||||
<%
|
||||
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.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
$.post(ext.contextPath + '/activiti/auto/autoCreat.do', {} , 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({
|
||||
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(ppid) {
|
||||
/* var dialog = parent.ext.modalDialog({
|
||||
title : '查看用户信息',
|
||||
url : ext.contextPath + '/work/group/view.do?id=' + id
|
||||
}); */
|
||||
//alert(pid+","+ppid);
|
||||
graphTrace("","",ppid);
|
||||
};
|
||||
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '删除此记录会将该流程关联的所有记录删除,您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/activiti/workflow/process/delete.do', {deploymentId : 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){
|
||||
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');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
var suspendFun = function(id,status) {
|
||||
var tip="";
|
||||
if(status=="active"){
|
||||
tip="激活";
|
||||
}else{
|
||||
tip="挂起";
|
||||
}
|
||||
parent.$.messager.confirm('提示', '您确定要'+tip+'此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/activiti/workflow/processdefinition/update.do', {processDefinitionId : id,state:status}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示',tip+'成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示',tip+'失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/activiti/workflow/model/getProcessTechnicsList.do?modelid=${param.modelid}&processid=${param.processid}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
nowrap:false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{width : '100', title : '主流程', field : 'mainprocedure', sortable : true, halign:'center'},
|
||||
{width : '100', title : '分工序', field : 'subprocedure', sortable : true, halign:'center'},
|
||||
{width : '50', title : '序号', field : 'contentno', sortable : false, halign:'center'},
|
||||
{width : '180', title : '管控项目', field : 'subject', sortable : true, halign:'center'},
|
||||
{width : '180', title : '管控规格', field : 'specifications', sortable : true, halign:'center'},
|
||||
{width : '100', title : '管控方式', field : 'mode', sortable : true, halign:'center'},
|
||||
{width : '100', title : '管控工具', field : 'tool', sortable : true, halign:'center'},
|
||||
{width : '100', title : '管控频率', field : 'frequency', sortable : true, halign:'center'},
|
||||
{width : '100', title : '管控人员', field : 'people', sortable : true, halign:'center'},
|
||||
{width : '100', title : '不良品管制', field : 'rejects', sortable : true, halign:'center'},
|
||||
{width : '100', title : '管控文件/规范', field : 'filename', sortable : true, halign:'center'},
|
||||
{width : '100', title : '管控表单', field : 'formname', sortable : true, halign:'center'},
|
||||
{width : '100', title : '备注', field : 'remark', sortable : true, halign:'center'}
|
||||
] ],
|
||||
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
|
||||
});
|
||||
if('${param.processid}'!=''){
|
||||
//alert($('#import'))
|
||||
document.getElementById('import').style.display = "none";;
|
||||
}
|
||||
});
|
||||
var importFun = function() {
|
||||
var severaddr='/activiti/workflow/model/saveImportTechnics.do';
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择文件',
|
||||
width: 600,
|
||||
height:300,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/base/doimportExcel.do?dest='+severaddr+'¶m=${param.modelid}',
|
||||
buttons : [ {
|
||||
text : '上传',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doimport(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
</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="mainprocedure" class="easyui-textbox" /></td>
|
||||
<td>分工序</td>
|
||||
<td><input id="subprocedure" name="subprocedure" 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>
|
||||
|
||||
<a id ="import" name ="import" href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true"
|
||||
onclick="importFun();">导入</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>
|
||||
367
bin/WebRoot/jsp/activiti/taskList.jsp
Normal file
367
bin/WebRoot/jsp/activiti/taskList.jsp
Normal file
@ -0,0 +1,367 @@
|
||||
<%@page import="com.sipai.service.plan.DailyPlanService"%>
|
||||
<%@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();
|
||||
%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<% request.setAttribute("Type_Produce", DailyPlanService.processDefKey);%>
|
||||
<%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>
|
||||
<%-- <script src="<%=contextPath%>/JS/activiti/leave-todo.js" type="text/javascript"></script> --%>
|
||||
<script src="<%=contextPath%>/JS/activiti/workflow.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加班组',
|
||||
url : ext.contextPath + '/activiti/leavew/add.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var completeFun = function(leaveid,taskId,tdkey,name) {
|
||||
switch(tdkey)
|
||||
{
|
||||
case 'deptLeaderAudit':
|
||||
deptLeaderAuditFun(leaveid,taskId);
|
||||
break;
|
||||
case 'deptLeaderAuditToSub':
|
||||
deptLeaderAuditFunToSub(leaveid,taskId);
|
||||
break;
|
||||
case 'deptLeaderAuditToCA':
|
||||
deptLeaderAuditFunToCA(leaveid,taskId);
|
||||
break;
|
||||
case 'modifyApply':
|
||||
modifyApplyFun(leaveid,taskId,'deptLeaderAudit');
|
||||
break;
|
||||
case 'hrAudit':
|
||||
hrAuditFun(leaveid,taskId);
|
||||
break;
|
||||
case 'hrAuditCA':
|
||||
hrAuditCAFun(leaveid,taskId);
|
||||
break;
|
||||
default:
|
||||
alert("未查询到“"+tdkey+"”任务模块!");
|
||||
}
|
||||
|
||||
};
|
||||
var gotoTaskFun = function(type,tdkey,taskId) {
|
||||
if(type=='${Type_Produce}'){
|
||||
switch(tdkey)
|
||||
{
|
||||
case 'DrawDailyPlan':
|
||||
doLook(taskId);
|
||||
break;
|
||||
case 'deptLeaderAudit':
|
||||
doLookOperate();
|
||||
break;
|
||||
case 'IssueWorkOrder':
|
||||
showWorkOrders();
|
||||
break;
|
||||
case 'StartWork':
|
||||
dostart(taskId);
|
||||
break;
|
||||
case 'HandUp':
|
||||
doreport(taskId);
|
||||
break;
|
||||
case 'CarryOver':
|
||||
docarryover(taskId);
|
||||
break;
|
||||
default:
|
||||
alert("未查询到任务模块!");
|
||||
}
|
||||
}else{
|
||||
alert("未查询到任务模块!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
var doLook = function(taskId) {
|
||||
/* var nowdate = new Date();
|
||||
var dt=nowdate.Format('yyyy-MM-dd');//月日必须都是两位
|
||||
*/
|
||||
var dialog = parent.ext.modalDialog({
|
||||
id:'viewDialog',
|
||||
iframeId:'view',
|
||||
title : '查看计划',
|
||||
height:"90%",
|
||||
width:"90%",
|
||||
url : ext.contextPath + '/plan/dailyplansummary/showlist.do?taskId='+taskId,
|
||||
onDestroy:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var doLookOperate = function() {
|
||||
var nowdate = new Date();
|
||||
var dt=nowdate.Format('yyyy-MM-dd');//月日必须都是两位
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
id:'viewDialog',
|
||||
iframeId:'view',
|
||||
title : '查看计划',
|
||||
height:"90%",
|
||||
width:"90%",
|
||||
url : ext.contextPath + '/plan/dailyplansummary/showlistoperate.do?dt='+dt,
|
||||
onDestroy:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var showWorkOrders = function() {
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
id:'viewDialog',
|
||||
iframeId:'view',
|
||||
title : '任务调度',
|
||||
height:"90%",
|
||||
width:"90%",
|
||||
url : ext.contextPath + '/work/workorder/showlist.do',
|
||||
onDestroy:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
//开工 taskId为activiti的taskid
|
||||
var dostart = function(taskId) {
|
||||
$.post(ext.contextPath + '/work/workorder/doupdate_taskdemand.do', {taskId : taskId,status:'${Flag_Start}'}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','开工成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('unselectAll');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','开工失败','info');
|
||||
}
|
||||
});
|
||||
};
|
||||
//报工
|
||||
var doreport=function(taskId){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '工单报工',
|
||||
width: 400,
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workorder/showworkorder_carryover.do?taskId='+taskId+'&status=${Flag_Report}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
||||
grid.datagrid('unselectAll');
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
//工单结转
|
||||
var docarryover=function(taskId){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '工单结转',
|
||||
width: 400,
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workorder/showworkorder_carryover.do?taskId='+taskId+'&status=${Flag_CarryOver}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid);
|
||||
grid.datagrid('unselectAll');
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
var claimFun = function(id) {
|
||||
$.post(ext.contextPath + '/activiti/leavew/task/claim.do', {taskId : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','签收成功','info',function(){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('unselectAll');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','签收失败','info');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var viewFun = function(pid,ppid,taskId) {
|
||||
graphTrace(pid,ppid,taskId);
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?流程删除后将无法恢复。', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/activiti/workflow/process/delProcessInstance.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
top.$.messager.alert('提示','删除成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
function loadworkorders(date){
|
||||
$("#workorderno").combobox({
|
||||
url : ext.contextPath + '/work/workorder/getList4Select.do?nowdate='+date,
|
||||
valueField : 'workorderno',
|
||||
textField : 'workorderno',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onSelect: function () {
|
||||
var datas=$("#workorderno").combobox('getData');
|
||||
var workorderno = $("#workorderno").combobox('getValue');
|
||||
var wforderid ="";
|
||||
for(var i=0;i<datas.length;i++){
|
||||
if(datas[i].workorderno==workorderno){
|
||||
wforderid=datas[i].wforderid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$("#processInstanceId").val(wforderid);
|
||||
$("#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 () {
|
||||
}
|
||||
});
|
||||
},
|
||||
onLoadSuccess : function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
var searchgrid = function() {
|
||||
grid.datagrid('reload',ext.contextPath + '/activiti/workflow/getProduceTaskList.do?'+$('#searchForm').serialize());
|
||||
};
|
||||
|
||||
$(function() {
|
||||
var nowdate = new Date();
|
||||
var dt=nowdate.Format('yyyy-MM-dd');//月日必须都是两位
|
||||
loadworkorders(dt);
|
||||
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/activiti/workflow/getProduceTaskList.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '150', title : '流程名称', field : 'name', sortable : false, halign:'center'},
|
||||
{width : '180', title : '任务下发时间', field : 'createTime', sortable : false, halign:'center', formatter : function(value, row) {
|
||||
return row.task.createTime;
|
||||
}},
|
||||
{width : '180', title : '任务节点', field : 'taskName', sortable : false, halign:'center', formatter : function(value, row) {
|
||||
return row.task.name;
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.processInstance.id+'\',\''+row.processDefinition.id+'\',\''+row.task.id+'\');"/>';
|
||||
if(!row.task.assignee){
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="签收" onclick="claimFun(\''+row.task.id+'\');"/>';
|
||||
}else{
|
||||
str += '<img class="iconImg ext-icon-table_go" title="办理" onclick="gotoTaskFun(\''+row.type+'\',\''+row.task.taskDefinitionKey+'\',\''+row.task.id+'\');"/>';
|
||||
}
|
||||
//str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.processInstance.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>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>工单</td>
|
||||
<td><input id="workorderno" name="workorderno" class="easyui-combobox" data-options="required:false" style="width: 180px;" />
|
||||
<input id="processInstanceId" name="processInstanceId" type="hidden" 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>
|
||||
<!-- 部门领导审批 -->
|
||||
<div id="deptLeaderAudit" style="display: none">
|
||||
|
||||
<!-- table用来显示信息,方便办理任务 -->
|
||||
<%@include file="view-form.jsp" %>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
348
bin/WebRoot/jsp/activiti/taskList4main.jsp
Normal file
348
bin/WebRoot/jsp/activiti/taskList4main.jsp
Normal file
@ -0,0 +1,348 @@
|
||||
<%@page import="com.sipai.service.plan.DailyPlanService"%>
|
||||
<%@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();
|
||||
%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<% request.setAttribute("Type_Produce", DailyPlanService.processDefKey);%>
|
||||
<%request.setAttribute("Flag_Start",DailyPlanTaskDemand.Flag_Start);%>
|
||||
<%request.setAttribute("Flag_Report",DailyPlanTaskDemand.Flag_Report);%>
|
||||
<%request.setAttribute("Flag_CarryOver",DailyPlanTaskDemand.Flag_CarryOver);%>
|
||||
<script src="<%=contextPath%>/JS/activiti/workflow.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var grid_task;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
iframeId:'iframeadd',
|
||||
title : '添加班组',
|
||||
url : ext.contextPath + '/activiti/leavew/add.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid_task);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var completeFun = function(leaveid,taskId,tdkey,name) {
|
||||
switch(tdkey)
|
||||
{
|
||||
case 'deptLeaderAudit':
|
||||
deptLeaderAuditFun(leaveid,taskId);
|
||||
break;
|
||||
case 'deptLeaderAuditToSub':
|
||||
deptLeaderAuditFunToSub(leaveid,taskId);
|
||||
break;
|
||||
case 'deptLeaderAuditToCA':
|
||||
deptLeaderAuditFunToCA(leaveid,taskId);
|
||||
break;
|
||||
case 'modifyApply':
|
||||
modifyApplyFun(leaveid,taskId,'deptLeaderAudit');
|
||||
break;
|
||||
case 'hrAudit':
|
||||
hrAuditFun(leaveid,taskId);
|
||||
break;
|
||||
case 'hrAuditCA':
|
||||
hrAuditCAFun(leaveid,taskId);
|
||||
break;
|
||||
default:
|
||||
alert("未查询到“"+tdkey+"”任务模块!");
|
||||
}
|
||||
|
||||
};
|
||||
var gotoTaskFun = function(type,tdkey,taskId) {
|
||||
if(type=='${Type_Produce}'){
|
||||
switch(tdkey)
|
||||
{
|
||||
case 'DrawDailyPlan':
|
||||
doLook(taskId);
|
||||
break;
|
||||
case 'deptLeaderAudit':
|
||||
doLookOperate();
|
||||
break;
|
||||
case 'IssueWorkOrder':
|
||||
showWorkOrders();
|
||||
break;
|
||||
case 'StartWork':
|
||||
dostart(taskId);
|
||||
break;
|
||||
case 'HandUp':
|
||||
doreport(taskId);
|
||||
break;
|
||||
case 'CarryOver':
|
||||
docarryover(taskId);
|
||||
break;
|
||||
default:
|
||||
alert("未查询到任务模块!");
|
||||
}
|
||||
}else{
|
||||
alert("未查询到任务模块!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
var doLook = function(taskId) {
|
||||
/* var nowdate = new Date();
|
||||
var dt=nowdate.Format('yyyy-MM-dd');//月日必须都是两位 */
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
id:'viewDialog',
|
||||
iframeId:'view',
|
||||
title : '查看计划',
|
||||
height:"90%",
|
||||
width:"90%",
|
||||
url : ext.contextPath + '/plan/dailyplansummary/showlist.do?taskId='+taskId,
|
||||
onDestroy:function(){
|
||||
grid_task.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var doLookOperate = function() {
|
||||
var nowdate = new Date();
|
||||
var dt=nowdate.Format('yyyy-MM-dd');//月日必须都是两位
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
id:'viewDialog',
|
||||
iframeId:'view',
|
||||
title : '查看计划',
|
||||
height:"90%",
|
||||
width:"90%",
|
||||
url : ext.contextPath + '/plan/dailyplansummary/showlistoperate.do?dt='+dt,
|
||||
onDestroy:function(){
|
||||
grid_task.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var showWorkOrders = function() {
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
id:'viewDialog',
|
||||
iframeId:'view',
|
||||
title : '任务调度',
|
||||
height:"90%",
|
||||
width:"90%",
|
||||
url : ext.contextPath + '/work/workorder/showlist.do',
|
||||
onDestroy:function(){
|
||||
grid_task.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
//开工 taskId为activiti的taskid
|
||||
var dostart = function(taskId) {
|
||||
$.post(ext.contextPath + '/work/workorder/doupdate_taskdemand.do', {taskId : taskId,status:'${Flag_Start}'}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','开工成功','info',function(){
|
||||
grid_task.datagrid('reload');
|
||||
grid_task.datagrid('unselectAll');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','开工失败','info');
|
||||
}
|
||||
});
|
||||
};
|
||||
//报工
|
||||
var doreport=function(taskId){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '工单报工',
|
||||
width: 400,
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workorder/showworkorder_carryover.do?taskId='+taskId+'&status=${Flag_Report}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid_task);
|
||||
grid_task.datagrid('unselectAll');
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
//工单结转
|
||||
var docarryover=function(taskId){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '工单结转',
|
||||
width: 400,
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/workorder/showworkorder_carryover.do?taskId='+taskId+'&status=${Flag_CarryOver}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog,grid_task);
|
||||
grid_task.datagrid('unselectAll');
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
};
|
||||
var claimFun = function(id) {
|
||||
$.post(ext.contextPath + '/activiti/leavew/task/claim.do', {taskId : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','签收成功','info',function(){
|
||||
grid_task.datagrid('reload');
|
||||
grid_task.datagrid('unselectAll');
|
||||
});
|
||||
}else{
|
||||
parent.$.messager.alert('提示','签收失败','info');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var viewFun_task = function(pid,ppid,taskId) {
|
||||
graphTrace(pid,ppid,taskId);
|
||||
};
|
||||
function loadworkorders(date){
|
||||
$("#workorderno").combobox({
|
||||
url : ext.contextPath + '/work/workorder/getList4Select.do?nowdate='+date,
|
||||
valueField : 'workorderno',
|
||||
textField : 'workorderno',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onSelect: function () {
|
||||
var datas=$("#workorderno").combobox('getData');
|
||||
var workorderno = $("#workorderno").combobox('getValue');
|
||||
var wforderid ="";
|
||||
for(var i=0;i<datas.length;i++){
|
||||
if(datas[i].workorderno==workorderno){
|
||||
wforderid=datas[i].wforderid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$("#processInstanceId").val(wforderid);
|
||||
$("#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 () {
|
||||
}
|
||||
});
|
||||
},
|
||||
onLoadSuccess : function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
var searchgrid = function() {
|
||||
grid_task.datagrid('reload',ext.contextPath + '/activiti/workflow/getProduceTaskList.do?'+$('#searchForm_task').serialize());
|
||||
};
|
||||
|
||||
$(function() {
|
||||
var nowdate = new Date();
|
||||
var dt=nowdate.Format('yyyy-MM-dd');//月日必须都是两位
|
||||
loadworkorders(dt);
|
||||
grid_task = $('#grid_task').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/activiti/workflow/getProduceTaskList.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
/* {checkbox:true , field : 'ck'}, */
|
||||
{width : '80', title : '流程名称', field : 'name', sortable : false, halign:'center'},
|
||||
{width : '120', title : '任务下发时间', field : 'createTime', sortable : false, halign:'center', formatter : function(value, row) {
|
||||
return row.task.createTime;
|
||||
}},
|
||||
{width : '80', title : '任务节点', field : 'taskName', sortable : false, halign:'center', formatter : function(value, row) {
|
||||
return row.task.name;
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '70', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun_task(\''+row.processInstance.id+'\',\''+row.processDefinition.id+'\',\''+row.task.id+'\');"/>';
|
||||
if(!row.task.assignee){
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="签收" onclick="claimFun(\''+row.task.id+'\');"/>';
|
||||
}else{
|
||||
str += '<img class="iconImg ext-icon-table_go" title="办理" onclick="gotoTaskFun(\''+row.type+'\',\''+row.task.taskDefinitionKey+'\',\''+row.task.id+'\');"/>';
|
||||
}
|
||||
//str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.processInstance.id+'\');"/>';
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar_task',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<div class="easyui-layout" data-options="fit:true,border:false">
|
||||
<%if (sessionManager.havePermission(session,"activiti/workflow/searchForm")) {%>
|
||||
<div id="toolbar_task" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<form id="searchForm_task">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>工单</td>
|
||||
<td><input id="workorderno" name="workorderno" class="easyui-combobox" data-options="required:false" style="width: 100px;" />
|
||||
<input id="processInstanceId" name="processInstanceId" type="hidden" value=""/></td>
|
||||
<td>工序</td>
|
||||
<td><input id="procedureno" name="procedureno" class="easyui-combobox" style="width: 80px;" 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_task" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
<!-- 部门领导审批 -->
|
||||
<%-- <div id="deptLeaderAudit" style="display: none">
|
||||
|
||||
<!-- table用来显示信息,方便办理任务 -->
|
||||
<%@include file="view-form.jsp" %>
|
||||
</div> --%>
|
||||
</div>
|
||||
28
bin/WebRoot/jsp/activiti/view-form.jsp
Normal file
28
bin/WebRoot/jsp/activiti/view-form.jsp
Normal file
@ -0,0 +1,28 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<table class='view-info'>
|
||||
<tr>
|
||||
<td width="100" class="label">申请人:</td>
|
||||
<td name="userId"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">假种:</td>
|
||||
<td name="leaveType"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">申请时间:</td>
|
||||
<td name="applyTime"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">请假<font color="red">开始</font>时间:</td>
|
||||
<td name="startTime"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">请假<font color="red">结束</font>时间:</td>
|
||||
<td name="endTime"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">请假事由:</td>
|
||||
<td name="reason"></td>
|
||||
</tr>
|
||||
</table>
|
||||
141
bin/WebRoot/jsp/base/fileupload.jsp
Normal file
141
bin/WebRoot/jsp/base/fileupload.jsp
Normal file
@ -0,0 +1,141 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>文件选择</title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<link rel="stylesheet" type="text/css" href="<%=contextPath%>/JS/webuploader-0.1.5/CSS/bootstrap-theme.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="<%=contextPath%>/JS/webuploader-0.1.5/CSS/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="<%=contextPath%>/JS/webuploader-0.1.5/CSS/font-awesome.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="<%=contextPath%>/JS/webuploader-0.1.5/CSS/syntax.css">
|
||||
<link rel="stylesheet" type="text/css" href="<%=contextPath%>/JS/webuploader-0.1.5/CSS/styleWebuploader.css">
|
||||
<style type="text/css">
|
||||
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
.wu-example {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
padding: 45px 15px 15px;
|
||||
margin: 0;
|
||||
background-color: white;
|
||||
box-shadow: inset 0 3px 6px rgba(0, 0, 0, .05);
|
||||
border-color: #e5e5e5 #eee #eee;
|
||||
border-style: solid;
|
||||
border-width: 1px 0;
|
||||
}
|
||||
|
||||
.uploader-list {
|
||||
width: 100%;
|
||||
height: 260px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.btns {
|
||||
position:relative;
|
||||
top:5px;
|
||||
text-align:center;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
var $list ;
|
||||
var uploader;
|
||||
$(function() {
|
||||
var $ = jQuery,
|
||||
$btn = $('#ctlBtn'),
|
||||
state = 'pending';
|
||||
|
||||
$list = $('#thelist');
|
||||
uploader = WebUploader.create({
|
||||
// swf文件路径
|
||||
swf: ext.contextPath+'/JS/webuploader-0.1.5/Uploader.swf',
|
||||
// 文件接收服务端。
|
||||
server: ext.contextPath+'/base/uploadfile.do?mappernamespace=${mappernamespace}&masterid=${masterid}',
|
||||
// 选择文件的按钮。可选。
|
||||
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
|
||||
pick: '#picker',
|
||||
// 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传!
|
||||
resize: false
|
||||
});
|
||||
|
||||
//当有文件被添加进队列的时候
|
||||
uploader.on( 'fileQueued', function( file ) {
|
||||
$list.append( '<div id="' + file.id + '" class="item">' +
|
||||
'<h4 class="info">' + file.name + '</h4>' +
|
||||
'<p class="state">等待上传...</p>' +
|
||||
'</div>' );
|
||||
});
|
||||
//文件上传过程中创建进度条实时显示。
|
||||
uploader.on( 'uploadProgress', function( file, percentage ) {
|
||||
var $li = $( '#'+file.id ),
|
||||
$percent = $li.find('.progress .progress-bar');
|
||||
|
||||
// 避免重复创建
|
||||
if ( !$percent.length ) {
|
||||
$percent = $('<div class="progress progress-striped active">' +
|
||||
'<div class="progress-bar" role="progressbar" style="width: 0%">' +
|
||||
'</div>' +
|
||||
'</div>').appendTo( $li ).find('.progress-bar');
|
||||
}
|
||||
|
||||
$li.find('p.state').text('上传中');
|
||||
|
||||
$percent.css( 'width', percentage * 100 + '%' );
|
||||
});
|
||||
uploader.on( 'uploadSuccess', function( file, response) {
|
||||
if (response.feedback.indexOf("成功") >= 0){
|
||||
$( '#'+file.id ).find('p.state').text('已上传');
|
||||
} else{
|
||||
$( '#'+file.id ).find('p.state').text(response.feedback);
|
||||
}
|
||||
});
|
||||
|
||||
uploader.on( 'uploadError', function( file ) {
|
||||
$( '#'+file.id ).find('p.state').text('上传出错');
|
||||
});
|
||||
|
||||
uploader.on( 'uploadComplete', function( file ) {
|
||||
$( '#'+file.id ).find('.progress').remove();
|
||||
});
|
||||
|
||||
uploader.on( 'all', function( type ) {
|
||||
if ( type === 'startUpload' ) {
|
||||
state = 'uploading';
|
||||
} else if ( type === 'stopUpload' ) {
|
||||
state = 'paused';
|
||||
} else if ( type === 'uploadFinished' ) {
|
||||
state = 'done';
|
||||
}
|
||||
|
||||
if ( state === 'uploading' ) {
|
||||
$btn.text('暂停上传');
|
||||
} else {
|
||||
$btn.text('开始上传');
|
||||
}
|
||||
});
|
||||
|
||||
$btn.on( 'click', function() {
|
||||
if ( state === 'uploading' ) {
|
||||
uploader.stop();
|
||||
} else {
|
||||
uploader.upload();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="uploader" class="wu-example">
|
||||
<!--用来存放文件信息-->
|
||||
<div id="thelist" class="uploader-list"></div>
|
||||
|
||||
</div>
|
||||
<div class="btns" >
|
||||
<div id="picker">选择文件</div>
|
||||
<button id="ctlBtn" class="btn btn-default">开始上传</button>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
78
bin/WebRoot/jsp/base/importExcel.jsp
Normal file
78
bin/WebRoot/jsp/base/importExcel.jsp
Normal file
@ -0,0 +1,78 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>导入人员</title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script>
|
||||
var uploader,state;
|
||||
$(function() {
|
||||
var $ = jQuery,
|
||||
$list = $('#thelist'),
|
||||
state = 'pending';
|
||||
|
||||
uploader = WebUploader.create({
|
||||
// swf文件路径
|
||||
swf: ext.contextPath+'/JS/webuploader-0.1.5/Uploader.swf',
|
||||
// 文件接收服务端。
|
||||
server: ext.contextPath+'${param.dest}?param=${param.param}',
|
||||
// 选择文件的按钮。可选。
|
||||
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
|
||||
pick: {
|
||||
id: '#picker',
|
||||
multiple: false
|
||||
},
|
||||
// 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传!
|
||||
resize: false,
|
||||
accept: {
|
||||
title: 'Excel',
|
||||
extensions: 'xls,xlsx',
|
||||
mimeTypes: 'excel/*'
|
||||
}
|
||||
});
|
||||
//当有文件被添加进队列的时候
|
||||
uploader.on( 'fileQueued', function( file ) {
|
||||
$list.append( '<div id="' + file.id + '" class="item">' +
|
||||
'<h4 class="info">' + file.name + '</h4>' +
|
||||
'<p class="state">等待上传...</p>' +
|
||||
'</div>' );
|
||||
});
|
||||
});
|
||||
|
||||
var doimport = function(dialog, grid){
|
||||
//执行上传功能
|
||||
if ( state === 'uploading' ) {
|
||||
alert("文件正在上传中,请稍等");
|
||||
} else {
|
||||
uploader.upload();
|
||||
}
|
||||
|
||||
uploader.on( 'uploadError', function( file ) {
|
||||
$( '#'+file.id ).find('p.state').text('上传出错');
|
||||
});
|
||||
|
||||
uploader.on( 'uploadSuccess', function( file,response ) {
|
||||
$( '#'+file.id ).find('p.state').text('已上传');
|
||||
if(response=="1"){
|
||||
grid.datagrid('reload');
|
||||
alert("导入成功!");
|
||||
dialog.dialog('destroy');
|
||||
}else{
|
||||
alert("导入未完成!");
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="uploader" class="wu-example">
|
||||
<div class="btns">
|
||||
<div id="picker">选择文件</div>
|
||||
</div>
|
||||
<!--用来存放文件信息-->
|
||||
<div id="thelist" class="uploader-list"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
42
bin/WebRoot/jsp/base/print.html
Normal file
42
bin/WebRoot/jsp/base/print.html
Normal file
@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>数据打印</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
background: white;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.pb {
|
||||
font-size: 13px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.pb th {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
border: 1px solid #333333;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.pb td {
|
||||
border: 1px solid #333333;
|
||||
padding: 2px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
var win=document.write(window.dialogArguments);
|
||||
win.document.close();
|
||||
window.print();
|
||||
//window.close();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
53
bin/WebRoot/jsp/base/print.jsp
Normal file
53
bin/WebRoot/jsp/base/print.jsp
Normal file
@ -0,0 +1,53 @@
|
||||
<%@ 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();
|
||||
%>
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>数据打印</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
background: white;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.pb {
|
||||
font-size: 13px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.pb th {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
border: 1px solid #333333;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.pb td {
|
||||
border: 1px solid #333333;
|
||||
padding: 2px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
alert('${param.tableString}')
|
||||
document.write('${param.tableString}');
|
||||
window.print();
|
||||
//window.close();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
57
bin/WebRoot/jsp/center.jsp
Normal file
57
bin/WebRoot/jsp/center.jsp
Normal file
@ -0,0 +1,57 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$(function() {
|
||||
mainTabs = $('#mainTabs').tabs({
|
||||
fit : true,
|
||||
border : false,
|
||||
cache : false,
|
||||
tools : [ {
|
||||
text : '刷新',
|
||||
iconCls : 'ext-icon-arrow_refresh',
|
||||
cache : false,
|
||||
handler : function() {
|
||||
var panel = mainTabs.tabs('getSelected').panel('panel');
|
||||
var frame = panel.find('iframe');
|
||||
try {
|
||||
if (frame.length > 0) {
|
||||
for (var i = 0; i < frame.length; i++) {
|
||||
frame[i].contentWindow.document.write('');
|
||||
frame[i].contentWindow.close();
|
||||
frame[i].src = frame[i].src;
|
||||
}
|
||||
if (navigator.userAgent.indexOf("MSIE") > 0) {// IE特有回收内存方法
|
||||
try {
|
||||
CollectGarbage();
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
}
|
||||
}, {
|
||||
text : '关闭',
|
||||
iconCls : 'ext-icon-cross',
|
||||
handler : function() {
|
||||
parent.$.messager.confirm("提示","是否关闭全部?",function(r){
|
||||
if(r){
|
||||
$("#mainTabs span.tabs-title").each(function(){
|
||||
if($(this).text()!='首页'){
|
||||
$("#mainTabs").tabs('close',$(this).text());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
} ]
|
||||
});
|
||||
|
||||
$("iframe:first").attr("src","jsp/portal.jsp");
|
||||
});
|
||||
</script>
|
||||
<div id="mainTabs" class="easyui-tabs" fit="true" border="false">
|
||||
<div title="首页">
|
||||
<!-- margin-bottom:-4px 不设置的话会出现滚动条 -->
|
||||
<iframe src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;margin-bottom:-4px" frameBorder="0" scrolling="no"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
19
bin/WebRoot/jsp/changePage.jsp
Normal file
19
bin/WebRoot/jsp/changePage.jsp
Normal file
@ -0,0 +1,19 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%
|
||||
String contextPath = request.getContextPath();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
alert();
|
||||
location.replace(ext.contextPath);
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
87
bin/WebRoot/jsp/clean/alarmAdd.jsp
Normal file
87
bin/WebRoot/jsp/clean/alarmAdd.jsp
Normal file
@ -0,0 +1,87 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@page import="java.text.SimpleDateFormat"%>
|
||||
<%@page import="java.text.DateFormat"%>
|
||||
<%@ 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"%>
|
||||
<% Date date=new Date();
|
||||
DateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String time=format.format(date);
|
||||
%>
|
||||
<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 + "/clean/alarmhandle/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>
|
||||
<input id="wids" name="wids" type="hidden" value="" />
|
||||
<input id="id" name="id" type="hidden" value="${monitorEquipment.id}"/>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
|
||||
<tr>
|
||||
<th>设备名称</th>
|
||||
<td ><input id="alarmponit" name="alarmponit" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" readonly="readonly" value="${monitorEquipment.equipmentName}" />
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<th>处理者</th>
|
||||
<td><input name="handleuser" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<th>报警时间</th>
|
||||
<td><input name="alarmtime" id="alarmtime" class="easyui-textbox" value="<%=time%>" readonly="readonly" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>温度</th>
|
||||
<td><input name="temperature" class="easyui-textbox" readonly="readonly"
|
||||
value="${monitorEquipment.temperature}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>湿度</th>
|
||||
<td><input name="humidity" class="easyui-textbox" readonly="readonly" value="${monitorEquipment.humidity}" />
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th>尘埃粒子</th>
|
||||
<td><input name="dust" class="easyui-textbox" readonly="readonly" value="${monitorEquipment.dust}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>报警原因</th>
|
||||
<td>
|
||||
<input name="alarmreason" id="alarmreason" class="easyui-textbox" data-options="multiline:true" value=""
|
||||
style="height:100px;width:100%" validtype="length[0,250]" invalidMessage="有效长度0-250"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br/>
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
82
bin/WebRoot/jsp/clean/alarmEdit.jsp
Normal file
82
bin/WebRoot/jsp/clean/alarmEdit.jsp
Normal file
@ -0,0 +1,82 @@
|
||||
<!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 dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/clean/alarmhandle/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>
|
||||
<input id="wids" name="wids" type="hidden" value="" />
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${alarmhandle.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>点位</th>
|
||||
<td><span name="alarmponit" >${alarmhandle.alarmponit}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>处理者</th>
|
||||
<td><input name="handleuser" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${alarmhandle.handleuser}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>采集时间</th>
|
||||
<td><span id="alarmTime" name="alarmTime"> ${alarmhandle.alarmtime}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>温度</th>
|
||||
<td><span name="temperature" > ${alarmhandle.temperature}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>湿度</th>
|
||||
<td><span name="humidity"> ${alarmhandle.humidity}</span></td>
|
||||
</tr><tr>
|
||||
<th>尘埃粒子</th>
|
||||
<td><span name="dust"> ${alarmhandle.dust}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>报警原因</th>
|
||||
<td height="100px">
|
||||
<span name="alarmreason" >${alarmhandle.alarmreason}</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>处理结果</th>
|
||||
<td>
|
||||
<textarea name="handlereault" class="easyui-textbox" data-options="multiline:true" style="height:100px;width:100%" validtype="length[0,250]" invalidMessage="有效长度0-250">${alarmhandle.handlereault}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br/>
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
189
bin/WebRoot/jsp/clean/alarmList.jsp
Normal file
189
bin/WebRoot/jsp/clean/alarmList.jsp
Normal file
@ -0,0 +1,189 @@
|
||||
<%@ 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:"alarmAdd",
|
||||
url : ext.contextPath + '/clean/alarmhandle/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:"alarmEdit",
|
||||
url : ext.contextPath + '/clean/alarmhandle/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 + '/clean/alarmhandle/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 + '/clean/alarmhandle/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 + '/clean/alarmhandle/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'},
|
||||
{height:'200',width : '100', title : '监测设备', field : 'alarmponit', sortable : true, halign:'center'},
|
||||
{width : '100', title : '处理者', field : 'handleuser', sortable : true, halign:'center'},
|
||||
{width : '150', title : '采集时间', field : 'alarmtime', sortable : true, halign:'center'},
|
||||
{width : '100', title : '温度', field : 'temperature', sortable : true, halign:'center'},
|
||||
{width : '100', title : '湿度', field : 'humidity', sortable : true, halign:'center'},
|
||||
{width : '100', title : '尘埃粒子', field : 'dust', sortable : true, halign:'center'},
|
||||
{width : '150', title : '报警原因', field : 'alarmreason', sortable : true, halign:'center',},
|
||||
{width : '150', title : '处理结果', field : 'handlereault', sortable : true, halign:'center'},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
<%if (sessionManager.havePermission(session,"clean/alarmhandle/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"clean/alarmhandle/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,"clean/alarmhandle/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,"clean/alarmhandle/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>
|
||||
261
bin/WebRoot/jsp/clean/equipmentAdd.jsp
Normal file
261
bin/WebRoot/jsp/clean/equipmentAdd.jsp
Normal file
@ -0,0 +1,261 @@
|
||||
<!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 + "/clean/MonitorEquipment/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 selectPoint(temperaturePoint,id){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择监测点位',
|
||||
width: 700,
|
||||
height:420,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/clean/MonitorEquipment/showlistForSelect.do',
|
||||
toolbar:'',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
$("#"+temperaturePoint).textbox("setValue",res.id);
|
||||
$("#"+id).val(res.id);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
// dialog.find('iframe').get(0).contentWindow.selectCancel();
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
function selectPointid(humidityPoint,id){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择监测点位',
|
||||
width: 700,
|
||||
height:420,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/clean/MonitorEquipment/showlistForSelect.do',
|
||||
toolbar:'',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
$("#"+humidityPoint).textbox("setValue",res.id);
|
||||
$("#"+id).val(res.id);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
// dialog.find('iframe').get(0).contentWindow.selectCancel();
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
function selectPointdust(dustPoint,id){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择监测点位',
|
||||
width: 700,
|
||||
height:420,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/clean/MonitorEquipment/showlistForSelect.do',
|
||||
toolbar:'',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
$("#"+dustPoint).textbox("setValue",res.id);
|
||||
$("#"+id).val(res.id);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
// dialog.find('iframe').get(0).contentWindow.selectCancel();
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>设备名称</th>
|
||||
<td><input name="equipmentName" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>参数上次修改时间</th>
|
||||
<td><input id="lastchangetime" name="lastchangetime" class="Wdate"
|
||||
value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
|
||||
readonly/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>修改者</th>
|
||||
<td><input name="mender" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>温度测量点ID</th>
|
||||
<td><input id="temperaturePoint" name="temperaturePoint" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
|
||||
<input id="id" name="id" type="hidden" value="" />
|
||||
</td>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("#temperaturePoint").textbox('textbox').bind("click", function () {
|
||||
selectPoint("temperaturePoint","id");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<th>状态</th>
|
||||
<td>
|
||||
<select name="temperaturePort" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
|
||||
<option value="1" selected >启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>湿度测量点ID</th>
|
||||
<td><input id="humidityPoint" name="humidityPoint" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
|
||||
<input id="id" name="id" type="hidden" value="" />
|
||||
</td>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("#humidityPoint").textbox('textbox').bind("click", function () {
|
||||
selectPointid("humidityPoint","id");
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<th>状态</th>
|
||||
<td>
|
||||
<select name="humidityPort" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
|
||||
<option value="1" selected >启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<th>尘埃粒子测量点ID</th>
|
||||
<td><input id="dustPoint" name="dustPoint" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
|
||||
<input id="id" name="id" type="hidden" value="" />
|
||||
</td>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("#dustPoint").textbox('textbox').bind("click", function () {
|
||||
selectPointdust("dustPoint","id");
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<th>状态</th>
|
||||
<td>
|
||||
<select name="dustPort" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
|
||||
<option value="1" selected >启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<th>尘埃粒子报警值 大于</th>
|
||||
<td><input name="dustAlarmgreater" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>温度报警值 大于</th>
|
||||
<td><input name="temAlarmgreater" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
<th >小于</th>
|
||||
<td><input name="temAlarmless" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th>湿度报警值 大于</th>
|
||||
<td><input name="humAlarmgreater" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
<th>小于</th>
|
||||
<td><input name="humAlarmless" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>设备状态</th>
|
||||
<td>
|
||||
<select name="equipmentPosition" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
|
||||
<option value="1" selected >启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br/>
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
262
bin/WebRoot/jsp/clean/equipmentEdit.jsp
Normal file
262
bin/WebRoot/jsp/clean/equipmentEdit.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.clean.MonitorEquipment"%>
|
||||
<%@ 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", MonitorEquipment.Flag_Enable);%>
|
||||
<%request.setAttribute("Flag_Disable", MonitorEquipment.Flag_Disable); %> --%>
|
||||
|
||||
<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 + "/clean/MonitorEquipment/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 selectPoint(temperaturePoint,id){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择监测点位',
|
||||
width: 700,
|
||||
height:420,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/clean/MonitorEquipment/showlistForSelect.do',
|
||||
toolbar:'',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
$("#"+temperaturePoint).textbox("setValue",res.id);
|
||||
$("#"+id).val(res.id);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
// dialog.find('iframe').get(0).contentWindow.selectCancel();
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
function selectPointid(humidityPoint,id){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择监测点位',
|
||||
width: 700,
|
||||
height:420,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/clean/MonitorEquipment/showlistForSelect.do',
|
||||
toolbar:'',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
$("#"+humidityPoint).textbox("setValue",res.id);
|
||||
$("#"+id).val(res.id);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
// dialog.find('iframe').get(0).contentWindow.selectCancel();
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
function selectPointdust(dustPoint,id){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择监测点位',
|
||||
width: 700,
|
||||
height:420,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/clean/MonitorEquipment/showlistForSelect.do',
|
||||
toolbar:'',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
$("#"+dustPoint).textbox("setValue",res.id);
|
||||
$("#"+id).val(res.id);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
// dialog.find('iframe').get(0).contentWindow.selectCancel();
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<input id="wids" name="wids" type="hidden" value="" />
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${MonitorEquipment.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>设备名称</th>
|
||||
<td><input name="equipmentName" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${MonitorEquipment.equipmentName}" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>参数上次修改时间</th>
|
||||
<td><input id="lastchangetime" name="lastchangetime" class="Wdate"
|
||||
value="${MonitorEquipment.lastchangetime}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
|
||||
readonly/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>修改者</th>
|
||||
<td><input name="mender" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${MonitorEquipment.mender}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>温度测量点ID</th>
|
||||
<td><input id="temperaturePoint" name="temperaturePoint" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${MonitorEquipment.temperaturePoint}" />
|
||||
<input id="id" name="id" type="hidden" value="" />
|
||||
</td>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("#temperaturePoint").textbox('textbox').bind("click", function () {
|
||||
selectPoint("temperaturePoint","id");
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<th>状态</th>
|
||||
<td>
|
||||
<select name="temperaturePort" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
|
||||
<option value="1" <c:if test="${MonitorEquipment.temperaturePort=='1'}">selected</c:if>>启用</option>
|
||||
<option value="0" <c:if test="${MonitorEquipment.temperaturePort=='0'}">selected</c:if>>禁用</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>湿度测量点ID</th>
|
||||
<td><input id="humidityPoint" name="humidityPoint" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${MonitorEquipment.humidityPoint}" />
|
||||
<input id="id" name="id" type="hidden" value="" />
|
||||
</td>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("#humidityPoint").textbox('textbox').bind("click", function () {
|
||||
selectPointid("humidityPoint","id");
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<th>状态</th>
|
||||
<td>
|
||||
<select name="humidityPort" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
|
||||
<option value="1" <c:if test="${MonitorEquipment.humidityPort=='1'}">selected</c:if>>启用</option>
|
||||
<option value="0" <c:if test="${MonitorEquipment.humidityPort=='0'}">selected</c:if>>禁用</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>尘埃粒子测量点ID</th>
|
||||
<td><input id="dustPoint" name="dustPoint" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${MonitorEquipment.dustPoint}" />
|
||||
<input id="id" name="id" type="hidden" value="" />
|
||||
</td>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("#dustPoint").textbox('textbox').bind("click", function () {
|
||||
selectPointdust("dustPoint","id");
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<th>状态</th>
|
||||
<td>
|
||||
<select name="dustPort" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
|
||||
<option value="1" <c:if test="${MonitorEquipment.dustPort=='1'}">selected</c:if>>启用</option>
|
||||
<option value="0" <c:if test="${MonitorEquipment.dustPort=='0'}">selected</c:if>>禁用</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>尘埃粒子报警值 大于</th>
|
||||
<td><input name="dustAlarmgreater" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${MonitorEquipment.dustAlarmgreater}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>温度报警值 大于</th>
|
||||
<td><input name="temAlarmgreater" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${MonitorEquipment.temAlarmgreater}" />
|
||||
</td>
|
||||
<th>小于</th>
|
||||
<td><input name="temAlarmless" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${MonitorEquipment.temAlarmless}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>湿度报警值 大于</th>
|
||||
<td><input name="humAlarmgreater" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${MonitorEquipment.humAlarmgreater}" />
|
||||
</td>
|
||||
<th>小于</th>
|
||||
<td><input name="humAlarmless" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${MonitorEquipment.humAlarmless}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备状态</th>
|
||||
<td>
|
||||
<select name="equipmentPosition" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
|
||||
<option value="1" <c:if test="${MonitorEquipment.equipmentPosition=='1'}">selected</c:if>>启用</option>
|
||||
<option value="0" <c:if test="${MonitorEquipment.equipmentPosition=='0'}">selected</c:if>>禁用</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
202
bin/WebRoot/jsp/clean/equipmentList.jsp
Normal file
202
bin/WebRoot/jsp/clean/equipmentList.jsp
Normal file
@ -0,0 +1,202 @@
|
||||
<%@ 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 addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加洁净度监测设备',
|
||||
width:750,
|
||||
height:500,
|
||||
iframeId:"equipmentAdd",
|
||||
url : ext.contextPath + '/clean/MonitorEquipment/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 : '编辑洁净度检测设备',
|
||||
width:750,
|
||||
height:500,
|
||||
iframeId:"equipmentEdit",
|
||||
url : ext.contextPath + '/clean/MonitorEquipment/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 + '/clean/MonitorEquipment/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 + '/clean/MonitorEquipment/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 + '/clean/MonitorEquipment/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'},
|
||||
{height:'200',width : '100', title : '设备名称', field : 'equipmentName', sortable : true, halign:'center'},
|
||||
{width : '120', title : '上次修改时间', field : 'lastchangetime', sortable : true, halign:'center'},
|
||||
{width : '120', title : '温度测量点ID', field : 'temperaturePoint', sortable : true, halign:'center'},
|
||||
{width : '120', title : '湿度测量点ID', field : 'humidityPoint', sortable : true, halign:'center'},
|
||||
{width : '120', title : '尘埃粒子测量点ID', field : 'dustPoint', sortable : true, halign:'center'},
|
||||
{width : '100', title : '尘埃粒子报警值', field : 'dustAlarmgreater', sortable : true, halign:'center'},
|
||||
{width : '100', title : '温度报警值小于', field : 'temAlarmless', sortable : true, halign:'center'},
|
||||
{width : '100', title : '温度报警值大于', field : 'temAlarmgreater', sortable : true, halign:'center'},
|
||||
{width : '100', title : '湿度报警值小于', field : 'humAlarmless', sortable : true, halign:'center'},
|
||||
{width : '100', title : '湿度报警值大于', field : 'humAlarmgreater', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备状态', field : 'equipmentPosition', sortable : true, align:'center',halign:'center', formatter : function(value, row) {
|
||||
switch (value) {
|
||||
case '0':
|
||||
return '禁用';
|
||||
case '1':
|
||||
return '启用';
|
||||
}
|
||||
}},
|
||||
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
<%if (sessionManager.havePermission(session,"clean/MonitorEquipment/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="详情" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"clean/MonitorEquipment/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,"clean/MonitorEquipment/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,"clean/MonitorEquipment/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" id="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>
|
||||
58
bin/WebRoot/jsp/clean/historyList.jsp
Normal file
58
bin/WebRoot/jsp/clean/historyList.jsp
Normal file
@ -0,0 +1,58 @@
|
||||
<%@ 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;
|
||||
|
||||
$(function() {
|
||||
//alert('${code}')
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/clean/MonitorEquipment/gethistorylist.do?code=${code}',
|
||||
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 : '用户id', field : 'userid', sortable : true, halign:'center'},
|
||||
{width : '100', title : '监测值', field : 'parmvalue', sortable : true, halign:'center'},
|
||||
{width : '120', title : '数据采集时间', field : 'measuredt', sortable : true, halign:'center'},
|
||||
{width : '100', title : '类型', field : 'memotype', sortable : true, halign:'center'},
|
||||
{width : '100', title : '备注', field : 'memo', sortable : true, halign:'center'},
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
//testFun();
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false">
|
||||
<div id="div1"></div>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
116
bin/WebRoot/jsp/clean/monitorAdd.jsp
Normal file
116
bin/WebRoot/jsp/clean/monitorAdd.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">
|
||||
//获取已选的工位id
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/clean/CleanMonitor/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 selectPoint(pointPosition,equipmentName,temperature,humidity,dust){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择监测设备',
|
||||
width: 700,
|
||||
height:420,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/clean/CleanMonitor/showlistForSelect.do',
|
||||
toolbar:'',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
$("#"+pointPosition).textbox("setValue",res.equipmentName);
|
||||
$("#"+equipmentName).val(res.Name);
|
||||
$("#"+temperature).textbox("setValue",res.temperature);
|
||||
$("#"+humidity).textbox("setValue",res.humidity);
|
||||
$("#"+dust).textbox("setValue",res.dust);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
// dialog.find('iframe').get(0).contentWindow.selectCancel();
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>监测点位</th>
|
||||
<td><input id="pointPosition" name="pointPosition" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" readonly/>
|
||||
<input id="equipmentName" name="equipmentName" type="hidden" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("#pointPosition").textbox('textbox').bind("click", function () {
|
||||
selectPoint("pointPosition","equipmentName","temperature","humidity","dust");
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>采集时间</th>
|
||||
<td><input id="collectionTime" name="collectionTime" class="Wdate"
|
||||
value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
|
||||
readonly/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>温度</th>
|
||||
<td><input id="temperature" name="temperature" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>湿度</th>
|
||||
<td><input id="humidity" name="humidity" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th>尘埃粒子</th>
|
||||
<td><input id="dust" name="dust" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br/>
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
80
bin/WebRoot/jsp/clean/monitorEdit.jsp
Normal file
80
bin/WebRoot/jsp/clean/monitorEdit.jsp
Normal file
@ -0,0 +1,80 @@
|
||||
<!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 dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/clean/CleanMonitor/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>
|
||||
<input id="wids" name="wids" type="hidden" value="" />
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="mPoint.id"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>最新监测信息</th>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备名称</th>
|
||||
<td><input name="equipmentName" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${MonitorEquipment.equipmentName}" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>数据采集时间</th>
|
||||
<td><input id="collectionTime" name="collectionTime" class="Wdate"
|
||||
value="${cleanMonitor.collectionTime}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
|
||||
readonly/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>温度</th>
|
||||
<td><input name="temperature" id="temperature" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${mPoint.Parmvalue}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>湿度</th>
|
||||
<td><input name="humidity" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${MonitorEquipment.humidity}" />
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th>尘埃粒子</th>
|
||||
<td><input name="dust" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${MonitorEquipment.dust}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br/>
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
101
bin/WebRoot/jsp/clean/monitorList.jsp
Normal file
101
bin/WebRoot/jsp/clean/monitorList.jsp
Normal file
@ -0,0 +1,101 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<% //页面每隔120秒自动刷新一遍
|
||||
response.setHeader("refresh" , "120" );
|
||||
%>
|
||||
<%@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 viewFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '详细信息',
|
||||
iframeId:"monitorView",
|
||||
url : ext.contextPath + '/clean/MonitorEquipment/view.do?id=' +id,
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/clean/MonitorEquipment/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 : 'equipmentName', sortable : true, halign:'center'},
|
||||
{width : '160', title : '数据采集时间', field : 'insdt', sortable : true, halign:'center'},
|
||||
{width : '100', title : '温度', field : 'temperature', sortable : true, halign:'center'},
|
||||
{width : '100', title : '湿度', field : 'humidity', sortable : true, halign:'center'},
|
||||
{width : '100', title : '尘埃粒子', field : 'dust', sortable : true, halign:'center'},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="详细信息" onclick="viewFun(\''+row.id+'\');"/>';
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$('#grid').datagrid({
|
||||
rowStyler:function(index,row) {
|
||||
|
||||
|
||||
if (row.equipmentState=="1"){
|
||||
return 'background-color:green;' ;
|
||||
}
|
||||
if (row.equipmentState=="2"){
|
||||
return 'background-color:yellow;' ;
|
||||
}
|
||||
if (row.equipmentState=="3"){
|
||||
|
||||
return 'background-color:red;' ;
|
||||
}
|
||||
if (row.equipmentState=="0"){
|
||||
return 'background-color:gray;';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
(每两分钟刷新一次
|
||||
,红色代表超标,黄色代表预警,绿色代表正常,灰色代表无数据) </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>
|
||||
154
bin/WebRoot/jsp/clean/monitorView.jsp
Normal file
154
bin/WebRoot/jsp/clean/monitorView.jsp
Normal file
@ -0,0 +1,154 @@
|
||||
<!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 alarmFun=function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加洁净度报警处理记录',
|
||||
iframeId:"iframeId",
|
||||
url : ext.contextPath + '/clean/alarmhandle/add.do?id=${MonitorEquipment.id}',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
function viewtemperature(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '温度历史信息',
|
||||
iframeId:"",
|
||||
url : ext.contextPath + '/clean/MonitorEquipment/showhistorylistForSelect.do?tid=${MonitorEquipment.temperaturePoint}',
|
||||
});
|
||||
};
|
||||
|
||||
function viewhumidity(id) {
|
||||
var dialog = parent.ext.modalDialog ({
|
||||
title : '湿度历史信息',
|
||||
iframeId:"",
|
||||
|
||||
url : ext.contextPath + '/clean/MonitorEquipment/showhistorylistForSelect.do?tid=${MonitorEquipment.humidityPoint}',
|
||||
});
|
||||
};
|
||||
|
||||
function viewdust(id) {
|
||||
var dialog = parent.ext.modalDialog ({
|
||||
title : '尘埃粒子历史信息',
|
||||
iframeId:"",
|
||||
url : ext.contextPath + '/clean/MonitorEquipment/showhistorylistForSelect.do?tid=${MonitorEquipment.dustPoint}',
|
||||
});
|
||||
};
|
||||
|
||||
$(function() {
|
||||
if('${MonitorEquipment.temperatureColor}'=="3" || '${MonitorEquipment.humidityColor}'=="3" || '${MonitorEquipment.dustColor}'=="3" ){
|
||||
document.getElementById("meid").style.display="inline";
|
||||
}else{
|
||||
document.getElementById("meid").style.display="none";
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<input id="wids" name="wids" type="hidden" value="" />
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${MonitorEquipment.id}"/>
|
||||
<table class="table" >
|
||||
<tr>
|
||||
<th><input type="hidden" name="equipmentState" value="${MonitorEquipment.equipmentState}" />最新监测信息
|
||||
</th>
|
||||
<td></td>
|
||||
<td rowspan="6">
|
||||
<a id="meid" href="javascript:void(0);" class="easyui-linkbutton" style="height:20px" data-options="iconCls:'iconImg ext-icon-table_go'" onclick="alarmFun('${MonitorEquipment.id}');" >报警处理</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备名称</th>
|
||||
<td>${MonitorEquipment.equipmentName}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>数据采集时间</th>
|
||||
<td>${MonitorEquipment.insdt}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>温度</th>
|
||||
<td id="temperature">${MonitorEquipment.temperature}</td>
|
||||
<script>
|
||||
$(function(){
|
||||
var ta = document.getElementById("temperature");
|
||||
if(${MonitorEquipment.temperatureColor}=="3"){
|
||||
ta.style.color="red";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>湿度</th>
|
||||
<td id="humidity">${MonitorEquipment.humidity}</td>
|
||||
<script>
|
||||
$(function(){
|
||||
var ta = document.getElementById("humidity");
|
||||
if(${MonitorEquipment.humidityColor}=="3"){
|
||||
ta.style.color="red";
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</tr><tr>
|
||||
<th>尘埃粒子</th>
|
||||
<td id="dust">${MonitorEquipment.dust}</td>
|
||||
<script>
|
||||
$(function(){
|
||||
var ta = document.getElementById("dust");
|
||||
if(${MonitorEquipment.dustColor}=="3"){
|
||||
ta.style.color="red";
|
||||
}
|
||||
})
|
||||
</script>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div><br />
|
||||
|
||||
<input id="wids" name="wids" type="hidden" value="" />
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value=""/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>历史监测信息</th>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>温度</th>
|
||||
<!-- <td><span id="temperature" name="temperature" data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td> -->
|
||||
<td><a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-view'" onclick="viewtemperature('${MonitorEquipment.temperaturePoint}');">查看更多..</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>湿度</th>
|
||||
<!-- <td><span id="humidity" name="humidity" data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td> -->
|
||||
<td><a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-view'" onclick="viewhumidity('${MonitorEquipment.humidityPoint}');">查看更多..</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>尘埃粒子</th>
|
||||
<!-- <td><span id="dust" name="dust" data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td> -->
|
||||
<td><a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-view'" onclick="viewdust('${MonitorEquipment.dustPoint}');">查看更多..</a></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
<br/>
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
76
bin/WebRoot/jsp/clean/selectMeasurePointID.jsp
Normal file
76
bin/WebRoot/jsp/clean/selectMeasurePointID.jsp
Normal file
@ -0,0 +1,76 @@
|
||||
<%@ 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 +'","id":"'+item.id +'"}';
|
||||
});
|
||||
return $.parseJSON(datas);
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/work/mpoint/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 : '测量点ID', field : 'id', 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 : 'parmvalue', sortable : false, align:'center'},
|
||||
] ],
|
||||
toolbar : '#toolbar'
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<input name="idStr" type="hidden" />
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>测量点ID</td>
|
||||
<td><input id="search_mpointid" name="search_mpointid" class="easyui-textbox" /></td>
|
||||
<td>名称</td>
|
||||
<td><input id="search_dept" name="search_dept" 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>
|
||||
80
bin/WebRoot/jsp/clean/selectPoint.jsp
Normal file
80
bin/WebRoot/jsp/clean/selectPoint.jsp
Normal file
@ -0,0 +1,80 @@
|
||||
<%@ 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 = '{"Name":"'+item.Name +'","equipmentName":"'+item.equipmentName +'",'+
|
||||
'"temperature":"'+item.temperature +'","humidity":"'+item.humidity +'",'+
|
||||
'"dust":"'+item.dust +'"}';
|
||||
});
|
||||
return $.parseJSON(datas);
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/clean/MonitorEquipment/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'},
|
||||
{height:'200',width : '100', title : '设备名称', field : 'equipmentName', sortable : true, halign:'center'},
|
||||
{width : '120', title : '上次修改时间', field : 'lastchangetime', sortable : true, halign:'center'},
|
||||
{width : '120', title : '温度', field : 'temperature', sortable : true, halign:'center'},
|
||||
{width : '120', title : '湿度', field : 'humidity', sortable : true, halign:'center'},
|
||||
{width : '120', title : '尘埃粒子', field : 'dust', sortable : true, halign:'center'},
|
||||
] ],
|
||||
toolbar : '#toolbar'
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<input name="idStr" type="hidden" />
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>设备名称</td>
|
||||
<td><input id="search_equipmentName" name="search_equipmentName" 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>
|
||||
103
bin/WebRoot/jsp/document/bookAdd.jsp
Normal file
103
bin/WebRoot/jsp/document/bookAdd.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 contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/document/saveBook.do", $(".form").serialize(), function(result) {
|
||||
if (result.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//刷新树
|
||||
parent.reloadTree();
|
||||
parent.$("#mainFrame").attr("src",ext.contextPath+"/document/showBookEdit.do?id="+result.id);
|
||||
});
|
||||
}else if(result.res == 0) {
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
} else{
|
||||
top.$.messager.alert('提示', result.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
$(function() {
|
||||
var ue = UE.getEditor('details');
|
||||
$('#pname').combotree({
|
||||
url : ext.contextPath + '/document/getDataJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
required:true,
|
||||
onClick : function(node) {
|
||||
$("#pid").val(node.id);
|
||||
}
|
||||
});
|
||||
//附件加载
|
||||
new commfile('document.DocFileMapper','${id}').loadfile();
|
||||
});
|
||||
</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="fit:true,tools:'#tt'">
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" name="id" value="${id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>名称</th>
|
||||
<td>
|
||||
<input name="docname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
<th>上级</th>
|
||||
<td>
|
||||
<input id="pname" name="pname" class="easyui-combotree" value="${pname}" />
|
||||
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>编号</th>
|
||||
<td>
|
||||
<input name="number" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
<th>类型</th>
|
||||
<td>
|
||||
<input id="type" name="type" class="easyui-combotree" value="作业指导书" disabled />
|
||||
<input id="doctype" name="doctype" type="hidden" value="C"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>地址</th>
|
||||
<td colspan="3">
|
||||
<input name="path" class="easyui-textbox" style="width:400px" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>启用</th>
|
||||
<td colspan="3">
|
||||
<select name="st" class="easyui-combobox" data-options="required:true,validType:'isBlank',editable:false,panelHeight:'auto'">
|
||||
<option value="1" selected>启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<a class="easyui-linkbutton" href="javascript:new commfile('document.DocFileMapper','${id}').showUpload();">附件上传</a>
|
||||
</th>
|
||||
<td colspan="3">
|
||||
<div id="fileList"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>内容</th>
|
||||
<td colspan="3"><script id="details" name="details" type="text/plain" style="width:100%;height:500px;"></script></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
122
bin/WebRoot/jsp/document/bookEdit.jsp
Normal file
122
bin/WebRoot/jsp/document/bookEdit.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 contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/document/updateBook.do", $(".form").serialize(), function(result) {
|
||||
if (result == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//刷新树
|
||||
parent.reloadTree();
|
||||
});
|
||||
}else if(result == 0) {
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
} else{
|
||||
top.$.messager.alert('提示', result.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
function dodel() {
|
||||
top.$.messager.confirm('提示', '确定删除此工作指令?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + "/document/deleteBook.do", $(".form").serialize(), function(result) {
|
||||
if (result == 1) {
|
||||
top.$.messager.alert('提示', "删除成功", 'info', function() {
|
||||
//刷新树
|
||||
parent.reloadTree();
|
||||
parent.$("#mainFrame").attr("src",ext.contextPath+"/document/showBookAdd.do?pid="+$("#pid").val());
|
||||
});
|
||||
} else {
|
||||
top.$.messager.alert('提示', "删除失败", 'info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
var ue = UE.getEditor('details');
|
||||
$('#pname').combotree({
|
||||
url : ext.contextPath + '/document/getDataJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
required:true,
|
||||
onClick : function(node) {
|
||||
$("#pid").val(node.id);
|
||||
}
|
||||
});
|
||||
|
||||
//附件加载
|
||||
new commfile('document.DocFileMapper','${data.id}').loadfile();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="tt">
|
||||
<a href="javascript:void(0)" class="icon-save" title="保存" onclick="dosave()"></a>
|
||||
<a href="javascript:void(0)" class="icon-remove" title="删除" onclick="dodel()"></a>
|
||||
</div>
|
||||
<div class="easyui-panel" title="编辑指导书" style="padding:10px;"
|
||||
data-options="fit:true,tools:'#tt'">
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" name="id" value="${data.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>名称</th>
|
||||
<td>
|
||||
<input name="docname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${data.docname}" />
|
||||
</td>
|
||||
<th>上级</th>
|
||||
<td>
|
||||
<input id="pname" name="pname" class="easyui-combotree" value="${pname}" />
|
||||
<input id="pid" name="pid" type="hidden" value="${data.pid}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>编号</th>
|
||||
<td>
|
||||
<input name="number" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${data.number}" />
|
||||
</td>
|
||||
<th>类型</th>
|
||||
<td>
|
||||
<input id="type" name="type" class="easyui-combotree" value="作业指导书" disabled />
|
||||
<input id="doctype" name="doctype" type="hidden" value="C"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>地址</th>
|
||||
<td colspan="3">
|
||||
<input name="path" class="easyui-textbox" style="width:400px" value="${data.path}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<a class="easyui-linkbutton" href="javascript:new commfile('document.DocFileMapper','${data.id}').showUpload();">附件上传</a>
|
||||
</th>
|
||||
<td colspan="3">
|
||||
<div id="fileList"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>启用</th>
|
||||
<td colspan="3">
|
||||
<select name="st" class="easyui-combobox" data-options="required:true,validType:'isBlank',editable:false,panelHeight:'auto',value:'${data.st}'" >
|
||||
<option value="1">启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>内容</th>
|
||||
<td colspan="3"><script id="details" name="details" type="text/plain" style="width:100%;height:500px;">${data.details}</script></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
107
bin/WebRoot/jsp/document/bookForSelect.jsp
Normal file
107
bin/WebRoot/jsp/document/bookForSelect.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">
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/document/getDatasForSelect.do?doctype=C',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
singleSelect: false,
|
||||
//ctrlSelect: true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
idField : 'id',
|
||||
treeField: 'docname',
|
||||
pagination : true,
|
||||
pageSize : 20,
|
||||
pageList : [20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '180', title : '名称', field : 'docname', sortable : true, align:'left',halign:'center'},
|
||||
{width : '120', title : '编号', field : 'number', sortable : true, align:'center',halign:'center'},
|
||||
{width : '100', title : '类型', field : 'doctype', sortable : true, align:'center',halign:'center', formatter : function(value, row, index) {
|
||||
switch (value) {
|
||||
case 'A':
|
||||
return '工作指令';
|
||||
case 'B':
|
||||
return '图纸';
|
||||
case 'C':
|
||||
return '作业指导书';
|
||||
}
|
||||
}},
|
||||
{width : '320', title : '地址', field : 'path', sortable : true, halign:'center'}
|
||||
] ],
|
||||
loadFilter: function (data){
|
||||
resultData = data;
|
||||
$.each(data.rows, function(i) {
|
||||
var parentId = data.rows[i].pid;
|
||||
if(parentId!='-1'){
|
||||
data.rows[i]._parentId = parentId;
|
||||
}else{
|
||||
data.rows[i]._parentId =undefined;
|
||||
}
|
||||
});
|
||||
return data;
|
||||
},
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
function selectOK() {
|
||||
//以json格式返回数据
|
||||
var jsonstr = "";
|
||||
var row = $('#grid').treegrid('getSelected');
|
||||
if (row){
|
||||
jsonstr = '{"id":"'+row.id
|
||||
+'","docname":"'+row.docname
|
||||
+'","number":"'+row.number
|
||||
+'","path":"'+row.path
|
||||
+'"}';
|
||||
}
|
||||
var dataset = $.parseJSON(jsonstr);
|
||||
return dataset;
|
||||
}
|
||||
</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 name="search_code" 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>
|
||||
68
bin/WebRoot/jsp/document/bookView.jsp
Normal file
68
bin/WebRoot/jsp/document/bookView.jsp
Normal file
@ -0,0 +1,68 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
var ue = UE.getEditor('details');
|
||||
$('#pname').combotree({
|
||||
url : ext.contextPath + '/document/getDataJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
required:true,
|
||||
onClick : function(node) {
|
||||
$("#pid").val(node.id);
|
||||
}
|
||||
});
|
||||
|
||||
//附件加载
|
||||
new commfile('document.DocFileMapper','${data.id}').loadfile();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div >
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" name="id" value="${data.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>名称</th>
|
||||
<td>${data.docname}</td>
|
||||
<th>上级</th>
|
||||
<td>${pname}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>编号</th>
|
||||
<td>${data.number}</td>
|
||||
<th>类型</th>
|
||||
<td>作业指导书</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>地址</th>
|
||||
<td colspan="3">${data.path}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
附件列表
|
||||
</th>
|
||||
<td colspan="3">
|
||||
<div id="fileList"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>状态</th>
|
||||
<td colspan="3">
|
||||
${data.st=="1"?"启用":"禁用"}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>内容</th>
|
||||
<td colspan="3"><script id="details" name="details" style="width:100%;height:260px;">${data.details}</script></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
93
bin/WebRoot/jsp/document/dataAdd.jsp
Normal file
93
bin/WebRoot/jsp/document/dataAdd.jsp
Normal file
@ -0,0 +1,93 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<script type="text/javascript" charset="utf-8" src="ueditor.config.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="ueditor.all.min.js"> </script>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/user/saveWorkOrder.do", $(".form").serialize(), function(result) {
|
||||
if (result.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//刷新树
|
||||
parent.reloadTree();
|
||||
});
|
||||
}else if(result.res == 0) {
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
} else{
|
||||
top.$.messager.alert('提示', result.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
$(function() {
|
||||
var ue = UE.getEditor('details');
|
||||
$('#pname').combotree({
|
||||
url : ext.contextPath + '/document/getDataJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
required:true,
|
||||
onClick : function(node) {
|
||||
$("#pid").val(node.id);
|
||||
}
|
||||
});
|
||||
});
|
||||
</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="fit:true,tools:'#tt'">
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>名称</th>
|
||||
<td>
|
||||
<input name="docname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
<th>上级</th>
|
||||
<td>
|
||||
<input id="pname" name="pname" class="easyui-combotree" value="${pname}" />
|
||||
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>编号</th>
|
||||
<td>
|
||||
<input name="number" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
<th>类型</th>
|
||||
<td>
|
||||
<input id="type" name="type" class="easyui-combotree" value="工作指令" disabled />
|
||||
<input id="doctype" name="doctype" type="hidden" value="A"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>地址</th>
|
||||
<td colspan="3">
|
||||
<input name="path" class="easyui-textbox" style="width:400px" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>启用</th>
|
||||
<td>
|
||||
<select name="st" class="easyui-combobox" data-options="required:true,validType:'isBlank',editable:false,panelHeight:'auto'">
|
||||
<option value="1" selected>启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>内容</th>
|
||||
<td colspan="3"><script id="details" type="text/plain" style="width:100%;height:500px;"></script></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
114
bin/WebRoot/jsp/document/dataEdit.jsp
Normal file
114
bin/WebRoot/jsp/document/dataEdit.jsp
Normal file
@ -0,0 +1,114 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<script type="text/javascript" charset="utf-8" src="ueditor.config.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="ueditor.all.js"> </script>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/document/updateWorkOrder.do", $(".form").serialize(), function(result) {
|
||||
if (result == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//刷新树
|
||||
parent.reloadTree();
|
||||
});
|
||||
}else if(result == 0) {
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
} else{
|
||||
top.$.messager.alert('提示', result.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
function dodel() {
|
||||
top.$.messager.confirm('提示', '确定删除此公司?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + "/user/deleteCompany.do", $(".form").serialize(), function(result) {
|
||||
if (result == 1) {
|
||||
top.$.messager.alert('提示', "删除成功", 'info', function() {
|
||||
//刷新树
|
||||
parent.reloadTree();
|
||||
parent.$("#mainFrame").attr("src",ext.contextPath+"/user/showCompanyAdd.do?pid="+$("#pid").val());
|
||||
});
|
||||
} else {
|
||||
top.$.messager.alert('提示', "删除失败", 'info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
var ue = UE.getEditor('details');
|
||||
$('#pname').combotree({
|
||||
url : ext.contextPath + '/document/getDataJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
required:true,
|
||||
onClick : function(node) {
|
||||
$("#pid").val(node.id);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="tt">
|
||||
<a href="javascript:void(0)" class="icon-save" title="保存" onclick="dosave()"></a>
|
||||
<a href="javascript:void(0)" class="icon-remove" title="删除" onclick="dodel()"></a>
|
||||
</div>
|
||||
<div class="easyui-panel" title="编辑工作指令" style="padding:10px;"
|
||||
data-options="fit:true,tools:'#tt'">
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" name="id" value="${data.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>名称</th>
|
||||
<td>
|
||||
<input name="docname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${data.docname}" />
|
||||
</td>
|
||||
<th>上级</th>
|
||||
<td>
|
||||
<input id="pname" name="pname" class="easyui-combotree" value="${pname}" />
|
||||
<input id="pid" name="pid" type="hidden" value="${data.pid}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>编号</th>
|
||||
<td>
|
||||
<input name="number" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${data.number}" />
|
||||
</td>
|
||||
<th>类型</th>
|
||||
<td>
|
||||
<input id="type" name="type" class="easyui-combotree" value="工作指令" disabled />
|
||||
<input id="doctype" name="doctype" type="hidden" value="A"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>地址</th>
|
||||
<td colspan="3">
|
||||
<input name="path" class="easyui-textbox" style="width:400px" value="${data.path}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>启用</th>
|
||||
<td>
|
||||
<select name="st" class="easyui-combobox" data-options="required:true,validType:'isBlank',editable:false,panelHeight:'auto',value:'${data.st}'" >
|
||||
<option value="1">启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>内容</th>
|
||||
<td colspan="3"><script id="details" type="text/plain" style="width:918px;height:500px;">${data.details}</script></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
70
bin/WebRoot/jsp/document/dataTree.jsp
Normal file
70
bin/WebRoot/jsp/document/dataTree.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 contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('#dataTree').tree({
|
||||
url : ext.contextPath + '/document/getDataJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
onClick : function(node) {
|
||||
if(node.pid != ''){
|
||||
if(node.attributes.type=='A'){
|
||||
$("#mainFrame").attr("src",ext.contextPath+"/document/showWorkOrderEdit.do?id="+node.id);
|
||||
}else if(node.attributes.type=='B'){
|
||||
$("#mainFrame").attr("src",ext.contextPath+"/document/showDrawingEdit.do?id="+node.id);
|
||||
}else if(node.attributes.type=='C'){
|
||||
$("#mainFrame").attr("src",ext.contextPath+"/document/showBookEdit.do?id="+node.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function reloadTree(){
|
||||
$('#dataTree').tree('options').url = ext.contextPath+ '/document/getDataJson.do?random=' + Math.random();
|
||||
$('#dataTree').tree('reload');
|
||||
//$("#mainFrame").attr("src",ext.contextPath+"/document/showDataTree.do");
|
||||
}
|
||||
|
||||
function getSelectedPid(){
|
||||
var t = $('#dataTree').tree('getSelected');
|
||||
var pid="";
|
||||
if(t!=null){
|
||||
pid=t.id;
|
||||
}
|
||||
return pid;
|
||||
}
|
||||
|
||||
function addWorkOrder(){
|
||||
$("#mainFrame").attr("src",ext.contextPath+"/document/showWorkOrderAdd.do?pid="+getSelectedPid());
|
||||
}
|
||||
|
||||
function addDrawing(){
|
||||
$("#mainFrame").attr("src",ext.contextPath+"/document/showDrawingAdd.do?pid="+getSelectedPid());
|
||||
}
|
||||
function addBook(){
|
||||
$("#mainFrame").attr("src",ext.contextPath+"/document/showBookAdd.do?pid="+getSelectedPid());
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="easyui-layout" data-options="fit:true">
|
||||
<div id="leftdiv" data-options="region:'west',split:true" style="width:250px;position:relative">
|
||||
<div style="padding:2px;background-color:#eeeeee">
|
||||
<a class="easyui-linkbutton" href="#" data-options="iconCls:'icon-add',plain:true" onclick="addWorkOrder()">工作指令</a>
|
||||
<a class="easyui-linkbutton" href="#" data-options="iconCls:'icon-add',plain:true" onclick="addDrawing()">图纸</a>
|
||||
<a class="easyui-linkbutton" href="#" data-options="iconCls:'icon-add',plain:true" onclick="addBook()">作业指导书</a>
|
||||
</div>
|
||||
<ul id="dataTree" class="easyui-tree" data-options="method:'get',animate:true"></ul>
|
||||
</div>
|
||||
<div id="rightdiv" data-options="region:'center'" style="overflow: hidden;">
|
||||
<iframe id="mainFrame" src="" allowTransparency="true" style="border: 0; width: 100%; height: 100%;" frameBorder="0" scrolling="auto"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
103
bin/WebRoot/jsp/document/drawingAdd.jsp
Normal file
103
bin/WebRoot/jsp/document/drawingAdd.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 contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/document/saveDrawing.do", $(".form").serialize(), function(result) {
|
||||
if (result.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//刷新树
|
||||
parent.reloadTree();
|
||||
parent.$("#mainFrame").attr("src",ext.contextPath+"/document/showDrawingEdit.do?id="+result.id);
|
||||
});
|
||||
}else if(result.res == 0) {
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
} else{
|
||||
top.$.messager.alert('提示', result.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
$(function() {
|
||||
var ue = UE.getEditor('details');
|
||||
$('#pname').combotree({
|
||||
url : ext.contextPath + '/document/getDataJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
required:true,
|
||||
onClick : function(node) {
|
||||
$("#pid").val(node.id);
|
||||
}
|
||||
});
|
||||
//附件加载
|
||||
new commfile('document.DocFileMapper','${id}').loadfile();
|
||||
});
|
||||
</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="fit:true,tools:'#tt'">
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" name="id" value="${id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>名称</th>
|
||||
<td>
|
||||
<input name="docname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
<th>上级</th>
|
||||
<td>
|
||||
<input id="pname" name="pname" class="easyui-combotree" value="${pname}" />
|
||||
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>编号</th>
|
||||
<td>
|
||||
<input name="number" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
<th>类型</th>
|
||||
<td>
|
||||
<input id="type" name="type" class="easyui-combotree" value="图纸" disabled />
|
||||
<input id="doctype" name="doctype" type="hidden" value="B"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>地址</th>
|
||||
<td colspan="3">
|
||||
<input name="path" class="easyui-textbox" style="width:400px" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>启用</th>
|
||||
<td colspan="3">
|
||||
<select name="st" class="easyui-combobox" data-options="required:true,validType:'isBlank',editable:false,panelHeight:'auto'">
|
||||
<option value="1" selected>启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<a class="easyui-linkbutton" href="javascript:new commfile('document.DocFileMapper','${id}').showUpload();">附件上传</a>
|
||||
</th>
|
||||
<td colspan="3">
|
||||
<div id="fileList"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>内容</th>
|
||||
<td colspan="3"><script id="details" name="details" type="text/plain" style="width:100%;height:500px;"></script></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
122
bin/WebRoot/jsp/document/drawingEdit.jsp
Normal file
122
bin/WebRoot/jsp/document/drawingEdit.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 contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/document/updateDrawing.do", $(".form").serialize(), function(result) {
|
||||
if (result == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//刷新树
|
||||
parent.reloadTree();
|
||||
});
|
||||
}else if(result == 0) {
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
} else{
|
||||
top.$.messager.alert('提示', result.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
function dodel() {
|
||||
top.$.messager.confirm('提示', '确定删除此工作指令?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + "/document/deleteDrawing.do", $(".form").serialize(), function(result) {
|
||||
if (result == 1) {
|
||||
top.$.messager.alert('提示', "删除成功", 'info', function() {
|
||||
//刷新树
|
||||
parent.reloadTree();
|
||||
parent.$("#mainFrame").attr("src",ext.contextPath+"/document/showDrawingAdd.do?pid="+$("#pid").val());
|
||||
});
|
||||
} else {
|
||||
top.$.messager.alert('提示', "删除失败", 'info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
var ue = UE.getEditor('details');
|
||||
$('#pname').combotree({
|
||||
url : ext.contextPath + '/document/getDataJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
required:true,
|
||||
onClick : function(node) {
|
||||
$("#pid").val(node.id);
|
||||
}
|
||||
});
|
||||
|
||||
//附件加载
|
||||
new commfile('document.DocFileMapper','${data.id}').loadfile();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="tt">
|
||||
<a href="javascript:void(0)" class="icon-save" title="保存" onclick="dosave()"></a>
|
||||
<a href="javascript:void(0)" class="icon-remove" title="删除" onclick="dodel()"></a>
|
||||
</div>
|
||||
<div class="easyui-panel" title="编辑图纸" style="padding:10px;"
|
||||
data-options="fit:true,tools:'#tt'">
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" name="id" value="${data.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>名称</th>
|
||||
<td>
|
||||
<input name="docname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${data.docname}" />
|
||||
</td>
|
||||
<th>上级</th>
|
||||
<td>
|
||||
<input id="pname" name="pname" class="easyui-combotree" value="${pname}" />
|
||||
<input id="pid" name="pid" type="hidden" value="${data.pid}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>编号</th>
|
||||
<td>
|
||||
<input name="number" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${data.number}" />
|
||||
</td>
|
||||
<th>类型</th>
|
||||
<td>
|
||||
<input id="type" name="type" class="easyui-combotree" value="图纸" disabled />
|
||||
<input id="doctype" name="doctype" type="hidden" value="B"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>地址</th>
|
||||
<td colspan="3">
|
||||
<input name="path" class="easyui-textbox" style="width:400px" value="${data.path}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<a class="easyui-linkbutton" href="javascript:new commfile('document.DocFileMapper','${data.id}').showUpload();">附件上传</a>
|
||||
</th>
|
||||
<td colspan="3">
|
||||
<div id="fileList"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>启用</th>
|
||||
<td colspan="3">
|
||||
<select name="st" class="easyui-combobox" data-options="required:true,validType:'isBlank',editable:false,panelHeight:'auto',value:'${data.st}'" >
|
||||
<option value="1">启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>内容</th>
|
||||
<td colspan="3"><script id="details" name="details" type="text/plain" style="width:100%;height:500px;">${data.details}</script></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
107
bin/WebRoot/jsp/document/drawingForSelect.jsp
Normal file
107
bin/WebRoot/jsp/document/drawingForSelect.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">
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/document/getDatasForSelect.do?doctype=B',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
singleSelect: false,
|
||||
//ctrlSelect: true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
idField : 'id',
|
||||
treeField: 'docname',
|
||||
pagination : true,
|
||||
pageSize : 20,
|
||||
pageList : [20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '180', title : '名称', field : 'docname', sortable : true, align:'left',halign:'center'},
|
||||
{width : '120', title : '编号', field : 'number', sortable : true, align:'center',halign:'center'},
|
||||
{width : '100', title : '类型', field : 'doctype', sortable : true, align:'center',halign:'center', formatter : function(value, row, index) {
|
||||
switch (value) {
|
||||
case 'A':
|
||||
return '工作指令';
|
||||
case 'B':
|
||||
return '图纸';
|
||||
case 'C':
|
||||
return '作业指导书';
|
||||
}
|
||||
}},
|
||||
{width : '320', title : '地址', field : 'path', sortable : true, halign:'center'}
|
||||
] ],
|
||||
loadFilter: function (data){
|
||||
resultData = data;
|
||||
$.each(data.rows, function(i) {
|
||||
var parentId = data.rows[i].pid;
|
||||
if(parentId!='-1'){
|
||||
data.rows[i]._parentId = parentId;
|
||||
}else{
|
||||
data.rows[i]._parentId =undefined;
|
||||
}
|
||||
});
|
||||
return data;
|
||||
},
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
function selectOK() {
|
||||
//以json格式返回数据
|
||||
var jsonstr = "";
|
||||
var row = $('#grid').treegrid('getSelected');
|
||||
if (row){
|
||||
jsonstr = '{"id":"'+row.id
|
||||
+'","docname":"'+row.docname
|
||||
+'","number":"'+row.number
|
||||
+'","path":"'+row.path
|
||||
+'"}';
|
||||
}
|
||||
var dataset = $.parseJSON(jsonstr);
|
||||
return dataset;
|
||||
}
|
||||
</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 name="search_code" 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>
|
||||
103
bin/WebRoot/jsp/document/workorderAdd.jsp
Normal file
103
bin/WebRoot/jsp/document/workorderAdd.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"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/document/saveWorkOrder.do", $(".form").serialize(), function(result) {
|
||||
if (result.res == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//刷新树
|
||||
parent.reloadTree();
|
||||
parent.$("#mainFrame").attr("src",ext.contextPath+"/document/showWorkOrderEdit.do?id="+result.id);
|
||||
});
|
||||
}else if(result.res == 0) {
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
} else{
|
||||
top.$.messager.alert('提示', result.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
$(function() {
|
||||
var ue = UE.getEditor('details');
|
||||
$('#pname').combotree({
|
||||
url : ext.contextPath + '/document/getDataJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
required:true,
|
||||
onClick : function(node) {
|
||||
$("#pid").val(node.id);
|
||||
}
|
||||
});
|
||||
//附件加载
|
||||
new commfile('document.DocFileMapper','${id}').loadfile();
|
||||
});
|
||||
</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="fit:true,tools:'#tt'">
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" name="id" value="${id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>名称</th>
|
||||
<td>
|
||||
<input name="docname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
<th>上级</th>
|
||||
<td>
|
||||
<input id="pname" name="pname" class="easyui-combotree" value="${pname}" />
|
||||
<input id="pid" name="pid" type="hidden" value="${param.pid}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>编号</th>
|
||||
<td>
|
||||
<input name="number" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
<th>类型</th>
|
||||
<td>
|
||||
<input id="type" name="type" class="easyui-combotree" value="工作指令" disabled />
|
||||
<input id="doctype" name="doctype" type="hidden" value="A"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>地址</th>
|
||||
<td colspan="3">
|
||||
<input name="path" class="easyui-textbox" style="width:400px" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>状态</th>
|
||||
<td colspan="3">
|
||||
<select name="st" class="easyui-combobox" data-options="required:true,validType:'isBlank',editable:false,panelHeight:'auto'"">
|
||||
<option value="1" selected>启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<a class="easyui-linkbutton" href="javascript:new commfile('document.DocFileMapper','${id}').showUpload();">附件上传</a>
|
||||
</th>
|
||||
<td colspan="3">
|
||||
<div id="fileList"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>内容</th>
|
||||
<td colspan="3"><script id="details" name="details" type="text/plain" style="width:100%;height:500px;"></script></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
122
bin/WebRoot/jsp/document/workorderEdit.jsp
Normal file
122
bin/WebRoot/jsp/document/workorderEdit.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 contentType="text/html;charset=UTF-8" language="java"%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
function dosave() {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/document/updateWorkOrder.do", $(".form").serialize(), function(result) {
|
||||
if (result == 1) {
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
//刷新树
|
||||
parent.reloadTree();
|
||||
});
|
||||
}else if(result == 0) {
|
||||
top.$.messager.alert('提示', "保存失败", 'info');
|
||||
} else{
|
||||
top.$.messager.alert('提示', result.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
function dodel() {
|
||||
top.$.messager.confirm('提示', '确定删除此工作指令?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + "/document/deleteWorkOrder.do", $(".form").serialize(), function(result) {
|
||||
if (result == 1) {
|
||||
top.$.messager.alert('提示', "删除成功", 'info', function() {
|
||||
//刷新树
|
||||
parent.reloadTree();
|
||||
parent.$("#mainFrame").attr("src",ext.contextPath+"/document/showWorkOrderAdd.do?pid="+$("#pid").val());
|
||||
});
|
||||
} else {
|
||||
top.$.messager.alert('提示', "删除失败", 'info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
var ue = UE.getEditor('details');
|
||||
$('#pname').combotree({
|
||||
url : ext.contextPath + '/document/getDataJson.do?random=' + Math.random(),
|
||||
parentField : 'pid',
|
||||
method:'get',
|
||||
required:true,
|
||||
onClick : function(node) {
|
||||
$("#pid").val(node.id);
|
||||
}
|
||||
});
|
||||
|
||||
//附件加载
|
||||
new commfile('document.DocFileMapper','${data.id}').loadfile();
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="tt">
|
||||
<a href="javascript:void(0)" class="icon-save" title="保存" onclick="dosave()"></a>
|
||||
<a href="javascript:void(0)" class="icon-remove" title="删除" onclick="dodel()"></a>
|
||||
</div>
|
||||
<div class="easyui-panel" title="编辑工作指令" style="padding:10px;"
|
||||
data-options="fit:true,tools:'#tt'">
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" name="id" value="${data.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>名称</th>
|
||||
<td>
|
||||
<input name="docname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${data.docname}" />
|
||||
</td>
|
||||
<th>上级</th>
|
||||
<td>
|
||||
<input id="pname" name="pname" class="easyui-combotree" value="${pname}" />
|
||||
<input id="pid" name="pid" type="hidden" value="${data.pid}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>编号</th>
|
||||
<td>
|
||||
<input name="number" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${data.number}" />
|
||||
</td>
|
||||
<th>类型</th>
|
||||
<td>
|
||||
<input id="type" name="type" class="easyui-combotree" value="工作指令" disabled />
|
||||
<input id="doctype" name="doctype" type="hidden" value="A"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>地址</th>
|
||||
<td colspan="3">
|
||||
<input name="path" class="easyui-textbox" style="width:400px" value="${data.path}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
<a class="easyui-linkbutton" href="javascript:new commfile('document.DocFileMapper','${data.id}').showUpload();">附件上传</a>
|
||||
</th>
|
||||
<td colspan="3">
|
||||
<div id="fileList"></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>启用</th>
|
||||
<td colspan="3">
|
||||
<select name="st" class="easyui-combobox" data-options="required:true,validType:'isBlank',editable:false,panelHeight:'auto',value:'${data.st}'" >
|
||||
<option value="1">启用</option>
|
||||
<option value="0">禁用</option>
|
||||
</select>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>内容</th>
|
||||
<td colspan="3"><script id="details" name="details" type="text/plain" style="width:100%;height:500px;">${data.details}</script></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
246
bin/WebRoot/jsp/equipment/equipCardListForDistrictWork.jsp
Normal file
246
bin/WebRoot/jsp/equipment/equipCardListForDistrictWork.jsp
Normal file
@ -0,0 +1,246 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" 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 selectFun() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
/* $.each(checkedItems, function(index, item){
|
||||
if(datas !=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas += '{"id":"'+item.id +'","equipmentcardid":"'+item.equipmentcardid +'",'+
|
||||
'"equipmentname":"'+item.equipmentname +'","equipmentmodel":"'+item.equipmentmodel +'",'+
|
||||
'"equipmentclass":"'+item.equipmentclass.name +'","geographyarea":"'+item.geographyarea.name +'"}';
|
||||
|
||||
});
|
||||
datas="["+datas+"]"; */
|
||||
//alert(datas)
|
||||
|
||||
return JSON.stringify(checkedItems) ;//datas;//$.parseJSON(datas);
|
||||
|
||||
}
|
||||
|
||||
function updateFun() {
|
||||
var checkedItems = $('#grid').datagrid('getRows');
|
||||
var datas="";
|
||||
return JSON.stringify(checkedItems) ;//datas;//$.parseJSON(datas);
|
||||
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
var grid;
|
||||
var dialogT;
|
||||
var equiparrange;
|
||||
function getEquipArrange() {
|
||||
return equiparrange;
|
||||
}
|
||||
var arrangework = function(id){
|
||||
//alert(id)
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '设备调度',
|
||||
url : ext.contextPath + '/equipment/showEquipCardsArrangement.do?equipmentid='+id,
|
||||
width:800,
|
||||
height:450,
|
||||
buttons : [{
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}],
|
||||
onDestroy:function(){
|
||||
$('#grid').datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
function dblClickFun(rowIndex){
|
||||
|
||||
rowData=grid.datagrid('getData').rows[rowIndex];
|
||||
//console.info(rowData)
|
||||
equiparrange=rowData.equipmentArrangements;
|
||||
//grid timespiner编辑的时间格式需要格式化为12:00
|
||||
$.each(equiparrange, function(index, item){
|
||||
if(item.enddt!=null && item.enddt.length>10){
|
||||
item.enddt=item.enddt.substring(11,16);
|
||||
}
|
||||
});
|
||||
equiparrange=JSON.stringify(rowData.equipmentArrangements);
|
||||
//alert(equiparrange);
|
||||
var dialog = ext.modalDialog({
|
||||
title : '安排时间',
|
||||
width : 700,
|
||||
height : 360,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/doeditEquipArrange.do?equipmentid=' +rowData.id +'&plandate=${param.plandate}',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.dosave();
|
||||
//alert(res);
|
||||
var temp=JSON.parse(res);
|
||||
$.each(temp, function(index, item){
|
||||
if(item.enddt!=null && item.enddt.length<10){
|
||||
item.enddt="1900-01-01 "+item.enddt;
|
||||
//alert(item.enddt)
|
||||
}
|
||||
});
|
||||
rowData.equipmentArrangements=temp;
|
||||
//$('#grid').datagrid('updateRow',{index:rowIndex,row:rowData});
|
||||
$('#grid').datagrid('refreshRow',rowIndex);
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
$(function() {
|
||||
|
||||
|
||||
$("#lineid").combobox({
|
||||
url : ext.contextPath + '/work/line/getLineListForSelect.do',
|
||||
valueField : 'id',
|
||||
textField : 'name',
|
||||
method:'get',
|
||||
panelHeight:'auto',
|
||||
onLoadSuccess:function(){
|
||||
var val = $("#lineid").combobox("getData");
|
||||
var i=0;
|
||||
for(i=0;i<val.length;i++){
|
||||
//console.log("${param.taskid}")
|
||||
if(val[i].serial=="${param.taskid}"){
|
||||
$("#lineid").combobox('select',val[i].id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(i==val.length){
|
||||
$("#lineid").combobox('select',val[0].id);
|
||||
}
|
||||
|
||||
} ,
|
||||
onSelect:function(){
|
||||
var lineid=$("#lineid").combobox("getValue");
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getEquipCardForDistrictWork.do?arrangementdate=${param.plandate}&workorderid=${param.workorderid}&taskid=${param.taskid}&equipmentid=${param.equipmentid}&lineid='+lineid,
|
||||
striped : true,
|
||||
nowrap:false,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '80', title : '设备编号', field : 'equipmentcardid', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备名称', field : 'equipmentname', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备型号', field: 'equipmentmodel', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备类型', field: 'equipmentclass', sortable : true, halign:'center',formatter:function(value,row){
|
||||
//console.info(row.equipmentclass.name);
|
||||
if(row.equipmentclass!=null)
|
||||
return row.equipmentclass.name;
|
||||
} },
|
||||
{width : '100', title : '设备产能', field: 'capacity', sortable : true, halign:'center',formatter:function(value,row){
|
||||
//console.info(row.equipmentclass.name);
|
||||
if(row.equipmentclass!=null)
|
||||
return row.equipmentclass._capacity;
|
||||
} },
|
||||
{width : '100', title : '当前状态', field: 'equipmentstatus', sortable : true, halign:'center'},
|
||||
{width : '50', title : '管理状态', field: 'currentmanageflag', sortable : true, halign:'center'},
|
||||
{width : '130', title : '分配时段', field : 'remark', sortable : true, halign:'center',formatter:function(value,row){
|
||||
|
||||
return getInfoFromArrangement(row.equipmentArrangements);
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '70', halign:'center', align:'center', formatter : function(value, row,rowindex) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="设备分配" onclick="dblClickFun(\''+rowindex+'\');"/>';
|
||||
str += '<img class="iconImg ext-icon-chart_organisation" title="设备已分配情况" onclick="arrangework(\''+row.id+'\');"/>';
|
||||
|
||||
return str;
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
},
|
||||
onDblClickRow :function (rowIndex, rowData){
|
||||
dblClickFun(rowIndex);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</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 name="search_name" class="easyui-textbox" style="width: 180px;" /></td>
|
||||
<td><input id="lineid" name="lineid" class="easyui-combobox" style="width: 180px;" data-options="validType:'isBlank'"/></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>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
228
bin/WebRoot/jsp/equipment/equipCardsArrangement.jsp
Normal file
228
bin/WebRoot/jsp/equipment/equipCardsArrangement.jsp
Normal file
@ -0,0 +1,228 @@
|
||||
<%@ 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 + '/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 equiparrange;
|
||||
function getEquipArrange() {
|
||||
return equiparrange;
|
||||
}
|
||||
var editFun = function(index) {
|
||||
var row =grid.datagrid("getRows")[index];
|
||||
//grid timespiner编辑的时间格式需要格式化为12:00
|
||||
equiparrange=row.equipmentArrangements_;
|
||||
$.each(equiparrange, function(index, item){
|
||||
if(item.enddt!=null && item.enddt.length>10){
|
||||
item.enddt=item.enddt.substring(11,16);
|
||||
}
|
||||
});
|
||||
equiparrange=JSON.stringify(equiparrange);
|
||||
//alert(equiparrange);
|
||||
var dialog = ext.modalDialog({
|
||||
title : '安排时间',
|
||||
width : 700,
|
||||
height : 360,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/doeditEquipArrange.do?equipmentid=${param.equipmentid}&plandate=${dt}',
|
||||
buttons : [{
|
||||
text : '保存',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.dosave();
|
||||
//alert(res);
|
||||
var temp=JSON.parse(res);
|
||||
$.each(temp, function(index, item){
|
||||
if(item.enddt!=null && item.enddt.length<10){
|
||||
item.enddt="1900-01-01 "+item.enddt;
|
||||
//alert(item.enddt)
|
||||
}
|
||||
});
|
||||
temp=JSON.stringify(temp);
|
||||
// alert(temp);
|
||||
$.post(ext.contextPath + '/equipment/doupdateEquipArrangement.do', {arrangestr:temp} , function(data) {
|
||||
if(data>0){
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}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;
|
||||
}
|
||||
var searchgrid = function() {
|
||||
grid.datagrid('load',ext.contextPath + '/equipment/getEquipCardsArrangement.do?equipmentid=${param.equipmentid}&'+$('#searchForm').serialize());
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getEquipCardsArrangement.do?equipmentid=${param.equipmentid}&'+$('#searchForm').serialize(),
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
nowrap:false,
|
||||
idField : 'taskid',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '120', title : '工单编号', field : 'workorderno_', sortable : false, halign:'center'},
|
||||
{width : '120', title : '任务名称', field : 'name', sortable : false, halign:'center'},
|
||||
{width : '120', title : '任务编码', field : 'id', sortable : false, halign:'center'},
|
||||
{width : '130', title : '分配时段', field : 'remark', sortable : true, halign:'center',formatter:function(value,row){
|
||||
|
||||
return getInfoFromArrangement(row.equipmentArrangements_);
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '90', halign:'center', align:'center', formatter : function(value, row,index) {
|
||||
var str = '';
|
||||
//var arr=JSON.stringify(row.equipmentArrangements_);
|
||||
<%if (sessionManager.havePermission(session,"equipment/editEquipmentCard.do")) {%>
|
||||
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+index+'\');"/> ';
|
||||
<%}%>
|
||||
|
||||
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);
|
||||
}
|
||||
});
|
||||
} */
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<table id="toolbar" style="width:100%">
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
|
||||
<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>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</body>
|
||||
</html>
|
||||
183
bin/WebRoot/jsp/equipment/equipmentArrangeEdit.jsp
Normal file
183
bin/WebRoot/jsp/equipment/equipmentArrangeEdit.jsp
Normal file
@ -0,0 +1,183 @@
|
||||
<!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 cellStyler(value,row,index){
|
||||
//if (index==1){
|
||||
return 'background-color:#999999;color:white;';
|
||||
//}
|
||||
}
|
||||
var grid="";
|
||||
$(function() {
|
||||
var content=parent.getEquipArrange();
|
||||
//alert(content)
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
striped : true,
|
||||
singleSelect: true,
|
||||
ctrlSelect:true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
rownumbers : true,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '90', title : '班次', field : 'gt_name', halign:'center'},
|
||||
{width : '160', title : '开始时间', field : 'stdt',halign:'center',styler:cellStyler,formatter:function(value,row){
|
||||
return row.stdt.substring(11,16);
|
||||
}},
|
||||
{width : '160', title : '结束时间', field : 'enddt',halign:'center',
|
||||
/* formatter:function(value,row){
|
||||
return row.enddt.substring(11,16);
|
||||
}, */
|
||||
editor:{
|
||||
type:'timespinner',
|
||||
options:{
|
||||
required : true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
] ],
|
||||
onClickCell: function (rowIndex, field, value) {
|
||||
beginEditing(rowIndex, field, value);
|
||||
},
|
||||
|
||||
onLoadSuccess : function(data) {
|
||||
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
if(data){
|
||||
$.each(data.rows, function(index, item){
|
||||
if(item.checkFlag){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onCheck: function(rowIndex,rowData){
|
||||
rowData.checkFlag=true;
|
||||
},
|
||||
onUncheck : function(rowIndex,rowData){
|
||||
rowData.checkFlag=false;
|
||||
},
|
||||
data:JSON.parse(content)
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
var editIndex = undefined;
|
||||
var beginEditing = function (rowIndex, field, value) {
|
||||
//alert(value)
|
||||
if (field != "enddt" )
|
||||
{
|
||||
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: 'enddt' });
|
||||
//alert("oled"+value)
|
||||
$(ed.target).timespinner('setValue',value);
|
||||
$(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: 'enddt' });
|
||||
var number = $(ed.target).timespinner('getValue');
|
||||
|
||||
$('#grid').datagrid('getRows')[editIndex]['enddt'] =number;
|
||||
//alert( 'new:'+$('#grid').datagrid('getRows')[editIndex]['enddt']);
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
editIndex = undefined;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
var dosave = function(dialog,grid) {
|
||||
//alert();
|
||||
//若用户未确认编辑状态,则自动完成编辑
|
||||
var row=$('#grid').datagrid('getSelected');
|
||||
var editIndex=$('#grid').datagrid('getRowIndex',row);
|
||||
var ed = $('#grid').datagrid('getEditor', { index: editIndex, field: 'enddt' });
|
||||
if(ed!=null){
|
||||
var number = $(ed.target).timespinner('getValue');
|
||||
$('#grid').datagrid('getRows')[editIndex]['enddt'] = number;
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
}
|
||||
|
||||
var allItems = $('#grid').datagrid('getData').rows;
|
||||
|
||||
/* $.each(allItems, function(index, item){
|
||||
//alert(item)
|
||||
if(datas !=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas += '{"id":"'+item.id +'","gt_id":"'+item.gt_id +'",'+
|
||||
'"stdt":"'+item.stdt +'","enddt":"'+item.enddt +'"}';
|
||||
}); */
|
||||
|
||||
//alert(JSON.stringify(allItems))
|
||||
return JSON.stringify(allItems);
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>设备名称</th>
|
||||
<td>${equipmentCard.equipmentname}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备编码</th>
|
||||
<td>${equipmentCard.equipmentcardid}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>日期</th>
|
||||
<td>${param.plandate}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
|
||||
</form>
|
||||
<table class="table">
|
||||
<div data-options="region:'center',border:false">
|
||||
<table id="grid" data-options="border:false "></table>
|
||||
</div>
|
||||
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
221
bin/WebRoot/jsp/equipment/equipmentCardAdd.jsp
Normal file
221
bin/WebRoot/jsp/equipment/equipmentCardAdd.jsp
Normal file
@ -0,0 +1,221 @@
|
||||
<!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"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<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 + "/equipment/saveEquipmentCard.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
$.post(ext.contextPath + "/equipment/saveEquipmentPoints.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 mrows= grid.datagrid("getRows");
|
||||
|
||||
//复制rows,否则deleteRow的index会出错
|
||||
var copyRows = [];
|
||||
for ( var j= 0; j < mrows.length; j++) {
|
||||
copyRows.push(mrows[j]);
|
||||
}
|
||||
$.each(copyRows, function(index, item){
|
||||
grid.datagrid('deleteRow', grid.datagrid('getRowIndex',copyRows[index]));
|
||||
});
|
||||
*/
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加测量点',
|
||||
height:500,
|
||||
url : ext.contextPath + '/work/mpoint/showlistForSelects.do',
|
||||
buttons : [ {
|
||||
iconCls:'icon-ok',
|
||||
text : '确认',
|
||||
handler : function() {
|
||||
var data = dialog.find('iframe').get(0).contentWindow.selectFun(dialog, grid);
|
||||
var datas= $.parseJSON(data);
|
||||
|
||||
if(datas.length>0){
|
||||
for(var i=0;i<datas.length;i++){
|
||||
grid.datagrid('appendRow',{
|
||||
id:datas[i].id,
|
||||
id:datas[i].id,
|
||||
parmname:datas[i].parmname,
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
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() {
|
||||
$('#equipmentclassid').combobox({
|
||||
url:ext.contextPath + '/equipment/getEquipmentClassname.do',
|
||||
valueField:'id',
|
||||
textField:'name',
|
||||
editable:false,
|
||||
panelHeight:'auto',
|
||||
|
||||
});
|
||||
$('#areaid').combobox({
|
||||
url:ext.contextPath + '/equipment/getGeographyAreaname.do',
|
||||
valueField:'id',
|
||||
textField:'name',
|
||||
editable:false,
|
||||
panelHeight:'auto',
|
||||
});
|
||||
$('#m').panel({
|
||||
width:"100%",
|
||||
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 : '100', title : '测量点ID', field : 'id', sortable : true, halign:'center'},
|
||||
|
||||
{width : '180', title : '名称', field : 'parmname', sortable : false, halign:'center'},
|
||||
|
||||
] ]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<input id="mids" name="mids" type="hidden" value="" />
|
||||
<tr>
|
||||
<th >设备编号</th>
|
||||
<td ><input id="equipmentcardid" name="equipmentcardid" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备名称</th>
|
||||
<td ><input id="equipmentname" name="equipmentname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备型号</th>
|
||||
<td ><input id="equipmentmodel" name="equipmentmodel" class="easyui-textbox" style="overflow:auto;" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备类型</th>
|
||||
<td>
|
||||
<input id="equipmentclassid" name="equipmentclassid" class="easyui-combobox" value="" />
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>存放位置</th>
|
||||
<td>
|
||||
<input id="areaid" name="areaid" class="easyui-combobox" value="" />
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th >管理状态</th>
|
||||
<td ><select id="currentmanageflag" name="currentmanageflag" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="启用" selected>启用</option>
|
||||
<option value="禁用">禁用</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备厂商</th>
|
||||
<td ><input id="equipmentmanufacturer" name="equipmentmanufacturer" class="easyui-textbox" style="overflow:auto;" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >责任人</th>
|
||||
<td ><input id="responsibleperson" name="responsibleperson" class="easyui-textbox" style="overflow:auto;" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >使用部门</th>
|
||||
<td ><input id="responsibledepartment" name="responsibledepartment" class="easyui-textbox" style="overflow:auto;" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>使用日期</th>
|
||||
<td><input id="productiondate" name="productiondate" class="Wdate"
|
||||
value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
|
||||
readonly>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >资产原值</th>
|
||||
<td ><input id="equipmentvalue" name="equipmentvalue" class="easyui-textbox" style="overflow:auto;" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td ><input id="remark" name="remark" class="easyui-textbox"
|
||||
data-options="multiline:true" style="overflow:auto;width:100%;height:80px;" value=""
|
||||
validtype="length[0,250]" invalidMessage="有效长度0-250"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<div id="m">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
200
bin/WebRoot/jsp/equipment/equipmentCardEdit.jsp
Normal file
200
bin/WebRoot/jsp/equipment/equipmentCardEdit.jsp
Normal file
@ -0,0 +1,200 @@
|
||||
<!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"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<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 + "/equipment/updateEquipmentCard.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
$.post(ext.contextPath + "/equipment/saveEquipmentPoints.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 + '/work/mpoint/showlistForSelects.do?iframeId=equipmentCardAdd',
|
||||
buttons : [ {
|
||||
iconCls:'icon-ok',
|
||||
text : '确认',
|
||||
handler : function() {
|
||||
var data = dialog.find('iframe').get(0).contentWindow.selectFun(dialog, grid);
|
||||
var datas= $.parseJSON(data);
|
||||
|
||||
if(datas.length>0){
|
||||
for(var i=0;i<datas.length;i++){
|
||||
grid.datagrid('appendRow',{
|
||||
id:datas[i].id,
|
||||
id:datas[i].id,
|
||||
parmname:datas[i].parmname,
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
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() {
|
||||
$('#m').panel({
|
||||
width:"100%",
|
||||
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 : '100', title : '测量点ID', field : 'id', sortable : true, halign:'center'},
|
||||
|
||||
{width : '180', title : '名称', field : 'parmname', sortable : false, halign:'center'},
|
||||
|
||||
] ],
|
||||
data:${equipmentPointList}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<input id="mids" name="mids" type="hidden" value="" />
|
||||
<form method="post" class="form">
|
||||
<input id="id" name="id" type="hidden" value="${ equipmentcard.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th >设备编号</th>
|
||||
<td ><input id="equipmentcardid" name="equipmentcardid" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="${ equipmentcard.equipmentcardid}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备名称</th>
|
||||
<td ><input id="equipmentname" name="equipmentname" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="${ equipmentcard.equipmentname}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备型号</th>
|
||||
<td ><input id="equipmentmodel" name="equipmentmodel" class="easyui-textbox" style="overflow:auto;" value="${ equipmentcard.equipmentmodel}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备类型</th>
|
||||
<td ><select id="equipmentclassid" name="equipmentclassid" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<c:forEach items="${equipmentClassList}" var="ecObj">
|
||||
<option value="${ecObj.id}" <c:if test="${equipmentcard.equipmentclassid==ecObj.id }"> selected</c:if>><c:out value="${ecObj.name}"></c:out></option>
|
||||
</c:forEach>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >存放位置</th>
|
||||
<td ><select id="areaid" name="areaid" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<c:forEach items="${geographyAreaList}" var="gaObj">
|
||||
<option value="${gaObj.id}" <c:if test="${equipmentcard.areaid==gaObj.id }"> selected</c:if>><c:out value="${gaObj.name}"></c:out></option>
|
||||
</c:forEach>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >管理状态</th>
|
||||
<td ><select id="currentmanageflag" name="currentmanageflag" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="启用" <c:if test="${equipmentcard.currentmanageflag=='启用' }"> selected</c:if>>启用</option>
|
||||
<option value="禁用" <c:if test="${equipmentcard.currentmanageflag=='禁用' }"> selected</c:if>>禁用</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备厂商</th>
|
||||
<td ><input id="equipmentmanufacturer" name="equipmentmanufacturer" class="easyui-textbox" style="overflow:auto;" value="${equipmentcard.equipmentmanufacturer}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >责任人</th>
|
||||
<td ><input id="responsibleperson" name="responsibleperson" class="easyui-textbox" style="overflow:auto;" value="${equipmentcard.responsibleperson}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >使用部门</th>
|
||||
<td ><input id="responsibledepartment" name="responsibledepartment" class="easyui-textbox" style="overflow:auto;" value="${equipmentcard.responsibledepartment}" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>使用日期</th>
|
||||
<td><input id="productiondate" name="productiondate"class="Wdate"
|
||||
value="${equipmentcard.productiondate}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"readonly/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >资产原值</th>
|
||||
<td ><input id="equipmentvalue" name="equipmentvalue" class="easyui-textbox" style="overflow:auto;" value="${equipmentcard.equipmentvalue}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td ><input id="remark" name="remark" class="easyui-textbox"
|
||||
data-options="multiline:true" style="overflow:auto;width:100%;height:80px;"
|
||||
validtype="length[0,250]" invalidMessage="有效长度0-250"
|
||||
value="${ equipmentcard.remark}" /></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
<div id="m">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
290
bin/WebRoot/jsp/equipment/equipmentCardList.jsp
Normal file
290
bin/WebRoot/jsp/equipment/equipmentCardList.jsp
Normal file
@ -0,0 +1,290 @@
|
||||
<%@page import="com.sipai.entity.equipment.EquipmentCard"%>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" 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("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">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加设备信息',
|
||||
url : ext.contextPath + '/equipment/addEquipmentCard.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var viewFun = function(id) {
|
||||
grid.datagrid('clearChecked');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '设备卡片信息',
|
||||
url : ext.contextPath + '/equipment/viewEquipmentCard.do?id=' + id
|
||||
});
|
||||
dialog.dialog({
|
||||
onClose:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
grid.datagrid('clearChecked');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑设备信息',
|
||||
url : ext.contextPath + '/equipment/editEquipmentCard.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
dialog.dialog({
|
||||
onClose:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var importFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择文件',
|
||||
width: 600,
|
||||
height:300,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/doimportEquipmentCard.do',
|
||||
buttons : [ {
|
||||
text : '导入数据',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doimport(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/equipment/deleteEquipmentCard.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 + '/equipment/deleteEquipmentCards.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
top.$.messager.alert('提示','成功删除'+data+'条记录','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getEquipmentCard.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
selectOnCheck: true,
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '160', title : '设备编号', field : 'equipmentcardid', sortable : true, halign:'center'},
|
||||
{width : '150', title : '设备名称', field : 'equipmentname', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备型号', field : 'equipmentmodel', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备状态', field : 'equipmentstatus', sortable : true, halign:'center',formatter:function(value,row){
|
||||
switch(row.equipmentstatus){
|
||||
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;
|
||||
}
|
||||
|
||||
}},
|
||||
{width : '100', title : '设备类型', field: 'equipmentclass', sortable : true, halign:'center',formatter:function(value){
|
||||
if(value!=null){
|
||||
if(value.status=="禁用"){
|
||||
return value.name+"<img class='iconImg ext-icon-bullet_error' title='该类型已禁用' /> ";
|
||||
}else{
|
||||
|
||||
return value.name;
|
||||
}}}
|
||||
},
|
||||
{width : '100', title : '存放位置', field: 'geographyarea', sortable : true, halign:'center',formatter:function(value,row){
|
||||
|
||||
if(value!=null){
|
||||
if(value.status=="禁用"){
|
||||
return value.name+"<img class='iconImg ext-icon-bullet_error' title='该位置已禁用' /> ";
|
||||
}else{
|
||||
return value.name;
|
||||
}}
|
||||
}},
|
||||
{width : '70', title : '能否被使用', field: 'currentmanageflag', sortable : true, halign:'center'},
|
||||
{width : '80', title : '备注', field : 'remark', sortable : true, halign:'center'},
|
||||
{width : '120', title : '最后更新时间', field : 'insdt', sortable : true, halign:'center',formatter:function(value){
|
||||
return value.substring(0,19);
|
||||
}
|
||||
},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.id+'\');"/> ';
|
||||
<%if (sessionManager.havePermission(session,"equipment/editEquipmentCard.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/> ';
|
||||
str += '<img class="iconImg ext-icon-chart_organisation" title="设备调度" onclick="arrangework(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"equipment/deleteEquipmentCard.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);
|
||||
}
|
||||
});
|
||||
});
|
||||
var arrangework = function(id){
|
||||
//alert(planid+workorderid+processid)
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '设备调度',
|
||||
url : ext.contextPath + '/equipment/showEquipCardsArrangement.do?equipmentid='+id,
|
||||
width:1000,
|
||||
height:500,
|
||||
buttons : [{
|
||||
text : '关闭',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
}]
|
||||
});
|
||||
};
|
||||
function formattime(val) {
|
||||
var year = parseInt(val.year) + 1900;
|
||||
var month = (parseInt(val.month) + 1);
|
||||
month = month > 9 ? month : ('0' + month);
|
||||
var date = parseInt(val.date);
|
||||
date = date > 9 ? date : ('0' + date);
|
||||
var hours = parseInt(val.hours);
|
||||
hours = hours > 9 ? hours : ('0' + hours);
|
||||
var minutes = parseInt(val.minutes);
|
||||
minutes = minutes > 9 ? minutes : ('0' + minutes);
|
||||
var seconds = parseInt(val.seconds);
|
||||
seconds = seconds > 9 ? seconds : ('0' + seconds);
|
||||
var time = year + '-' + month + '-' + date + ' ' + hours + ':'
|
||||
+ minutes + ':' + seconds;
|
||||
return time;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<%if (sessionManager.havePermission(session,"equipment/addEquipmentCard.do")) {%>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
<%}%>
|
||||
</td>
|
||||
<td>
|
||||
<%if (sessionManager.havePermission(session,"equipment/deleteEquipmentCard.do")) {%>
|
||||
<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-add',plain:true"
|
||||
onclick="importFun();">导入</a>
|
||||
|
||||
</td>
|
||||
<!-- <td><div class="datagrid-btn-separator"></div></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true" onclick="">导入</a></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_go',plain:true" onclick="">导出</a></td> -->
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<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>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
99
bin/WebRoot/jsp/equipment/equipmentCardListForSelect.jsp
Normal file
99
bin/WebRoot/jsp/equipment/equipmentCardListForSelect.jsp
Normal file
@ -0,0 +1,99 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" 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 selectFun() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas = '{"id":"'+item.id +'","equipmentcardid":"'+item.equipmentcardid +'",'+
|
||||
'"equipmentname":"'+item.equipmentname +'","equipmentmodel":"'+item.equipmentmodel +'",'+
|
||||
'"equipmentclass":"'+item.equipmentclass.name +'","geographyarea":"'+item.geographyarea.name +'"}';
|
||||
});
|
||||
console.log("datas",$.parseJSON(datas));
|
||||
return $.parseJSON(datas);
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getEquipmentCard.do?querytype=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '135', title : '设备编号', field : 'equipmentcardid', sortable : true, halign:'center'},
|
||||
{width : '127', title : '设备名称', field : 'equipmentname', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备型号', field: 'equipmentmodel', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备类型', field: 'equipmentclass', sortable : true, halign:'center',formatter:function(value){
|
||||
if(value!=null){
|
||||
return value.name;
|
||||
}} },
|
||||
{width : '100', title : '存放位置', field: 'geographyarea', sortable : true, halign:'center',formatter:function(value){
|
||||
if(value!=null){
|
||||
return value.name;
|
||||
}} },
|
||||
{width : '50', title : '管理状态', field: 'currentmanageflag', sortable : true, halign:'center'},
|
||||
{width : '80', title : '备注', field : 'remark', sortable : true, halign:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
var equids = localStorage.getItem("search_equ").split(",");
|
||||
localStorage.clear();
|
||||
$.each(equids, function(index, item){
|
||||
if(item != ""){
|
||||
$('#grid').datagrid("checkRow",$('#grid').datagrid("getRowIndex",item));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</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 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>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
131
bin/WebRoot/jsp/equipment/equipmentCardListForSelects.jsp
Normal file
131
bin/WebRoot/jsp/equipment/equipmentCardListForSelects.jsp
Normal file
@ -0,0 +1,131 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" 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 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){
|
||||
if(datas !=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas += '{"id":"'+item.id +'","equipmentcardid":"'+item.equipmentcardid +'",'+
|
||||
'"equipmentname":"'+item.equipmentname +'","equipmentmodel":"'+item.equipmentmodel +'"}';
|
||||
|
||||
});
|
||||
datas="["+datas+"]";
|
||||
|
||||
return datas;//$.parseJSON(datas);
|
||||
|
||||
}
|
||||
function selectID(dialog, grid) {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas = '{"id":"'+item.id +'","id":"'+item.id +'"}';
|
||||
});
|
||||
return $.parseJSON(datas);
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getEquipmentCard.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 : '80', title : '设备编号', field : 'equipmentcardid', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备名称', field : 'equipmentname', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备型号', field: 'equipmentmodel', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备类型', field: 'equipmentclass', sortable : true, halign:'center',formatter:function(value){
|
||||
if(value!=null){
|
||||
return value.name;
|
||||
}} },
|
||||
{width : '100', title : '存放位置', field: 'geographyarea', sortable : true, halign:'center',formatter:function(value){
|
||||
if(value!=null){
|
||||
return value.name;
|
||||
} }},
|
||||
|
||||
|
||||
{width : '50', title : '管理状态', field: 'currentmanageflag', sortable : true, halign:'center'},
|
||||
{width : '80', title : '备注', field : 'remark', sortable : true, halign:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
/* var mids = parent.$("#${param.iframeId}")[0].contentWindow.$("#mids").val().split(",");
|
||||
$.each(mids, function(index, item){
|
||||
if(item != ""){
|
||||
$('#grid').datagrid("checkRow",$('#grid').datagrid("getRowIndex",item)); */
|
||||
var mids = localStorage.getItem("mids").split(",");
|
||||
localStorage.removeItem("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>
|
||||
<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>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
126
bin/WebRoot/jsp/equipment/equipmentCardView.jsp
Normal file
126
bin/WebRoot/jsp/equipment/equipmentCardView.jsp
Normal file
@ -0,0 +1,126 @@
|
||||
<!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 utf16to8(str) {
|
||||
var out, i, len, c;
|
||||
out = "";
|
||||
len = str.length;
|
||||
for (i = 0; i < len; i++) {
|
||||
c = str.charCodeAt(i);
|
||||
if ((c >= 0x0001) && (c <= 0x007F)) {
|
||||
out += str.charAt(i);
|
||||
} else if (c > 0x07FF) {
|
||||
out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
|
||||
out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
|
||||
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
|
||||
} else {
|
||||
out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
|
||||
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th >设备编号</th>
|
||||
<td id="cfilenametd">${equipmentcard.equipmentcardid}</td>
|
||||
<td rowspan="7" width="150px">
|
||||
<div id="qrcodeTable2" style="display:block;align:center; width:150px"></div>
|
||||
<script >
|
||||
var filename2 = $('#cfilenametd').html();
|
||||
var cidd2 = utf16to8(filename2);
|
||||
$('#qrcodeTable2').qrcode({
|
||||
render : "canvas",
|
||||
width : 150, //设置宽度
|
||||
height : 150, //设置高度
|
||||
typeNumber : -1, //计算模式
|
||||
correctLevel : QRErrorCorrectLevel.H,//纠错等级
|
||||
background : "#ffffff",//背景颜色
|
||||
foreground : "#000000", //前景颜色
|
||||
text : cidd2
|
||||
});
|
||||
|
||||
</script>
|
||||
<!-- </div> -->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备名称</th>
|
||||
<td >${equipmentcard.equipmentname}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备型号</th>
|
||||
<td >${equipmentcard.equipmentmodel}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备类型</th>
|
||||
<td >
|
||||
<c:if test="${equipmentcard.equipmentclass.id==equipmentcard.equipmentclassid}">
|
||||
${equipmentcard.equipmentclass.name}
|
||||
</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >存放位置</th>
|
||||
<td >
|
||||
|
||||
<c:if test="${equipmentcard.geographyarea.id==equipmentcard.areaid}">
|
||||
${equipmentcard.geographyarea.name}
|
||||
</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >管理状态</th>
|
||||
<td >${equipmentcard.currentmanageflag}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >设备厂商</th>
|
||||
<td >${equipmentcard.equipmentmanufacturer}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >责任人</th>
|
||||
<td >${equipmentcard.responsibleperson}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >使用部门</th>
|
||||
<td >${equipmentcard.responsibledepartment}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >使用日期</th>
|
||||
<td >${equipmentcard.productiondate}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >资产原值</th>
|
||||
<td >${equipmentcard.equipmentvalue}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td >${equipmentcard.remark}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th >关联测量点</th>
|
||||
<td >
|
||||
<c:if test="${equipmentPointname != null}">
|
||||
${equipmentPointname}
|
||||
</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
78
bin/WebRoot/jsp/equipment/equipmentCardimport.jsp
Normal file
78
bin/WebRoot/jsp/equipment/equipmentCardimport.jsp
Normal file
@ -0,0 +1,78 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>导入人员</title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script>
|
||||
var uploader,state;
|
||||
$(function() {
|
||||
var $ = jQuery,
|
||||
$list = $('#thelist'),
|
||||
state = 'pending';
|
||||
|
||||
uploader = WebUploader.create({
|
||||
// swf文件路径
|
||||
swf: ext.contextPath+'/JS/webuploader-0.1.5/Uploader.swf',
|
||||
// 文件接收服务端。
|
||||
server: ext.contextPath+'/equipment/importequipmentCard.do',
|
||||
// 选择文件的按钮。可选。
|
||||
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
|
||||
pick: {
|
||||
id: '#picker',
|
||||
multiple: false
|
||||
},
|
||||
// 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传!
|
||||
resize: false,
|
||||
accept: {
|
||||
title: 'Excel',
|
||||
extensions: 'xls,xlsx',
|
||||
mimeTypes: 'excel/*'
|
||||
}
|
||||
});
|
||||
//当有文件被添加进队列的时候
|
||||
uploader.on( 'fileQueued', function( file ) {
|
||||
$list.append( '<div id="' + file.id + '" class="item">' +
|
||||
'<h4 class="info">' + file.name + '</h4>' +
|
||||
'<p class="state">等待上传...</p>' +
|
||||
'</div>' );
|
||||
});
|
||||
});
|
||||
|
||||
var doimport = function(dialog, grid){
|
||||
//执行上传功能
|
||||
if ( state === 'uploading' ) {
|
||||
alert("文件正在上传中,请稍等");
|
||||
} else {
|
||||
uploader.upload();
|
||||
}
|
||||
|
||||
uploader.on( 'uploadError', function( file ) {
|
||||
$( '#'+file.id ).find('p.state').text('上传出错');
|
||||
});
|
||||
|
||||
uploader.on( 'uploadSuccess', function( file,response ) {
|
||||
$( '#'+file.id ).find('p.state').text('已上传');
|
||||
if(response.feedback!=null&&response.feedback!=""){
|
||||
alert(response.feedback);
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
}else{
|
||||
alert("导入未完成!");
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="uploader" class="wu-example">
|
||||
<div class="btns">
|
||||
<div id="picker">选择文件</div>
|
||||
</div>
|
||||
<!--用来存放文件信息-->
|
||||
<div id="thelist" class="uploader-list"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
58
bin/WebRoot/jsp/equipment/equipmentClassAdd.jsp
Normal file
58
bin/WebRoot/jsp/equipment/equipmentClassAdd.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"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<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 + "/equipment/saveEquipmentClass.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 id="name" name="name" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th >管理状态</th>
|
||||
<td ><select id="status" name="status" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="启用">启用</option>
|
||||
<option value="禁用">禁用</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td ><input id="remark" name="remark" class="easyui-textbox" data-options="multiline:true" style="overflow:auto;width:100%;height:80px;" value=""
|
||||
validtype="length[0,250]" invalidMessage="有效长度0-250"/></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
59
bin/WebRoot/jsp/equipment/equipmentClassEdit.jsp
Normal file
59
bin/WebRoot/jsp/equipment/equipmentClassEdit.jsp
Normal file
@ -0,0 +1,59 @@
|
||||
<!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"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<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 + "/equipment/updateEquipmentClass.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">
|
||||
<input id="id" name="id" type="hidden" value="${ equipmentclass.id}"/>
|
||||
<tr>
|
||||
<th >类型名称</th>
|
||||
<td ><input id="name" name="name" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="${equipmentclass.name }" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th >管理状态</th>
|
||||
<td ><select id="status" name="status" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="启用" <c:if test="${equipmentclass.status=='启用' }">selected</c:if>>启用</option>
|
||||
<option value="禁用" <c:if test="${equipmentclass.status=='禁用' }">selected</c:if>>禁用</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td ><input id="remark" name="remark" class="easyui-textbox"
|
||||
validtype="length[0,250]" invalidMessage="有效长度0-250"
|
||||
data-options="multiline:true" style="overflow:auto;width:100%;height:80px;" value="${equipmentclass.remark}" /></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
230
bin/WebRoot/jsp/equipment/equipmentClassList.jsp
Normal file
230
bin/WebRoot/jsp/equipment/equipmentClassList.jsp
Normal file
@ -0,0 +1,230 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" 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">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加设备类型信息',
|
||||
url : ext.contextPath + '/equipment/addEquipmentClass.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var viewFun = function(id) {
|
||||
grid.datagrid('clearChecked');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看设备类型信息',
|
||||
url : ext.contextPath + '/equipment/viewEquipmentClass.do?id=' + id
|
||||
});
|
||||
dialog.dialog({
|
||||
onClose:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
grid.datagrid('clearChecked');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑设备类型信息',
|
||||
url : ext.contextPath + '/equipment/editEquipmentClass.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
dialog.dialog({
|
||||
onClose:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/equipment/deleteEquipmentClass.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 + '/equipment/deleteEquipmentClasses.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
top.$.messager.alert('提示','成功删除'+data+'条记录','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//同步PLM设备类型同步信息
|
||||
var synchroFun = function() {
|
||||
parent.$.messager.confirm('提示', '您确定要与PLM系统同步设备类型信息?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/equipment/synchroEquipmentClass.do', "" , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','同步成功','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
parent.$.messager.alert('提示','同步失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getEquipmentClass.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
selectOnCheck: true,
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '80', title : '备注', field : 'remark', sortable : true, halign:'center'},
|
||||
|
||||
{width : '50', title : '状态', field: 'status', sortable : true, halign:'center'},
|
||||
{width : '180', title : '最后更新时间', field : 'insdt', sortable : true, halign:'center',formatter:function(value){
|
||||
return value.substring(0,19);
|
||||
}
|
||||
},
|
||||
{title : '操作', field : 'action', width : '90', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.id+'\');"/> ';
|
||||
<%if (sessionManager.havePermission(session,"equipment/editEquipmentClass.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/> ';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"equipment/deleteEquipmentClass.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);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function formattime(val) {
|
||||
var year = parseInt(val.year) + 1900;
|
||||
var month = (parseInt(val.month) + 1);
|
||||
month = month > 9 ? month : ('0' + month);
|
||||
var date = parseInt(val.date);
|
||||
date = date > 9 ? date : ('0' + date);
|
||||
var hours = parseInt(val.hours);
|
||||
hours = hours > 9 ? hours : ('0' + hours);
|
||||
var minutes = parseInt(val.minutes);
|
||||
minutes = minutes > 9 ? minutes : ('0' + minutes);
|
||||
var seconds = parseInt(val.seconds);
|
||||
seconds = seconds > 9 ? seconds : ('0' + seconds);
|
||||
var time = year + '-' + month + '-' + date + ' ' + hours + ':'
|
||||
+ minutes + ':' + seconds;
|
||||
return time;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<%if (sessionManager.havePermission(session,"equipment/addEquipmentClass.do")) {%>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
<%}%>
|
||||
</td>
|
||||
<td>
|
||||
<%if (sessionManager.havePermission(session,"equipment/deleteEquipmentClass.do")) {%>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
<%}%>
|
||||
</td>
|
||||
<%if (sessionManager.havePermission(session,"equipment/addEquipmentClass.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="synchroFun();">同步</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<!-- <td><div class="datagrid-btn-separator"></div></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true" onclick="">导入</a></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_go',plain:true" onclick="">导出</a></td> -->
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<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>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
39
bin/WebRoot/jsp/equipment/equipmentClassView.jsp
Normal file
39
bin/WebRoot/jsp/equipment/equipmentClassView.jsp
Normal file
@ -0,0 +1,39 @@
|
||||
<!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"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
|
||||
<tr>
|
||||
<th >类型名称</th>
|
||||
<td >${equipmentclass.name}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th >管理状态</th>
|
||||
<td >${equipmentclass.status}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td colspan="3">
|
||||
<input name="remark" class="easyui-textbox" value="${equipmentclass.remark}" validtype="length[0,250]" invalidMessage="有效长度0-250"
|
||||
data-options="multiline:true" style="width:100%;height:100px"/>
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
96
bin/WebRoot/jsp/equipment/equipmentListForSelect.jsp
Normal file
96
bin/WebRoot/jsp/equipment/equipmentListForSelect.jsp
Normal file
@ -0,0 +1,96 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" 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 selectID(dialog, grid) {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas = '{"equipmentcard":"'+item.equipmentcardid +'_'+item.equipmentname+'","id":"'+item.id +'"}';
|
||||
});
|
||||
return $.parseJSON(datas);
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getEquipmentCard.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 : '80', title : '设备编号', field : 'equipmentcardid', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备名称', field : 'equipmentname', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备型号', field: 'equipmentmodel', sortable : true, halign:'center'},
|
||||
{width : '100', title : '设备类型', field: 'equipmentclass', sortable : true, halign:'center',formatter:function(value){
|
||||
if(value!=null){
|
||||
return value.name;
|
||||
}} },
|
||||
{width : '100', title : '存放位置', field: 'geographyarea', sortable : true, halign:'center',formatter:function(value){
|
||||
if(value!=null){
|
||||
return value.name;
|
||||
} }},
|
||||
|
||||
|
||||
{width : '50', title : '管理状态', field: 'currentmanageflag', sortable : true, halign:'center'},
|
||||
{width : '80', title : '备注', field : 'remark', sortable : true, halign:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
var mids = localStorage.getItem("mids").split(",");
|
||||
localStorage.removeItem("mids");
|
||||
|
||||
$.each(mids, function(index, item){
|
||||
if(item != ""){
|
||||
$('#grid').datagrid("checkRow",$('#grid').datagrid("getRowIndex",item));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</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 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>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
170
bin/WebRoot/jsp/equipment/equipmentMaintainAdd.jsp
Normal file
170
bin/WebRoot/jsp/equipment/equipmentMaintainAdd.jsp
Normal file
@ -0,0 +1,170 @@
|
||||
<!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 + "/equipment/equipmentmaintain/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 selectequipmentmaintain(equipmentid,eid){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择设备',
|
||||
width: 700,
|
||||
height:420,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/equipmentmaintain/showListForSelect.do',
|
||||
toolbar:'',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
console.log("enter",res);
|
||||
dialog.dialog('destroy');
|
||||
$("#"+equipmentid).textbox("setValue",res.equipmentid);
|
||||
$("#"+eid).val(res.id);
|
||||
$("#equipmentname").html(res.equipmentname);
|
||||
$("#equipmentclassid").html(res.equipmentclass);
|
||||
$("#equipmentmodel").html(res.equipmentmodel);
|
||||
$("#areaid").html(res.geographyarea);
|
||||
$("#currentmanageflag").html(res.currentmanageflag);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
// dialog.find('iframe').get(0).contentWindow.selectCancel();
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
$(function() {
|
||||
$("#equipmentid").textbox('textbox').bind("click", function () {
|
||||
selectequipmentmaintain("equipmentid","eid");
|
||||
});
|
||||
});
|
||||
function selectmaintenanceman(maintenanceman,mid){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择维修者',
|
||||
width: 700,
|
||||
height:420,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/equipmentmaintain/showMaintenancemanForSelect.do',
|
||||
toolbar:'',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
dialog.dialog('destroy');
|
||||
$("#"+maintenanceman).textbox("setValue",res.name);
|
||||
$("#"+mid).val(res.id);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
// dialog.find('iframe').get(0).contentWindow.selectCancel();
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
$(function() {
|
||||
$("#maintenanceman").textbox('textbox').bind("click", function () {
|
||||
selectmaintenanceman("maintenanceman","mid");
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>设备编号</th>
|
||||
<td >
|
||||
<input id="equipmentid" name="equipmentid" class="easyui-textbox" data-options="required:true,validType:'isBlank',prompt:'单击选择'" value="" readonly/>
|
||||
<input id="eid" name="eid" type="hidden" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备名称</th>
|
||||
<td>
|
||||
<span id="equipmentname"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备类型</th>
|
||||
<td><span id="equipmentclassid" ></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备型号</th>
|
||||
<td><span id="equipmentmodel" ></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>存放位置</th>
|
||||
<td><span id="areaid"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>状态</th>
|
||||
<td><span id="currentmanageflag" ></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>维修描述</th>
|
||||
<td ><input id="describe" name="describe" class="easyui-textbox"
|
||||
data-options="multiline:true" style="overflow:auto;width:100%;height:80px;" value=""
|
||||
validtype="length[0,250]" invalidMessage="有效长度0-250"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>维修时间</th>
|
||||
<td><input id="time" name="time" class="Wdate"
|
||||
value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" readonly/>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>维修者</th>
|
||||
<td><input id="maintenanceman" name="maintenanceman" class="easyui-textbox" data-options="required:true,validType:'isBlank',prompt:'单击选择'" value="" readonly/>
|
||||
<input id="mid" name="mid" type="hidden" value="" /></td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
169
bin/WebRoot/jsp/equipment/equipmentMaintainEdit.jsp
Normal file
169
bin/WebRoot/jsp/equipment/equipmentMaintainEdit.jsp
Normal file
@ -0,0 +1,169 @@
|
||||
<!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 + "/equipment/equipmentmaintain/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 selectequipmentmaintain(equipmentid,equipmentcardid){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择设备',
|
||||
width: 700,
|
||||
height:420,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/equipmentmaintain/showListForSelect.do',
|
||||
toolbar:'',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
console.log("enter",res);
|
||||
dialog.dialog('destroy');
|
||||
$("#"+equipmentid).textbox("setValue",res.equipmentid);
|
||||
$("#"+equipmentcardid).val(res.id);
|
||||
$("#equipmentname").html(res.equipmentname);
|
||||
$("#equipmentclassid").html(res.equipmentclass);
|
||||
$("#equipmentmodel").html(res.equipmentmodel);
|
||||
$("#areaid").html(res.geographyarea);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
// dialog.find('iframe').get(0).contentWindow.selectCancel();
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
$(function() {
|
||||
$("#equipmentid").textbox('textbox').bind("click", function () {
|
||||
selectequipmentmaintain("equipmentid","equipmentcardid");
|
||||
});
|
||||
});
|
||||
function selectmaintenanceman(mancaption,maintenanceman){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择维修者',
|
||||
width: 700,
|
||||
height:420,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/equipmentmaintain/showMaintenancemanForSelect.do',
|
||||
toolbar:'',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
console.log("enter",res);
|
||||
dialog.dialog('destroy');
|
||||
$("#"+mancaption).textbox("setValue",res.name);
|
||||
$("#"+maintenanceman).val(res.id);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
// dialog.find('iframe').get(0).contentWindow.selectCancel();
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("#mancaption").textbox('textbox').bind("click", function () {
|
||||
selectmaintenanceman("mancaption","maintenanceman");
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" name="id" value="${equipmentmaintain.id}"/>
|
||||
<table class="table">
|
||||
|
||||
<tr>
|
||||
<th >设备编号</th>
|
||||
<td><input id="equipmentid" name="equipmentid" class="easyui-textbox" data-options="required:true,validType:'isBlank',"value="${equipmentmaintain.equipmentcode}" readonly/>
|
||||
<input id="equipmentcardid" name="equipmentcardid" type="hidden" value="${equipmentmaintain.equipmentcardid}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备名称</th>
|
||||
<td><span id="equipmentname"></span> </td>
|
||||
<script type="text/javascript">
|
||||
document.getElementById('equipmentname').innerText="${equipmentmaintain.equipmentname}";
|
||||
</script>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备类型</th>
|
||||
<td><span id="equipmentclassid"></span> </td>
|
||||
<script type="text/javascript">
|
||||
document.getElementById('equipmentclassid').innerText="${equipmentmaintain.equipmentclassid}";
|
||||
</script>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备型号</th>
|
||||
<td><span id="equipmentmodel"></span> </td>
|
||||
<script type="text/javascript">
|
||||
document.getElementById('equipmentmodel').innerText="${equipmentmaintain.equipmentmodel}";
|
||||
</script>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>存放位置</th>
|
||||
<td><span id="areaid"></span> </td>
|
||||
<script type="text/javascript">
|
||||
document.getElementById('areaid').innerText="${equipmentmaintain.areaid}";
|
||||
</script>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >维修者</th>
|
||||
<td><input id="mancaption" name="mancaption" class="easyui-textbox" data-options="required:true,validType:'isBlank',"value="${equipmentmaintain.mancaption}" readonly/>
|
||||
<input id="maintenanceman" name="maintenanceman" type="hidden" value="${equipmentmaintain.maintenanceman}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >维修描述</th>
|
||||
<td ><input id="describe" name="describe" class="easyui-textbox"
|
||||
data-options="multiline:true" style="overflow:auto;width:100%;height:80px;"
|
||||
validtype="length[0,250]" invalidMessage="有效长度0-250"
|
||||
value="${ equipmentmaintain.describe}" /></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
195
bin/WebRoot/jsp/equipment/equipmentMaintainList.jsp
Normal file
195
bin/WebRoot/jsp/equipment/equipmentMaintainList.jsp
Normal file
@ -0,0 +1,195 @@
|
||||
<%@ 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 : 500,
|
||||
resizable:true,
|
||||
url : ext.contextPath + '/equipment/equipmentmaintain/add.do',
|
||||
buttons : [{
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
var viewFun = function(id) {
|
||||
grid.datagrid('clearChecked');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '设备信息',
|
||||
url : ext.contextPath + '/equipment/equipmentmaintain/view.do?id=' + id,
|
||||
});
|
||||
dialog.dialog({
|
||||
onClose:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑设备',
|
||||
url : ext.contextPath + '/equipment/equipmentmaintain/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 + '/equipment/equipmentmaintain/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 + '/equipment/equipmentmaintain/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 + '/equipment/equipmentmaintain/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 : 'equipmentcode', sortable : true, halign:'center'},
|
||||
{width : '80', title : '设备名称', field : 'equipmentname', sortable : true, halign:'center'},
|
||||
{width : '80', title : '设备型号', field : 'equipmentmodel', sortable : true, halign:'center'},
|
||||
{width : '80', title : '设备类型', field: 'equipmentclassid', sortable : true, halign:'center' },
|
||||
{width : '80', title : '存放位置', field: 'areaid', sortable : true, halign:'center'},
|
||||
{width : '50', title : '状态', field: 'currentmanageflag', sortable : true, halign:'center'},
|
||||
{width : '80', title : '维修者', field : 'mancaption', sortable : true, halign:'center'},
|
||||
{width : '160', title : '维修描述', field : 'describe', sortable : true, halign:'center'},
|
||||
{width : '100', title : '维修时间', field : 'time', sortable : true, halign:'center'},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.id+'\');"/>';
|
||||
<%if (sessionManager.havePermission(session,"equipment/equipmentmaintain/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"equipment/equipmentmaintain/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,"equipment/equipmentmaintain/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,"equipment/equipmentmaintain/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>
|
||||
<tr>
|
||||
<td>设备名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" style="width: 180px;" /></td>
|
||||
<td>设备类型</td>
|
||||
<td><input name="search_class" class="easyui-textbox" style="width: 180px;" /></td></tr>
|
||||
<tr>
|
||||
<td>维修日期</td>
|
||||
<td><input name="search_time" class="easyui-textbox" style="width: 180px;" /></td>
|
||||
<td>维修者</td>
|
||||
<td><input name="search_maintenanceman" 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>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</table>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
106
bin/WebRoot/jsp/equipment/equipmentMaintainListForSelect.jsp
Normal file
106
bin/WebRoot/jsp/equipment/equipmentMaintainListForSelect.jsp
Normal file
@ -0,0 +1,106 @@
|
||||
<%@ 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 = '{"equipmentid":"'+item.equipmentcardid +'","id":"'+item.id+'","equipmentname":"'+item.equipmentname +'",'+
|
||||
'"equipmentmodel":"'+item.equipmentmodel +'","equipmentclass":"'+item.equipmentclass.name+'",'+
|
||||
'"geographyarea":"'+item.geographyarea.name +'","currentmanageflag":"'+item.currentmanageflag +'","remark":"'+item.remark +'"}';
|
||||
});
|
||||
return $.parseJSON(datas);
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getEquipmentCard.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 : 'equipmentcardid', sortable : true, halign:'center'},
|
||||
{width : '240', title : '设备名称', field : 'equipmentname', sortable : true, halign:'center'},
|
||||
{width : '80', title : '设备型号', field : 'equipmentmodel', sortable : true, halign:'center'},
|
||||
{width : '80', title : '设备类型', field : 'equipmentclass', sortable : true, halign:'center' ,formatter:function(value){
|
||||
if(value!=null){
|
||||
if(value.status=="禁用"){
|
||||
return value.name+"<img class='iconImg ext-icon-bullet_error' title='该类型已禁用' /> ";
|
||||
}else{
|
||||
|
||||
return value.name;
|
||||
}}}
|
||||
},
|
||||
{width : '180', title : '存放位置', field : 'geographyarea', sortable : true, halign:'center',formatter:function(value){
|
||||
if(value!=null){
|
||||
if(value.status=="禁用"){
|
||||
return value.name+"<img class='iconImg ext-icon-bullet_error' title='该位置已禁用' /> ";
|
||||
}else{
|
||||
return value.name;
|
||||
}}
|
||||
}},
|
||||
{width : '80', title : '状态', field : 'currentmanageflag', sortable : true, halign:'center'},
|
||||
{width : '80', title : '备注', field : 'remark', 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_areaid" name="search_areaid" class="easyui-texbox"/></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/equipment/equipmentMaintainView.jsp
Normal file
54
bin/WebRoot/jsp/equipment/equipmentMaintainView.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>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" id="id" name="id" value="${equipmentMaintain.id}"/>
|
||||
|
||||
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th >设备编号</th>
|
||||
<td >${equipmentMaintain.equipmentcardid}</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备名称</th>
|
||||
<td> ${equipmentMaintain.equipmentname}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备类型</th>
|
||||
<td> ${equipmentMaintain.equipmentclassid} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>设备型号</th>
|
||||
<td> ${equipmentMaintain.equipmentmodel}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>存放位置</th>
|
||||
<td> ${equipmentMaintain.areaid} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >状态</th>
|
||||
<td >${equipmentMaintain.currentmanageflag}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >维修者</th>
|
||||
<td >${equipmentMaintain.maintenanceman}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >维修描述</th>
|
||||
<td >${equipmentMaintain.describe}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
<div class="barcode2" id="div128" style="text-align:center;margin-left:250px;margin-top:200px;"></div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
56
bin/WebRoot/jsp/equipment/geographyAreaAdd.jsp
Normal file
56
bin/WebRoot/jsp/equipment/geographyAreaAdd.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"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<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 + "/equipment/saveGeographyArea.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 id="name" name="name" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >管理状态</th>
|
||||
<td ><select id="status" name="status" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="启用">启用</option>
|
||||
<option value="禁用">禁用</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td ><input id="remark" name="remark" class="easyui-textbox" data-options="multiline:true" style="overflow:auto;width:100%;height:80px;" value="" validtype="length[0,250]" invalidMessage="有效长度0-250"/></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
58
bin/WebRoot/jsp/equipment/geographyAreaEdit.jsp
Normal file
58
bin/WebRoot/jsp/equipment/geographyAreaEdit.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"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<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 + "/equipment/updateGeographyArea.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">
|
||||
<input id="id" name="id" type="hidden" value="${ geographyarea.id}"/>
|
||||
<tr>
|
||||
<th >位置名称</th>
|
||||
<td ><input id="name" name="name" class="easyui-textbox" data-options="required:true,validType:'isBlank'" style="overflow:auto;" value="${geographyarea.name }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >管理状态</th>
|
||||
<td ><select id="status" name="status" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="启用" <c:if test="${geographyarea.status=='启用' }">selected</c:if>>启用</option>
|
||||
<option value="禁用" <c:if test="${geographyarea.status=='禁用' }">selected</c:if>>禁用</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td ><input id="remark" name="remark" class="easyui-textbox"
|
||||
validtype="length[0,250]" invalidMessage="有效长度0-250"
|
||||
data-options="multiline:true" style="overflow:auto;width:100%;height:80px;" value="${geographyarea.remark }" /></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
219
bin/WebRoot/jsp/equipment/geographyAreaList.jsp
Normal file
219
bin/WebRoot/jsp/equipment/geographyAreaList.jsp
Normal file
@ -0,0 +1,219 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@page import="java.util.Date" %>
|
||||
<%@page import="java.text.SimpleDateFormat" %>
|
||||
<%@ 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" src="<%=contextPath%>/JS/datagrid-dnd.js"></script>
|
||||
<script type="text/javascript">
|
||||
var grid;
|
||||
var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加设备存放位置信息',
|
||||
url : ext.contextPath + '/equipment/addGeographyArea.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var viewFun = function(id) {
|
||||
grid.datagrid('clearChecked');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '查看设备存放位置信息',
|
||||
url : ext.contextPath + '/equipment/viewGeographyArea.do?id=' + id
|
||||
});
|
||||
dialog.dialog({
|
||||
onClose:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
grid.datagrid('clearChecked');
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑设备存放位置信息',
|
||||
url : ext.contextPath + '/equipment/editGeographyArea.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
dialog.dialog({
|
||||
onClose:function(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
});
|
||||
};
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/equipment/deleteGeographyArea.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 + '/equipment/deleteGeographyAreas.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
top.$.messager.alert('提示','成功删除'+data+'条记录','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
top.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/getGeographyArea.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
selectOnCheck: true,
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '120', title : '备注', field : 'remark', sortable : true, halign:'center'},
|
||||
{width : '50', title : '状态', field: 'status', sortable : true, halign:'center'},
|
||||
{width : '120', title : '最后更新时间', field : 'insdt', sortable : true, halign:'center',formatter:function(value){
|
||||
return value.substring(0,19);
|
||||
}
|
||||
},
|
||||
{title : '操作', field : 'action', width : '90', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.id+'\');"/> ';
|
||||
<%if (sessionManager.havePermission(session,"equipment/editGeographyArea.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/> ';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"equipment/deleteGeographyArea.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);
|
||||
//$(this).datagrid('enableDnd');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function formattime(val) {
|
||||
var year = parseInt(val.year) + 1900;
|
||||
var month = (parseInt(val.month) + 1);
|
||||
month = month > 9 ? month : ('0' + month);
|
||||
var date = parseInt(val.date);
|
||||
date = date > 9 ? date : ('0' + date);
|
||||
var hours = parseInt(val.hours);
|
||||
hours = hours > 9 ? hours : ('0' + hours);
|
||||
var minutes = parseInt(val.minutes);
|
||||
minutes = minutes > 9 ? minutes : ('0' + minutes);
|
||||
var seconds = parseInt(val.seconds);
|
||||
seconds = seconds > 9 ? seconds : ('0' + seconds);
|
||||
var time = year + '-' + month + '-' + date + ' ' + hours + ':'
|
||||
+ minutes + ':' + seconds;
|
||||
return time;
|
||||
}
|
||||
function allow(){
|
||||
grid.datagrid('enableDnd');
|
||||
//grid.datagrid('reload');
|
||||
}
|
||||
function notallow(){
|
||||
grid.datagrid('reload');
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<%if (sessionManager.havePermission(session,"equipment/addGeographyArea.do")) {%>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"
|
||||
onclick="addFun();">添加</a>
|
||||
<%}%>
|
||||
</td>
|
||||
<td>
|
||||
<%if (sessionManager.havePermission(session,"equipment/deleteGeographyArea.do")) {%>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
<%}%>
|
||||
</td>
|
||||
<!-- <td><div class="datagrid-btn-separator"></div></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true" onclick="">导入</a></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_go',plain:true" onclick="">导出</a></td> -->
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<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>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
35
bin/WebRoot/jsp/equipment/geographyAreaView.jsp
Normal file
35
bin/WebRoot/jsp/equipment/geographyAreaView.jsp
Normal file
@ -0,0 +1,35 @@
|
||||
<!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"%>
|
||||
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
|
||||
<tr>
|
||||
<th >类型名称</th>
|
||||
<td >${geographyarea.name}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >管理状态</th>
|
||||
<td >${geographyarea.status}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th >备注</th>
|
||||
<td >${geographyarea.remark}</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
79
bin/WebRoot/jsp/equipment/importMaintenancePlan.jsp
Normal file
79
bin/WebRoot/jsp/equipment/importMaintenancePlan.jsp
Normal file
@ -0,0 +1,79 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>导入人员</title>
|
||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||
<script>
|
||||
var uploader,state;
|
||||
$(function() {
|
||||
var $ = jQuery,
|
||||
$list = $('#thelist'),
|
||||
state = 'pending';
|
||||
|
||||
uploader = WebUploader.create({
|
||||
// swf文件路径
|
||||
swf: ext.contextPath+'/JS/webuploader-0.1.5/Uploader.swf',
|
||||
// 文件接收服务端。
|
||||
server: ext.contextPath+'/equipment/maintenanceplan/importMaintenancePlan.do',
|
||||
// 选择文件的按钮。可选。
|
||||
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
|
||||
pick: {
|
||||
id: '#picker',
|
||||
multiple: false
|
||||
},
|
||||
// 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传!
|
||||
resize: false,
|
||||
accept: {
|
||||
title: 'Excel',
|
||||
extensions: 'xls,xlsx',
|
||||
mimeTypes: 'excel/*'
|
||||
}
|
||||
});
|
||||
//当有文件被添加进队列的时候
|
||||
uploader.on( 'fileQueued', function( file ) {
|
||||
$list.append( '<div id="' + file.id + '" class="item">' +
|
||||
'<h4 class="info">' + file.name + '</h4>' +
|
||||
'<p class="state">等待上传...</p>' +
|
||||
'</div>' );
|
||||
});
|
||||
});
|
||||
|
||||
var doimport = function(dialog, grid){
|
||||
//执行上传功能
|
||||
if ( state === 'uploading' ) {
|
||||
alert("文件正在上传中,请稍等");
|
||||
} else {
|
||||
uploader.upload();
|
||||
}
|
||||
|
||||
uploader.on( 'uploadError', function( file ) {
|
||||
$( '#'+file.id ).find('p.state').text('上传出错');
|
||||
});
|
||||
|
||||
uploader.on( 'uploadSuccess', function( file,response ) {
|
||||
$( '#'+file.id ).find('p.state').text('已上传');
|
||||
if(response.feedback!=null&&response.feedback!=""){
|
||||
|
||||
alert(response.feedback);
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
}else{
|
||||
alert("导入未完成!");
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="uploader" class="wu-example">
|
||||
<div class="btns">
|
||||
<div id="picker">选择文件</div>
|
||||
</div>
|
||||
<!--用来存放文件信息-->
|
||||
<div id="thelist" class="uploader-list"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
172
bin/WebRoot/jsp/equipment/maintenancePlanAdd.jsp
Normal file
172
bin/WebRoot/jsp/equipment/maintenancePlanAdd.jsp
Normal file
@ -0,0 +1,172 @@
|
||||
<!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">
|
||||
|
||||
function getids(){
|
||||
var rows= $('#grid').datagrid("getRows");
|
||||
var ids="";
|
||||
$.each(rows, function(index, item){
|
||||
ids+=item.id+",";
|
||||
});
|
||||
ids=ids.replace(/,$/gi,"");
|
||||
return ids;
|
||||
}
|
||||
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/equipment/maintenanceplan/save.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
$.post(ext.contextPath + "/equipment/maintenanceplan/saveEquipmentCard.do",{maintenanceplanid:data.id,ids:getids()},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(){
|
||||
$("#mids").val(getids());
|
||||
localStorage.setItem("mids",$("#mids").val());
|
||||
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++){
|
||||
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(){
|
||||
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:"300",
|
||||
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 : 'equipmentcardid', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '120', title : '设备名称', field : 'equipmentname', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '100', title : '设备型号', field : 'equipmentmodel', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '100', title : '设备类型', field : 'equipmentclass', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '100', title : '存放位置', field : 'geographyarea', sortable : true, editor:'textbox',halign:'center'}
|
||||
] ]
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<input id="mids" name="mids" type="hidden" value="" />
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th >保养计划类型</th>
|
||||
<td ><select id="plantype" name="plantype" class="easyui-combobox" data-options="panelHeight:'auto'">
|
||||
<option value="0">周计划</option>
|
||||
<option value="1">月计划</option>
|
||||
<option value="2">年计划</option>
|
||||
</select></td>
|
||||
<tr>
|
||||
<th>保养计划编号</th>
|
||||
<td><input name="plannumber" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>保养计划内容</th>
|
||||
<td><input name="plancontent" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>计划执行时间</th>
|
||||
<td><input id="plantime" name="plantime" class="Wdate"
|
||||
value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"readonly/>
|
||||
</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="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
176
bin/WebRoot/jsp/equipment/maintenancePlanEdit.jsp
Normal file
176
bin/WebRoot/jsp/equipment/maintenancePlanEdit.jsp
Normal file
@ -0,0 +1,176 @@
|
||||
<!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 getids(){
|
||||
var rows= $('#grid').datagrid("getRows");
|
||||
var ids="";
|
||||
$.each(rows, function(index, item){
|
||||
ids+=item.id+",";
|
||||
});
|
||||
ids=ids.replace(/,$/gi,"");
|
||||
return ids;
|
||||
}
|
||||
|
||||
function doupdate(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/equipment/maintenanceplan/update.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
$.post(ext.contextPath + "/equipment/maintenanceplan/saveEquipmentCard.do",{maintenanceplanid:data.id,ids:getids()},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(){
|
||||
$("#mids").val(getids());
|
||||
localStorage.setItem("mids",$("#mids").val());
|
||||
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++){
|
||||
$("#grid").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(){
|
||||
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:"300",
|
||||
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 : 'equipmentcardid', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '120', title : '设备名称', field : 'equipmentname', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '100', 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}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<input id="mids" name="mids" type="hidden" value="" />
|
||||
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${maintenanceplan.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>保养计划类型</th>
|
||||
<td>
|
||||
<select name="plantype" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
|
||||
<option value="0" <c:if test="${maintenanceplan.plantype=='0'}">selected</c:if>>周计划</option>
|
||||
<option value="1" <c:if test="${maintenanceplan.plantype=='1'}">selected</c:if>>月计划</option>
|
||||
<option value="2" <c:if test="${maintenanceplan.plantype=='2'}">selected</c:if>>年计划</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>保养计划编号</th>
|
||||
<td><input name="plannumber" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${maintenanceplan.plannumber}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>保养计划内容</th>
|
||||
<td><input name="plancontent" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${maintenanceplan.plancontent}" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>计划执行时间</th>
|
||||
<td><input id="plantime" name="plantime" class="Wdate"
|
||||
value="${fn:substring(maintenanceplan.plantime,0,10)}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})"readonly/>
|
||||
</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">${maintenanceplan.remark}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br/>
|
||||
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
275
bin/WebRoot/jsp/equipment/maintenancePlanList.jsp
Normal file
275
bin/WebRoot/jsp/equipment/maintenancePlanList.jsp
Normal file
@ -0,0 +1,275 @@
|
||||
<%@ 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();%>
|
||||
<%request.setAttribute("Flag_Weekplan",com.sipai.entity.equipment.MaintenancePlan.Flag_Weekplan);%>
|
||||
<%request.setAttribute("Flag_Monthplan",com.sipai.entity.equipment.MaintenancePlan.Flag_Monthplan);%>
|
||||
<%request.setAttribute("Flag_Yearplan",com.sipai.entity.equipment.MaintenancePlan.Flag_Yearplan);%>
|
||||
|
||||
|
||||
<!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 + '/equipment/maintenanceplan/add.do',
|
||||
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 + '/equipment/maintenanceplan/view.do?id=' + id
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑周保养计划',
|
||||
url : ext.contextPath + '/equipment/maintenanceplan/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doupdate(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/equipment/maintenanceplan/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info');
|
||||
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 + '/equipment/maintenanceplan/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 importFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择文件',
|
||||
width: 600,
|
||||
height:300,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/equipment/maintenanceplan/doimport.do',
|
||||
buttons : [ {
|
||||
text : '导入数据',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doimport(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
|
||||
var flag=0;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/maintenanceplan/getlist.do',
|
||||
queryParams: {
|
||||
search_plantype: $('#search_plantype').combobox('getValue'),
|
||||
},
|
||||
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 : 'plantype', sortable : true, halign:'center',formatter : function(value, row, index) {
|
||||
switch (value) {
|
||||
case '0':
|
||||
return '周计划';
|
||||
case '1':
|
||||
return '月计划';
|
||||
case '2':
|
||||
return '年计划';
|
||||
}
|
||||
}},
|
||||
{width : '120', title : '保养计划编号', field : 'plannumber', sortable : true, halign:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '220', title : '保养计划内容', field : 'plancontent', sortable : true, halign:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
|
||||
|
||||
{width : '140', title : '计划执行时间', field : 'plantime', sortable : true, align:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value.substring(5,19);
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
|
||||
|
||||
{width : '80', title : '备注', field : 'remark', sortable : true, halign:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
|
||||
|
||||
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.id+'\');"/>';
|
||||
<%if (sessionManager.havePermission(session,"material/materialinfo/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"material/materialinfo/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);
|
||||
},
|
||||
});
|
||||
/* <td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_save',plain:true" onclick="downFun();">模版下载</a></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true" onclick="importFun();">导入</a></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_go',plain:true" onclick="exportFun();">全部导出</a></td>
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_go',plain:true" onclick="exportByIdFun();">指定导出</a></td>*/
|
||||
});
|
||||
</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,"material/materialinfo/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,"material/materialinfo/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<td><div class="datagrid-btn-separator"></div></td>
|
||||
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true" onclick="importFun();">导入保养计划</a></td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<input id="id" name="pid" type="hidden" value="${maintenanceplan.id }" />
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td >保养计划类型</td>
|
||||
<td colspan='1'><select id="search_plantype" name="search_plantype" class="easyui-combobox" style="width:152px;">
|
||||
<option value='weekplan' select>周计划</option>
|
||||
<option value='monthplan'>月计划</option>
|
||||
<option value='yearplan'>年计划</option>
|
||||
|
||||
</select>
|
||||
</td>
|
||||
<td>保养计划编号</td>
|
||||
<td><input name="search_plannumber" class="easyui-textbox" /></td></tr>
|
||||
<tr>
|
||||
|
||||
<td>计划执行时间</td>
|
||||
<td><input id="plantime" name="plantime" class="Wdate" value="${maintenanceplan.plantime }"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'plantime\')}'})"
|
||||
readonly></td>
|
||||
<%-- <td>——</td>
|
||||
<td><input id="realtime" name="realtime" class="Wdate" value="${weekmaintenance.realtime }"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',minDate:'#F{$dp.$D(\'plantime\')}'})"
|
||||
readonly></td> --%>
|
||||
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton"
|
||||
data-options="iconCls:'ext-icon-search',plain:true"
|
||||
onclick="$('#pid').val('${maintenanceplan.id }');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>
|
||||
<!-- <a href="javascript:void(0);" class="easyui-linkbutton" -->
|
||||
<!-- data-options="iconCls:'ext-icon-search',plain:true" -->
|
||||
<!-- onclick="$('#searchForm').form('clear');ddvpid='';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>
|
||||
141
bin/WebRoot/jsp/equipment/maintenancePlanListForSelects.jsp
Normal file
141
bin/WebRoot/jsp/equipment/maintenancePlanListForSelects.jsp
Normal file
@ -0,0 +1,141 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" 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 selectFun(dialog, grid) {
|
||||
var rows= grid.datagrid("getRows");
|
||||
//复制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]));
|
||||
});
|
||||
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
if(datas !=""){
|
||||
datas+=",";
|
||||
}
|
||||
datas += '{"id":"'+item.id +'","plantype":"'+item.plantype +'",'+
|
||||
'"plannumber":"'+item.plannumber +'","plancontent":"'+item.plancontent +'",'+
|
||||
'"condition":"'+item.condition +'","plantime":"'+item.plantime +'","realtime":"'+item.realtime
|
||||
+'","behaviordescription":"'+item.behaviordescription +'","performer":"'+item.performer +'","remark":"'+item.remark +'"}';
|
||||
|
||||
});
|
||||
datas="["+datas+"]";
|
||||
|
||||
return datas;//$.parseJSON(datas);
|
||||
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/maintenanceplan/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 : '80', title : '保养计划类型', field : 'plantype', sortable : true, halign:'center'},
|
||||
{width : '100', title : '保养计划编号', field : 'plannumber', sortable : true, halign:'center'},
|
||||
{width : '100', title : '保养计划内容', field: 'plancontent', sortable : true, halign:'center'},
|
||||
{width : '80', title : '状态', field : 'condition', sortable : true, halign:'center'},
|
||||
{width : '100', title : '计划执行时间', field : 'plantime', sortable : true, halign:'center'},
|
||||
{width : '100', title : '实际执行时间', field: 'realtime', sortable : true, halign:'center'},
|
||||
{width : '50', title : '执行描述', field: 'behaviordescription', sortable : true, halign:'center'},
|
||||
{width : '50', title : '执行者', field: 'performer', sortable : true, halign:'center'},
|
||||
{width : '80', title : '备注', field : 'remark', sortable : true, halign:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
/* var mids = parent.$("#${param.iframeId}")[0].contentWindow.$("#mids").val().split(",");
|
||||
$.each(mids, function(index, item){
|
||||
if(item != ""){
|
||||
$('#grid').datagrid("checkRow",$('#grid').datagrid("getRowIndex",item)); */
|
||||
var ids = localStorage.getItem("ids").split(",");
|
||||
|
||||
localStorage.removeItem("ids");
|
||||
|
||||
$.each(ids, function(index, item){
|
||||
if(item != ""){
|
||||
$('#grid').datagrid("checkRow",$('#grid').datagrid("getRowIndex",item));
|
||||
}
|
||||
});
|
||||
//$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
//});
|
||||
//}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
var dosave = function(dialog,parentWin) {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
if(checkedItems==""){
|
||||
top.$.messager.alert('提示', '请选择保养计划','info');
|
||||
}else{
|
||||
|
||||
var res=JSON.stringify(checkedItems);
|
||||
$.post(ext.contextPath + '/equipment/maintenancerecord/save.do', {ids:getids()} , 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">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<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>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
181
bin/WebRoot/jsp/equipment/maintenancePlanView.jsp
Normal file
181
bin/WebRoot/jsp/equipment/maintenancePlanView.jsp
Normal file
@ -0,0 +1,181 @@
|
||||
<!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 getids(){
|
||||
var rows= $('#grid').datagrid("getRows");
|
||||
var ids="";
|
||||
$.each(rows, function(index, item){
|
||||
ids+=item.id+",";
|
||||
});
|
||||
ids=ids.replace(/,$/gi,"");
|
||||
return ids;
|
||||
}
|
||||
|
||||
/* function doupdate(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/equipment/maintenanceplan/update.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
$.post(ext.contextPath + "/equipment/maintenanceplan/saveEquipmentCard.do",{maintenanceplanid:data.id,ids:getids()},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(){
|
||||
$("#qids").val(getids());
|
||||
|
||||
localStorage.setItem("qids",$("#qids").val());
|
||||
//清除旧数据
|
||||
var qrows= grid.datagrid("getRows");
|
||||
//复制rows,否则deleteRow的index会出错
|
||||
var copyRows = [];
|
||||
for ( var i= 0; i < qrows.length; i++) {
|
||||
copyRows.push(qrows[i]);
|
||||
}
|
||||
$.each(copyRows, function(index, item){
|
||||
grid.datagrid('deleteRow', grid.datagrid('getRowIndex',copyRows[index]));
|
||||
});
|
||||
*/
|
||||
/* var dialog = parent.ext.modalDialog({
|
||||
title : '添加设备',
|
||||
height:500,
|
||||
url : ext.contextPath + '/equipment/showEquipmentCardForSelects.do?iframeId=lineEdit',
|
||||
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(){
|
||||
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:"350",
|
||||
title: '相关设备',
|
||||
|
||||
});
|
||||
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
|
||||
{width : '100', title : '设备编号', field : 'equipmentcardid', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '120', title : '设备名称', field : 'equipmentname', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '100', 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}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" name="id" value="${maintenanceplan.id }"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>保养计划类型</th>
|
||||
<td> <c:if test="${maintenanceplan.plantype=='0'}">周计划</c:if>
|
||||
<c:if test="${maintenanceplan.plantype=='1'}">月计划</c:if>
|
||||
<c:if test="${maintenanceplan.plantype=='2'}">年计划</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>保养计划编号</th>
|
||||
<td>${maintenanceplan.plannumber }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>保养计划内容</th>
|
||||
<td>${maintenanceplan.plancontent }</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>计划执行时间</th>
|
||||
<td>${fn:substring(maintenanceplan.plantime,5,10)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td>${maintenanceplan.remark}</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
|
||||
</br>
|
||||
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
195
bin/WebRoot/jsp/equipment/maintenanceRecordAdd.jsp
Normal file
195
bin/WebRoot/jsp/equipment/maintenanceRecordAdd.jsp
Normal file
@ -0,0 +1,195 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" 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 getids(){
|
||||
var rows= $('#grid').datagrid("getRows");
|
||||
var ids="";
|
||||
$.each(rows, function(index, item){
|
||||
ids+=item.id+",";
|
||||
});
|
||||
ids=ids.replace(/,$/gi,"");
|
||||
return ids;
|
||||
}
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/maintenancerecord/getlist.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '80', title : '保养计划类型', field : 'plantype', sortable : true, halign:'center'},
|
||||
{width : '100', title : '保养计划编号', field : 'plannumber', sortable : true, halign:'center'},
|
||||
{width : '100', title : '保养计划内容', field: 'plancontent', sortable : true, halign:'center'},
|
||||
{width : '80', title : '状态', field : 'condition', sortable : true, halign:'center'},
|
||||
{width : '100', title : '计划执行时间', field : 'plantime', sortable : true, halign:'center'},
|
||||
{width : '100', title : '实际执行时间', field: 'realtime', sortable : true, halign:'center'},
|
||||
{width : '50', title : '执行描述', field: 'behaviordescription', sortable : true, halign:'center'},
|
||||
{width : '50', title : '执行者', field: 'performer', sortable : true, halign:'center'},
|
||||
{width : '80', title : '备注', field : 'remark', sortable : true, halign:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
var ids = localStorage.getItem("ids").split(",");
|
||||
|
||||
localStorage.removeItem("ids");
|
||||
|
||||
$.each(ids, function(index, item){
|
||||
if(item != ""){
|
||||
$('#grid').datagrid("checkRow",$('#grid').datagrid("getRowIndex",item));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}); */
|
||||
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/equipment/maintenancerecord/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');
|
||||
}
|
||||
}
|
||||
/* var addFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加保养计划',
|
||||
height:500,
|
||||
url : ext.contextPath + '/equipment/maintenancerecord/showMaintenancePlanForSelects.do?',
|
||||
buttons : [ {
|
||||
iconCls:'icon-ok',
|
||||
text : '确定',
|
||||
handler : function() {
|
||||
var data = dialog.find('iframe').get(0).contentWindow.selectFun(dialog, grid);
|
||||
var datas= $.parseJSON(data);alert(datas)
|
||||
if(datas.length>0){
|
||||
for(var i=0;i<datas.length;i++){
|
||||
grid.datagrid('appendRow',{
|
||||
id:datas[i].id,
|
||||
plantype:datas[i].plantype,
|
||||
plannumber:datas[i].plannumber,
|
||||
plancontent:datas[i].plancontent,
|
||||
condition:datas[i].condition,
|
||||
plantime:datas[i].plantime,
|
||||
realtime:datas[i].realtime,
|
||||
behaviordescription:datas[i].behaviordescription,
|
||||
performer:datas[i].performer,
|
||||
remark:datas[i].remark
|
||||
});
|
||||
}
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var delectFun=function(){
|
||||
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]));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
} */
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>保养计划类型</th>
|
||||
<td>
|
||||
<select name="plantype" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
|
||||
<option value="0" selected >周计划</option>
|
||||
<option value="1">月计划</option>
|
||||
<option value="2">年计划</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>保养计划编号</th>
|
||||
<td><input name="plannumber" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>保养计划内容</th>
|
||||
<td><input name="plancontent" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<th>状态</th>
|
||||
<td><select name="condition" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
|
||||
<option value="0" >未执行</option>
|
||||
<option value="1">执行完毕</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<th>计划执行时间</th>
|
||||
<td><input id="plantime" name="plantime" class="Wdate" data-options="required:true,validType:'isBlank'" value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>实际执行时间</th>
|
||||
<td><input id="realtime" name="realtime" class="Wdate" data-options="required:true,validType:'isBlank'" value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>执行描述</th>
|
||||
<td><input id="behaviordescription" name="behaviordescription" class='easyui-textbox' value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>执行者</th>
|
||||
<td><input id="performer" name="performer" class="easyui-textbox" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td><input name="remark" class="easyi-textbox" style="overflow:auto; width:100%;height:100px" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<div id="p">
|
||||
<table id="grid" data-options=" boder:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
102
bin/WebRoot/jsp/equipment/maintenanceRecordEdit.jsp
Normal file
102
bin/WebRoot/jsp/equipment/maintenanceRecordEdit.jsp
Normal file
@ -0,0 +1,102 @@
|
||||
<!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 doupdate(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/equipment/maintenancerecord/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 if (data.res==2){
|
||||
top.$.messager.alert('', "实际执行时间有误!",'info', function() {
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
}else{
|
||||
top.$.messager.alert('提示', data.res, 'info');
|
||||
}
|
||||
},'json');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<input id="mids" name="mids" type="hidden" value="" />
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${maintenanceRecord.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>保养计划类型</th>
|
||||
<td>
|
||||
<select name="plantype" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
|
||||
<option value="0" <c:if test="${maintenanceRecord.plantype=='0'}">selected</c:if>>周计划</option>
|
||||
<option value="1" <c:if test="${maintenanceRecord.plantype=='1'}">selected</c:if>>月计划</option>
|
||||
<option value="2" <c:if test="${maintenanceRecord.plantype=='2'}">selected</c:if>>年计划</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>保养计划编号</th>
|
||||
<td><input name="plannumber" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${maintenanceRecord.plannumber}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>保养计划内容</th>
|
||||
<td><input name="plancontent" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="${maintenanceRecord.plancontent}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<%-- <tr>
|
||||
<th>状态</th>
|
||||
<td><sel name="condition" class="easyui-combobox" data-options="panelHeight:'auto',editable:false">
|
||||
<option value="0" <c:if test="${maintenanceRecord.condition=='0'}">selected</c:if>>未执行</option>
|
||||
<option value="1" <c:if test="${maintenanceRecord.condition=='1'}">selected</c:if>>执行完毕</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr> --%>
|
||||
<tr>
|
||||
<th>计划执行时间</th>
|
||||
<td><input id="plantime" name="plantime" class="Wdate" data-options="required:true,validType:'isBlank'" value="${maintenanceRecord.plantime}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>实际执行时间</th>
|
||||
<td><input id="realtime" name="realtime" class="Wdate" data-options="required:true,validType:'isBlank'" value="${maintenanceRecord.realtime}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>执行描述</th>
|
||||
<td><input id="behaviordescription" name="behaviordescription" class='easyui-textbox' value="${maintenanceRecord.behaviordescription}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>执行者</th>
|
||||
<td><input id="performer" name="performer" class='easyui-textbox' value="${maintenanceRecord.performer}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td><input id="remark" name="remark" class="easyi-textbox" style="overflow:auto; width:100%;height:100px" value="${maintenanceRecord.remark}"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
324
bin/WebRoot/jsp/equipment/maintenanceRecordList.jsp
Normal file
324
bin/WebRoot/jsp/equipment/maintenanceRecordList.jsp
Normal file
@ -0,0 +1,324 @@
|
||||
<%@ 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();%>
|
||||
<%request.setAttribute("Flag_Weekplan",com.sipai.entity.equipment.MaintenanceRecord.Flag_Weekplan);%>
|
||||
<%request.setAttribute("Flag_Monthplan",com.sipai.entity.equipment.MaintenanceRecord.Flag_Monthplan);%>
|
||||
<%request.setAttribute("Flag_Yearplan",com.sipai.entity.equipment.MaintenanceRecord.Flag_Yearplan);%>
|
||||
|
||||
<%request.setAttribute("Flag_Nimplemented",com.sipai.entity.equipment.MaintenanceRecord.Flag_Nimplemented);%>
|
||||
<%request.setAttribute("Flag_Yimplemented",com.sipai.entity.equipment.MaintenanceRecord.Flag_Yimplemented);%>
|
||||
|
||||
<!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:"",
|
||||
url : ext.contextPath + '/equipment/maintenancerecord/add.do',
|
||||
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 + '/equipment/maintenancerecord/view.do?id=' + id
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑周保养计划',
|
||||
url : ext.contextPath + '/equipment/maintenancerecord/edit.do?id=' + id,
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doupdate(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
|
||||
var deleteFun = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/equipment/maintenancerecord/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info');
|
||||
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 + '/equipment/maintenancerecord/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 synchroFun = function() {
|
||||
parent.$.messager.confirm('提示', '您确定要同步保养计划?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/equipment/maintenancerecord/synchroMaintenancePlan.do', "" , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','同步成功','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else if(data==0){
|
||||
parent.$.messager.alert('提示','无可更新数据','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else {
|
||||
parent.$.messager.alert('提示','更新失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/equipment/maintenancerecord/getlist.do',
|
||||
queryParams: {
|
||||
search_plantype: $('#search_plantype').combobox('getValue'),
|
||||
},
|
||||
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 : 'plantype', sortable : true, halign:'center',formatter : function(value, row, index) {
|
||||
switch (value) {
|
||||
case '0':
|
||||
return '周计划';
|
||||
case '1':
|
||||
return '月计划';
|
||||
case '2':
|
||||
return '年计划';
|
||||
}
|
||||
}},
|
||||
{width : '120', title : '保养计划编号', field : 'plannumber', sortable : true, halign:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '220', title : '保养计划内容', field : 'plancontent', sortable : true, halign:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '100', title : '状态', field : 'condition', sortable : true, halign:'center',formatter : function(value, row, index) {
|
||||
switch (value) {
|
||||
case '0':
|
||||
return '未执行';
|
||||
case '1':
|
||||
return '执行完毕';
|
||||
|
||||
}
|
||||
}},
|
||||
{width : '140', title : '计划执行时间', field : 'plantime', sortable : true, align:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value.substring(0,10);
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '140', title : '实际执行时间', field : 'realtime', sortable : true, align:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value.substring(0,10);
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '140', title : '执行描述', field : 'behaviordescription', sortable : true, align:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '140', title : '执行者', field : 'performer', sortable : true, align:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{width : '80', title : '备注', field : 'remark', sortable : true, halign:'center', formatter : function(value, row){
|
||||
if(value!=null){
|
||||
return value;
|
||||
}else{
|
||||
return "";
|
||||
}
|
||||
}},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.id+'\');"/>';
|
||||
<%if (sessionManager.havePermission(session,"equipment/maintenancerecord/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"equipment/maintenancerecord/delete.do")) {%>
|
||||
if(row.c_judge1!="1"){
|
||||
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);
|
||||
},
|
||||
rowStyler:function(index,row) {
|
||||
// console.log("condition",row.condition);
|
||||
|
||||
if (row.condition=="0"&&row.c_judge=="0"){
|
||||
return 'background-color:red;' ;
|
||||
}
|
||||
if (row.condition=="0"){
|
||||
return 'background-color:white;' ;
|
||||
}
|
||||
if (row.condition=="1"){
|
||||
return 'background-color:gray;color:white' ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body class="easyui-layout" data-options="fit:true,border:false">
|
||||
<div id="toolbar" style="display: none;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
(白色未执行,灰色执行完毕,红色过期未执行。
|
||||
同步数据无删除操作) </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
<tr>
|
||||
<%-- <%if (sessionManager.havePermission(session,"material/materialinfo/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,"material/materialinfo/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-add',plain:true"
|
||||
onclick="synchroFun();">数据同步</a>
|
||||
</td>
|
||||
<%-- <%}%> --%>
|
||||
<td><div class="datagrid-btn-separator"></div></td>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td >保养计划类型</td>
|
||||
<td colspan='1'><select id="search_plantype" name="search_plantype" class="easyui-combobox" style="width:152px;">
|
||||
<option value='weekplan' select>周计划</option>
|
||||
<option value='monthplan'>月计划</option>
|
||||
<option value='yearplan'>年计划</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td>保养计划编号</td>
|
||||
<td><input name="search_plannumber" class="easyui-textbox" /></td></tr>
|
||||
<tr>
|
||||
|
||||
<td>计划执行时间</td>
|
||||
<td><input id="plantime" name="plantime" class="Wdate" value="${maintenancerecord.plantime }"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'plantime\')}'})"
|
||||
readonly></td>
|
||||
<%-- <td>——</td>
|
||||
<td><input id="realtime" name="realtime" class="Wdate" value="${weekmaintenance.realtime }"
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',minDate:'#F{$dp.$D(\'plantime\')}'})"
|
||||
readonly></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>
|
||||
72
bin/WebRoot/jsp/equipment/maintenanceRecordView.jsp
Normal file
72
bin/WebRoot/jsp/equipment/maintenanceRecordView.jsp
Normal file
@ -0,0 +1,72 @@
|
||||
<!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">
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<input id="mids" name="mids" type="hidden" value="" />
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${maintenanceRecord.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>保养计划类型</th>
|
||||
<td>
|
||||
<c:if test="${maintenanceRecord.plantype=='0'}">周计划</c:if>
|
||||
<c:if test="${maintenanceRecord.plantype=='1'}">月计划</c:if>
|
||||
<c:if test="${maintenanceRecord.plantype=='2'}">年计划</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>保养计划编号</th>
|
||||
<td>${maintenanceRecord.plannumber}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>保养计划内容</th>
|
||||
<td>${maintenanceRecord.plancontent}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>状态</th>
|
||||
<td>
|
||||
<c:if test="${maintenanceRecord.condition=='0'}">未执行</c:if>
|
||||
<c:if test="${maintenanceRecord.condition=='1'}">执行完毕</c:if>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>计划执行时间</th>
|
||||
<td>${maintenanceRecord.plantime}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>实际执行时间</th>
|
||||
<td>${maintenanceRecord.realtime}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>执行描述</th>
|
||||
<td>${maintenanceRecord.behaviordescription}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>执行者</th>
|
||||
<td>${maintenanceRecord.performer}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td>${maintenanceRecord.remark}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<div id="p">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
111
bin/WebRoot/jsp/equipment/maintenancemanForSelect.jsp
Normal file
111
bin/WebRoot/jsp/equipment/maintenancemanForSelect.jsp
Normal file
@ -0,0 +1,111 @@
|
||||
<%@ 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+'","name":"'+item.name +'"}';
|
||||
});
|
||||
return $.parseJSON(datas);
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/user/getUsers.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 : 'name', sortable : true, halign:'center'},
|
||||
{width : '80', title : '姓名', field : 'caption', sortable : true, halign:'center'},
|
||||
{width : '180', title : '部门', field : '_pname', sortable : true, halign:'center'},
|
||||
{width : '50', title : '性别', field : 'sex', sortable : true, halign:'center', align:'center', formatter : function(value, row, index) {
|
||||
switch (value) {
|
||||
case '0':
|
||||
return '女';
|
||||
case '1':
|
||||
return '男';
|
||||
}
|
||||
}
|
||||
}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess:function(data){
|
||||
if(data){
|
||||
$.each(data.rows, function(index, item){
|
||||
$.each(eval('${json}'), function(index1, item1){
|
||||
if(item.id==item1.empid){
|
||||
$('#grid').datagrid('checkRow', index);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#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>
|
||||
<tr>
|
||||
<td>登录名</td>
|
||||
<td><input name="search_name" class="easyui-textbox" style="width: 180px;" /></td>
|
||||
<td>姓名</td>
|
||||
<td><input name="search_caption" class="easyui-textbox" style="width: 180px;" /></td>
|
||||
<td>性别</td>
|
||||
<td><select name="search_sex" class="easyui-combobox" style="width:100px;" data-options="panelHeight:'auto',editable:false">
|
||||
<option value="">请选择</option>
|
||||
<option value="1">男</option>
|
||||
<option value="0">女</option></select>
|
||||
</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>
|
||||
86
bin/WebRoot/jsp/inc.jsp
Normal file
86
bin/WebRoot/jsp/inc.jsp
Normal file
@ -0,0 +1,86 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="java.util.Map"%>
|
||||
<%@ page import="java.util.HashMap"%>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/>
|
||||
<meta http-equiv="pragma" content="no-cache"/>
|
||||
<meta http-equiv="cache-control" content="no-cache"/>
|
||||
<meta http-equiv="expires" content="0"/>
|
||||
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<%String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath();%>
|
||||
|
||||
<%
|
||||
Map<String, Cookie> cookieMap = new HashMap<String, Cookie>();
|
||||
Cookie[] cookies = request.getCookies();
|
||||
if (null != cookies) {
|
||||
for (Cookie cookie : cookies) {
|
||||
cookieMap.put(cookie.getName(), cookie);
|
||||
}
|
||||
}
|
||||
String easyuiTheme = "default";//指定如果用户未选择样式,那么初始化一个默认样式
|
||||
if (cookieMap.containsKey("easyuiTheme")) {
|
||||
Cookie cookie = (Cookie) cookieMap.get("easyuiTheme");
|
||||
easyuiTheme = cookie.getValue();
|
||||
}
|
||||
%>
|
||||
|
||||
<script type="text/javascript">
|
||||
var ext = ext || {};
|
||||
ext.contextPath = '<%=contextPath%>';
|
||||
ext.basePath = '<%=basePath%>';
|
||||
ext.pixel_0 = '<%=contextPath%>/IMG/pixel_0.gif';//0像素的背景,一般用于占位
|
||||
</script>
|
||||
|
||||
<%-- 引入jQuery --%>
|
||||
<script type="text/javascript" src="<%=contextPath%>/JS/jquery-easyui-1.4.5/jquery.min.js" charset="utf-8"></script>
|
||||
<%-- 引入jquery扩展 --%>
|
||||
<script type="text/javascript" src="<%=contextPath%>/JS/extJquery.js" charset="utf-8"></script>
|
||||
<%-- 引入js --%>
|
||||
<%-- <script type="text/javascript" src="<%=contextPath%>/JS/jquery.jqprint-0.3.js" charset="utf-8"></script> --%>
|
||||
<%-- 引入EasyUI --%>
|
||||
<link id="easyuiTheme" rel="stylesheet" href="<%=contextPath%>/JS/jquery-easyui-1.4.5/themes/<%=easyuiTheme%>/easyui.css" type="text/css">
|
||||
<link rel="stylesheet" href="<%=contextPath%>/JS/jquery-easyui-1.4.5/themes/icon.css" type="text/css">
|
||||
<script type="text/javascript" src="<%=contextPath%>/JS/jquery-easyui-1.4.5/jquery.easyui.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=contextPath%>/JS/jquery-easyui-1.4.5/locale/easyui-lang-zh_CN.js" charset="utf-8"></script>
|
||||
<%-- 引入easyui扩展 --%>
|
||||
<script src="<%=contextPath%>/JS/extEasyUI.js" type="text/javascript" charset="utf-8"></script>
|
||||
|
||||
<%-- 引入easyui扩展detailview --%>
|
||||
<script src="<%=contextPath%>/JS/jquery-easyui-datagridview/datagrid-detailview.js" type="text/javascript" charset="utf-8"></script>
|
||||
|
||||
<%-- 引入easyui扩展detail-dnd --%>
|
||||
<script type="text/javascript" src="<%=contextPath%>/JS/jquery-easyui-datagrid-dnd/datagrid-dnd.js"></script>
|
||||
|
||||
<%-- 引入my97日期时间控件 --%>
|
||||
<script type="text/javascript" src="<%=contextPath%>/JS/My97DatePicker/WdatePicker.js" charset="utf-8"></script>
|
||||
|
||||
<%-- 引入ueditor控件 --%>
|
||||
<script type="text/javascript" charset="utf-8">window.UEDITOR_HOME_URL = '<%=contextPath%>/JS/ueditor1_4_2-utf8-jsp/';</script>
|
||||
<script src="<%=contextPath%>/JS/ueditor1_4_2-utf8-jsp/ueditor.config.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="<%=contextPath%>/JS/ueditor1_4_2-utf8-jsp/ueditor.all.min.js" type="text/javascript" charset="utf-8"></script>
|
||||
|
||||
<%-- 引入Highcharts --%>
|
||||
<script src="<%=contextPath%>/JS/Highcharts-3.0.6/js/highcharts.js" type="text/javascript" charset="utf-8"></script>
|
||||
<script src="<%=contextPath%>/JS/Highcharts-3.0.6/js/modules/exporting.js" type="text/javascript" charset="utf-8"></script>
|
||||
|
||||
<%-- 引入webuploader-0.1.5 --%>
|
||||
<link rel="stylesheet" type="text/css" href="<%=contextPath%>/JS/webuploader-0.1.5/webuploader.css">
|
||||
<script type="text/javascript" src="<%=contextPath%>/JS/webuploader-0.1.5/webuploader.js"></script>
|
||||
|
||||
<%-- 引入扩展图标 --%>
|
||||
<link rel="stylesheet" href="<%=contextPath%>/CSS/extIcon.css" type="text/css">
|
||||
|
||||
<%-- 引入CSS --%>
|
||||
<link rel="stylesheet" href="<%=contextPath%>/CSS/comm.css" type="text/css">
|
||||
|
||||
<%-- 引入js --%>
|
||||
<script type="text/javascript" src="<%=contextPath%>/JS/comm.js" charset="utf-8"></script>
|
||||
|
||||
<%-- 引入二维码 --%>
|
||||
<script type="text/javascript" src="<%=contextPath%>/JS/qrcode/jquery.qrcode.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="<%=contextPath%>/JS/qrcode/qrcode.js" charset="utf-8"></script>
|
||||
<%-- 引入一维码 --%>
|
||||
<link rel="stylesheet" type="text/css" href="<%=contextPath%>/JS/barcode/barcode.css" charset="utf-8">
|
||||
<script type="text/javascript" src="<%=contextPath%>/JS/barcode/barcode.js" charset="utf-8"></script>
|
||||
262
bin/WebRoot/jsp/login.jsp
Normal file
262
bin/WebRoot/jsp/login.jsp
Normal file
@ -0,0 +1,262 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%
|
||||
String contextPath = request.getContextPath();
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<jsp:include page="inc.jsp"></jsp:include>
|
||||
<link id="easyuiTheme" rel="stylesheet" href="<%=contextPath%>/JS/jquery-easyui-1.4.5/themes/metro/easyui.css" type="text/css">
|
||||
<LINK href="IMG/logo.ico" type="image/x-icon" rel="icon"/>
|
||||
<LINK href="IMG/logo.ico" type="image/x-icon" rel="shortcut icon"/>
|
||||
<style>
|
||||
.table tr{
|
||||
height:32px
|
||||
}
|
||||
.table input{
|
||||
height:22px
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function init(){
|
||||
$("#j_username").val(getCookie("j_username"));
|
||||
$("#j_password").val(getCookie("j_password"));
|
||||
$('.loginbg').height($(window).height());
|
||||
$('input').css({"width":"194px","border":"1px solid #d5d5d5"});
|
||||
}
|
||||
|
||||
function validateForm(loginTabIndex){
|
||||
if(loginTabIndex == 0){
|
||||
if($("#j_username").val()==''){
|
||||
$.messager.alert("提示","请输入用户名","info",function(){
|
||||
$("#j_username").focus();
|
||||
return false;
|
||||
});
|
||||
}else if($("#j_password").val()==''){
|
||||
$.messager.alert("提示","请输入密码","info",function(){
|
||||
$("#j_password").focus();
|
||||
return false;
|
||||
});
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}else if(loginTabIndex == 1){
|
||||
if($("#j_cardid").val()==''){
|
||||
$.messager.alert("提示","请刷卡登录","info",function(){
|
||||
$("#j_cardid").focus();
|
||||
return false;
|
||||
});
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var loginFun;
|
||||
$(function() {
|
||||
init();
|
||||
|
||||
loginFun = function() {
|
||||
var loginTabs = $('#loginTabs').tabs('getSelected');//当前选中的tab
|
||||
var loginTabIndex = $('#loginTabs').tabs('getTabIndex',loginTabs);//当前tab序号
|
||||
var $form = loginTabs.find('form');//选中的tab里面的form
|
||||
if (validateForm(loginTabIndex)) {//判断不为空
|
||||
$.post(ext.contextPath+"/j_spring_security_check",$form.serialize(), function(result) {
|
||||
delCookie("j_username");
|
||||
delCookie("j_password");
|
||||
console.info(result)
|
||||
if (result=="true") {
|
||||
if(loginTabIndex==0){
|
||||
setCookie("j_username",$("#j_username").val());
|
||||
setCookie("j_password",$("#j_password").val());
|
||||
}
|
||||
location.replace(ext.contextPath);
|
||||
} else {
|
||||
if(loginTabIndex==0){
|
||||
$.messager.alert('提示',"用户名或密码错误", 'error');
|
||||
}else if(loginTabIndex==1){
|
||||
$.messager.alert('提示',"卡号错误", 'error');
|
||||
}
|
||||
}
|
||||
}, "json");
|
||||
}
|
||||
};
|
||||
|
||||
$('#loginDialog').show().dialog({
|
||||
modal : false,
|
||||
closable : false,
|
||||
shadow:false,
|
||||
title:"系统登录",
|
||||
buttons : [ {
|
||||
id : 'loginBtn',
|
||||
text : ' 登 录 ',
|
||||
width:80,
|
||||
handler : function() {
|
||||
loginFun();
|
||||
}
|
||||
} ],
|
||||
onOpen : function() {
|
||||
$('form :input:first').focus();
|
||||
$('form :input').keyup(function(event) {
|
||||
if ($(this).val() !='' && event.keyCode == 13) {
|
||||
loginFun();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#loginTabs').tabs({
|
||||
onSelect:function(title,index){
|
||||
var loginTabs = $('#loginTabs').tabs('getSelected');
|
||||
loginTabs.find('form :input:first').focus();
|
||||
}
|
||||
});
|
||||
$.post(ext.contextPath+"/Login/doScanApk.do",{ng:'',type:'phone'}, function(result) {
|
||||
var filename = result.res;
|
||||
var qrcode = $('#qrcodeTable1').qrcode({
|
||||
render : "canvas",
|
||||
width : 70, //设置宽度
|
||||
height : 70, //设置高度
|
||||
typeNumber : -1, //计算模式
|
||||
correctLevel : QRErrorCorrectLevel.H,//纠错等级
|
||||
background : "#ffffff",//背景颜色
|
||||
foreground : "#000000", //前景颜色
|
||||
text : filename
|
||||
});
|
||||
var canvas=qrcode.find('canvas').get(0);
|
||||
$('#qrcodeTable1').tooltip({
|
||||
content: "<img src='"+canvas.toDataURL('image/jpg')+"' style='width:110px;height:110px;'></img>"
|
||||
});
|
||||
$('#qrcodeTable1_phone').text("安卓手机");
|
||||
$('#qrcodeTable1_phone').attr('href',filename);
|
||||
}, "json");
|
||||
|
||||
$.post(ext.contextPath+"/Login/doScanApk.do",{ng:'',type:'tv'}, function(result) {
|
||||
var filename = result.res;
|
||||
var qrcode = $('#qrcodeTable2').qrcode({
|
||||
render : "canvas",
|
||||
width : 70, //设置宽度
|
||||
height : 70, //设置高度
|
||||
typeNumber : -1, //计算模式
|
||||
correctLevel : QRErrorCorrectLevel.H,//纠错等级
|
||||
background : "#ffffff",//背景颜色
|
||||
foreground : "#000000", //前景颜色
|
||||
text : filename
|
||||
});
|
||||
var canvas=qrcode.find('canvas').get(0);
|
||||
$('#qrcodeTable2').tooltip({
|
||||
content: "<img src='"+canvas.toDataURL('image/jpg')+"' style='width:110px;height:110px;'></img>"
|
||||
});
|
||||
$('#qrcodeTable2_tv').text("安卓TV");
|
||||
$('#qrcodeTable2_tv').attr('href',filename);
|
||||
}, "json");
|
||||
});
|
||||
|
||||
//写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();
|
||||
}
|
||||
//二维码转格式
|
||||
function utf16to8(str) {
|
||||
var out, i, len, c;
|
||||
out = "";
|
||||
len = str.length;
|
||||
for (i = 0; i < len; i++) {
|
||||
c = str.charCodeAt(i);
|
||||
if ((c >= 0x0001) && (c <= 0x007F)) {
|
||||
out += str.charAt(i);
|
||||
} else if (c > 0x07FF) {
|
||||
out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
|
||||
out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
|
||||
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
|
||||
} else {
|
||||
out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
|
||||
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="loginbg">
|
||||
<div style="background: url('<%=contextPath%>/IMG/login/sipai.png') no-repeat; background-position:center;background-color:#ffffff;height:140px;width:100%;">
|
||||
<div style="display:block;text-align:left; width:80%;float:left;">
|
||||
</br>
|
||||
</div>
|
||||
<div style="display:block;text-align:center;width:7%;float:left;margin:28px 0 0 0;">
|
||||
<div style="display:block;">
|
||||
<div id="qrcodeTable1" style="display:block;cursor: pointer;"></div>
|
||||
<a id="qrcodeTable1_phone" href="javascript:void(0)" onclick="openWin(3,this)" style="display:block;height:10px;font-size:12px;text-align:center;"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display:block;text-align:center; width:2%;float:left;">
|
||||
</br>
|
||||
</div>
|
||||
<div style="display:block;text-align:center; width:7%;float:left;margin:28px 20px 0 0;">
|
||||
<div id="qrcodeTable2" style="display:block;cursor: pointer;"></div>
|
||||
<a id="qrcodeTable2_tv" href="javascript:void(0)" onclick="openWin(3,this)" style="display:block;height:10px;font-size:12px;text-align:center;"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div style="background: url('<%=contextPath%>/IMG/login/title.png') no-repeat; background-position:center;height:180px;width:100%;">
|
||||
</div>
|
||||
<div style="position:absolute;bottom:0px;text-align:center;background-color:#ffffff;width:100%;line-height:50px;height:130px;">
|
||||
|
||||
</div>
|
||||
|
||||
<div id="loginDialog" style="width: 320px; height: 180px; overflow: hidden;">
|
||||
<div id="loginTabs" class="easyui-tabs" data-options="fit:true,border:false">
|
||||
<div title="用户登录" style="overflow: hidden; padding: 5px;">
|
||||
<form method="post" class="form" onSubmit="return false;">
|
||||
<table class="table" style="width: 100%">
|
||||
<tr>
|
||||
<th style="text-align:center;width:80px">用户名</th>
|
||||
<td style="text-align:center">
|
||||
<input id="j_username" name="j_username"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="text-align:center">密 码</th>
|
||||
<td style="text-align:center">
|
||||
<input id="j_password" name="j_password" type="password"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<div title="卡号登录" style="overflow: hidden; padding: 5px;">
|
||||
<form method="post" class="form" onSubmit="return false;">
|
||||
<table class="table" style="width: 100%">
|
||||
<tr>
|
||||
<th style="text-align:center;width:80px">卡号</th>
|
||||
<td style="text-align:center">
|
||||
<input id="j_cardid" name="j_cardid" type="password"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
195
bin/WebRoot/jsp/main.jsp
Normal file
195
bin/WebRoot/jsp/main.jsp
Normal file
@ -0,0 +1,195 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.sipai.tools.SessionManager"%>
|
||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||||
<%
|
||||
SessionManager sessionManager = new SessionManager();
|
||||
%>
|
||||
<%String contextPath = request.getContextPath();%>
|
||||
<html>
|
||||
<head>
|
||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
||||
<jsp:include page="inc.jsp"></jsp:include>
|
||||
<LINK href="IMG/logo.ico" type="image/x-icon" rel="icon"/>
|
||||
<LINK href="IMG/logo.ico" type="image/x-icon" rel="shortcut icon"/>
|
||||
<script src="<%=contextPath%>/JS/reconnecting-websocket.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
var mainMenu;
|
||||
var mainTabs;
|
||||
var restartDialog;
|
||||
var websocket = null;
|
||||
//判断当前浏览器是否支持WebSocket
|
||||
if ('WebSocket' in window) {
|
||||
websocket = new ReconnectingWebSocket(ext.basePath.replace("http","ws")+"/msgWebSocket/${cu.id}");
|
||||
}
|
||||
else {
|
||||
alert('当前浏览器 Not support websocket')
|
||||
}
|
||||
|
||||
//连接发生错误的回调方法
|
||||
websocket.onerror = function () {
|
||||
};
|
||||
|
||||
//连接成功建立的回调方法
|
||||
websocket.onopen = function () {
|
||||
console.info('消息滚动websocker开启');
|
||||
}
|
||||
|
||||
//接收到消息的回调方法
|
||||
websocket.onmessage = function (event) {
|
||||
// var result= JSON.parse(event.data);
|
||||
|
||||
querynewmsg();
|
||||
|
||||
}
|
||||
|
||||
//连接关闭的回调方法
|
||||
websocket.onclose = function () {
|
||||
console.info('消息滚动websocker关闭_main');
|
||||
if(restartDialog==null){
|
||||
restartDialog =top.$.messager.alert('提示','服务器连接已断开,请重新登录!','info',function(){
|
||||
top.location.href=ext.contextPath; //跳转到登陆页面
|
||||
});
|
||||
}
|
||||
closeWebSocket();
|
||||
}
|
||||
|
||||
//监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。
|
||||
window.onbeforeunload = function () {
|
||||
closeWebSocket();
|
||||
}
|
||||
|
||||
//关闭WebSocket连接
|
||||
function closeWebSocket() {
|
||||
websocket.close();
|
||||
}
|
||||
|
||||
//发送消息
|
||||
/* function send() {
|
||||
var message = document.getElementById('text').value;
|
||||
websocket.send(message);
|
||||
} */
|
||||
$(function() {
|
||||
|
||||
$('#passwordDialog').show().dialog({
|
||||
modal : true,
|
||||
closable : true,
|
||||
iconCls : 'ext-icon-lock_edit',
|
||||
buttons : [ {
|
||||
text : '修改',
|
||||
handler : function() {
|
||||
if ($('#passwordDialog form').form('validate')) {
|
||||
$.post("Login/resetPwd.do", {"loadNewPassword" : $("#pwd").val()}, function(data) {
|
||||
if (data=="成功") {
|
||||
$.messager.alert('提示', '密码修改成功!', 'info');
|
||||
$('#passwordDialog').dialog('close');
|
||||
}else{
|
||||
$.messager.alert('提示', data, 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} ],
|
||||
onOpen : function() {
|
||||
$('#passwordDialog form :input').val('');
|
||||
}
|
||||
}).dialog('close');
|
||||
|
||||
});
|
||||
|
||||
//菜单栏选择后添加tab页面
|
||||
function addTab(id,name,location){
|
||||
$.post("user/isOnline.do");//用于session过期后重新进入登录页面
|
||||
|
||||
var tabs = $('#mainTabs');
|
||||
var opts = {
|
||||
title : name,
|
||||
closable : true,
|
||||
content : '<iframe src="'+location+'" allowTransparency="true" style="border:0;width:100%;height:100%;" frameBorder="0" scrolling="auto"></iframe>',
|
||||
border : false,
|
||||
fit : true
|
||||
};
|
||||
if (tabs.tabs('exists', opts.title)) {
|
||||
tabs.tabs('select', opts.title);
|
||||
} else {
|
||||
tabs.tabs('add', opts);
|
||||
}
|
||||
}
|
||||
|
||||
//消息
|
||||
var post = "";
|
||||
var unReadMsgNum = 0;
|
||||
function querynewmsg(){
|
||||
$.post("msg/getUnreadMsgs4main.do",function(data){
|
||||
var total= data.total;
|
||||
var rows =data.rows;
|
||||
document.getElementById("msgcount").innerHTML = "("+total+")";
|
||||
if(unReadMsgNum < total){
|
||||
msgshow("24小时内,您有"+total+"条未读消息!");
|
||||
unReadMsgNum = total;
|
||||
}
|
||||
var res="";
|
||||
for(var i=0;i<rows.length;i++){
|
||||
//console.info(rows[i]);
|
||||
res+=rows[i].insdt.substring(0,19)+"——"+rows[i].susername.caption+":"+rows[i].content+" ";
|
||||
}
|
||||
$("#marquee_msg").html(res);
|
||||
},'json');
|
||||
}
|
||||
function msgshow(a){
|
||||
$.messager.show({
|
||||
title:'消息',
|
||||
msg:a,
|
||||
showType:'show',
|
||||
timeout:5000,
|
||||
style:{
|
||||
left:'',
|
||||
right:1,
|
||||
top:'',
|
||||
bottom:31
|
||||
}
|
||||
});
|
||||
}
|
||||
querynewmsg();
|
||||
//setInterval("querynewmsg();",5000);
|
||||
</script>
|
||||
</head>
|
||||
<body id="mainLayout" class="easyui-layout">
|
||||
<div data-options="region:'north',href:'jsp/north.jsp'" class="logo" style="height: 70px; overflow: hidden;"></div>
|
||||
<div data-options="region:'west',href:'user/showMenuListByCu.do',split:true" title="${cu.caption}" style="width: 200px"></div>
|
||||
<div data-options="region:'center',href:'jsp/center.jsp'" style="overflow: hidden;"></div>
|
||||
<div data-options="region:'south',border:false" style="height: 30px; overflow: hidden;">
|
||||
|
||||
<table style="float:right;width: 100%" data-options="fit:true" >
|
||||
|
||||
<tr>
|
||||
<td style="padding:0px 5px 0px 5px;fit:true;" >
|
||||
<marquee id ="marquee_msg" behavior="scroll" >当前没有消息提醒</marquee>
|
||||
</td>
|
||||
<td style="width: auto;float:right" >
|
||||
<%-- <%if (sessionManager.havePermission(session,"msg/getMsgrecv.do?scope=all")) {%> --%>
|
||||
<a href="javascript:addTab('msgrecv','收消息','msg/showMsgrecv.do');" class="easyui-linkbutton" data-options="plain:true">
|
||||
<b id="newmsg">消息</b><b id="msgcount"></b>
|
||||
</a>
|
||||
<%-- <%}%> --%>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="passwordDialog" title="修改密码" style="display: none;width: 380px;">
|
||||
<form method="post" class="form" onsubmit="return false;">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>新密码</th>
|
||||
<td><input id="pwd" name="loadNewPassword" type="password" class="easyui-validatebox" data-options="required:true,validType:'isBlank'" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>重复密码</th>
|
||||
<td><input type="password" class="easyui-validatebox" data-options="required:true,validType:'eqPwd[\'#pwd\']'" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
129
bin/WebRoot/jsp/material/MaterialApplicationAdd.jsp
Normal file
129
bin/WebRoot/jsp/material/MaterialApplicationAdd.jsp
Normal file
@ -0,0 +1,129 @@
|
||||
<!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 + "/material/materialapplication/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 selectmaterialcode(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择物料',
|
||||
width: 800,
|
||||
height:550,
|
||||
url : ext.contextPath + '/material/materialinventory/select.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
chosematerial(res)
|
||||
//$("#div_product").panel('close');
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
function chosematerial(res){
|
||||
//console.log("res",res);
|
||||
$("#materialcode").textbox('setValue',res.materialcode);//easyui textbox赋值jquery不一样
|
||||
$("#materialid").val(res.id);
|
||||
$("#materialname").html(res.materialname);
|
||||
$("#unit").html(res.unit);
|
||||
}
|
||||
$(function() {
|
||||
$('#taskorderid').combobox({
|
||||
url : ext.contextPath + '/plan/taskorder/getTaskorder1.do',
|
||||
valueField:'id',
|
||||
textField:'tasklistcode',
|
||||
method:'get',
|
||||
onSelect: function () {
|
||||
$('#workorderid').combobox({
|
||||
url : ext.contextPath + '/work/workorder/getlistbyplanid.do?taskorderid=' + $('#taskorderid').combobox('getValue'),
|
||||
valueField:'id',
|
||||
textField:'workorderno',
|
||||
method:'get',
|
||||
})},
|
||||
});
|
||||
$("#materialcode").textbox('textbox').bind("click", function () {
|
||||
selectmaterialcode();
|
||||
$("#processid").val('${processid}');
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>任务单编号</th>
|
||||
<td><input id="taskorderid" name="taskorderid" class="easyui-combobox" value="" data-options="required:true,validType:'isBlank'"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>工单编号</th>
|
||||
<td><input id="workorderid" name="workorderid" class="easyui-combobox" value="" data-options="required:true,validType:'isBlank'"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>物料代码</th>
|
||||
<td><input id="materialcode" name="materialcode" class="easyui-textbox" data-options="required:true,validType:'isBlank',prompt:'单击选择'" value="" readonly/>
|
||||
<input id="materialid" name="materialid" type="hidden" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>物料名称</th>
|
||||
<td><span id="materialname"></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>单位</th>
|
||||
<td><span id="unit"></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>当前库存</th>
|
||||
<td><input name="currentinventory" class="easyui-textbox" value="" data-options="required:true,validType:'isBlank'"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>物料需求</th>
|
||||
<td><input name="materialrequest" class="easyui-textbox" value="" data-options="required:true,validType:'isBlank'"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>补料需求</th>
|
||||
<td><input name="supplymaterial" class="easyui-textbox" value="" data-options="required:true,validType:'isBlank'"/></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
198
bin/WebRoot/jsp/material/MaterialApplicationList.jsp
Normal file
198
bin/WebRoot/jsp/material/MaterialApplicationList.jsp
Normal file
@ -0,0 +1,198 @@
|
||||
<%@ 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 + '/material/materialapplication/add.do',
|
||||
buttons : [ {
|
||||
text : '保存',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.dosave(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
var editFunstatus = function(id) {
|
||||
parent.$.messager.confirm('提示', '您确定要提交此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/material/materialapplication/editFunstatus.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','提交成功','info');
|
||||
grid.datagrid('reload');
|
||||
}else{
|
||||
parent.$.messager.alert('提示','提交失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑补料申请单',
|
||||
url : ext.contextPath + '/material/materialapplication/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 + '/material/materialapplication/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info');
|
||||
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+",";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/material/materialapplication/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','成功删除'+data+'条记录','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/material/materialapplication/getMaterialApplications.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 : '180', title : '任务单编号', field : 'taskorder', sortable : true, align:'center',halign:'center',formatter : function(value, row) {
|
||||
return value.tasklistcode;
|
||||
}},
|
||||
{width : '100', title : '工单编号', field: 'workorderid', sortable : true, halign:'center',formatter:function(value,row){
|
||||
return row.workOrder.workorderno;
|
||||
|
||||
}
|
||||
},
|
||||
{width : '180', title : '产品名称', field : 'bomname', sortable : true, align:'center',halign:'center'},
|
||||
{width : '180', title : '工单日期', field : 'workOrder', sortable : true, align:'center',halign:'center',formatter : function(value, row) {
|
||||
|
||||
return value.stdt.substring(0,10);
|
||||
}},
|
||||
{width : '180', title : '物料代码', field : 'materialcode', sortable : true, align:'center',halign:'center'},
|
||||
{width : '180', title : '物料名称', field : 'materialname', sortable : true, align:'center',halign:'center'},
|
||||
{width : '180', title : '当前库存', field : 'currentinventory', sortable : true, align:'center',halign:'center'},
|
||||
{width : '180', title : '物料需求', field : 'materialrequest', sortable : true, align:'center',halign:'center'},
|
||||
{width : '180', title : '补料数量', field : 'supplymaterial', sortable : true, align:'center',halign:'center'},
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
if(row.status!="1"){
|
||||
<%if (sessionManager.havePermission(session,"material/materialapplication/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"material/materialapplication/delete.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_delete" title="删除" onclick="deleteFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
str += '<img class="iconImg ext-icon-table_go" title="提交" onclick="editFunstatus(\''+row.id+'\');"/>';
|
||||
}else{
|
||||
str += '<img class="iconImg ext-icon-table_go" title="已提交" />';
|
||||
}
|
||||
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,"material/materialapplication/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,"material/materialapplication/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
<td><div class="datagrid-btn-separator"></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<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_code" name="search_code" 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>
|
||||
81
bin/WebRoot/jsp/material/PLMProductsList.jsp
Normal file
81
bin/WebRoot/jsp/material/PLMProductsList.jsp
Normal file
@ -0,0 +1,81 @@
|
||||
<%@ 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() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/material/materialinfo/getPLMProducts.do?typename='+encodeURI('${typename}'),
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
ctrlSelect: true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '150', title : '物料编码', field : 'materialcode', sortable : true, halign:'center'},
|
||||
{width : '150', title : '物料名称', field : 'materialname', sortable : true, halign:'center'},
|
||||
{width : '240', title : '规格参数', field : 'materialmodel', sortable : true, halign:'center'},
|
||||
{width : '120', title : '创建时间', field : 'insdt', sortable : true, halign:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
function selectOK() {
|
||||
//以json格式返回数据
|
||||
var jsonstr = "";
|
||||
var row = $('#grid').datagrid('getSelected');
|
||||
if (row){
|
||||
jsonstr = '{"materialcode":"'+row.materialcode+'"}';
|
||||
}
|
||||
var dataset = $.parseJSON(jsonstr);
|
||||
return dataset;
|
||||
}
|
||||
</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 name="search_code" 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>
|
||||
108
bin/WebRoot/jsp/material/alertboardList.jsp
Normal file
108
bin/WebRoot/jsp/material/alertboardList.jsp
Normal file
@ -0,0 +1,108 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" 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 selectFun() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas = '{"id":"'+item.id +'","no":"'+item.no +'",'+
|
||||
'"no":"'+item.no +'"}';
|
||||
});
|
||||
console.log("enter",datas);
|
||||
var dataset = $.parseJSON(datas);
|
||||
return dataset;
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
var equid = localStorage.getItem("equid");
|
||||
localStorage.removeItem("equid");
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/material/inkalert/getBoardbatchList.do?equid='+equid+'&querytype=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '90', title : '网板名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '120', title : '网板批次号', field : 'no', sortable : true, halign:'center'},
|
||||
{width : '80', title : '网板类别', field : 'type', sortable : true, halign:'center'},
|
||||
{width : '60', title : '状态', field : 'status', sortable : true, halign:'center',formatter : function(value, row, index) {
|
||||
switch (value) {
|
||||
case '0':
|
||||
return '未使用';
|
||||
case '1':
|
||||
return '使用中';
|
||||
case '2':
|
||||
return '使用完毕';
|
||||
}
|
||||
}},
|
||||
{width : '130', title : '使用开始时间', field : 'starttime', sortable : true, halign:'center',formatter : function(value, row){
|
||||
return value.substring(0,19);
|
||||
} },
|
||||
{width : '130', title : '使用结束时间', field : 'endtime', sortable : true, halign:'center',formatter : function(value, row){
|
||||
return value.substring(0,19);
|
||||
} },
|
||||
{width : '150', title : '使用机台', field : 'equipmentName', sortable : true, halign:'center'},
|
||||
{width : '60', title : '修改者', field : 'alteruser', sortable : true, halign:'center',formatter : function(value, row) {
|
||||
value ='admin';
|
||||
return value;
|
||||
} },
|
||||
{width : '130', title : '修改时间', field : 'alterdt', sortable : true, halign:'center',formatter : function(value, row){
|
||||
return value.substring(0,19);
|
||||
} },
|
||||
] ],
|
||||
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>
|
||||
<tr>
|
||||
<td>批次号</td>
|
||||
<td><input name="search_no" 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>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
109
bin/WebRoot/jsp/material/alertinkList.jsp
Normal file
109
bin/WebRoot/jsp/material/alertinkList.jsp
Normal file
@ -0,0 +1,109 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" 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 selectFun() {
|
||||
var checkedItems = $('#grid').datagrid('getChecked');
|
||||
var datas="";
|
||||
$.each(checkedItems, function(index, item){
|
||||
datas = '{"id":"'+item.id +'","no":"'+item.no +'",'+
|
||||
'"no":"'+item.no +'"}';
|
||||
});
|
||||
|
||||
var dataset = $.parseJSON(datas);
|
||||
return dataset;
|
||||
}
|
||||
|
||||
var grid;
|
||||
$(function() {
|
||||
var equid = localStorage.getItem("equid");
|
||||
localStorage.removeItem("equid");
|
||||
//console.log("equid",equid);
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/material/inkalert/getInkbatchList.do?equid='+equid+'&querytype=select',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '120', title : '批次号', field : 'no', sortable : true, halign:'center'},
|
||||
{width : '90', title : '油墨名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '80', title : '油墨类别', field : 'type', sortable : true, halign:'center'},
|
||||
{width : '60', title : '状态', field : 'status', sortable : true, halign:'center',formatter : function(value, row, index) {
|
||||
switch (value) {
|
||||
case '0':
|
||||
return '未使用';
|
||||
case '1':
|
||||
return '使用中';
|
||||
case '2':
|
||||
return '使用完毕';
|
||||
}
|
||||
}},
|
||||
{width : '130', title : '使用开始时间', field : 'starttime', sortable : true, halign:'center',formatter : function(value, row){
|
||||
return value.substring(0,19);
|
||||
} },
|
||||
{width : '130', title : '使用结束时间', field : 'endtime', sortable : true, halign:'center',formatter : function(value, row){
|
||||
return value.substring(0,19);
|
||||
} },
|
||||
{width : '150', title : '使用机台', field : 'equipmentName', sortable : true, halign:'center'},
|
||||
{width : '60', title : '修改者', field : 'alteruser', sortable : true, halign:'center',formatter : function(value, row) {
|
||||
value ='admin';
|
||||
return value;
|
||||
} },
|
||||
{width : '130', title : '修改时间', field : 'alterdt', sortable : true, halign:'center',formatter : function(value, row){
|
||||
return value.substring(0,19);
|
||||
} },
|
||||
] ],
|
||||
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>
|
||||
<tr>
|
||||
<td>批次号</td>
|
||||
<td><input name="search_no" 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>
|
||||
</div>
|
||||
<div data-options="region:'center',fit:true,border:false">
|
||||
<table id="grid" data-options="fit:true,border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
85
bin/WebRoot/jsp/material/auxiliaryMaterialPicking.jsp
Normal file
85
bin/WebRoot/jsp/material/auxiliaryMaterialPicking.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 + "/material/auxiliarymaterialpicking/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">
|
||||
<input id="pid" name="pid" type="hidden" value="${auxiliaryMaterialPicking.pid}" />
|
||||
<input id="materialcode" name="materialcode" type="hidden" value="${auxiliaryMaterialPicking.materialcode}" />
|
||||
<input id="keyword" name="keyword" type="hidden" value="${auxiliaryMaterialPicking.keyword}" />
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>BOM物料项目</th>
|
||||
<td><input id="bomprojects" name="bomprojects" class="easyui-textbox" value="${auxiliaryMaterialPicking.bomprojects}" readonly/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>数量</th>
|
||||
<td>
|
||||
<input id="num" name="num" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${auxiliaryMaterialPicking.num}" />
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>单位</th>
|
||||
<td>
|
||||
<input id="unit" name="unit" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${auxiliaryMaterialPicking.unit} " readonly/>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>领料人</th>
|
||||
<td>
|
||||
<input id="pickingpeople" name="pickingpeople" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${auxiliaryMaterialPicking.pickingpeople}" />
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>领料日期</th>
|
||||
<td>
|
||||
<input id="pickingdate" name="pickingdate" class="Wdate" value=""
|
||||
onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm'})" readonly value="${auxiliaryMaterialPicking.pickingdate}" />
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td>
|
||||
<input id="remark" name="remark" class="easyui-textbox"
|
||||
data-options="required:false,validType:'isBlank'" value="${pickingdate.remark}" />
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
106
bin/WebRoot/jsp/material/boardChange.jsp
Normal file
106
bin/WebRoot/jsp/material/boardChange.jsp
Normal file
@ -0,0 +1,106 @@
|
||||
<!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 + "/material/inkalert/saveboard.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 selectBoardbatchList(boardbatchno,No){
|
||||
localStorage.setItem("equid",$("#equipmentcardid").val());
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择可使用网板批次',
|
||||
width: 800,
|
||||
height:550,
|
||||
url : ext.contextPath + '/material/inkalert/showBoardbatchList.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectFun();
|
||||
if(res!=null){
|
||||
$("#"+boardbatchno).val(res.id);
|
||||
$("#"+No).textbox('setValue',res.no);
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$("#No").textbox('textbox').bind("click", function () {
|
||||
selectBoardbatchList("boardbatchno","No");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input id="boardbatchno" name="boardbatchno" type="hidden"/>
|
||||
<input id="lastboardbatchno" name="lastboardbatchno" value="${inkalert.lastboardbatchno}" type="hidden"/>
|
||||
<input id="equipmentcardid" name="equipmentcardid" value="${inkalert.equipmentcardid}" type="hidden"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>设备</th>
|
||||
<td><input name="equipmentname" class="easyui-textbox"
|
||||
disabled="disabled" value="${inkalert.equipmentname}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>上次更换时间</th>
|
||||
<td><input name="starttime" class="easyui-textbox"
|
||||
disabled="disabled" value="${fn:substring(inkalert.starttime,0,19)}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>更换者</th>
|
||||
<td>
|
||||
<input name="operator" class="easyui-textbox"
|
||||
disabled="disabled" value="admin" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>当前网板批次号</th>
|
||||
<td><input name="no" class="easyui-textbox"
|
||||
disabled="disabled" value="${inkalert.no}" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>可使用网板批次号</th>
|
||||
<td>
|
||||
<input id="No" name="No" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank',prompt:'单击选择'" value="" readonly/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
248
bin/WebRoot/jsp/material/boardbatchAdd.jsp
Normal file
248
bin/WebRoot/jsp/material/boardbatchAdd.jsp
Normal file
@ -0,0 +1,248 @@
|
||||
<!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 + "/material/boardbatch/save.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
|
||||
$.post(ext.contextPath + "/material/boardbatch/saveMachine.do",{no:data.id,mids:getMids(),status:$('#status').textbox('getValue')},function(data1){
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
});
|
||||
/* 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 getNowFormatDate() {
|
||||
var date = new Date();
|
||||
var seperator1 = "-";
|
||||
var seperator2 = ":";
|
||||
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 currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
|
||||
+ " " + date.getHours() + seperator2 + date.getMinutes()
|
||||
/*+ seperator2 + date.getSeconds();*/
|
||||
return currentdate;
|
||||
}
|
||||
|
||||
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());
|
||||
//清除旧数据
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加参数设置中的设备',
|
||||
height:500,
|
||||
url : ext.contextPath + '/material/inkinfo/showEquipmentcardForSelects.do?iframeId=boardbatchAdd',
|
||||
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 selectProcess(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择工艺路线',
|
||||
width: 800,
|
||||
height:550,
|
||||
url : ext.contextPath + '/activiti/workflow/getProcessForSelect.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
$("#processrealid").textbox('setValue',res.id);
|
||||
$("#processrealid").textbox('setText',res.name);
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
$(function() {
|
||||
$("#processrealid").textbox('textbox').bind("click", function () {
|
||||
selectProcess();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(function() {
|
||||
document.getElementById('starttime').value=getNowFormatDate();//设置默认时间
|
||||
$('#m').panel({
|
||||
width:"100%",
|
||||
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 : '145', title : '设备编号', field : 'equipmentcardid', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '90', 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'}
|
||||
] ],
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<input id="mids" name="mids" type="hidden" value="" />
|
||||
<form method="post" class="form">
|
||||
<input id="mtypetemp" type="hidden" value=""/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>网板批次号</th>
|
||||
<td><input name="no" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>网板类别</th>
|
||||
<td>
|
||||
<input name="type" 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><select id="status" name="status" class="easyui-combobox"
|
||||
data-options="panelHeight:'auto'">
|
||||
<option value="0">未使用</option>
|
||||
<option value="1">使用中</option>
|
||||
<option value="2">使用完毕</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>使用开始时间</th>
|
||||
<td><input id="starttime" name="starttime" class="Wdate"
|
||||
value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"readonly/>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- <tr>
|
||||
<th>使用开始时间</th>
|
||||
<td><input id="endtime" name="endtime" class="Wdate"
|
||||
value="" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"readonly/>
|
||||
</td>
|
||||
</tr> -->
|
||||
<tr>
|
||||
<th>产品工艺路线</th>
|
||||
<td><input id="processrealid" name="processrealid" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<div id="m">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
304
bin/WebRoot/jsp/material/boardbatchEdit.jsp
Normal file
304
bin/WebRoot/jsp/material/boardbatchEdit.jsp
Normal file
@ -0,0 +1,304 @@
|
||||
<!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"%>
|
||||
<%request.setAttribute("Flag_UNUSE",com.sipai.entity.material.Boardbatch.Flag_UNUSE);%>
|
||||
<%request.setAttribute("Flag_INUSE",com.sipai.entity.material.Boardbatch.Flag_INUSE);%>
|
||||
<%request.setAttribute("Flag_USED",com.sipai.entity.material.Boardbatch.Flag_USED);%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
var editIndex = undefined;//定义编辑列的索引
|
||||
function endEditing(){//清除editor
|
||||
if (editIndex == undefined){return true;}
|
||||
if ($('#grid').datagrid('validateRow', editIndex)){
|
||||
$('#grid').datagrid('endEdit', editIndex);
|
||||
editIndex = undefined;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function getGriddata(){
|
||||
var gridrows= $('#grid').datagrid("getRows");
|
||||
var griddata= '[';
|
||||
$.each(gridrows, function(index, item){
|
||||
if(index == 0){
|
||||
griddata+='{"equipmentcardid":"'+item.id+'","status":"'+item.ibmstatus+'"}';
|
||||
}
|
||||
else{
|
||||
griddata+=',{"equipmentcardid":"'+item.id+'","status":"'+item.ibmstatus+'"}';
|
||||
}
|
||||
});
|
||||
griddata+= ']';
|
||||
return griddata;
|
||||
|
||||
}
|
||||
//获取已选的工位id
|
||||
function getMids(){
|
||||
var mrows= $('#grid').datagrid("getRows");
|
||||
var mids="";
|
||||
$.each(mrows, function(index, item){
|
||||
mids+=item.id+",";
|
||||
});
|
||||
mids=mids.replace(/,$/gi,"");
|
||||
return mids;
|
||||
}
|
||||
|
||||
function dosave(dialog,grid) {
|
||||
if ($(".form").form('validate')) {
|
||||
$.post(ext.contextPath + "/material/boardbatch/update.do", $(".form").serialize(), function(data) {
|
||||
if (data.res == 1) {
|
||||
$.post(ext.contextPath + "/material/boardbatch/updateMachine.do",{no:$('#id').val(),griddata:getGriddata()},function(data1){
|
||||
top.$.messager.alert('提示', "保存成功", 'info', function() {
|
||||
grid.datagrid('reload');
|
||||
dialog.dialog('destroy');
|
||||
});
|
||||
});
|
||||
/* 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_M(){
|
||||
$("#mids").val(getMids());
|
||||
|
||||
localStorage.setItem("mids",$("#mids").val());
|
||||
//清除旧数据
|
||||
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '添加参数设置中的设备',
|
||||
height:500,
|
||||
url : ext.contextPath + '/material/inkinfo/showEquipmentcardForSelects.do?iframeId=boardbatchEdit',
|
||||
buttons : [ {
|
||||
iconCls:'icon-ok',
|
||||
text : '确认',
|
||||
handler : function() {
|
||||
var data = dialog.find('iframe').get(0).contentWindow.selectFun(dialog, grid);
|
||||
var datas= $.parseJSON(data);
|
||||
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,
|
||||
equipmentclassid:datas[i].equipmentclass,
|
||||
areaid: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() {
|
||||
$('#m').panel({
|
||||
width:"100%",
|
||||
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',
|
||||
onClickCell:function(index){
|
||||
endEditing();
|
||||
},
|
||||
onDblClickCell : function(index,field){
|
||||
/*if (endEditing()) {
|
||||
$('#grid').datagrid('selectRow', index).datagrid('editCell', {index:index,field:field});
|
||||
editIndex = index;
|
||||
}*/
|
||||
if(!endEditing()){
|
||||
return false;
|
||||
}
|
||||
|
||||
editIndex = index;
|
||||
$('#grid').datagrid('selectRow', editIndex).datagrid('beginEdit', editIndex);
|
||||
|
||||
var ed = $('#grid').datagrid('getEditor', {index:editIndex,field:'name'});
|
||||
($(ed.target).data('textbox') ? $(ed.target).textbox('textbox') : $(ed.target)).focus();
|
||||
},
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '140', title : '设备编号', field : 'equipmentcardid', sortable : true, halign:'center'},
|
||||
{width : '90', title : '设备名称', field : 'equipmentname', sortable : true, halign:'center'},
|
||||
{width : '105', title : '设备油墨使用状态', field : 'ibmstatus', sortable : true,formatter:function(value,row){
|
||||
switch (value) {
|
||||
case '${Flag_UNUSE}':
|
||||
return '未使用';
|
||||
case '${Flag_INUSE}':
|
||||
return '使用中';
|
||||
case '${Flag_USED}':
|
||||
return '使用完毕';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
},editor:{
|
||||
type:'combobox',
|
||||
options:{
|
||||
data: [{
|
||||
name: '未使用',
|
||||
status: '${Flag_UNUSE}'
|
||||
},{
|
||||
name: '使用中',
|
||||
status: '${Flag_INUSE}'
|
||||
},{
|
||||
name: '使用完毕',
|
||||
status: '${Flag_USED}'
|
||||
}],
|
||||
valueField:'status',
|
||||
textField:'name',
|
||||
required:true
|
||||
}
|
||||
}},
|
||||
{width : '90', title : '设备型号', field : 'equipmentmodel', sortable : true, halign:'center'},
|
||||
{width : '90', title : '设备类型', field : 'equipmentclassid', sortable : true,halign:'center'},
|
||||
{width : '90', title : '存放位置', field : 'areaid', sortable : true,halign:'center'}
|
||||
] ],
|
||||
data:${equipmentcardList}
|
||||
});
|
||||
});
|
||||
function selectProcess(){
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择工艺路线',
|
||||
width: 800,
|
||||
height:550,
|
||||
url : ext.contextPath + '/activiti/workflow/getProcessForSelect.do',
|
||||
buttons : [{
|
||||
text : '确定',
|
||||
iconCls:'icon-ok',
|
||||
handler : function() {
|
||||
var res=dialog.find('iframe').get(0).contentWindow.selectOK();
|
||||
if(res!=null){
|
||||
$("#processrealid").textbox('setValue',res.id);
|
||||
$("#processrealid").textbox('setText',res.name);
|
||||
}
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
text : '取消',
|
||||
iconCls:'icon-cancel',
|
||||
handler : function() {
|
||||
dialog.dialog('destroy');
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
$(function() {
|
||||
$("#processrealid").textbox('textbox').bind("click", function () {
|
||||
selectProcess();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<input id="mids" name="mids" type="hidden" value="" />
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" id = "id" name="id" value="${boardbatch.id }"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>批次号</th>
|
||||
<td><input name="no" class="easyui-textbox"
|
||||
disabled="disabled" value="${boardbatch.no }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>网板类别</th>
|
||||
<td><input name="type" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${boardbatch.type }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>网板名称</th>
|
||||
<td>
|
||||
<input name="name" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${boardbatch.name }" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>物料状态</th>
|
||||
<td><select id="status" name="status" class="easyui-combobox"
|
||||
data-options="panelHeight:'auto'">
|
||||
<option value="0" <c:if test="${boardbatch.status=='0'}">selected</c:if>>未使用</option>
|
||||
<option value="1" <c:if test="${boardbatch.status=='1'}">selected</c:if>>使用中</option>
|
||||
<option value="2" <c:if test="${boardbatch.status=='2'}">selected</c:if>>使用完毕</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品工艺路线</th>
|
||||
<td><input id="processrealid" name="processrealid" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${boardbatch.processrealid }" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>开始时间</th>
|
||||
<td><input id="starttime" name="starttime" class="Wdate"
|
||||
value="${fn:substring(boardbatch.starttime,0,19)}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"readonly/>
|
||||
</td>
|
||||
</tr>
|
||||
<%--<tr>
|
||||
<th>结束时间</th>
|
||||
<td>
|
||||
<input id="endtime"name="endtime" class="Wdate"
|
||||
value="${fn:substring(boardbatch.endtime,0,19)}" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"readonly/>
|
||||
</td>
|
||||
</tr><!-- 添加开始结束时间 --> --%>
|
||||
</table>
|
||||
</form>
|
||||
<div id="m">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
270
bin/WebRoot/jsp/material/boardbatchList.jsp
Normal file
270
bin/WebRoot/jsp/material/boardbatchList.jsp
Normal file
@ -0,0 +1,270 @@
|
||||
<%@ 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_UNUSE",com.sipai.entity.material.Boardbatch.Flag_UNUSE);%>
|
||||
<%request.setAttribute("Flag_INUSE",com.sipai.entity.material.Boardbatch.Flag_INUSE);%>
|
||||
<%request.setAttribute("Flag_USED",com.sipai.entity.material.Boardbatch.Flag_USED);%>
|
||||
<!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 + '/material/boardbatch/add.do',
|
||||
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 + '/material/boardbatch/view.do?id=' + id
|
||||
});
|
||||
};
|
||||
var editFun = function(id) {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '编辑网板批次信息',
|
||||
url : ext.contextPath + '/material/boardbatch/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 + '/material/boardbatch/delete.do', {id : id}, function(data) {
|
||||
if(data==1){
|
||||
parent.$.messager.alert('提示','删除成功','info');
|
||||
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+",";
|
||||
});
|
||||
if(datas==""){
|
||||
top.$.messager.alert('提示', '请先选择要删除的记录','info');
|
||||
}else{
|
||||
parent.$.messager.confirm('提示', '您确定要删除此记录?', function(r) {
|
||||
if (r) {
|
||||
$.post(ext.contextPath + '/material/boardbatch/deletes.do', {ids:datas} , function(data) {
|
||||
if(data>0){
|
||||
parent.$.messager.alert('提示','成功删除'+data+'条记录','info');
|
||||
grid.datagrid('reload');
|
||||
grid.datagrid('clearChecked');
|
||||
}else{
|
||||
parent.$.messager.alert('提示','删除失败','info');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var importFun = function() {
|
||||
var dialog = parent.ext.modalDialog({
|
||||
title : '选择文件',
|
||||
width: 600,
|
||||
height:300,
|
||||
closeOnEscape:true,
|
||||
url : ext.contextPath + '/material/boardbatch/doimport.do',
|
||||
buttons : [ {
|
||||
text : '导入数据',
|
||||
handler : function() {
|
||||
dialog.find('iframe').get(0).contentWindow.doimport(dialog, grid);
|
||||
}
|
||||
} ]
|
||||
});
|
||||
};
|
||||
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
view: detailview,
|
||||
detailFormatter:function(index,row){
|
||||
return '<div style="padding:2px"><table class="ddv"></table></div>';
|
||||
},
|
||||
title : '',
|
||||
url : ext.contextPath + '/material/boardbatch/getlist.do',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
singleSelect: false,
|
||||
ctrlSelect: true,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
frozenColumns:[[
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '100', title : '网板批次号', field : 'no', sortable : true, halign:'center'},
|
||||
{width : '90', title : '网板名称', field : 'name', sortable : true, halign:'center'},
|
||||
{width : '80', title : '网板类别', field : 'type', sortable : true, halign:'center'},
|
||||
{width : '60', title : '状态', field : 'status', sortable : true, halign:'center',formatter : function(value, row, index) {
|
||||
switch (value) {
|
||||
case '${Flag_UNUSE}':
|
||||
return '未使用';
|
||||
case '${Flag_INUSE}':
|
||||
return '使用中';
|
||||
case '${Flag_USED}':
|
||||
return '使用完毕';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}},
|
||||
] ],
|
||||
columns : [ [
|
||||
{width : '180', title : '工艺路线', field : 'processrealid', sortable : true, halign:'center' },
|
||||
{width : '130', title : '使用开始时间', field : 'starttime', sortable : true, halign:'center',formatter : function(value, row){
|
||||
return value.substring(0,19);
|
||||
} },
|
||||
{width : '130', title : '使用结束时间', field : 'endtime', sortable : true, halign:'center',formatter : function(value, row){
|
||||
return value.substring(0,19);
|
||||
} },
|
||||
{width : '60', title : '修改者', field : 'alteruser', sortable : true, halign:'center',formatter : function(value, row) {
|
||||
value ='admin';
|
||||
return value;
|
||||
} },
|
||||
{width : '130', title : '修改时间', field : 'alterdt', sortable : true, halign:'center',formatter : function(value, row){
|
||||
return value.substring(0,19);
|
||||
} },
|
||||
{title : '操作', field : 'action', width : '120', halign:'center', align:'center', formatter : function(value, row) {
|
||||
var str = '';
|
||||
str += '<img class="iconImg ext-icon-table" title="查看" onclick="viewFun(\''+row.id+'\');"/>';
|
||||
<%if (sessionManager.havePermission(session,"material/boardbatch/edit.do")) {%>
|
||||
str += '<img class="iconImg ext-icon-table_edit" title="编辑" onclick="editFun(\''+row.id+'\');"/>';
|
||||
<%}%>
|
||||
<%if (sessionManager.havePermission(session,"material/boardbatch/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);
|
||||
},
|
||||
onExpandRow: function(index,prow){
|
||||
ddv = $(this).datagrid('getRowDetail',index).find('table.ddv');
|
||||
ddv.datagrid({
|
||||
url:ext.contextPath + '/material/boardbatch/getMachine.do?pid='+prow.id,
|
||||
fitColumns:true,
|
||||
ctrlSelect:true,
|
||||
singleSelect: false,
|
||||
selectOnCheck: false,
|
||||
checkOnSelect: false,
|
||||
striped: true,
|
||||
idField : 'id',
|
||||
rownumbers:true,
|
||||
//loadMsg:'',
|
||||
height:'auto',
|
||||
columns : [ [
|
||||
{width : '140', title : '使用网板设备编号', field : 'equipmentcardid', sortable : true, halign:'center'},
|
||||
{width : '140', title : '使用网板设备编号', field : 'equipmentname', sortable : true, halign:'center'},
|
||||
{width : '85', title : '使用网板设备状态', field : 'ibmstatus', sortable : true, align:'center',halign:'center',formatter : function(value, row, index) {
|
||||
switch (value) {
|
||||
case '${Flag_UNUSE}':
|
||||
return '未使用';
|
||||
case '${Flag_INUSE}':
|
||||
return '使用中';
|
||||
case '${Flag_USED}':
|
||||
return '使用完毕';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}},
|
||||
] ],
|
||||
onResize:function(){
|
||||
$('#grid').datagrid('fixDetailRowHeight',index);
|
||||
},
|
||||
onLoadSuccess:function(){
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
setTimeout(function(){
|
||||
$('#grid').datagrid('fixDetailRowHeight',index);
|
||||
},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,"material/boardbatch/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,"material/inkbatch/delete.do")) {%>
|
||||
<td>
|
||||
<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true"
|
||||
onclick="deletesFun();">删除</a>
|
||||
</td>
|
||||
<%}%>
|
||||
|
||||
<td><div class="datagrid-btn-separator"></div></td>
|
||||
|
||||
<td><a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'ext-icon-table_add',plain:true" onclick="importFun();">导入网板批次</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<form id="searchForm">
|
||||
<input name="idStr" type="hidden" />
|
||||
<table class="tooltable">
|
||||
<tr>
|
||||
<td>网板名称</td>
|
||||
<td><input name="search_name" class="easyui-textbox" /></td>
|
||||
<td>网板批次号</td>
|
||||
<td><input name="search_no" 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>
|
||||
|
||||
98
bin/WebRoot/jsp/material/boardbatchView.jsp
Normal file
98
bin/WebRoot/jsp/material/boardbatchView.jsp
Normal file
@ -0,0 +1,98 @@
|
||||
<!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"%>
|
||||
<%request.setAttribute("Flag_UNUSE",com.sipai.entity.material.Boardbatch.Flag_UNUSE);%>
|
||||
<%request.setAttribute("Flag_INUSE",com.sipai.entity.material.Boardbatch.Flag_INUSE);%>
|
||||
<%request.setAttribute("Flag_USED",com.sipai.entity.material.Boardbatch.Flag_USED);%>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<jsp:include page="../inc.jsp"></jsp:include>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('#m').panel({
|
||||
width:"100%",
|
||||
height:"300",
|
||||
title: '使用设备',
|
||||
});
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
idField : 'id',
|
||||
columns : [ [
|
||||
{width : '140', title : '设备编号', field : 'equipmentcardid', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '90', title : '设备名称', field : 'equipmentname', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '105', title : '设备油墨使用状态', field : 'ibmstatus', sortable : true,formatter:function(value,row){
|
||||
switch (value) {
|
||||
case '${Flag_UNUSE}':
|
||||
return '未使用';
|
||||
case '${Flag_INUSE}':
|
||||
return '使用中';
|
||||
case '${Flag_USED}':
|
||||
return '使用完毕';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}},
|
||||
{width : '90', title : '设备型号', field : 'equipmentmodel', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '90', title : '设备类型', field : 'equipmentclassid', sortable : true, editor:'textbox',halign:'center'},
|
||||
{width : '90', title : '存放位置', field : 'areaid', sortable : true, editor:'textbox',halign:'center'}
|
||||
] ],
|
||||
data:${equipmentcardList}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
body{ text-align:center}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input type="hidden" name="id" value="${boardbatch.id }"/>
|
||||
<table class="table">
|
||||
|
||||
<tr>
|
||||
<th>网板批次号</th>
|
||||
<td>${boardbatch.no }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>网板类别</th>
|
||||
<td>${boardbatch.type }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>网板名称</th>
|
||||
<td>${boardbatch.name }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>物料状态</th>
|
||||
<td>
|
||||
<c:if test="${boardbatch.status=='0'}">未使用</c:if>
|
||||
<c:if test="${boardbatch.status=='1'}">使用中</c:if>
|
||||
<c:if test="${boardbatch.status=='2'}">使用完毕</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>产品工艺路线</th>
|
||||
<td>${boardbatch.processrealid }</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>开始时间</th>
|
||||
<td>${fn:substring(boardbatch.starttime,0,19)}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>结束时间</th>
|
||||
<td>${fn:substring(boardbatch.endtime,0,19)}</td>
|
||||
</tr>
|
||||
<%-- <tr>
|
||||
<th>机台</th>
|
||||
<td>${boardbatch.equipmentName }</td>
|
||||
</tr> --%>
|
||||
</table>
|
||||
</form>
|
||||
<div id="m">
|
||||
<table id="grid" data-options="border:false"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
88
bin/WebRoot/jsp/material/bomsForSelect.jsp
Normal file
88
bin/WebRoot/jsp/material/bomsForSelect.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">
|
||||
var grid;
|
||||
$(function() {
|
||||
grid = $('#grid').datagrid({
|
||||
title : '',
|
||||
url : ext.contextPath + '/material/materialbom/getMaterialBOMs.do?querytype=select&bomid=${bomid}',
|
||||
striped : true,
|
||||
rownumbers : true,
|
||||
pagination : true,
|
||||
selectOnCheck: true,
|
||||
checkOnSelect: true,
|
||||
singleSelect:true,
|
||||
idField : 'id',
|
||||
pageSize : 50,
|
||||
pageList : [ 20, 50, 100],
|
||||
columns : [ [
|
||||
{checkbox:true , field : 'ck'},
|
||||
{width : '150', title : '物料编码', field : 'materialcode', sortable : true, halign:'center'},
|
||||
{width : '400', title : '物料名称', field : 'materialname', sortable : true, halign:'center'},
|
||||
{width : '80', title : '单位', field : 'unit', sortable : true, halign:'center'},
|
||||
{width : '80', title : '版本', field : 'version', sortable : true, align:'center'}
|
||||
] ],
|
||||
toolbar : '#toolbar',
|
||||
onLoadSuccess : function(data) {
|
||||
$('.iconImg').attr('src', ext.pixel_0);
|
||||
}
|
||||
});
|
||||
});
|
||||
function selectOK() {
|
||||
//以json格式返回数据
|
||||
var jsonstr = "";
|
||||
var bomidstr = "";
|
||||
var namestr = "";
|
||||
var rows = $('#grid').datagrid('getSelections');
|
||||
for(var i=0; i<rows.length; i++){
|
||||
bomidstr += rows[i].id+",";
|
||||
namestr+= rows[i].materialname+",";
|
||||
}
|
||||
if(bomidstr.length>0){
|
||||
bomidstr = bomidstr.substring(0,bomidstr.length-1);
|
||||
namestr = namestr.substring(0,namestr.length-1);
|
||||
}
|
||||
jsonstr = '{"bomid":"'+bomidstr+'","bomcode":"'+namestr+'"}';
|
||||
var dataset = $.parseJSON(jsonstr);
|
||||
return dataset;
|
||||
}
|
||||
</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 name="search_code" 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>
|
||||
142
bin/WebRoot/jsp/material/clientsAdd.jsp
Normal file
142
bin/WebRoot/jsp/material/clientsAdd.jsp
Normal file
@ -0,0 +1,142 @@
|
||||
<!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 + "/material/clients/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');
|
||||
}
|
||||
}
|
||||
|
||||
//信息验证
|
||||
$.extend($.fn.validatebox.defaults.rules, {
|
||||
phoneRex: {//电话号码自定义验证
|
||||
validator: function(value){
|
||||
var rex=/^1[3-8]+\d{9}$/;
|
||||
//var rex=/^(([0\+]\d{2,3}-)?(0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/;
|
||||
//区号:前面一个0,后面跟2-3位数字 : 0\d{2,3}
|
||||
//电话号码:7-8位数字: \d{7,8
|
||||
//分机号:一般都是3位数字: \d{3,}
|
||||
//这样连接起来就是验证电话的正则表达式了:/^((0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/
|
||||
var rex2=/^((0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/;
|
||||
if(rex.test(value)||rex2.test(value))
|
||||
{
|
||||
// alert('t'+value);
|
||||
return true;
|
||||
}else
|
||||
{
|
||||
//alert('false '+value);
|
||||
return false;
|
||||
}
|
||||
|
||||
},
|
||||
message: '请输入正确电话或手机格式'
|
||||
},
|
||||
name: {// 验证姓名,中文或英文,必须输入全是中文或全是英文
|
||||
validator: function (value) {
|
||||
return /^[\Α-\¥]+$/i.test(value) | /^\w+[\w\s]+\w+$/i.test(value);
|
||||
},
|
||||
message: '请输入姓名'
|
||||
},
|
||||
faxno: {// 验证传真
|
||||
validator: function (value) {
|
||||
// return /^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/i.test(value);
|
||||
return /^((\d{2,3})|(\d{3}\-))?(0\d{2,3}|0\d{2,3}-)?[1-9]\d{6,7}(\-\d{1,4})?$/i.test(value);
|
||||
},
|
||||
message: '传真号码不正确'
|
||||
}
|
||||
});
|
||||
|
||||
$(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="" validtype="name" invalidMessage="请输入正确名称"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>联系电话</th>
|
||||
<td><input name="tel" class="easyui-textbox" data-options="required:true,validType:'isBlank'" value="" type="text" validtype="phoneRex" invalidMessage="请输入正确的电话号码"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>联系传真</th>
|
||||
<td><input name="fax" class="easyui-textbox"
|
||||
data-options="required:false" value="" validtype="faxno" invalidMessage="请输入正确传真号" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>E-mail</th>
|
||||
<td><input name="email" class="easyui-textbox"
|
||||
data-options="required:false" value="" type="text" validtype="email" required="true" missingMessage="不能为空" invalidMessage="请输入正确的邮箱格式" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>联系人</th>
|
||||
<td><input name="contactname" class="easyui-textbox"
|
||||
data-options="required:false" value="" validtype="name" invalidMessage="请输入正确名称"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>联系人电话</th>
|
||||
<td><input name="contacttel" class="easyui-textbox"
|
||||
data-options="required:false" value="" type="text" validtype="phoneRex" invalidMessage="请输入正确的电话号码"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>地址</th>
|
||||
<td><input name="address" class="easyui-textbox"
|
||||
data-options="required:false" value="" validtype="length[0,250]" invalidMessage="有效长度0-250"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td><input id="remark" 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>
|
||||
126
bin/WebRoot/jsp/material/clientsEdit.jsp
Normal file
126
bin/WebRoot/jsp/material/clientsEdit.jsp
Normal file
@ -0,0 +1,126 @@
|
||||
<!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 + "/material/clients/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() {
|
||||
});
|
||||
//信息验证
|
||||
$.extend($.fn.validatebox.defaults.rules, {
|
||||
phoneRex: {//电话号码自定义验证
|
||||
validator: function(value){
|
||||
var rex=/^1[3-8]+\d{9}$/;
|
||||
//var rex=/^(([0\+]\d{2,3}-)?(0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/;
|
||||
//区号:前面一个0,后面跟2-3位数字 : 0\d{2,3}
|
||||
//电话号码:7-8位数字: \d{7,8
|
||||
//分机号:一般都是3位数字: \d{3,}
|
||||
//这样连接起来就是验证电话的正则表达式了:/^((0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/
|
||||
var rex2=/^((0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$/;
|
||||
if(rex.test(value)||rex2.test(value))
|
||||
{
|
||||
// alert('t'+value);
|
||||
return true;
|
||||
}else
|
||||
{
|
||||
//alert('false '+value);
|
||||
return false;
|
||||
}
|
||||
|
||||
},
|
||||
message: '请输入正确电话或手机格式'
|
||||
},
|
||||
name: {// 验证姓名,中文或英文,必须输入全是中文或全是英文
|
||||
validator: function (value) {
|
||||
return /^[\Α-\¥]+$/i.test(value) | /^\w+[\w\s]+\w+$/i.test(value);
|
||||
},
|
||||
message: '请输入姓名'
|
||||
},
|
||||
faxno: {// 验证传真
|
||||
validator: function (value) {
|
||||
// return /^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/i.test(value);
|
||||
return /^((\d{2,3})|(\d{3}\-))?(0\d{2,3}|0\d{2,3}-)?[1-9]\d{6,7}(\-\d{1,4})?$/i.test(value);
|
||||
},
|
||||
message: '传真号码不正确'
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form method="post" class="form">
|
||||
<input name="id" type="hidden" value="${clients.id}"/>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>客户名称</th>
|
||||
<td><input name="name" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${clients.name}" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>联系电话</th>
|
||||
<td><input name="tel" class="easyui-textbox"
|
||||
data-options="required:true,validType:'isBlank'" value="${clients.tel}" type="text" validtype="phoneRex" invalidMessage="请输入正确的电话号码"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>联系传真</th>
|
||||
<td><input name="fax" class="easyui-textbox"
|
||||
data-options="required:false" value="${clients.fax}" validtype="faxno" invalidMessage="请输入正确传真号"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>E-mail</th>
|
||||
<td><input name="email" class="easyui-textbox"
|
||||
data-options="required:false" value="${clients.email}" validtype="email" required="true" missingMessage="不能为空" invalidMessage="请输入正确的邮箱格式"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>联系人</th>
|
||||
<td><input name="contactname" class="easyui-textbox"
|
||||
data-options="required:false" value="${clients.contactname}" validtype="name" invalidMessage="请输入正确名称"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>联系人电话</th>
|
||||
<td><input name="contacttel" class="easyui-textbox"
|
||||
data-options="required:false" value="${clients.contacttel}" validtype="phoneRex" invalidMessage="请输入正确的电话号码"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>地址</th>
|
||||
<td><input name="address" class="easyui-textbox"
|
||||
data-options="required:false" value="${clients.address}" validtype="length[0,250]" invalidMessage="有效长度0-250"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>备注</th>
|
||||
<td><input id="remark" name="remark" class="easyui-textbox"
|
||||
data-options="multiline:true" validtype="length[0,250]" invalidMessage="有效长度0-250"
|
||||
style="overflow:auto;height:80px;width:100%" value="${clients.remark}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user