<!DOCTYPE html>
|
<html>
|
<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/zgqCustom/zgqCustom.js"></script>
|
<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 src="../../../layuiadmin/PubCustom.js"></script>-->
|
<script src="../../CreateControl.js"></script>
|
</head>
|
<body>
|
<div class="layui-fluid" style="padding: 0;">
|
<div class="layui-card" style="padding: 2px;background-color: #efefef;">
|
<div class="layui-card-body" style="padding: 1px;">
|
<form class="layui-form" action="" lay-filter="formData" style="background-color:white;">
|
<!--<div style="padding: 10px;">
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">保存</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">退出</button>
|
</div>-->
|
<div class="layui-tab" lay-filter="tab-POStockInBill" style="width: 49%; float: left; height: 400px;background-color:white;">
|
<div class="layui-tab-content">
|
<!--基本信息-->
|
<div class="layui-tab-item layui-show">
|
<div class="layui-form-item" style="padding-top: 10px;">
|
<div class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">条形码:</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HBarCodeSN" lay-verify="HBarCodeSN" autocomplete="off" placeholder="请键入后回车" id="HBarCodeSN" style="width: 500px;">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;padding: 9px 18px;">工序</label>
|
<div class="layui-input-block" style="margin-left: 77px;">
|
<input type="text" class="layui-input" name="HProcName" lay-verify="HProcName" id="HProcName" style="background-color: #efefef4d; width: 60%; display: inline-block;" readonly>
|
<input type="hidden" name="HProcID" id="HProcID" lay-verify="HProcID" value="0">
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHProc" id="btnHProc" style="padding: 0 10px;float: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">工序号</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HProcNo" lay-verify="HProcNo" id="HProcNo">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">产品编码</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" lay-verify="HMaterNumber" name="HMaterNumber" id="HMaterNumber" style="background-color:#efefef4d;" readonly>
|
<input type="hidden" class="layui-input" lay-verify="HMaterID" name="HMaterID" id="HMaterID">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">产品名称</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" lay-verify="HMaterName" name="HMaterName" id="HMaterName" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">规格型号</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" lay-verify="HMaterModel" name="HMaterModel" id="HMaterModel" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px; padding: 9px 18px;">当前车间</label>
|
<div class="layui-input-block" style="margin-left: 77px;">
|
<input type="text" class="layui-input" lay-verify="HDeptName" name="HDeptName" id="HDeptName" style="background-color: #efefef4d; width: 60%; display: inline-block;" readonly>
|
<input type="hidden" class="layui-input" lay-verify="HDeptID" name="HDeptID" id="HDeptID">
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHDept" id="btnHDept" style="padding: 0 10px;float: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px; padding: 9px 18px;">生产班组</label>
|
<div class="layui-input-block" style="margin-left: 77px;">
|
<input type="text" class="layui-input" name="HGroupName" id="HGroupName" lay-verify="HGroupName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<input type="hidden" class="layui-input" name="HGroupID" lay-verify="HGroupID" id="HGroupID" value="0">
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHGroup" id="btnHGroup" style="padding: 0 10px;float: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px; padding: 9px 18px;">生产资源</label>
|
<div class="layui-input-block" style="margin-left: 77px;">
|
<input type="text" class="layui-input" name="HSourceName" id="HSourceName" lay-verify="HSourceName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<input type="hidden" class="layui-input" name="HSourceID" lay-verify="HSourceID" id="HSourceID" value="0">
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHSource" id="btnHSource" style="padding: 0 10px;float: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">工序流转卡</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HProcExchBillNo" lay-verify="HProcExchBillNo" id="HProcExchBillNo" value="" style="background-color:#efefef4d;">
|
<input type="hidden" class="layui-input" name="HProcExchInterID" lay-verify="HProcExchInterID" id="HProcExchInterID" value="0">
|
<input type="hidden" class="layui-input" name="HProcExchEntryID" lay-verify="HProcExchEntryID" id="HProcExchEntryID" value="0">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">生产订单</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HICMOBillNo" lay-verify="HICMOBillNo" id="HICMOBillNo" value="" style="background-color:#efefef4d;">
|
<input type="hidden" class="layui-input" name="HICMOInterID" lay-verify="HICMOInterID" id="HICMOInterID" value="0">
|
<input type="hidden" class="layui-input" name="HICMOEntryID" lay-verify="HICMOEntryID" id="HICMOEntryID" value="0">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">单据号</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly>
|
<input type="hidden" name="HInterID" id="HInterID" lay-verify="HInterID">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">产品SN</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HBarCode_P" lay-verify="HBarCode_P" id="HBarCode_P" value="" style="background-color:#efefef4d;display: inline-block;" readonly>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;padding: 9px 18px;">操作员</label>
|
<div class="layui-input-block" style="margin-left: 77px;">
|
<input type="text" class="layui-input" lay-verify="HEmpName2" name="HEmpName2" id="HEmpName2" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<input type="hidden" class="layui-input" lay-verify="HEmpID2" name="HEmpID2" id="HEmpID2" value="0">
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHEmp2" id="btnHEmp2" style="padding: 0 10px;float: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;padding: 9px 18px;">质检员</label>
|
<div class="layui-input-block" style="margin-left: 77px;">
|
<input type="text" class="layui-input" lay-verify="HEmpName" name="HEmpName" id="HEmpName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<input type="hidden" class="layui-input" lay-verify="HEmpID" name="HEmpID" id="HEmpID" value="0">
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHEmp" id="btnHEmp" style="padding: 0 10px;float: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="layui-tab" lay-filter="tab-POStockInBill" style="width: 39%; float: left; height: 100px; background-color: white;">
|
<div class="layui-tab-content" style="padding-top: 10px; padding-left: 40%;">
|
<div class="layui-tab-item layui-show">
|
<div class="layui-form-item">
|
<div class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">总合格数</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" lay-verify="HQualifiedCount" name="HQualifiedCount" id="HQualifiedCount" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">总不良数</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HBadCount" lay-verify="HBadCount" id="HBadCount" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="layui-tab" lay-filter="tab-POStockInBill" style="width: 10%; float: left; height: 100px; background-color: white;">
|
<div class="layui-tab-content" style="padding-top: 10px;">
|
<div class="layui-tab-item layui-show">
|
<div class="layui-form-item">
|
<div style="padding: 10px;">
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">退出</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="layui-tab layui-tab-card" style="width: 49%; float: left;height:300px;">
|
<ul class="layui-tab-title">
|
<li class="layui-this">关键件清单</li>
|
</ul>
|
<div class="layui-tab-content" style="background-color: white;">
|
<div class="layui-row" style="margin-bottom: 5px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">流转卡:</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HBardCodeProcExchBillNo" autocomplete="off" lay-verify="HBardCodeProcExchBillNo" id="HBardCodeProcExchBillNo">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">配件码:</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HBardCodeMater" autocomplete="off" lay-verify="HBardCodeMater" id="HBardCodeMater">
|
</div>
|
</div>
|
</div>
|
<div class="layui-tab-item layui-show">
|
<!--关键件清单-->
|
<table class="layui-hide" id="mainTable2" lay-filter="mainTable2"></table>
|
</div>
|
</div>
|
</div>
|
<div class="layui-tab layui-tab-card" style="width: 49%; float: left;">
|
<ul class="layui-tab-title">
|
<li class="layui-this">不良记录</li>
|
</ul>
|
<div class="layui-tab-content" style="background-color: white;">
|
<div class="layui-row" style="margin-bottom: 5px;">
|
<div class="layui-inline">
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="BadReport" id="BadReport">不良汇报</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="BadReport_SubtleFlaw" id="BadReport_SubtleFlaw">微瑕品记录</button>
|
</div>
|
</div>
|
<div class="layui-tab-item layui-show">
|
<!--不良记录-->
|
<table class="layui-hide" id="mainTable3" lay-filter="mainTable3"></table>
|
</div>
|
</div>
|
</div>
|
<div class="layui-tab layui-tab-card" style="width: 49%; float: left;">
|
<ul class="layui-tab-title">
|
<li class="layui-this">合格记录</li>
|
</ul>
|
<div class="layui-tab-content" style="background-color: white;">
|
<div class="layui-tab-item layui-show">
|
<!--合格记录-->
|
<table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
|
</div>
|
</div>
|
</div>
|
<script type="text/html" id="toolbarDemo">
|
<div class="layui-btn-container">
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>增加一行</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>复制一行</button>
|
</div>
|
</script>
|
<script type="text/html" id="toolbarDemo2">
|
<div class="layui-btn-container">
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine2"><i class="layui-icon layui-icon-form"></i>增加一行</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine2"><i class="layui-icon layui-icon-form"></i>复制一行</button>
|
</div>
|
</script>
|
<input type="hidden" id="HProdOrgID" name="HProdOrgID" value="0" />
|
<input type="hidden" name="HPieceQty" id="HPieceQty" value="0">
|
<input type="hidden" name="HICMOQty" id="HICMOQty" value="0">
|
</form>
|
</div>
|
</div>
|
</div>
|
</body>
|
</html>
|
<script type="text/html" id="barDemo2">
|
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del2">删除</a>
|
</script>
|
<script type="text/html" id="barDem03">
|
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del3">删除</a>
|
</script>
|
<script>
|
|
layui.config({
|
base: '../../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'form', 'laydate', 'table', 'element'], function () {
|
|
//#region 公共变量
|
|
var $ = layui.$
|
, admin = layui.admin
|
, layer = layui.layer
|
, table = layui.table
|
, form = layui.form
|
, element = layui.element;
|
|
//定义全局变量
|
|
var HModName = "Cj_ProcessItemStationPlatform";
|
var option = [];
|
var option2 = [];
|
var option3 = [];
|
var setIntervalIndex = null;
|
//#endregion
|
|
//#region 进入页面即加载
|
|
set_ClearBill();
|
|
//制单人
|
$("#HMaker").val(sessionStorage["HUserName"]);
|
$("#hmakedate").val(Format(new Date(), "yyyy-MM-dd"));
|
|
|
|
//#endregion
|
|
//#region 触发事件:包括form.on(){}格式的所有点击事件、选择事件等
|
|
//条形码回车方法
|
$('#HBarCodeSN').on('keydown', function (event) {
|
var HBarCode = $('#HBarCodeSN').val();
|
var HBardCodeProcExchBillNo = $('#HBardCodeProcExchBillNo').val();
|
if (event.keyCode == 13) {
|
if (!HBardCodeProcExchBillNo) {
|
layer.msg("请先扫流转卡!")
|
return;
|
} else {
|
HBarCode = HBarCode.toUpperCase();
|
if (!HBarCode) {
|
layer.msg("条形码不能为空!")
|
return;
|
} else {
|
if (HBarCode.length != 29 && HBarCode.length != 50) {
|
layer.alert("子件条码长度不为29位或50位!", { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
|
return;
|
}
|
|
if (HBarCode.match(/[^\x00-\xff]/g) != null) {
|
layer.alert("必须是半角字符!", { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
|
return;
|
}
|
}
|
}
|
for (var i = 0; i < option.data.length; i++) {
|
if (option.data[i]["HBatchNo"] == "") {
|
layer.msg("当前工序批次不能为空!")
|
return;
|
}
|
}
|
txtHBarCode_KeyDown(HBarCode);
|
}
|
});
|
|
//流转卡回车方法
|
$('#HBardCodeProcExchBillNo').on('keydown', function (event) {
|
var HBarCode = $('#HBardCodeProcExchBillNo').val();
|
if (event.keyCode == 13) {
|
if (!HBarCode) {
|
layer.msg("流转卡不能为空!")
|
return;
|
}
|
setIntervalIndex = setInterval(setIntervalList, 30000);
|
get_BomList(HBarCode);
|
//if (option.data != 0) {
|
// //保存到临时表
|
// get_AddBomTempList();
|
//}
|
//查询不良记录
|
get_BadRecords();
|
//查询合格记录
|
get_HGRecords();
|
|
|
}
|
});
|
|
|
|
//配件回车方法
|
$('#HBardCodeMater').on('keydown', function (event) {
|
var HBarCode = $('#HBardCodeMater').val();
|
var HBardCodeProcExchBillNo = $('#HBardCodeProcExchBillNo').val();
|
if (event.keyCode == 13) {
|
if (!HBardCodeProcExchBillNo) {
|
layer.msg("请先扫流转卡!")
|
return;
|
} else {
|
if (!HBarCode) {
|
layer.msg("配件不能为空!")
|
return;
|
}
|
}
|
get_Accessory(HBarCode);
|
}
|
});
|
|
//不良记录行内事件
|
table.on('tool(mainTable3)', function (obj) {
|
set_GridDelete1(obj); //行内删除
|
});
|
|
//合格记录行内事件
|
table.on('tool(mainTable)', function (obj) {
|
set_GridDelete2(obj); //行内删除
|
});
|
|
//不良汇报
|
form.on('submit(BadReport)', function () {
|
BadReport();
|
});
|
|
//微瑕品记录
|
form.on('submit(BadReport_SubtleFlaw)', function () {
|
BadReport_SubtleFlaw();
|
});
|
|
//选择质检员
|
form.on('submit(btnHEmp)', function () {
|
btnHEmp();
|
});
|
|
//选择操作员
|
form.on('submit(btnHEmp2)', function () {
|
btnHEmp2();
|
});
|
|
|
//选择生产资源
|
form.on('submit(btnHSource)', function () {
|
btnHSource();
|
});
|
|
//选择生产班组按钮
|
form.on('submit(btnHGroup)', function () {
|
btnHGroup();
|
});
|
|
//选择生产车间按钮
|
form.on('submit(btnHDept)', function () {
|
btnHDept();
|
});
|
|
//选择工序按钮
|
form.on('submit(btnHProc)', function () {
|
btnHProc();
|
});
|
|
|
//退出
|
form.on('submit(btnEdit)', function (data) {
|
if (params[1] != null) {
|
Pub_Close(1);
|
} else if (params[1] == null) {
|
Pub_Close(2);
|
}
|
});
|
|
|
//#endregion
|
|
//#region 此页面所有的方法
|
|
//初始化界面
|
function set_ClearBill() {
|
//进入页面默认光标在流转卡上
|
$("#HBardCodeProcExchBillNo").focus();
|
|
get_Display();
|
get_CriticalPartsList();//关键件清单 不良记录 合格记录
|
|
|
}
|
|
// 生成单据号
|
function createBillNo() {
|
var sql = "select * from Sc_StationOutBillMain where HProcExchBillNo='" + $("#HProcExchBillNo").val() + "' and HProcID=" + $("#HProcID").val() +" order by HDate desc"
|
$.ajax({
|
url: GetWEBURL() + "/Gy_SOPBillList/WindowPrintList",
|
async: false,
|
type: "GET",
|
data: { "sWhere": sql },
|
success: function (data) {
|
if (data.data.length > 0) {
|
$("#HInterID").val(data.data[0].HInterID);
|
$("#HBillNo").val(data.data[0].HBillNo);
|
} else {
|
$.ajax({
|
url: GetWEBURL() + "/Web/GetMAXNum",
|
async: false,
|
type: "GET",
|
data: { "HBillType": '3791' },
|
success: function (d) {
|
$("#HInterID").val(d.data[0].HInterID);
|
$("#HBillNo").val(d.data[0].HBillNo);
|
}
|
});
|
}
|
}
|
});
|
}
|
|
//查询
|
function get_Display() {
|
var sWhere = " and 编码='" + sessionStorage["Czybm"]+"'";
|
var ajaxLoad = layer.load();
|
//进入页面显示的缓存列表
|
$.ajax({
|
url: GetWEBURL() + '/Cj_SingleStation/Cj_CollectionOfSingleProductDefectsUserList',
|
type: "GET",
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
|
success: function (data1) {
|
if (data1.count == 1) {
|
|
$("#HDeptID").val(data1.data[0]["HDeptID"]);
|
$("#HDeptName").val(data1.data[0]["车间"]);
|
$("#HProcName").val(data1.data[0]["工序"]);
|
$("#HProcID").val(data1.data[0]["HProcID"]);
|
$("#HSourceID").val(data1.data[0]["HSourceID"]);
|
$("#HSourceName").val(data1.data[0]["生产资源"]);
|
$("#HEmpID").val(data1.data[0]["HEmpID"]);
|
$("#HEmpName").val(data1.data[0]["质检员"]);
|
$("#HEmpID2").val(data1.data[0]["HEmpID"]);
|
$("#HEmpName2").val(data1.data[0]["质检员"]);
|
$("#HGroupID").val(data1.data[0]["HGroupID"]);
|
$("#HGroupName").val(data1.data[0]["生产班组"]);
|
layer.close(ajaxLoad);
|
|
//layer.alert("查询成功", { icon: 1 });
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
|
});
|
}
|
|
//关键件清单
|
function get_CriticalPartsList() {
|
option= {
|
elem: '#mainTable2'
|
//, toolbar: '#toolbarDemo'
|
, page: false
|
, totalRow: true
|
, cellMinWidth: 120
|
, data: []
|
, height: 185
|
, limit: Number.MAX_VALUE
|
, cols: [[
|
{ type: 'numbers', title: '序号' }
|
, { field: '日期', title: '日期' }
|
, { field: '配件代码', title: '配件代码' }
|
, { field: '配件名称', title: '配件名称' }
|
, { field: '配件规格', title: '配件规格' }
|
, { field: '配件数量', title: '配件数量', totalRow: true}
|
, { field: 'HBatchNo', title: '当前批次' }
|
, { field: 'HICMOInterID', title: 'HICMOInterID', hide: true }
|
, { field: 'HICMOEntryID', title: 'HICMOEntryID', hide: true }
|
, { field: 'HICMOBillNo', title: 'HICMOBillNo', hide: true }
|
, { field: 'HProcExchInterID', title: 'HProcExchInterID', hide: true }
|
, { field: 'HProcExchEntryID', title: 'HProcExchEntryID', hide: true }
|
, { field: 'HProcExchBillNo', title: 'HProcExchBillNo', hide: true }
|
, { field: 'HMaterID', title: 'HMaterID', hide: true }
|
, { field: 'HBarCode', title: 'HBarCode', hide: true }
|
]]
|
}
|
|
option2 = {
|
elem: '#mainTable3'
|
//, toolbar: '#toolbarDemo'
|
, page: false
|
, totalRow: true
|
, cellMinWidth: 120
|
, limit: Number.MAX_VALUE
|
, data: []
|
, height: 325
|
, cols: [[
|
{ type: 'numbers', title: '序号' }
|
, { field: '日期', title: '日期' }
|
, { field: 'HName', title: '产品名称' }
|
, { field: 'HNumber', title: '产品代码' }
|
, { field: 'HBarCode', title: 'SN码', width: 300 }
|
, { field: '不良原因', title: '不良原因' }
|
, { field: 'HBatchNo', title: '不良类型' }
|
, { field: 'HInterID', title: 'HInterID', hide: true }
|
, { field: 'HEntryID', title: 'HEntryID', hide: true }
|
, { fixed: 'right', title: '操作', toolbar: '#barDemo2' }
|
]]
|
}
|
|
option3 = {
|
elem: '#mainTable'
|
//, toolbar: '#toolbarDemo'
|
, page: false
|
, totalRow: true
|
, cellMinWidth: 120
|
, limit: Number.MAX_VALUE
|
, data: []
|
, height: 370
|
, cols: [[
|
{ type: 'numbers', title: '序号' }
|
, { field: 'hmainid', title: 'hmainid', hide: true }
|
, { field: 'hsubid', title: 'hsubid', hide: true }
|
, { field: '日期', title: '日期' }
|
, { field: '产品名称', title: '产品名称' }
|
, { field: '产品条码', title: 'SN码', width: 300}
|
//, { field: '配件条码', title: '配件SN码' }
|
//, { field: '任务单号', title: '订单号' }
|
, { field: 'HICMOInterID', title: 'HICMOInterID', hide: true }
|
, { field: 'HICMOEntryID', title: 'HICMOEntryID', hide: true }
|
, { field: 'HICMOBillNo', title: 'HICMOBillNo', hide: true }
|
, { field: 'HProcExchInterID', title: 'HProcExchInterID', hide: true }
|
, { field: 'HProcExchEntryID', title: 'HProcExchEntryID', hide: true }
|
, { field: 'HProcExchBillNo', title: 'HProcExchBillNo', hide: true }
|
, { field: 'HMaterID', title: 'HMaterID', hide: true }
|
, { field: 'HBarCode', title: 'HBarCode', hide: true }
|
, { fixed: 'right', title: '操作', toolbar: '#barDem03' }
|
]]
|
}
|
|
table.render(option);
|
table.render(option2);
|
table.render(option3);
|
|
}
|
|
//查询不良记录
|
function get_BadRecords() {
|
var ajaxLoad = layer.load();
|
var HProcExchInterID = $("#HProcExchInterID").val();
|
var HProcExchEntryID = $("#HProcExchEntryID").val();
|
//进入页面显示的缓存列表
|
$.ajax({
|
url: GetWEBURL() + '/Cj_SingleStation/BadRecordsList',
|
type: "GET",
|
async: false,
|
data: { "HProcExchInterID": HProcExchInterID, "HProcExchEntryID": HProcExchEntryID, "user": sessionStorage["HUserName"] },
|
success: function (data1) {
|
if (data1.count == 1) {
|
option2.data = data1.data.h_p_Gy_BadRecordsList;
|
table.render(option2);
|
$("#HBadCount").val(data1.data.h_p_Gy_BadRecordsList1.length - data1.data.h_p_Gy_BadRecordsList2.length);
|
layer.close(ajaxLoad);
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
|
});
|
}
|
|
//查询合格记录
|
function get_HGRecords() {
|
var HProcExchInterID = $("#HProcExchInterID").val();
|
var HProcExchEntryID = $("#HProcExchEntryID").val();
|
var sWhere = "and HProcExchInterID=" + HProcExchInterID + " and HProcExchEntryID=" + HProcExchEntryID;
|
var ajaxLoad = layer.load();
|
//进入页面显示的缓存列表
|
$.ajax({
|
url: GetWEBURL() + '/Cj_SingleStation/HGRecordsList',
|
type: "GET",
|
async: false,
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
|
success: function (data1) {
|
if (data1.count == 1) {
|
option3.data = data1.data;
|
table.render(option3);
|
$("#HQualifiedCount").val(data1.data.length);
|
layer.close(ajaxLoad);
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
|
});
|
}
|
|
//条码回车查询
|
function txtHBarCode_KeyDown(HBarCode) {
|
|
var HProcExchBillNo = $("#HProcExchBillNo").val();
|
var indexs = layer.load();
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Cj_SingleStation/SNHBardCodeList",
|
async: false,
|
data: { "HBarCode": HBarCode, "HProcExchBillNo": HProcExchBillNo, "user": sessionStorage["HUserName"], "HOrgID": sessionStorage["OrganizationID"] },
|
dataType: "json",
|
success: function (data1) {
|
if (data1.count == 1) {
|
layer.close(indexs);
|
var index = layer.load();
|
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Cj_SingleStation/HBardCodeSNList",
|
async: false,
|
data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"] },
|
dataType: "json",
|
success: function (data1) {
|
if (data1.count == 1) {
|
layer.close(index);
|
$("#HBarCode_P").val(HBarCode);
|
if (AllowLoadData()) {
|
//保存数据
|
set_AddAssemblyBill();
|
}
|
}
|
else {
|
layer.close(index);
|
layer.msg(data1.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
$("#HBarCodeSN").val("");
|
},
|
error: function (err) {
|
layer.close(index);
|
layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
});
|
}
|
else {
|
layer.close(indexs);
|
layer.msg(data1.Message);
|
}
|
//光标跳转到SN条码文本框上
|
//$("#HBarCodeSN").focus();
|
$("#HBarCodeSN").val("");
|
},
|
error: function (err) {
|
layer.close(indexs);
|
layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
});
|
}
|
|
//不良记录删除方法
|
function set_GridDelete1(obj) {
|
if (obj.event === 'del2') {
|
layer.confirm('真的删除行吗?', function (index) {
|
var HInterID = obj.data.HInterID;
|
var HEntryID = obj.data.HEntryID;
|
var HProcID = $("#HProcID").val();
|
|
var ajaxLoad = layer.load();
|
$.ajax({
|
url: GetWEBURL() + "/Cj_SingleStation/DelBadRecords",
|
type: "GET",
|
async: false,
|
data: { "HInterID": HInterID, "HEntryID": HEntryID, "user": sessionStorage["HUserName"], "HProcID": HProcID },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg("删除成功!");
|
layer.close(ajaxLoad);
|
//查询不良记录
|
get_BadRecords();
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
layer.close(ajaxLoad);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
layer.close(ajaxLoad);
|
}
|
})
|
});
|
}
|
}
|
|
//合格记录删除方法
|
function set_GridDelete2(obj) {
|
if (obj.event === 'del3') {
|
layer.confirm('真的删除行吗?', function (index) {
|
var HInterID = obj.data.hmainid;
|
var HEntryID = obj.data.hsubid;
|
|
var ajaxLoad = layer.load();
|
$.ajax({
|
url: GetWEBURL() + "/Cj_SingleStation/DelQualifiedRecords",
|
type: "GET",
|
async: false,
|
data: { "HInterID": HInterID, "HEntryID": HEntryID, "user": sessionStorage["HUserName"] },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg("删除成功!");
|
layer.close(ajaxLoad);
|
//查询合格记录
|
get_HGRecords();
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
layer.close(ajaxLoad);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
layer.close(ajaxLoad);
|
}
|
})
|
});
|
}
|
}
|
|
//流转卡查询关键件清单
|
function get_BomList(HBarCode) {
|
var index = layer.load();
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Cj_SingleStation/HBardCodeBomList",
|
async: false,
|
data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"] },
|
dataType: "json",
|
success: function (data1) {
|
if (data1.count == 1) {
|
layer.close(index);
|
|
$("#HBardCodeProcExchBillNo").attr("readonly", "readonly");//流转卡只读
|
$("#HBardCodeProcExchBillNo").css("background-color", "#efefef4d");//流转卡灰色
|
//光标跳转到SN条码文本框上
|
$("#HBarCodeSN").focus();
|
|
$("#HMaterNumber").val(data1.data[0]["HMainMaterNumber"]);
|
$("#HMaterID").val(data1.data[0]["HMainMaterID"]);
|
$("#HMaterName").val(data1.data[0]["HMainMaterName"]);
|
$("#HMaterModel").val(data1.data[0]["HMainModel"]);
|
$("#HProcExchInterID").val(data1.data[0]["HProcExchInterID"]);
|
$("#HProcExchEntryID").val(data1.data[0]["HProcExchEntryID"]);
|
$("#HProcExchBillNo").val(data1.data[0]["HProcExchBillNo"]);
|
$("#HICMOBillNo").val(data1.data[0]["HICMOBillNo"]);
|
$("#HICMOInterID").val(data1.data[0]["HICMOInterID"]);
|
$("#HICMOEntryID").val(data1.data[0]["HICMOEntryID"]);
|
$("#HProcNo").val(data1.data[0]["HProcNo"]);
|
$("#HPieceQty").val(data1.data[0]["HPieceQty"]);
|
$("#HICMOQty").val(data1.data[0]["HICMOQty"]);
|
|
createBillNo();
|
|
option.data = data1.data;
|
table.render(option)
|
|
for (var i = 0; i < option.data.length; i++) {
|
if (parseFloat(option.data[i]["配件数量"]) == 0|| isNaN(parseFloat(option.data[i]["配件数量"])) ) {
|
if (setIntervalIndex != null) {
|
//clearInterval(setIntervalIndex);
|
//setIntervalIndex = null;
|
clearTimerQ();
|
setIntervalIndex = 0;
|
}
|
//光标跳转到配件文本框上
|
$("#HBardCodeMater").focus();
|
return layer.msg("配件数量为0!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
}
|
|
}
|
else if (data1.count == 2) {
|
layer.close(index);
|
|
$("#HBardCodeProcExchBillNo").attr("readonly", "readonly");//流转卡只读
|
$("#HBardCodeProcExchBillNo").css("background-color", "#efefef4d");//流转卡灰色
|
//光标跳转到SN条码文本框上
|
$("#HBarCodeSN").focus();
|
|
$("#HMaterNumber").val(data1.data[0]["HMainMaterNumber"]);
|
$("#HMaterID").val(data1.data[0]["HMainMaterID"]);
|
$("#HMaterName").val(data1.data[0]["HMainMaterName"]);
|
$("#HMaterModel").val(data1.data[0]["HMainModel"]);
|
$("#HProcExchInterID").val(data1.data[0]["HProcExchInterID"]);
|
$("#HProcExchEntryID").val(data1.data[0]["HProcExchEntryID"]);
|
$("#HProcExchBillNo").val(data1.data[0]["HProcExchBillNo"]);
|
$("#HICMOBillNo").val(data1.data[0]["HICMOBillNo"]);
|
$("#HICMOInterID").val(data1.data[0]["HICMOInterID"]);
|
$("#HICMOEntryID").val(data1.data[0]["HICMOEntryID"]);
|
$("#HProcNo").val(data1.data[0]["HProcNo"]);
|
$("#HPieceQty").val(data1.data[0]["HPieceQty"]);
|
$("#HICMOQty").val(data1.data[0]["HICMOQty"]);
|
|
createBillNo();
|
|
} else {
|
layer.close(index);
|
layer.msg(data1.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
$("#HBarCodeSN").val("");
|
},
|
error: function (err) {
|
layer.close(index);
|
layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
});
|
}
|
|
function clearTimerQ() {
|
try {
|
window.clearInterval(setIntervalIndex)
|
} catch (error) { }
|
window.setIntervalIndex = null
|
}
|
|
function setIntervalList() {
|
clearTimerQ();
|
|
var HBarCode = $('#HBardCodeProcExchBillNo').val();
|
|
if (!HBarCode) {
|
layer.msg("流转卡不能为空!")
|
return;
|
}
|
|
//查询不良记录
|
get_BadRecords();
|
//查询合格记录
|
get_HGRecords();
|
|
if (option2.data.length != 0 || option3.data.length != 0) {
|
get_BomList(HBarCode);
|
}
|
|
//if (option.data != 0) {
|
// //保存到临时表
|
// get_AddBomTempList();
|
//}
|
|
if (setIntervalIndex != null && setIntervalIndex != 0) {
|
setIntervalIndex = setInterval(setIntervalList, 30000);
|
}
|
}
|
|
//配件查询数据
|
var KNum = 0;
|
function get_Accessory(HBarCode) {
|
var index = layer.load();
|
var HProcExchBillNo = $("#HProcExchBillNo").val();
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Cj_SingleStation/HBardCodeAccessoryList",
|
async: false,
|
data: { "HBarCode": HBarCode, "HProcExchBillNo": HProcExchBillNo, "user": sessionStorage["HUserName"],"HBillType":"DPGZ"},
|
dataType: "json",
|
success: function (data1) {
|
if (data1.count == 1) {
|
layer.close(index);
|
|
var MaterNum = 0;
|
for (var i = 0; i < option.data.length; i++) {
|
if (data1.data[0]["HMaterNumber"] == option.data[i]["配件代码"] && option.data[i]["HBatchNo"] == data1.data[0]["HBatchNo"] && option.data[i]["HBatchNo"] != "") {
|
return layer.msg("当前批次已扫入,请不要重复扫入!");
|
}
|
if (data1.data[0]["HMaterNumber"] == option.data[i]["配件代码"] && option.data[i]["HBatchNo"] != data1.data[0]["HBatchNo"] && option.data[i]["HBatchNo"] != "") {
|
layer.confirm('是否要把当前批次:' + option.data[i]["HBatchNo"] + '替换成批次:' + data1.data[0]["HBatchNo"], function (index) {
|
layer.close(index);
|
option.data[i]["HBatchNo"] = data1.data[0]["HBatchNo"];
|
option.data[i]["配件数量"] = data1.data[0]["HQty"];
|
option.data[i]["HBarCode"] = HBarCode;
|
table.render(option);
|
|
PD_HBatchNo();
|
});
|
break;
|
}
|
|
if (data1.data[0]["HMaterNumber"] == option.data[i]["配件代码"]) {
|
option.data[i]["HBatchNo"] = data1.data[0]["HBatchNo"];
|
option.data[i]["配件数量"] = data1.data[0]["HQty"];
|
option.data[i]["HBarCode"] = HBarCode;
|
|
table.render(option);
|
PD_HBatchNo();
|
break;
|
} else {
|
MaterNum++;
|
if (MaterNum == option.data.length) {
|
layer.msg("物料代码不匹配,请确认条码配件物料是否与绑定物料一致!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
}
|
|
}
|
|
|
$('#HBardCodeMater').val("");
|
}
|
else {
|
layer.close(index);
|
layer.msg(data1.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
$("#HBarCodeSN").val("");
|
},
|
error: function (err) {
|
layer.close(index);
|
layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
});
|
}
|
|
//判断批次是否匹配完
|
function PD_HBatchNo() {
|
for (var i = 0; i < option.data.length; i++) {
|
if (parseFloat(option.data[i]["配件数量"]) != 0 && option.data[i]["配件数量"] != null) {
|
KNum += 1;
|
}
|
if (KNum == option.data.length) {
|
layer.msg("批次已全部匹配!");
|
if (setIntervalIndex != null) {
|
clearInterval(setIntervalIndex);
|
setIntervalIndex = null;
|
}
|
setIntervalIndex = setInterval(setIntervalList, 30000);
|
|
get_AddBomTempList();
|
}
|
}
|
KNum = 0;
|
}
|
|
//保存配件到产线组装单临时表
|
function get_AddBomTempList() {
|
var HInterID = $("#HInterID").val();
|
var HBillNo = $("#HBillNo").val();
|
var sSubStr = JSON.stringify(table.cache["mainTable2"]);
|
var sMainSub = sSubStr + ';' + HInterID + ';' + HBillNo + ";" + sessionStorage["HUserName"] + ";" + "3791" + ";" + sessionStorage["OrganizationID"];
|
var index = layer.load();
|
$.ajax({
|
type: "POST",
|
url: GetWEBURL() + "/Cj_SingleStation/AddBomTempList",
|
async: false,
|
data: { "sMainSub": sMainSub },
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1) {
|
layer.close(index);
|
}
|
else {
|
layer.close(index);
|
layer.msg(data.Message);
|
}
|
},
|
error: function (err) {
|
layer.close(index);
|
layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
});
|
}
|
|
//质检员选择页面
|
function btnHEmp() {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: '质检员列表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html', 'yes']
|
, btn: ['确定', '取消']
|
, btn1: function (index, layero) {//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
//获取数据
|
$("#HEmpID").val(checkStatus.data[0].HItemID);
|
$("#HEmpName").val(checkStatus.data[0].职员名称);
|
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
})
|
}
|
|
//操作员选择页面
|
function btnHEmp2() {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: '质检员列表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html', 'yes']
|
, btn: ['确定', '取消']
|
, btn1: function (index, layero) {//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
//获取数据
|
$("#HEmpID2").val(checkStatus.data[0].HItemID);
|
$("#HEmpName2").val(checkStatus.data[0].职员名称);
|
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
})
|
}
|
|
//生产资源选择页面
|
function btnHSource() {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: '生产资源列表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../基础资料/生产基础资料/Gy_Source.html', 'yes']
|
, btn: ['确定', '取消']
|
, btn1: function (index, layero) {//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
//获取数据
|
$("#HSourceID").val(checkStatus.data[0].HItemID);
|
$("#HSourceName").val(checkStatus.data[0].生产资源名称);
|
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
}
|
|
//生产班组选择页面
|
function btnHGroup() {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: '班组表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../基础资料/工资基础资料/Gy_Group.html', 'yes']
|
, btn: ['确定', '取消']
|
, btn1: function (index, layero) {//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length != 1) {
|
return layer.msg('请选择一条数据');
|
}
|
//获取数据
|
$("#HGroupID").val(checkStatus.data[0].HItemID);//班组id
|
$("#HGroupName").val(checkStatus.data[0].班组名称);//计量单位名称
|
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
}
|
|
//生产车间选择页面
|
function btnHDept() {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: '生产车间列表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../基础资料/公用基础资料/Gy_DepartmentList.html', 'yes']
|
, btn: ['确定', '取消']
|
, btn1: function (index, layero) {//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length != 1) {
|
return layer.msg('请选择一条数据');
|
}
|
//获取数据
|
$("#HDeptID").val(checkStatus.data[0].HItemID);//
|
$("#HDeptName").val(checkStatus.data[0].部门名称);//
|
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
}
|
|
//工序选择页面
|
function btnHProc() {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: '工序列表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../基础资料/生产基础资料/Gy_Process.html', 'yes']
|
, btn: ['确定', '取消']
|
, btn1: function (index, layero) {//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length != 1) {
|
return layer.msg('请选择一条数据');
|
}
|
//获取数据
|
$("#HProcID").val(checkStatus.data[0].HItemID);//
|
$("#HProcName").val(checkStatus.data[0].工序名称);//
|
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
}
|
|
//不良汇报
|
function BadReport() {
|
var len = option3.data.length;
|
|
if (len != 0) {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['100%', '100%']//大小
|
, title: '工序不良汇报'//标题
|
, shift: 2//弹出动画
|
, content: ['../../车间管理/单品过站/Cj_CollectionOfSingleProductDefects.html?OperationType=1&linterid=' + $("#HInterID").val() + '&HProcExchBillNo=' + $("#HProcExchBillNo").val(), 'yes']
|
, end: function () {
|
get_BadRecords();
|
}
|
})
|
}
|
else {
|
layer.msg("请先保存一次合格条码!")
|
}
|
}
|
|
//微瑕品记录
|
function BadReport_SubtleFlaw() {
|
var len = option3.data.length;
|
|
if (len != 0) {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['100%', '100%']//大小
|
, title: '微瑕品记录'//标题
|
, shift: 2//弹出动画
|
, content: ['../../车间管理/单品过站/Cj_CollectionOfSingleProductDefects.html?OperationType=1&linterid=' + $("#HInterID").val() + '&HProcExchBillNo=' + $("#HProcExchBillNo").val() + '&HBillSubType=3717-1', 'yes']
|
, end: function () {
|
get_BadRecords();
|
}
|
})
|
}
|
else {
|
layer.msg("请先保存一次合格条码!")
|
}
|
}
|
|
|
//保存产线组装主子表 工序出站单主子表
|
function set_AddAssemblyBill() {
|
var data = { "field": { "HInterID": $("#HInterID").val(), "HBillNo": $("#HBillNo").val(), "HProcID": $("#HProcID").val(), "HMaterID": $("#HMaterID").val(), "HGroupID": $("#HGroupID").val(), "HSourceID": $("#HSourceID").val(), "HICMOInterID": $("#HICMOInterID").val(), "HICMOEntryID": $("#HICMOEntryID").val(), "HICMOBillNo": $("#HICMOBillNo").val(), "HBarCode_P": $("#HBarCode_P").val(), "HProdOrgID": sessionStorage["OrganizationID"], "HEmpID2": $("#HEmpID2").val(), "HEmpID": $("#HEmpID").val(), "HProcExchBillNo": $("#HProcExchBillNo").val(), "HProcExchInterID": $("#HProcExchInterID").val(), "HProcExchEntryID": $("#HProcExchEntryID").val(), "HPieceQty": $("#HPieceQty").val(), "HICMOQty": $("#HICMOQty").val(), "HDeptID": $("#HDeptID").val(), "HProcNo": $("#HProcNo").val()} };
|
|
if ($("#HSourceID").val() == "0") {
|
layer.msg("生产资源不能为空!");
|
return false;
|
}
|
|
var sMainStr = JSON.stringify(data.field);
|
var sSubStr = JSON.stringify(table.cache["mainTable2"]);
|
var sMainSub = sMainStr + ';' + sSubStr + ";" + sessionStorage["HUserName"] ;
|
|
var index = layer.load();
|
$.ajax({
|
type: "POST",
|
url: GetWEBURL() + "/Cj_SingleStation/AddAssemblyBillList",
|
async: false,
|
data: { "sMainSub": sMainSub },
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1) {
|
//$('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);
|
layer.close(index);
|
layer.msg("提交成功");
|
//光标跳转到SN条码文本框上
|
$("#HBarCodeSN").focus();
|
//保存到临时表
|
get_AddBomTempList();
|
var HBardCodeProcExchBillNo = $("#HBardCodeProcExchBillNo").val();
|
get_BomList(HBardCodeProcExchBillNo);
|
//查询合格记录
|
get_HGRecords();
|
//查询不良记录
|
get_BadRecords();
|
}
|
else {
|
layer.close(index);
|
layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
},
|
error: function (err) {
|
layer.close(index);
|
layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
});
|
}
|
|
//非空验证
|
function AllowLoadData() {
|
|
var HBarCode = $("#HBarCode_P").val();
|
if (HBarCode == "") {
|
layer.msg("产品SN不能为空!")
|
return false;
|
}
|
|
var HEmpID2 = $("#HEmpID2").val();
|
if (HEmpID2 == 0) {
|
layer.msg("操作员不能为空!")
|
return false;
|
}
|
|
//var HBadReasonID = $("#HBadReasonID").val();
|
//if (HBadReasonID == 0) {
|
// layer.msg("不良原因不能为空!")
|
// return false;
|
//}
|
return true;
|
}
|
|
//#endregion
|
|
});
|
</script>
|