陈战涛
2023-03-16 5bfe19fe69faf564751de586f5219501fdf29efc
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
var url = null;
var inHandleData = null;
var data = {
    "interfaceId": "5206",
    "sign": "10206",
    "outId": "10206",
    "reqDateTime": new Date(),
    "tokenAuth": "",
    "data": {
        "deptId": "",
        "type": "IN",
        "plateNum": "",
        "intelCard": ""
    }
};
 
//初始化数据
function init() {
    var user = JSON.parse(localStorage.getItem('user'));
    var selectDeptId = JSON.parse(localStorage.getItem('selectDeptId'));
    url = user.url + "/api-phone/v35/gateway";
    data.tokenAuth = user.tokenAuth;
    data.data.deptId = selectDeptId;
    
    //获取入库待值仓列表
    getInHandleList();
}
 
//查询入库记录
function getInHandleList() {
    inHandleData = null;
    
    //赋值参数的日期
    data.data.plateNum = mui("#plateNum")[0].value;
 
    //请求
    mui.ajax(url, {
        type: "POST",
        dataType: "json",
        crossDomain: true,
        contentType: "application/json;charset=utf-8",
        data: JSON.stringify(data),
        success: function(result) {
            if (result.code == "0000") {
                inHandleData = result.data;
                renderData();
            } else {
                renderData();
                mui.toast(result.mag);
            }
        },
        error: function() {
            mui.alert("系统繁忙,请重试!", "提示", ["确定"], function() {}, "div")
        }
    })
}
 
//渲染页面
function renderData() {
    var html = '';
    if(inHandleData){
        if (inHandleData && inHandleData.length > 0) {
            $.each(inHandleData, function(index, item) {
                html += '<li><div class="con"><div class="top">';
                html += '<div class="info">车牌号: <b>' + (item.plateNum == null ? "" : item.plateNum) +'</b></div>';
                html += '<a href="" class="link">值仓<span class="mui-icon mui-icon-arrowright"></span></a>';
                html += '</div><div class="box">';
                html += '<div class="item"><div class="conbox" style="background-image: url(images/icons/g-i19.png);">';
                html += '<div class="h3">' + (item.depotName == null ? "" : item.depotName) + '</div>';
                html += '<div class="bot">目标仓库</div></div></div>';
                html += '<div class="item"><div class="conbox" style="background-image: url(images/icons/g-i20.png);">';
                html += '<div class="h3">' + (item.foodVarietyName == null ? "" : item.foodVarietyName) + '</div>';
                html += '<div class="bot">粮食品种</div></div></div>';
                html += '<div class="item"><div class="conbox" style="background-image: url(images/icons/g-i21.png);">';
                html += '<div class="h3">' + (item.foodLevelName == null ? "" : item.foodLevelName) + '</div>';
                html += '<div class="bot">粮食等级</div></div></div>';
                html += '</div></div></li>';
            })
        } else {
            html += '<li><div class="con"><div style="text-align: center;font-size: 20px;color:#dd524d;padding-top: 16px;">暂无入库待值仓信息</div></div></li>';
        }
    }else{
        html += '<li><div class="con"><div style="text-align: center;font-size: 20px;color:#dd524d;padding-top: 16px;">暂无入库待值仓信息</div></div></li>';
    }
    $("#handleList").html(html);
}
 
//滑动
mui('.mui-scroll-wrapper').scroll({
    indicators: false, //是否显示滚动条
    deceleration: 0.0006, //阻尼系数,系数越小滑动越灵敏
    bounce: false, //是否启用回弹
    deceleration: 0.0005 //flick 减速系数,系数越大,滚动速度越慢,滚动距离越小,默认值0.0006
});