yxj
2023-12-05 99b89dc7a4ce7d7d499de69e8909d241faeaeb4e
WebTM/views/¼Æ»®¹ÜÀí/¹¤ÒÕ·Ïß/Gy_RoutingBill.html
@@ -52,13 +52,17 @@
        <div class="layui-card" style="padding: 2px;background-color: #efefef;">
            <div class="layui-card-body" style="padding: 1px;">
                <form class="layui-form" action="" lay-filter="formData" style="background-color:white;">
                    <div style="padding: 10px; ">
                    <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_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>
                    </div>
                    <div class="layui-tab" lay-filter="tab-POStockInBill">
                        <ul class="layui-tab-title" lay-filter="tab-all">
@@ -71,7 +75,7 @@
                                <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>
                                            <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">
@@ -79,27 +83,22 @@
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">日期</label>
                                            <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: 85px;">工艺路线名称</label>
                                            <label class="layui-form-label" style="width: 85px;">工艺路线名称<label style="color:red"> * </label></label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" lay-verify="HName" name="HName" id="HName">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">图号版本</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" lay-verify="HPicNumVer" name="HPicNumVer" id="HPicNumVer">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">产品代码</label>
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">产品代码*</label>
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="text" class="layui-input" lay-verify="HMaterNumber" name="HMaterNumber" id="HMaterNumber" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchMater" id="btnSearchMater" style="padding: 0 10px;float: right;margin-right: 3px;">
@@ -108,28 +107,23 @@
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 75px;">产品名称</label>
                                            <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>
                                            <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" readonly>
                                                <input type="text" class="layui-input" name="HMaterModel" id="HMaterModel" onmouseover="this.title=this.value" 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="HPicNumAssemble" id="HPicNumAssemble" onmouseover="this.title=this.value">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">计量单位</label>
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">计量单位*</label>
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="text" class="layui-input" name="HUnitName" lay-verify="HUnitName" id="HUnitName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <input type="hidden" name="HUnitID" id="HUnitID" lay-verify="HUnitID" value="0">
@@ -139,43 +133,26 @@
                                            </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">时间单位</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>
                                                </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 class="layui-input-block" style="margin-left: 96px;">
                                                <input type="checkbox" name="checkboxHStandard" id="checkboxHStandard" lay-skin="primary" lay-filter="checkboxHStandard" checked title="是否默认工艺">
                                                <input type="hidden" value="true" name="HStandard" id="HStandard" lay-verify="HStandard">
                                                <!--<input type="checkbox" name="checkboxHUseFlag" id="checkboxHUseFlag" title="是否启用" lay-skin="primary" lay-filter="checkboxHUseFlag">
        <input type="hidden" value="false" name="HUseFlag" id="HUseFlag">-->
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                        <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="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>
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                        <!--<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>
@@ -194,68 +171,51 @@
                                                    <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>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">加工数量</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMainWorkQty" lay-verify="HMainWorkQty" id="HMainWorkQty" value="0" onmouseover="this.title=this.value">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">运行时间</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMainUnitTime" lay-verify="HMainUnitTime" id="HMainUnitTime" value="0">
                                                <!--<input type="hidden" value="小时" name="HMainTimeUnit" id="HMainTimeUnit">-->
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">工价</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMainPrice" id="HMainPrice" lay-verify="HMainPrice" value="0">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 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">
            <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 class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">组织</label>
                                            <div class="layui-input-block" style="margin-left: 120px; width: 185px;">
                                                <select name="HOrgID" id="HOrgID" lay-verify="HOrgID">
                                                    <!--动态渲染组织-->
                                                </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="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">
@@ -265,21 +225,19 @@
                                                <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">
                                            <div class="layui-input-block" style="margin-left: 96px;">
                                                <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">
                                            <div class="layui-input-block" style="margin-left: 185px;">
                                                <input type="checkbox" name="checkboxIsProNo" id="checkboxIsProNo" lay-skin="primary" lay-filter="checkboxIsProNo"  title="转工序" checked>
                                                <input type="hidden" value="1" name="IsProNo" id="IsProNo" lay-verify="IsProNo" >
                                            </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>
@@ -366,6 +324,68 @@
                                            </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="转工序">
                                                <input type="hidden" value="1" name="IsProNo" id="IsProNo" lay-verify="IsProNo">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
@@ -377,6 +397,9 @@
                            <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>
