<!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/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>
|
<style>
|
.main-btn { /*头部主按钮*/
|
padding: 0 2px; /*调整按钮左右空隙大小*/
|
height: 30px;
|
line-height: 30px;
|
}
|
|
.btn-title {
|
font-size: 16px;
|
}
|
/* 防止下拉框的下拉列表被隐藏---必须设置--- */
|
.layui-table-cell {
|
overflow: visible !important;
|
}
|
/* 使得下拉框与单元格刚好合适 */
|
td .layui-form-select {
|
margin-top: -10px;
|
margin-left: -15px;
|
margin-right: -15px;
|
}
|
|
.layui-form-item .layui-inline {
|
margin-top: 5px;
|
margin-bottom: 5px;
|
margin-right: 0px;
|
}
|
|
.layui-form-label {
|
width: 25%;
|
}
|
</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-add-1 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 class="layui-btn layuiadmin-btn-order main-btn" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">
|
<i class="layui-icon layui-icon-delete layuiadmin-button-btn"><span class="btn-title">保存</span></i>
|
</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" lay-verify="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly>
|
<input type="hidden" name="HInterID" id="HInterID" lay-verify="HInterID">
|
<input type="hidden" name="HPRDORGID" id="HPRDORGID" lay-verify="HPRDORGID">
|
</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" lay-verify="HDate" name="HDate" id="HDate" style="padding-left: 32px;">
|
</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="HName" name="HName" id="HName">
|
</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="HPicNumVer" name="HPicNumVer" id="HPicNumVer">
|
</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="HMaterNumber" name="HMaterNumber" id="HMaterNumber" 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;background-color:gainsboro;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="color:black;"></i>
|
</button>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 75px;">产品名称</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HMaterName" lay-verify="HMaterName" id="HMaterName" style="background-color:#efefef4d;width:90%" readonly>
|
<input type="hidden" name="HMaterID" id="HMaterID" lay-verify="HMaterID" value="0">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">规格型号</label>
|
<div class="layui-input-block" style="margin-left: 105px;">
|
<input type="text" class="layui-input" name="HMaterModel" id="HMaterModel" onmouseover="this.title=this.value" 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="HPicNumAssemble" id="HPicNumAssemble" onmouseover="this.title=this.value">
|
</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="HUnitName" lay-verify="HUnitName" id="HUnitName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<input type="hidden" name="HUnitID" id="HUnitID" lay-verify="HUnitID" value="0">
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnUnit" id="btnUnit" style="padding: 0 10px;float: left;margin-right: 3px;background-color:gainsboro;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="color:black;"></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="hidden" class="layui-input" lay-verify="HRoutingGroupID" name="HRoutingGroupID" id="HRoutingGroupID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<input type="text" class="layui-input" lay-verify="HRoutingGroupIDName" name="HRoutingGroupIDName" id="HRoutingGroupIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnRoutingGroup" id="btnRoutingGroup" style="padding: 0 10px;float: left;margin-right: 3px;background-color:gainsboro;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="color:black;"></i>
|
</button>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">时间单位</label>
|
<div class="layui-input-block" style="margin-left: 120px;width: 172px;">
|
<select name="HMainTimeUnit" lay-verify="HMainTimeUnit" id="HMainTimeUnit">
|
<option value="小时">小时</option>
|
<option value="天">天</option>
|
</select>
|
</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="HMaterTexture" lay-verify="HMaterTexture" id="HMaterTexture" value="" onmouseover="this.title=this.value">
|
</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="HMainProcIDName" name="HMainProcIDName" id="HMainProcIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<input type="hidden" class="layui-input" name="HMainProcID" id="HMainProcID" lay-verify="HMainProcID" 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="btnSearchProc" id="btnSearchProc" style="padding: 0 10px;float: left;margin-right: 3px;background-color:gainsboro;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="color:black;"></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="HMainCenterIDName" name="HMainCenterIDName" id="HMainCenterIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<input type="hidden" class="layui-input" name="HMainCenterID" lay-verify="HMainCenterID" id="HMainCenterID" 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="btnWorkCenter" id="btnWorkCenter" style="padding: 0 10px;float: left;margin-right: 3px;background-color:gainsboro;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="color:black;"></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="HGroupIDName" lay-verify="HGroupIDName" id="HGroupIDName" 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" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnGroup" id="" style="padding: 0 10px;float: left;margin-right: 3px;background-color:gainsboro;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn" style="color:black;"></i>
|
</button>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">成品编号</label>
|
<div class="layui-input-block" style="margin-left: 100px;">
|
<input type="text" class="layui-input" name="HProductNum" lay-verify="HProductNum" id="HProductNum" value="" onmouseover="this.title=this.value">
|
</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="HMainWorkQty" lay-verify="HMainWorkQty" id="HMainWorkQty" value="0" onmouseover="this.title=this.value">
|
</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="HMainUnitTime" lay-verify="HMainUnitTime" id="HMainUnitTime" value="0">
|
<!--<input type="hidden" value="小时" name="HMainTimeUnit" id="HMainTimeUnit">-->
|
</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="HMainPrice" id="HMainPrice" lay-verify="HMainPrice" value="0">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">版本</label>
|
<div class="layui-input-block" style="margin-left: 105px;">
|
<input type="text" class="layui-input" name="HVerNum" lay-verify="HVerNum" id="HVerNum" value="" onmouseover="this.title=this.value">
|
</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="HStdSourceQty" id="HStdSourceQty" lay-verify="HStdSourceQty" value="0"> <!--style="background-color:#efefef4d;"-->
|
</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="HAddSourceRate" id="HAddSourceRate" lay-verify="HAddSourceRate" value="0"> <!--style="background-color:#efefef4d;"-->
|
</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="HDelSourceRate" name="HDelSourceRate" id="HDelSourceRate" value="0"> <!--style="background-color:#efefef4d;"-->
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline" style="width: 56%;">
|
<label class="layui-form-label" style="width: 85px;">备注</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="hidden" class="layui-input" name="HMaker" id="HMaker" lay-verify="HMaker" value="">
|
<input type="text" class="layui-input" name="HRemark" id="HRemark" lay-verify="HRemark" placeholder="请输入内容" onmouseover="this.title=this.value">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<div class="layui-input-block" style="margin-left: 70px;">
|
<input type="checkbox" name="checkboxHStandard" id="checkboxHStandard" lay-skin="primary" lay-filter="checkboxHStandard" checked title="是否默认工艺">
|
<input type="hidden" value="true" name="HStandard" id="HStandard" lay-verify="HStandard">
|
<!--<input type="checkbox" name="checkboxHUseFlag" id="checkboxHUseFlag" title="是否启用" lay-skin="primary" lay-filter="checkboxHUseFlag">
|
<input type="hidden" value="false" name="HUseFlag" id="HUseFlag">-->
|
</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="" id="" 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="" id="" 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="" id="" 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="" id="" 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="" id="" 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="" id="" 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="" id="" 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="" id="" 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="" id="" 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="" id="" 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="" id="" 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="" id="" 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>
|
</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="HProcType">
|
<select name="HProcType" lay-filter="HProcType" id="HProcType{{d.LAY_TABLE_INDEX+1}}">
|
<option value="主工序">主工序</option>
|
<option value="辅助工序">辅助工序</option>
|
</select>
|
</script>
|
|
<!--复选框 委外协助-->
|
<script type="text/html" id="HSupFlag">
|
<div class="layui-input-block" style="margin-left: 20px;">
|
<input type="checkbox" name="HSupFlag" lay-filter="HSupFlag" id="HSupFlag{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
|
</div>
|
</script>
|
|
<!--复选框 下道流转工序-->
|
<script type="text/html" id="HNextProcFlag">
|
<div class="layui-input-block" style="margin-left: 20px;">
|
<input type="checkbox" name="HNextProcFlag" lay-filter="HNextProcFlag" id="HNextProcFlag{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
|
</div>
|
</script>
|
|
<!--复选框 流转工序-->
|
<script type="text/html" id="HFlowProc">
|
<div class="layui-input-block" style="margin-left: 20px;">
|
<input type="checkbox" name="HFlowProc" lay-filter="HFlowProc" id="HFlowProc{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
|
</div>
|
</script>
|
|
<!--复选框 标准定额-->
|
<script type="text/html" id="HStdFlag">
|
<div class="layui-input-block" style="margin-left: 20px;">
|
<input type="checkbox" name="HStdFlag" lay-filter="HStdFlag" id="HStdFlag{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
|
</div>
|
</script>
|
|
<!--复选框 自动移转-->
|
<script type="text/html" id="HAutoTrunFlag">
|
<div class="layui-input-block" style="margin-left: 20px;">
|
<input type="checkbox" name="HAutoTrunFlag" lay-filter="HAutoTrunFlag" id="HAutoTrunFlag{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
|
</div>
|
</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 HReasonName, ReasonID, EmpName, SQProcName,
|
ProcID, ZRProcName, QRName;
|
|
//初始表格数据
|
var rowdata = [{
|
"HProcNo": "", "HProcID_S": 0, "HProcType": "主工序", "HCenterID_S": 0, "HCenterID_SName": ""
|
, "HWorkQty_S": 0, "HSubStdEmpQty_S": 0, "HMouldNo": "", "HChangeMould": 0, "HPackStd": ""
|
, "HPack": "", "HPutArea": "", "HMyWorkDays": 0, "HMyFixWorkDays": 0, "工序": ""
|
, "HProcID": 0, "工作中心代码": "", "HCenterID": 0, "工作中心": "", "HSupID": 0
|
, "供应商代码": "", "供应商": "", "HSupFlag": false, "HTimeUnit": "", "HUnitTime": 0
|
, "HWorkQty": 0, "HPassRate": 0, "HOverRate": 0, "HReadyTime": 0, "HQueueTime": 0
|
, "HMoveTime": 0, "HNextProcFlag": false, "HFlowProc": false, "HSubStdEmpQty": 0, "HSubCanUseSourceQty": 0
|
, "HFixPrice": 0, "HProcPrice": 0, "HBadPrice": 0, "HWasterPrice": 0, "HStdFlag": false
|
, "HBeginDayQty": 0, "HBeginFixQty": 0, "HFixWorkDays": 0, "HTrunWorkDays": 0, "HReadyTimes": 0
|
, "HICMOReadyTimes": 0, "HAutoTrunFlag": false, "HTechnologyParameter": "", "HPicNum": "", "HProcCheckNote": ""
|
, "HProcWorkNum": ""
|
}];
|
|
//#endregion
|
|
//#region 进入页面即加载
|
|
//制单人
|
$("#HMaker").val(sessionStorage["HUserName"]);
|
|
//判断是否登录 未登录则跳到登录页
|
//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 = getUrlVars();
|
var OperationType = params[params[0]]; //从参数中获取 数据类型 添加 保存
|
var linterid = params[params[1]]; //从参数中获取 单据内码
|
var lSourceBillType = params[params[2]]; //从单据获取 源单类型
|
var linteridSub = params[params[3]]; //从参数获取 子表级别
|
|
//判断是否新增
|
if (linterid == null || linterid == 0) {
|
linteridSub = -1;
|
OperationType = 1;
|
$.ajax({
|
url: GetWEBURL() + "/Web/GetMAXNum",
|
type: "GET",
|
data: { "HBillType": '3301' },
|
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"));
|
}
|
});
|
}
|
else {//如果修改则走下面 new
|
RoadBillMain(linterid, linteridSub);
|
//RoadBillSub(linterid);
|
}
|
|
|
var option = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, limit: 500 //每页默认显示的数量
|
, cellMinWidth: 120
|
, height: 400
|
, cols: [[ //表头
|
{ type: 'checkbox', totalRowText: '合计行' }
|
, { type: 'numbers', title: '序号', totalRow: true }
|
, { field: 'HProcNo', title: '流水号', edit: 'text' }
|
, { field: 'HProcID_S', title: '工段', edit: 'text' }
|
, { field: 'HProcType', title: '工序类型', templet: '#HProcType' }//选择
|
, { field: 'HCenterID_SName', title: '产线中心', edit: 'text', event: "CheckHCenterID_S" }//f7
|
, { field: 'HCenterID_S', title: '产线中心id', hide: true }//hide: true
|
, { field: 'HWorkQty_S', title: '产线产能', edit: 'text' }
|
, { field: 'HSubStdEmpQty_S', title: '产线人数', edit: 'text' }
|
, { field: 'HMouldNo', title: '模具编号', edit: 'text' }
|
, { field: 'HChangeMould', title: '换模时间', edit: 'text' }
|
, { field: 'HPackStd', title: '周转箱标准', edit: 'text' }
|
, { field: 'HPack', title: '周转箱', edit: 'text' }
|
, { field: 'HPutArea', title: '暂放区', edit: 'text' }
|
, { field: 'HMyWorkDays', title: '生产周期', edit: 'text' }
|
, { field: 'HMyFixWorkDays', title: '固定生产天数', edit: 'text' }
|
, { field: '工序', title: '工序', edit: 'text', event: "CheckHProcID" }//f7
|
, { field: 'HProcID', title: '工序ID', hide: true }//, hide: true
|
, { field: '工作中心代码', title: '工作中心代码' }//不填
|
, { field: 'HCenterID', title: '工作中心id', hide: true }//, hide: true
|
, { field: '工作中心', title: '工作中心', edit: 'text', event: "CheckHCenterID" }//f7
|
, { field: 'HSupID', title: '供应商ID', hide: true }
|
, { field: '供应商代码', title: '供应商代码' }
|
, { field: '供应商', title: '供应商', edit: 'text', width: 110, event: "CheckHSupID" }//f7
|
, { field: 'HSupFlag', title: '外协标记', templet: "#HSupFlag" }//checkbox
|
, { field: 'HTimeUnit', title: '时间单位', edit: 'text' }
|
, { field: 'HUnitTime', title: '运行时间', edit: 'text' }
|
, { field: 'HWorkQty', title: '加工数量', edit: 'text' }//默认
|
, { field: 'HPassRate', title: '良率', edit: 'text' }//默认
|
, { field: 'HOverRate', title: '超额比例', edit: 'text' }
|
, { field: 'HReadyTime', title: '准备时间', edit: 'text' }
|
, { field: 'HQueueTime', title: '排队时间', edit: 'text' }
|
, { field: 'HMoveTime', title: '转移时间', edit: 'text' }
|
, { field: 'HNextProcFlag', title: '下道流转工序', templet: "#HNextProcFlag" }//chenbox
|
, { field: 'HFlowProc', title: '流转工序', templet: "#HFlowProc" }//chenbox
|
, { field: 'HSubStdEmpQty', title: '标准人数', edit: 'text' }
|
, { field: 'HSubCanUseSourceQty', title: '可操作设备数', edit: 'text' }
|
, { field: 'HFixPrice', title: '班产定额', edit: 'text' }//默认
|
, { field: 'HProcPrice', title: '工序工价', edit: 'text' }//默认
|
, { field: 'HBadPrice', title: '不合格单价', edit: 'text' }//默认
|
, { field: 'HWasterPrice', title: '报废单价', edit: 'text' }//默认
|
, { field: 'HStdFlag', title: '标准定额', templet: "#HStdFlag" }//chenbox
|
, { field: 'HBeginDayQty', title: '开工余量(天数)', edit: 'text' }
|
, { field: 'HBeginFixQty', title: '开工余量(固数)', edit: 'text' }
|
, { field: 'HFixWorkDays', title: '上道固定天数', edit: 'text' }
|
, { field: 'HTrunWorkDays', title: '上道循环周期', edit: 'text' }
|
, { field: 'HReadyTimes', title: '本道准备时间', edit: 'text' }
|
, { field: 'HICMOReadyTimes', title: '换单准备时间', edit: 'text' }
|
, { field: 'HAutoTrunFlag', title: '自动移转', templet: "#HAutoTrunFlag" }//chenbox
|
, { field: 'HTechnologyParameter', title: '工艺参数', edit: 'text' }
|
, { field: 'HPicNum', title: '图纸编号', edit: 'text' }
|
, { field: 'HProcCheckNote', title: '本工序确认记录', edit: 'text' }
|
, { field: 'HProcWorkNum', 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) {
|
// //alert(value)
|
// if (value.LAY_TNDEX == dataIndex) {
|
// $cr.find('input').val(value.HProcType);
|
// }
|
// });
|
// });
|
//}
|
}
|
|
//初始加载表格
|
option.data = rowdata;
|
table.render(option);
|
|
//#endregion
|
|
//#region 触发事件:包括form.on(){}格式的所有点击事件、选择事件等
|
|
//选择产品代码按钮
|
form.on('submit(btnSearchMater)', function () {
|
get_checkSearchMater();
|
});
|
|
//选择工序按钮
|
form.on('submit(btnSearchProc)', function () {
|
get_checkSearchProc();
|
});
|
|
//选择计量单位按钮
|
form.on('submit(btnUnit)', function () {
|
get_checkUnit();
|
});
|
|
//选择生产班组按钮
|
form.on('submit(btnGroup)', function () {
|
get_checkGroup();
|
});
|
|
//选择工作中心按钮
|
form.on('submit(btnWorkCenter)', function () {
|
get_checkWorkCenter();
|
});
|
|
//选择工艺路线大类按钮
|
form.on('submit(btnRoutingGroup)', function () {
|
get_checkRoutingGroup();
|
});
|
|
|
//是否默认工艺
|
form.on('checkbox(checkboxHStandard)', function (data) {
|
$("#HStandard").val(data.elem.checked);
|
});
|
|
//#region 复选框
|
//委外协助
|
form.on('checkbox(HSupFlag)', 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.HSupFlag = data.elem.checked;//把选中下拉框id值赋值给表格缓存
|
}
|
});
|
});
|
|
//下道流转工序
|
form.on('checkbox(HNextProcFlag)', 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.HNextProcFlag = data.elem.checked;//把选中下拉框id值赋值给表格缓存
|
}
|
});
|
});
|
|
//流转工序
|
form.on('checkbox(HFlowProc)', 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.HFlowProc = data.elem.checked;//把选中下拉框id值赋值给表格缓存
|
}
|
});
|
});
|
|
//标准定额
|
form.on('checkbox(HStdFlag)', 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.HStdFlag = data.elem.checked;//把选中下拉框id值赋值给表格缓存
|
}
|
});
|
});
|
|
//自动移转
|
form.on('checkbox(HAutoTrunFlag)', 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.HAutoTrunFlag = data.elem.checked;//把选中下拉框id值赋值给表格缓存
|
}
|
});
|
});
|
//#endregion
|
|
//行选择处理(工序类型)
|
form.on('select(HProcType)', 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.HProcType = data.value;//把选中下拉框id值赋值给表格缓存
|
}
|
});
|
});
|
|
|
//头工具栏事件
|
table.on('toolbar(mainTable)', function (obj) {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
//新增行表格数据
|
var NewRow = {
|
"HProcNo": "", "HProcID_S": 0, "HProcType": "主工序", "HCenterID_S": 0, "HCenterID_SName": ""
|
, "HWorkQty_S": 0, "HSubStdEmpQty_S": 0, "HMouldNo": "", "HChangeMould": 0, "HPackStd": ""
|
, "HPack": "", "HPutArea": "", "HMyWorkDays": 0, "HMyFixWorkDays": 0, "工序": ""
|
, "HProcID": 0, "工作中心代码": "", "HCenterID": 0, "工作中心": "", "HSupID": 0
|
, "供应商代码": "", "供应商": "", "HSupFlag": false, "HTimeUnit": "", "HUnitTime": 0
|
, "HWorkQty": 0, "HPassRate": 0, "HOverRate": 0, "HReadyTime": 0, "HQueueTime": 0
|
, "HMoveTime": 0, "HNextProcFlag": false, "HFlowProc": false, "HSubStdEmpQty": 0, "HSubCanUseSourceQty": 0
|
, "HFixPrice": 0, "HProcPrice": 0, "HBadPrice": 0, "HWasterPrice": 0, "HStdFlag": false
|
, "HBeginDayQty": 0, "HBeginFixQty": 0, "HFixWorkDays": 0, "HTrunWorkDays": 0, "HReadyTimes": 0
|
, "HICMOReadyTimes": 0, "HAutoTrunFlag": false, "HTechnologyParameter": "", "HPicNum": "", "HProcCheckNote": ""
|
, "HProcWorkNum": ""
|
};
|
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++) {
|
console.log(option.data[i - 1].HSupFlag)
|
$('#HProcType' + i + '').find("option[value='" + option.data[i - 1].HProcType + "']").attr("selected", true);
|
//委外协助
|
if (option.data[i - 1].HSupFlag) {
|
$('#HSupFlag' + i + '').attr("checked", true);
|
}
|
//下道流转工序
|
if (option.data[i - 1].HNextProcFlag) {
|
$('#HNextProcFlag' + i + '').attr("checked", true);
|
}
|
//流转工序
|
if (option.data[i - 1].HFlowProc) {
|
$('#HFlowProc' + i + '').attr("checked", true);
|
}
|
//标准定额
|
if (option.data[i - 1].HStdFlag) {
|
$('#HStdFlag' + i + '').attr("checked", true);
|
}
|
//自动移转
|
if (option.data[i - 1].HAutoTrunFlag) {
|
$('#HAutoTrunFlag' + i + '').attr("checked", true);
|
}
|
}
|
form.render('select');
|
form.render('checkbox');
|
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++) {
|
$('#HProcType' + i + '').find("option[value='" + option.data[i - 1].HProcType + "']").attr("selected", true);
|
//委外协助
|
if (option.data[i - 1].HSupFlag) {
|
$('#HSupFlag' + i + '').attr("checked", true);
|
}
|
//下道流转工序
|
if (option.data[i - 1].HNextProcFlag) {
|
$('#HNextProcFlag' + i + '').attr("checked", true);
|
}
|
//流转工序
|
if (option.data[i - 1].HFlowProc) {
|
$('#HFlowProc' + i + '').attr("checked", true);
|
}
|
//标准定额
|
if (option.data[i - 1].HStdFlag) {
|
$('#HStdFlag' + i + '').attr("checked", true);
|
}
|
//自动移转
|
if (option.data[i - 1].HAutoTrunFlag) {
|
$('#HAutoTrunFlag' + i + '').attr("checked", true);
|
}
|
}
|
form.render('select');
|
form.render('checkbox');
|
}
|
break;
|
}
|
});
|
|
//行内事件
|
table.on('tool(mainTable)', function (obj) {
|
set_GridDelete(obj); //行内删除
|
set_GridCellCheck(obj); //行内快捷键筛选
|
|
});
|
|
$('#HName').on('keydown', function (event) {//工艺路线名称
|
if (event.keyCode == 118) {
|
layer.msg("工艺路线名称F7按钮")
|
}
|
});
|
|
//保存提交
|
form.on('submit(btnSave)', function (data) {//提交
|
if (AllowLoadData(data)) {
|
set_AddNew(data);
|
}
|
});
|
|
//选择不良原因
|
form.on('submit(HBadReasonID-BT)', function () {//选择仓库
|
layer.open({
|
type: 2
|
, area: ['80%', '80%']
|
, title: '不良原因列表'
|
, shade: 0.6 //遮罩透明度
|
, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
|
, resize: false
|
, cancel: function () {
|
//$(".layui-btn").removeClass("layui-btn-disabled");
|
}
|
})
|
});
|
|
//选择工序计划单
|
form.on('submit(HPlanID-BT)', function () {//选择工序计划单
|
layer.open({
|
type: 2
|
, area: ['80%', '80%']
|
, title: '工序计划单列表'
|
, shade: 0.6 //遮罩透明度
|
, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../../../views/Baseset/基础资料/Sc_ProcessPlanViewList.html', 'yes']
|
, resize: false
|
, cancel: function () {
|
//$(".layui-btn").removeClass("layui-btn-disabled");
|
}
|
})
|
});
|
|
//选择责任人
|
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: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
|
, resize: false
|
, cancel: function () {
|
//$(".layui-btn").removeClass("layui-btn-disabled");
|
}
|
})
|
});
|
|
//选择申请工序
|
form.on('submit(HSQProcID-BT)', function () {//选择申请工序
|
layer.open({
|
type: 2
|
, area: ['80%', '80%']
|
, title: '申请工序列表'
|
, shade: 0.6 //遮罩透明度
|
, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
|
, resize: false
|
, cancel: function () {
|
//$(".layui-btn").removeClass("layui-btn-disabled");
|
}
|
})
|
});
|
|
//选择责任工序
|
form.on('submit(HZRProcID-BT)', function () {//选择责任工序
|
layer.open({
|
type: 2
|
, area: ['80%', '80%']
|
, title: '责任工序列表'
|
, shade: 0.6 //遮罩透明度
|
, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
|
, resize: false
|
, cancel: function () {
|
//$(".layui-btn").removeClass("layui-btn-disabled");
|
}
|
})
|
});
|
|
//编辑
|
form.on('submit(cmdModify)', function () {//编辑
|
var sSubStr = table.cache['wl-table'];
|
//if (AllowLoadData(sSubStr) != false) {//非空验证
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '明细列表'
|
, shade: 0.6 //遮罩透明度
|
, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../../../views/公共页面/Kf_BarCodeEditDlg.html?table=' + JSON.stringify(sSubStr), 'yes']
|
, resize: false
|
, cancel: function () {
|
//$(".layui-btn").removeClass("layui-btn-disabled");
|
}
|
})
|
// }
|
});
|
|
form.on('submit(Cancel)', function () {
|
//sessionStorage["SourceFlag"] = false;
|
parent.location.href = "../../../views/index.html"
|
//window.close();//关闭当前页
|
})
|
|
|
form.on('submit(Saver)', function (data) { //保存
|
//debugger;
|
var sMainStr = JSON.stringify(data.field);
|
var sSubStr = JSON.stringify(table.cache['mainTable']);
|
var sMainSub = sMainStr + ';' + sSubStr;
|
$.ajax(
|
{
|
type: "POST",
|
url: GetWEBURL() + "SaveBadReasonList", //方法所在页面和方法名
|
async: true,
|
data: { "msg": sMainSub },
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1) { // 说明验证成功了,
|
layer.msg(data.Message, { icon: 1 });
|
$('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
|
}
|
else {
|
|
f_alert(data.Message);
|
console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable));
|
}
|
layer.closeAll("loading");
|
},
|
error: function (err) {
|
|
f_alert("错误:" + err);
|
console.log("Reason" + sMainStr);
|
}
|
});
|
});
|
|
//监听提交
|
form.verify({
|
numberOrEmpty: function (value, item) {
|
|
// if (value != '') {
|
if (!/^\d+$/.test(value)) {
|
return '不能为空或数字或者0';
|
}
|
//}
|
}
|
});
|
|
|
|
|
//#endregion
|
|
//#region 此页面所有的方法
|
|
//产品选择页面
|
function get_checkSearchMater() {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: '物料表'//标题
|
, shift: 2//弹出动画
|
, 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('请选择数据');
|
}
|
//获取数据
|
$("#HMaterID").val(checkStatus.data[0].HItemID);//物料id
|
$("#HMaterName").val(checkStatus.data[0].HName);//物料名称
|
$("#HMaterNumber").val(checkStatus.data[0].HNumber);//物料代码
|
$("#HMaterModel").val(checkStatus.data[0].HModel);//规格型号
|
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
}
|
|
//工序选择页面
|
function get_checkSearchProc() {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: '工序表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../Baseset/基础资料/Gy_ProcList.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('请选择数据');
|
}
|
//获取数据
|
$("#HMainProcID").val(checkStatus.data[0].HItemID);//工序id
|
$("#HMainProcIDName").val(checkStatus.data[0].工序);//工序id
|
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
}
|
|
//计量单位选择页面
|
function get_checkUnit() {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: '计量单位表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../Baseset/基础资料/Gy_UnitList.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('请选择数据');
|
}
|
//获取数据
|
$("#HUnitID").val(checkStatus.data[0].HItemID);//计量单位id
|
$("#HUnitName").val(checkStatus.data[0].HName);//计量单位名称
|
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
}
|
|
//生产班组选择页面
|
function get_checkGroup() {
|
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
|
$("#HGroupIDName").val(checkStatus.data[0].班组名称);//计量单位名称
|
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
}
|
|
//工作中心选择页面
|
function get_checkWorkCenter() {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: '工作中心表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../Baseset/基础资料/Gy_WorkCenterList.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('请选择数据');
|
}
|
//获取数据
|
$("#HMainCenterID").val(checkStatus.data[0].HItemID);//工作中心id
|
$("#HMainCenterIDName").val(checkStatus.data[0].工作中心);//计量单位名称
|
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
}
|
|
//工艺路线大类选择页面
|
function get_checkRoutingGroup() {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: '工艺路线大类列表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../Baseset/基础资料/Gy_RoutingGroup.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('请选择数据');
|
}
|
//获取数据
|
$("#HRoutingGroupID").val(checkStatus.data[0].HItemID);//工艺路线大类id
|
$("#HRoutingGroupIDName").val(checkStatus.data[0].HName);//工艺路线大类名称
|
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
}
|
//获取参数
|
function getUrlVars() {
|
var vars = [], hash;
|
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
for (var i = 0; i < hashes.length; i++) {
|
hash = hashes[i].split('=');
|
vars.push(hash[0]);
|
vars[hash[0]] = hash[1];
|
}
|
return vars;
|
}
|
|
//行内删除
|
function set_GridDelete(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);
|
}
|
});
|
}
|
}
|
|
//行内删除快捷键
|
function set_GridCellCheck(obj) {
|
$(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
|
if (event.key == "F7") {
|
//产线中心
|
if (obj.event == "CheckHCenterID_S") {
|
//打开维修项目小窗体
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "产线中心列表" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["90%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ["../../Baseset/基础资料/Gy_LineCenter.html", "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//按钮一 的回调
|
var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
|
|
if (checkStatus.data.length != 1) {
|
return layer.msg("请选择一条数据");
|
}
|
//更新表格缓存的数据
|
obj.update({
|
"HCenterID_SName": checkStatus.data[0].HName
|
, "HCenterID_S": checkStatus.data[0].HItemID
|
})
|
layer.close(index);//关闭弹窗
|
}
|
})
|
}
|
//工序
|
if (obj.event == "CheckHProcID") {
|
//打开人员表 小窗体
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "工序列表" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["90%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ["../../Baseset/基础资料/Gy_ProcList.html", "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//按钮一 的回调
|
var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
|
|
if (checkStatus.data.length != 1) {
|
return layer.msg("请选择一条数据");
|
}
|
//更新表格缓存的数据
|
obj.update({
|
"工序": checkStatus.data[0].工序
|
, "HProcID": checkStatus.data[0].HItemID
|
})
|
layer.close(index);//关闭弹窗
|
}
|
})
|
}
|
//工作中心
|
if (obj.event == "CheckHCenterID") {
|
//打开人员表 小窗体
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "人员列表" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["90%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ["../../Baseset/基础资料/Gy_WorkCenterList.html", "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//按钮一 的回调
|
var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
|
|
if (checkStatus.data.length != 1) {
|
return layer.msg("请选择一条数据");
|
}
|
//更新表格缓存的数据
|
obj.update({
|
"工作中心": checkStatus.data[0].工作中心
|
, "HCenterID": checkStatus.data[0].HItemID
|
, "工作中心代码": checkStatus.data[0].工作中心代码
|
})
|
layer.close(index);//关闭弹窗
|
}
|
})
|
}
|
//供应商
|
if (obj.event == "CheckHSupID") {
|
//打开人员表 小窗体
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "供应商列表" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["90%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ["../../Baseset/基础资料/Gy_SupplierList.html", "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//按钮一 的回调
|
var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
|
|
if (checkStatus.data.length != 1) {
|
return layer.msg("请选择一条数据");
|
}
|
//更新表格缓存的数据
|
obj.update({
|
"供应商": checkStatus.data[0].HName
|
, "HSupID": checkStatus.data[0].HItemID
|
, "供应商代码": checkStatus.data[0].HNumber
|
})
|
layer.close(index);//关闭弹窗
|
}
|
})
|
}
|
obj.event = "";
|
return false;
|
}
|
|
})
|
}
|
|
//编辑 页面赋值
|
function RoadBillMain(linterid, linteridSub)//加载表头
|
{
|
var sWhere = " and hmainid='" + linterid + "' and hsubid='" + linteridSub + "'";
|
$.ajax({
|
url: GetWEBURL() + "/LEMS/MES_Gy_RoutingBillList_Json",
|
type: "GET",
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
|
success: function (d) {
|
|
//alert(JSON.stringify(d.data[0]))
|
//return false;
|
|
var IsHStopflag = d.data[0].默认工艺;
|
if (IsHStopflag == 1) {
|
$("input[name='checkboxHStandard']").prop("checked", true);
|
}
|
//主表
|
form.val("formData", { //formTest 即 class="layui-form" 所在元素属性 lay-filter="" 对应的值
|
"HBillNo": d.data[0].单据号
|
, "HInterID": d.data[0].hmainid
|
, "HDate": Format(new Date(d.data[0].制单日期), "yyyy-MM-dd")
|
, "HName": d.data[0].工艺名称
|
, "HMaterNumber": d.data[0].物料代码
|
, "HMaterName": d.data[0].物料名称
|
, "HMaterID": d.data[0].hmaterid
|
, "HUnitName": d.data[0].计量单位
|
, "HUnitID": d.data[0].hunitid
|
, "HMainTimeUnit": d.data[0].运行时间单位
|
, "HMainProcIDName": d.data[0].工序名称
|
, "HMainProcID": d.data[0].HMainProcID
|
, "HMainCenterIDName": d.data[0].工作
|
, "HMainCenterID": d.data[0].HMainCenterID
|
, "HGroupIDName": d.data[0].班组
|
, "HGroupID": d.data[0].HMainGroupID
|
, "HMainWorkQty": d.data[0].主加工数量
|
, "HMainUnitTime": d.data[0].主运行时间
|
, "HMainPrice": d.data[0].工价
|
, "HStdSourceQty": d.data[0].标准资源数
|
, "HAddSourceRate": d.data[0].加资源增量
|
, "HDelSourceRate": d.data[0].减资源减量
|
, "HRemark": d.data[0].表头备注
|
, "HStandard": d.data[0].默认工艺 == 1 ? true : false
|
, "HMaterModel": d.data[0].规格型号
|
, "HPicNumVer": d.data[0].图号版本
|
, "HPicNumAssemble": d.data[0].总装图号
|
, "HMaterTexture": d.data[0].材质
|
, "HProductNum": d.data[0].成品编号
|
, "HVerNum": d.data[0].版本
|
});
|
|
//子表 赋值
|
var rowdata = [{
|
"HProcNo": d.data[0].工序号, "HProcID_S": d.data[0].工段, "HProcType": d.data[0].工序类型, "HCenterID_S": d.data[0].HCenterID_S, "HCenterID_SName": d.data[0].产线中心
|
, "HWorkQty_S": d.data[0].产线产能, "HSubStdEmpQty_S": d.data[0].产线人数, "HMouldNo": d.data[0].模具编号, "HChangeMould": d.data[0].换模时间, "HPackStd": d.data[0].周转箱标准
|
, "HPack": d.data[0].周转箱, "HPutArea": d.data[0].暂放区, "HMyWorkDays": d.data[0].生产周期, "HMyFixWorkDays": d.data[0].固定生产天数, "工序": d.data[0].工序
|
, "HProcID": d.data[0].hprocid, "工作中心代码": d.data[0].工作中心代码, "HCenterID": d.data[0].HCenterID, "工作中心": d.data[0].工作中心名称, "HSupID": d.data[0].HSupID
|
, "供应商代码": d.data[0].供应商代码, "供应商": d.data[0].供应商, "HSupFlag": d.data[0].委外标记 == 0 ? false : true, "HTimeUnit": d.data[0].时间单位, "HUnitTime": d.data[0].运行时间
|
, "HWorkQty": d.data[0].加工数量, "HPassRate": d.data[0].良率, "HOverRate": d.data[0].超额比例, "HReadyTime": d.data[0].准备时间, "HQueueTime": d.data[0].排队时间
|
, "HMoveTime": d.data[0].转移时间, "HNextProcFlag": d.data[0].HNextProcFlag == 0 ? false : true, "HFlowProc": d.data[0].流转工序 == 0 ? false : true, "HSubStdEmpQty": d.data[0].标准人数, "HSubCanUseSourceQty": d.data[0].可操作设备数
|
, "HFixPrice": d.data[0].班产定额, "HProcPrice": d.data[0].加工单价, "HBadPrice": d.data[0].不合格单价, "HWasterPrice": d.data[0].报废单价, "HStdFlag": d.data[0].标准定额
|
, "HBeginDayQty": d.data[0].开工余量天数, "HBeginFixQty": d.data[0].开工余量固数, "HFixWorkDays": d.data[0].上道固定天数, "HTrunWorkDays": d.data[0].上道循环周期, "HReadyTimes": d.data[0].本道准备时间
|
, "HICMOReadyTimes": d.data[0].换单准备时间, "HAutoTrunFlag": d.data[0].自动移转, "HTechnologyParameter": d.data[0].工艺参数, "HPicNum": d.data[0].图纸编号, "HProcCheckNote": d.data[0].本工序确认记录
|
, "HProcWorkNum": d.data[0].程序号
|
}];
|
option.data = rowdata;
|
table.render(option);
|
|
if (d.data[0].委外标记) {
|
$('#HSupFlag1').attr("checked", true);
|
}
|
if (d.data[0].HNextProcFlag) {
|
$('#HNextProcFlag1').attr("checked", true);
|
}
|
if (d.data[0].流转工序) {
|
$('#HFlowProc1').attr("checked", true);
|
}
|
if (d.data[0].标准定额) {
|
$('#HStdFlag1').attr("checked", true);
|
}
|
if (d.data[0].自动移转) {
|
$('#HAutoTrunFlag1').attr("checked", true);
|
}
|
form.render('checkbox');
|
$('#HProcType1').find("option[value='" + d.data[0].工序类型+ "']").attr("selected", true);
|
form.render('select');
|
}
|
})
|
}
|
//保存HMaker
|
function set_AddNew(data) {
|
|
var num = [];
|
for (var i = 0; i < table.cache["mainTable"].length; i++) {
|
if (table.cache["mainTable"][i] != "") {
|
table.cache["mainTable"][i].LAY_TABLE_INDEX = i;
|
num.push(table.cache["mainTable"][i])
|
}
|
}
|
|
data.field.HPRDORGID = sessionStorage["OrganizationID"];//组织
|
var sMainStr = JSON.stringify(data.field);
|
var sSubStr = JSON.stringify(num);
|
var hentryid = linteridSub;//子表 排序id
|
var sMainSub = sMainStr + ';' + sSubStr + ';' + hentryid + ';' + OperationType + ";" + sessionStorage["HUserName"];
|
|
var index = layer.load();
|
$.ajax({
|
type: "POST",
|
url: GetWEBURL() + "/Gy_RoutingBill/AddBill",
|
//url:"http://localhost:12761/Gy_RoutingBill/AddBill",
|
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("提交成功");
|
}
|
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 f_alert(sMsg) {
|
layer.alert(sMsg, { icon: 5 });
|
|
}
|
//非空验证
|
function AllowLoadData(data) {
|
|
if ($("#HMaterNumber").val() == "") {
|
layer.msg("产品代码没有选择");
|
return false;
|
}
|
if ($("#HUnitName").val() == "") {
|
layer.msg("计量单位没有选择");
|
return false;
|
}
|
if ($("#HMainProcIDName").val() == "") {
|
layer.msg("工序没有选择");
|
return false;
|
}
|
if ($("#HMainCenterIDName").val() == "") {
|
layer.msg("工作中心没有选择");
|
return false;
|
}
|
if ($("#HGroupIDName").val() == "") {
|
layer.msg("生产班组没有选择");
|
return false;
|
}
|
|
return true;
|
//if ($("#HBillNo").val() == '') {
|
// layer.msg("错误的单据号", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
// return false;
|
//}
|
//if ($("#HInterID").val() == '') {
|
// layer.msg("错误的内码", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
// return false;
|
//}
|
//if (typeof (sSubStr) == "undefined") {
|
// layer.msg("没有物料明细记录", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
// return false;
|
//}
|
|
}
|
|
//#endregion
|
|
});
|
|
|
</script>
|
</body>
|
</html>
|