<!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="sBillBarCode" placeholder="请输入条形码" style="border-radius: 50px;">
|
</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="sProcNo" 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="请输入合格数量">
|
</td>
|
</tr>
|
<tr>
|
<th>工时</th>
|
<td class="t1_input">
|
<input type="text" name="工时" class="layui-input" id="工时" placeholder="请输入工时">
|
</td>
|
</tr>
|
<tr>
|
<th>报废数量</th>
|
<td class="t1_input">
|
<input type="text" name="报废数量" class="layui-input" id="报废数量" placeholder="请输入报废数量">
|
</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="WorkCenter" placeholder="选择工作中心" style="background-color:#efefef4d;" readonly>
|
<input type="hidden" name="工作中心ID" id="WorkCenterID" 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="bz_td">
|
<input type="text" name="检验员" class="layui-input" id="Employee" placeholder="选择检验员" style="background-color:#efefef4d;" readonly>
|
<input type="hidden" name="检验员ID" id="EmployeeID" value="0" autocomplete="off" class="layui-input">
|
<button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="HSecManagerID-BT">...</button>
|
</td>
|
</tr>
|
<tr>
|
<th>出站单号</th>
|
<td class="t1_input">
|
<input type="text" name="出站单号" class="layui-input" id="HBillNo" placeholder="请输入出站单号" style="background-color:#efefef4d;" readonly>
|
<input type="hidden" name="出站单号ID" class="layui-input" id="HInterID">
|
</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;
|
|
//获取当前时间处理
|
$("#HDateNow").val(Format(new Date(), "yyyy-MM-dd"));
|
$("#创建人").val(sessionStorage["HUserName"]);
|
|
//页面初始化赋值
|
//获取单据号
|
$.ajax({
|
url: GetWEBURL() + "/api/newBill/getNewInterBillNo",
|
type: "GET",
|
//data: { "HBillType": '3790' },
|
success: function (d) {
|
$("#HBillNo").val(d.data.HBillNo);//进站单号
|
$("#HInterID").val(d.data.HInterID);//进站单号ID
|
}, error: function () {
|
layer.alert("获取单据号失败!", { icon: 5 });
|
}
|
});
|
|
$("#sBillBarCode").focus();
|
$("#sBillBarCode").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");
|
|
|
//扫条形码方法
|
$('#sBillBarCode').on('keydown', function (event) { //扫条形码
|
var sBillBarCode = $('#sBillBarCode').val();//条形码(流转卡号)(数据库中为单据号)
|
if (event.keyCode == 13) {
|
//判断文本框是否有数据 new
|
if (sBillBarCode == "") {
|
layer.alert("条形码为空!", { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
|
return;
|
}
|
//
|
$.ajax({
|
url: GetWEBURL() + "api/newBill/getHbarCodeDetail",
|
type: "GET",
|
data: {
|
"sBillBarCode": sBillBarCode
|
},
|
success: function (result) {
|
var data = result.data.h_v_Sc_ProcessExchangeBillList[0];
|
if (result.code == 1) { // 说明验证成功了,
|
form.val("component-form-group", { //formTest 即 class="layui-form" 所在元素属性 lay-filter="" 对应的值
|
"流转卡号": $("#sBillBarCode").val()
|
, "工序代码": data.工序代码
|
, "工序名称": data.工序
|
, "合格数量": data.计划数量
|
, "产品代码": data.产品代码
|
, "产品名称": data.产品
|
, "规格型号": data.规格型号
|
, "生产订单数量": data.生产数量
|
});
|
//$("#sBillBarCode").attr("readonly", "readonly");//条形码只读
|
//$("#sBillBarCode").css("background-color", "#efefef4d");
|
$("#sBillBarCode").css("box-shadow", "none");
|
$("#sProcNo").removeAttr("readonly");//移除流水号只读
|
$("#sProcNo").css("background-color", "white");
|
$("#sProcNo").focus();
|
$("#sProcNo").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 });
|
}
|
});
|
}
|
});
|
|
//流水号回车方法
|
$('#sProcNo').on('keydown', function (event) { //扫条形码
|
var sProcNo = $('#sProcNo').val();
|
var sBillNo = $('#sBillBarCode').val();
|
if (event.keyCode == 13) {
|
if (sProcNo == "" || sBillNo == "") {
|
layer.alert("流水号或流转卡号为空!", { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
|
return;
|
}
|
$.ajax({
|
url: GetWEBURL() + "/api/newBill/getProcDetail",
|
type: "GET",
|
data: {
|
"sBillNo": sBillNo
|
, "sProcNo": sProcNo
|
},
|
success: function (result) {
|
var data = result.data.h_v_Sc_ProcessExchangeBillList[0];
|
if (result.code == 1) { // 说明验证成功了,
|
form.val("component-form-group", { //formTest 即 class="layui-form" 所在元素属性 lay-filter="" 对应的值
|
"工序代码": data.工序代码
|
, "工序名称": data.工序
|
, "合格数量": data.计划数量
|
, "产品代码": data.产品代码
|
, "产品名称": data.产品
|
, "规格型号": data.规格型号
|
, "生产订单数量": data.生产数量
|
});
|
$("#sProcNo").css("box-shadow", "none");
|
checkPopup();
|
} else {
|
layer.alert(result.Message, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
|
}
|
}, error: function () {
|
layer.alert("流水号方法发生错误!", { icon: 5 });
|
}
|
});
|
}
|
});
|
|
//工时回车方法
|
$('#工时').on('keydown', function (event) {
|
checkPopup();
|
});
|
|
//报废数量回车方法
|
$('#报废数量').on('keydown', function (event) {
|
$('#报废数量').blur();
|
checkPopup();
|
});
|
|
//选择生产班组弹窗
|
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(HWorkingProcedure-BT)', function () {//选择工作中心
|
layer.open({
|
type: 2
|
, area: ['80%', '80%']
|
, title: '工作中心'
|
, shade: 0.6 //遮罩透明度
|
//, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../Baseset/基础资料/Gy_WorkCenterList.html', 'yes']
|
, resize: false
|
, cancel: function (index, layero) {
|
}
|
})
|
});
|
|
//选择检验员
|
form.on('submit(HSecManagerID-BT)', function (data) {//选择检验员
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '检验员列表'
|
, shade: 0.6 //遮罩透明度
|
, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../Baseset/基础资料/Gy_EmployeeList.html?Type=HSecManager', 'yes']
|
, resize: false
|
, cancel: function () {
|
//$(".layui-btn").removeClass("layui-btn-disabled");
|
}
|
})
|
});
|
|
//保存按钮
|
form.on('submit(Saver)', function (data) {//提交
|
//debugger;
|
var sMainStr = JSON.stringify(data.field);
|
console.log(sMainStr);
|
$.ajax(
|
{
|
type: "POST",
|
url: GetWEBURL() + "/test", //方法所在页面和方法名
|
async: true,
|
data: { "oMain": sMainStr },
|
dataType: "json",
|
success: function (result) {
|
if (result.code == 1) { // 说明验证成功了,
|
$("#sHWHID").val("");
|
layer.alert(result.msg + "单号为:" + $("#HBillNo").val(), { icon: 1 }, function () {
|
window.location.reload();//刷新页面
|
});
|
}
|
else {
|
layer.alert(result.msg, { 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 checkPopup() {
|
$("#工时").css("box-shadow", "none");
|
$("#报废数量").css("box-shadow", "none");
|
$("#ProductionResources").css("box-shadow", "none");
|
$("#ProductionTeam").css("box-shadow", "none");
|
$("#WorkCenter").css("box-shadow", "none");
|
$("#Employee").css("box-shadow", "none");
|
if (!$("#工时").val()) {
|
$("#工时").focus();
|
$("#工时").css("box-shadow", "0 0 1px 2px #00ff00");
|
}
|
else if (!$("#报废数量").val()) {
|
$("#报废数量").focus();
|
$("#报废数量").css("box-shadow", "0 0 1px 2px #00ff00");
|
}
|
else if (!$("#ProductionResources").val()) {
|
$("#ProductionResources").css("box-shadow", "0 0 1px 2px #00ff00");
|
}
|
else if (!$("#ProductionTeam").val()) {
|
$("#ProductionTeam").css("box-shadow", "0 0 1px 2px #00ff00");
|
}
|
else if (!$("#WorkCenter").val()) {
|
$("#WorkCenter").css("box-shadow", "0 0 1px 2px #00ff00");
|
}
|
else if (!$("#Employee").val()) {
|
$("#Employee").css("box-shadow", "0 0 1px 2px #00ff00");
|
}
|
}
|
|
//返回生产班组
|
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");
|
checkPopup();
|
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");
|
checkPopup();
|
}
|
|
//返回工作中心
|
function GetWorkCenterValue(obj) { //返回工作中心
|
if (obj.length == 0) {
|
layer.msg("请先选择班组", { index: 0 });
|
} else {
|
$("#WorkCenter").val(obj[0].生产班组);
|
$("#WorkCenterID").val(obj[0].HItemID);
|
$("#WorkCenter").css("box-shadow", "none");
|
checkPopup();
|
layer.closeAll();
|
}
|
}
|
|
//返回检验员
|
function GetHSecManagerValue(obj) { //返回检验员
|
$("#Employee").val(obj[0].HName);
|
$("#EmployeeID").val(obj[0].HNumber);
|
$("#Employee").css("box-shadow", "none");
|
checkPopup();
|
}
|
|
</script>
|
</body>
|
</html>
|