From 7df042662e1929abdd667cfd7b037f4e10e8c2ad Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期四, 14 三月 2024 11:27:56 +0800
Subject: [PATCH] 其他应付单 增加子表保存,目录放到采购管理,其他入库单编辑模块 并完善 其他出库单 列表功能;( 常规 功能, 新增,修改,删除,审核,作废,关闭,自定义过滤,源单类型列表(源单 手工录入), 合计行,保存控制,审核控制,删除控制,关联数回填 等等 ) (注: 基础资料选择, 均用 基础资料列表 的方式)

---
 WebTM/views/计划管理/工艺路线/Gy_RoutingBill.html | 1134 ++++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 763 insertions(+), 371 deletions(-)

diff --git "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBill.html" "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBill.html"
index 7bf95e9..ab5cbcf 100644
--- "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBill.html"
+++ "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/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="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;">浜у搧浠g爜</label>
+                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">浜у搧浠g爜*</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="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,16 +171,10 @@
                                                     <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">
+                                        <!--<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">
@@ -212,50 +183,39 @@
                                         <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>
+                                                <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>-->
                                     </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 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>
+                                                <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>
+                                                <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>
@@ -404,10 +427,17 @@
         </div>
     </script>
 
+    <!--澶嶉�夋 鎺掍骇宸ュ簭鏍囪-->
+    <script type="text/html" id="HSortProcFlag">
+        <div class="layui-input-block" style="margin-left: 20px;">
+            <input type="checkbox" name="HSortProcFlag" lay-filter="HSortProcFlag" id="HSortProcFlag{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
+        </div>
+    </script>
+
     <!--澶嶉�夋 涓嬮亾娴佽浆宸ュ簭-->
     <script type="text/html" id="HNextProcFlag">
         <div class="layui-input-block" style="margin-left: 20px;">
-            <input type="checkbox" name="HNextProcFlag" disabled="disabled"  lay-filter="HNextProcFlag" id="HNextProcFlag{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
+            <input type="checkbox" name="HNextProcFlag" disabled="disabled" lay-filter="HNextProcFlag" id="HNextProcFlag{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
         </div>
     </script>
 
@@ -459,16 +489,19 @@
                 , "HWorkQty_S": 0, "HSubStdEmpQty_S": 0, "HMouldNo": "", "HChangeMould": 0, "HPackStd": ""
                 , "HPack": "", "HPutArea": "", "HMyWorkDays": 0, "HMyFixWorkDays": 0, "宸ュ簭": ""
                 , "HProcID": 0, "宸ヤ綔涓績浠g爜": "", "HCenterID": 0, "宸ヤ綔涓績": "", "HSupID": 0
-                , "渚涘簲鍟嗕唬鐮�": "", "渚涘簲鍟�": "", "HSupFlag": false, "HTimeUnit": "", "HUnitTime": 0
-                , "HWorkQty": 1, "HPassRate": 0, "HOverRate": 0, "HReadyTime": 0, "HQueueTime": 0
+                , "渚涘簲鍟嗕唬鐮�": "", "渚涘簲鍟�": "", "HSupFlag": false, "HSortProcFlag": 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":""
+                , "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 杩涘叆椤甸潰鍗冲姞杞�
@@ -477,68 +510,84 @@
                 elem: '#mainTable'
                 , toolbar: '#toolbarDemo'
                 , limit: 500 //姣忛〉榛樿鏄剧ず鐨勬暟閲�
