var url = null;
|
var depotList = null;
|
var data = {
|
"interfaceId": "5102",
|
"sign": "10102",
|
"outId": "10102",
|
"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;
|
getData();
|
}
|
|
//获取仓库信息
|
function getData() {
|
//发送请求获取仓库信息
|
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") {
|
depotList = result.data;
|
renderDepotList();
|
} else {
|
mui.alert(result.msg, '提示', ["确定"], function() {}, "div");
|
}
|
},
|
error: function() {
|
mui.alert('系统繁忙,请重新登录尝试!', '提示', ["确定"], function() {}, "div");
|
}
|
})
|
}
|
|
//渲染
|
function renderDepotList() {
|
var html = '';
|
if(depotList && depotList.length > 0){
|
$.each(depotList, function(index, item) {
|
html += '<li><div class="con">';
|
html += '<div class="tit">仓库名称:<span>' + (item.depotName == null?"--":item.depotName) + '</span></div>';
|
html += '<div class="txt">';
|
html += '<div class="box"><div class="group type"><div class="desc">';
|
html += (item.depotTypeName == null?"--":item.depotTypeName) + '</div><div class="ort">仓库类型</div></div></div>';
|
html += '<div class="box"><div class="group state"><div class="desc">';
|
html += (item.depotStatusName == null?"--":item.depotStatusName) + '</div><div class="ort">仓库状态</div></div></div>';
|
html += '<div class="box"><div class="group weight"><div class="desc">';
|
html += (item.storageReal == null?"--":item.storageReal) + '<span class="w"> KG</span></div><div class="ort">实际储量</div></div></div></div>';
|
html += '<div class="edit"><div class="sel"><div class="name">粮食品种</div>';
|
html += '<div class="cont">' + (item.foodVarietyName == null?"--":item.foodVarietyName) + '</div></div>';
|
html += '<div class="peo"><div class="name">保管员</div>';
|
html += '<div class="cont">' + (item.storeKeeperName == null?"--":item.storeKeeperName) + '</div></div></div></div></li>';
|
})
|
}else{
|
html += '<li><div class="con">';
|
html += '<div class="tit"><span>暂无仓库数据</span></div>';
|
html += '<div class="txt">';
|
html += '<div class="box"><div class="group type"><div class="desc">';
|
html += '--</div><div class="ort">仓库类型</div></div></div>';
|
html += '<div class="box"><div class="group state"><div class="desc">';
|
html += '--</div><div class="ort">仓库状态</div></div></div>';
|
html += '<div class="box"><div class="group weight"><div class="desc">';
|
html += '--<span class="w"> KG</span></div><div class="ort">实际储量</div></div></div></div>';
|
html += '<div class="edit"><div class="sel"><div class="name">粮食品种</div>';
|
html += '<div class="cont">--</div></div>';
|
html += '<div class="peo"><div class="name">保管员</div>';
|
html += '<div class="cont">--</div></div></div></div></li>';
|
}
|
$("#depotList").html(html);
|
}
|
|
//滑动
|
mui('.mui-scroll-wrapper').scroll({
|
indicators: false, //是否显示滚动条
|
deceleration: 0.0006, //阻尼系数,系数越小滑动越灵敏
|
bounce: false, //是否启用回弹
|
deceleration: 0.0005 //flick 减速系数,系数越大,滚动速度越慢,滚动距离越小,默认值0.0006
|
});
|