1
yhj
2025-03-31 9003044073373185511f1e2c901285a3287e7fa4
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<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;
            }
            .mui-toast-container {
            top: 50% !important; 
            }
            
            .mui-toast-message {
            font-size: 1rem;
            padding: 10px 25px;
            text-align: center;
            color: #fff;
            border-radius: 6px;
            background-color: #323232;
            }
        </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>
            <span class="title-right" id="usr"></span>
            <span class="title-right mui-icon mui-icon-camera" style="color:#ffffff;" id="cameraId"></span>
        </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="model_list">
                </ul>
            </div>
            <script id='model-template' type="text/template">
                <% for(var i in record){ var item=record[i]; %>
                    <li class="mui-table-view-cell item-heigh" data-flot= "<%=(item.ITEM_MODEL)%>">
                    <a class="mui-navigate-right font"><%=(item.ITEM_MODEL)%></a>
                    </li>
                <% } %>
            </script>
            <div class="mui-scroll">
                <ul class="mui-table-view" style="margin-top: 2px;" id="list">
                </ul>
            </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)%>" data-view="<%=(item.TASK_NO)%>">
                    <a class="mui-navigate-right font"><%=(item.TASK_NOSHOW)%></a>
                    </li>
                <% } %>
            </script>
        </div>
        <script type="text/javascript" charset="utf-8">
            mui.init({});
            var urlId = '';
            var keyword = '';
            mui.plusReady(function() {
                document.getElementById("usr").innerHTML = setUsrCode()
                urlId = plus.webview.currentWebview().urlId;
                searchType = plus.webview.currentWebview().searchType;
                fparam = plus.webview.currentWebview().fparam;
                getData(fparam.lineType);
                document.getElementById('searchBtn').addEventListener('tap', function(event) {
                    keyword = document.getElementById('keyword').value;
                    if (keyword == '') {
                        mui.toast('请先填写关键字', {
                            duration: 'long',
                            type: 'div'
                        })
                        return;
                    }
                    console.log(keyword)
                    getData(fparam.lineType);
                });
 
                mui("#model_list").on("tap", "li", function(event) {
                    var i = this.getAttribute('data-flot');
                    var view = plus.webview.currentWebview().opener();
                    mui.fire(view, 'changeModel', {
                        flot: i
                    });
                    mui.back()
                });
                //选中
                mui("#list").on("tap", "li", function(event) {
                    var i = this.getAttribute('data-flot');
                    var v = this.getAttribute('data-view');
                    var view = plus.webview.currentWebview().opener();
                    mui.fire(view, 'changeBatch', {
                        flot: i,
                        task: v
                    });
                    mui.back()
                });
            })
 
            function getData(lineType) {
                aj.post(urlId, {
                    "factory": api_localStorageGet("factory"),
                    "company": api_localStorageGet("company"),
                    "ftype": searchType,
                    "period": fparam.period,
                    "procno": fparam.procno,
                    "modelno": fparam.modelno==""?keyword:fparam.modelno, // 当searchType为型号时,传入模糊查询关键字,
                    "keyword": lineType==undefined?keyword:lineType // 当searchType为型号时,传入系列
                }, function(data) {
                    if (data.result) {
                        // console.log(JSON.stringify(data) )
                        if (searchType == "型号") {
                            document.getElementById('model_list').innerHTML = template('model-template', {
                                "record": data.data
                            });
                        } else if (searchType == "工单") {
                            document.getElementById('list').innerHTML = template('ui-template', {
                                "record": data.data
                            });
                        }
 
                    } else {
                        mui.toast(data.msg, {
                            duration: 'long',
                            type: 'div'
                        });
                    }
                });
            }
        </script>
    </body>
 
</html>