1
hao
2025-04-16 8f175e836561887b940ae5d3a125425ee9095370
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
<!doctype html>
<html>
 
    <head>
        <meta charset="utf-8">
        <title>批号查询</title>
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <script src="../../js/mui.min.js"></script>
        <script src="../../js/api.js"></script>
        <script src="../../js/common.js"></script>
        <script src="../../js/template-web.js"></script>
        <link href="../../css/mui.min.css" rel="stylesheet" />
        <link href="../../css/mui.picker.min.css" rel="stylesheet" />
        <link rel="stylesheet" type="text/css" href="../../css/iconfont.css" />
        <script src="../../js/mui.picker.min.js"></script>
        <style type="text/css">
            .mui-content {
                margin-top: 2px;
            }
 
            .search {
                border: 1px solid #e0e0e0;
                border-radius: 5px;
                display: flex;
                width: 100%;
                align-items: center;
                margin-top: 10px;
                /* padding:0px 10px 0;*/
                background-color: rgba(255, 255, 255, 1);
                padding-left: 10px;
                margin-bottom: 10px;
                height: 40px;
            }
 
            .search input {
                margin-bottom: 2px;
                padding: 0px 0px;
                background: none;
                font-size: 1.6rem;
            }
            
            .font{
                font-size: 1.6rem;
            }
            
            .item-height{
                height:3.5rem;
            }
        </style>
    </head>
 
    <body class="mui-fullscreen">
        <header class="mui-bar mui-bar-nav">
            <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
            <h1 class="mui-title">批号查询</h1>
        </header>
        <div class="mui-content">
            <div class="search">
                <input type="search" class="mui-input-clear" id="keyword" placeholder="输入关键字查询">
                <button type="button" data-loading-text="查询中" id="searchBtn" style="font-size:1.3rem;"  class="mui-btn mui-btn-green mui-icon  mui-icon-plus">点击查询</button>
            </div>
            <div class="mui-scroll">
                <ul class="mui-table-view" style="margin-top: 2px;" id="list">
                </ul>
            </div>
            <script id='ui-template' type="text/template">
                <% for(var i in record){ var item=record[i]; %>
                    <li class="mui-table-view-cell item-heigh" data-flot= "<%=(item.LOT_NO)%>">
                    <a class="mui-navigate-right font"><%=(item.LOT_NO)%></a>
                    </li>
                <% } %>
            </script>
        </div>
        <script type="text/javascript" charset="utf-8">
            mui.init({});
            var urlId = '';
            mui.plusReady(function() {
                urlId = plus.webview.currentWebview().urlId;
                //console.log(urlId)
                getData("");
                document.getElementById('searchBtn').addEventListener('tap', function(event) {
                    var keyword = document.getElementById('keyword').value;
                    if (keyword == '') {
                        mui.toast('请先填写关键字')
                        return;
                    }
                    getData(keyword);
                });
                //选中
                mui("#list").on("tap", "li", function(event) {
                    var i = this.getAttribute('data-flot');
                    var view = plus.webview.currentWebview().opener();
                    mui.fire(view, 'changeBatch', {
                        flot: i
                    });
                    mui.back()
                });
            })
 
            function getData(keyword) {
                aj.post(urlId, {
                    "factory": api_localStorageGet("factory"),
                    "company": api_localStorageGet("company"),
                    "dataType":'1',
                    "keyword": keyword
                }, function(data) {
                    if (data.result) {
                        //console.log(JSON.stringify(data) )
                        document.getElementById('list').innerHTML = template('ui-template', {
                            "record": data.data
                        });
                    } else {
                        plus.ui.toast(data.msg);
                    }
                });
            }
        </script>
    </body>
 
</html>