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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<!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>
        <script src="../../js/jquery.js"></script>
        <script src="../../js/jquery-1.11.1.js"></script>
        <script src="../../js/jquery.xml2json.js.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" />
        <link rel="stylesheet" type="text/css" href="../lyt/css/common_s.css" />
        <script src="../../js/mui.picker.min.js"></script>
        <style type="text/css">
            .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;
            }
 
            .font-s {
                font-size: 1.4rem;
            }
 
            .item-height {
                height: 3.5rem;
            }
 
            .p-left {
                width: 50%;
                float: left;
            }
 
            .p-right {
                width: 50%;
                float: left;
            }
        </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 font">记录查询</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>
            <button type="button" class="mui-btn mui-btn-blue mui-icon mui-icon-arrowup back-top font" id="backTop">
                回到顶部</button>
            <div class="mui-scroll-wrapper" id="pullrefresh">
                <div class="mui-scroll" id="contentId">
                </div>
            </div>
            <script id='record-template' type="text/template">
                <% for(var i in record){ var item=record[i]; %>    
            <div class="mui-card">
                <div class="mui-card-header font">
                    型号-工序:<%=(item.BOARD_MODEL)%>-<%=(item.PPROC_NAME)%>
                    {{if item.FSUBMIT=="0"}}
                        <div class="font-seal-apply">待提交</div>
                    {{else if item.FCOMFIR=="0"}}
                        <div class="font-seal-r">待审核</div>
                    {{else}}
                        <div class="font-seal-r-ok">已审核</div>
                    {{/if}}
                </div>
                <div class="mui-card-content">
                    <ul class="mui-table-view">
                        <li class="mui-table-view-cell mui-media" mid-data='<%=(item.ID)%>'>
                            <a href="javascript:;" class="mui-navigate-right">
                                <div class="mui-media-body">
                                    <p class='mui-ellipsis font-s p-left'>
                                        </br>
                                        工单号:<%=(item.TASK_NO)%></br></br>
                                        检查水平:<%=(item.ONE_TIME)%></br></br>    
                                        电池类型:<%=(item.FOIL_TYPE)%></br></br>
                                        班次:<%=(item.CLASS_NO)%></br></br>
                                        检验单号:<%=(item.FBILL_NO)%></br></br>
                                        检验结果:<%=(item.FCHECK_RESULT)%></br></br>
                                        数量:<%=(item.FLOT_QTY)%></br></br>                                    
                                    </p>                                    
                                    <p class='mui-ellipsis font-s p-right'>
                                        </br>
                                        </br></br>
                                        接收标准:<%=(item.TWO_TIME)%></br></br>    
                                        客户名称:<%=(item.COATING_TYPE)%></br></br>
                                        </br></br>
                                        送检单号:<%=(item.STATION_NO)%></br></br>
                                        最终结果:<%=(item.FFINAL_RESULT)%></br></br>
                                        良品数量:<%=(item.GOOD_QTY)%></br></br>
                                    </p>
                                </div>
                                <div class="mui-media-body">
                                    <p class='mui-ellipsis font-s'>
                                        备注:<%=(item.FNG_REASON)%></br></br>
                                    </p>
                                </div>
                            </a>
                        </li>
                    </ul>
                    <div>
                    </div>
                </div>
                <div class="mui-card-footer">
                    <span class="font-s">检验人:<%=(item.TFNAME)%></span>
                    <span class="font-s p-right">检验时间:<%=(item.FTEST_DATE)%></span>
                </div>
                <div class="mui-card-footer">
                    <span class="font-s">提交人:<%=(item.SFNAME)%></span>
                    <span class="font-s p-right">提交时间:<%=(item.FSUBMIT_DATE)%></span>
                </div>
                <div class="mui-card-footer">
                    <span class="font-s">修改人:<%=(item.UFNAME)%></span>
                    <span class="font-s p-right">修改时间:<%=(item.LASTUPDATE_DATE)%></span>
                </div>
                <div class="mui-card-footer">
                    <span class="font-s">审核人:<%=(item.CFNAME)%></span>
                    <span class="font-s p-right">审核时间:<%=(item.FCOMFIR_DATE)%></span>
                </div>
            </div>
        </div>
        <%}%>
        </script>
            <script type="text/javascript" charset="utf-8">
                var urlId = '';
                var searchType = '';
                var keyword = '';
                var count = 1;
                mui.init({
                    pullRefresh: {
                        container: '#pullrefresh',
                        down: { //下拉刷新
                            auto: true, //可选,默认false.自动下拉刷新一次
                            contentdown: "下拉可以刷新", //可选,在下拉可刷新状态时,下拉刷新控件上显示的标题内容
                            contentover: "释放立即刷新", //可选,在释放可刷新状态时,下拉刷新控件上显示的标题内容
                            contentrefresh: "正在刷新...", //可选,正在刷新状态时,下拉刷新控件上显示的标题内容
                            callback: pulldownRefresh
                        },
                        up: { //上拉加载
                            //auto:true,//可选,默认false.自动上拉加载一次
                            contentrefresh: '正在加载...',
                            contentnomore: '没有更多数据了', //可选,请求完毕若没有更多数据时显示的提醒内容;
                            callback: pullupRefresh
                        }
                    }
                });
                mui.plusReady(function() {
                    searchType = plus.webview.currentWebview().searchType;
                    urlId = plus.webview.currentWebview().urlId;
                    getData(searchType, "", 1, 2);
                    document.getElementById('searchBtn').addEventListener('tap', function(event) {
                        keyword = document.getElementById('keyword').value;
                        if (keyword == '') {
                            mui.toast('请先填写关键字')
                            return;
                        }
                        getData(searchType, keyword, 1, 2);
                    });
                    mui("#contentId").on("tap", "li", function() {
                        var mid_data = this.getAttribute('mid-data'); //主表ID
                        //console.log(JSON.stringify(mid_data + " " + searchType + " " + urlId));
                        OpenWindow('search_fucechoujian_detail', 'search_fucechoujian_detail.html', {
                            "mid": mid_data,
                            "urlId": urlId,
                            "searchType": searchType
                        })
                    })
                })
 
                function pulldownRefresh() {
                    count = 1; //第一页
                    type = 1; //代表下拉刷新
                    getData(searchType, keyword, count, type); //具体取数据的方法
                }
 
                function pullupRefresh() {
                    count++; //翻下一页
                    type = 2; //代表上拉加载
                    getData(searchType, keyword, count, type); //具体取数据的方法
                }
 
                function getData(searchType, keyword, page, type) {
                    //console.log(page)
                    //console.log(JSON.stringify(searchType) + ' ' + JSON.stringify(keyword));
                    aj.post(urlId, {
                        "factory": api_localStorageGet("factory"),
                        "company": api_localStorageGet("company"),
                        "ftype": searchType,
                        "keyword": keyword,
                        "mid": "",
                        "size": 12,
                        "page": page
                    }, function(data) {
                        console.log(searchType + " " + data.data.MAIN.length);
                        if (data.result) {
                            var mainData = data.data.MAIN
                            /*document.getElementById('contentId').innerHTML = template('record-template', {
                                "record": mainData
                            }); */
 
                            if (type == 2) { //下拉加载
                                if (mainData.length > 0) {
                                    var html = '';
                                    if (page != 1) {
                                        html = document.getElementById("contentId").innerHTML;
                                    }
                                    document.getElementById('contentId').innerHTML = html + template('record-template', {
                                        "record": mainData
                                    });
                                } else if (page == 1 && mainData.length == 0) { //数据清空后不会遗留
                                    document.getElementById('contentId').innerHTML = template('record-template', {
                                        "record": []
                                    });
                                }
                                mui('#pullrefresh').pullRefresh().endPulldownToRefresh(); //结束下拉刷新
                                //结束上拉加载,并根据情况切换“下拉显示更多数据”,以及“没有更多数据了”。执行endPullupToRefresh()方法,结束转雪花进度条的“正在加载...”过程,若还有更多数据,则传入false; 否则传入true,之后滚动条滚动到底时
                                if (mainData.length > 0) {
                                    mui('#pullrefresh').pullRefresh().endPullupToRefresh(false);
                                } else {
                                    mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
                                }
                            }
                            if (type == 1) { //上拉刷新
                                /*下面这句很关键!*/
                                mui('#pullrefresh').pullRefresh().refresh(
                                    true); //有重新触发上拉加载的需求(比如当前类别已无更多数据,但切换到另外一个类别后,应支持继续上拉加载)
                                //plus.nativeUI.closeWaiting();//数据渲染完毕,关闭加载框
                                mui.currentWebview.show(); //显示当前页面
                                var html = '';
                                //console.log(page != 1)
                                if (page != 1) {
                                    html = document.getElementById("contentId").innerHTML;
                                }
                                document.getElementById('contentId').innerHTML = html + template('record-template', {
                                    "record": mainData
                                });
                            }
                        } else {
                            plus.ui.toast(data.msg);
                        }
                    });
                }
 
 
                $("#backTop").click(function() { //回到顶部
                    mui.scrollTo(0, 100);
                })
            </script>
    </body>
</html>