<!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%;
|
}
|
|
.layui-table th, .layui-table td {
|
white-space: nowrap; /* 不换行 */
|
overflow: hidden; /* 超出内容隐藏 */
|
text-overflow: ellipsis; /* 显示省略号 */
|
}
|
</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: 2px; ">
|
<!--<button type="button" id="btnSearch" style="margin-left: 0px" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="btnSearch" >预览</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">新增</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">修改</button>-->
|
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">保存</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnEdit" id="btnEdit">退出</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_defaultRoute" id="set_defaultRoute">启用默认</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_closeOtherRoute" id="set_closeOtherRoute">禁用其它</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_startCheckBill" id="set_startCheckBill">发起审批</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CheckBill" id="set_CheckBill">审核</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_AbandonCheck" id="set_AbandonCheck">反审核</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CloseBill" id="set_CloseBill">关闭</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CancelCloseBill" id="set_CancelCloseBill">反关闭</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_Copy" id="set_Copy">复制</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CheckFlowInfo" id="set_CheckFlowInfo">查看审批进度</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CheckBill_Flow" id="set_CheckBill_Flow">多级审核</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_AbandonCheck_Flow" id="set_AbandonCheck_Flow">多级反审核</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_RejectCheck_Flow" id="set_RejectCheck_Flow">驳回</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_WithdrawCheck_Flow" id="set_WithdrawCheck_Flow">撤回</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: 80px;">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 90px;">工艺路线名称*</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>
|
<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="width: 60%;display: inline-block;">
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchMater" id="btnSearchMater" style="padding: 0 10px;float: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 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;" 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: 85px;">规格型号*</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HMaterModel" id="HMaterModel" onmouseover="this.title=this.value" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;padding: 9px 18px;">计量单位*</label>
|
<div class="layui-input-block" style="margin-left: 83px;">
|
<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: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">定额类型</label>
|
<div class="layui-input-inline">
|
<select name="HProcPriceType" id="HProcPriceType" lay-filter="HProcPriceType" style="width:200px;">
|
<option value="临时定额">临时定额</option>
|
<option value="永久定额" selected="selected">永久定额</option>
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<div class="layui-input-block" style="margin-left: 0px;">
|
<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 class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">组织*</label>
|
<div class="layui-input-block" style="margin-left: 120px; width: 501px;">
|
<select name="HOrgID" id="HOrgID" lay-verify="HOrgID">
|
<!--动态渲染组织-->
|
</select>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline" id="HIDDEN" style="display:none;">
|
<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: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">开始日期</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="date" class="layui-input" lay-verify="HBeginDate" name="HBeginDate" id="HBeginDate" style="padding-left: 20px;">
|
</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="HEndDate" name="HEndDate" id="HEndDate" style="padding-left: 80px;">
|
</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="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" style=" width: 500px;">
|
</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: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;padding: 9px 18px;">生产班组</label>
|
<div class="layui-input-block" style="margin-left: 77px;">
|
<input type="text" class="layui-input" name="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: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>-->
|
</div>
|
<div class="layui-row">
|
<!--<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">加工数量</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="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>
|
<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">
|
<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" style=" width: 500px;">
|
</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; width: 501px;">
|
<select name="HOrgID" id="HOrgID" lay-verify="HOrgID">-->
|
<!--动态渲染组织-->
|
<!--</select>
|
</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="hmakers" id="hmakers" 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="" 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="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="" 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="hcloser" id="hcloser" 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="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="hclosedate" id="hclosedate" 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="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 class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label">时间单位</label>
|
<div class="layui-input-block" style="margin-left: 120px;width: 184px;">
|
<select name="HMainTimeUnit" lay-verify="HMainTimeUnit" id="HMainTimeUnit">
|
<option value="小时">小时</option>
|
<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 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;">总装图号</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 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: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">成品编号</label>
|
<div class="layui-input-block" style="margin-left: 115px;">
|
<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="HVerNum" lay-verify="HVerNum" id="HVerNum" value="" onmouseover="this.title=this.value">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<div class="layui-input-block" style="margin-left: 185px;">
|
<input type="checkbox" name="checkboxIsProNo" id="checkboxIsProNo" lay-skin="primary" lay-filter="checkboxIsProNo" title="转工序" disabled="disabled">
|
<input type="hidden" value="1" name="IsProNo" id="IsProNo" lay-verify="IsProNo">
|
</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>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn_up"><i class="layui-icon layui-icon-form"></i>上一行</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn_under"><i class="layui-icon layui-icon-form"></i>下一行</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn_Refresh"><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>
|
|
<!--复选框 SN过站控制-->
|
<script type="text/html" id="HSNCtrl">
|
<div class="layui-input-block" style="margin-left: 20px;">
|
<input type="checkbox" name="HSNCtrl" lay-filter="HSNCtrl" id="HSNCtrl{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
|
</div>
|
</script>
|
<!--复选框 是否首件-->
|
<script type="text/html" id="HQCFst">
|
<div class="layui-input-block" style="margin-left: 20px;">
|
<input type="checkbox" name="HQCFst" lay-filter="HQCFst" id="HQCFst{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
|
</div>
|
</script>
|
<!--复选框 是否末检-->
|
<script type="text/html" id="HQCProc">
|
<div class="layui-input-block" style="margin-left: 20px;">
|
<input type="checkbox" name="HQCProc" lay-filter="HQCProc" id="HQCProc{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
|
</div>
|
</script>
|
<!--复选框 是否巡检-->
|
<script type="text/html" id="HQCPatrol">
|
<div class="layui-input-block" style="margin-left: 20px;">
|
<input type="checkbox" name="HQCPatrol" lay-filter="HQCPatrol" id="HQCPatrol{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
|
</div>
|
</script>
|
<!--复选框 上料防错控制-->
|
<script type="text/html" id="HMaterToSourceCtrl">
|
<div class="layui-input-block" style="margin-left: 20px;">
|
<input type="checkbox" name="HMaterToSourceCtrl" lay-filter="HMaterToSourceCtrl" id="HMaterToSourceCtrl{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
|
</div>
|
</script>
|
<!--复选框 排产工序标记-->
|
<script type="text/html" id="HSortProcFlag">
|
<div class="layui-input-block" style="margin-left: 20px;">
|
<input type="checkbox" name="HSortProcFlag" lay-filter="HSortProcFlag" id="HSortProcFlag{{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" disabled="disabled" 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" disabled="disabled" 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>
|
//#region 文本框输入搜索相关数据-变量
|
var childPage = null; //获取子窗口对象,用于操作子窗口的变量和方法
|
var currRowIndex = 0; //用于定位子窗口当前选中的行
|
var childData = null; //用于获取子窗口返回的数据
|
//#endregion
|
|
var OptionData = [];
|
layui.config({
|
base: '../../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'form', 'laydate', 'table', 'element','tableSelect'], function () {
|
|
//#region 公共变量
|
|
var $ = layui.$
|
, admin = layui.admin
|
, layer = layui.layer
|
, table = layui.table
|
, form = layui.form
|
, element = layui.element
|
, tableSelect = layui.tableSelect;
|
|
//定义全局变量
|
var HReasonName, ReasonID, EmpName, SQProcName,
|
ProcID, ZRProcName, QRName;
|
|
//初始表格数据
|
var rowdata = [{
|
"HProcNo": "10", "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, "HSortProcFlag": false, "HTimeUnit": "", "HUnitTime": 0
|
, "HWorkQty": 1, "HSNCtrl": false, "HPassRate": 100, "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": "", "HBadWHID": 0, "HBadWHName": "", "HWasterWHID": 0, "HWasterWHName": ""
|
, "HWHID": 0, "HWHName": "", "HRemark": "", "HWorkTimes_S": 0
|
, "HQCSchemeID_Fst": 0, "HQCSchemeNumber_Fst": "", "HQCSchemeName_Fst": ""
|
, "HQCSchemeID_Proc": 0, "HQCSchemeNumber_Proc": "", "HQCSchemeName_Proc": ""
|
, "HQCSchemeID_Patrol": 0, "HQCSchemeNumber_Patrol": "", "HQCSchemeName_Patrol": ""
|
, "HQCFst": false, "HQCProc": false, "HQCPatrol": false, "HMaterToSourceCtrl": false
|
, "HSubStdEmpAvg_S": 0, "标准工价": 0,"HYDCoefficient": 0
|
}];
|
var HModName = "Gy_RoutingBill";
|
//#endregion
|
|
//#region 进入页面即加载
|
|
var option = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, limit: 500 //每页默认显示的数量
|
, totalRow: true
|
//, cellMinWidth: 120
|
, height: 450
|
, cols: [[ //表头
|
{ type: 'checkbox', totalRowText: '合计行' }
|
, { type: 'numbers', field: '序号', title: '序号', totalRow: true }
|
, { field: 'HProcNo', title: '流水号', edit: 'text' }
|
, { field: 'HProcID', title: '工序ID', hide: true }//, hide: true
|
, { field: '工序代码', title: '工序代码'}
|
, { field: '工序', title: '工序', edit: 'text', event: "CheckHProcID" }//f7
|
, { field: 'HProcID_S', title: '工段ID', hide: true }//, hide: true
|
, { field: '工段', title: '工段', edit: 'text', event: "CheckHProcMulID" }//f7
|
, { field: '工作中心代码', title: '工作中心代码', edit: 'text', event: "CheckHCenterID" }//不填
|
, { field: 'HCenterID', title: '工作中心ID', hide: true }//, hide: true
|
, { field: '工作中心', title: '工作中心' }//f7
|
, { field: 'HTechnologyParameter', title: '工艺参数', edit: 'text' }
|
, { field: 'HProcPrice', title: '工价', edit: 'text' }
|
, { field: '标准工价', title: '标准工价' }
|
, { field: 'HYDCoefficient', title: '约当系数', edit: 'text' }
|
, { field: 'HRemark', title: '备注', edit: 'text' }
|
, { field: 'HSupID', title: '供应商ID', hide: true }
|
, { field: '供应商代码', title: '供应商代码', edit: 'text', width: 110, event: "CheckHSupID" }
|
, { field: '供应商', title: '供应商' }//f7
|
, { field: 'HSupFlag', title: '外协标记', templet: "#HSupFlag" }//checkbox
|
, { field: 'HSortProcFlag', title: '排产工序标记', templet: "#HSortProcFlag", width: 120 }//checkbox
|
|
//, { field: 'HProcType', title: '工序类型', templet: '#HProcType' }//选择
|
////, { field: 'HBadWHID', title: 'HBadWHID', hide: true }//, hide: true
|
//, { field: 'HBadWHName', title: '不良品仓', edit: 'text', event: "HBadWHID" }//f7
|
//// , { field: 'HWasterWHID', title: 'HWasterWHID', hide: true }//, hide: true
|
//, { field: 'HWasterWHName', title: '报废品仓', edit: 'text', event: "HWasterWHID" }//f7
|
//// , { field: 'HWHID', title: 'HWHID', hide: true }//, hide: true
|
//, { field: 'HWHName', title: '良品仓', edit: 'text', event: "HWHID" }//f7
|
//, { field: 'HMouldNo', title: '模具编号', edit: 'text' }
|
//, { field: 'HPicNum', title: '图纸编号', edit: 'text' }
|
//, { field: 'HTimeUnit', title: '时间单位', edit: 'text' }
|
//, { field: 'HUnitTime', title: '运行时间', edit: 'text' }
|
, { field: 'HSNCtrl', title: 'SN过站控制', templet: "#HSNCtrl", width: 120 }
|
, { field: 'HMaterToSourceCtrl', title: '上料防错控制', templet: "#HMaterToSourceCtrl", width:120 }
|
, { field: 'HQCFst', title: '是否首件', templet: "#HQCFst", width: 120 }
|
, { field: 'HQCProc', title: '是否末检', templet: "#HQCProc", width: 120 }
|
, { field: 'HQCPatrol', title: '是否巡检', templet: "#HQCPatrol", width: 120 }
|
|
, { field: 'HQCSchemeID_Fst', title: '首件检验方案ID', hide: true }//f7
|
, { field: 'HQCSchemeNumber_Fst', title: '首件检验方案代码', edit: 'text', event: "HQCSchemeNumber_Fst", width: 125 }
|
, { field: 'HQCSchemeName_Fst', title: '首件检验方案名称', width: 125 }//f7
|
, { field: 'HQCSchemeID_Proc', title: '转序检验方案ID', hide: true }//f7
|
, { field: 'HQCSchemeNumber_Proc', title: '转序检验方案代码', edit: 'text', event: "HQCSchemeNumber_Proc", width: 125 }
|
, { field: 'HQCSchemeName_Proc', title: '转序检验方案名称', width: 125 }//f7
|
, { field: 'HQCSchemeID_Patrol', title: '巡检检验方案ID', hide: true }//f7
|
, { field: 'HQCSchemeNumber_Patrol', title: '巡检检验方案代码', edit: 'text', event: "HQCSchemeNumber_Patrol", width: 125 }
|
, { field: 'HQCSchemeName_Patrol', title: '巡检检验方案名称', width: 125 }//f7
|
, { field: 'HWorkQty', title: '加工数量', edit: 'text', width: 125 }
|
, { field: 'HSubStdEmpQty_S', title: '产线人数', edit: 'text', width: 125 }
|
, { field: 'HSubStdEmpAvg_S', title: '人均产能', edit: 'text', width: 125}
|
//, { field: 'HPassRate', title: '良率', edit: 'text' }//默认
|
//, { field: 'HProcID_S', title: '工段', edit: 'text' }
|
////, { field: 'HCenterID_S', title: '产线中心id', hide: true }//hide: true
|
//, { field: 'HCenterID_SName', title: '产线中心', edit: 'text', event: "CheckHCenterID_S" }//f7
|
//, { field: 'HWorkQty_S', title: '产线产能', edit: 'text' }
|
//, { field: 'HSubStdEmpQty_S', title: '产线人数', edit: 'text' }
|
//, { field: 'HReadyTime', title: '准备时间', edit: 'text' }
|
//, { field: 'HQueueTime', title: '排队时间', edit: 'text' }
|
//, { field: 'HMoveTime', 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: 'HOverRate', 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: '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: 'HProcCheckNote', title: '本工序确认记录', edit: 'text' }
|
//, { field: 'HProcWorkNum', title: '程序号', edit: 'text' }
|
/* , { field: 'HWorkTimes_S', title: '产品单件工时', edit: 'text' }*/
|
, { field: 'HWorkTimes_S', 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);
|
//初始化表格
|
DisPlay_HideColumn();
|
|
//制单人
|
$("#HMaker").val(sessionStorage["HUserName"]);
|
$("#hmakers").val(sessionStorage["HUserName"]);
|
$("#hmakedate").val(Format(new Date(), "yyyy-MM-dd"));
|
//组织
|
Organ();
|
|
//判断是否登录 未登录则跳到登录页
|
//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]]; //从参数中获取 数据类型 1添加 保存 2复制 3 编辑 4添加子工艺路线
|
var linterid = params[params[1]]; //从参数中获取 单据内码
|
var HBillSubType = params[params[2]]; //从单据获取 源单类型
|
//var linteridSub = params[params[3]]; //从参数获取 子表级别
|
var IsHavingPermissions = 0; //排产页面跳转过来时判断用户是否有工艺路线编辑权限,0代码没有权限,1代表有权限
|
//排产页面跳转编辑查看工艺路线
|
if (HBillSubType == 4610 && OperationType == 3) {
|
HBillSubType = 3301
|
IsHavingPermissions = params[params[3]];
|
if (IsHavingPermissions == 0) {
|
//没有工艺路线的编辑权限,禁用按钮
|
$('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);
|
$('#set_CheckBill').addClass("layui-btn-disabled").attr("disabled", true);
|
$('#set_AbandonCheck').addClass("layui-btn-disabled").attr("disabled", true);
|
$('#set_CloseBill').addClass("layui-btn-disabled").attr("disabled", true);
|
$('#set_CancelCloseBill').addClass("layui-btn-disabled").attr("disabled", true);
|
}
|
}
|
//排产页面跳转新增工艺路线
|
if (HBillSubType == 4610 && OperationType == 1) {
|
HBillSubType = 3301
|
|
$("#HMaterID").val(params[params[3]]);//物料ID
|
|
$("#HMaterNumber").val(getParams("HMaterNumber"));//物料代码
|
$("#HMaterName").val(getParams("HMaterName"));//物料名称
|
$("#HMaterModel").val(getParams("HMaterModel") == "" ? " " : getParams("HMaterModel"));//规格型号
|
}
|
|
if (HBillSubType == "SUB") {
|
//显示工序
|
$("#HIDDEN").show();
|
} else {
|
HBillSubType = "3301";
|
}
|
|
//判断是否新增
|
if (linterid == null || linterid == 0) {
|
//$("#HIDDEN").hide();
|
OperationType = 1;
|
$('#set_closeOtherRoute').addClass("layui-btn-disabled").attr("disabled", true);
|
$.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"));
|
$("#HBeginDate").val(Format(new Date(), "yyyy-MM-dd"));
|
$("#HEndDate").val(Format(new Date(2100,12,31), "yyyy-MM-dd"));
|
}
|
});
|
}
|
else if (OperationType == 2) {
|
//禁用组织选项
|
//$("#HOrgID").attr("disabled", true);
|
RoadBillMain(linterid);
|
$.ajax({
|
url: GetWEBURL() + "/Web/GetMAXNum",
|
type: "GET",
|
async: false,
|
data: { "HBillType": '3301' },
|
success: function (d) {
|
$("#HInterID").val(d.data[0].HInterID);
|
$("#HBillNo").val(d.data[0].HBillNo);
|
$("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
|
$("#HBeginDate").val(Format(new Date(), "yyyy-MM-dd"));
|
$("#HEndDate").val(Format(new Date(2100, 12, 31), "yyyy-MM-dd"));
|
}
|
});
|
}
|
else {//如果修改则走下面 new
|
|
//禁用组织选项
|
$("#HOrgID").attr("disabled", true);
|
RoadBillMain(linterid);
|
//RoadBillSub(linterid);
|
}
|
//设置转工序
|
get_xt();
|
|
|
|
//#endregion
|
|
//#region 触发事件:包括form.on(){}格式的所有点击事件、选择事件等
|
//#region 表头基础资料选择弹窗
|
//#region 文本框监听
|
$(document).ready(function () {
|
//#region 根据物料代码获取物料基础资料筛选弹窗
|
//根据元素ID对元素进行监听=============================================================================
|
$("#HMaterNumber").on('keydown', function (data) {
|
//================================================================================================
|
var errKeys = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Enter"];
|
if ($.inArray(event.key, errKeys) == -1) { //如果按下的键位不是 方向键,则刷新弹窗中的数据
|
if (childPage == null) { //判断当前子窗口是否已经打开,若未打卡,则打开页面,并获取子窗口的对象
|
var offset = $(this).offset(); //获取触发事件的元素的位置,用于定位子窗口打开的位置
|
var innerHeight = window.innerHeight;
|
var top = offset.top + 0.05 * innerHeight;
|
var left = offset.left;
|
if (top + 0.05 * innerHeight + 0.3 * innerHeight > innerHeight) {
|
top = top - 0.3 * innerHeight - 0.05 * innerHeight;
|
}
|
layer.open({
|
type: 2 //弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['25%', '30%'] //大小
|
, shadeClose: true //点击遮罩时关闭弹窗
|
, offset: [top, left]
|
, title: false //不显示标题栏
|
//, title: '项目费用列表' //标题
|
, shift: 2 //弹出动画
|
, closeBtn: 0 //禁用关闭按钮
|
, content: ["../../基础资料/通用基础资料/Gy_CommonBaseData.html?OperationType=2", "yes"]
|
, success: function (layero, index) {
|
setTimeout(function () {
|
//修改,根据文本框数据,编写查询语句================================================================================================
|
var value = $("#HMaterNumber").val().replace(/'/g, ""); //获取文本框最新值
|
currRowIndex = 0;
|
var tableView = "h_v_Gy_MaterialList";
|
var childSWhere = "select top(10) HItemID,物料代码,物料名称,规格型号,HUnitID,计量单位名称 from " + tableView + " where 1=1 and 组织名称 = '" + sessionStorage["Organization"] + "' and (物料代码 like '%" + value + "%' or 物料名称 like '%" + value + "%') order by 物料代码 desc";
|
childPage.getData(childSWhere, tableView);
|
//===================================================================================================================================
|
}, 200);
|
}
|
, end: function () {
|
childPage = null;
|
currRowIndex = 0;
|
if (childData != null) {
|
//根据弹窗返回数据设置文本框数据=================================================================================================
|
//获取数据
|
$("#HMaterID").val(childData.HItemID);//物料id
|
$("#HMaterName").val(childData.物料名称);//物料名称
|
$("#HMaterNumber").val(childData.物料代码);//物料代码
|
$("#HMaterModel").val(childData.规格型号);//规格型号
|
$("#HUnitID").val(childData.HUnitID);//计量单位id
|
$("#HUnitName").val(childData.计量单位名称);//计量单位名称
|
if ($("#HName").val() == "") {
|
$("#HName").val(childData.物料代码);
|
}
|
//===============================================================================================================================
|
|
childData = null;
|
}
|
}
|
});
|
} else {
|
setTimeout(function () {
|
//修改,根据文本框数据,编写查询语句================================================================================================
|
var value = $("#HMaterNumber").val().replace(/'/g, ""); //获取文本框最新值
|
currRowIndex = 0;
|
var tableView = "h_v_Gy_MaterialList";
|
var childSWhere = "select top(10) HItemID,物料代码,物料名称,规格型号,HUnitID,计量单位名称 from " + tableView + " where 1=1 and 组织名称 = '" + sessionStorage["Organization"] + "' and (物料代码 like '%" + value + "%' or 物料名称 like '%" + value + "%') order by 物料代码 desc";
|
childPage.getData(childSWhere, tableView);
|
//=================================================================================================================================
|
}, 200);
|
}
|
} else { //如果按下的键位是 方向键,则调整窗口中 选中行 的位置
|
if (event.key == "ArrowUp") {
|
currRowIndex--;
|
childPage.setSelectedRow(currRowIndex);
|
} else if (event.key == "ArrowDown") {
|
currRowIndex++;
|
childPage.setSelectedRow(currRowIndex);
|
} else if (event.key == "Enter") {
|
//手动失焦
|
var element = document.getElementById("HMaterNumber");
|
element.blur();
|
|
childPage.getSelectedData(currRowIndex);
|
|
if (childData != null) {
|
//根据弹窗返回数据设置文本框数据=================================================================================================
|
//获取数据
|
$("#HMaterID").val(childData.HItemID);//物料id
|
$("#HMaterName").val(childData.物料名称);//物料名称
|
$("#HMaterNumber").val(childData.物料代码);//物料代码
|
$("#HMaterModel").val(childData.规格型号);//规格型号
|
$("#HUnitID").val(childData.HUnitID);//计量单位id
|
$("#HUnitName").val(childData.计量单位名称);//计量单位名称
|
if ($("#HName").val() == "") {
|
$("#HName").val(childData.物料代码);
|
}
|
//===============================================================================================================================
|
|
childData = null;
|
}
|
|
|
childPage = null;
|
currRowIndex = 0;
|
childData = null;
|
}
|
}
|
});
|
//#endregion
|
});
|
//#endregion
|
//#endregion
|
|
|
//选择产品代码按钮
|
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('submit(set_defaultRoute)', function (data) {
|
set_defaultRoute(data);
|
});
|
//发起审批
|
form.on('submit(set_startCheckBill)', function (data) {
|
set_startCheckBill(data);
|
});
|
//禁用其它
|
form.on('submit(set_closeOtherRoute)', function (data) {
|
if ($("#hcloser").val() != '') {
|
layer.alert("单据已被关闭无法关闭其它!", { icon: 5 });
|
} else {
|
set_closeOtherRoute(data);
|
}
|
|
});
|
|
//审核
|
form.on('submit(set_CheckBill)', function (data) {
|
set_CheckBill(data);
|
});
|
|
//反审核
|
form.on('submit(set_AbandonCheck)', function (data) {
|
set_AbandonCheck(data);
|
});
|
|
//关闭
|
form.on('submit(set_CloseBill)', function (data) {
|
set_CloseBill(data);
|
});
|
|
//反关闭
|
form.on('submit(set_CancelCloseBill)', function (data) {
|
set_CancelCloseBill(data);
|
});
|
|
//查看审批进度
|
form.on('submit(set_CheckFlowInfo)', function (data) {
|
set_CheckFlowInfo();
|
});
|
|
//多级审核
|
form.on('submit(set_CheckBill_Flow)', function (data) {
|
set_CheckBill_Flow(0);
|
});
|
|
//多级反审核
|
form.on('submit(set_AbandonCheck_Flow)', function (data) {
|
set_CheckBill_Flow(1);
|
});
|
//驳回
|
form.on('submit(set_RejectCheck_Flow)', function (data) {
|
set_RejectCheck_Flow();
|
});
|
//撤回
|
form.on('submit(set_WithdrawCheck_Flow)', function (data) {
|
set_WithdrawCheck_Flow();
|
});
|
//复制
|
form.on('submit(set_Copy)', function (data) {
|
set_Copy();
|
});
|
|
//是否默认工艺
|
form.on('checkbox(checkboxHStandard)', function (data) {
|
$("#HStandard").val(data.elem.checked);
|
});
|
|
//是否转工序
|
form.on('checkbox(checkboxIsProNo)', function (data) {
|
|
if (data.elem.checked) {
|
$("#IsProNo").val("1");
|
}
|
else {
|
$("#IsProNo").val("0");
|
}
|
});
|
|
//#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值赋值给表格缓存
|
}
|
});
|
});
|
|
//SN过站控制
|
form.on('checkbox(HSNCtrl)', 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.HSNCtrl = data.elem.checked;//把选中下拉框id值赋值给表格缓存
|
}
|
});
|
});
|
//上料防错控制
|
form.on('checkbox(HMaterToSourceCtrl)', 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.HMaterToSourceCtrl = data.elem.checked;//把选中下拉框id值赋值给表格缓存
|
}
|
});
|
});
|
//是否首件
|
form.on('checkbox(HQCFst)', 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.HQCFst = data.elem.checked;//把选中下拉框id值赋值给表格缓存
|
}
|
});
|
});
|
//是否末检
|
form.on('checkbox(HQCProc)', 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.HQCProc = data.elem.checked;//把选中下拉框id值赋值给表格缓存
|
}
|
});
|
});
|
///是否巡检
|
form.on('checkbox(HQCPatrol)', 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.HQCPatrol = data.elem.checked;//把选中下拉框id值赋值给表格缓存
|
}
|
});
|
});
|
//排产工序标记
|
form.on('checkbox(HSortProcFlag)', 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.HSortProcFlag = 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": (table.cache["mainTable"].length + 1) * 10, "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, "HSortProcFlag": false, "HTimeUnit": "", "HUnitTime": 0
|
, "HWorkQty": 1, "HSNCtrl": false, "HPassRate": 100, "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": "", "HBadWHID": 0, "HBadWHName": "", "HWasterWHID": 0, "HWasterWHName": ""
|
, "HWHID": 0, "HWHName": "", "HRemark": "", "HWorkTimes_S": 0
|
, "HQCSchemeID_Fst": 0, "HQCSchemeNumber_Fst": "", "HQCSchemeName_Fst": ""
|
, "HQCSchemeID_Proc": 0, "HQCSchemeNumber_Proc": "", "HQCSchemeName_Proc": ""
|
, "HQCSchemeID_Patrol": 0, "HQCSchemeNumber_Patrol": "", "HQCSchemeName_Patrol": ""
|
, "HQCFst": false, "HQCProc": false, "HQCPatrol": false, "HMaterToSourceCtrl": false
|
, "HSubStdEmpAvg_S": 0, "标准工价": 0, "HYDCoefficient": 0
|
};
|
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++) {
|
$('#HProcType' + i + '').find("option[value='" + option.data[i - 1].HProcType + "']").attr("selected", true);
|
//委外协助
|
if (option.data[i - 1].HSupFlag) {
|
$('#HSupFlag' + i + '').attr("checked", true);
|
}
|
//SN过站控制
|
if (option.data[i - 1].HSNCtrl) {
|
$('#HSNCtrl' + i + '').attr("checked", true);
|
}
|
//上料防错控制
|
if (option.data[i - 1].HMaterToSourceCtrl) {
|
$('#HMaterToSourceCtrl' + i + '').attr("checked", true);
|
}
|
//是否首件
|
if (option.data[i - 1].HQCFst) {
|
$('#HQCFst' + i + '').attr("checked", true);
|
}
|
//是否末检
|
if (option.data[i - 1].HQCProc) {
|
$('#HQCProc' + i + '').attr("checked", true);
|
}
|
//是否巡检
|
if (option.data[i - 1].HQCPatrol) {
|
$('#HQCPatrol' + i + '').attr("checked", true);
|
}
|
//排产工序标记
|
if (option.data[i - 1].HSortProcFlag) {
|
$('#HSortProcFlag' + 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);
|
}
|
//SN过站控制
|
if (option.data[i - 1].HSNCtrl) {
|
$('#HSNCtrl' + i + '').attr("checked", true);
|
}
|
//上料防错控制
|
if (option.data[i - 1].HMaterToSourceCtrl) {
|
$('#HMaterToSourceCtrl' + i + '').attr("checked", true);
|
}
|
//是否首件
|
if (option.data[i - 1].HQCFst) {
|
$('#HQCFst' + i + '').attr("checked", true);
|
}
|
//是否末检
|
if (option.data[i - 1].HQCProc) {
|
$('#HQCProc' + i + '').attr("checked", true);
|
}
|
//是否巡检
|
if (option.data[i - 1].HQCPatrol) {
|
$('#HQCPatrol' + i + '').attr("checked", true);
|
}
|
//排产工序标记
|
if (option.data[i - 1].HSortProcFlag) {
|
$('#HSortProcFlag' + 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 'set_HideColumn':
|
get_HideColumn();
|
break;
|
//上一行
|
case 'btn_up':
|
btn_up(data);
|
break;
|
//下一行
|
case 'btn_under':
|
btn_under(data);
|
break;
|
//刷新流水号
|
case 'btn_Refresh':
|
btn_Refresh(data);
|
break;
|
}
|
});
|
|
//行内事件
|
table.on('tool(mainTable)', function (obj) {
|
set_GridDelete(obj); //行内删除
|
set_GridCellCheck(obj); //行内快捷键筛选
|
|
});
|
|
//行内鼠标离开事件
|
table.on('edit(mainTable)', function (obj) {
|
if (obj.field == "HProcNo") {
|
var num = 0;
|
for (var i = 0; i < option.data.length; i++) {
|
if (obj.value == option.data[i]["HProcNo"]) {
|
num += 1;
|
}
|
if (num > 1) {
|
layer.msg("流水号:" + obj.value + "重复!");
|
return false;
|
}
|
}
|
}
|
})
|
|
//明细网格单元格编辑事件
|
table.on('edit(mainTable)', function (obj) {
|
var value = obj.value //得到修改后的值
|
, data = obj.data //得到所在行所有键值
|
, field = obj.field; //得到字段
|
switch (field) {
|
case 'HSubStdEmpQty_S': //产线人数
|
if (value != 0 && value != "" && data.HSubStdEmpAvg_S != 0 && data.HSubStdEmpAvg_S != "") {
|
//同步更新表格和缓存对应的值
|
obj.update({
|
HWorkQty: Number((value * data.HSubStdEmpAvg_S).toFixed(2))
|
});
|
//table.render(option)
|
}
|
break;
|
case 'HSubStdEmpAvg_S': //产线人均产能
|
if (value != 0 && value != "" && data.HSubStdEmpQty_S != 0 && data.HSubStdEmpQty_S != "") {
|
//同步更新表格和缓存对应的值
|
obj.update({
|
HWorkQty: Number((value * data.HSubStdEmpQty_S).toFixed(2))
|
});
|
//table.render(option)
|
}
|
break;
|
case 'HWorkQty': //约当系数
|
if (localStorage["HBenchmarkValue"] != undefined && localStorage["HBenchmarkValue"] != null && data.HWorkQty > 0) {
|
obj.update({
|
HYDCoefficient: (localStorage["HBenchmarkValue"] / data.HWorkQty).toFixed(6)
|
});
|
}
|
break;
|
|
}
|
})
|
|
$('#HName').on('keydown', function (event) {//工艺路线名称
|
if (event.keyCode == 118) {
|
layer.msg("工艺路线名称F7按钮")
|
}
|
});
|
|
//保存提交
|
form.on('submit(btnSave)', function (data) {//提交
|
const procNos = table.cache["mainTable"].map(item => Number(item.HProcNo));
|
if (isSortedAscending(procNos) && haveHProcNO9999()) {
|
if (AllowLoadData(data)) {
|
set_AddNew(data);
|
}
|
} else {
|
layer.msg('请注意流水号次序或者是否有转工序');
|
}
|
});
|
// 函数:判断数组是否从小到大排序
|
function isSortedAscending(arr) {
|
for (let i = 0; i < arr.length - 1; i++) {
|
if (arr[i] > arr[i + 1]) {
|
return false;
|
}
|
}
|
return true;
|
}
|
//复制时保证转工序存在
|
function haveHProcNO9999() {
|
if (OperationType == 2 || OperationType == 3) {
|
for (var i = 0; i < option.data.length; i++) {
|
if (option.data[i]["HProcNo"] == 9999 && option.data[i]["工序代码"] == 9999) {
|
return true
|
}
|
}
|
return false;
|
}
|
return true;
|
}
|
//退出
|
form.on('submit(btnEdit)', function (data) {
|
if (params[1] != null) {
|
Pub_Close(1);
|
} else if (params[1] == null) {
|
Pub_Close(2);
|
}
|
});
|
|
//监听提交
|
form.verify({
|
numberOrEmpty: function (value, item) {
|
|
// if (value != '') {
|
if (!/^\d+$/.test(value)) {
|
return '不能为空或数字或者0';
|
}
|
//}
|
}
|
});
|
|
|
|
|
//#endregion
|
|
//#region 此页面所有的方法
|
|
//获取组织
|
function Organ() {
|
//获取登录页组织列
|
var Organization = '';
|
$.ajax({
|
type: "get",
|
url: GetWEBURL() + "/Web/GetOrganizations",
|
success: function (result) {
|
if (result.count == 1) { // 说明验证成功了,
|
var data = result.data;
|
for (var i = 0; i < data.length; i++) {
|
Organization += '<option style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>';
|
}
|
$("#HOrgID").append(Organization);
|
$("#HOrgID").val(sessionStorage["OrganizationID"])
|
form.render('select');
|
}
|
layer.closeAll("loading");
|
}
|
})
|
}
|
|
//产品选择页面
|
function get_checkSearchMater() {
|
var HOrgID = $("#HOrgID").val();
|
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: '物料表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../基础资料/公用基础资料/Gy_Material.html?openType=2&HOrgID=' + HOrgID, '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].物料名称);//物料名称
|
$("#HMaterNumber").val(checkStatus.data[0].物料代码);//物料代码
|
$("#HMaterModel").val(checkStatus.data[0].规格型号);//规格型号
|
$("#HUnitID").val(checkStatus.data[0].HUnitID);//计量单位id
|
$("#HUnitName").val(checkStatus.data[0].计量单位名称);//计量单位名称
|
if ($("#HName").val() == "") {
|
$("#HName").val(checkStatus.data[0].物料代码);
|
}
|
|
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: ['../../基础资料/公用基础资料/Gy_Unit.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].计量单位名称);//计量单位名称
|
|
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: ['../../计划管理/工艺路线大类/Gy_RoutingGroupList.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].id);//工艺路线大类id
|
$("#HRoutingGroupIDName").val(checkStatus.data[0].名称);//工艺路线大类名称
|
|
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) {
|
if (rowIndex === '0') {
|
layer.msg('首行无法删除!!!');
|
} else if (table.cache["mainTable"][obj.tr.data('index')].HProcNo == "9999") {
|
layer.msg('系统转工序,不允许删除!!!');
|
} else {
|
var oldData = table.cache["mainTable"];
|
oldData.splice(obj.tr.data('index'), 1)
|
option.data = oldData;//将数据绑定到data上
|
table.render(option);
|
layer.close(index);
|
}
|
});
|
}
|
}
|
|
//获取 转工序 系统参数
|
function get_xt() {
|
$.ajax({
|
type: "get",
|
url: GetWEBURL() + '/LEMS/MES_XT_List',
|
async: false,
|
data: { "sWhere": "" },
|
success: function (result) {
|
if (result.count == 1) { // 说明验证成功了,
|
if (result.data.Gy_RoutingBill_SaveAutoLastProc == "Y") {
|
$("#IsProNo").val("1");
|
$("input[name='checkboxIsProNo']").prop("checked", true);
|
form.render("checkbox");
|
} else {
|
$("#IsProNo").val("0");
|
$("input[name='checkboxIsProNo']").prop("checked", false);
|
}
|
}
|
layer.closeAll("loading");
|
}
|
})
|
}
|
|
//启用默认
|
function set_defaultRoute() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
var HInterID = $("#HInterID").val();
|
|
layer.confirm("确认要启用该工艺路线为物料默认工艺路线吗?", function (index) {
|
var wait = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Gy_RoutingBill/set_defaultRoute',
|
type: "GET",
|
data: { "HInterID": HInterID, "user": sessionStorage["HUserName"], "HBillSubType": "3301" },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { icon: 1 });
|
layer.close(wait);
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
layer.close(wait);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
layer.close(wait);
|
}
|
});
|
})
|
}
|
|
//#region 关闭其它
|
function set_closeOtherRoute() {
|
var hmainid = $("#HInterID").val();
|
var HName = $("#HName").val();
|
var HMaterID = $("#HMaterID").val();
|
if (hmainid != 0 && HMaterID != 0 && HName!="") {
|
layer.open({
|
type: 2
|
, area: ['70%', '70%']
|
, title: '会关闭的单据列表请确认'
|
, closeBtn: 1
|
, shade: 0.6 //遮罩透明度
|
, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: '../../计划管理/工艺路线/Gy_RoutingBillCloseList.html?HMaterID=' + HMaterID + '&HProID=' + 0 + '&HName=' + HName + '&HInterID=' + hmainid
|
, resize: false
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
$.ajax({
|
url: GetWEBURL() + '/Gy_Routing/CloseOther',
|
type: "GET",
|
data: { "HInterID": hmainid, "CurUserName": sessionStorage["HUserName"] },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { icon: 1 });
|
layer.close(index);
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
layer.close(index);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
|
}
|
});
|
//更新表格缓存的数据
|
layer.close(index);//关闭弹窗
|
}
|
, end: function () {
|
////修改为功后刷新界面
|
//if (get_needClose_Bar == 0) {
|
$("#btnSearch").trigger('click');
|
//} else if (get_needClose_Bar == 1) {
|
// $("#get_needClose").trigger('click');
|
//}
|
}
|
, cancel: function () {
|
|
}
|
})
|
} else {
|
layer.msg('信息错误');
|
}
|
}
|
//#endregion
|
|
//#region 发起审批
|
function set_startCheckBill() {
|
var hmainid = $("#HInterID").val();
|
if (hmainid != 0) {
|
//逻辑审核方法
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Gy_Routing/StartCheckFlow", //方法所在页面和方法名
|
data: { "HInterID": hmainid, "CurUserName": sessionStorage["HUserName"] },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
|
|
// 得到frame索引
|
var index = layer.getFrameIndex(window.name);
|
//关闭当前frame
|
layer.close(index);
|
});
|
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
else {
|
layer.msg('请保存后再发起!');
|
}
|
}
|
//#endregion
|
|
//审核
|
function set_CheckBill() {
|
layer.confirm("确认要审核吗?", function (index) {
|
var wait = layer.load();
|
var HInterID = $("#HInterID").val();
|
$.ajax({
|
url: GetWEBURL() + '/Gy_RoutingBill/CheckGy_RoutingBill',
|
type: "GET",
|
data: { "HInterID": HInterID, "Type": 1, "user": sessionStorage["HUserName"], "HBillSubType": "3301"},
|
success: function (result) {
|
if (result.count == 1) {
|
//检查是否具备启用默认工艺路线的权限,存在,则弹窗提问
|
$.ajax({
|
url: GetWEBURL() + '/Gy_RoutingBill/set_defaultRoute_CheckRight',
|
type: "GET",
|
async: false,
|
data: { "user": sessionStorage["HUserName"], "HBillSubType": "3301" },
|
success: function (result1) {
|
if (result1.count == 1) { //拥有权限
|
layer.confirm("确认要启用该工艺路线为物料默认工艺路线吗?", function (index1) {
|
//启用默认工艺路线
|
$.ajax({
|
url: GetWEBURL() + '/Gy_RoutingBill/set_defaultRoute',
|
type: "GET",
|
async: false,
|
data: { "HInterID": HInterID, "user": sessionStorage["HUserName"], "HBillSubType": "3301" },
|
success: function (result2) {
|
if (result2.count == 1) {
|
layer.msg(result2.Message, { icon: 1 });
|
} else {
|
layer.alert(result2.code + result2.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
})
|
layer.close(wait);
|
} else {
|
layer.close(wait);
|
layer.close(index);
|
}
|
}, error: function () {
|
layer.close(wait);
|
layer.close(index);
|
}
|
});
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
layer.close(wait);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
layer.close(wait);
|
}
|
});
|
})
|
}
|
|
//反审核
|
function set_AbandonCheck() {
|
layer.confirm("确认要反审核吗?", function (index) {
|
var HInterID = $("#HInterID").val();
|
var wait = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Gy_RoutingBill/CheckGy_RoutingBill',
|
type: "GET",
|
data: { "HInterID": HInterID, "Type": 2, "user": sessionStorage["HUserName"], "HBillSubType": "3301" },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { icon: 1 });
|
layer.close(wait);
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
layer.close(wait);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
layer.close(wait);
|
}
|
});
|
})
|
}
|
|
//关闭
|
function set_CloseBill() {
|
layer.confirm("确认要关闭吗?", function (index) {
|
var HInterID = $("#HInterID").val();
|
var wait = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Gy_RoutingBill/CloseGy_RoutingBill_1',
|
type: "GET",
|
data: { "HInterID": HInterID, "Type": 1, "user": sessionStorage["HUserName"], "HBillSubType": "" },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { icon: 1 });
|
layer.close(wait);
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
layer.close(wait);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
layer.close(wait);
|
}
|
});
|
})
|
}
|
|
//反关闭
|
function set_CancelCloseBill() {
|
layer.confirm("确认要反关闭吗?", function (index) {
|
var HInterID = $("#HInterID").val();
|
var wait = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Gy_RoutingBill/CloseGy_RoutingBill_1',
|
type: "GET",
|
data: { "HInterID": HInterID, "Type": 1, "user": sessionStorage["HUserName"], "HBillSubType": "" },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { icon: 1 });
|
layer.close(wait);
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
layer.close(wait);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
layer.close(wait);
|
}
|
});
|
})
|
}
|
|
//#region 多级 反审核/审核数据
|
function set_CheckBill_Flow(num) {
|
var InterID = $("#HInterID").val();
|
if (InterID != 0) {
|
//逻辑审核方法
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Gy_Routing/AuditFlow", //方法所在页面和方法名
|
data: { "HInterID": InterID, "IsAudit": num, "CurUserName": sessionStorage["HUserName"], "CurUserID": sessionStorage["Czybm"] },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
|
// 得到frame索引
|
var index = layer.getFrameIndex(window.name);
|
//关闭当前frame
|
layer.close(index);
|
//修改为功后刷新界面
|
$("#btnSearch").trigger('click');
|
});
|
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
else {
|
layer.msg('请选择请选择在审批流的单据审核!');
|
}
|
}
|
//#endregion
|
|
//#region 驳回
|
function set_RejectCheck_Flow() {
|
var InterID = $("#HInterID").val();
|
if (InterID != 0) {
|
//逻辑审核方法
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Gy_Routing/RejectCheckFlow", //方法所在页面和方法名
|
data: { "HInterID": InterID, "CurUserID": sessionStorage["Czybm"] },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
|
// 得到frame索引
|
var index = layer.getFrameIndex(window.name);
|
//关闭当前frame
|
layer.close(index);
|
});
|
//修改为功后刷新界面
|
$("#btnSearch").trigger('click');
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
else {
|
layer.msg('请选择在审批流的单据驳回!');
|
}
|
}
|
//#endregion
|
|
//#region 撤回
|
function set_WithdrawCheck_Flow() {
|
var InterID = $("#HInterID").val();
|
if (InterID != 0) {
|
//逻辑审核方法
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Gy_Routing/WithdrawCheckFlow", //方法所在页面和方法名
|
data: { "HInterID": InterID, "user": sessionStorage["HUserName"] },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
|
// 得到frame索引
|
var index = layer.getFrameIndex(window.name);
|
//关闭当前frame
|
layer.close(index);
|
});
|
//修改为功后刷新界面
|
$("#btnSearch").trigger('click');
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
else {
|
layer.msg('请选择在审批流的单据驳回!');
|
}
|
}
|
//#endregion
|
|
//#region 复制
|
function set_Copy() {
|
$('#btnSave').removeClass("layui-btn-disabled").attr("disabled", false);
|
//制单人
|
$("#HMaker").val(sessionStorage["HUserName"]);
|
$("#hmakers").val(sessionStorage["HUserName"]);
|
$("#hmakedate").val(Format(new Date(), "yyyy-MM-dd"));
|
$("#HBeginDate").val(Format(new Date(), "yyyy-MM-dd"));
|
$("#HEndDate").val(Format(new Date(2100, 12, 31), "yyyy-MM-dd"));
|
//设置hinterid
|
$.ajax({
|
url: GetWEBURL() + "/Web/GetMAXNum",
|
type: "GET",
|
async: false,
|
data: { "HBillType": '3301' },
|
success: function (d) {
|
$("#HInterID").val(d.data[0].HInterID);
|
$("#HBillNo").val(d.data[0].HBillNo);
|
$("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
|
}
|
});
|
OperationType = 2;
|
}
|
//#endregion
|
|
//#region 查看审批进度
|
function set_CheckFlowInfo() {
|
var InterID = $("#HInterID").val();
|
if (InterID != 0) {
|
layer.open({
|
type: 2
|
, area: ['70%', '70%']
|
, title: '单据审批进度'
|
, closeBtn: 1
|
, shade: 0.6 //遮罩透明度
|
, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: '../../系统管理/多级审批/审批进度/Xt_CheckFlowProgressList.html?linterid=' + InterID + '&HSouceBillType=3301'
|
, resize: false,
|
end: function () {
|
////修改为功后刷新界面
|
//if (get_needClose_Bar == 0) {
|
// $("#btnSearch").trigger('click');
|
//} else if (get_needClose_Bar == 1) {
|
// $("#get_needClose").trigger('click');
|
//}
|
}
|
, cancel: function () {
|
|
}
|
})
|
} else {
|
layer.msg('请选择正确数据查看!');
|
}
|
}
|
//#endregion
|
|
//行内删除快捷键
|
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: ["../../基础资料/生产基础资料/Gy_Process.html?Type=HProcess", "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//按钮一 的回调
|
var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
|
|
if (checkStatus.data.length == 0) {
|
return layer.msg("请至少选择一条数据!");
|
}
|
|
//获取工序代码
|
var ProcessNumber = [];
|
for (var i = 0; i < checkStatus.data.length; i++) {
|
ProcessNumber.push("'" + checkStatus.data[i]["工序代码"] + "'");
|
}
|
|
//获取当前位置所在行数
|
var NowNum = 0;
|
for (var i = 0; i < option.data.length; i++) {
|
if (obj.data["HProcNo"] == option.data[i]["HProcNo"]) {
|
NowNum = i + 1;
|
}
|
}
|
|
//查询工作中心的数据
|
var WorkCente = [];
|
var sWhere = "select isnull(a.HItemID,'') HCenterID, isnull(a.HNumber,'') 工作中心代码, isnull(a.HName,'') 工作中心名称 ,p.HItemID HProcID,p.HName 工序名称 from Gy_Process p left join Gy_WorkCenter a on p.HWorkCenterID=a.HItemID where p.HNumber in (" + ProcessNumber.toString() + ") order by p.HNumber ";
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Gy_SOPBillList/WindowPrintList", //方法所在页面和方法名
|
async: false,
|
data: { "sWhere": sWhere },
|
success: function (data) {
|
if (data.count == 1) { // 说明验证成功了,
|
WorkCente = data.data;
|
}
|
else {
|
layer.msg(data.Message, { icon: 5 });
|
}
|
layer.closeAll("loading");
|
},
|
error: function (err) {
|
layer.msg("错误:" + err, { icon: 5 });
|
}
|
});
|
|
//判断选择的数据总数 是否大于表格现有的数据
|
if (ProcessNumber.length > option.data.length - (NowNum - 1)) {
|
//获取表格剩余行数量
|
var num = ProcessNumber.length - option.data.length + (NowNum - 1);
|
//循环赋值 在已有的表格赋值
|
var j = 0;
|
for (var i = (NowNum - 1); i < option.data.length; i++) {
|
option.data[i]["工序"] = WorkCente[j]["工序名称"];
|
option.data[i]["工序代码"] = ProcessNumber[j].substring(1, ProcessNumber[j].length - 1);
|
option.data[i]["HProcID"] = WorkCente[j]["HProcID"];
|
option.data[i]["工作中心"] = WorkCente[j]["工作中心名称"];
|
option.data[i]["HCenterID"] = WorkCente[j]["HCenterID"];
|
option.data[i]["工作中心代码"] = WorkCente[j]["工作中心代码"];
|
option.data[i]["HProcID_S"] = checkStatus.data[j]["HProcMulID"];
|
option.data[i]["工段"] = checkStatus.data[j]["工段名称"];
|
option.data[i]["标准工价"] = checkStatus.data[j]["标准工价"];
|
|
|
j++;
|
}
|
|
//在下方添加新的表格数据
|
for (var i = 0; i < num; i++) {
|
option.data.push({
|
"HProcNo": (table.cache["mainTable"].length + i + 1) * 10, "HProcID_S": 0, "HProcType": "主工序", "HCenterID_S": 0, "HCenterID_SName": "", "工序代码": ProcessNumber[j].substring(1, ProcessNumber[j].length - 1)
|
, "HWorkQty_S": 0, "HSubStdEmpQty_S": 0, "HMouldNo": "", "HChangeMould": 0, "HPackStd": ""
|
, "HPack": "", "HPutArea": "", "HMyWorkDays": 0, "HMyFixWorkDays": 0, "工序": WorkCente[j]["工序名称"]
|
, "HProcID": WorkCente[j]["HProcID"], "工作中心代码": WorkCente[j]["工作中心代码"], "HCenterID": WorkCente[j]["HCenterID"], "工作中心": WorkCente[j]["工作中心名称"], "HSupID": 0
|
, "供应商代码": "", "供应商": "", "HSupFlag": false, "HSortProcFlag": false, "HTimeUnit": "", "HUnitTime": 0
|
, "HWorkQty": 1, "HSNCtrl": false, "HPassRate": 100, "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": "", "HBadWHID": 0, "HBadWHName": "", "HWasterWHID": 0, "HWasterWHName": ""
|
, "HWHID": 0, "HWHName": "", "HRemark": "", "HWorkTimes_S": 0
|
, "HQCSchemeID_Fst": 0, "HQCSchemeNumber_Fst": "", "HQCSchemeName_Fst": ""
|
, "HQCSchemeID_Proc": 0, "HQCSchemeNumber_Proc": "", "HQCSchemeName_Proc": ""
|
, "HQCSchemeID_Patrol": 0, "HQCSchemeNumber_Patrol": "", "HQCSchemeName_Patrol": ""
|
, "HQCFst": false, "HQCProc": false, "HQCPatrol": false, "HMaterToSourceCtrl": false
|
, "HSubStdEmpAvg_S": 0, "标准工价": 0, "HYDCoefficient": 0
|
})
|
j++;
|
}
|
} else {
|
//循环赋值 在已有的表格赋值
|
var j = 0;
|
for (var i = (NowNum - 1); i < (NowNum - 1) + ProcessNumber.length; i++) {
|
option.data[i]["工序"] = WorkCente[j]["工序名称"];
|
option.data[i]["工序代码"] = ProcessNumber[j].substring(1, ProcessNumber[j].length - 1);
|
option.data[i]["HProcID"] = WorkCente[j]["HProcID"];
|
option.data[i]["工作中心"] = WorkCente[j]["工作中心名称"];
|
option.data[i]["HCenterID"] = WorkCente[j]["HCenterID"];
|
option.data[i]["工作中心代码"] = WorkCente[j]["工作中心代码"];
|
option.data[i]["HProcID_S"] = checkStatus.data[j]["HProcMulID"];
|
option.data[i]["工段"] = checkStatus.data[j]["工段名称"];
|
option.data[i]["标准工价"] = checkStatus.data[j]["标准工价"];
|
option.data[i]["HWorkQty"] = option.data[i]["HProcPrice"] != 0 ? (checkStatus.data[j]["标准工价"] / option.data[i]["HProcPrice"]).toFixed(2) : option.data[i]["HWorkQty"];
|
option.data[i]["HYDCoefficient"] = (localStorage["HBenchmarkValue"] / (option.data[i]["HProcPrice"] != 0 ? (checkStatus.data[j]["标准工价"] / option.data[i]["HProcPrice"]).toFixed(2) : option.data[i]["HWorkQty"])).toFixed(6)//约当系数=基准值/小时产能
|
j++;
|
}
|
}
|
table.render(option);
|
//var HCenterID = 0;
|
//var HCenterNUmber = "";
|
//var HCenterName = "";
|
|
|
////更新表格缓存的数据
|
//obj.update({
|
// "工序": checkStatus.data[0].工序名称
|
// , "HProcID": checkStatus.data[0].HItemID
|
// , "工作中心": HCenterName
|
// , "HCenterID": HCenterID
|
// , "工作中心代码": HCenterNUmber
|
//})
|
|
layer.close(index);//关闭弹窗
|
}
|
, end: function () {
|
if (OptionData.length > 0) {
|
//更新表格缓存的数据
|
obj.update({
|
"工序": OptionData[0].工序名称
|
, "工序代码": OptionData[0].工序代码
|
, "HProcID": OptionData[0].HItemID
|
, "工作中心": OptionData[0].工作中心
|
, "HCenterID": OptionData[0].HWorkCenterID
|
, "工作中心代码": OptionData[0].工作中心代码
|
, "HProcID_S": OptionData[0].HProcMulID
|
, "工段": OptionData[0].工段名称
|
, "标准工价": OptionData[0].标准工价
|
, "HWorkQty": obj.data.HProcPrice != 0 ? (OptionData[0].标准工价 / obj.data.HProcPrice).toFixed(2) : obj.data.HWorkQty
|
, "HYDCoefficient": (localStorage["HBenchmarkValue"] / (obj.data.HProcPrice != 0 ? (OptionData[0].标准工价 / obj.data.HProcPrice).toFixed(2) : obj.data.HWorkQty)).toFixed(6)
|
|
})
|
OptionData = [];
|
}
|
}
|
})
|
}
|
//工段
|
if (obj.event == "CheckHProcMulID") {
|
//打开人员表 小窗体
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "工段列表" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["90%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ["../../基础资料/生产基础资料/Gy_ProcMul.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_S": checkStatus.data[0].HItemID
|
})
|
layer.close(index);//关闭弹窗
|
}
|
, end: function () {
|
if (OptionData.length > 0) {
|
//更新表格缓存的数据
|
obj.update({
|
"工段": OptionData[0].工段名称
|
, "HProcID_S": OptionData[0].HItemID
|
})
|
OptionData = [];
|
}
|
}
|
})
|
}
|
//工作中心
|
if (obj.event == "CheckHCenterID") {
|
//打开人员表 小窗体
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "工作中心列表" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["90%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ["../../基础资料/公用基础资料/Gy_WorkCenter.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);//关闭弹窗
|
}
|
, end: function () {
|
if (OptionData.length > 0) {
|
//更新表格缓存的数据
|
obj.update({
|
"工作中心": OptionData[0].工作中心名称
|
, "HCenterID": OptionData[0].HItemID
|
, "工作中心代码": OptionData[0].工作中心代码
|
})
|
OptionData = [];
|
}
|
}
|
})
|
}
|
//供应商
|
if (obj.event == "CheckHSupID") {
|
//打开人员表 小窗体
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "供应商列表" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["90%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ["../../基础资料/采购基础资料/Gy_Supplier.html?type=HSup", "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].供应商名称
|
, "HSupID": checkStatus.data[0].HItemID
|
, "供应商代码": checkStatus.data[0].供应商代码
|
})
|
layer.close(index);//关闭弹窗
|
}
|
, end: function () {
|
if (OptionData.length > 0) {
|
//更新表格缓存的数据
|
obj.update({
|
"供应商": OptionData[0].供应商名称
|
, "HSupID": OptionData[0].HItemID
|
, "供应商代码": OptionData[0].供应商代码
|
})
|
OptionData = [];
|
}
|
}
|
})
|
}
|
//不良品仓
|
if (obj.event == "HBadWHID") {
|
//打开人员表 小窗体
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "仓库列表" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["90%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ["../../基础资料/公用基础资料/Gy_Warehouse.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({
|
"HBadWHID": checkStatus.data[0].HItemID
|
, "HBadWHName": checkStatus.data[0].仓库名称
|
})
|
layer.close(index);//关闭弹窗
|
}
|
})
|
}
|
|
//良品仓
|
if (obj.event == "HWHID") {
|
//打开人员表 小窗体
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "仓库列表" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["90%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ["../../基础资料/公用基础资料/Gy_Warehouse.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({
|
"HWHID": checkStatus.data[0].HItemID
|
, "HWHName": checkStatus.data[0].仓库名称
|
})
|
layer.close(index);//关闭弹窗
|
}
|
})
|
}
|
|
//报废品仓
|
if (obj.event == "HWasterWHID") {
|
//打开人员表 小窗体
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "仓库列表" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["90%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ["../../基础资料/公用基础资料/Gy_Warehouse.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({
|
"HWasterWHID": checkStatus.data[0].HItemID
|
, "HWasterWHName": checkStatus.data[0].仓库名称
|
})
|
layer.close(index);//关闭弹窗
|
}
|
})
|
}
|
//首件检验方案
|
if (obj.event == "HQCSchemeNumber_Fst") {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: '检验方案列表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../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('请选择数据');
|
}
|
obj.update({
|
"HQCSchemeID_Fst": checkStatus.data[0].HItemID
|
, "HQCSchemeNumber_Fst": checkStatus.data[0].检验方案代码
|
, "HQCSchemeName_Fst": checkStatus.data[0].方案名称
|
})
|
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
}
|
//转序检验方案
|
if (obj.event == "HQCSchemeNumber_Proc") {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: '检验方案列表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../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('请选择数据');
|
}
|
obj.update({
|
"HQCSchemeID_Proc": checkStatus.data[0].HItemID
|
, "HQCSchemeNumber_Proc": checkStatus.data[0].检验方案代码
|
, "HQCSchemeName_Proc": checkStatus.data[0].方案名称
|
})
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
}
|
//巡检检验方案
|
if (obj.event == "HQCSchemeNumber_Patrol") {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: '检验方案列表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../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('请选择数据');
|
}
|
obj.update({
|
"HQCSchemeID_Patrol": checkStatus.data[0].HItemID
|
, "HQCSchemeNumber_Patrol": checkStatus.data[0].检验方案代码
|
, "HQCSchemeName_Patrol": checkStatus.data[0].方案名称
|
})
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
}
|
|
obj.event = "";
|
return false;
|
}
|
|
})
|
|
//工序表格下拉搜索框
|
tableSelect.render({
|
elem: 'td[data-field="工序"] .layui-table-edit',
|
searchKey: '工序代码,工序名称',
|
sWhere: " and 明细标记 = 'Y' and 禁用标记 != 'Y'",//table搜索sWhere条件
|
ajaxSelect: function (sWhere) {
|
var data = '';
|
$.ajax({
|
url: GetWEBURL() + '/Gy_Process/list',
|
type: "GET",
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"]},
|
async: false,
|
success: function (data1) {
|
if (data1.count == 1) {
|
data = data1.data
|
}
|
},
|
error: function () {
|
layer.alert('获取列表失败!', { icon: 15, title: '通信错误' });
|
}
|
});
|
return data;
|
},//设置前端分页时可以设置的
|
table: {
|
cols: [[
|
{ type: 'radio', fixed: 'left' },
|
{ field: 'HItemID', title: 'HItemID', hide: true },
|
{ field: '工序代码', title: '工序代码' },
|
{ field: '工序名称', title: '工序名称' },
|
{ field: 'HProcMulID', title: 'HProcMulID', hide: true },
|
{ field: '工段名称', title: '工段名称' }
|
]],
|
page: true,
|
limit: 5,
|
//limits: [5]
|
},
|
done: function (elem, data) {
|
$(".layui-table-edit").blur();//单元格失去焦点
|
//获取工序代码
|
var ProcessNumber = [];
|
for (var i = 0; i < data.data.length; i++) {
|
ProcessNumber.push("'" + data.data[i]["工序代码"] + "'");
|
}
|
|
//获取当前位置所在行数
|
var NowNum = 0;
|
for (var i = 0; i < option.data.length; i++) {
|
if (obj.data["HProcNo"] == option.data[i]["HProcNo"]) {
|
NowNum = i + 1;
|
}
|
}
|
|
//查询工作中心的数据
|
var WorkCente = [];
|
var sWhere = "select isnull(a.HItemID,'') HCenterID, isnull(a.HNumber,'') 工作中心代码, isnull(a.HName,'') 工作中心名称 ,p.HItemID HProcID,p.HName 工序名称,p.HStandardWages 标准工价 from Gy_Process p left join Gy_WorkCenter a on p.HWorkCenterID=a.HItemID where p.HNumber in (" + ProcessNumber.toString() + ") order by p.HNumber ";
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Gy_SOPBillList/WindowPrintList", //方法所在页面和方法名
|
async: false,
|
data: { "sWhere": sWhere },
|
success: function (data) {
|
if (data.count == 1) { // 说明验证成功了,
|
WorkCente = data.data;
|
}
|
else {
|
layer.msg(data.Message, { icon: 5 });
|
}
|
layer.closeAll("loading");
|
},
|
error: function (err) {
|
layer.msg("错误:" + err, { icon: 5 });
|
}
|
});
|
|
//判断选择的数据总数 是否大于表格现有的数据
|
if (ProcessNumber.length > option.data.length - (NowNum - 1)) {
|
//获取表格剩余行数量
|
var num = ProcessNumber.length - option.data.length + (NowNum - 1);
|
//循环赋值 在已有的表格赋值
|
var j = 0;
|
for (var i = (NowNum - 1); i < option.data.length; i++) {
|
option.data[i]["工序"] = WorkCente[j]["工序名称"];
|
option.data[i]["工序代码"] = ProcessNumber[j].substring(1, ProcessNumber[j].length - 1);
|
option.data[i]["HProcID"] = WorkCente[j]["HProcID"];
|
option.data[i]["工作中心"] = WorkCente[j]["工作中心名称"];
|
option.data[i]["HCenterID"] = WorkCente[j]["HCenterID"];
|
option.data[i]["工作中心代码"] = WorkCente[j]["工作中心代码"];
|
option.data[i]["HProcID_S"] = data.data[j]["HProcMulID"];
|
option.data[i]["工段"] = data.data[j]["工段名称"];
|
option.data[i]["标准工价"] = WorkCente[j]["标准工价"];
|
option.data[i]["HYDCoefficient"] = (localStorage["HBenchmarkValue"] / option.data[i]["HWorkQty"]).toFixed(6);
|
|
j++;
|
}
|
|
//在下方添加新的表格数据
|
for (var i = 0; i < num; i++) {
|
option.data.push({
|
"HProcNo": (table.cache["mainTable"].length + i + 1) * 10, "HProcID_S": 0, "HProcType": "主工序", "HCenterID_S": 0, "HCenterID_SName": "", "工序代码": ProcessNumber[j].substring(1, ProcessNumber[j].length - 1)
|
, "HWorkQty_S": 0, "HSubStdEmpQty_S": 0, "HMouldNo": "", "HChangeMould": 0, "HPackStd": ""
|
, "HPack": "", "HPutArea": "", "HMyWorkDays": 0, "HMyFixWorkDays": 0, "工序": WorkCente[j]["工序名称"]
|
, "HProcID": WorkCente[j]["HProcID"], "工作中心代码": WorkCente[j]["工作中心代码"], "HCenterID": WorkCente[j]["HCenterID"], "工作中心": WorkCente[j]["工作中心名称"], "HSupID": 0
|
, "供应商代码": "", "供应商": "", "HSupFlag": false, "HSortProcFlag": false, "HTimeUnit": "", "HUnitTime": 0
|
, "HWorkQty": 1, "HSNCtrl": false, "HPassRate": 100, "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": "", "HBadWHID": 0, "HBadWHName": "", "HWasterWHID": 0, "HWasterWHName": ""
|
, "HWHID": 0, "HWHName": "", "HRemark": "", "HWorkTimes_S": 0
|
, "HQCSchemeID_Fst": 0, "HQCSchemeNumber_Fst": "", "HQCSchemeName_Fst": ""
|
, "HQCSchemeID_Proc": 0, "HQCSchemeNumber_Proc": "", "HQCSchemeName_Proc": ""
|
, "HQCSchemeID_Patrol": 0, "HQCSchemeNumber_Patrol": "", "HQCSchemeName_Patrol": ""
|
, "HQCFst": false, "HQCProc": false, "HQCPatrol": false, "HMaterToSourceCtrl": false
|
, "HSubStdEmpAvg_S": 0, "标准工价": 0, "HYDCoefficient": 0
|
})
|
j++;
|
}
|
} else {
|
//循环赋值 在已有的表格赋值
|
var j = 0;
|
for (var i = (NowNum - 1); i < (NowNum - 1) + ProcessNumber.length; i++) {
|
option.data[i]["工序"] = WorkCente[j]["工序名称"];
|
option.data[i]["工序代码"] = ProcessNumber[j].substring(1, ProcessNumber[j].length - 1);
|
option.data[i]["HProcID"] = WorkCente[j]["HProcID"];
|
option.data[i]["工作中心"] = WorkCente[j]["工作中心名称"];
|
option.data[i]["HCenterID"] = WorkCente[j]["HCenterID"];
|
option.data[i]["工作中心代码"] = WorkCente[j]["工作中心代码"];
|
option.data[i]["HProcID_S"] = data.data[j]["HProcMulID"];
|
option.data[i]["工段"] = data.data[j]["工段名称"];
|
option.data[i]["标准工价"] = WorkCente[j]["标准工价"];
|
option.data[i]["HYDCoefficient"] = (localStorage["HBenchmarkValue"] / option.data[i]["HWorkQty"]).toFixed(6);
|
j++;
|
}
|
}
|
table.render(option);
|
|
|
|
//setTableByHMater(obj, data);
|
}
|
})
|
|
|
}
|
|
//编辑 页面赋值
|
function RoadBillMain(linterid)//加载表头
|
{
|
|
$.ajax({
|
url: GetWEBURL() + "/Gy_RoutingBill/cx",
|
type: "GET",
|
async: false,
|
data: { "HInterID": linterid },
|
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);
|
}
|
else {
|
$("input[name='checkboxHStandard']").prop("checked", false);
|
}
|
//主表
|
form.val("formData", { //formTest 即 class="layui-form" 所在元素属性 lay-filter="" 对应的值
|
"HBillNo": OperationType == 2 ? "" : d.data[0].单据号
|
, "HInterID": OperationType == 2 ? 0 : d.data[0].hmainid
|
, "HDate": Format(new Date(d.data[0].日期), "yyyy-MM-dd")
|
, "HBeginDate": Format(new Date(d.data[0].生效时间), "yyyy-MM-dd")
|
, "HEndDate": Format(new Date(d.data[0].失效时间), "yyyy-MM-dd")
|
, "HName": OperationType == 2 ? "" : d.data[0].工艺名称
|
, "HMaterNumber": OperationType == 2 ? "" : d.data[0].物料代码
|
, "HMaterName": OperationType == 2 ? "" : d.data[0].物料名称
|
, "HMaterID": OperationType == 2 ? "" : 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": OperationType == 2 ? 0 : d.data[0].规格型号
|
, "HPicNumVer": d.data[0].图号版本
|
, "HPicNumAssemble": d.data[0].总装图号
|
, "HMaterTexture": d.data[0].材质
|
, "HProductNum": d.data[0].成品编号
|
, "HVerNum": d.data[0].版本
|
, "HOrgID": d.data[0].HOrgID
|
, "HProcPriceType": d.data[0].HProcPriceType == null ? "临时定额" : d.data[0].HProcPriceType
|
//其他信息
|
, "hmakers": d.data[0].制单人
|
, "hmakedate": d.data[0].制单日期 == null ? "" : Format(new Date(d.data[0].制单日期), "yyyy-MM-dd")
|
, "hchecker": d.data[0].审核人
|
, "hcheckdate": d.data[0].审核日期 == null ? "" : Format(new Date(d.data[0].审核日期), "yyyy-MM-dd")
|
, "hupdater": d.data[0].修改人
|
, "hupdatedate": d.data[0].修改日期 == null ? "" : Format(new Date(d.data[0].修改日期), "yyyy-MM-dd")
|
, "hdeleteman": d.data[0].作废人
|
, "hdeletedate": d.data[0].作废日期 == null ? "" : Format(new Date(d.data[0].作废日期), "yyyy-MM-dd")
|
, "hcloser": d.data[0].关闭人
|
, "hclosedate": d.data[0].关闭日期 == null ? "" : Format(new Date(d.data[0].关闭日期), "yyyy-MM-dd")
|
});
|
|
//子表 赋值
|
var rowdata = [];
|
console.log(d.data)
|
for (var i = 0; i < d.data.length; i++) {
|
rowdata.push(
|
{
|
"HProcNo": d.data[i].工序号, "HProcID_S": d.data[i].工段, "HProcType": d.data[i].工序类型, "HCenterID_S": d.data[i].HCenterID_S, "HCenterID_SName": d.data[i].产线中心, "工序代码": d.data[i].工序代码
|
, "HWorkQty_S": d.data[i].产线产能, "HSubStdEmpQty_S": d.data[i].产线人数, "HMouldNo": d.data[i].模具编号, "HChangeMould": d.data[i].换模时间, "HPackStd": d.data[i].周转箱标准
|
, "HPack": d.data[i].周转箱, "HPutArea": d.data[i].暂放区, "HMyWorkDays": d.data[i].生产周期, "HMyFixWorkDays": d.data[i].固定生产天数, "工序": d.data[i].工序, "工段": d.data[i].工段名称
|
, "HProcID": d.data[i].HProcID, "工作中心代码": d.data[i].工作中心代码, "HCenterID": d.data[i].HCenterID, "工作中心": d.data[i].工作中心名称, "HSupID": d.data[i].HSupID
|
, "供应商代码": d.data[i].供应商代码, "供应商": d.data[i].供应商, "HSupFlag": d.data[i].委外标记 == 0 ? false : true, "HSortProcFlag": d.data[i].排产工序标记 == 0 ? false : true, "HTimeUnit": d.data[i].时间单位, "HUnitTime": d.data[i].运行时间
|
, "HWorkQty": d.data[i].加工数量, "HSNCtrl": d.data[i].SN过站控制 == 0 ? false : true, "HPassRate": d.data[i].良率, "HOverRate": d.data[i].超额比例, "HReadyTime": d.data[i].准备时间, "HQueueTime": d.data[i].排队时间
|
, "HMoveTime": d.data[i].转移时间, "HNextProcFlag": d.data[i].HNextProcFlag == 0 ? false : true, "HFlowProc": d.data[i].流转工序 == 0 ? false : true, "HSubStdEmpQty": d.data[i].标准人数, "HSubCanUseSourceQty": d.data[i].可操作设备数
|
, "HFixPrice": d.data[i].班产定额, "HProcPrice": d.data[i].加工单价, "HBadPrice": d.data[i].不合格单价, "HWasterPrice": d.data[i].报废单价, "HStdFlag": d.data[i].标准定额
|
, "HBeginDayQty": d.data[i].开工余量天数, "HBeginFixQty": d.data[i].开工余量固数, "HFixWorkDays": d.data[i].上道固定天数, "HTrunWorkDays": d.data[i].上道循环周期, "HReadyTimes": d.data[i].本道准备时间
|
, "HICMOReadyTimes": d.data[i].换单准备时间, "HAutoTrunFlag": d.data[i].自动移转, "HTechnologyParameter": d.data[i].工艺参数, "HPicNum": d.data[i].图纸编号, "HProcCheckNote": d.data[i].本工序确认记录
|
, "HProcWorkNum": d.data[i].程序号, "HBadWHID": d.data[i].HBadWHID, "HBadWHName": d.data[i].HBadWHName, "HWasterWHID": d.data[i].HWasterWHID, "HWasterWHName": d.data[i].HWasterWHName
|
, "HWHID": d.data[i].HWHID, "HWHName": d.data[i].HWHName, "HRemark": d.data[i].表体备注, "HWorkTimes_S": d.data[i].产品单件工时
|
, "HQCSchemeID_Fst": d.data[i].HQCSchemeID_Fst, "HQCSchemeNumber_Fst": d.data[i].首件检验方案代码, "HQCSchemeName_Fst": d.data[i].首件检验方案
|
, "HQCSchemeID_Proc": d.data[i].HQCSchemeID_Proc, "HQCSchemeNumber_Proc": d.data[i].转序检验方案代码, "HQCSchemeName_Proc": d.data[i].转序检验方案
|
, "HQCSchemeID_Patrol": d.data[i].HQCSchemeID_Patrol, "HQCSchemeNumber_Patrol": d.data[i].巡检检验方案代码, "HQCSchemeName_Patrol": d.data[i].巡检检验方案
|
, "HQCFst": d.data[i].HQCFst == 1 ? true : false, "HQCProc": d.data[i].HQCProc == 1 ? true : false, "HQCPatrol": d.data[i].HQCPatrol == 1 ? true : false, "HMaterToSourceCtrl": d.data[i].HMaterToSourceCtrl == 1 ? true : false
|
, "HSubStdEmpAvg_S": d.data[i].人均产能, "标准工价": d.data[i].标准工价, "HYDCoefficient": d.data[i].约当系数
|
}
|
)
|
}
|
option.data = rowdata;
|
table.render(option);
|
|
for (var i = 0; i < d.data.length; i++) {
|
if (d.data[i].委外标记) {
|
$('#HSupFlag' + (i + 1)).attr("checked", true);
|
}
|
if (d.data[i].SN过站控制) {
|
$('#HSNCtrl' + (i + 1)).attr("checked", true);
|
}
|
if (d.data[i].HQCFst) {
|
$('#HQCFst' + (i + 1)).attr("checked", true);
|
}
|
if (d.data[i].HQCProc) {
|
$('#HQCProc' + (i + 1)).attr("checked", true);
|
}
|
if (d.data[i].HQCPatrol) {
|
$('#HQCPatrol' + (i + 1)).attr("checked", true);
|
}
|
if (d.data[i].HMaterToSourceCtrl) {
|
$('#HMaterToSourceCtrl' + (i + 1)).attr("checked", true);
|
}
|
if (d.data[i].排产工序标记) {
|
$('#HSortProcFlag' + (i + 1)).attr("checked", true);
|
}
|
if (d.data[i].HNextProcFlag) {
|
$('#HNextProcFlag' + (i + 1)).attr("checked", true);
|
}
|
if (d.data[i].流转工序) {
|
$('#HFlowProc' + (i + 1)).attr("checked", true);
|
}
|
if (d.data[i].标准定额) {
|
$('#HStdFlag' + (i + 1)).attr("checked", true);
|
}
|
if (d.data[i].自动移转) {
|
$('#HAutoTrunFlag' + (i + 1)).attr("checked", true);
|
}
|
$('#HProcType' + (i + 1)).find("option[value='" + d.data[i].工序类型 + "']").attr("selected", true);
|
}
|
form.render('checkbox');
|
form.render('select');
|
}
|
})
|
}
|
|
//保存HMaker
|
function set_AddNew(data) {
|
|
data.field.HMaterModel = data.field.HMaterModel.replace("\"", "”").replace(";", ";");
|
data.field.HMaterName = data.field.HMaterName.replace("\"", "”").replace(";", ";");
|
|
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;
|
|
//加工数量=产线人数 * 产线人均产能
|
if (table.cache["mainTable"][i].HSubStdEmpQty_S != 0 && table.cache["mainTable"][i].HSubStdEmpQty_S != "" && table.cache["mainTable"][i].HSubStdEmpAvg_S != 0 && table.cache["mainTable"][i].HSubStdEmpAvg_S != "") {
|
|
table.cache["mainTable"][i].HWorkQty = Number((table.cache["mainTable"][i].HSubStdEmpQty_S * table.cache["mainTable"][i].HSubStdEmpAvg_S).toFixed(2))
|
|
}
|
|
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 + ';' + OperationType + ";" + sessionStorage["HUserName"] + ";" + HBillSubType;
|
|
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) {
|
$('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);
|
$('#set_closeOtherRoute').prop('disabled', false).removeClass('layui-btn-disabled');
|
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 ($("#HBillNo").val() == "") {
|
layer.msg("单据号不能为空!");
|
return false;
|
}
|
|
if ($("#HName").val() == "") {
|
layer.msg("工艺路线名称不能为空!");
|
return false;
|
}
|
if ($("#HMaterNumber").val() == "") {
|
layer.msg("产品代码没有选择!");
|
return false;
|
}
|
if ($("#HMaterName").val() == "") {
|
layer.msg("产品名称不能为空!");
|
return false;
|
}
|
if ($("#HMaterModel").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;
|
//}
|
var pc = 0;
|
var num = [];
|
for (var i = 0; i < option.data.length; i++) {
|
|
if (option.data[i] != "") {
|
//流水号
|
if ($.inArray(option.data[i]["HProcNo"], num) == -1) {
|
num.push(option.data[i]["HProcNo"]);
|
} else {
|
layer.msg("第" + (i + 1) + "行,流水号:" + option.data[i]["HProcNo"] + "重复!");
|
return false;
|
}
|
//流水号不为空
|
if (option.data[i]["HProcNo"] == "") {
|
layer.msg("第" + (i + 1) + "行:流水号不能为空!");
|
return false;
|
}
|
//工序不为空
|
if (option.data[i]["HProcID"] == "0") {
|
layer.msg("第" + (i + 1) + "行:工序不能为空!");
|
return false;
|
}
|
//外协标记
|
if (option.data[i]["HSupFlag"]) {
|
if (option.data[i]["HSupID"] == "0") {
|
layer.msg("第" + (i + 1) + "行:供应商不能为空!");
|
return false;
|
}
|
}
|
|
//排产工序标记
|
if (option.data[i]["HSortProcFlag"]) {
|
pc += 1;
|
}
|
|
//if (pc > 1) {
|
// layer.msg("排产工序标记只能选择一个,请重新选择!");
|
// return false;
|
//}
|
|
//else {
|
// if (option.data[i]["HCenterID"] == "0") {
|
// layer.msg("第" + (i + 1) + "行:工作中心不能为空!");
|
// return false;
|
// }
|
//}
|
|
//良率 大于0 小于等于100
|
if (parseInt(option.data[i]["HPassRate"]) <= 0) {
|
layer.msg("第" + (i + 1) + "行:良率必须大于0!");
|
return false;
|
}
|
if (parseInt(option.data[i]["HPassRate"]) > 100) {
|
layer.msg("第" + (i + 1) + "行:良率必须小于等于100!");
|
return false;
|
}
|
|
|
//仓库重复
|
if (option.data[i]["HBadWHID"] != 0 && option.data[i]["HWasterWHID"] != 0) {
|
|
if (option.data[i]["HBadWHID"] == option.data[i]["HWasterWHID"]) {
|
layer.msg("第" + (i + 1) + "行:不良品仓和报废品仓重复!");
|
return false;
|
}
|
}
|
if (option.data[i]["HBadWHID"] != 0 && option.data[i]["HWHID"] != 0) {
|
if (option.data[i]["HBadWHID"] == option.data[i]["HWHID"]) {
|
layer.msg("第" + (i + 1) + "行:不良品仓和良品仓重复!");
|
return false;
|
}
|
}
|
if (option.data[i]["HWasterWHID"] != 0 && option.data[i]["HWHID"] != 0) {
|
if (option.data[i]["HWasterWHID"] == option.data[i]["HWHID"]) {
|
layer.msg("第" + (i + 1) + "行:报废品仓和良品仓重复!");
|
return false;
|
}
|
}
|
}
|
}
|
return true;
|
}
|
|
//隐藏列设置
|
function get_HideColumn() {
|
var colName = "";
|
var contentUrl = "";
|
for (var i = 1; i < option.cols[0].length - 1; i++) {
|
colName += option.cols[0][i]["field"] + ",";
|
}
|
var urlStr = window.document.location.pathname;//获取文件路径
|
var urlLen = urlStr.split('/');
|
for (var i = 0; i < urlLen.length - 4; i++) {
|
contentUrl += "../";
|
}
|
colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI 进行编码
|
|
contentUrl += '基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName;
|
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "隐藏列设置" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["50%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: [contentUrl, "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//刷新表格数据
|
DisPlay_HideColumn();
|
//更新表格缓存的数据
|
layer.close(index);//关闭弹窗
|
}
|
})
|
}
|
|
//上一行
|
function btn_up(data) {
|
if (data.length != 1) {
|
layer.msg("请选择一行数据!");
|
} else if (option.data[0]["HProcNo"] == data[0]["HProcNo"]) {
|
layer.msg("首行数据无法移动!");
|
} else {
|
var tables = [];
|
for (var i = 0; i < option.data.length; i++) {
|
if (option.data[i]["HProcNo"] == data[0]["HProcNo"]) {
|
tables.push(option.data[i - 1]);
|
data[0].LAY_CHECKED = true;
|
option.data[i - 1] = data[0];
|
option.data[i] = tables[0];
|
table.render(option);
|
break;
|
}
|
}
|
}
|
}
|
|
//下一行
|
function btn_under(data) {
|
if (data.length != 1) {
|
layer.msg("请选择一行数据!");
|
} else if (option.data[option.data.length - 1]["HProcNo"] == data[0]["HProcNo"]) {
|
layer.msg("末行数据无法移动!");
|
} else {
|
var tables = [];
|
for (var i = 0; i < option.data.length; i++) {
|
if (option.data[i]["HProcNo"] == data[0]["HProcNo"]) {
|
tables.push(option.data[i + 1]);
|
data[0].LAY_CHECKED = true;
|
option.data[i + 1] = data[0];
|
option.data[i] = tables[0];
|
table.render(option);
|
break;
|
}
|
}
|
}
|
}
|
|
//刷新流水号
|
function btn_Refresh(data) {
|
for (var i = 0; i < option.data.length; i++) {
|
if (option.data[i]["HProcNo"] != 9999) {
|
option.data[i]["HProcNo"] = (i + 1) * 10;
|
}
|
}
|
table.render(option);
|
}
|
|
//显示列数据
|
function DisPlay_HideColumn() {
|
$.ajax({
|
url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
|
type: "GET",
|
data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
|
async: false,
|
success: function (data1) {
|
if (data1.data.length != 0) {
|
var dataCol = [];//数据库查询出的列数据
|
var titleData = ["程序号", "本工序确认记录", "自动移转", "换单准备时间", "本道准备时间", "上道循环周期", "上道固定天数", "开工余量(固数)", "开工余量(天数)", "标准定额", "报废单价", "不合格单价", "工序工价", "班产定额", "可操作设备数", "标准人数", "流转工序", "下道流转工序", "固定生产天数", "生产周期", "暂放区", "周转箱", "周转箱标准", "换模时间", "转移时间", "排队时间", "准备时间", "产线人数", "产线产能", "产线中心", "良率", "加工数量", "运行时间", "时间单位", "图纸编号", "模具编号", "良品仓", "报废品仓", "不良品仓", "工序类型"];//不需要显示的字段 可扩展
|
|
dataCol = data1.data[0].HGridString.split(',');
|
|
for (var i = 0; i < option.cols[0].length - 2; i++) {
|
if (i >= dataCol.length) {
|
continue;
|
}
|
if (dataCol[i]) {
|
var dataCols = dataCol[i].split('|');
|
}
|
|
//隐藏列
|
if (dataCols[1] == 1) {
|
option.cols[0][i + 1]["hide"] = true;
|
}
|
//设置列宽
|
if (dataCols[3] > 0) {
|
option.cols[0][i + 1]["width"] = dataCols[3];
|
}
|
//设置内容字体大小
|
if (data1.data[0].HFontSize != 0) {
|
option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
|
} else {
|
option.cols[0][i + 1]["style"] = "font-size:100%";
|
}
|
//统计列
|
if (dataCols[6] == 1) {
|
option.cols[0][i + 1]["totalRow"] = true;
|
}
|
//设置列宽
|
//if (data1.data[0].HColumnWidth != 0) {
|
// option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;";
|
//} else {
|
// option.cols[0][i + 1]["width"] = "";
|
//}
|
//显示列
|
if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
|
option.cols[0][i + 1]["hide"] = false;
|
}
|
//字体所在位置(左 居中 右)
|
switch (dataCols[2]) {
|
case "L":
|
option.cols[0][i + 1]["align"] = "left";
|
break;
|
case "M":
|
option.cols[0][i + 1]["align"] = "center";
|
break;
|
case "R":
|
option.cols[0][i + 1]["align"] = "right";
|
break;
|
}
|
//设置表格title属性显示别名
|
if (dataCols[4] != null && dataCols[4] != "") {
|
option.cols[0][i + 1]["title"] = dataCols[4];
|
}
|
}
|
|
//取消冻结列
|
for (var i = 1; i < option.cols[0].length - 1; i++) {
|
if (option.cols[0][i]["fixed"] != null) {
|
option.cols[0][i]["fixed"] = null;
|
}
|
else {
|
break;
|
}
|
}
|
//冻结列
|
if (data1.data[0].HFixCols != 0) {
|
for (var i = 0; i < data1.data[0].HFixCols; i++) {
|
if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
|
data1.data[0].HFixCols += 1;
|
}
|
option.cols[0][i + 1]["fixed"] = "left";
|
}
|
}
|
table.render(option);
|
} else {
|
table.render(option);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
})
|
}
|
//#endregion
|
//将url参数中的中文乱码重新转换成中文
|
function getParams(key) {
|
var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
|
//如果地址栏中出现中文则进行编码
|
var r = encodeURI(window.location.search).substr(1).match(reg);
|
if (r != null) {
|
//将中文编码的字符重新变成中文
|
return decodeURI(unescape(r[2]));
|
}
|
return null;
|
};
|
|
});
|
|
//物料
|
function GetMaterValue(obj) {
|
//获取数据
|
$("#HMaterID").val(obj[0].HItemID);//物料id
|
$("#HMaterName").val(obj[0].物料名称);//物料名称
|
$("#HMaterNumber").val(obj[0].物料代码);//物料代码
|
$("#HMaterModel").val(obj[0].规格型号);//规格型号
|
$("#HUnitID").val(obj[0].HUnitID);//计量单位id
|
$("#HUnitName").val(obj[0].计量单位名称);//计量单位名称
|
if ($("#HName").val() == "") {
|
$("#HName").val(obj[0].物料代码);
|
}
|
}
|
|
//计量单位
|
function GetUnitValue(obj) {
|
$("#HUnitID").val(obj[0].HItemID);//计量单位id
|
$("#HUnitName").val(obj[0].计量单位名称);//计量单位名称
|
}
|
|
//工序
|
function GetProcessValue(obj) {
|
OptionData = obj;
|
}
|
|
//工作中心
|
function GetWorkCenterValue(obj) {
|
OptionData = obj;
|
}
|
|
//供应商
|
function GetHSupNameValue(obj) {
|
OptionData = obj;
|
}
|
//供应商
|
function GetGyProcMulValue(obj) {
|
OptionData = obj;
|
}
|
</script>
|
</body>
|
</html>
|