Administrator
2023-04-17 63fbfddabe08e353ad75e495c2ac8dc5203da88c
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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition template="/template/nit/tmp_brief.xhtml">
    <ui:define name="acss">
        <style>
        #searchBtn {
            height: 34px;
        }
        p.error {
            color: #D9534F
        }
        input.error {
            border: 1px solid #D9534F;
        }
        #simple-table th,#simple-table td{
            text-align: center;
            padding: 1px 8px;
        }
        #form .control-label {
            margin-right: -14px
        }
        .t-error{
            color: red;
            position: relative;
            right: 2px;
            top: 3px;
        }
        i.fa.danger {
            color: #D15B47
        }
        i.fa.success {
            color: #87B87F
        }
        .pagination {
            margin: 10px 0;
        }
        #simple-table th {
            padding: 0
        }
        .th {
            position: relative;
            width: 100%;
            display: block;
            background: #F2F2F2;
            border: 1px solid #DDDDDD;
            z-index: 1;
            border-left: none;
        }
        .btn-xs, .btn-group-xs > .btn{
            padding-top: 0px;
            padding-bottom: 0px;
        }
        </style>
    </ui:define>
    <ui:define name="acontent">
 
        <div class="row" style="width: 100%;height: 100%">
        <div style=" margin:0 auto;margin-top: 200px;">
         <div class="col-xs-3">
         </div>
            <div class="col-xs-5">
                 <div class="input-group" style="margin-bottom:20px" >
                       <span class="input-group-btn" style="font-size: 20px">厂区:</span>
                       <SELECT style="width:120px" id="cq" >
                        <OPTION value="04" >明泰科技</OPTION>
                        <OPTION value="03"  >郑州明泰</OPTION>
                        <OPTION value="06"  >河南明晟</OPTION>
                        <OPTION value="08"  >义瑞新材</OPTION>
                    </SELECT>
                 </div>
                <div class="input-group" >
                   <span class="input-group-btn" style="font-size: 20px">卡号:</span>
                    <input class="form-control input-mask-date" type="text" id="keyword" style="float: left;" placeholder="输入卡号搜索"/>
                    <span class="input-group-btn">
                        <button class="btn btn-sm btn-default" type="button" id="searchBtn">
                            <i class="ace-icon fa fa-search bigger-110"></i>
                            搜索
                        </button>
                    </span>
                </div>
            </div>
        </div>
        </div>
    </ui:define>
    <ui:define name="myscript">
    <script type="text/javascript">
        window.cqNo='cqNo';
 
        $('#searchBtn').click(function(event) {
            if($('#keyword').val()==null||$('#keyword').val().trim().length!=10 ){
                alert("卡号不正确,请输入正确的卡号!");
            }else{
                let a=$('#keyword').val();
                let b=$('#cq').children('option:selected').val();
                window.location.href='/task/printbycard.htm?cardno='+a+'&amp;cqNo'=b;
           //        $.post("/task/printbycard.htm", {cardno: a, cqNo: b},
              //   function (data, textStatus, jqXHR) {
              //       if (data.code >= 1) {
              //           swal({title:'',text:data.errmsg,type:'error',confirmButtonText:'确定'});
              //           return;
              //       }
              //       if (data.code == 0) {
              //           // showErrmsg('发送成功!');
              //           return;
              //       }
              //   },
              //       "json"
                    // );
 
            }
 
 
        });
           //页面初始化的时候查找cookies 存在
        $(function(){
            init();
        })
 
        function init(){
                var cqno = getCookie(window.cqNo);
                if(cqno!=null){
                    $("#cq option[value='"+cqno+"']").attr("selected", true);
                }else{
                    $("#cq option[value='04']").attr("selected", true);
                }
 
        }
 
         $('#cq').change(function(){
      var p1=$(this).children('option:selected').val();//这就是selected的值
      document.cookie=window.cqNo+"="+p1;
    })
 
        function getCookie(name) {
            var prefix = name + "="
            var start = document.cookie.indexOf(prefix)
 
            if (start == -1) {
                return null;
            }
            var end = document.cookie.indexOf(";", start + prefix.length)
            if (end == -1) {
                end = document.cookie.length;
            }
 
            var value = document.cookie.substring(start + prefix.length, end)
            return unescape(value);
        }
    </script>
    </ui:define>
</ui:composition>
</html>