<!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" />
|
<link href="./css/mui.min.css" rel="stylesheet" />
|
<link href="./css/mui.picker.min.css" rel="stylesheet" />
|
<style>
|
.mui-bar-nav {
|
background: #245ca7;
|
-webkit-box-shadow: none;
|
box-shadow: none;
|
}
|
.mui-title {
|
color: #FFFFFF;
|
}
|
.mui-icon-back:before,
|
.mui-icon-left-nav:before {
|
color: #FFFFFF;
|
}
|
.mui-content-padded {
|
position: fixed;
|
z-index: 10;
|
width: 100%;
|
margin:unset;
|
padding: 6px;
|
border-bottom: 2px solid #0bcece;
|
}
|
input[type=text] {
|
font-size: 16px;
|
-webkit-box-sizing: border-box;
|
box-sizing: border-box;
|
height: 35px;
|
text-align: left;
|
border: 0;
|
border-radius: 50px;
|
background-color: #efeff4;
|
margin-bottom: 1px;
|
width: 75%;
|
}
|
.sousuo{
|
font-size: 16px;
|
background:#0277f7;
|
color: #fff;
|
border-radius: 6px;
|
line-height: 22px;
|
float: right;
|
width: 22%;
|
}
|
/*出入库记录、值仓列表*/
|
.inout_record {
|
width: 96%;
|
margin: auto;
|
margin-top: 53px;
|
margin-bottom: 10px;
|
border-top-left-radius: 5px;
|
border-top-right-radius: 5px;
|
}
|
.inout_record_title {
|
background: rgb(68, 189, 245);
|
height: 10px;
|
border-top-left-radius: 5px;
|
border-top-right-radius: 5px;
|
margin-top: 5px;
|
}
|
.inout_record_body {
|
padding-left: 15px;
|
background: #FFFFFF;
|
}
|
.inout_record_body table {
|
width: 100%;
|
}
|
.inout_record_body tr {
|
border-bottom: 1px #efefef solid;
|
height: 32px;
|
line-height: 32px;
|
}
|
.inout_record_button {
|
background: #668dc1;
|
color: #fff;
|
border: 0px;
|
border-radius: 5px;
|
margin: 2px 5px;
|
float: right
|
}
|
.inout_record_one {
|
color: rgb(102, 102, 102);
|
font-size: 15px;
|
width: 35%;
|
}
|
.inout_record_two {
|
color: black;
|
font-size: 16px;
|
}
|
.heji{
|
margin-top: 6px;
|
border-radius: 6px;
|
background: #9cc5f3;
|
}
|
.heji1{
|
color: #222;
|
font-weight: 700;
|
font-size: 16px;
|
}
|
</style>
|
</head>
|
<body>
|
<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>
|
</header>
|
<div class="mui-content">
|
<div class="mui-content-padded" style="background: #FFFFFF;">
|
<input id="dateTime" type="text" onclick="search()" placeholder="请选择日期检索" readonly="readonly">
|
<button class="sousuo" onclick="getrecordInList()">查询</button>
|
</div>
|
<div class="inout_record" id="recordList">
|
<!-- <div class="inout_record_body heji">
|
<table>
|
<tr style="border-bottom: 0px #efefef solid;">
|
<td class="inout_record_one heji1">出库合计:</td>
|
<td class="inout_record_two heji1">5000 KG</td>
|
</tr>
|
</table>
|
</div>
|
<div class="inout_record_title"></div>
|
<div class="inout_record_body">
|
<table>
|
<tr>
|
<td class="inout_record_one">单据号:</td>
|
<td class="inout_record_two">03110001</td>
|
</tr>
|
<tr>
|
<td class="inout_record_one">车牌号:</td>
|
<td class="inout_record_two">豫A12345</td>
|
</tr>
|
<tr>
|
<td class="inout_record_one">仓库名称:</td>
|
<td class="inout_record_two">5号仓</td>
|
</tr>
|
<tr>
|
<td class="inout_record_one">粮食品种:</td>
|
<td class="inout_record_two">早籼稻</td>
|
</tr>
|
<tr>
|
<td class="inout_record_one">结算重量:</td>
|
<td class="inout_record_two">5000 KG</td>
|
</tr>
|
<tr style="border-bottom: 0 #efefef solid;">
|
<td class="inout_record_one">完成时间:</td>
|
<td class="inout_record_two">2021-03-11 16:54</td>
|
</tr>
|
</table>
|
</div> -->
|
</div>
|
</div>
|
<script src="./js/mui.js"></script>
|
<script src="./js/mui.picker.min.js"></script>
|
<script src="./js/jquery.min.js"></script>
|
<script src="./js/echarts.min.js"></script>
|
<script type="text/javascript" charset="utf-8">
|
mui.init();
|
var url; //接口路径
|
var recordInList; //入库记录集合
|
var dateTime; //选择时间
|
var data = {
|
"interfaceId": "5201",
|
"sign": "10201",
|
"outId": "10201",
|
"reqDateTime": new Date(),
|
"tokenAuth": "",
|
"data": {
|
"pageSize": 10,
|
"pageNo": 1,
|
"date": ''
|
}
|
};
|
|
mui.plusReady(function() {
|
var user = JSON.parse(localStorage.getItem('user'));
|
data.tokenAuth = user.tokenAuth;
|
url = user.url + "/api-phone/gateway";
|
dateTime = getDate();
|
data.data.date = dateTime;
|
$("#dateTime").val(dateTime);
|
})
|
|
//获取入库记录
|
function getrecordInList() {
|
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") {
|
recordInList = result.data;
|
if (recordInList != null && recordInList.length > 0) {
|
renderrecordInList();
|
} else {
|
$("#recordList").html('');
|
mui.toast("暂无入库信息,请选择其他时间查询!")
|
}
|
} else {
|
mui.alert(result.msg, '提示', ["确定"], function() {}, "div");
|
}
|
},
|
error: function() {
|
mui.alert('系统繁忙,请重试!', '提示', ["确定"], function() {}, "div");
|
}
|
})
|
}
|
|
//渲染
|
function renderrecordInList() {
|
var html = '';
|
var html1 = '';
|
var html2 = '';
|
$.each(recordInList, function(index, item) {
|
if (item.plateNum == '合计') {
|
html1 += '<div class="inout_record_body heji"><table>';
|
html1 += '<tr style="border-bottom: 0px #efefef solid;"><td class="inout_record_one heji1">入库合计:</td>' +
|
'<td class="inout_record_two heji1">' + item.settleWeight + ' KG</td></tr>';
|
html1 += '</table></div>';
|
} else {
|
html2 += '<div class="inout_record_title"></div><div class="inout_record_body"><table>';
|
html2 += '<tr><td class="inout_record_one">单据号:</td><td class="inout_record_two">' +
|
item.id + '</td></tr>';
|
html2 += '<tr><td class="inout_record_one">车牌号:</td><td class="inout_record_two">' +
|
item.plateNum + '</td></tr>';
|
html2 += '<tr><td class="inout_record_one">仓库名称:</td><td class="inout_record_two">' +
|
item.depotName + '</td></tr>';
|
html2 += '<tr><td class="inout_record_one">粮食品种:</td><td class="inout_record_two">' +
|
item.foodVarietyName + '</td></tr>';
|
html2 += '<tr><td class="inout_record_one">结算重量:</td><td class="inout_record_two">' +
|
item.settleWeight + ' KG</td></tr>';
|
html2 += '<tr style="border-bottom: 0 #efefef solid;"><td class="inout_record_one">完成时间:</td>' +
|
'<td class="inout_record_two">' + item.completeTime + '</td></tr>';
|
html2 += '</table></div>';
|
}
|
})
|
html = html1 + html2;
|
$("#recordList").html(html);
|
}
|
//默认获取当天日期(yyyy-MM-dd)
|
function getDate() {
|
var date = new Date();
|
var year = date.getFullYear();
|
var month, day;
|
month = date.getMonth() + 1;
|
if (month >= 1 && month <= 9) {
|
month = "0" + month;
|
}
|
day = date.getDate();
|
if (day >= 1 && day <= 9) {
|
day = "0" + day;
|
}
|
return year + "-" + month + "-" + day
|
}
|
|
//监听时间选择
|
function search() {
|
var dtPicker = new mui.DtPicker({
|
type: 'date',
|
beginDate: new Date(2010, 00, 01), //起始日期
|
value: dateTime //默认时间
|
});
|
dtPicker.show(function(selectItems) {
|
var y = selectItems.y.text; //获取选择的年
|
var m = selectItems.m.text; //获取选择的月
|
var d = selectItems.d.text; //获取选择的日
|
dateTime = y + "-" + m + "-" + d;
|
$("#dateTime").val(dateTime);
|
data.data.date = dateTime;
|
})
|
}
|
</script>
|
</body>
|
</html>
|