<!DOCTYPE html>
|
<html>
|
<head>
|
<meta charset="UTF-8" />
|
<meta name="viewport" content="user-scalable=0,width=device-width,initial-scale=1.0" />
|
<!-- <meta name="viewport" content="width=device-width, initial-scale=0.665, minimum-scale=0.5, maximum-scale=2.0, user-scalable=no" /> -->
|
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
<title>Boxline PDA</title>
|
|
<link rel="stylesheet" href="/layui/layui-v2.9.8/layui/css/layui.css" />
|
<link rel="stylesheet" href="/layui/css/layui.css" />
|
<!-- <link rel="stylesheet" href="/layui/layui-v2.9.8/layui/css/layui.css" /> -->
|
<link rel="stylesheet" href="/css/style.css" />
|
<script src="/js/adaptive.js"></script>
|
<link rel="stylesheet" href="/css/my.css" />
|
<link rel="stylesheet" href="/css/adapter.css" />
|
<style type="text/css">
|
.layout-bill-info {
|
height: 255px;
|
}
|
.layout-tbl-submit {
|
margin-top: 10px;
|
}
|
</style>
|
</head>
|
<body>
|
<div id="" class="main-content">
|
<div id="" class="layout-title">
|
<table border="" cellspacing="" cellpadding="">
|
<tr>
|
<td class="img-back"><a href="../index.html"><img src="/assets/back.jpg" ></a></td>
|
<td class="title-text">订单复核</td>
|
<td class="title-menu-icon"><img id="menuImg" src="/assets/menu.jpg" ></td>
|
</tr>
|
</table>
|
</div>
|
<div id="" class="layout-sub-content">
|
<div id="menuList" class="menu">
|
<ul class="" style="text-align: center;">
|
<li><a href="../index.html">主页</a></li>
|
<!-- <li><a href="productEnterConfirm.html">入库信息确认</a></li> -->
|
<li><a href="../login.html">重新登录</a></li>
|
</ul>
|
</div>
|
|
<div id="" class="layout-bill-info">
|
<form class="layui-form" action="">
|
<div id="layout-pallet" class="layui-form-item layout-input layout-dropdownlist">
|
<label class="layui-form-label" lang>系统单号:</label>
|
<div class="layui-inline" style="width: auto;">
|
<input name="" placeholder="请选择或输入单号" lay-filter="getbar" id="bar" style="width: 350px;">
|
</div>
|
</div>
|
|
<table class="layout-tbl-input" border="" cellspacing="" cellpadding="">
|
<tr>
|
<td>
|
<div id="" class="layui-form-item layout-boxinfo">
|
<label class="layui-form-label" style="width: 100px;" >当前系统单号:</label>
|
<div class="layui-input-block">
|
<input id="Code" type="text" disabled placeholder=""
|
autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
</td>
|
</tr>
|
<tr>
|
<td>
|
<div id="" class="layui-form-item layout-boxinfo">
|
<label class="layui-form-label" >上游系统单号:</label>
|
<div class="layui-input-block">
|
<input id="OrderCode" type="text" disabled placeholder=""
|
autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
</td>
|
</tr>
|
|
</table>
|
|
<br /><br /><br /><br />
|
|
<table class="layout-tbl-submit" border="" cellspacing="" cellpadding="">
|
<tr>
|
<td style="width: 23%;"></td>
|
<td>
|
<button class="layout-btn layout-btn-red" lang type="button" lay-submit
|
lay-filter="formBind">复核</button>
|
</td>
|
<td style="width: 33%;"></td>
|
|
</tr>
|
</table>
|
<!-- <div id="" class="layui-form-item layout-dropdownlist">
|
<label class="layui-form-label" lang>入库单:</label>
|
<div class="layui-input-block" id="selectDiv">
|
<input id="bar" type="text" placeholder="请选择" lay-filter="getbar" >
|
</div>
|
</div> -->
|
<!-- <div id="layout-pallet" class="layui-form-item layout-input">
|
<label class="layui-form-label">入库数量:</label>
|
<div class="layui-input-block">
|
<input id="palletNum" type="number" lay-verify="stock" placeholder="入库托盘数量"
|
autocomplete="off" class="layui-input" oninput="value=value.replace(/^(0+)|[^\d]+/g,'')">
|
</div>
|
</div>
|
<div id="layout-boxcode" class="layui-form-item layout-input">
|
<label class="layui-form-label">托盘条码:</label>
|
<div class="layui-input-block">
|
<input id="PalletNo" type="text" placeholder="请扫描托盘条码"
|
autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div id="" style="margin-left: 21%; width: 38%;float: left;">
|
<button id="btnScanBox" class="layout-btn layout-btn-blue" lay-submit lay-filter="formBind" type="button">绑定</button>
|
</div>
|
<div id="" style="width: 38%;float: left;">
|
<button id="btnScanBox" class="layout-btn layout-btn-red" lay-submit lay-filter="formUnbind" type="button">解绑</button>
|
</div> -->
|
|
</form>
|
</div>
|
|
<div id="" class="cut-line">
|
<img src="/assets/fengexian.png">
|
</div>
|
|
<div class="layout-tbl-paging" id="">
|
<table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding="">
|
<tr>
|
<th lang style="width: 15%;">编码</th>
|
<th lang style="width: 30%;">名称</th>
|
<th lang style="width: 25%;">批次</th>
|
<th lang style="width: 15%;">计划数量</th>
|
<th lang style="width: 15%;">完成数量</th>
|
</tr>
|
<tr id="boxCell" style="display: none;">
|
<td name="code">AG000001</td>
|
<td name="name">疫苗名称名称名称</td>
|
<td name="lotNo">批次号</td>
|
<td name="qty">30</td>
|
<td name="cqty"></td>
|
</tr>
|
</table>
|
<!-- 分页 -->
|
<table id="tableBoxPages" class="tbl-box-pages" border="" cellspacing="" cellpadding="">
|
<tr>
|
<td class="page-prev">上一页</td>
|
<td class="page-num page-num-select">1</td>
|
<td class="page-num">2</td>
|
<td class="page-num">3</td>
|
<td class="page-num">4</td>
|
<td class="page-num">5</td>
|
<td class="page-next">下一页</td>
|
</tr>
|
</table>
|
</div>
|
|
</div>
|
</div>
|
|
|
<script src="/js/jquery-3.5.1.min.js"></script>
|
<script src="/layui/layui-v2.9.8/layui/layui.js"></script>
|
<!-- <script src="/layui/layui.js"></script> -->
|
<script src="/js/public.js"></script>
|
<script src="/js/jquery.cookie.js"></script>
|
<script>
|
layui.use(['form', 'jquery'], function() {
|
var form = layui.form,
|
dropdown = layui.dropdown;
|
|
var arrs = [];
|
fun();
|
function fun(){
|
arrs = [];
|
$("#bar").val("");
|
setOrderGoods();
|
//修改为获取所有订单关闭单据
|
synData(IP + "/PdaAsn/GetNotices", {}, 'get', function (res) {
|
if (res.code == 0) { //成功
|
res.data.forEach(element => {
|
var arr = {};
|
arr.title = element.Title;
|
arr.Id = element.Id;
|
arrs.push(arr);
|
});
|
|
} else {
|
//不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {});
|
}
|
});
|
}
|
|
//扫描入库单监听
|
$("#bar").change(function () {
|
setOrderGoods();
|
})
|
|
//获取入库单
|
dropdown.render({
|
elem: '#bar',
|
data: arrs,
|
click: function(obj){
|
this.elem.val(obj.title);
|
setOrderGoods();
|
},
|
style: 'min-width: 335px;',
|
class:'layui-anim layui-anim-upbit',
|
});
|
|
// 根据入库明细ID 获取详细信息
|
function setOrderGoods() {
|
|
removeInput();
|
|
if ($("#bar").val() != "") {
|
var a = 0;
|
for (var i = 0;i< arrs.length;i++){
|
if (arrs[i].title == $("#bar").val())
|
{
|
a += 1;
|
break;
|
}
|
}
|
if (a <= 0) {
|
layer.msg('当前输入或选择单号有误或不存在!', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {});
|
}
|
if (a > 0) {
|
var param = {
|
Code: $("#bar").val()
|
};
|
//根据单号获取信息
|
synData(IP + "/PdaAsn/ByNoGetNotices", param, 'post', function (res) {
|
// console.log(res)
|
if (res.code == 0) {
|
|
$("#Code").val(res.data.Code);
|
$("#OrderCode").val(res.data.OrderCode);
|
|
var arrTrs = new Array()
|
let idx = 0
|
for (var i in res.data.models) {
|
// console.log(res.data.models[i])
|
var tr = $("#boxCell").eq(0).clone();
|
tr.appendTo("#tableBoxList");
|
idx++;
|
tr.attr('index', idx)
|
tr.find("td[name='code']").html(res.data.models[i].SkuNo);
|
tr.find("td[name='name']").html(res.data.models[i].SkuName);
|
tr.find("td[name='lotNo']").html(res.data.models[i].LotNo);
|
tr.find("td[name='qty']").html(res.data.models[i].Qty);
|
tr.find("td[name='cqty']").html(res.data.models[i].CompleteQty);
|
// arrs.forEach(element => {
|
|
// if (element.title == $("#bar").val()) {
|
// arrs.remove(element)
|
// }
|
// });
|
tr.show();
|
arrTrs[i] = tr
|
}
|
|
//设置分页
|
setPages(1, res.data.models.length)
|
} else {
|
//不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {});
|
}
|
})
|
}
|
}
|
}
|
|
//清除
|
function removeInput() {
|
$("#Code").val("");
|
$("#OrderCode").val("");
|
//先清空一下单据列表
|
let trs = $("#tableBoxList tr")
|
let len = trs.length
|
|
for (i = len - 1; i >= 2; i--) {
|
trs[i].remove();
|
}
|
}
|
|
//移除
|
function removeElement(arr, element) {
|
console.log(arr,element)
|
return arr.filter(e => e.title !== element.title);
|
}
|
|
//复核选中单据
|
form.on('submit(formBind)', function (data) {
|
|
// 代码区域
|
layer.confirm('确定复核此单据吗?', function(index) {
|
// 代码区域
|
var param = {
|
code:$("#bar").val(),
|
};
|
sendData(IP + "/UpApi/ByPdaFinish", param, 'post', function (res) {
|
if (res.code == 0) { //成功
|
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
doing = true,
|
location.reload();
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { doing = true });
|
}
|
});
|
});
|
// arrs.remove($("#bar").val())
|
});
|
|
|
// #region
|
/* 分页 */
|
//设置分页
|
function setPages(pageIndex, boxNum) {
|
if (boxNum <= 0) {
|
//列表为空,隐藏分页页码
|
$("#tableBoxPages").hide()
|
return
|
}
|
|
let pageNum = Math.floor(boxNum / 10);
|
if (boxNum % 10 > 0) {
|
pageNum += 1;
|
}
|
//console.log("pageNum is " + pageNum)
|
|
$("#tableBoxPages").find("tr").remove()
|
let table = $("#tableBoxPages")
|
$("<tr></tr>").appendTo("#tableBoxPages")
|
|
// let newTr = table.append("<tr></tr>")
|
// newTr.append("<td class='page-prev'>上一页</td>")
|
$("<td id='prevPage' class='page-prev'>上一页</td>").appendTo("#tableBoxPages tr")
|
$("#tableBoxPages tr").eq(0).find("td[id^='prevPage']").click(function () {
|
onClickPrevPage()
|
})
|
for (i = 1; i < pageNum + 1; i++) {
|
// newTr.append("<td class='page-num'>"+ i +"</td>")
|
$("<td class='page-num'>" + i + "</td>").appendTo("#tableBoxPages tr")
|
}
|
// newTr.append("<td class='page-next'>下一页</td>")
|
$("<td id='nextPage' class='page-next'>下一页</td>").appendTo("#tableBoxPages tr")
|
$("#tableBoxPages tr").eq(0).find("td[id^='nextPage']").click(function () {
|
onClickNextPage()
|
})
|
// pages.show()
|
$("#tableBoxPages").show()
|
|
setCurPage(1)
|
}
|
|
//设置当前分页
|
function setCurPage(pageIndex) {
|
let totalTrNum = $("#tableBoxList tr").length
|
if (totalTrNum <= 2) {
|
//console.log("tableBoxList 为空 totalTrNum: " + totalTrNum)
|
//curPageIndex = 1
|
return
|
}
|
|
let pageNum = getBoxPageNum()
|
if (pageIndex > pageNum) {
|
//console.log("设置的页码超出页数, pageIndex : " + pageIndex)
|
//curPageIndex = 1
|
return
|
}
|
|
let startIndex = (pageIndex - 1) * 10 + 1
|
let n = totalTrNum - startIndex
|
let endIndex = 0
|
if (n > 9) {
|
endIndex = startIndex + 9
|
} else {
|
endIndex = startIndex + n
|
}
|
//console.log("startIndex is "+startIndex)
|
//console.log("endIndex is "+endIndex)
|
//startIndex =2
|
//endIndex = 2
|
let trs = $("#tableBoxList tr")
|
//console.log("行数 "+trs.length)
|
let d = 0
|
for (let i = 2; i < trs.length; i++) {
|
//console.log("行索引 " + trs.eq(i).attr('index'))
|
let t = trs.eq(i)
|
d = t.attr('index')
|
if (d >= startIndex && d <= endIndex) {
|
//console.log("需要显示")
|
//显示行
|
t.show()
|
} else {
|
//隐藏行
|
t.hide()
|
}
|
}
|
|
curPageIndex = pageIndex
|
|
let ptr = $("#tableBoxPages tr")
|
for (let i = 1; i < pageNum + 1; i++) {
|
ptr.eq(0).find("td").eq(i).removeClass("page-num-select")
|
if (i == curPageIndex) {
|
ptr.eq(0).find("td").eq(i).addClass("page-num-select")
|
}
|
}
|
//console.log("totalTrNum is " + totalTrNum)
|
}
|
|
function onClickPrevPage() {
|
//console.log("上一页按钮被点击")
|
if (curPageIndex == 1) {
|
return
|
}
|
setCurPage(curPageIndex - 1)
|
}
|
|
function onClickNextPage() {
|
//console.log("下一页按钮被点击")
|
let n = getBoxPageNum()
|
if (curPageIndex == n - 1) {
|
return
|
}
|
setCurPage(curPageIndex + 1)
|
}
|
function getBoxPageNum() {
|
let num = $("#tableBoxList tr").length
|
if (num <= 2) {
|
return 0
|
}
|
|
let pageNum = Math.floor(num / 10);
|
if (num % 10 > 0) {
|
pageNum += 1;
|
}
|
|
return pageNum
|
}
|
|
/*——————————————————————————————————————————————————————————*/
|
//#endregion
|
})
|
</script>
|
</body>
|
</html>
|