严智鑫
2025-11-13 945bc394f40d8af1072a53da9a94f24207124e6d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<%@ 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>