@@ -455,19 +478,23 @@
            //初始表格数据
            var rowdata = [{
                "HProcNo": "", "HProcID_S": 0, "HProcType": "主工序", "HCenterID_S": 0, "HCenterID_SName": ""
                "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, "HTimeUnit": "", "HUnitTime": 0
                , "HWorkQty": 1, "HPassRate": 0, "HOverRate": 0, "HReadyTime": 0, "HQueueTime": 0
                , "HWorkQty": 1, "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": ""
                , "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": ""
            }];
            var HModName = "Sc_MouldDotCheckBillList";
            var HModName = "Gy_RoutingBill";
            //#endregion
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
@@ -476,62 +503,82 @@
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
                , limit: 500 //每页默认显示的数量
                , cellMinWidth: 120
                //, cellMinWidth: 120
                , height: 400
                , cols: [[ //表头
                    { type: 'checkbox', totalRowText: '合计行' }
                    , { type: 'numbers', title: '序号', totalRow: true }
                    , { field: 'HProcNo', title: '流水号', edit: 'text' }
                    , { field: 'HProcID_S', title: '工段', edit: 'text' }
                    , { field: 'HProcType', title: '工序类型', templet: '#HProcType' }//选择
                    , { field: 'HCenterID_SName', title: '产线中心', edit: 'text', event: "CheckHCenterID_S" }//f7
                    , { field: 'HCenterID_S', title: '产线中心id', hide: true }//hide: true
                    , { field: 'HWorkQty_S', title: '产线产能', edit: 'text' }
                    , { field: 'HSubStdEmpQty_S', title: '产线人数', edit: 'text' }
                    , { field: 'HMouldNo', title: '模具编号', edit: 'text' }
                    , { field: 'HChangeMould', title: '换模时间', edit: 'text' }
                    , { field: 'HPackStd', title: '周转箱标准', edit: 'text' }
                    , { field: 'HPack', title: '周转箱', edit: 'text' }
                    , { field: 'HPutArea', title: '暂放区', edit: 'text' }
                    , { field: 'HMyWorkDays', title: '生产周期', edit: 'text' }
                    , { field: 'HMyFixWorkDays', title: '固定生产天数', edit: 'text' }
                      // , { field: 'HProcID', title: '工序ID', hide: true }//, hide: true
                    , { field: '工序', title: '工序', edit: 'text', event: "CheckHProcID" }//f7
                    , { field: 'HProcID', title: '工序ID', hide: true }//, hide: true
                    , { field: '工作中心代码', title: '工作中心代码' }//不填
                    , { field: 'HCenterID', title: '工作中心id', hide: true }//, hide: true
                    , { field: '工作中心', title: '工作中心', edit: 'text', event: "CheckHCenterID" }//f7
                    , { field: 'HSupID', title: '供应商ID', hide: true }
                    , { field: '供应商代码', title: '供应商代码' }
                    , { field: '供应商', title: '供应商', edit: 'text', width: 110, event: "CheckHSupID" }//f7
                    , { field: 'HSupFlag', title: '外协标记', templet: "#HSupFlag" }//checkbox
                    , { field: 'HTimeUnit', title: '时间单位', edit: 'text' }
                    , { field: 'HUnitTime', title: '运行时间', edit: 'text' }
                    , { field: 'HWorkQty', title: '加工数量', edit: 'text' }//默认
                    , { field: 'HPassRate', title: '良率', edit: 'text' }//默认
                    , { field: 'HOverRate', title: '超额比例', edit: 'text' }
                    , { field: 'HReadyTime', title: '准备时间', edit: 'text' }
                    , { field: 'HQueueTime', title: '排队时间', edit: 'text' }
                    , { field: 'HMoveTime', title: '转移时间', edit: 'text' }
                    , { field: 'HNextProcFlag', title: '下道流转工序', templet: "#HNextProcFlag" }//chenbox
                    , { field: 'HFlowProc', title: '流转工序', templet: "#HFlowProc" }//chenbox
                    , { field: 'HSubStdEmpQty', title: '标准人数', edit: 'text' }
                    , { field: 'HSubCanUseSourceQty', title: '可操作设备数', edit: 'text' }
                    , { field: 'HFixPrice', title: '班产定额', edit: 'text' }//默认
                    , { field: 'HProcPrice', title: '工序工价', edit: 'text' }//默认
                    , { field: 'HBadPrice', title: '不合格单价', edit: 'text' }//默认
                    , { field: 'HWasterPrice', title: '报废单价', edit: 'text' }//默认
                    , { field: 'HStdFlag', title: '标准定额', templet: "#HStdFlag" }//chenbox
                    , { field: 'HBeginDayQty', title: '开工余量(天数)', edit: 'text' }
                    , { field: 'HBeginFixQty', title: '开工余量(固数)', edit: 'text' }
                    , { field: 'HFixWorkDays', title: '上道固定天数', edit: 'text' }
                    , { field: 'HTrunWorkDays', title: '上道循环周期', edit: 'text' }
                    , { field: 'HReadyTimes', title: '本道准备时间', edit: 'text' }
                    , { field: 'HICMOReadyTimes', title: '换单准备时间', edit: 'text' }
                    , { field: 'HAutoTrunFlag', title: '自动移转', templet: "#HAutoTrunFlag" }//chenbox
                    , { field: '工作中心代码', title: '工作中心代码', edit: 'text', event: "CheckHCenterID" }//不填
                    // , { field: 'HCenterID', title: '工作中心id', hide: true }//, hide: true
                    , { field: '工作中心', title: '工作中心' }//f7
                    , { field: 'HTechnologyParameter', title: '工艺参数', edit: 'text' }
                    , { field: 'HPicNum', title: '图纸编号', edit: 'text' }
                    , { field: 'HProcCheckNote', title: '本工序确认记录', edit: 'text' }
                    , { field: 'HProcWorkNum', 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: '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: 'HWorkQty', title: '加工数量', edit: 'text' }//默认
                    //, { 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: '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: 'HProcPrice', title: '工序工价', edit: 'text' }//默认
                    //, { field: 'HBadPrice', title: '不合格单价', edit: 'text' }//默认
                    //, { field: 'HWasterPrice', title: '报废单价', edit: 'text' }//默认
                    //, { field: 'HStdFlag', title: '标准定额', templet: "#HStdFlag" }//chenbox
                    //, { field: 'HBeginDayQty', title: '开工余量(天数)', edit: 'text' }
                    //, { field: 'HBeginFixQty', title: '开工余量(固数)', edit: 'text' }
                    //, { field: 'HFixWorkDays', title: '上道固定天数', edit: 'text' }
                    //, { field: 'HTrunWorkDays', title: '上道循环周期', edit: 'text' }
                    //, { field: 'HReadyTimes', title: '本道准备时间', edit: 'text' }
                    //, { field: 'HICMOReadyTimes', title: '换单准备时间', edit: 'text' }
                    //, { field: 'HAutoTrunFlag', title: '自动移转', templet: "#HAutoTrunFlag" }//chenbox
                    //, { field: 'HProcCheckNote', title: '本工序确认记录', edit: 'text' }
                    //, { field: 'HProcWorkNum', title: '程序号', edit: 'text' }
                    //, { field: 'HWorkTimes_S', title: '产品单件工时', edit: 'text' }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                ]]
                //, done: function (res, curr, count) {
@@ -561,6 +608,8 @@
            //制单人
            $("#HMaker").val(sessionStorage["HUserName"]);
            $("#hmakers").val(sessionStorage["HUserName"]);
            $("#hmakedate").val(Format(new Date(), "yyyy-MM-dd"));
            //组织
            Organ();
@@ -572,15 +621,23 @@
            //}
            var params = getUrlVars();
            var OperationType = params[params[0]]; //从参数中获取 æ•°æ®ç±»åž‹  1添加 ä¿å­˜  2复制  3 ç¼–辑
            var OperationType = params[params[0]]; //从参数中获取 æ•°æ®ç±»åž‹  1添加 ä¿å­˜  2复制  3 ç¼–辑 4添加子工艺路线
            var linterid = params[params[1]]; //从参数中获取 å•据内码
            var lSourceBillType = params[params[2]];  //从单据获取 æºå•类型
            var HBillSubType = params[params[2]];  //从单据获取 æºå•类型
            //var linteridSub = params[params[3]];  //从参数获取 å­è¡¨çº§åˆ«
            if (HBillSubType == "SUB") {
                //显示工序
                $("#HIDDEN").show();
            } else {
                HBillSubType = "3301";
            }
            //判断是否新增
            if (linterid == null || linterid == 0) {
                //linteridSub = -1;
                //$("#HIDDEN").hide();
                OperationType = 1;
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
@@ -604,19 +661,22 @@
                    data: { "HBillType": '3301' },
                    success: function (d) {
                        $("#HInterID").val(d.data[0].HInterID);
                        $("#HBillNo").attr("readOnly", false);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
                    }
                });
            }
            else {//如果修改则走下面 new
                //禁用组织选项
                $("#HOrgID").attr("disabled", true);
                RoadBillMain(linterid);
                //RoadBillSub(linterid);
            }
            //设置转工序
            get_xt();
            //#endregion
@@ -652,6 +712,26 @@
                get_checkRoutingGroup();
            });
            //审核
            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('checkbox(checkboxHStandard)', function (data) {
@@ -660,14 +740,13 @@
            //是否转工序
            form.on('checkbox(checkboxIsProNo)', function (data) {
                if (data.elem.checked) {
                    $("#IsProNo").val("1");
                }
                else {
                    $("#IsProNo").val("0");
                }
                console.log($("#IsProNo").val())
            });
            //#region å¤é€‰æ¡†
@@ -749,25 +828,29 @@
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                //新增行表格数据
                var NewRow = {
                    "HProcNo": "", "HProcID_S": 0, "HProcType": "主工序", "HCenterID_S": 0, "HCenterID_SName": ""
                    "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, "HTimeUnit": "", "HUnitTime": 0
                    , "HWorkQty": 1, "HPassRate": 0, "HOverRate": 0, "HReadyTime": 0, "HQueueTime": 0
                    , "HWorkQty": 1, "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": ""
                    , "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": ""
                };
                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++) {
@@ -840,7 +923,19 @@
                    //列设置
                    case 'set_HideColumn':
                        get_HideColumn();
                        break;
                        break;
                    //上一行
                    case 'btn_up':
                        btn_up(data);
                        break;
                    //下一行
                    case 'btn_under':
                        btn_under(data);
                        break;
                    //刷新流水号
                    case 'btn_Refresh':
                        btn_Refresh(data);
                        break;
                }
            });
