<!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">
|
td {
|
word-break: break-all;
|
word-wrap: break-word;
|
}
|
|
.layui-form-switch {
|
margin-top: 0;
|
}
|
|
/* 标签样式 */
|
.tableyang-this a {
|
margin: 10px 10px 0px 0px;
|
line-height: 30px;
|
width: 100px;
|
color: #999;
|
text-align: center;
|
float: left;
|
background: #f7f7f7;
|
user-select: none;
|
position: relative;
|
z-index: 1;
|
cursor: pointer;
|
border-radius: 5px;
|
border: 1px solid #ccc;
|
transition: all 0.3s ease;
|
}
|
|
.tableyang-this a.hover {
|
color: #5298ff;
|
background-color: #eff2ff;
|
border: 1px solid #5298ff;
|
}
|
|
/* 内容居中 */
|
.tableyang-tab {
|
display: flex;
|
/* justify-content: center; */
|
/* align-items: center; */
|
flex-direction: column;
|
height: 90vh;
|
}
|
|
/* 必用样式 */
|
.tableyang-2,
|
.tableyang-3 {
|
display: none;
|
}
|
|
ul {
|
list-style-type: none;
|
padding: 0;
|
}
|
|
li {
|
cursor: pointer;
|
background-color: lightgray;
|
padding: 10px;
|
margin-bottom: 5px;
|
}
|
</style>
|
<link rel="stylesheet" href="/css/adapter.css" />
|
<script src="../../js/jquery.js"></script>
|
<script src="../../js/jquery-3.5.1.min.js"></script>
|
</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" lang>物料取样</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" lang>主页</a></li>
|
<!-- <li><a href="productEnterConfirm.html">入库信息确认</a></li> -->
|
<li><a href="../login.html" lang>重新登录</a></li>
|
</ul>
|
</div>
|
|
<button id="option1" class="layout-btn" type="button">标签</button>
|
<button id="option2" class="layout-btn" type="button">数量</button>
|
<br /><br />
|
|
<!-- 有码 -->
|
<div id="content1">
|
<div id="zongDiv" class="layout-bill-info" style="height: 260px;">
|
<form class="layui-form" action="">
|
|
<div id="BOX" class="layui-form-item layout-input">
|
<label class="layui-form-label" lang>外箱条码:</label>
|
<div class="layui-input-block">
|
<input id="BOXCODE" type="text" lay-verify="required" lang langholder
|
placeholder="请扫描外箱条码" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
|
<div id="BOX3" class="layui-form-item layout-input" style="display: none;">
|
<label class="layui-form-label" lang>追溯条码:</label>
|
<div class="layui-input-block">
|
<input id="BOXCODE3" type="text" lang langholder placeholder="请扫描追溯条码"
|
autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div id="SampleQty" class="layui-form-item layout-input">
|
<label class="layui-form-label" lang>取样数量:</label>
|
<div class="layui-input-block">
|
<input id="sampleQty" type="text" lang langholder placeholder="请输入取样数量"
|
autocomplete="off" class="layui-input" oninput="value=value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/,'$1$2.$3')" onafterpaste="this.value=this.value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/,'$1$2.$3')">
|
</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" lang>箱内数量:</label>
|
<div class="layui-input-block">
|
<input id="BoxQty" type="text" disabled placeholder="" autocomplete="off"
|
class="layui-input">
|
</div>
|
</div>
|
</td>
|
<td>
|
<div id="" class="layui-form-item layout-boxinfo">
|
<label class="layui-form-label" lang>已取数量:</label>
|
<div class="layui-input-block">
|
<input id="sampleComQty" type="text" disabled placeholder=""
|
autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="2">
|
<div id="" class="layui-form-item layout-boxinfo">
|
<label class="layui-form-label" lang style="width: 21%;">物料编码:</label>
|
<div class="layui-input-block" style="width: 79%; margin-left: 21%;">
|
<input id="SkuNo" type="text" disabled placeholder="" autocomplete="off"
|
class="layui-input">
|
</div>
|
</div>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="2">
|
<div id="" class="layui-form-item layout-boxinfo">
|
<label class="layui-form-label" lang style="width: 21%;">物料名称:</label>
|
<div class="layui-input-block" style="width: 79%; margin-left: 21%;">
|
<input id="SkuName" type="text" disabled placeholder="" autocomplete="off"
|
class="layui-input">
|
</div>
|
</div>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="2">
|
<div id="" class="layui-form-item layout-boxinfo">
|
<label class="layui-form-label" lang style="width: 21%;">批次:</label>
|
<div class="layui-input-block" style="width: 79%; margin-left: 21%;">
|
<input id="LotNo" type="text" disabled placeholder="" autocomplete="off"
|
class="layui-input">
|
</div>
|
</div>
|
</td>
|
</tr>
|
|
</table>
|
|
<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" style="margin-top: 10px;">取样</button>
|
</td>
|
<td style="width: 33%;"></td>
|
|
</tr>
|
</table>
|
</form>
|
</div>
|
|
</div>
|
|
<!-- 无码 -->
|
<div id="content2">
|
<div id="zongDiv2" class="layout-bill-info" style="height: 300px;">
|
<form class="layui-form" id="form2" action="" lay-filter = "form2">
|
<div id="" class="layui-form-item layout-dropdownlist">
|
<label class="layui-form-label" lang>入库单:</label>
|
<div class="layui-input-block" id="selectDiv1">
|
<select id="bar1" lay-filter="getbar1" 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" id="goodDiv1">
|
<select id="goodSelect1" lay-filter="goodSelect1" lay-search>
|
<option value=""></option>
|
</select>
|
<img src="/assets/down_arraw.png">
|
</div>
|
</div>
|
|
<div id="" class="layui-form-item layout-input">
|
<label class="layui-form-label" lang>托盘条码:</label>
|
<div class="layui-input-block">
|
<input id="PalletNo" type="text" lang langholder
|
placeholder="请扫描托盘条码" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
|
<div id="" class="layui-form-item layout-input">
|
<label class="layui-form-label" lang>取样数量:</label>
|
<div class="layui-input-block">
|
<input id="sampleQty2" type="text" lang langholder placeholder="请输入取样数量" autocomplete="off" class="layui-input" oninput="value=value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/,'$1$2.$3')" onafterpaste="this.value=this.value.replace(/[^\d^\.]+/g,'').replace('.','$#$').replace(/\./g,'').replace('$#$','.').replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/,'$1$2.$3')">
|
</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" lang>托内数量:</label>
|
<div class="layui-input-block">
|
<input id="PalletQty" type="text" disabled placeholder="" autocomplete="off"
|
class="layui-input">
|
</div>
|
</div>
|
</td>
|
<td>
|
<div id="" class="layui-form-item layout-boxinfo">
|
<label class="layui-form-label" lang>已取数量:</label>
|
<div class="layui-input-block">
|
<input id="PalletSampleComQty" type="text" disabled placeholder=""
|
autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="2">
|
<div id="" class="layui-form-item layout-boxinfo">
|
<label class="layui-form-label" lang style="width: 21%;">物料编码:</label>
|
<div class="layui-input-block" style="width: 79%; margin-left: 21%;">
|
<input id="SkuNo2" type="text" disabled placeholder="" autocomplete="off"
|
class="layui-input">
|
</div>
|
</div>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="2">
|
<div id="" class="layui-form-item layout-boxinfo">
|
<label class="layui-form-label" lang style="width: 21%;">物料名称:</label>
|
<div class="layui-input-block" style="width: 79%; margin-left: 21%;">
|
<input id="SkuName2" type="text" disabled placeholder="" autocomplete="off"
|
class="layui-input">
|
</div>
|
</div>
|
</td>
|
</tr>
|
<tr>
|
<td colspan="2">
|
<div id="" class="layui-form-item layout-boxinfo">
|
<label class="layui-form-label" lang style="width: 21%;">批次:</label>
|
<div class="layui-input-block" style="width: 79%; margin-left: 21%;">
|
<input id="LotNo2" type="text" disabled placeholder="" autocomplete="off"
|
class="layui-input">
|
</div>
|
</div>
|
</td>
|
</tr>
|
</table>
|
|
<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" style="margin-top: 10px;">取样</button>
|
</td>
|
<td style="width: 33%;"></td>
|
|
</tr>
|
</table>
|
|
</form>
|
</div>
|
|
</div>
|
|
</div>
|
</div>
|
<script src="/js/jquery-3.5.1.min.js"></script>
|
<script src="/layui/layui.js"></script>
|
<script src="/js/public.js"></script>
|
<script src="/js/language.js"></script>
|
<script src="/js/jquery.cookie.js"></script>
|
<script>
|
layui.use(['form', 'jquery'], function () {
|
var form = layui.form
|
|
/* 标签切换代码 */
|
var xianshiyemian = 0;
|
|
$('#option1').attr("style", "background-color: red;width: 50%;float: left;text-align: center;"); //选中后颜色
|
$('#option2').attr("style", "background-color: #999;width: 50%;float: right;text-align: center;"); //默认颜色
|
$('#content2').hide();
|
$(document).ready(function () {
|
$('#option1').click(function () {
|
// qingkong();
|
xianshiyemian = 0;
|
$('#content1').show();
|
$('#option1').attr("style", "background-color: red;width: 50%;float: left;text-align: center;"); //选中后颜色
|
|
$('#content2').hide();
|
$('#option2').attr("style", "background-color: #999;width: 50%;float: right;text-align: center;"); //默认颜色
|
});
|
|
$('#option2').click(function () {
|
// qingkong();
|
xianshiyemian = 1;
|
$('#content1').hide();
|
$('#option1').attr("style", "background-color: #999;width: 50%;float: left;text-align: center;"); //默认颜色
|
|
|
$('#content2').show();
|
$('#option2').attr("style", "background-color: red;width: 50%;float: right;text-align: center;"); //选中后颜色
|
|
});
|
});
|
|
|
initLanguage()
|
setLanguage()
|
|
//当前分页
|
var curPageIndex = 1;
|
//箱码级别
|
var BoxLevelVal = "0";
|
|
//箱码回车事件
|
$("#BOXCODE").keydown(function (e) {
|
if (e.keyCode === 13) {
|
if ($("#BOXCODE").val() == "") {
|
layer.msg('请先扫描箱码', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
return
|
}
|
checkBoxInfo()
|
}
|
});
|
//追溯条码回车事件
|
$("#BOXCODE3").keydown(function (e) {
|
if (e.keyCode === 13) {
|
if ($("#BOXCODE3").val() == "") {
|
layer.msg('请先扫描追溯码', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
return
|
}
|
checkBoxInfo2()
|
}
|
});
|
|
//获取箱码等级 、数量、取样数量
|
function checkBoxInfo() {
|
var param = {
|
"boxNo": $("#BOXCODE").val(),
|
}
|
sendData(IP + "/PdaAsn/GetBoxLevel", param, 'get', function (res) {
|
BoxLevelVal = "0";
|
if (res.code == 0) { //成功
|
BoxLevelVal = res.data.BoxLevel;
|
if(res.data.BoxLevel == "2"){
|
$("#BOX3").attr("style", "display:block");
|
}else{
|
$("#BOX3").attr("style", "display:none");
|
}
|
$("#BoxQty").val(res.data.Qty);
|
$("#sampleComQty").val(res.data.SamplingQty);
|
$("#SkuNo").val(res.data.SkuNo);
|
$("#SkuName").val(res.data.SkuName);
|
$("#LotNo").val(res.data.LotNo);
|
} else { //不成功
|
BoxLevelVal = "0";
|
$("#BOX3").attr("style", "display:none");
|
$("#BoxQty").val("");
|
$("#sampleComQty").val("");
|
$("#SkuNo").val("");
|
$("#SkuName").val("");
|
$("#LotNo").val("");
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
}
|
});
|
|
}
|
//获取追溯码数量、取样数量
|
function checkBoxInfo2() {
|
var param = {
|
"boxNo": $("#BOXCODE").val(),
|
"boxNo3": $("#BOXCODE3").val(),
|
}
|
sendData(IP + "/PdaAsn/GetBoxLevel", param, 'get', function (res) {
|
if (res.code == 0) { //成功
|
$("#BoxQty").val(res.data.Qty);
|
$("#sampleComQty").val(res.data.SamplingQty);
|
} else { //不成功
|
$("#BoxQty").val("");
|
$("#sampleComQty").val("");
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
}
|
});
|
|
}
|
|
// 无箱码取样
|
|
// 托盘码文本改变时触发
|
$("#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() {
|
$("#bar1").empty()
|
$("#bar1").append('<option value =>' + '</option>');
|
$("#goodSelect1").empty()
|
$("#goodSelect1").append('<option value =>' + '</option>');
|
var param = {
|
"PalletNo": $("#PalletNo").val(),
|
}
|
sendData(IP + "/PdaAsn/GetPalletInfo", param, 'get', function (res) {
|
if (res.code == 0) { //成功
|
$("#PalletQty").val(res.data.Qty);
|
$("#PalletSampleComQty").val(res.data.SamplingQty);
|
$("#SkuNo2").val(res.data.SkuNo);
|
$("#SkuName2").val(res.data.SkuName);
|
$("#LotNo2").val(res.data.LotNo);
|
|
$("#bar1").append('<option value =' + res.data.ASNNo + ' selected>' + res.data.ASNNo +'</option>');
|
$("#goodSelect1").append('<option value =' + res.data.ASNDetailNo + ' selected>' + res.data.SkuName+'-'+res.data.LotNo +'</option>');
|
console.log(res.data)
|
|
form.render('select');
|
} else { //不成功
|
$("#PalletQty").val("");
|
$("#PalletSampleComQty").val("");
|
$("#SkuNo2").val("");
|
$("#SkuName2").val("");
|
$("#LotNo2").val("");
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
}
|
});
|
}
|
|
//取样按钮事件
|
form.on('submit(formBind)', function (data) {
|
if (xianshiyemian == 0) {
|
if ($("#BOXCODE").val() == "") {
|
layer.msg('请扫描外箱条码', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
return;
|
}
|
if (BoxLevelVal == "2") {
|
if($("#BOXCODE3").val() == ""){
|
layer.msg('请扫描追溯条码', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
return;
|
}
|
}
|
|
if($("#sampleQty").val() <= 0){
|
layer.msg('请输入取样数量', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
return;
|
}
|
|
var param = {
|
BoxNo: $("#BOXCODE").val(),
|
BoxNo3: $("#BOXCODE3").val(),
|
sampleQty: $("#sampleQty").val(),
|
Origin: "PDA",
|
TableType: xianshiyemian,
|
BoxLevel:BoxLevelVal,
|
}
|
console.log(param)
|
//组盘
|
sendData(IP + "/PdaAsn/HaveNoCodeSkuSample", param, 'post', function (res) {
|
if (res.code == 0) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 1000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
$("#sampleQty").val("")
|
$("#BOXCODE3").val("")
|
checkBoxInfo()
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
//回调
|
});
|
}
|
});
|
}
|
else if (xianshiyemian == 1) {
|
if ($("#bar1").val() == "") {
|
layer.msg('请选择入库单', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
return;
|
}
|
if ($("#goodSelect1").val() == "") {
|
layer.msg('请选择物料及明细', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
return;
|
}
|
if ($("#STOCKCODE1").val() == "") {
|
layer.msg('请扫描托盘条码', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
return;
|
}
|
if($("#sampleQty2").val() <= 0){
|
layer.msg('请输入取样数量', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
return;
|
}
|
var param = {
|
AsnNo: $("#bar1").val(), //出库单据
|
AsnDetailId: parseInt($("#goodSelect1").val()), //入库单明细ID
|
PalletNo: $("#PalletNo").val(), //托盘条码
|
sampleQty: $("#sampleQty2").val(),
|
Origin: "PDA",
|
TableType: xianshiyemian,
|
}
|
|
console.log(param)
|
//组盘
|
sendData(IP + "/PdaAsn/HaveNoCodeSkuSample", param, 'post', function (res) {
|
if (res.code == 0) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 1000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
checkPalletState();
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
//回调
|
});
|
}
|
});
|
}
|
|
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。
|
});
|
|
$("#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()
|
})
|
|
})
|
</script>
|
</body>
|
|
</html>
|