<!DOCTYPE html>
|
<html>
|
|
<head>
|
<meta name="viewport" content="user-scalable=0,width=device-width,initial-scale=1.0" />
|
<meta charset="UTF-8" />
|
<!-- <meta name="viewport" content="width=device-width, initial-scale=0.665, minimum-scale=0.5, maximum-scale=1, user-scalable=no" /> -->
|
<!-- <meta name="viewport" content="width=device-width, initial-scale=0.665" /> -->
|
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
<title>Boxline PDA</title>
|
|
<link rel="stylesheet" href="/layui/css/layui.css" />
|
<link rel="stylesheet" href="/css/style.css" />
|
<script src="/js/adaptive.js"></script>
|
|
<link rel="stylesheet" href="/css/my.css" />
|
<style type="text/css">
|
.layout-bill-info {
|
height: auto;
|
}
|
|
.layout-tbl-submit {
|
margin-top: 10px;
|
}
|
|
.fact-input {
|
width: 40px;
|
padding-left: 5px;
|
margin-left: 2px;
|
margin-right: 2px;
|
}
|
|
.foot-container {
|
height: 36px;
|
text-align: center;
|
margin: auto;
|
/* background-color: #009688; */
|
width: 100%;
|
max-width: 320px;
|
bottom: 2px;
|
}
|
|
.btn-ok {
|
border: none;
|
color: #FFFFFF;
|
background-color: #0a93e3;
|
width: 48%;
|
height: 100%;
|
border-radius: 2px;
|
float: left;
|
margin: 0 1%;
|
}
|
|
.btn-cancel {
|
border: none;
|
color: #FFFFFF;
|
background-color: #9f1707;
|
width: 48%;
|
height: 100%;
|
float: left;
|
border-radius: 2px;
|
margin: 0 1%;
|
}
|
|
.btn-ok:active {
|
opacity: 0.8;
|
}
|
|
.btn-cancel:active {
|
opacity: 0.8;
|
}
|
|
.div-tbl-title {
|
width: 98%;
|
margin: auto;
|
/* background-color: #4476A7; */
|
height: 30px;
|
margin-top: 20px;
|
}
|
|
.div-tbl-title table {
|
width: 100%;
|
height: 30px;
|
}
|
|
.div-tbl-title td {
|
width: 50%;
|
height: 30px;
|
line-height: 30px;
|
}
|
|
.div-tbl-title span {
|
float: left;
|
width: 60%;
|
height: 30px;
|
line-height: 30px;
|
}
|
|
.div-tbl-title input {
|
float: left;
|
width: 40%;
|
height: 30px;
|
line-height: 30px;
|
border: none;
|
}
|
|
.layout-tbl-paging {
|
margin-top: 0;
|
}
|
|
.out-scatter-num .local-input {
|
width: 40%;
|
height: 25px;
|
float: left;
|
}
|
|
.out-scatter-num .local-ok button {
|
height: 25px;
|
border: 0;
|
color: #FFFFFF;
|
background-color: #0a93e3;
|
border-radius: 3px;
|
padding: 2px;
|
margin-left: 10px;
|
width: 100%;
|
}
|
|
.out-scatter-num .layui-form-label {
|
width: 25%;
|
/* background-color: #007BFF; */
|
}
|
|
.out-scatter-num .layui-input-block {
|
width: 100%;
|
/* background-color: #009E94; */
|
margin-left: 0px;
|
}
|
|
.out-scatter-num .layui-input-block .layui-input {
|
padding-left: 5px;
|
}
|
|
.out-scatter-num .local-ok {
|
width: 20%;
|
height: 25px;
|
float: left;
|
margin-left: 0;
|
}
|
|
.out-scatter-num .local-ok button {
|
margin-left: 5px;
|
}
|
|
.layout-tab-page {
|
height: auto;
|
}
|
|
.cut-line {
|
margin-top: 10px;
|
}
|
.show{
|
display: block;
|
}
|
.noshow{
|
display: none;
|
}
|
td {
|
word-break: break-all;
|
word-wrap: break-word;
|
}
|
.layui-form-switch {
|
margin-top: 0;
|
}
|
</style>
|
<link rel="stylesheet" href="/css/adapter.css" />
|
</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="../login.html">重新登录</a></li>
|
</ul>
|
</div>
|
|
<div id="" class="layout-bill-info">
|
<form class="layui-form" action="" style="height: auto;">
|
<div id="" class="layui-form-item layout-dropdownlist">
|
<label class="layui-form-label" lang>盘点单:</label>
|
<div class="layui-input-block" id="selectDiv">
|
<select id="bar" lay-filter="getbar" lay-search>
|
<option value=""></option>
|
</select>
|
<img src="/assets/down_arraw.png">
|
</div>
|
</div>
|
<div class="layui-form-item layout-dropdownlist" style="margin-top: 10px;">
|
<label class="layui-form-label">物料-批次:</label>
|
<div class="layui-input-block">
|
<select id="skuLotNo" lay-filter="skuLotNo" lay-search>
|
<option value=""></option>
|
</select>
|
<img src="/assets/down_arraw.png">
|
</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="palletNo" type="text" lay-verify="palletNo" placeholder="请扫描托盘条码"
|
autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
|
<div class="layout-tab-page">
|
<div id="" class="layui-form-item layout-input" >
|
<label class="layui-form-label">是否数量盘点:</label>
|
<div class="layui-input-block" style="position: absolute;top: 100;">
|
<input type="checkbox" name="IsZhengTuo" id="IsZhengTuo" lay-skin="switch" lay-text="是|否"
|
lay-filter="IsZhengTuo" class="layui-input" >
|
</div>
|
</div>
|
<div id="boxno1" class="layui-form-item layout-input" style="margin-top: 10px;">
|
<label class="layui-form-label">箱码:</label>
|
<div class="layui-input-block">
|
<input id="boxNo" type="text" lay-verify="boxNo" placeholder="请扫描外箱条码"
|
autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div id="boxno3" class="layui-form-item layout-input noshow" style="margin-top: 10px;">
|
<label class="layui-form-label">支码:</label>
|
<div class="layui-input-block">
|
<input id="boxNo3" type="text" lay-verify="boxNo3" placeholder="请扫描支码"
|
autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-form-item layout-dropdownlist" style="margin-top: 10px;">
|
<label class="layui-form-label">盘点结果:</label>
|
<div class="layui-input-block">
|
<select id="Result" lay-filter="Result" lay-search>
|
<!-- <option value=""></option> -->
|
<option value="0">正常</option>
|
<option value="1">盘亏</option>
|
<option value="2">盘盈</option>
|
</select>
|
<img src="/assets/down_arraw.png">
|
</div>
|
</div>
|
<table id="outHalf" class="layout-tab-content" border="" cellspacing="" cellpadding="">
|
|
<tr id="outScatter">
|
<td>
|
<div id="layout-boxcode" class="layui-form-item out-scatter-num"
|
style="margin-top: 10px;">
|
<label class="layui-form-label" style="width: 21%;">实际数量:</label>
|
<div id="" class="local-input">
|
<div class="layui-input-block">
|
<input id="factNum" type="number" placeholder="请输入实际数量" disabled
|
autocomplete="off" class="layui-input" style="padding-left:0.1rem;"
|
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')">
|
</div>
|
</div>
|
<div id="" class="local-ok">
|
<button type="button" lay-submit lay-filter="btnSubmit">确认</button>
|
</div>
|
</div>
|
</td>
|
</tr>
|
</table>
|
<div id="" style="text-align: right;margin-top: 10px;">
|
<div id="" class="cut-line">
|
<img src="/assets/fengexian.png">
|
</div>
|
</div>
|
</div>
|
</form>
|
</div>
|
|
<div id="tableid" class="layout-tbl-paging">
|
<table id="tableBoxList" class="tbl-box-list" border="" cellspacing="" cellpadding="">
|
<tr>
|
<th style="width: 40%;"><p id="a">箱码</p></th>
|
<th style="width: 30%;"><p id="b">支码</p></th>
|
<th style="width: 15%;"><p id="c">箱内数量</p></th>
|
<th style="width: 15%;"><p id="d">结果</p></th>
|
</tr>
|
<tr id="boxCell" style="display: none;">
|
<td name="boxNo"></td>
|
<td name="boxNo3"></td>
|
<td name="qty"></td>
|
<td name="result"></td>
|
</tr>
|
</table>
|
|
</div>
|
</div>
|
</div>
|
|
<script src="/js/jquery-3.5.1.min.js"></script>
|
<script src="/layui/layui.js"></script>
|
<script src="/js/jquery.cookie.js"></script>
|
<script src="/js/public.js"></script>
|
|
<script>
|
layui.use(['form', 'jquery'], function () {
|
var form = layui.form
|
|
|
var tableData = null;
|
var canPickBox = true;
|
$("#palletNo").focus();
|
|
//是否数量盘点
|
var isContinue = "0";
|
|
form.on('switch(IsZhengTuo)', function (obj) {
|
$("#a").html('');
|
$("#b").html('');
|
$("#c").html('');
|
|
if (obj.elem.checked) {
|
$('#boxno1').attr("style", "display:none")
|
$('#boxno3').attr("style", "display:none")
|
isContinue="1";
|
|
$("#a").html('物料编码');
|
$("#b").html('托盘条码');
|
$("#c").html('托盘数量');
|
|
} else {
|
$('#boxno1').attr("style", "display:block")
|
$('#boxno3').attr("style", "display:block")
|
isContinue="0";
|
|
$("#a").html('箱码');
|
$("#b").html('支码');
|
$("#c").html('箱内数量');
|
|
if ($("#Result").val() != "0") {
|
$('#boxno3').addClass("show");
|
$('#boxno3').removeClass("noshow");
|
}else{
|
$('#boxno3').addClass("noshow");
|
$('#boxno3').removeClass("show");
|
}
|
if($("#Result").val() == "2"){
|
$('#factNum').removeAttr("disabled");
|
}
|
else{
|
$('#factNum').attr("disabled","disabled");
|
}
|
}
|
$('#boxNo').val("");
|
$('#boxNo3').val("");
|
refreshTable()
|
checkPalletState()
|
});
|
|
$("#menuImg").click(function (e) {
|
//console.log("menuImg")
|
e.stopPropagation()
|
|
if ($("#menuList").is(":hidden")) {
|
$("#menuList").show()
|
} else {
|
$("#menuList").hide()
|
}
|
})
|
$('body').click(function () {
|
// //console.log("body")
|
$("#menuList").hide()
|
})
|
|
//当托盘条码输入框失去焦点时,检查一下托盘状态
|
// $("#palletNo").blur(function () {
|
// //console.log("0000000000000")
|
// if ($("#palletNo").val() == "") {
|
// return
|
// }
|
// checkPalletState()
|
// })
|
//当托盘条码输入库回车时
|
$("#palletNo").keydown(function(e) {
|
if (e.keyCode === 13) {
|
//检查托盘状态
|
checkPalletState();
|
}
|
});
|
//input框变化事件
|
$("#palletNo").on('input', function () {
|
|
if ($("#palletNo").val() == "" || $("#palletNo").val().length < 8) {
|
return
|
}
|
if ($("#palletNo").val().length >= 8) {
|
$("#palletNo").val($("#palletNo").val().substr(-8))
|
}
|
checkPalletState()
|
})
|
//检查托盘状态
|
function checkPalletState() {
|
if ($("#palletNo").val() == "") {
|
return
|
}
|
var param = {
|
"PalletNo": $("#palletNo").val()
|
}
|
synData(IP + "/PdaSo/IsEnableOkPalletNo", param, 'post', function (res) {
|
|
if (res.code == 0) { //成功
|
updateBillList();
|
updateGoodList();
|
GetOutInfo();
|
} else { //不成功
|
layer.msg("无效托盘", {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { });
|
}
|
});
|
|
}
|
|
//更新盘点单
|
function updateBillList() {
|
$("#bar").empty()
|
$("#bar").append('<option value =>' + '</option>');
|
form.render('select');
|
|
var param = {
|
PalletNo: $("#palletNo").val(),
|
};
|
synData(IP + "/PdaCr/GetStockCheckNoList", param, 'post', function (res) {
|
|
if (res.code == 0) { //成功
|
for (var i = 0; i < res.data.length; i++) {
|
if (i == 0) {
|
$("#bar").append('<option value =' + res.data[i] + ' selected>'
|
+ res.data[i] + '</option>');
|
} else {
|
$("#bar").append('<option value =' + res.data[i] + '>'
|
+ res.data[i] + '</option>');
|
}
|
}
|
form.render('select');
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { });
|
}
|
});
|
}
|
//初始化渲染物料
|
function updateGoodList() {
|
|
$("#skuLotNo").empty()
|
$("#skuLotNo").append('<option value =>' + '</option>');
|
form.render('select');
|
|
var param = {
|
PalletNo: $("#palletNo").val(),
|
CrNo: $("#bar").val(),
|
};
|
synData(IP + "/PdaCr/GetStockCheckDetailList", param, 'post', function (res) {
|
if (res.code == 0) { //成功
|
for (var i = 0; i < res.data.length; i++) {
|
var vl = res.data[i].SkuNo+'-'+ res.data[i].LotNo;
|
var vl2 = res.data[i].SkuName+'-'+ res.data[i].LotNo;
|
if (i == 0) {
|
$("#skuLotNo").append('<option value =' + vl + ' selected>'+ vl2 + '</option>');
|
} else {
|
$("#skuLotNo").append('<option value =' + vl + '>'+ vl2 + '</option>');
|
}
|
}
|
form.render('select');
|
|
} else { //不成功
|
// layer.msg(res.msg, {
|
// icon: 2,
|
// time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
// }, function() {});
|
}
|
});
|
}
|
|
|
//获取托盘物料名细
|
function GetOutInfo() {
|
var param = {
|
"CrNo": $("#bar").val(),
|
"CrDetail": $("#skuLotNo").val(),
|
"PalletNo": $("#palletNo").val(),
|
"BoxNo": $("#boxNo").val(),
|
"isContinue": isContinue,
|
}
|
console.log(param)
|
synData(IP + "/PdaCr/GetStockCheckLogList", param, 'post', function (res) {
|
console.log(res)
|
if (res.code == 0) { //成功
|
tableData = deepCopy(res.data)
|
refreshTable()
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { });
|
}
|
});
|
}
|
|
form.on('submit(btnSubmit)', function (data) {
|
if (tableData == null) {
|
//console.log("tableData为空")
|
return
|
}
|
|
if ($("#palletNo").val() == "") {
|
layer.msg("托盘码为空", {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { });
|
return
|
}
|
if ($("#skuLotNo").val() == "") {
|
layer.msg("请选择物料批次", {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { });
|
return
|
}
|
if ($("#Result").val() == "2" && isContinue == "0") {
|
if ($("#boxNo").val() == "" ||$("#boxNo3").val() == "") {
|
layer.msg("请扫描外箱条码和支码", {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
return;
|
}
|
if($("#factNum").val()<=0){
|
layer.msg("盘盈时数量不能为空且需大于0", {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
return;
|
}
|
}
|
|
if (canPickBox == true) {
|
canPickBox = false;
|
var param = {
|
"CrNo": $("#bar").val(),
|
"CrDetail": $("#skuLotNo").val(),
|
"PalletNo": $("#palletNo").val(),
|
"BoxNo": $("#boxNo").val(),
|
"BoxNo3": $("#boxNo3").val(),
|
"Result": $("#Result").val(),
|
"Qty": parseInt($("#factNum").val()),
|
"isContinue": isContinue,
|
}
|
sendData(IP + "/PdaCr/CrSetCheck", param, 'post', function (res) {
|
|
if (res.code == 0) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
tableData = null
|
//$("#palletNo").val('')
|
$("#boxNo").val('')
|
$("#boxNo3").val('')
|
$("#Result").val('0')
|
refreshTable()
|
GetOutInfo()
|
canPickBox = true
|
});
|
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { canPickBox = true });
|
}
|
});
|
} else {
|
layer.msg("请勿重复请求", {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { });
|
}
|
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
|
});
|
|
//选中结果下拉事件
|
form.on('select(Result)', function (data) {
|
if (data.value != "0") {
|
$('#boxno3').addClass("show");
|
$('#boxno3').removeClass("noshow");
|
}else{
|
$('#boxno3').addClass("noshow");
|
$('#boxno3').removeClass("show");
|
}
|
if(data.value == "2" || isContinue == "1"){
|
$('#factNum').removeAttr("disabled");
|
}
|
else if(isContinue != "1"){
|
$('#factNum').attr("disabled","disabled");
|
}
|
$('#boxNo3').val("");
|
});
|
//渲染表格
|
function refreshTable() {
|
let data = tableData
|
//先清空一下箱子列表
|
let trs = $("#tableBoxList tr")
|
let len = trs.length ;
|
for (i = len - 1; i >= 2; i--) {
|
trs[i].remove();
|
}
|
if (data == null) {
|
//console.log("数据为空")
|
return
|
}
|
|
|
if (data.length > 0 || isContinue == "1") { //成功
|
$("#boxNum").val(data.length)
|
var list = data
|
var arrTrs = new Array()
|
let idx = 0
|
for (var i in list) {
|
// list[i].BoxCode
|
var tr = $("#boxCell").eq(0).clone();
|
|
tr.appendTo("#tableBoxList");
|
idx++;
|
tr.attr('index', idx)
|
//判断是否为数量
|
if(isContinue == "1")
|
{
|
tr.find("td[name='boxNo']").html(list[i].SkuNo);
|
tr.find("td[name='boxNo3']").html(list[i].PalletNo);
|
}
|
else{
|
tr.find("td[name='boxNo']").html(list[i].BoxNo);
|
tr.find("td[name='boxNo3']").html(list[i].BoxNo3);
|
}
|
tr.find("td[name='qty']").html(list[i].Qty);
|
|
|
var CheckResultStr='';
|
if(list[i].CheckResult=='0'){
|
CheckResultStr='正常';
|
} else if(list[i].CheckResult=='1'){
|
CheckResultStr='盘亏';
|
}else if(list[i].CheckResult=='2'){
|
CheckResultStr='盘盈';
|
}else if(list[i].CheckResult=='3'){
|
CheckResultStr='实物不符';
|
}else if(list[i].CheckResult=='4'){
|
CheckResultStr='数量盘点';
|
}
|
tr.find("td[name='result']").html(CheckResultStr);
|
|
tr.show();
|
arrTrs[i] = tr
|
}
|
|
} else { //不成功
|
layer.msg("无数据", {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () { });
|
}
|
}
|
|
})
|
</script>
|
</body>
|
|
</html>
|