-                , cellMinWidth: 120
+                , totalRow: true
+                //, cellMinWidth: 120
                 , height: 400
                 , cols: [[ //琛ㄥご
                     { type: 'checkbox', totalRowText: '鍚堣琛�' }
                     , { type: 'numbers', title: '搴忓彿', totalRow: true }
                     , { field: 'HProcNo', title: '娴佹按鍙�', edit: 'text' }
-                    , { field: 'HProcID_S', title: '宸ユ', edit: 'text' }
-                    , { field: 'HProcType', title: '宸ュ簭绫诲瀷', templet: '#HProcType' }//閫夋嫨
-                    , { field: 'HCenterID_SName', title: '浜х嚎涓績', edit: 'text', event: "CheckHCenterID_S" }//f7
-                    //, { field: 'HCenterID_S', title: '浜х嚎涓績id', hide: true }//hide: true
-                    , { field: 'HWorkQty_S', title: '浜х嚎浜ц兘', edit: 'text' }
-                    , { field: 'HSubStdEmpQty_S', title: '浜х嚎浜烘暟', edit: 'text' }
-                    , { field: 'HMouldNo', title: '妯″叿缂栧彿', edit: 'text' }
-                    , { field: 'HChangeMould', title: '鎹㈡ā鏃堕棿', edit: 'text' }
-                    , { field: 'HPackStd', title: '鍛ㄨ浆绠辨爣鍑�', edit: 'text' }
-                    , { field: 'HPack', title: '鍛ㄨ浆绠�', edit: 'text' }
-                    , { field: 'HPutArea', title: '鏆傛斁鍖�', edit: 'text' }
-                    , { field: 'HMyWorkDays', title: '鐢熶骇鍛ㄦ湡', edit: 'text' }
-                    , { field: 'HMyFixWorkDays', title: '鍥哄畾鐢熶骇澶╂暟', edit: 'text' }
-                    , { field: '宸ュ簭', title: '宸ュ簭', edit: 'text', event: "CheckHProcID" }//f7
                     // , { field: 'HProcID', title: '宸ュ簭ID', hide: true }//, hide: true
-                    , { field: '宸ヤ綔涓績浠g爜', title: '宸ヤ綔涓績浠g爜' }//涓嶅~
+                    , { field: '宸ュ簭', title: '宸ュ簭', edit: 'text', event: "CheckHProcID" }//f7
+                    , { field: '宸ヤ綔涓績浠g爜', title: '宸ヤ綔涓績浠g爜', edit: 'text', event: "CheckHCenterID" }//涓嶅~
                     // , { field: 'HCenterID', title: '宸ヤ綔涓績id', hide: true }//, hide: true
-                    , { field: '宸ヤ綔涓績', title: '宸ヤ綔涓績', edit: 'text', event: "CheckHCenterID" }//f7
-                    // , { field: 'HSupID', title: '渚涘簲鍟咺D', 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: '宸ヤ綔涓績' }//f7
                     , { field: 'HTechnologyParameter', title: '宸ヨ壓鍙傛暟', edit: 'text' }
-                    , { field: 'HPicNum', title: '鍥剧焊缂栧彿', edit: 'text' }
-                    , { field: 'HProcCheckNote', title: '鏈伐搴忕‘璁よ褰�', edit: 'text' }
-                    , { field: 'HProcWorkNum', title: '绋嬪簭鍙�', edit: 'text' }
-                    //, { 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: 'HRemark', title: '澶囨敞', edit: 'text' }
+                    // , { field: 'HSupID', title: '渚涘簲鍟咺D', hide: true }
+                    , { field: '渚涘簲鍟嗕唬鐮�', title: '渚涘簲鍟嗕唬鐮�', edit: 'text', width: 110, event: "CheckHSupID" }
+                    , { field: '渚涘簲鍟�', title: '渚涘簲鍟�' }//f7
+                    , { field: 'HSupFlag', title: '澶栧崗鏍囪', templet: "#HSupFlag" }//checkbox
+                    , { field: 'HSortProcFlag', title: '鎺掍骇宸ュ簭鏍囪', templet: "#HSortProcFlag" }//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', totalRow: true }//榛樿
+
+                    //, { field: 'HQCSchemeID_Fst', title: '棣栦欢妫�楠屾柟妗圛D', 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: '杞簭妫�楠屾柟妗圛D', 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: '宸℃妫�楠屾柟妗圛D', 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) {
@@ -568,6 +617,8 @@
 
             //鍒跺崟浜�
             $("#HMaker").val(sessionStorage["HUserName"]);
+            $("#hmakers").val(sessionStorage["HUserName"]);
+            $("#hmakedate").val(Format(new Date(), "yyyy-MM-dd"));
             //缁勭粐
             Organ();
 
@@ -579,15 +630,47 @@
             //}
 
             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]];  //浠庡弬鏁拌幏鍙� 瀛愯〃绾у埆
