严智鑫
2024-05-13 cedce4883f0d204f5bf7bf87c0bf4858dabb0c23
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
 
<html>
<head>
<title>磨边机设置</title>
    <script type="text/javascript"
    src="${pageContext.request.contextPath}/static/js/jquery.min.js"></script>
<script type="text/javascript"
    src="${pageContext.request.contextPath}/static/js/jquery.dataTables.min.js"></script>
<script type="text/javascript"
    src="${pageContext.request.contextPath}/static/js/dataTables.bootstrap.js"></script>
<script type="text/javascript"
    src="${pageContext.request.contextPath}/static/js/dataTables.tableTools.js"></script>
<script type="text/javascript"
    src="${pageContext.request.contextPath}/static/js/moment.js"></script>
<script type="text/javascript"
    src="${pageContext.request.contextPath}/static/js/sucaijiayuan.js"></script>
<script type="text/javascript"
    src="${pageContext.request.contextPath}/static/laydate/laydate.js"></script>
<script type="text/javascript" src="${ctx}/static/util/utilAlert.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/draw.js"></script>
    <style>
    td{
        text-align:center;
    }
    </style>
 
</head>
<body>
<script type="text/javascript">
  function tdclick(obj){
     var t= obj.innerText;
       var p=obj.parentNode.parentNode;
       if(t=="选择"){
           obj.innerText="取消";
           p.style="background-color:rgba(161,203,237,255)";
      
       } else
       if(t=="取消"){
           obj.innerText="选择";
           p.style="background-color:rgba(0,0,0,0)";
       }
  }
  
  function btclick1(bt){
      var a=bt.innerText;
      var tab=document.getElementById("tab1");
     
      if(a=="仅显选择"){
          bt.innerText="显示全部";
          for(var i=1;i<tab.rows.length;i++){
             if(tab.rows[i].cells[0].innerText!="取消")
          tab.rows[i].style.display="none";
          }
      }
      else if(a=="显示全部"){
          bt.innerText="仅显选择";
          for(var i=1;i<tab.rows.length;i++){
              tab.rows[i].style.display="table-row";
              }
      }
  }
  
  function btclick2(){
      var s="";
      var tab=document.getElementById("tab1");
      var first=true;
      for(var i=1;i<tab.rows.length;i++){
             if(tab.rows[i].cells[0].innerText=="取消")
             {
                 var k=tab.rows[i].dataset.id;
                 if(first){
                     s=k;
                   first=false;
                 }
                 else
                 s+=","+k;
             }
        
      }
         alert(s);
         var data={'action':'cancel','ids':s};
         $.post("ajtab",data,function(){
             window.location.reload();
         }
         );         
  }
 
  function btclick3(){
      var s="";
      var tab=document.getElementById("tab1");
      var first=true;
      for(var i=1;i<tab.rows.length;i++){
             if(tab.rows[i].cells[0].innerText=="取消")
             {
                 var k=tab.rows[i].dataset.id;
                 if(first){
                     s=k;
                   first=false;
                 }
                 else
                 s+=","+k;
             }
        
      }
         alert(s);
         var data={'action':'create','ids':s};
         $.post("ajtab",data,function(data){
             if(data!="success"){
             alert(data);
             }
             else
             window.location.reload();
         }
         );         
  }
  
  function btclick4(){
      var combo=document.getElementById("combo");
      var idx= combo.selectIndex;
  }
  
</script>
<div class="content-wrapper" style="margin-top:0px">
 <div style="margin-bottom:10px;">
 <p>补片</p>
   <span>材料</span>
   
   <form action="ajtab" method="get"  style="display: inline">
   <select style="width:100px" id="combo" name="select">
    ${select}
   </select>
  <input type="submit" value="查询" style="height:28px;border:none;background-color:#5CADFE;padding-left:8px;padding-right:8px;border-radius:3px;margin-right:30px"/>
</form>
   
   <button onclick="btclick1(this)" style="height:28px;border:none;background-color:#5CADFE;padding-left:8px;padding-right:8px;border-radius:3px">仅显选择</button>
   <button onclick="btclick2()" style="height:28px;border:none;background-color:#5CADFE;padding-left:8px;padding-right:8px;border-radius:3px">补片作废</button>
   <button onclick="btclick3()" style="height:28px;border:none;background-color:#5CADFE;padding-left:8px;padding-right:8px;border-radius:3px">生成补片单</button>
 </div>
 <div>
  <table border="1" id="tab1">
    <thead>
        <th style="min-width:40px">设备编号</th>
        <th style="min-width:150px">设备名称</th>
       <th style="min-width:60px">工艺</th>
        <th style="min-width:60px">最后维修时间</th>
        <th style="min-width:80px">维修周期(天)</th>
        <th style="min-width:80px";>超期(天)</th>
    </thead>
    <tbody>
        ${tbody}
    </tbody>
  </table>
  </div>
</div>
</body>
</html>