@@ -882,155 +977,11 @@
            //退出
            form.on('submit(btnEdit)', function (data) {
                if (OperationType == 1) {
                    Pub_Close(2);
                } else {
                if (params[1] != null) {
                    Pub_Close(1);
                } else if (params[1] == null) {
                    Pub_Close(2);
                }
            });
            //选择不良原因
            form.on('submit(HBadReasonID-BT)', function () {//选择仓库
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '不良原因列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            //选择工序计划单
            form.on('submit(HPlanID-BT)', function () {//选择工序计划单
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '工序计划单列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Sc_ProcessPlanViewList.html', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            //选择责任人
            form.on('submit(HEmployeeID-BT)', function () {//选择责任人
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '职员列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            //选择申请工序
            form.on('submit(HSQProcID-BT)', function () {//选择申请工序
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '申请工序列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            //选择责任工序
            form.on('submit(HZRProcID-BT)', function () {//选择责任工序
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '责任工序列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            //编辑
            form.on('submit(cmdModify)', function () {//编辑
                var sSubStr = table.cache['wl-table'];
                //if (AllowLoadData(sSubStr) != false) {//非空验证
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '明细列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/公共页面/Kf_BarCodeEditDlg.html?table=' + JSON.stringify(sSubStr), 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
                // }
            });
            form.on('submit(Cancel)', function () {
                //sessionStorage["SourceFlag"] = false;
                parent.location.href = "../../../views/index.html"
                //window.close();//关闭当前页
            })
            form.on('submit(Saver)', function (data) { //保存
                //debugger;
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(table.cache['mainTable']);
                var sMainSub = sMainStr + ';' + sSubStr;
                $.ajax(
                    {
                        type: "POST",
                        url: GetWEBURL() + "SaveBadReasonList", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sMainSub },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                layer.msg(data.Message, { icon: 1 });
                                $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
                            }
                            else {
                                f_alert(data.Message);
                                console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable));
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            f_alert("错误:" + err);
                            console.log("Reason" + sMainStr);
                        }
                    });
            });
            //监听提交
@@ -1097,6 +1048,9 @@
                        $("#HMaterModel").val(checkStatus.data[0].HModel);//规格型号
                        $("#HUnitID").val(checkStatus.data[0].HUnitID);//计量单位id
                        $("#HUnitName").val(checkStatus.data[0].HUnitName);//计量单位名称
                        if ($("#HName").val() == "") {
                            $("#HName").val(checkStatus.data[0].HNumber);
                        }
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
@@ -1251,17 +1205,136 @@
                var rowIndex = $(obj.tr).attr("data-index");
                if (obj.event === 'del') {
                    layer.confirm('真的删除行吗?', function (index) {
                        console.log("索引为:" + rowIndex);
                        if (rowIndex === '0') {
                            layer.msg('首行无法删除!!!');
                        } else {
                            obj.del();
                            option.data = table.cache["mainTable"];//将数据绑定到data上
                            table.reload(option);
                            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_CheckBill() {
                layer.confirm("确认要审核吗?", function (index) {
                    var wait = layer.load();
                    $.ajax({
                        url: GetWEBURL() + '/Gy_RoutingBill/AuditGy_RoutingBill',
                        type: "GET",
                        data: { "HInterID": $("#HInterID").val(), "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
                        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_AbandonCheck() {
                layer.confirm("确认要反审核吗?", function (index) {
                    var wait = layer.load();
                    $.ajax({
                        url: GetWEBURL() + '/Gy_RoutingBill/AuditGy_RoutingBill',
                        type: "GET",
                        data: { "HInterID": $("#HInterID").val(), "IsAudit": 1, "CurUserName": sessionStorage["HUserName"] },
                        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 wait = layer.load();
                    $.ajax({
                        url: GetWEBURL() + '/Gy_RoutingBill/CloseGy_RoutingBill',
                        type: "GET",
                        data: { "HInterID": $("#HInterID").val(), "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
                        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 wait = layer.load();
                    $.ajax({
                        url: GetWEBURL() + '/Gy_RoutingBill/CloseGy_RoutingBill',
                        type: "GET",
                        data: { "HInterID": $("#HInterID").val(), "IsAudit": 1, "CurUserName": sessionStorage["HUserName"] },
                        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);
                        }
                    });
                })
            }
            //行内删除快捷键
@@ -1300,7 +1373,7 @@
                        }
                        //工序
                        if (obj.event == "CheckHProcID") {
                            //打开人员表  å°çª—体
                            // å°çª—体
                            layer.open({
                                type: 2
                                , skin: "layui-layer-rim" //加上边框
@@ -1309,21 +1382,116 @@
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ["../../Baseset/基础资料/Gy_ProcList.html", "yes"]
                                , content: ["../../基础资料/生产基础资料/Gy_Process.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("请选择一条数据");
                                    if (checkStatus.data.length ==0) {
                                        return layer.msg("请至少选择一条数据!");
                                    }
                                    //更新表格缓存的数据
                                    obj.update({
                                        "工序": checkStatus.data[0].工序
                                        , "HProcID": checkStatus.data[0].HItemID
                                    })
                                    //获取工序代码
                                    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]["HProcID"] = WorkCente[j]["HProcID"];
                                            option.data[i]["工作中心"] = WorkCente[j]["工作中心名称"];
                                            option.data[i]["HCenterID"] = WorkCente[j]["HCenterID"];
                                            option.data[i]["工作中心代码"] = WorkCente[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": ""
                                                , "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, "HTimeUnit": "", "HUnitTime": 0
                                                , "HWorkQty": 1, "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": ""
                                            })
                                            j++;
                                        }
                                    } else {
                                        //循环赋值  åœ¨å·²æœ‰çš„表格赋值
                                        var j = 0;
                                        for (var i = (NowNum - 1); i < (NowNum - 1) + ProcessNumber.length; i++) {
                                            option.data[i]["工序"] = WorkCente[j]["工序名称"];
                                            option.data[i]["HProcID"] = WorkCente[j]["HProcID"];
                                            option.data[i]["工作中心"] = WorkCente[j]["工作中心名称"];
                                            option.data[i]["HCenterID"] = WorkCente[j]["HCenterID"];
                                            option.data[i]["工作中心代码"] = WorkCente[j]["工作中心代码"];
                                            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);//关闭弹窗
                                }
                            })
@@ -1334,7 +1502,7 @@
                            layer.open({
                                type: 2
                                , skin: "layui-layer-rim" //加上边框
                                , title: "人员列表"  //标题
                                , title: "工作中心列表"  //标题
                                , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
@@ -1390,6 +1558,178 @@
                                }
                            })
                        }
                        //不良品仓
                        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;
                    }
@@ -1405,7 +1745,7 @@
                    url: GetWEBURL() + "/LEMS/MES_Gy_RoutingBillList_Json",
                    type: "GET",
                    async: false,
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "HBillSubType": HBillSubType },
                    success: function (d) {
                        //alert(JSON.stringify(d.data[0]))
@@ -1418,11 +1758,13 @@
                        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")
                            , "HInterID": OperationType == 2 ? 0 : d.data[0].hmainid
                            , "HDate": Format(new Date(d.data[0].日期), "yyyy-MM-dd")
                            , "HName": d.data[0].工艺名称
                            , "HMaterNumber": OperationType == 2 ? "" : d.data[0].物料代码
                            , "HMaterName": OperationType == 2 ? "" : d.data[0].物料名称
@@ -1453,13 +1795,13 @@
                            , "HOrgID": d.data[0].HOrgID
                            //其他信息
                            , "hmakers": d.data[0].制单人
                            , "hmakedate": d.data[0].制单日期==null?"":Format(new Date(d.data[0].制单日期), "yyyy-MM-dd")
                            , "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")
                            , "hdeletedate": d.data[0].作废日期 == null ? "" : Format(new Date(d.data[0].作废日期), "yyyy-MM-dd")
                        });
                        //子表  èµ‹å€¼
@@ -1477,7 +1819,11 @@
                                    , "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].程序号
                                    , "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].巡检检验方案
                                }
                            )
                        }
@@ -1507,6 +1853,7 @@
                    }
                })
            }
            //保存HMaker
            function set_AddNew(data) {
@@ -1522,8 +1869,8 @@
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(num);
                //var hentryid = linteridSub;//子表 æŽ’序id
                var sMainSub = sMainStr + ';' + sSubStr + ';' + OperationType + ";" + sessionStorage["HUserName"];
                var sMainSub = sMainStr + ';' + sSubStr + ';' + OperationType + ";" + sessionStorage["HUserName"] + ";" + HBillSubType;
                var index = layer.load();
                $.ajax({
                    type: "POST",
@@ -1557,14 +1904,31 @@
            //非空验证
            function AllowLoadData(data) {
                if ($("#HMaterNumber").val() == "") {
                    layer.msg("产品代码没有选择");
                if ($("#HBillNo").val() == "") {
                    layer.msg("单据号不能为空!");
                    return false;
                }
                //if ($("#HUnitName").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;
@@ -1580,11 +1944,70 @@
                //}
                var num = [];
                for (var i = 0; i < option.data.length; i++) {
                    if ($.inArray(option.data[i]["HProcNo"], num) == -1) {
                        num.push(option.data[i]["HProcNo"]);
                    } else {
                        layer.msg("流水号:" + option.data[i]["HProcNo"] + "重复!");
                        return false;
                    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;
                            }
                        }
                        //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;
                            }
                        }
                    }
                }
@@ -1626,6 +2049,56 @@
                })
            }
            //上一行
            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++) {
                    option.data[i]["HProcNo"] = (i + 1) * 10;
                }
                table.render(option);
            }
            //显示列数据
            function DisPlay_HideColumn() {
                $.ajax({
@@ -1635,10 +2108,8 @@
                    async: false,
                    success: function (data1) {
                        if (data1.data.length != 0) {
                            var dataCol = [];//数据库查询出的列数据
                            var titleData = ["单据ID", "HMouldID", "hsubid", "HManagerID", "源单主内码", "源单子内码"];//不需要显示的字段 å¯æ‰©å±•
                            var titleData = ["程序号", "本工序确认记录", "自动移转", "换单准备时间", "本道准备时间", "上道循环周期", "上道固定天数", "开工余量(固数)", "开工余量(天数)", "标准定额", "报废单价", "不合格单价", "工序工价", "班产定额", "可操作设备数", "标准人数", "流转工序", "下道流转工序", "固定生产天数", "生产周期", "暂放区", "周转箱", "周转箱标准", "换模时间", "转移时间", "排队时间", "准备时间", "产线人数", "产线产能", "产线中心", "良率", "加工数量", "运行时间", "时间单位", "图纸编号", "模具编号", "良品仓", "报废品仓", "不良品仓", "工序类型"];//不需要显示的字段 å¯æ‰©å±•
                            dataCol = data1.data[0].HGridString.split(',');
@@ -1712,8 +2183,6 @@
            //#endregion
        });
    </script>
</body>
</html>