+            var IsHavingPermissions = 0; //鎺掍骇椤甸潰璺宠浆杩囨潵鏃跺垽鏂敤鎴锋槸鍚︽湁宸ヨ壓璺嚎缂栬緫鏉冮檺,0浠g爜娌℃湁鏉冮檺锛�1浠h〃鏈夋潈闄�
+            //鎺掍骇椤甸潰璺宠浆缂栬緫鏌ョ湅宸ヨ壓璺嚎
+            if (HBillSubType == 4610 && OperationType == 3) {
+                HBillSubType = 3301
+                IsHavingPermissions = params[params[3]];
+                if (IsHavingPermissions == 0) {
+                    //娌℃湁宸ヨ壓璺嚎鐨勭紪杈戞潈闄愶紝绂佺敤鎸夐挳
+                    $('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);
+                    $('#set_CheckBill').addClass("layui-btn-disabled").attr("disabled", true);
+                    $('#set_AbandonCheck').addClass("layui-btn-disabled").attr("disabled", true);
+                    $('#set_CloseBill').addClass("layui-btn-disabled").attr("disabled", true);
+                    $('#set_CancelCloseBill').addClass("layui-btn-disabled").attr("disabled", true);
+                }
+            }
+            //鎺掍骇椤甸潰璺宠浆鏂板宸ヨ壓璺嚎
+            if (HBillSubType == 4610 && OperationType == 1) {
+                HBillSubType = 3301
+
+                $("#HMaterID").val(params[params[3]]);//鐗╂枡ID
+
+                $("#HMaterNumber").val(getParams("HMaterNumber"));//鐗╂枡浠g爜
+                $("#HMaterName").val(getParams("HMaterName"));//鐗╂枡鍚嶇О
+                $("#HMaterModel").val(getParams("HMaterModel") == "" ? " " : getParams("HMaterModel"));//瑙勬牸鍨嬪彿
+            }
+
+            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",
@@ -611,19 +694,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
 
@@ -659,6 +745,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) {
@@ -667,14 +773,13 @@
 
             //鏄惁杞伐搴�
             form.on('checkbox(checkboxIsProNo)', function (data) {
-             
+
                 if (data.elem.checked) {
                     $("#IsProNo").val("1");
                 }
                 else {
                     $("#IsProNo").val("0");
                 }
-                console.log($("#IsProNo").val())
             });
 
             //#region 澶嶉�夋
@@ -686,6 +791,18 @@
                 $.each(option.data, function (index, value) {
                     if (value.LAY_TABLE_INDEX == dataindex) {
                         value.HSupFlag = data.elem.checked;//鎶婇�変腑涓嬫媺妗唅d鍊艰祴鍊肩粰琛ㄦ牸缂撳瓨
+                    }
+                });
+            });
+
+            //鎺掍骇宸ュ簭鏍囪
+            form.on('checkbox(HSortProcFlag)', function (data) {
+                //鑾峰彇涓嬫媺妗嗛�変腑鐨勫��
+                var elem = data.othis.parents('tr');
+                var dataindex = elem.attr("data-index");
+                $.each(option.data, function (index, value) {
+                    if (value.LAY_TABLE_INDEX == dataindex) {
+                        value.HSortProcFlag = data.elem.checked;//鎶婇�変腑涓嬫媺妗唅d鍊艰祴鍊肩粰琛ㄦ牸缂撳瓨
                     }
                 });
             });
@@ -763,14 +880,17 @@
                     , "HWorkQty_S": 0, "HSubStdEmpQty_S": 0, "HMouldNo": "", "HChangeMould": 0, "HPackStd": ""
                     , "HPack": "", "HPutArea": "", "HMyWorkDays": 0, "HMyFixWorkDays": 0, "宸ュ簭": ""
                     , "HProcID": 0, "宸ヤ綔涓績浠g爜": "", "HCenterID": 0, "宸ヤ綔涓績": "", "HSupID": 0
