<%@ page language="java" contentType="text/html; charset=utf-8"
|
pageEncoding="utf-8"%>
|
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
<html>
|
<head>
|
<script type="text/javascript" src="${ctx}/static/jquery/jquery-3.1.0.min.js"></script>
|
<script language="javascript" type="text/javascript" src="${ctx}/static/util3.js"></script>
|
<title>领取任务</title>
|
<script type="text/javascript">
|
function checkTask(txtid){
|
var txtid = txtid;
|
$.ajax({
|
async: false,
|
|
type:"GET",
|
|
url:"${ctx}/cutmanage/checktask?txtid="+txtid+"&prodline=2", //领取任务前校验产线状态,任务状态,库存情况
|
|
dataType:"text",
|
|
success:function(data){
|
if(data=="ok"){
|
window.location.href="${ctx}/cutmanage/gottask2?txtid="+txtid;
|
}else if(data=="norawpackage"){
|
$.MsgBox.Alert("WARM PROMPT", "当前切割文件没有原片!");
|
//alert("No tasks can be claimed at present!");
|
return false;
|
}else if(data=="invalidtask"){
|
$.MsgBox.Alert("WARM PROMPT", "当前任务已被领取!");
|
return false;
|
//alert("No tasks can be claimed at present!");
|
}else if(data=="startedstandalone"){
|
$.MsgBox.Alert("WARM PROMPT", "请结束单机模式,领取任务!");
|
return false;
|
//alert("No tasks can be claimed at present!");
|
}else if(data=="operating"){
|
$.MsgBox.Alert("WARM PROMPT", "另一条产线正在操作当前任务,请稍后重试!");
|
return false;
|
}else{
|
//目前库存原片不足
|
$('#confirm').modal('toggle');
|
$('#confirmForm').attr('action', '${ctx}/cutmanage/gottask2');
|
document.getElementById("bodyTxt").value = data;
|
$('#confirmInput').attr('name', 'txtid');
|
$('#confirmInput').attr('value', txtid);
|
}
|
|
},
|
error: function (XMLHttpRequest,textStatus,errorThrown) {
|
alert(XMLHttpRequest.status);
|
alert(XMLHttpRequest.readyState);
|
alert(textStatus);
|
alert("There are problems of the current analysis!")
|
},
|
});
|
|
}
|
|
</script>
|
</head>
|
<body>
|
<div class="content-wrapper">
|
<!-- Content Header (Page header) -->
|
<div>
|
<section class="content-header">
|
<h1>
|
领取任务
|
<small></small>
|
</h1>
|
<ol class="breadcrumb">
|
<li><a href="${ctx }/cutmanage/gettask2"><i class="fa fa-reply"></i>领取任务</a></li>
|
<li class="active">领取</li>
|
</ol>
|
</section>
|
</div>
|
<div>
|
<!-- Main content -->
|
<section class="content container-fluid">
|
<div class="box" style="font-size: large;">
|
<div class="box-header" align="center">
|
<h1 class="box-title" style="font-size: x-large;">任务列表</h1>
|
</div>
|
<div style="overflow: auto;height:600px;" class="box-body no-padding">
|
<table class="table table-striped">
|
<tr>
|
<!-- <thead class="fixedThead"> -->
|
<th>ID</th>
|
<th>文件名</th>
|
<th>状态</th>
|
<th>创建时间</th>
|
<th>操作</th>
|
<!-- </thead> -->
|
</tr>
|
<tbody class="scrollTbody">
|
<c:forEach items="${rawPackageTxts}" var="rawPackageTxts" varStatus="status1">
|
<!-- varStatus用来存放到当前循环的变量信息 ,此处没有卵用-->
|
<tr>
|
<td>${rawPackageTxts.id}</td>
|
<td>${rawPackageTxts.txt_name}</td>
|
<td>${rawPackageTxts.status}</td>
|
<td>${rawPackageTxts.createTime}</td>
|
<td><input type="button" onclick="checktask(${rawPackageTxts.id})" value="领取" class="btn btn-middle btn-info"/></td>
|
</tr>
|
</c:forEach>
|
</tbody>
|
</table>
|
</div>
|
</div>
|
|
|
<div id="confirm" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
<form id="confirmForm" method="get">
|
<div class="modal-header">
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
<h3 id="myModalLabel"></h3>
|
</div>
|
<div class="modal-body">
|
<input type="hidden" id="confirmInput">
|
<input type="text" id="bodyTxt" style="width: 470px; font-size: large; border: 0px; font-weight: bolder; background-color: white;" readonly="readonly"/>
|
</div>
|
<div class="modal-footer">
|
<button type="submit" class="btn btn-primary">Commit</button>
|
<button type="button" class="btn" data-dismiss="modal">Close</button>
|
</div>
|
</form>
|
</div>
|
</section>
|
</div>
|
<!-- /.content -->
|
</div>
|
</body>
|
</html>
|