<!DOCTYPE html>
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<title>组装单</title>
|
<meta name="renderer" content="webkit">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
<link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
|
<link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
|
</head>
|
<!--<style>
|
@media screen and (max-width: 450px) {
|
.layui-form-item .mobile {
|
display: inline-block;
|
float: none;
|
left: -3px;
|
width: 55%;
|
margin: 0 0 10px 10px;
|
}
|
|
.layui-form-item .layui-btn {
|
position: relative;
|
top: -6px;
|
}
|
.layui-form-item .layui-input.mobile {
|
display: inline;
|
float: none;
|
left: -3px;
|
width: 55%;
|
margin: 0 0 10px 10px;
|
}
|
}
|
</style>-->
|
<body>
|
<div class="layui-fluid">
|
<div class="layui-card" style="padding: 1px">
|
<div class="layui-card-body" style="padding: 1px;">
|
<form class="layui-form" action="" lay-filter="component-form-group">
|
<div class="layui-form-item">
|
<div class="layui-row">
|
<div class="layui-col-xs4">
|
<label class="layui-form-label" style="width:60px;padding-left:0px;">成品条码</label>
|
</div>
|
<div class="layui-col-xs8">
|
<input type="text" name="HBarCode_P" id="HBarCode_P" lay-verify="HBarCode_P" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
</div>
|
<div class="layui-tab" lay-filter="tab-Sc_AssemblyBill">
|
<ul class="layui-tab-title" lay-filter="tab-all">
|
<li lay-id="1">表头信息</li>
|
<li lay-id="2">明细信息</li>
|
</ul>
|
<div class="layui-tab-content">
|
<div class="layui-tab-item layui-show">
|
<!--<div class="layui-form-item">
|
<div class="layui-row">
|
<div class="layui-col-xs4">
|
<label class="layui-form-label" style="width:60px;padding-left:0px;">单据类型</label>
|
</div>
|
<div class="layui-col-xs8">
|
<select name=" HBillType">
|
<option value="3720">生产任务单-投料</option>
|
</select>
|
</div>
|
</div>
|
</div>-->
|
<div class="layui-form-item">
|
<div class="layui-row">
|
<div class="layui-col-xs4">
|
<label class="layui-form-label" style="width:60px;padding-left:0px;">任务单号</label>
|
</div>
|
<div class="layui-col-xs8">
|
<input type="text" name="HICMOBillNo" id="HICMOBillNo" lay-verify="HICMOBillNo" autocomplete="off" class="layui-input" disabled="disabled">
|
</div>
|
</div>
|
</div>
|
<div class="layui-form-item">
|
<div class="layui-row">
|
<div class="layui-col-xs4">
|
<label class="layui-form-label" style="width:60px;padding-left:0px;">成品条码</label>
|
</div>
|
<div class="layui-col-xs8">
|
<input type="text" name="HCPBarCode" id="HCPBarCode" lay-verify="HCPBarCode" autocomplete="off" class="layui-input" disabled="disabled">
|
</div>
|
</div>
|
</div>
|
<div class="layui-form-item">
|
<div class="layui-row">
|
<div class="layui-col-xs4">
|
<label class="layui-form-label" style="width:60px;padding-left:0px;">成品名称</label>
|
</div>
|
<div class="layui-col-xs8">
|
<input type="text" name="HCPMaterName" id="HCPMaterName" lay-verify="HCPMaterName" autocomplete="off" class="layui-input" disabled="disabled">
|
</div>
|
</div>
|
</div>
|
<div class="layui-form-item">
|
<div class="layui-row">
|
<div class="layui-col-xs3">
|
<label class="layui-form-label" style="width:60px;padding-left:0px;">操作工</label>
|
</div>
|
<div class="layui-col-xs6">
|
<input type="text" name="HWorker" id="HWorker" lay-verify="HWorker" autocomplete="off" class="layui-input">
|
<input type="hidden" name="HWorkerID" id="HWorkerID" lay-verify="HWorkerID" value="0" autocomplete="off" class="layui-input">
|
</div>
|
<div class="layui-col-xs3">
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="HWorkerID-BT">...</button>
|
</div>
|
</div>
|
</div>
|
<div class="layui-form-item" style="padding:0px;margin:0px">
|
<div class="layui-row">
|
<div class="layui-col-xs3">
|
<label class="layui-form-label" style="width:30px;padding-left:0px;display:none">制单人</label>
|
</div>
|
<div class="layui-col-xs6">
|
<input type="text" name="HBillerID" id="HBillerID" lay-verify="HBillerID" autocomplete="off" class="layui-input">
|
<input type="text" name="HMaker" id="HMaker" lay-verify="HMaker" autocomplete="off" class="layui-input">
|
<input type="hidden" name="HMakerID" id="HMakerID" lay-verify="HMakerID" value="0" autocomplete="off" class="layui-input" style="display : none">
|
</div>
|
</div>
|
</div>
|
<div class="layui-form-item">
|
<div class="layui-row">
|
<div class="layui-col-xs3">
|
<label class="layui-form-label" style="width:60px;padding-left:0px;">单据号</label>
|
</div>
|
<div class="layui-col-xs6">
|
<input type="text" name="HBillNo" id="HBillNo" lay-verify="HBillNo" disabled="disabled" autocomplete="off" class="layui-input mobile">
|
</div>
|
<div class="layui-col-xs3">
|
<input type="text" name="HInterID" id="HInterID" lay-verify="HInterID" value="0" disabled="disabled" autocomplete="off" class="layui-input mobile">
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="layui-tab-item">
|
<div class="layui-row">
|
<div class="layui-col-xs4">
|
<label class="layui-form-label" style="width:60px;padding-left:0px;">SN号</label>
|
</div>
|
<div class="layui-col-xs8">
|
<input type="text" name="HSNNumber" id="HSNNumber" lay-verify="HSNNumber" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-form-item">
|
<div class="layui-row">
|
<div class="layui-col-xs4">
|
<label class="layui-form-label" style="width:60px;padding-left:0px;">配件条码</label>
|
</div>
|
<div class="layui-col-xs8">
|
<input type="text" name="HBarCode" id="HBarCode" lay-verify="HBarCode" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
</div>
|
<table class="layui-hide" id="mx-table-xx" lay-filter="mx-table-xx"></table>
|
</div>
|
|
</div>
|
<div class="layui-form-item" style="margin-bottom: 20px;">
|
<div class="layui-row">
|
<div class="layui-col-xs3">
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="Clear">重置</button>
|
</div>
|
<div class="layui-col-xs3">
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="Delete">删除</button>
|
</div>
|
<div class="layui-col-xs3">
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="Cancel">退出</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
</form>
|
</div>
|
</div>
|
</div>
|
<script src="../../layuiadmin/layui/layui.js"></script>
|
<script src="../../layuiadmin/Scripts/json2.js"></script>
|
<script src="../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
|
<script src="../../layuiadmin/Scripts/webConfig.js"></script>
|
<script>
|
layui.config({
|
base: '../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'form', 'laydate', 'table', 'element'], function () {
|
var $ = layui.$
|
, admin = layui.admin
|
, layer = layui.layer
|
, table = layui.table
|
, form = layui.form
|
, element = layui.element;
|
|
//灰度不可编辑
|
document.getElementById('HICMOBillNo').style.backgroundColor = "#E0E0E0";
|
document.getElementById('HCPBarCode').style.backgroundColor = "#E0E0E0";
|
document.getElementById('HCPMaterName').style.backgroundColor = "#E0E0E0";
|
document.getElementById('HBillNo').style.backgroundColor = "#E0E0E0";
|
document.getElementById('HInterID').style.backgroundColor = "#E0E0E0";
|
|
|
////初始化界面
|
$("#HMaker").val(sessionStorage["HUserName"]);
|
$("#HMaker").hide();
|
$("#HMakerID").hide();
|
$("#HBillerID").val(sessionStorage["HBillerID"]);
|
$("#HBillerID").hide();
|
|
|
form.on('submit(HWorkerID-BT)', function () {//选择操作工
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '操作工列表'
|
, shade: 0.6 //遮罩透明度
|
, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
|
, resize: false
|
, cancel: function () {
|
//$(".layui-btn").removeClass("layui-btn-disabled");
|
}
|
})
|
});
|
|
form.on('submit(Cancel)', function ()
|
{
|
parent.location.href = "../../../views/index.html"
|
//window.close();//关闭当前页
|
})
|
|
form.on('submit(Clear)', function () {
|
window.location.reload();
|
})
|
|
|
|
|
form.on('submit(Delete)', function () {//删除
|
var checkStatus = table.checkStatus('mx-table-xx')
|
, data = checkStatus.data;
|
var sInterID = $('#HInterID').val()
|
var sBarCode = data[0].HBarCode
|
$.ajax(
|
{
|
type: "Get",
|
//url: "http://61.130.49.162:9090/WMSAPI///Assembly/Delete_Json", //方法所在页面和方法名
|
url: GetWEBURL() + "/Assembly/Delete_Json",
|
async: true,
|
data: { "sInterID": sInterID , "sBarCode" : sBarCode},
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1) { // 说明验证成功了,
|
//layer.msg(data.Message, { icon: 1 });
|
table.render({
|
elem: '#mx-table-xx'
|
, url: GetWEBURL1() + '/Assembly/DisBillEntryList_Mate_Webs_Json'
|
, cellMinWidth: 80
|
, toolbar: '#toolbarDemo'
|
, where: { HInterID: sInterID, sBillType: '3727', sWhere: '' }
|
, cols: [[
|
{ type: 'radio' }
|
, { field: 'HNO', title: '序号', width: 75 }
|
, { field: 'HBarCode', title: '配件条码', width: 75 }
|
, { field: 'HMaterName', title: '配件代码', width: 100 }
|
, { field: 'HMaterNumber', title: '配件名称', width: 150 }
|
, { field: 'HMaterModel', title: '规格型号', width: 100 }
|
, { field: 'HQty', title: '数量', width: 75 }
|
, { field: 'HCPBarCode', title: '成品条码', width: 75 }
|
, { field: 'HCPMaterNumber', title: '成品代码', width: 100 }
|
, { field: 'HCPMaterName', title: '成品名称', width: 100 }
|
, { field: 'HCPMaterModel', title: '成品规格型号', width: 100 }
|
, { field: 'HCPMaterID', title: 'HCPMaterID', width: 75, hide: true }
|
]]
|
, height: 500
|
})
|
}
|
else {
|
layer.msg(data.Message, { icon: 2 });
|
}
|
},
|
error: function (err) {
|
layer.msg('错误' + err, {
|
icon: 5,
|
time: 20000
|
}, function () {
|
//do something
|
});
|
}
|
});
|
});
|
|
|
|
form.on('submit(Saver)', function (data) {//提交
|
//debugger;
|
var sMainStr = JSON.stringify(data.field);
|
var sSubStr = table.cache['wl-table'];
|
if (AllowLoadData(sSubStr) != false)//非空验证
|
{
|
layer.load(3);
|
$.ajax(
|
{
|
type: "POST",
|
// url: "http://61.130.49.162:9090/WMSAPI///MateOut/set_SaveMateOutBill_Json", //方法所在页面和方法名
|
url: GetWEBURL() + "/MateOut/set_SaveMateOutBill_Json",
|
async: true,
|
data: { "oMain": sMainStr },
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1) { // 说明验证成功了,
|
layer.msg(data.Message + $("#HBillNo").val(), { icon: 1 });
|
}
|
else {
|
layer.msg(data.Message, { icon: 1 });
|
}
|
layer.closeAll("loading");
|
},
|
error: function (err) {
|
|
layer.msg('错误' + err, {
|
icon: 5,
|
time: 20000
|
}, function () {
|
//do something
|
});
|
}
|
});
|
return false;
|
}
|
});
|
//监听提交
|
form.verify({
|
numberOrEmpty: function (value, item) {
|
// if (value != '') {
|
if (!/^\d+$/.test(value)) {
|
return '不能为空或数字或者0';
|
}
|
//}
|
}
|
});
|
//成品条码
|
$('#HBarCode_P').on('keydown', function (event) {
|
var sBarCode = $('#HBarCode_P').val()
|
//if (sBarCode != "")
|
//{
|
// $('#HBarCode_P').value("");
|
//}
|
if (event.keyCode == 13) {
|
$.ajax({
|
//url: "http://61.130.49.162:9090/WMSAPI///Assembly/Get_Assembly_CPBarCode_Json",
|
url: GetWEBURL() + "/Assembly/Get_Assembly_CPBarCode_Json",
|
type: "GET",
|
data: { "sBarCode": sBarCode, "sBillType": '3727'},
|
success:function(result){
|
if (result.count == 1) {
|
$("#HICMOBillNo").val(result.data[0].sICMOBillNo);
|
$("#HCPBarCode").val(result.data[0].sCPBarCode);
|
$("#HCPMaterID").val(result.data[0].sCPMaterID);
|
$("#HCPMaterName").val(result.data[0].sCPMaterName);
|
$("#HInterID").val(result.data[0].sInterID);
|
$("#HBillNo").val(result.data[0].sBillNo);
|
var HInterID = result.data[0].sInterID
|
element.tabChange('tab-Sc_AssemblyBill', '1');
|
layer.load(3)
|
table.render({
|
elem: '#mx-table-xx'
|
, url: GetWEBURL1() + '/Assembly/DisBillEntryList_Mate_Webs_Json'
|
, cellMinWidth :80
|
, toolbar: '#toolbarDemo'
|
, where: { HInterID: HInterID, sBillType: '3727', sWhere: '' }
|
, cols: [[
|
{ type: 'radio' }
|
, { field: 'HNO', title: '序号', width: 75 }
|
, { field: 'HBarCode', title: '配件条码', width: 75 }
|
, { field: 'HMaterName', title: '配件代码', width: 100 }
|
, { field: 'HMaterNumber', title: '配件名称', width: 100 }
|
, { field: 'HMaterModel', title: '规格型号', width: 100 }
|
, { field: 'HQty', title: '数量', width: 75 }
|
, { field: 'HCPBarCode', title: '成品条码', width: 75 }
|
, { field: 'HCPMaterNumber', title: '成品代码', width: 100 }
|
, { field: 'HCPMaterName', title: '成品名称', width: 100 }
|
, { field: 'HCPMaterModel', title: '成品规格型号', width: 100 }
|
, { field: 'HCPMaterID', title: 'HCPMaterID', width: 75, hide: true }
|
]]
|
, height: 500
|
, done: function () {
|
layer.closeAll("loading");
|
}
|
});
|
}
|
else {
|
// $("#verifycode").click();
|
layer.msg(result.Message, { icon: 5, btn: ['退出'], time: 100000,offset:'t'});
|
}
|
layer.closeAll("loading");
|
}
|
});
|
}
|
});
|
//条码
|
$('#HBarCode').on('keydown', function (event) {
|
var sPJCode = $('#HBarCode').val()
|
var sCPBarCode = $('#HCPBarCode').val()
|
var sInterID = $('#HInterID').val()
|
var sBillNo = $('#HBillNo').val()
|
var sMaker = sessionStorage["HUserName"];
|
var sWorkerID = $('#HWorkerID').val()
|
var sSNumber = $('#HSNNumber').val()
|
if (event.keyCode == 13) {
|
$('#HBarCode').val("");
|
$('#HSNNumber').val("");
|
$.ajax({
|
url: GetWEBURL() + "/Assembly/Get_Assembly_PJBarCode_Json",
|
type: "GET",
|
data: { "sPJCode": sPJCode, "sCPCode": sCPBarCode, "sInterID": sInterID, "sBillNo": sBillNo, "sMaker": sMaker, "HWorkerID": sWorkerID, "HSNNumber": sSNumber },
|
success: function (result) {
|
element.tabChange('tab-Sc_AssemblyBill', '2');
|
if (result.count == 1) { // 说明验证成功了,
|
layer.load(3)
|
table.render({
|
elem: '#mx-table-xx'
|
, url: GetWEBURL1() + '/Assembly/DisBillEntryList_Mate_Webs_Json'
|
//, cellMinWidth: 80
|
, toolbar: '#toolbarDemo'
|
, where: { HInterID: sInterID, sBillType: '3727', sWhere: '' }
|
, cols: [[
|
{ type: 'radio' }
|
, { field: 'HNO', title: '序号', width: 75 }
|
, { field: 'HBarCode', title: '配件条码', width: 75 }
|
, { field: 'HMaterName', title: '配件代码', width: 100 }
|
, { field: 'HMaterNumber', title: '配件名称', width: 100 }
|
, { field: 'HMaterModel', title: '规格型号', width: 100 }
|
, { field: 'HQty', title: '数量', width: 75 }
|
, { field: 'HCPBarCode', title: '成品条码', width: 75 }
|
, { field: 'HCPMaterNumber', title: '成品代码', width: 100 }
|
, { field: 'HCPMaterName', title: '成品名称', width: 100 }
|
, { field: 'HCPMaterModel', title: '成品规格型号', width: 100 }
|
//, { field: 'HSNNumber', title: 'SN', width: 100 }
|
, { field: 'HCPMaterID', title: 'HCPMaterID', width: 75, hide: true }
|
]]
|
// , data: [linterid]
|
// , page: true
|
, height: 500
|
, done: function () {
|
layer.closeAll("loading");
|
}
|
});
|
}
|
else {
|
// $("#verifycode").click();
|
//layer.msg(result.Message, { icon: 5 });
|
layer.msg(result.Message, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
|
}
|
layer.closeAll("loading");
|
}
|
});
|
// layer.msg($('#HSourceBillNo').val(), { icon: 1 });
|
}
|
});
|
|
table.render({
|
elem: '#mx-table'
|
// , url: 'http://61.130.49.162:9090/WMSAPI///MateOut/GetHBarCodeShowBillSub'
|
//, toolbar: '#toolbarDemo'
|
// , where: { sMsg: linterid, sMsg2: lentryid }
|
, cols: [[
|
, { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
|
]]
|
, page: true
|
, height: 500
|
, done: function () {
|
}
|
});
|
});
|
function GetHWorkerValue(obj) { //返回操作工
|
$("#HWorker").val(obj[0].HName);
|
$("#HWorkerID").val(obj[0].HItemID);
|
}
|
function AllowLoadData(sSubStr) { //非空验证
|
//if ($("#HSourceBillNo").val() == '') {
|
// layer.msg("请先扫源单!", { icon: 5 });
|
// return false;
|
//}
|
//if($("#HDeptName").val()=='')
|
//{
|
// layer.msg("部门没有选择!", { icon: 5 });
|
// return false;
|
//}
|
//if ($("#HSecManager").val() == '') {
|
// layer.msg("发料人没有选择!", { icon: 5 });
|
// return false;
|
//}
|
//if ($("#HKeeper").val() == '') {
|
// layer.msg("领料人没有选择!", { icon: 5 });
|
// return false;
|
//}
|
//if ($("#HSupName").val() == '') {
|
// layer.msg("供应商没有选择!", { icon: 5 });
|
// return false;
|
//}
|
//if ($("#HWHNAME").val() == '') {
|
// layer.msg("仓库没有选择!", { icon: 5 });
|
// return false;
|
//}
|
if ($("#HBillNo").val() == '') {
|
layer.msg("错误的单据号!", { icon: 5 });
|
return false;
|
}
|
if ($("#HInterID").val() == '') {
|
layer.msg("错误的内码!", { icon: 5 });
|
return false;
|
}
|
if(sSubStr=='')
|
{
|
layer.msg("没有物料明细记录!", { icon: 5 });
|
return false;
|
}
|
var s = 0;
|
if (sSubStr != '') {
|
for (var i = 0; i <= sSubStr.length - 1; i++) { //判断扫码数量不能大于应收数量
|
if (parseFloat(sSubStr[i].HQtyMust) > 0) {
|
if (parseFloat(sSubStr[i].HQty) > parseFloat(sSubStr[i].HQtyMust))
|
{
|
layer.msg("数量不能大于应发数量!", { icon: 5 });
|
return false;
|
}
|
}
|
}
|
for (var i = 0; i <= sSubStr.length - 1; i++) { //判断扫码数量不能为0
|
if (parseFloat(sSubStr[i].HQty) > 0) {
|
s = 1;
|
}
|
}
|
if (s == 0)
|
{
|
layer.msg("生产领料出库记录未扫码!", { icon: 5 });
|
return false;
|
}
|
}
|
else
|
{
|
return true;
|
}
|
}
|
</script>
|
|
</body>
|
</html>
|