-                    , "渚涘簲鍟嗕唬鐮�": "", "渚涘簲鍟�": "", "HSupFlag": false, "HTimeUnit": "", "HUnitTime": 0
-                    , "HWorkQty": 1, "HPassRate": 0, "HOverRate": 0, "HReadyTime": 0, "HQueueTime": 0
+                    , "渚涘簲鍟嗕唬鐮�": "", "渚涘簲鍟�": "", "HSupFlag": false, "HSortProcFlag": 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": ""
+                    , "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':
@@ -783,6 +903,10 @@
                             //濮斿鍗忓姪
                             if (option.data[i - 1].HSupFlag) {
                                 $('#HSupFlag' + i + '').attr("checked", true);
+                            }
+                            //鎺掍骇宸ュ簭鏍囪
+                            if (option.data[i - 1].HSortProcFlag) {
+                                $('#HSortProcFlag' + i + '').attr("checked", true);
                             }
                             //涓嬮亾娴佽浆宸ュ簭
                             if (option.data[i - 1].HNextProcFlag) {
@@ -824,6 +948,10 @@
                                 if (option.data[i - 1].HSupFlag) {
                                     $('#HSupFlag' + i + '').attr("checked", true);
                                 }
+                                //鎺掍骇宸ュ簭鏍囪
+                                if (option.data[i - 1].HSortProcFlag) {
+                                    $('#HSortProcFlag' + i + '').attr("checked", true);
+                                }
                                 //涓嬮亾娴佽浆宸ュ簭
                                 if (option.data[i - 1].HNextProcFlag) {
                                     $('#HNextProcFlag' + i + '').attr("checked", true);
@@ -848,6 +976,18 @@
                     //鍒楄缃�
                     case 'set_HideColumn':
                         get_HideColumn();
+                        break;
+                    //涓婁竴琛�
+                    case 'btn_up':
+                        btn_up(data);
+                        break;
+                    //涓嬩竴琛�
+                    case 'btn_under':
+                        btn_under(data);
+                        break;
+                    //鍒锋柊娴佹按鍙�
+                    case 'btn_Refresh':
+                        btn_Refresh(data);
                         break;
                 }
             });
@@ -890,155 +1030,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");
-                    }
-                })
-            });
-
-            //閫夋嫨璐d换浜�
-            form.on('submit(HEmployeeID-BT)', function () {//閫夋嫨璐d换浜�
-                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");
-                    }
-                })
-            });
-
-            //閫夋嫨璐d换宸ュ簭
-            form.on('submit(HZRProcID-BT)', function () {//閫夋嫨璐d换宸ュ簭
-                layer.open({
-                    type: 2
-                    , area: ['80%', '80%']
-                    , title: '璐d换宸ュ簭鍒楄〃'
-                    , 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);
-                        }
-                    });
             });
 
             //鐩戝惉鎻愪氦
