<!DOCTYPE html>
|
<html xmlns="http://www.w3.org/1999/xhtml" style="background-color:white;">
|
<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">
|
<script src="../../layuiadmin/layui/layui.js"></script>
|
<script src="../../layuiadmin/Scripts/json2.js" type="text/javascript"></script>
|
<script src="../../layuiadmin/Scripts/webConfig.js"></script>
|
<style>
|
.layui-form-label {
|
font-size: 14px;
|
width: 85px;
|
text-align: inherit;
|
}
|
/*全局设置输入框高度*/
|
.layui-input {
|
height: 30px;
|
}
|
/*设置表头输入框*/
|
.t1_input {
|
padding: 1%;
|
}
|
/*本站信息td*/
|
.bz_td {
|
display: -webkit-box; /*设置按钮不换行*/
|
padding: 1%; /*设置输入框边距*/
|
}
|
/*设置本站信息按钮高度*/
|
.bz_btu {
|
height: 30px;
|
}
|
</style>
|
</head>
|
<body>
|
<div class="layui-fluid" style="padding:0">
|
<div class="layui-card">
|
<!--<div class="layui-card-header"></div>-->
|
<div class="layui-card-body" style="padding: 0;">
|
<form class="layui-form" action="" lay-filter="component-form-group">
|
<div style="background-color:#0085E8;">
|
<span style="color: white;"><i class="layui-icon layui-icon-form"></i>工序进站接收单</span>
|
</div>
|
<div class="layui-form-item" style="margin: 1% 0;text-align: right;">
|
<button type="button" lay-submit="" lay-filter="HAddBT" class="layui-btn layui-btn-radius">新增</button>
|
<!--<button type="button" lay-submit="" lay-filter="" class="layui-btn layui-btn-radius">清空</button>-->
|
<button type="button" lay-submit="" lay-filter="Saver" class="layui-btn layui-btn-radius">保存</button>
|
<button type="button" lay-submit="" lay-filter="Close" class="layui-btn layui-btn-radius layui-btn-danger">退出</button>
|
</div>
|
<div class="layui-form-item">
|
<table style="width:80%;">
|
<tbody>
|
<tr>
|
<th>条形码</th>
|
<td class="t1_input">
|
<input type="text" name="条形码" class="layui-input" id="HFbarcode" placeholder="请输入条形码" style="background-color:#efefef4d;border-radius: 50px;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>流转卡号</th>
|
<td class="t1_input">
|
<input type="text" name="HBillNo" class="layui-input" id="HBillNo" placeholder="流转卡号" style="background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>流水号</th>
|
<td class="t1_input">
|
<input type="text" name="流水号" class="layui-input" id="Serial_number" placeholder="请输入流水号" style="background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>工序代码</th>
|
<td class="t1_input">
|
<input type="text" name="工序代码" class="layui-input" id="工序代码" placeholder="请输入工序代码" style="background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>工序名称</th>
|
<td class="t1_input">
|
<input type="text" name="工序名称" class="layui-input" id="工序名称" placeholder="请输入工序名称" style="background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>创建人</th>
|
<td class="t1_input">
|
<input type="text" name="创建人" class="layui-input" id="创建人" placeholder="请输入创建人" style="background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>进站数量</th>
|
<td class="t1_input">
|
<input type="text" name="进站数量" class="layui-input" id="进站数量" placeholder="请输入进站数量" style="background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>生产资源</th>
|
<td class="bz_td">
|
<input type="text" name="生产班组" class="layui-input" id="ProductionResources" placeholder="选择生产资源" style="background-color:#efefef4d;" readonly>
|
<input type="hidden" name="生产资源代码" id="ProductionResourcesID" value="0" autocomplete="off" class="layui-input">
|
<button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="ProductionResources-BT">...</button>
|
</td>
|
</tr>
|
<tr>
|
<th>生产班组</th>
|
<td class="bz_td">
|
<input type="text" name="生产班组" class="layui-input" id="ProductionTeam" placeholder="选择生产班组" style="background-color:#efefef4d;" readonly>
|
<input type="hidden" name="生产班组代码" id="ProductionTeamID" value="0" autocomplete="off" class="layui-input">
|
<button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="ProductionTeam-BT">...</button>
|
</td>
|
</tr>
|
<tr>
|
<th>工作中心</th>
|
<td class="bz_td">
|
<input type="text" name="工作中心" class="layui-input" id="HProcName" placeholder="选择工作中心" style="background-color:#efefef4d;" readonly>
|
<input type="hidden" name="工作中心代码" id="HProcID" value="0" autocomplete="off" class="layui-input">
|
<button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="HWorkingProcedure-BT">...</button>
|
</td>
|
</tr>
|
<tr>
|
<th>进站单号</th>
|
<td class="t1_input">
|
<input type="text" name="进站单号" class="layui-input" id="进站单号" placeholder="请输入进站单号" style="background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>日期</th>
|
<td class="t1_input">
|
<input type="date" name="日期" class="layui-input HDateNow" id="HDateNow" placeholder="请选择日期">
|
</td>
|
</tr>
|
<tr>
|
<th>生产订单</th>
|
<td class="t1_input">
|
<input type="text" name="生产订单" class="layui-input" id="生产订单" placeholder="请输入生产订单" style="background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>产品代码</th>
|
<td class="t1_input">
|
<input type="text" name="产品代码" class="layui-input" id="产品代码" placeholder="请输入产品代码" style="background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>产品名称</th>
|
<td class="t1_input">
|
<input type="text" name="产品名称" class="layui-input" id="产品名称" placeholder="请输入产品名称" style="background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>规格型号</th>
|
<td class="t1_input">
|
<input type="text" name="规格型号" class="layui-input" id="规格型号" placeholder="请输入规格型号" style="background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>订单跟踪号</th>
|
<td class="t1_input">
|
<input type="text" name="订单跟踪号" class="layui-input" id="订单跟踪号" placeholder="请输入订单跟踪号" style="background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>生产订单数量</th>
|
<td class="t1_input">
|
<input type="text" name="生产订单数量" class="layui-input" id="生产订单数量" placeholder="请输入生产订单数量" style="background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
</div>
|
</form>
|
</div>
|
</div>
|
</div>
|
|
<script src="../../layuiadmin/Scripts/jquery-1.4.1.js" type="text/javascript"></script>
|
<script src="../../layuiadmin/zgqCustom/zgqCustom.js"></script>
|
<script>
|
|
function getUrlVars() {
|
var vars = [], hash;
|
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
for (var i = 0; i < hashes.length; i++) {
|
hash = hashes[i].split('=');
|
vars.push(hash[0]);
|
vars[hash[0]] = hash[1];
|
}
|
return vars;
|
}
|
var params = getUrlVars();
|
var BillStatusjson = params[params[0]];
|
var InterID = params[params[1]];
|
|
layui.config({
|
base: '../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'form', 'laydate', 'table', 'element'], function () {
|
var $ = layui.$
|
, admin = layui.admin
|
, element = layui.element
|
, layer = layui.layer
|
, table = layui.table
|
, laydate = layui.laydate
|
, form = layui.form;
|
|
//获取当前时间处理
|
var data = new Date();
|
var year = data.getFullYear(); //获取年
|
var month = data.getMonth() + 1; //获取月
|
var day = data.getDate(); //获取日
|
var time = year + "/" + month + "/" + day;
|
var date = new Date();
|
//$("#HDateNow").val(time);//加载当前时间
|
//alert($("#HDateNow").val());
|
$("#HDateNow").val(Format(new Date(), "yyyy-MM-dd"));
|
|
//laydate.render({
|
// elem: '#HDateNow' //指定元素
|
// , value: new Date()
|
// ,trigger: 'click',
|
//});
|
//页面初始化赋值
|
//获取单据号
|
$.ajax({
|
url: GetWEBURL() + "/Web/GetMAXNum",
|
type: "GET",
|
data: { "HBillType": '3790' },
|
success: function (d) {
|
$("#HInterID").val(d.data[0].HInterID);
|
$("#HBillNo2").val(d.data[0].HBillNo);
|
}, error: function () {
|
layer.alert("获取单据号失败!", { icon: 5 });
|
}
|
});
|
|
$("#HFbarcode").focus();
|
$("#HFbarcode").css("box-shadow", "0 0 0 1px #00ff00");
|
$("#Serial_number").attr("readonly", "readonly");//流水号只读
|
$("#Serial_number").css("background-color", "#efefef4d");
|
$("#Entrants_number").attr("readonly", "readonly");//进站数量只读
|
$("#Entrants_number").css("background-color", "#efefef4d");
|
|
|
//扫条形码方法
|
$('#HFbarcode').on('keydown', function (event) { //扫条形码
|
var HFbarcode = $('#HFbarcode').val();
|
if (event.keyCode == 13) {
|
//判断文本框是否有数据 new
|
if (HFbarcode == "") {
|
layer.alert("条形码为空!", { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
|
return;
|
}
|
//
|
$.ajax({
|
url: GetWEBURL() + "TEST",
|
type: "GET",
|
data: {
|
"sBillBarCode": HFbarcode
|
},
|
success: function (result) {
|
//var data = result.data;
|
//if (result.count == 1) { // 说明验证成功了,
|
// form.val("component-form-group", { //formTest 即 class="layui-form" 所在元素属性 lay-filter="" 对应的值
|
// "订单跟踪号": data[0].订单跟踪号
|
// , "产品代码": data[0].产品代码
|
// , "产品名称": data[0].产品
|
// , "规格型号": data[0].规格型号
|
// , "流转卡数量": data[0].流转卡数量
|
// , "制单人": data[0].制单人
|
// , "制单日期": data[0].制单日期
|
// , "修改人": data[0].修改人
|
// , "修改日期": data[0].修改日期
|
// , "审核人": data[0].审核人
|
// , "审核日期": data[0].审核日期
|
// , "生产订单号": data[0].源单单号
|
// , "生产订单数量": data[0].生产数量
|
// , "HBillNo": $("#HFbarcode").val()
|
// });
|
// $("#HFbarcode").attr("readonly", "readonly");//条形码只读
|
// $("#HFbarcode").css("background-color", "#efefef4d");
|
// $("#HFbarcode").css("box-shadow", "none");
|
// $("#Serial_number").removeAttr("readonly");//移除流水号只读
|
// $("#Serial_number").css("background-color", "white");
|
// $("#Serial_number").focus();
|
// $("#Serial_number").css("box-shadow", "0 0 0 1px #00ff00");
|
//} else {
|
// layer.alert(result.Message, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
|
//}
|
}, error: function () {
|
layer.alert("扫条形码方法发生错误!", { icon: 5 });
|
}
|
});
|
// layer.msg($('#HFbarcode').val(), { icon: 1 });
|
}
|
});
|
|
//流水号回车方法
|
$('#Serial_number').on('keydown', function (event) { //扫条形码
|
var sProcNo = $('#Serial_number').val();
|
var sBillNo = $('#HBillNo').val();
|
if (event.keyCode == 13) {
|
if (sProcNo == "" || sBillNo == "") {
|
layer.alert("流水号或流转卡号为空!", { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
|
return;
|
}
|
$.ajax({
|
url: GetWEBURL() + "/LEMS/TxtHProcNo_KeyDown",
|
type: "GET",
|
data: {
|
"sProcNo": sProcNo
|
, "sBillNo": sBillNo
|
},
|
success: function (result) {
|
var data = result.data;
|
if (result.count == 1) { // 说明验证成功了,
|
form.val("component-form-group", { //formTest 即 class="layui-form" 所在元素属性 lay-filter="" 对应的值
|
"订单跟踪号": data[0].订单跟踪号
|
, "产品代码": data[0].产品代码
|
, "产品名称": data[0].产品
|
, "规格型号": data[0].规格型号
|
, "流转卡数量": data[0].流转卡数量
|
, "工作中心": data[0].工作中心
|
, "工作中心代码": data[0].工作中心代码
|
, "生产班组": data[0].班组
|
, "生产班组代码": data[0].班组代码
|
, "生产资源": data[0].生产资源
|
, "生产资源代码": data[0].生产资源代码
|
, "制单人": data[0].制单人
|
, "制单日期": data[0].制单日期
|
, "修改人": data[0].修改人
|
, "修改日期": data[0].修改日期
|
, "审核人": data[0].审核人
|
, "审核日期": data[0].审核日期
|
, "生产订单号": data[0].源单单号
|
, "生产订单数量": data[0].生产数量
|
, "HBillNo": $("#HFbarcode").val()
|
});
|
$("#Serial_number").attr("readonly", "readonly");//条形码只读
|
$("#Serial_number").css("background-color", "#efefef4d");
|
$("#Serial_number").css("box-shadow", "none");
|
$("#Entrants_number").removeAttr("readonly");//移除进站数量只读
|
$("#Entrants_number").css("background-color", "white");
|
$("#Entrants_number").focus();
|
$("#Entrants_number").css("box-shadow", "0 0 0 1px #00ff00");
|
} else {
|
// $("#verifycode").click();
|
//layer.msg(result.Message, { icon: 5 });
|
layer.alert(result.Message, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
|
}
|
}, error: function () {
|
layer.alert("流水号方法发生错误!", { icon: 5 });
|
}
|
});
|
}
|
});
|
|
//进站数量回车方法
|
$('#Entrants_number').on('keydown', function (event) {
|
if (event.keyCode == 13) {
|
$("#Entrants_number").attr("readonly", "readonly");//进站数量只读
|
$("#Entrants_number").css("background-color", "#efefef4d");
|
$("#Entrants_number").css("box-shadow", "none");
|
if ($("#Receiver").val()) {
|
$("#Receiver").css("box-shadow", "none");
|
} else {
|
$("#Receiver").css("box-shadow", "1px 1px 1px 2px #00ff00");
|
}
|
}
|
});
|
|
//选择生产班组弹窗
|
form.on('submit(ProductionTeam-BT)', function () {//选择生产班组
|
layer.open({
|
type: 2
|
, area: ['80%', '80%']
|
, title: '生产班组'
|
, shade: 0.6 //遮罩透明度
|
//, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../Baseset/基础资料/Gy_GetProductionTeamList.html', 'yes']
|
, resize: false
|
, cancel: function (index, layero) {
|
}
|
})
|
});
|
|
//选择生产资源弹窗
|
form.on('submit(ProductionResources-BT)', function () {//生产资源
|
layer.open({
|
type: 2
|
, area: ['80%', '80%']
|
, title: '生产资源'
|
, shade: 0.6 //遮罩透明度
|
//, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../Baseset/基础资料/Gy_GetProductionResourcesList.html', 'yes']
|
, resize: false
|
, cancel: function (index, layero) {
|
}
|
})
|
});
|
|
//保存按钮
|
form.on('submit(Saver)', function (data) {//提交
|
//debugger;
|
var sMainStr = JSON.stringify(data.field);
|
console.log(sMainStr);
|
$.ajax(
|
{
|
type: "POST",
|
url: GetWEBURL() + "/LEMS/Sub_SaveBill_Json", //方法所在页面和方法名
|
async: true,
|
data: { "oMain": sMainStr },
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1) { // 说明验证成功了,
|
$("#sHWHID").val("");
|
layer.alert(data.Message + $("#HBillNo").val(), { icon: 1 }, function () {
|
window.location.reload();//刷新页面
|
});
|
}
|
else {
|
layer.alert(data.Message, { icon: 5 });
|
}
|
layer.closeAll("loading");
|
layui.form.render();
|
},
|
error: function (err) {
|
layer.alert("错误:" + err, { icon: 5 });
|
}
|
});
|
});
|
|
//退出按钮
|
form.on('submit(Close)', function (data) {//退出
|
layer.confirm('您确定要关闭本页吗?', { icon: 3, title: '提示' }, function (index) {
|
parent.layui.admin.events.closeThisTabs();
|
});
|
});
|
|
//新增按钮
|
form.on('submit(HAddBT)', function (data) {//退出
|
layer.confirm('您确定要新增吗?', { icon: 3, title: '提示' }, function (index) {
|
window.location.reload();
|
});
|
});
|
|
|
|
|
|
|
//以上为layui模块
|
});
|
|
//原生js初始化
|
$(function () {
|
|
});
|
|
function GetProductionTeamValue(obj) { //返回生产班组
|
if (obj.length == 0) {
|
layer.msg("请先选择班组", { index: 0 });
|
} else {
|
$("#ProductionTeam").val(obj[0].班组);
|
$("#ProductionTeamID").val(obj[0].HItemID);
|
$("#ProductionTeam").css("box-shadow", "none");
|
if ($("#ProductionResources").val()) {
|
$("#ProductionResources").css("box-shadow", "none");
|
} else {
|
$("#ProductionResources").css("box-shadow", "0 0 1px 2px #00ff00");
|
}
|
layer.closeAll();
|
}
|
}
|
|
function GetProductionResourcesValue(obj) { //返回生产资源
|
if ($("#ProductionResources").val()) {
|
$("#ProductionResources").css("box-shadow", "none");
|
}
|
$("#ProductionResources").val(obj[0].生产资源);
|
$("#ProductionResourcesID").val(obj[0].生产资源代码);
|
$("#ProductionResources").css("box-shadow", "none");
|
}
|
|
|
//function GetHEmpValue(obj) //返回职员
|
//{
|
// $("#HEmpName").val(obj[0].HName);
|
// $("#HEmpID").val(obj[0].HItemID);
|
//}
|
//function GetHDeptNameValue(obj) //返回部门
|
//{
|
// $("#HDeptName").val(obj[0].HName);
|
// $("#HDeptID").val(obj[0].HItemID);
|
//}
|
|
|
</script>
|
</body>
|
</html>
|