<!DOCTYPE html>
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<title class="sckgd">生产停工单</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">
|
<!--引用layui样式文件-->
|
<link rel="stylesheet" href="../../../../layuiadmin/layui/css/layui.css" media="all">
|
<link rel="stylesheet" href="../../../../layuiadmin/style/admin.css" media="all">
|
<!--引用layui js文件-->
|
<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="../../../../layuiadmin/zgqCustom/zgqCustom.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;
|
width: 60px;
|
line-height: 30px;
|
}
|
|
th {
|
width: 70px;
|
text-align: center;
|
}
|
</style>
|
</head>
|
|
<body>
|
<div class="layui-fluid" style="padding: 0;">
|
<div class="layui-card">
|
<div class="layui-card-body" style="padding: 1px;">
|
<form class="layui-form" action="" lay-filter="formData" id="formData" style="background-color:white;">
|
<div style="background-color:#0085E8;">
|
<span style="color: white;" class="jzd"><i class="layui-icon layui-icon-form"></i>生产停工单</span>
|
</div>
|
<div class="layui-form-item" style="margin: 1% 2%;text-align: right;">
|
<button type="button" lay-submit="" lay-filter="Add" class="layui-btn layui-btn-radius">新增</button>
|
<button type="button" lay-submit="" lay-filter="Saver" id="Saver" class="layui-btn layui-btn-radius">保存</button>
|
<button type="button" lay-submit="" lay-filter="Cancel" class="layui-btn layui-btn-radius layui-btn-danger">退出</button>
|
</div>
|
<div class="layui-form-item">
|
<div class="layui-tab layui-tab-card" lay-filter="TabTest">
|
<div class="layui-tab-content">
|
<div class="layui-tab-item layui-show">
|
<table style="width:80%;">
|
<tbody>
|
<tr>
|
<th>条形码</th>
|
<td class="bz_td">
|
<input type="text" name="HBarCode" class="layui-input" id="HBarCode" placeholder="请输入条形码后回车" style="border-radius: 50px;" disabled>
|
<button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu layui-btn-radius" lay-filter="QueDin" style="line-height: 30px;">确定</button>
|
</td>
|
</tr>
|
<!--<tr>
|
<th>设备</th>
|
<td class="bz_td">
|
<input type="text" name="HEquipName" class="layui-input" id="HEquipName" placeholder="请扫描设备二维码" style="border-radius: 50px;">
|
<input type="hidden" name="HEquipID" id="HEquipID" value="0" autocomplete="off" class="layui-input">
|
</td>
|
</tr>-->
|
<tr>
|
<th>源单单号</th>
|
<td class="bz_td">
|
<input type="text" name="HMainSourceBillNo" id="HMainSourceBillNo" class="layui-input" value="" style="border-radius: 50px;">
|
<input type="hidden" name="HMainSourceInterID" id="HMainSourceInterID" class="layui-input" value="0" style="border-radius: 50px;">
|
<input type="hidden" name="HMainSourceEntryID" id="HMainSourceEntryID" class="layui-input" value="0" style="border-radius: 50px;">
|
<input type="hidden" name="HMainSourceBillType" id="HMainSourceBillType" class="layui-input" value="" style="border-radius: 50px;">
|
</td>
|
</tr>
|
<tr>
|
<th>生产订单</th>
|
<td class="bz_td">
|
<input type="text" name="HICMOBillNo" id="HICMOBillNo" class="layui-input" value="" style="border-radius: 50px;">
|
<input type="hidden" name="HICMOInterID" id="HICMOInterID" class="layui-input" value="0" style="border-radius: 50px;">
|
<input type="hidden" name="HICMOEntryID" id="HICMOEntryID" class="layui-input" value="0" style="border-radius: 50px;">
|
</td>
|
</tr>
|
<tr>
|
<th>生产资源</th>
|
<td class="bz_td">
|
<input type="text" name="HSourceName" class="layui-input" id="HSourceName" placeholder="选择生产资源" style="border-radius: 50px;">
|
<input type="hidden" name="HSourceID" id="HSourceID" value="0" autocomplete="off" class="layui-input">
|
<button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="ProductionResources-BT" id="ProductionResources-BT" style="font-weight:bolder">...</button>
|
</td>
|
</tr>
|
|
<!--<tr>
|
<th>流水号</th>
|
<td class="bz_td">
|
<input type="text" name="HProcNo" class="layui-input" id="HProcNo" placeholder="选择流水号" style="background-color:#efefef4d;border-radius: 50px;">
|
<button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="SerialNum-BT" id="SerialNum-BT" style="font-weight:bolder">...</button>
|
</td>
|
</tr>
|
<tr>
|
<th>当前工序</th>
|
<td class="bz_td">
|
<input type="text" name="HProcName" class="layui-input" id="HProcName" placeholder="当前工序" style="border-radius: 50px;background-color:#efefef4d;" readonly>
|
<input type="hidden" name="HProcID" id="HProcID" value="0" autocomplete="off" class="layui-input">
|
</td>
|
</tr>-->
|
<tr>
|
<th>产品代码</th>
|
<td class="bz_td">
|
<input type="text" name="HMaterNumber" class="layui-input" id="HMaterNumber" placeholder="产品代码" style="border-radius: 50px;background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>产品名称</th>
|
<td class="bz_td">
|
<input type="text" name="HMaterName" class="layui-input" id="HMaterName" placeholder="产品名称" style="border-radius: 50px;background-color:#efefef4d;" readonly>
|
<input type="hidden" name="HMaterID" id="HMaterID" value="0" autocomplete="off" class="layui-input">
|
</td>
|
</tr>
|
<tr>
|
<th>开始时间</th>
|
<td class="bz_td">
|
<input type="text" name="HStopBeginWorkTime" class="layui-input" id="HStopBeginWorkTime" style="border-radius: 50px;" model="datetime" dateFormat="yyyy-MM-dd" placeholder="yyyy-MM-dd">
|
</td>
|
</tr>
|
<tr>
|
<th>结束时间</th>
|
<td class="bz_td">
|
<input type="text" name="HStopEndWorkTime" class="layui-input" id="HStopEndWorkTime" style="border-radius: 50px;" model="datetime" dateFormat="yyyy-MM-dd" placeholder="yyyy-MM-dd">
|
</td>
|
</tr>
|
<tr>
|
<th>停工类型</th>
|
<td class="bz_td">
|
<select name="HStopType" id="HStopType" lay-verify="HStopType" style="border-radius: 50px;">
|
<option value="">请选择停工原因</option>
|
<option value="模具保养">模具保养</option>
|
<option value="断料">断料</option>
|
<option value="人员不足">人员不足</option>
|
<option value="停气">停气</option>
|
<option value="停水">停水</option>
|
<option value="停电">停电</option>
|
<option value="模具故障">模具故障</option>
|
<option value="监控报警">监控报警</option>
|
<option value="自动化故障">自动化故障</option>
|
<option value="注塑机故障">注塑机故障</option>
|
<option value="尺寸异常">尺寸异常</option>
|
<option value="计划停机">计划停机</option>
|
<option value="外观不良调机">外观不良调机</option>
|
<option value="模具清洁">模具清洁</option>
|
<option value="模温机故障">模温机故障</option>
|
<option value="烘料机故障">烘料机故障</option>
|
</select>
|
</td>
|
</tr>
|
<tr>
|
<th>停工原因</th>
|
<td class="bz_td">
|
<input type="text" name="HStopReason" class="layui-input" id="HStopReason" value="" placeholder="" style="border-radius: 50px;">
|
</td>
|
</tr>
|
<tr>
|
<th>生产班组</th>
|
<td class="bz_td">
|
<input type="text" name="HGroupName" class="layui-input" id="HGroupName" placeholder="选择生产班组" style="background-color:#efefef4d;border-radius: 50px;">
|
<input type="hidden" name="HGroupID" id="HGroupID" value="0" autocomplete="off" class="layui-input">
|
<button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="ProductionTeam-BT" id="ProductionTeam-BT" style="font-weight:bolder">...</button>
|
</td>
|
</tr>
|
<tr>
|
<th>操作员</th>
|
<td class="bz_td">
|
<input type="text" name="HEmpName" class="layui-input" id="HEmpName" placeholder="选择接收人" style="background-color:#efefef4d;border-radius: 50px;" readonly>
|
<input type="hidden" name="HEmpID" id="HEmpID" value="0" autocomplete="off" class="layui-input">
|
<button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="HEmployeeID-BT" id="HEmployeeID-BT" style="font-weight:bolder">...</button>
|
</td>
|
</tr>
|
<tr>
|
<th>车间</th>
|
<td class="bz_td">
|
<input type="text" name="HDeptName" class="layui-input set_height" id="HDeptName" placeholder="选择车间" style="border-radius: 50px; background-color: #efefef4d;" readonly>
|
<input type="hidden" name="HDeptID" id="HDeptID" value="0" autocomplete="off" class="layui-input set_height">
|
<button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="btnHDept" id="btnHDept" style="font-weight:bolder;">...</button>
|
</td>
|
</tr>
|
<tr>
|
<th>生产班次</th>
|
<td class="bz_td">
|
<input type="text" name="HWorkShiftName" class="layui-input set_height" id="HWorkShiftName" placeholder="选择班次" style="border-radius: 50px; background-color: #efefef4d;" readonly>
|
<input type="hidden" name="HWorkShiftID" id="HWorkShiftID" value="0" autocomplete="off" class="layui-input set_height">
|
<button type="button" lay-submit="" class="layui-btn layui-col-xs2 bz_btu" lay-filter="btnHWorkShift" id="btnHWorkShift" style="font-weight:bolder;">...</button>
|
</td>
|
</tr>
|
<tr>
|
<th>备注</th>
|
<td class="bz_td">
|
<input type="text" name="HRemark" class="layui-input" id="HRemark" placeholder="备注" style="border-radius: 50px;background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>单据日期</th>
|
<td class="t1_input">
|
<input type="text" name="HDate" class="layui-input" id="HDate" style="border-radius: 50px;" placeholder="请选择日期" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>单据号</th>
|
<td class="bz_td">
|
<input type="text" name="HBillNo" class="layui-input" id="HBillNo" placeholder="单据号" style="border-radius: 50px;background-color:#efefef4d;" readonly>
|
<input type="hidden" name="HInterID" id="HInterID" value="0" autocomplete="off" class="layui-input">
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
</div>
|
<div class="layui-tab-item">
|
<table style="width:80%;">
|
<tbody>
|
<tr>
|
<th>制单人</th>
|
<td class="bz_td">
|
<input type="text" name="HMaker" class="layui-input" id="HMaker" style="border-radius: 50px;background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>制单日期</th>
|
<td class="bz_td">
|
<input type="text" name="HMakeDate" class="layui-input" id="HMakeDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>修改人</th>
|
<td class="bz_td">
|
<input type="text" name="HUpDater" class="layui-input" id="HUpDater" style="border-radius: 50px;background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>修改日期</th>
|
<td class="bz_td">
|
<input type="text" name="HUpDateDate" class="layui-input" id="HUpDateDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>审核人</th>
|
<td class="bz_td">
|
<input type="text" name="HChecker" class="layui-input" id="HChecker" style="border-radius: 50px;background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>审核日期</th>
|
<td class="bz_td">
|
<input type="text" name="HCheckDate" class="layui-input" id="HCheckDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>关闭人</th>
|
<td class="bz_td">
|
<input type="text" name="HCloseMan" class="layui-input" id="HCloseMan" style="border-radius: 50px;background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>关闭日期</th>
|
<td class="bz_td">
|
<input type="text" name="HCloseDate" class="layui-input" id="HCloseDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>作废人</th>
|
<td class="bz_td">
|
<input type="text" name="HDeleteMan" class="layui-input" id="HDeleteMan" style="border-radius: 50px;background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
<tr>
|
<th>作废日期</th>
|
<td class="bz_td">
|
<input type="text" name="HDeleteDate" class="layui-input" id="HDeleteDate" style="border-radius: 50px;background-color:#efefef4d;" readonly>
|
</td>
|
</tr>
|
</tbody>
|
</table>
|
</div>
|
<table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
|
</div>
|
<ul class="layui-tab-title">
|
<li class="layui-this">单据信息</li>
|
<li>制单信息</li>
|
</ul>
|
</div>
|
</div>
|
<!--隐藏字段-->
|
<input type="hidden" name="lngProcInterID" id="lngProcInterID">
|
<input type="hidden" name="lngBillKey" id="lngBillKey" value="0">
|
<input type="hidden" name="lngBillSubKey" id="lngBillSubKey" value="0">
|
<!--<input type="hidden" name="HMaker" id="HMaker">--><!--制单人-->
|
<input type="hidden" name="eventType" id="eventType" value="Add">
|
<input type="hidden" name="HeqSouID" id="HeqSouID" value="0">
|
</form>
|
</div>
|
</div>
|
</div>
|
|
<script>
|
var HBillType = ""; //单据类型
|
var HSourceInterID = ""; //源单主内码
|
var HSourceEntryID = ""; //源单子内码
|
var HSourceBillNo = ""; //源单单号
|
var HSourceBillType = ""; //源单类型
|
var HGroupID = 0;//班组ID
|
//获取页面跳转参数 //单据编辑状态: 1.无源单新增 2.有源单新增 3.编辑 4.浏览 5.变更
|
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 HSBillType = params[params[2]];//源单类型
|
}
|
|
var edit = function (data) {
|
HBillType = data[0].HBillType;
|
HSourceInterID = data[0].HSourceInterID;
|
HSourceEntryID = data[0].HSourceEntryID;
|
HSourceBillNo = data[0].HSourceBillNo;
|
HSourceBillType = data[0].HSourceBillType;
|
HGroupID = data[0].HGroupID;
|
}
|
layui.config({
|
base: '../../../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'form', 'laydate', 'table', 'element','upload'], function () {
|
var $ = layui.$
|
, admin = layui.admin
|
, layer = layui.layer
|
, table = layui.table
|
, form = layui.form
|
, laydate = layui.laydate
|
, element = layui.element;
|
//流转卡是否扫描标记
|
var HProcExchBillNoFlag = false;
|
//加载时间控件
|
laydate.render({
|
elem: '#HStopBeginWorkTime'
|
, type: 'datetime'
|
});
|
laydate.render({
|
elem: '#HStopEndWorkTime'
|
, type: 'datetime'
|
});
|
//判断是否新增
|
if (OperationType == 1 || OperationType == 2 || OperationType == 5) {
|
//获取最大单据号
|
var ajaxLoad = layer.load();
|
$.ajax({
|
url: GetWEBURL() + "/Web/GetMAXNum",
|
type: "GET",
|
data: { "HBillType": '3702' },
|
success: function (d) {
|
$("#HInterID").val(0);
|
$("#HBillNo").val(d.data[0].HBillNo);
|
layer.close(ajaxLoad);
|
}
|
, error: function () {
|
layer.close(ajaxLoad);
|
layer.msg("获取单据号失败,请刷新重试!");
|
}
|
});
|
|
GetDefValByUser();
|
//获取班组名称
|
getHGroupNameByID()
|
set_AddNew();
|
}
|
|
//进入页面默认光标在条形码上
|
$("#HBarCode").focus();
|
|
//#region 触发事件:包括form.on(){}格式的所有点击事件、选择事件等
|
|
//#region 确定按钮
|
form.on('submit(QueDin)', function (data) {//
|
var HBarCode = $('#HBarCode').val();
|
|
if (!HBarCode) {
|
layer.msg("条形码不能为空!")
|
return;
|
}
|
txtHBarCode_KeyDown(HBarCode);
|
|
});
|
//#endregion
|
|
//#region 新增按钮
|
form.on('submit(Add)', function () {//提交
|
layer.confirm('新增后页面数据将消失?', { icon: 3, title: '提示' }, function (index) {
|
location.replace('Sc_MESBeginWorkBillList_PDA.html?type=' + params[params[0]]);
|
});
|
})
|
//#endregion
|
|
//#region 保存按钮
|
form.on('submit(Saver)', function (data) {//提交
|
var refSav = "";
|
if (OperationType == 1 || OperationType == 2 || OperationType == 5) {
|
refSav = "Add";
|
} else {
|
refSav = "Update";
|
}
|
if ($("#HStopEndWorkTime").val() == '' || $("#HStopBeginWorkTime").val() == null) {
|
layer.msg("预计结束时间不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
if ($("#HSourceID").val() == '' || $("#HSourceID").val() == null || $("#HSourceID").val() == 0) {
|
layer.msg("生产资源不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
if ($("#HMainSourceInterID").val() == '' || $("#HMainSourceInterID").val() == null || $("#HMainSourceInterID").val() == 0) {
|
layer.msg("源单单号不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
if ($("#HEmpID").val() == '' || $("#HEmpID").val() == null||$("#HEmpID").val() == '0') {
|
layer.msg("操作员不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
if ($("#HGroupID").val() == '' || $("#HGroupID").val() == null || $("#HGroupID").val() == '0') {
|
layer.msg("班组不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
if ($("#HDeptID").val() == '' || $("#HDeptID").val() == null || $("#HDeptID").val() == '0') {
|
layer.msg("车间不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
if ($("#HICMOInterID").val() == '' || $("#HICMOInterID").val() == null || $("#HICMOInterID").val() == '0') {
|
layer.msg("生产订单不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
if ($("#HStopType").val() == '' || $("#HStopType").val() == null) {
|
layer.msg("停工类型不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
if ($("#HStopReason").val() == '' || $("#HStopReason").val() == null) {
|
layer.msg("停工原因不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return Result = false;
|
}
|
|
var msg = JSON.stringify(data.field) + ";" + sessionStorage["HUserName"] + ";" + refSav;
|
var index = layer.load();
|
$.ajax({
|
type: "POST",
|
url: GetWEBURL() + "/Sc_MESStopWorkBill/SaveGetMESStopFrom",
|
async: true,
|
data: { "msg": msg },
|
dataType: "json",
|
success: function (result) {
|
if (result.count == 1) {
|
$('#Saver').addClass("layui-btn-disabled").attr("disabled", true);//禁用保存按钮
|
$("#HInterID").val(result.HInterID);//获取提交成功返回的单据主ID
|
layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function (index) {
|
if (result.Verify == "Y") //自动审核
|
{
|
layer.close(index);
|
SaveVerify(); //审核
|
}
|
else {
|
layer.close(index);
|
}
|
});
|
layer.close(index);
|
}
|
else {
|
layer.close(index);
|
layer.msg(result.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: "温馨提示" });
|
}
|
});
|
|
|
});
|
//#endregion
|
|
//条形码回车方法
|
$('#HBarCode').on('keydown', function (event) {
|
var HBarCode = $('#HBarCode').val();
|
if (event.keyCode == 13) {
|
if (!HBarCode) {
|
layer.msg("空白码,条形码不能为空!")
|
return;
|
}
|
txtHBarCode_KeyDown(HBarCode);
|
}
|
});
|
//流水号(工序号)回车方法
|
$('#HProcNo').on('keydown', function (event) {
|
var sProcNo = $('#HProcNo').val();
|
var sBillNo = $('#HMainSourceBillNo').val();
|
if (event.keyCode == 13) {
|
if (!HProcExchBillNoFlag) {
|
layer.msg("流转卡没有扫描,或者没有按回车键,请扫描流转卡或者在流转卡文本框中按回车键!");
|
return;
|
}
|
txtHProcNo_KeyDown(sBillNo, sProcNo);
|
}
|
});
|
|
//选择生产班组弹窗
|
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 () {//生产资源
|
console.log($('#HProcNo').val())
|
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(HEmployeeID-BT)', function () {
|
layer.open({
|
type: 2
|
, area: ['80%', '80%']
|
, title: '职员列表'
|
, shade: 0.6 //遮罩透明度
|
, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../../../Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
|
, resize: false
|
, cancel: function (index, layero) {
|
}
|
})
|
});
|
|
//选择流水号弹窗
|
form.on('submit(SerialNum-BT)', function () {//生产资源
|
var value = $("#lngProcInterID").val();
|
// 判断是否已经输入流水号,是则弹出模态框,否则给出提示
|
if (value) {
|
layer.open({
|
type: 2
|
, area: ['80%', '80%']
|
, title: '流水号'
|
, shade: 0.6 //遮罩透明度
|
//, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: [`../../../Baseset/基础资料/Gy_GetProcNoList.html?HInterID=${value}`, 'yes']
|
, resize: false
|
, cancel: function (index, layero) {
|
}
|
, end: function () {
|
var sProcNo = $('#HProcNo').val();
|
var sBillNo = $('#HMainSourceBillNo').val();
|
if (sProcNo != "") {
|
txtHProcNo_KeyDown(sBillNo, sProcNo);
|
}
|
}
|
})
|
} else {
|
layer.alert('请您确认输入流转卡号后重试^_^', { icon: 7 });
|
}
|
});
|
|
//选择部门弹窗
|
form.on('submit(btnHDept)', function () {//部门
|
layer.open({
|
type: 2 //类型
|
, skin: 'layui-layer-rim'//加上边框
|
, area: ['90%', '90%']//大小
|
, title: '部门列表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../../Baseset/基础资料/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 === 0) {
|
return layer.msg('请选择数据');
|
}
|
//获取数据
|
$("#HDeptID").val(checkStatus.data[0].HItemID);
|
$("#HDeptName").val(checkStatus.data[0].HName);
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
})
|
});
|
|
//退出--全屏版
|
form.on('submit(Cancel)', function () {
|
Pub_Close2(1);
|
})
|
|
//新增
|
form.on('submit(Add)', function () {
|
Pub_Close2(1);
|
})
|
|
//#endregion
|
|
//#region 本页面所有被调用的方法
|
|
//#region 通过登录用户获取默认值
|
function GetDefValByUser() {
|
var index = layer.load();
|
$.ajax({
|
url: GetWEBURL() + "/Cj_StationInBill/GetDefValByUser",
|
type: "GET",
|
async: false,
|
data: { "Czybm": sessionStorage["Czybm"], "Czymc": sessionStorage["HUserName"] },
|
success: function (result) {
|
var data = result.data[0];
|
|
form.val("formData", {
|
//"HSourceID": data.HSourceID,
|
//"HSourceName": data.生产资源名称,
|
"HGroupID": data.HGroupID,
|
"HGroupName": data.生产班组名称,
|
"HEmpID": data.HEmpID,
|
"HEmpName": data.操作员名称
|
});
|
layer.close(index);
|
}
|
, error: function () {
|
layer.close(index);
|
layer.msg("接口请求失败");
|
}
|
})
|
}
|
//#endregion
|
|
//#region 通过班组ID获取班组名称
|
function getHGroupNameByID() {
|
$.ajax({
|
url: GetWEBURL() + '/Gy_Group/cx',
|
type: "GET",
|
async: false,
|
data: { "HInterID": HGroupID },
|
success: function (data1) {
|
if (data1.count == 1) {
|
$("#HGroupID").val(HGroupID)
|
$("#HGroupName").val(data1.data[0].班组名称)
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
|
});
|
}
|
|
//#endregion
|
|
//条形码回车方法
|
function txtHBarCode_KeyDown(HBarCode) {
|
var ajaxLoad = layer.load();
|
var sql = "select * from Sc_ICMOBillStatus_Tmp where HICMOBillNo = '" + HBarCode + "'" ;
|
$.ajax({
|
url: GetWEBURL() + '/Gy_SOPBillList/WindowPrintList',
|
type: "GET",
|
async: false,
|
data: { "sWhere": sql },
|
success: function (data1) {
|
if (data1.count == 1) {
|
HSourceInterID = data1.data[0].HInterID;
|
HSourceEntryID = data1.data[0].HICMOEntryID;
|
HSourceBillNo = HBarCode;
|
HSourceBillType = data1.data[0].HBillType;
|
} else {
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
layer.close(ajaxLoad);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
layer.close(ajaxLoad);
|
}
|
});
|
$.ajax(
|
{
|
type: "GET",
|
url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkFrom", //方法所在页面和方法名
|
async: false,
|
data: {
|
"HSourceInterID": HSourceInterID,
|
"HSourceEntryID": HSourceEntryID,
|
"HSourceBillNo": HSourceBillNo,
|
"HSourceBillType": HSourceBillType
|
},
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1)// 说明验证成功了,
|
{
|
var LoadData = data.data.h_p_JIT_GetInfoByICMOStatusInterID;
|
|
$("#HProcID").val(LoadData[0].HProcID); //当前工序ID
|
$("#HProcName").val(LoadData[0].HProcName); //当前工序
|
$("#HMaterID").val(LoadData[0].HMaterID); //产品ID
|
$("#HMaterCode").val(LoadData[0].HMaterNumber); //产品代码
|
$("#HMaterName").val(LoadData[0].HMaterName); //产品名称
|
$("#HMaterSpec").val(LoadData[0].HModel); //产品规格
|
$("#HSourceID").val(LoadData[0].HSourceID); //生产资源ID
|
$("#HSourceName").val(LoadData[0].HSourceName); //生产资源
|
$("#HMainSourceBillNo").val(LoadData[0].HICMOBillNo); //源单单号(暂时取值订单编号)
|
$("#HMainSourceInterID").val(LoadData[0].HSourceInterID); //源单主内码(取值HInterID)
|
$("#HMainSourceEntryID").val(LoadData[0].HSourceEntryID); //源单子内码(源单行号)
|
$("#HMainSourceBillType").val(HSourceBillType); //源单类型
|
$("#HDeptID").val(LoadData[0].HDeptID); //车间ID
|
$("#HDeptName").val(LoadData[0].HDeptName); //车间
|
$("#HICMOInterID").val(LoadData[0].HICMOInterID); //生产订单ID
|
$("#HICMOEntryID").val(LoadData[0].HICMOEntryID); //生产订单子ID
|
$("#HICMOBillNo").val(LoadData[0].HICMOBillNo); //生产订单
|
//HCenterID = LoadData[0].HCenterID == null ? sessionStorage["HWorkCenterID"] : LoadData[0].HCenterID;//工作中心id
|
layer.close(ajaxLoad);
|
}
|
else {
|
layer.alert(data.Message, { icon: 5 });
|
layer.close(ajaxLoad);
|
}
|
},
|
error: function (err) {
|
layer.alert(err, { icon: 5 });
|
layer.close(ajaxLoad);
|
}
|
});
|
}
|
//流水号回车方法
|
function txtHProcNo_KeyDown(sBillNo, sProcNo) {
|
var index = layer.load();
|
$.ajax({
|
url: GetWEBURL() + "/Cj_StationInBill/txtHProcNo_KeyDown",
|
type: "GET",
|
data: { "sBillNo": sBillNo, "sProcNo": sProcNo },
|
success: function (result) {
|
if (result.count == 1) {
|
var data = result.data[0];
|
form.val("formData", { //formTest 即 class="layui-form" 所在元素属性 lay-filter="" 对应的值
|
"HProcName": data.工序,
|
"HProcID": data.HProcID,
|
"HSourceID": data.HSourceID,
|
"HSourceName": data.生产资源
|
});
|
$("#HProcNo").attr("readonly", "readonly");
|
$("#HProcNo").css("background-color", "#efefef4d");
|
layer.close(index);
|
}
|
else {
|
layer.close(index);
|
layer.msg(result.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 SaveVerify() {
|
var InterID = $("#HInterID").val();
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Sc_MESStopWorkBill/AuditProcessReportList", //方法所在页面和方法名
|
async: true,
|
data: { "HInterID": InterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1) { // 说明验证成功了,
|
layer.msg(data.Message, { time: 1 * 2000, icon: 1 }, function (index) {
|
//layer.close(layer.index);
|
//window.parent.location.reload();
|
});
|
}
|
else {
|
layer.alert(data.Message, { icon: 5 })
|
}
|
},
|
error: function (err) {
|
layer.alert(err, { icon: 5 })
|
}
|
})
|
}
|
|
//有源单新增
|
function set_AddNew() {
|
//初始基本信息赋值
|
$("#HDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss")); //单据日期
|
$("#HStopBeginWorkTime").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss")) //开始时间
|
$("#HStopEndWorkTime").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss")) //有预计结束时间
|
$("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd hh:mm:ss")); //制单日期
|
$("#HMaker").val(sessionStorage["HUserName"]); //制单人
|
|
|
//加源单类型区分(可以写不同的方法)
|
$('#HProcName').attr("disabled", true);
|
$('#HStopBeginWorkTime').attr("disabled", true);
|
$('#HSourceName').attr("disabled", true);
|
$('#ProductionResources-BT').addClass("layui-btn-disabled").attr("disabled", true);
|
$('#HMainSourceBillNo').attr("disabled", true);
|
$('#HICMOBillNo').attr("disabled", true);
|
$('#HDeptName').attr("disabled", true);
|
$('#btnHDept').addClass("layui-btn-disabled").attr("disabled", true);
|
|
$.ajax(
|
{
|
type: "GET",
|
url: GetWEBURL() + "/Sc_MESBeginWorkBill/GetMESBeginWorkFrom", //方法所在页面和方法名
|
async: false,
|
data: {
|
"HSourceInterID": HSourceInterID,
|
"HSourceEntryID": HSourceEntryID,
|
"HSourceBillNo": HSourceBillNo,
|
"HSourceBillType": HBillType
|
},
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1)// 说明验证成功了,
|
{
|
var LoadData = data.data.h_p_JIT_GetInfoByICMOStatusInterID;
|
|
$("#HProcID").val(LoadData[0].HProcID); //当前工序ID
|
$("#HProcName").val(LoadData[0].HProcName); //当前工序
|
$("#HMaterID").val(LoadData[0].HMaterID); //产品ID
|
$("#HMaterNumber").val(LoadData[0].HMaterNumber); //产品代码
|
$("#HMaterName").val(LoadData[0].HMaterName); //产品名称
|
$("#HSourceID").val(LoadData[0].HSourceID); //生产资源ID
|
$("#HSourceName").val(LoadData[0].HSourceName); //生产资源
|
$("#HMainSourceBillNo").val(LoadData[0].HICMOBillNo); //源单单号(暂时取值订单编号)
|
$("#HMainSourceInterID").val(LoadData[0].HSourceInterID); //源单主内码(取值HInterID)
|
$("#HMainSourceEntryID").val(LoadData[0].HSourceEntryID); //源单子内码(源单行号)
|
$("#HMainSourceBillType").val(HSourceBillType); //源单类型
|
$("#HDeptID").val(LoadData[0].HDeptID); //车间ID
|
$("#HDeptName").val(LoadData[0].HDeptName); //车间
|
$("#HICMOInterID").val(LoadData[0].HICMOInterID); //生产订单ID
|
$("#HICMOEntryID").val(LoadData[0].HICMOEntryID); //生产订单子ID
|
$("#HICMOBillNo").val(LoadData[0].HICMOBillNo); //生产订单
|
//HCenterID = LoadData[0].HCenterID == null ? sessionStorage["HWorkCenterID"] : LoadData[0].HCenterID;//工作中心id
|
}
|
else {
|
layer.alert(data.Message, { icon: 5 });
|
|
}
|
},
|
error: function (err) {
|
layer.alert(err, { icon: 5 });
|
}
|
});
|
}
|
|
//以上为layui模块
|
});
|
//返回流水号
|
function GetProcNoValue(obj) {
|
$("#HProcNo").val(obj[0].流水号);
|
}
|
|
//返回生产班组
|
function GetProductionTeamValue(obj) {
|
$("#HGroupName").val(obj[0].班组);
|
$("#HGroupID").val(obj[0].HItemID);
|
}
|
|
//返回生产资源
|
function GetProductionResourcesValue(obj) {
|
$("#HSourceName").val(obj[0].生产资源);
|
$("#HSourceID").val(obj[0].HItemID);
|
}
|
//返回操作员
|
function GetHWorkerValue(obj) {
|
$("#HEmpName").val(obj[0].HName);
|
$("#HEmpID").val(obj[0].HItemID);
|
}
|
//返回当前工序
|
function GetHProcValue(obj) { //返回当前工序
|
$("#HProcName").val(obj[0].工序);
|
$("#HProcID").val(obj[0].HItemID);
|
}
|
|
</script>
|
</body>
|
</html>
|