@@ -1084,13 +1080,15 @@
 
             //浜у搧閫夋嫨椤甸潰
             function get_checkSearchMater() {
+                var HOrgID = $("#HOrgID").val();
+
                 layer.open({
                     type: 2//寮圭獥绫诲瀷
                     , skin: 'layui-layer-rim' //鍔犱笂杈规
                     , area: ['90%', '90%']//澶у皬
                     , title: '鐗╂枡琛�'//鏍囬
                     , shift: 2//寮瑰嚭鍔ㄧ敾
-                    , content: ['../../Baseset/鍩虹璧勬枡/Gy_MaterialList.html', 'yes']
+                    , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Material.html?openType=2&HOrgID=' + HOrgID, 'yes']
                     , btn: ['纭畾', '鍙栨秷']
                     , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
                         var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
@@ -1100,11 +1098,14 @@
                         }
                         //鑾峰彇鏁版嵁
                         $("#HMaterID").val(checkStatus.data[0].HItemID);//鐗╂枡id
-                        $("#HMaterName").val(checkStatus.data[0].HName);//鐗╂枡鍚嶇О
-                        $("#HMaterNumber").val(checkStatus.data[0].HNumber);//鐗╂枡浠g爜
-                        $("#HMaterModel").val(checkStatus.data[0].HModel);//瑙勬牸鍨嬪彿
+                        $("#HMaterName").val(checkStatus.data[0].鐗╂枡鍚嶇О);//鐗╂枡鍚嶇О
+                        $("#HMaterNumber").val(checkStatus.data[0].鐗╂枡浠g爜);//鐗╂枡浠g爜
+                        $("#HMaterModel").val(checkStatus.data[0].瑙勬牸鍨嬪彿);//瑙勬牸鍨嬪彿
                         $("#HUnitID").val(checkStatus.data[0].HUnitID);//璁¢噺鍗曚綅id
-                        $("#HUnitName").val(checkStatus.data[0].HUnitName);//璁¢噺鍗曚綅鍚嶇О
+                        $("#HUnitName").val(checkStatus.data[0].璁¢噺鍗曚綅鍚嶇О);//璁¢噺鍗曚綅鍚嶇О
+                        if ($("#HName").val() == "") {
+                            $("#HName").val(checkStatus.data[0].鐗╂枡浠g爜);
+                        }
 
                         layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
                     }
@@ -1259,7 +1260,6 @@
                 var rowIndex = $(obj.tr).attr("data-index");
                 if (obj.event === 'del') {
                     layer.confirm('鐪熺殑鍒犻櫎琛屽悧锛�', function (index) {
-                        console.log("绱㈠紩涓�:" + rowIndex);
                         if (rowIndex === '0') {
                             layer.msg('棣栬鏃犳硶鍒犻櫎锛侊紒锛�');
                         } else {
@@ -1271,6 +1271,125 @@
                         }
                     });
                 }
+            }
+
+            //鑾峰彇 杞伐搴� 绯荤粺鍙傛暟
+            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);
+                        }
+                    });
+                })
             }
 
             //琛屽唴鍒犻櫎蹇嵎閿�
@@ -1309,7 +1428,7 @@
                         }
                         //宸ュ簭
                         if (obj.event == "CheckHProcID") {
-                            //鎵撳紑浜哄憳琛�  灏忕獥浣�
+                            // 灏忕獥浣�
                             layer.open({
                                 type: 2
                                 , skin: "layui-layer-rim" //鍔犱笂杈规
@@ -1318,46 +1437,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("璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�!");
                                     }
-                                    var HCenterID = 0;
-                                    var HCenterNUmber = "";
-                                    var HCenterName = "";
+
+                                    //鑾峰彇宸ュ簭浠g爜
+                                    var ProcessNumber = [];
+                                    for (var i = 0; i < checkStatus.data.length; i++) {
+                                        ProcessNumber.push("'" + checkStatus.data[i]["宸ュ簭浠g爜"] + "'");
+                                    }
+
+                                    //鑾峰彇褰撳墠浣嶇疆鎵�鍦ㄨ鏁�
+                                    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,'') 宸ヤ綔涓績浠g爜, 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_WorkCenter/list',
+                                        type: "GET",
+                                        url: GetWEBURL() + "/Gy_SOPBillList/WindowPrintList", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
                                         async: false,
-                                        data: { "sWhere": " and 宸ヤ綔涓績浠g爜='" + checkStatus.data[0].宸ュ簭浠g爜+"' ", user: sessionStorage["HUserName"] },
-                                        success: function (result) {
-                                            if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
-                                                if (result.data.length > 0) {
-                                                    HCenterID = result.data[0]["HItemID"];
-                                                    HCenterNUmber = result.data[0]["宸ヤ綔涓績浠g爜"];
-                                                    HCenterName = result.data[0]["宸ヤ綔涓績鍚嶇О"];
-                                                }
+                                        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 });
                                         }
-                                    })
+                                    });
 
