<!DOCTYPE html>
|
<html>
|
<head>
|
<meta 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.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
<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/PubCustom.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>
|
<style>
|
.main-btn { /*头部主按钮*/
|
padding: 0 2px; /*调整按钮左右空隙大小*/
|
height: 30px;
|
line-height: 30px;
|
}
|
|
.btn-title {
|
font-size: 16px;
|
}
|
/*.table-select {
|
margin-top: -10px;
|
margin-left: -15px;
|
margin-right: -15px;
|
}*/
|
/* 防止下拉框的下拉列表被隐藏---必须设置--- */
|
.layui-table-cell {
|
overflow: visible !important;
|
}
|
/* 使得下拉框与单元格刚好合适 */
|
td .layui-form-select {
|
margin-top: -10px;
|
margin-left: -15px;
|
margin-right: -15px;
|
}
|
</style>
|
</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 layuiadmin-btn-order main-btn" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
|
<i class="layui-icon layui-icon-print layuiadmin-button-btn"><span class="btn-title">预览</span></i>
|
</button>-->
|
<!--<button class="layui-btn layuiadmin-btn-order main-btn" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
|
<i class="layui-icon layui-icon-edit layuiadmin-button-btn"><span class="btn-title">修改</span></i>
|
</button>-->
|
<button type="button" class="layui-btn layui-btn-sm" lay-submit="" lay-filter="btn-AddNew" id="btn-AddNew">新增</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-submit="" lay-filter="btnSave" id="btnSave">保存</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-submit="" lay-filter="btn-Exit" id="btn-Exit">退出</button>
|
</div>
|
<div class="layui-tab" lay-filter="tab-POStockInBill">
|
<ul class="layui-tab-title" lay-filter="tab-all">
|
<li lay-id="1" style="padding:1px;" class="layui-this">基本信息</li>
|
<li lay-id="2" style="padding:1px;">制单信息</li>
|
</ul>
|
<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="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly>
|
<input type="hidden" name="HInterID" id="HInterID">
|
</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="date" class="layui-input" name="HDate" id="HDate" style="padding-left: 32px;">
|
</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" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchSource" id="btnSearchSource" style="padding: 0 10px;float: left;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
<input type="hidden" name="HSourceID" id="HSourceID" value="0">
|
</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="HICMOBillNo" id="HICMOBillNo" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchICMOBill" id="btnSearchICMOBill" style="padding: 0 10px;float: left;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="HICMOQty" id="HICMOQty" style="background-color:#efefef4d;" readonly>
|
</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="HICMOInterID" id="HICMOInterID" value="0" style="background-color:#efefef4d;" readonly>
|
<input type="hidden" name="HICMOEntryID" id="HICMOEntryID" value="0">
|
</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="HMaterID" id="HMaterID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchMater" id="btnSearchMater" style="padding: 0 10px;float: left;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="HProcExchQty" id="HProcExchQty" 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" name="HProcExchBillNo" id="HProcExchBillNo" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchProcExch" id="btnSearchProcExch" style="padding: 0 10px;float: left;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;">流转卡ID</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HProcExchInterID" id="HProcExchInterID" value="0" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">流转卡子ID</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HProcExchEntryID" id="HProcExchEntryID" value="0" 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" name="HFirstCheckEmpName" id="HFirstCheckEmpName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHFirstCheckEmp" id="btnSearchHFirstCheckEmp" style="padding: 0 10px;float: left;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
<input type="hidden" name="HFirstCheckEmp" id="HFirstCheckEmp" value="0">
|
</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="HQCCheckProjectName" id="HQCCheckProjectName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchCheckProject" id="btnSearchCheckProject" style="padding: 0 10px;float: left;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
<input type="hidden" name="HQCCheckProjectID" id="HQCCheckProjectID" value="0">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline" style="width: 50%;">
|
<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="HRemark" id="HRemark" placeholder="请输入内容" onmouseover="this.title=this.value">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label">判断结论</label>
|
<div class="layui-input-block">
|
<input type="radio" name="HLastResult" id="HLastResult" value="true" title="合格" checked>
|
<input type="radio" name="HLastResult" id="HLastResult" value="false" title="不合格">
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<!--制单信息-->
|
<div class="layui-tab-item">
|
<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" name="HMaker" id="HMaker" style="background-color:#efefef4d;" readonly>
|
</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="HChecker" id="HChecker" style="background-color:#efefef4d;" readonly>
|
</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="HCloseMan" id="HCloseMan" 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="HMakeDate" id="HMakeDate" style="background-color:#efefef4d;" readonly>
|
</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="HCheckDate" id="HCheckDate" style="background-color:#efefef4d;" readonly>
|
</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="HCloseDate" id="HCloseDate" 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="HUpDater" id="HUpDater" style="background-color:#efefef4d;" readonly>
|
</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="HDeleteMan" id="HDeleteMan" 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="HUpDateDate" id="HUpDateDate" style="background-color:#efefef4d;" readonly>
|
</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="HDeleteDate" id="HDeleteDate" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
|
<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>
|
<!--隐藏字段-->
|
<input type="hidden" name="HMainSourceBillType" id="HMainSourceBillType">
|
<input type="hidden" name="HMainSourceInterID" id="HMainSourceInterID" value="0">
|
<input type="hidden" name="HMainSourceEntryID" id="HMainSourceEntryID" value="1">
|
<input type="hidden" name="HMainSourceBillNo" id="HMainSourceBillNo">
|
</form>
|
</div>
|
</div>
|
</div>
|
<!--行按钮-->
|
<script type="text/html" id="barDemo">
|
<!--<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
|
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
</script>
|
<!--行下拉选择(结论)-->
|
<script type="text/html" id="HResult">
|
<select name="HResult" lay-filter="HResult" id="HResult{{d.LAY_TABLE_INDEX+1}}">
|
<option value="">请选择</option>
|
<option value="合格">合格</option>
|
<option value="不合格">不合格</option>
|
</select>
|
</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
|
, laydate = layui.laydate
|
, element = layui.element;
|
//公用变量
|
var rowdata = [];
|
var option = [];
|
|
//判断是否登录 未登录则跳到登录页
|
//if (sessionStorage.login != "login") {
|
// layer.confirm("登录失效,请重新登录!", {
|
// icon: 4, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['重新登录']
|
// }, function () { window.location.href = "../../user/login.html"; });
|
//}
|
|
var params = get_UrlVars();
|
if (typeof (params[params[0]]) == "undefined") {
|
var OperationType = 1;//操作类型
|
} else {
|
var OperationType = params[params[0]];//操作类型
|
var linterid = params[params[1]];//源单id
|
var HSouceBillType = params[params[2]];//源单类型
|
var HICMOEntryID = params[params[3]];//源单子id
|
}
|
/*固定代码,每张单据都要begin*/
|
//////测试用数据
|
//var OperationType = 2;
|
//var linterid = 11880;
|
//var HSouceBillType = 3722;
|
//var HICMOEntryID = 100027;
|
//判断是否新增
|
if (OperationType == 1) {
|
$("#HInterID").val("");
|
$("#HBillNo").val("");
|
$('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);//有源单时保存按钮禁用
|
//获取最大单据号
|
$.ajax({
|
url: GetWEBURL() + "/Web/GetMAXNum",
|
type: "GET",
|
data: { "HBillType": '7505' },
|
success: function (d) {
|
//console.log(d.data);
|
$("#HInterID").val(d.data[0].HInterID);
|
$("#HBillNo").val(d.data[0].HBillNo);
|
$("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd"));
|
$("#HMaker").val(sessionStorage["HUserName"]);
|
}
|
});
|
}
|
else if (OperationType == 2) {
|
$("#HInterID").val("");
|
$("#HBillNo").val("");
|
$('#btn-AddNew').addClass("layui-btn-disabled").attr("disabled", true);//有源单时新增按钮禁用
|
$('#btnSearchSource').addClass("layui-btn-disabled").attr("disabled", true);//有源单时生产资源按钮禁用
|
$('#btnSearchICMOBill').addClass("layui-btn-disabled").attr("disabled", true);//有源单时任务单号按钮禁用
|
$('#btnSearchMater').addClass("layui-btn-disabled").attr("disabled", true);//有源单时产品内码按钮禁用
|
$('#btnSearchProcExch').addClass("layui-btn-disabled").attr("disabled", true);//有源单时流转卡号按钮禁用
|
//获取最大单据号
|
$.ajax({
|
url: GetWEBURL() + "/Web/GetMAXNum",
|
type: "GET",
|
data: { "HBillType": '7505' },
|
success: function (d) {
|
//console.log(d.data);
|
$("#HInterID").val(d.data[0].HInterID);
|
$("#HBillNo").val(d.data[0].HBillNo);
|
$("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
|
$("#HMaker").val(sessionStorage["HUserName"]);
|
}
|
});
|
//报工平台首检
|
if (HSouceBillType == 3722) {
|
//根据源单id获取源单信息
|
LoadingInformation2();
|
}
|
//工序进站接收单列表首检
|
else if (HSouceBillType == 3790) {
|
//根据源单id获取源单信息
|
LoadingInformation();
|
}
|
//工序委外接收单列表首检
|
else if (HSouceBillType == 3793) {
|
//根据源单id获取源单信息
|
LoadingInformation3();
|
}
|
else {
|
layer.alert("源单类型无效!", { icon: 5 });
|
}
|
}
|
else if (OperationType == 3) {
|
RoadBillMain(linterid);
|
//RoadBillSub(linterid);
|
}
|
//初始化表格
|
set_InitGrid();
|
|
//根据源单id获取源单信息
|
function LoadingInformation() {
|
var wait = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Cj_StationInBill/get_Display',
|
type: "GET",
|
data: { "sWhere": "and HInterID = " + linterid },
|
success: function (result) {
|
var data = result.data[0];
|
if (result.count == 1) {
|
$("#HProcExchBillNo").val(data.工序流转卡号);
|
$("#HProcExchInterID").val(data.HProcExchInterID);
|
$("#HProcExchEntryID").val(data.HProcExchEntryID);
|
$("#HProcExchQty").val(data.流转卡数量);
|
$("#HICMOBillNo").val(data.任务单);
|
$("#HICMOInterID").val(data.HICMOInterID);
|
$("#HICMOQty").val(data.HICMOQty);
|
$("#HSourceName").val(data.生产资源);
|
$("#HSourceID").val(data.HSourceID);
|
$("#HMaterID").val(data.HMaterID);
|
$("#HMainSourceBillNo").val(data.单据号);
|
$("#HMainSourceBillType").val(data.HBillType);
|
$("#HMainSourceInterID").val(data.HInterID);
|
$("#HICMOEntryID").val(data.HICMOEntryID);
|
} else {
|
layer.alert(result.Message, { icon: 5 });
|
}
|
layer.close(wait);
|
}, error: function () {
|
layer.close(wait);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
|
//根据源单id获取源单信息
|
function LoadingInformation2() {
|
var wait = layer.load();
|
$.ajax({
|
url: GetWEBURL() + "/QC_FirstPieceCheckBill/get_ICMOBillStatus_Tmp",
|
type: "GET",
|
data: { "HInterID": linterid, "HEntryID": HICMOEntryID, "HBillType": HSouceBillType },
|
success: function (result) {
|
var data = result.data[0];
|
if (result.count == 1) {
|
$("#HProcExchBillNo").val(data.HProcExchBillNo);
|
$("#HProcExchInterID").val(data.HProcExchInterID);
|
$("#HProcExchEntryID").val(data.HProcExchEntryID);
|
$("#HProcExchQty").val(data.HProcExchQty);
|
$("#HICMOBillNo").val(data.HICMOBillNo);
|
$("#HICMOInterID").val(data.HICMOInterID);
|
$("#HICMOQty").val(data.HICMOQty);
|
$("#HSourceName").val(data.HSourceName);
|
$("#HSourceID").val(data.HSourceID);
|
$("#HMaterID").val(data.HMaterID);
|
$("#HMainSourceBillNo").val("");
|
$("#HMainSourceBillType").val(data.HBillType);
|
$("#HMainSourceInterID").val(data.HInterID);
|
$("#HICMOEntryID").val(data.HICMOEntryID);
|
} else {
|
layer.alert(result.Message, { icon: 5 });
|
}
|
layer.close(wait);
|
}, error: function () {
|
layer.close(wait);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
|
//根据源单id获取源单信息
|
function LoadingInformation3() {
|
var wait = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Cj_StationEntrustOutBill/list',
|
type: "GET",
|
data: { "sWhere": "and HInterID = " + linterid },
|
success: function (result) {
|
var data = result.data[0];
|
if (result.count == 1) {
|
$("#HProcExchBillNo").val(data.流转卡号);
|
$("#HProcExchInterID").val(data.HProcExchInterID);
|
$("#HProcExchEntryID").val(data.HProcExchEntryID);
|
$("#HProcExchQty").val(data.流转卡数量);
|
$("#HICMOBillNo").val(data.生产订单号);
|
$("#HICMOInterID").val(data.HICMOInterID);
|
$("#HICMOQty").val(data.HICMOQty);
|
$("#HSourceName").val(data.生产资源);
|
$("#HSourceID").val(data.HSourceID);
|
$("#HMaterID").val(data.HMaterID);
|
$("#HMainSourceBillNo").val(data.单据号);
|
$("#HMainSourceBillType").val(data.HBillType);
|
$("#HMainSourceInterID").val(data.HInterID);
|
$("#HICMOEntryID").val(data.HICMOEntryID);
|
} else {
|
layer.alert(result.Message, { icon: 5 });
|
}
|
layer.close(wait);
|
}, error: function () {
|
layer.close(wait);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
|
//头工具栏事件
|
table.on('toolbar(mainTable)', function (obj) {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
//新增行表格数据
|
var NewRow = {
|
"HQCCheckItemID": "", "检验项目": "", "HQCStd": "", "HUnit": "", "HQCNote": "", "HResult": "",
|
"HMax": "", "HMin": "", "HAvg": "", "HRemark": ""
|
};
|
switch (obj.event) {
|
case 'btn-AddLine':
|
table.cache["mainTable"].push(NewRow);
|
option.data = table.cache["mainTable"];
|
table.render(option);
|
for (var i = 1; i <= option.data.length; i++) {
|
$('#HResult' + i + '').find("option[value='" + option.data[i - 1].HResult + "']").attr("selected", true);
|
}
|
form.render('select');
|
break;
|
case 'btn-CopyLine':
|
var copydata = JSON.stringify(data);
|
if (data.length <= 0) {
|
layer.msg("请选择需要复制的一行!");
|
}
|
else if (data.length > 1) {
|
layer.msg("只能选择复制一行!");
|
}
|
else {
|
var copydata2 = copydata.substring(1, copydata.length);//去除首行字符'['
|
var copyrow = copydata2.substring(0, copydata2.length - 1);//去除末尾字符']'
|
table.cache["mainTable"].push(JSON.parse(copyrow));//将复制的行强转成json追加到表格上
|
option.data = table.cache["mainTable"];//将数据绑定到data上
|
table.render(option);//将数据渲染到表格上
|
for (var i = 1; i <= option.data.length; i++) {
|
$('#HResult' + i + '').find("option[value='" + option.data[i - 1].HResult + "']").attr("selected", true);
|
}
|
form.render('select');
|
}
|
break;
|
}
|
});
|
|
//退出按钮
|
form.on('submit(btn-Exit)', function (data) {
|
get_Exit();
|
});
|
|
//新增按钮
|
form.on('submit(btn-AddNew)', function (data) {
|
window.location.reload();
|
});
|
|
|
//退出
|
function get_Exit() {
|
if (OperationType == 1) {
|
parent.layui.admin.events.closeThisTabs();
|
} else if (OperationType == 2) {
|
var index = parent.layer.getFrameIndex(window.name);
|
parent.layer.close(index);
|
} else if (OperationType == 3) {
|
var index = parent.layer.getFrameIndex(window.name);
|
parent.layer.close(index);
|
}
|
}
|
|
//行内事件
|
table.on('tool(mainTable)', function (obj) {
|
var data = obj.data;
|
var rowIndex = $(obj.tr).attr("data-index");
|
if (obj.event === 'del') {
|
layer.confirm('真的删除行吗?', function (index) {
|
console.log("索引为:" + rowIndex);
|
if (rowIndex === '0') {
|
layer.msg('首行无法删除!!!');
|
} else {
|
obj.del();
|
option.data = table.cache["mainTable"];//将数据绑定到data上
|
table.reload(option);
|
layer.close(index);
|
}
|
});
|
}
|
|
var data = obj.data;
|
var rowIndex = $(obj.tr).attr("data-index");
|
if (obj.event === 'del') {
|
layer.confirm('真的删除行么', function (index) {
|
console.log("索引为:" + rowIndex);
|
if (rowIndex === '0') {
|
layer.msg('首行无法删除!!!');
|
} else {
|
//obj.del();
|
//layer.close(index);
|
var oldData = table.cache["mainTable"];
|
oldData.splice(obj.tr.data('index'), 1);
|
table.reload('mainTable', { data: oldData });
|
layer.close(index);
|
}
|
});
|
}
|
|
|
$(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
|
if (event.key == "F7") {
|
if (obj.event == 'HQCCheckItemID') //模具信息
|
{
|
//页面层-自定义
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '检验项目列表',
|
closeBtn: 1,
|
shift: 2,
|
area: ['90%', '90%'],
|
maxmin: true,
|
content: ['../../../views/Baseset/基础资料/Gy_QCCheckItemListView.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('请选择数据');
|
}
|
|
//同步更新表格和缓存对应的值
|
obj.update({
|
检验项目: checkStatus.data[0].名称
|
, HQCCheckItemID: checkStatus.data[0].HItemID
|
});
|
layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) {
|
//按钮【按钮二】的回调
|
//return false 开启该代码可禁止点击该按钮关闭
|
},
|
end: function () {
|
|
}
|
});
|
}
|
|
obj.event = "";
|
return false;
|
|
}
|
})
|
});
|
|
//保存按钮
|
form.on('submit(btnSave)', function (data) {
|
set_SaveBill(data);
|
});
|
|
//保存
|
function set_SaveBill(data) {
|
if ($("#HICMOQty").val() == "" || $("#HICMOQty").val() <= 0) {
|
layer.msg("任务单数量不能为空且不能小于等于0!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return;
|
}
|
if ($("#HProcExchQty").val() == "" || $("#HProcExchQty").val() <= 0) {
|
layer.msg("流转卡数量不能为空且不能小于等于0!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return;
|
}
|
if ($("#HFirstCheckEmp").val() == 0) {
|
layer.msg("检验员未选择!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return;
|
}
|
var sSubTable = table.cache['mainTable'];
|
for (var i = 0; i < sSubTable.length; i++) {
|
if (!sSubTable[i].HQCCheckItemID) {
|
var indexRow = i + 1;
|
layer.msg("第" + indexRow + "行,检验项目不能为空!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return;
|
}
|
}
|
var sMainStr = JSON.stringify(data.field);
|
var sSubStr = JSON.stringify(table.cache['mainTable']);
|
var sMainSub = sMainStr + ';' + sSubStr + ';' + OperationType + ";" + sessionStorage["HUserName"] ;
|
var index = layer.load();
|
$.ajax({
|
type: "POST",
|
url: GetWEBURL() + "/QC_FirstPieceCheckBill/set_SaveBill",
|
async: true,
|
data: { "sMainSub": sMainSub },
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1) {
|
//layer.confirm(data.Message, {
|
// icon: 1, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['新增'],
|
// btn2: function () {
|
// //parent.layui.admin.events.closeThisTabs();关闭页签
|
// //window.close();//关闭页面,浏览器有效,PDA无效
|
// parent.location.href = "../../../views/index.html"
|
// }//关闭
|
//}, function () { window.location.reload(); });//新增
|
layer.close(index);
|
layer.msg("提交成功");
|
$('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);//保存按钮
|
}
|
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 RoadBillMain(linterid) {
|
$.ajax({
|
url: GetWEBURL() + "/Web/GetPonderationBill",
|
type: "GET",
|
data: { "HInterID": linterid },
|
success: function (d) {
|
// console.log(d.data);
|
$("#HInterID").val(d.data[0].HInterID);
|
$("#HBillNo").val(d.data[0].HBillNo);
|
}
|
})
|
}
|
|
//表头信息检验方案弹窗
|
form.on('submit(btnSearchCheckProject)', function () {
|
//页面层-自定义
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '检验方案列表',
|
closeBtn: 1,
|
shift: 2,
|
area: ['90%', '90%'],
|
maxmin: true,
|
content: ['../../../views/Baseset/基础资料/Gy_QCCheckProjectListView.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('请选择数据');
|
}
|
$("#HQCCheckProjectID").val(checkStatus.data[0].HItemID);
|
$("#HQCCheckProjectName").val(checkStatus.data[0].方案名称);
|
get_CheckItem();
|
layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) {
|
//按钮【按钮二】的回调
|
//return false 开启该代码可禁止点击该按钮关闭
|
},
|
end: function () {
|
|
},
|
success: function (layero, index) {
|
|
}
|
});
|
});
|
|
function get_CheckItem() {
|
$.ajax({
|
url: GetWEBURL() + "/Web/GetCheckItemByCheckProjectID",
|
type: "GET",
|
data: { "CheckProjectID": $("#HQCCheckProjectID").val() },
|
success: function (result) {
|
option.data = result.data;
|
table.render(option);
|
}
|
})
|
}
|
|
//表头信息工序流转卡弹窗
|
form.on('submit(btnSearchProcExch)', function () {
|
//页面层-自定义
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '工序流转卡列表',
|
closeBtn: 1,
|
shift: 2,
|
area: ['90%', '90%'],
|
maxmin: true,
|
content: ['../../../views/Baseset/基础资料/Sc_ProcessExchangeBillListView.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('请选择数据');
|
}
|
$("#HProcExchInterID").val(checkStatus.data[0].hmainid);
|
$("#HProcExchEntryID").val(checkStatus.data[0].hsubid);
|
$("#HProcExchBillNo").val(checkStatus.data[0].单据号);
|
layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) {
|
//按钮【按钮二】的回调
|
//return false 开启该代码可禁止点击该按钮关闭
|
},
|
end: function () {
|
|
},
|
success: function (layero, index) {
|
|
}
|
});
|
});
|
|
//表头信息生产任务单弹窗
|
form.on('submit(btnSearchICMOBill)', function () {
|
//页面层-自定义
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '生产任务单列表',
|
closeBtn: 1,
|
shift: 2,
|
area: ['90%', '90%'],
|
maxmin: true,
|
content: ['../../../views/Baseset/基础资料/Sc_ICMOBillListView2.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('请选择数据');
|
}
|
$("#HICMOInterID").val(checkStatus.data[0].hmainid);
|
$("#HICMOEntryID").val(checkStatus.data[0].hsubid);
|
$("#HICMOBillNo").val(checkStatus.data[0].单据号);
|
$("#HICMOQty").val(checkStatus.data[0].计划生产数量);
|
layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) {
|
//按钮【按钮二】的回调
|
//return false 开启该代码可禁止点击该按钮关闭
|
},
|
end: function () {
|
|
},
|
success: function (layero, index) {
|
|
}
|
});
|
});
|
|
//表头信息选择检验员弹窗
|
form.on('submit(btnSearchHFirstCheckEmp)', function () {
|
//页面层-自定义
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '检验员列表',
|
closeBtn: 1,
|
shift: 2,
|
area: ['90%', '90%'],
|
maxmin: true,
|
content: ['../../PublicPage/UserInformation.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('请选择数据');
|
}
|
$("#HFirstCheckEmpName").val(checkStatus.data[0].HName);
|
$("#HFirstCheckEmp").val(checkStatus.data[0].HItemID);
|
layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) {
|
//按钮【按钮二】的回调
|
//return false 开启该代码可禁止点击该按钮关闭
|
},
|
end: function () {
|
|
},
|
success: function (layero, index) {
|
|
}
|
});
|
});
|
|
//表头信息生产资源弹窗
|
form.on('submit(btnSearchSource)', function () {
|
//页面层-自定义
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '资源列表',
|
closeBtn: 1,
|
shift: 2,
|
area: ['90%', '90%'],
|
maxmin: true,
|
content: ['../../PublicPage/SourceInformation.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('请选择数据');
|
}
|
$("#HSourceName").val(checkStatus.data[0].HName);
|
$("#HSourceID").val(checkStatus.data[0].HItemID);
|
layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) {
|
//按钮【按钮二】的回调
|
//return false 开启该代码可禁止点击该按钮关闭
|
},
|
end: function () {
|
|
},
|
success: function (layero, index) {
|
|
}
|
});
|
});
|
|
//表头信息产品弹窗
|
form.on('submit(btnSearchMater)', function () {
|
//页面层-自定义
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '产品列表',
|
closeBtn: 1,
|
shift: 2,
|
area: ['90%', '90%'],
|
maxmin: true,
|
content: ['../../Baseset/基础资料/Gy_MaterialList.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('请选择数据');
|
}
|
$("#HMaterNumber").val(checkStatus.data[0].HNumber);
|
$("#HMaterID").val(checkStatus.data[0].HItemID);
|
layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) {
|
//按钮【按钮二】的回调
|
//return false 开启该代码可禁止点击该按钮关闭
|
},
|
end: function () {
|
|
},
|
success: function (layero, index) {
|
|
}
|
});
|
});
|
|
|
form.on('submit(Cancel)', function () {
|
//sessionStorage["SourceFlag"] = false;
|
parent.location.href = "../../../views/index.html"
|
//window.close();//关闭当前页
|
})
|
|
//初始化表格
|
function set_InitGrid() {
|
$("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
|
$("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd"));
|
//初始表格数据
|
rowdata = [{
|
"HQCCheckItemID": "", "检验项目": "", "HQCStd": "", "HUnit": "", "HQCNote": "", "HResult": "",
|
"HMax": "", "HMin": "", "HAvg": "", "HRemark": ""
|
}];
|
option = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, limit: 500 //每页默认显示的数量
|
, height: 'full-50'
|
, cellMinWidth: 150
|
, cols: [[ //表头
|
{ type: 'checkbox', totalRowText: '合计行' }
|
, { field: 'HQCCheckItemID', title: 'HQCCheckItemID', hide: true }
|
, { field: '检验项目', title: '检验项目', edit: 'text', event: 'HQCCheckItemID' }
|
, { field: 'HQCStd', title: '检验标准', edit: 'text' }
|
, { field: 'HUnit', title: '单位', edit: 'text' }
|
, { field: 'HQCNote', title: '检验记录', edit: 'text' }
|
, { field: 'HResult', title: '结论', templet: '#HResult' }
|
, { field: 'HMax', title: '最大值', edit: 'text' }
|
, { field: 'HMin', title: '最小值', edit: 'text' }
|
, { field: 'HAvg', title: '平均值', edit: 'text', totalRow: true }
|
, { field: 'HRemark', title: '备注', edit: 'text' }
|
, { fixed: 'right', title: '操作', toolbar: '#barDemo' }
|
]]
|
, done: function (res, curr, count) {
|
option.data = res.data;
|
//去掉下拉框失焦事件否则在下拉框里输入值
|
$('.layui-form-select').find('input').unbind("blur");
|
//表格重载回显下拉框里的数据
|
$('tr').each(function (e) {
|
var $cr = $(this);
|
var dataIndex = $cr.attr("data-index");
|
$.each(option.data, function (index, value) {
|
if (value.LAY_TNDEX == dataIndex) {
|
$cr.find('input').val(value.HResult);
|
}
|
});
|
});
|
}
|
, text: {
|
none: '无数据!'
|
}
|
};
|
//加载空表格
|
option.data = rowdata;
|
table.render(option);
|
}
|
|
//行选择处理(结论)
|
form.on('select(HResult)', function (data) {
|
//获取下拉框选中的值
|
var elem = data.othis.parents('tr');
|
var dataindex = elem.attr("data-index");
|
$.each(option.data, function (index, value) {
|
if (value.LAY_TABLE_INDEX == dataindex) {
|
value.HResult = data.value;//把选中下拉框id值赋值给表格缓存
|
}
|
});
|
});
|
//以上为layui模块
|
});
|
|
|
//定义全局变量HMainMaterID
|
var subProcName, subProcNumber, subProcID,
|
subWorkCenterName, subWorkCenterNumber, subWorkCenterID,
|
subSupName, subSupNumber, subSupID,
|
HReasonName, ReasonID, EmpName,
|
ZRProcName, QRName;
|
|
|
|
</script>
|
</body>
|
</html>
|