var url = null;
|
var recordData = null;
|
var recordList = null;
|
var data = {
|
"interfaceId": "5205",
|
"sign": "10205",
|
"outId": "10205",
|
"reqDateTime": new Date(),
|
"tokenAuth": "",
|
"data": {
|
"deptId": ""
|
}
|
};
|
|
//初始化数据
|
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;
|
|
//获取实时出入库信息
|
getRecordList();
|
}
|
|
//查询入库记录
|
function getRecordList() {
|
recordData = null;
|
|
//请求
|
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") {
|
recordData = result.data;
|
renderData();
|
} else {
|
renderData();
|
mui.toast(result.mag);
|
}
|
},
|
error: function() {
|
mui.alert("系统繁忙,请重试!", "提示", ["确定"], function() {}, "div")
|
}
|
})
|
}
|
|
//渲染页面
|
function renderData() {
|
var html = '';
|
if (recordData) {
|
$("#inSumNum").html(recordData.inSumNum);
|
$("#inCompleteNum").html(recordData.inCompleteNum);
|
$("#perInComplete").html(recordData.perInComplete);
|
$("#outSumNum").html(recordData.outSumNum);
|
$("#outCompleteNum").html(recordData.outCompleteNum);
|
$("#perOutComplete").html(recordData.perOutComplete);
|
$("#time").html("更新时间:" + recordData.time);
|
var listInout = recordData.listInout;
|
if (listInout && listInout.length > 0) {
|
$.each(listInout, function(index, item) {
|
html += '<div class="item">';
|
html += '<div class="id">单据号: ' + item.id + '<span class="status enter">' + item.type +
|
'</span></div>';
|
html += '<ul class="g-listb2">';
|
html += '<li><div class="con" style="background-image: url(images/icons/g-i24.png);">';
|
html += '车牌号:<b>' + (item.plateNum == null ? "-" : item.plateNum) + '</b></div></li>';
|
html += '<li><div class="con" style="background-image: url(images/icons/g-i25.png);">';
|
html += '仓库名称:<b>' + (item.depotName == null ? "-" : item.depotName) + '</b></div></li>';
|
html += '<li><div class="con" style="background-image: url(images/icons/g-i32.png);">';
|
html += '粮食品种:<b>' + (item.foodVarietyName == null ? "-" : item.foodVarietyName) + '</b></div></li>';
|
html += '<li><div class="con" style="background-image: url(images/icons/g-i24.png);">';
|
html += '当前流程:<span>' + (item.progressName == null ? "-" : item.progressName) +
|
'</span></div></li>';
|
html += '</ul></div>';
|
})
|
} else {
|
html += '<div class="id" style="text-align: center;">暂无实时信息</div>';
|
}
|
} else {
|
$("#inSumNum").html("0");
|
$("#inCompleteNum").html("0");
|
$("#perInComplete").html("0");
|
$("#outSumNum").html("0");
|
$("#outCompleteNum").html("0");
|
$("#perOutComplete").html("0");
|
$("#time").html("更新时间:2023-01-01 00:00:00");
|
html += '<div class="id" style="text-align: center;">暂无实时信息</div>';
|
}
|
$("#listInout").html(html);
|
}
|
|
//滑动
|
mui('.mui-scroll-wrapper').scroll({
|
indicators: false, //是否显示滚动条
|
deceleration: 0.0006, //阻尼系数,系数越小滑动越灵敏
|
bounce: false, //是否启用回弹
|
deceleration: 0.0005 //flick 减速系数,系数越大,滚动速度越慢,滚动距离越小,默认值0.0006
|
});
|