-                                    //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
-                                    obj.update({
-                                        "宸ュ簭": checkStatus.data[0].宸ュ簭
-                                        , "HProcID": checkStatus.data[0].HItemID
-                                        , "宸ヤ綔涓績": HCenterName
-                                        , "HCenterID": HCenterID
-                                        , "宸ヤ綔涓績浠g爜": HCenterNUmber
-                                    })
-                                   
+                                    //鍒ゆ柇閫夋嫨鐨勬暟鎹�绘暟 鏄惁澶т簬琛ㄦ牸鐜版湁鐨勬暟鎹�
+                                    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]["宸ヤ綔涓績浠g爜"] = WorkCente[j]["宸ヤ綔涓績浠g爜"];
+                                            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"], "宸ヤ綔涓績浠g爜": WorkCente[j]["宸ヤ綔涓績浠g爜"], "HCenterID": WorkCente[j]["HCenterID"], "宸ヤ綔涓績": WorkCente[j]["宸ヤ綔涓績鍚嶇О"], "HSupID": 0
+                                                , "渚涘簲鍟嗕唬鐮�": "", "渚涘簲鍟�": "", "HSupFlag": false, "HSortProcFlag": 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]["宸ヤ綔涓績浠g爜"] = WorkCente[j]["宸ヤ綔涓績浠g爜"];
+                                            j++;
+                                        }
+                                    }
+                                    table.render(option);
+                                    //var HCenterID = 0;
+                                    //var HCenterNUmber = "";
+                                    //var HCenterName = "";
+
+
+                                    ////鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                                    //obj.update({
+                                    //    "宸ュ簭": checkStatus.data[0].宸ュ簭鍚嶇О
+                                    //    , "HProcID": checkStatus.data[0].HItemID
+                                    //    , "宸ヤ綔涓績": HCenterName
+                                    //    , "HCenterID": HCenterID
+                                    //    , "宸ヤ綔涓績浠g爜": HCenterNUmber
+                                    //})
+
                                     layer.close(index);//鍏抽棴寮圭獥
                                 }
                             })
@@ -1368,7 +1557,7 @@
                             layer.open({
                                 type: 2
                                 , skin: "layui-layer-rim" //鍔犱笂杈规
-                                , title: "浜哄憳鍒楄〃"  //鏍囬
+                                , title: "宸ヤ綔涓績鍒楄〃"  //鏍囬
                                 , closeBtn: 1  //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
                                 , shift: 2 //寮瑰嚭鍔ㄧ敾
                                 , area: ["90%", "90%"] //绐椾綋澶у皬
@@ -1424,7 +1613,7 @@
                                 }
                             })
                         }
-                        //涓嶈壇鍝佷粨  
+                        //涓嶈壇鍝佷粨
                         if (obj.event == "HBadWHID") {
                             //鎵撳紑浜哄憳琛�  灏忕獥浣�
                             layer.open({
@@ -1455,7 +1644,7 @@
                             })
                         }
 
-                        //鑹搧浠�  
+                        //鑹搧浠�
                         if (obj.event == "HWHID") {
                             //鎵撳紑浜哄憳琛�  灏忕獥浣�
                             layer.open({
@@ -1516,6 +1705,85 @@
                                 }
                             })
                         }
+                        //棣栦欢妫�楠屾柟妗�
+                        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鐨別lem:"#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); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                                }
+                                , 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鐨別lem:"#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); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                                }
+                                , 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鐨別lem:"#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); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
+                                }
+                                , btn2: function (index, layero) { }
+                            })
+                        }
 
                         obj.event = "";
                         return false;
@@ -1532,7 +1800,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]))
@@ -1545,11 +1813,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].鐗╂枡浠g爜
                             , "HMaterName": OperationType == 2 ? "" : d.data[0].鐗╂枡鍚嶇О
@@ -1580,13 +1850,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")
                         });
 
                         //瀛愯〃  璧嬪��
@@ -1598,14 +1868,17 @@
                                     , "HWorkQty_S": d.data[i].浜х嚎浜ц兘, "HSubStdEmpQty_S": d.data[i].浜х嚎浜烘暟, "HMouldNo": d.data[i].妯″叿缂栧彿, "HChangeMould": d.data[i].鎹㈡ā鏃堕棿, "HPackStd": d.data[i].鍛ㄨ浆绠辨爣鍑�
                                     , "HPack": d.data[i].鍛ㄨ浆绠�, "HPutArea": d.data[i].鏆傛斁鍖�, "HMyWorkDays": d.data[i].鐢熶骇鍛ㄦ湡, "HMyFixWorkDays": d.data[i].鍥哄畾鐢熶骇澶╂暟, "宸ュ簭": d.data[i].宸ュ簭
                                     , "HProcID": d.data[i].hprocid, "宸ヤ綔涓績浠g爜": d.data[i].宸ヤ綔涓績浠g爜, "HCenterID": d.data[i].HCenterID, "宸ヤ綔涓績": d.data[i].宸ヤ綔涓績鍚嶇О, "HSupID": d.data[i].HSupID
-                                    , "渚涘簲鍟嗕唬鐮�": d.data[i].渚涘簲鍟嗕唬鐮�, "渚涘簲鍟�": d.data[i].渚涘簲鍟�, "HSupFlag": d.data[i].濮斿鏍囪 == 0 ? false : true, "HTimeUnit": d.data[i].鏃堕棿鍗曚綅, "HUnitTime": d.data[i].杩愯鏃堕棿
+                                    , "渚涘簲鍟嗕唬鐮�": d.data[i].渚涘簲鍟嗕唬鐮�, "渚涘簲鍟�": d.data[i].渚涘簲鍟�, "HSupFlag": d.data[i].濮斿鏍囪 == 0 ? false : true, "HSortProcFlag": d.data[i].鎺掍骇宸ュ簭鏍囪 == 0 ? false : true, "HTimeUnit": d.data[i].鏃堕棿鍗曚綅, "HUnitTime": d.data[i].杩愯鏃堕棿
                                     , "HWorkQty": d.data[i].鍔犲伐鏁伴噺, "HPassRate": d.data[i].鑹巼, "HOverRate": d.data[i].瓒呴姣斾緥, "HReadyTime": d.data[i].鍑嗗鏃堕棿, "HQueueTime": d.data[i].鎺掗槦鏃堕棿
                                     , "HMoveTime": d.data[i].杞Щ鏃堕棿, "HNextProcFlag": d.data[i].HNextProcFlag == 0 ? false : true, "HFlowProc": d.data[i].娴佽浆宸ュ簭 == 0 ? false : true, "HSubStdEmpQty": d.data[i].鏍囧噯浜烘暟, "HSubCanUseSourceQty": d.data[i].鍙搷浣滆澶囨暟
                                     , "HFixPrice": d.data[i].鐝骇瀹氶, "HProcPrice": d.data[i].鍔犲伐鍗曚环, "HBadPrice": d.data[i].涓嶅悎鏍煎崟浠�, "HWasterPrice": d.data[i].鎶ュ簾鍗曚环, "HStdFlag": d.data[i].鏍囧噯瀹氶
                                     , "HBeginDayQty": d.data[i].寮�宸ヤ綑閲忓ぉ鏁�, "HBeginFixQty": d.data[i].寮�宸ヤ綑閲忓浐鏁�, "HFixWorkDays": d.data[i].涓婇亾鍥哄畾澶╂暟, "HTrunWorkDays": d.data[i].涓婇亾寰幆鍛ㄦ湡, "HReadyTimes": d.data[i].鏈亾鍑嗗鏃堕棿
                                     , "HICMOReadyTimes": d.data[i].鎹㈠崟鍑嗗鏃堕棿, "HAutoTrunFlag": d.data[i].鑷姩绉昏浆, "HTechnologyParameter": d.data[i].宸ヨ壓鍙傛暟, "HPicNum": d.data[i].鍥剧焊缂栧彿, "HProcCheckNote": d.data[i].鏈伐搴忕‘璁よ褰�
                                     , "HProcWorkNum": d.data[i].绋嬪簭鍙�, "HBadWHID": d.data[i].HBadWHID, "HBadWHName": d.data[i].HBadWHName, "HWasterWHID": d.data[i].HWasterWHID, "HWasterWHName": d.data[i].HWasterWHName
-                                    , "HWHID": d.data[i].HWHID, "HWHName": d.data[i].HWHName
+                                    , "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].宸℃妫�楠屾柟妗�
                                 }
                             )
                         }
@@ -1615,6 +1888,9 @@
                         for (var i = 0; i < d.data.length; i++) {
                             if (d.data[i].濮斿鏍囪) {
                                 $('#HSupFlag' + (i + 1)).attr("checked", true);
+                            }
+                            if (d.data[i].鎺掍骇宸ュ簭鏍囪) {
+                                $('#HSortProcFlag' + (i + 1)).attr("checked", true);
                             }
                             if (d.data[i].HNextProcFlag) {
                                 $('#HNextProcFlag' + (i + 1)).attr("checked", true);
@@ -1635,6 +1911,7 @@
                     }
                 })
             }
+
             //淇濆瓨HMaker
             function set_AddNew(data) {
 
@@ -1650,8 +1927,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",
@@ -1685,14 +1962,31 @@
             //闈炵┖楠岃瘉
             function AllowLoadData(data) {
 
-                if ($("#HMaterNumber").val() == "") {
-                    layer.msg("浜у搧浠g爜娌℃湁閫夋嫨");
+                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("浜у搧浠g爜娌℃湁閫夋嫨!");
+                    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;
@@ -1706,6 +2000,7 @@
                 //    layer.msg("鐢熶骇鐝粍娌℃湁閫夋嫨");
                 //    return false;
                 //}
+                var pc = 0;
                 var num = [];
                 for (var i = 0; i < option.data.length; i++) {
 
@@ -1722,6 +2017,47 @@
                             layer.msg("绗�" + (i + 1) + "琛�:娴佹按鍙蜂笉鑳戒负绌�!");
                             return false;
                         }
+                        //宸ュ簭涓嶄负绌�
+                        if (option.data[i]["HProcID"] == "0") {
+                            layer.msg("绗�" + (i + 1) + "琛�:宸ュ簭涓嶈兘涓虹┖!");
+                            return false;
+                        }
+                        //澶栧崗鏍囪
+                        if (option.data[i]["HSupFlag"]) {
+                            if (option.data[i]["HSupID"] == "0") {
+                                layer.msg("绗�" + (i + 1) + "琛�:渚涘簲鍟嗕笉鑳戒负绌�!");
+                                return false;
+                            }
+                        }
+
+                        //鎺掍骇宸ュ簭鏍囪
+                        if (option.data[i]["HSortProcFlag"]) {
+                            pc += 1;
+                        }
+
+                        if (pc > 1) {
+                            layer.msg("鎺掍骇宸ュ簭鏍囪鍙兘閫夋嫨涓�涓�,璇烽噸鏂伴�夋嫨!");
+                            return false;
+                        }
+
+                        //else {
+                        //    if (option.data[i]["HCenterID"] == "0") {
+                        //        layer.msg("绗�" + (i + 1) + "琛�:宸ヤ綔涓績涓嶈兘涓虹┖!");
+                        //        return false;
+                        //    }
+                        //}
+
+                        //鑹巼 澶т簬0  灏忎簬绛変簬100
+                        if (parseInt(option.data[i]["HPassRate"]) <= 0) {
+                            layer.msg("绗�" + (i + 1) + "琛�:鑹巼蹇呴』澶т簬0!");
+                            return false;
+                        }
+                        if (parseInt(option.data[i]["HPassRate"]) > 100) {
+                            layer.msg("绗�" + (i + 1) + "琛�:鑹巼蹇呴』灏忎簬绛変簬100!");
+                            return false;
+                        }
+
+
                         //浠撳簱閲嶅
                         if (option.data[i]["HBadWHID"] != 0 && option.data[i]["HWasterWHID"] != 0) {
 
@@ -1744,7 +2080,6 @@
                         }
                     }
                 }
-
                 return true;
             }
 
@@ -1783,6 +2118,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({
@@ -1792,10 +2177,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(',');
 
@@ -1867,10 +2250,19 @@
                 })
             }
             //#endregion
+            //灏唘rl鍙傛暟涓殑涓枃涔辩爜閲嶆柊杞崲鎴愪腑鏂�
+            function getParams(key) {
+                var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
+                //濡傛灉鍦板潃鏍忎腑鍑虹幇涓枃鍒欒繘琛岀紪鐮�
+                var r = encodeURI(window.location.search).substr(1).match(reg);
+                if (r != null) {
+                    //灏嗕腑鏂囩紪鐮佺殑瀛楃閲嶆柊鍙樻垚涓枃
+                    return decodeURI(unescape(r[2]));
+                }
+                return null;
+            };
 
         });
-
-
     </script>
 </body>
 </html>
\ No newline at end of file

--
Gitblit v1.9.1