From a8effe0ef3122ea93521cd2c65fdac2aa73bb0a1 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期四, 09 十一月 2023 09:02:27 +0800
Subject: [PATCH] 销售订单变更单:编辑时,物料改为不可编辑

---
 WebTM/views/计划管理/工艺路线/Gy_RoutingBill.html | 1525 ++++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 1,093 insertions(+), 432 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 dac8543..42627c2 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,11 +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; ">
-                        <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>
+                    <div style="padding: 2px; ">
+                        <!--<button type="button" id="btnSearch" style="margin-left: 0px" class="layui-btn layui-btn-normal"  lay-submit="" lay-filter="btnSearch" >棰勮</button>
+    <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">鏂板</button>
+    <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">淇敼</button>-->
+
                         <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">淇濆瓨</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnEdit" id="btnEdit">閫�鍑�</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CheckBill" id="set_CheckBill">瀹℃牳</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_AbandonCheck" id="set_AbandonCheck">鍙嶅鏍�</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CloseBill" id="set_CloseBill">鍏抽棴</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CancelCloseBill" id="set_CancelCloseBill">鍙嶅叧闂�</button>
                     </div>
                     <div class="layui-tab" lay-filter="tab-POStockInBill">
                         <ul class="layui-tab-title" lay-filter="tab-all">
@@ -69,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">
@@ -77,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;">
@@ -106,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">
@@ -137,43 +133,26 @@
                                             </div>
                                         </div>
                                         <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">宸ヨ壓璺嚎澶х被</label>
-                                            <div class="layui-input-block" style="margin-left: 77px;">
-                                                <input type="hidden" class="layui-input" lay-verify="HRoutingGroupID" name="HRoutingGroupID" id="HRoutingGroupID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
-                                                <input type="text" class="layui-input" lay-verify="HRoutingGroupIDName" name="HRoutingGroupIDName" id="HRoutingGroupIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
-                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnRoutingGroup" id="btnRoutingGroup" style="padding: 0 10px;float: right;margin-right: 3px;">
-                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" ></i>
-                                                </button>
-                                            </div>
-                                        </div>
-                                        <div class="layui-inline">
-                                            <label class="layui-form-label">鏃堕棿鍗曚綅</label>
-                                            <div class="layui-input-block" style="margin-left: 120px;width: 184px;">
-                                                <select name="HMainTimeUnit" lay-verify="HMainTimeUnit" id="HMainTimeUnit">
-                                                    <option value="灏忔椂">灏忔椂</option>
-                                                    <option value="澶�">澶�</option>
-                                                </select>
-                                            </div>
-                                        </div>
-                                        <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;">鏉愯川</label>
-                                            <div class="layui-input-block" style="margin-left: 120px;">
-                                                <input type="text" class="layui-input" name="HMaterTexture" lay-verify="HMaterTexture" id="HMaterTexture" value="" onmouseover="this.title=this.value">
+                                            <div class="layui-input-block" style="margin-left: 96px;">
+                                                <input type="checkbox" name="checkboxHStandard" id="checkboxHStandard" lay-skin="primary" lay-filter="checkboxHStandard" checked title="鏄惁榛樿宸ヨ壓">
+                                                <input type="hidden" value="true" name="HStandard" id="HStandard" lay-verify="HStandard">
+                                                <!--<input type="checkbox" name="checkboxHUseFlag" id="checkboxHUseFlag" title="鏄惁鍚敤" lay-skin="primary" lay-filter="checkboxHUseFlag">
+        <input type="hidden" value="false" name="HUseFlag" id="HUseFlag">-->
                                             </div>
                                         </div>
                                     </div>
                                     <div class="layui-row">
-                                        <div class="layui-inline">
+                                        <div class="layui-inline" id="HIDDEN" style="display:none;">
                                             <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">宸ュ簭</label>
                                             <div class="layui-input-block" style="margin-left: 77px;">
-                                                <input type="text" class="layui-input" lay-verify="HMainProcIDName" name="HMainProcIDName" id="HMainProcIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+                                                <input type="text" class="layui-input" lay-verify="HMainProcIDName" name="HMainProcIDName" id="HMainProcIDName"  value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                 <input type="hidden" class="layui-input" name="HMainProcID" id="HMainProcID" lay-verify="HMainProcID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                 <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchProc" id="btnSearchProc" style="padding: 0 10px;float: right;margin-right: 3px;">
-                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" ></i>
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                 </button>
                                             </div>
                                         </div>
-                                        <div class="layui-inline">
+                                        <!--<div class="layui-inline">
                                             <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">宸ヤ綔涓績</label>
                                             <div class="layui-input-block" style="margin-left: 77px;">
                                                 <input type="text" class="layui-input" lay-verify="HMainCenterIDName" name="HMainCenterIDName" id="HMainCenterIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
@@ -192,86 +171,73 @@
                                                     <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                 </button>
                                             </div>
-                                        </div>
-                                        <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;">鎴愬搧缂栧彿</label>
-                                            <div class="layui-input-block" style="margin-left: 115px;">
-                                                <input type="text" class="layui-input" name="HProductNum" lay-verify="HProductNum" id="HProductNum" value="" onmouseover="this.title=this.value">
-                                            </div>
-                                        </div>
+                                        </div>-->
+                                    </div>
+                                    <div class="layui-row">
+                                        <!--<div class="layui-inline">
+            <label class="layui-form-label" style="width: 85px;">鍔犲伐鏁伴噺</label>
+            <div class="layui-input-block" style="margin-left: 120px;">
+                <input type="text" class="layui-input" name="HMainWorkQty" lay-verify="HMainWorkQty" id="HMainWorkQty" value="0" onmouseover="this.title=this.value">
+            </div>
+        </div>
+        <div class="layui-inline">
+            <label class="layui-form-label" style="width: 85px;">杩愯鏃堕棿</label>
+            <div class="layui-input-block" style="margin-left: 120px;">
+                <input type="text" class="layui-input" name="HMainUnitTime" lay-verify="HMainUnitTime" id="HMainUnitTime" value="0">-->
+                                        <!--<input type="hidden" value="灏忔椂" name="HMainTimeUnit" id="HMainTimeUnit">-->
+                                        <!--</div>
+        </div>
+        <div class="layui-inline">
+            <label class="layui-form-label" style="width: 85px;">宸ヤ环</label>
+            <div class="layui-input-block" style="margin-left: 120px;">
+                <input type="text" class="layui-input" name="HMainPrice" id="HMainPrice" lay-verify="HMainPrice" value="0">
+            </div>
+        </div>-->
+                                    </div>
+                                    <div class="layui-row">
+                                        <!--<div class="layui-inline">
+            <label class="layui-form-label" style="width: 85px;">鏍囧噯璧勬簮鏁�</label>
+            <div class="layui-input-block" style="margin-left: 120px;">
+                <input type="text" class="layui-input" name="HStdSourceQty" id="HStdSourceQty" lay-verify="HStdSourceQty" value="0">-->
+                                        <!--style="background-color:#efefef4d;"-->
+                                        <!--</div>
+        </div>
+        <div class="layui-inline">
+            <label class="layui-form-label" style="width: 85px;">鍔犺祫婧愬閲�</label>
+            <div class="layui-input-block" style="margin-left: 120px;">
+                <input type="text" class="layui-input" name="HAddSourceRate" id="HAddSourceRate" lay-verify="HAddSourceRate" value="0">-->
+                                        <!--style="background-color:#efefef4d;"-->
+                                        <!--</div>
+        </div>
+        <div class="layui-inline">
+            <label class="layui-form-label" style="width: 85px;">鍑忚祫婧愬噺閲�</label>
+            <div class="layui-input-block" style="margin-left: 120px;">
+                <input type="text" class="layui-input" lay-verify="HDelSourceRate" name="HDelSourceRate" id="HDelSourceRate" value="0">-->
+                                        <!--style="background-color:#efefef4d;"-->
+                                        <!--</div>
+        </div>-->
                                     </div>
                                     <div class="layui-row">
                                         <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;">鍔犲伐鏁伴噺</label>
+                                            <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">
+                                                <input type="hidden" class="layui-input" name="HMaker" id="HMaker" lay-verify="HMaker" value="">
+                                                <input type="text" class="layui-input" name="HRemark" id="HRemark" lay-verify="HRemark" placeholder="璇疯緭鍏ュ唴瀹�" onmouseover="this.title=this.value" style=" width: 500px;">
                                             </div>
                                         </div>
-                                        <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;">杩愯鏃堕棿</label>
-                                            <div class="layui-input-block" style="margin-left: 120px;">
-                                                <input type="text" class="layui-input" name="HMainUnitTime" lay-verify="HMainUnitTime" id="HMainUnitTime" value="0">
-                                                <!--<input type="hidden" value="灏忔椂" name="HMainTimeUnit" id="HMainTimeUnit">-->
-                                            </div>
-                                        </div>
-                                        <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;">宸ヤ环</label>
-                                            <div class="layui-input-block" style="margin-left: 120px;">
-                                                <input type="text" class="layui-input" name="HMainPrice" id="HMainPrice" lay-verify="HMainPrice" value="0">
-                                            </div>
-                                        </div>
-                                        <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;">鐗堟湰</label>
-                                            <div class="layui-input-block" style="margin-left: 120px;">
-                                                <input type="text" class="layui-input" name="HVerNum" lay-verify="HVerNum" id="HVerNum" value="" onmouseover="this.title=this.value">
-                                            </div>
-                                        </div>
+                                        
+
+
                                     </div>
                                     <div class="layui-row">
                                         <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;">鏍囧噯璧勬簮鏁�</label>
-                                            <div class="layui-input-block" style="margin-left: 120px;">
-                                                <input type="text" class="layui-input" name="HStdSourceQty" id="HStdSourceQty" lay-verify="HStdSourceQty" value="0"> <!--style="background-color:#efefef4d;"-->
-                                            </div>
-                                        </div>
-                                        <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;">鍔犺祫婧愬閲�</label>
-                                            <div class="layui-input-block" style="margin-left: 120px;">
-                                                <input type="text" class="layui-input" name="HAddSourceRate" id="HAddSourceRate" lay-verify="HAddSourceRate" value="0"> <!--style="background-color:#efefef4d;"-->
-                                            </div>
-                                        </div>
-                                        <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;">鍑忚祫婧愬噺閲�</label>
-                                            <div class="layui-input-block" style="margin-left: 120px;">
-                                                <input type="text" class="layui-input" lay-verify="HDelSourceRate" name="HDelSourceRate" id="HDelSourceRate" value="0"> <!--style="background-color:#efefef4d;"-->
-                                            </div>
-                                        </div>
-                                        <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;">缁勭粐</label>
-                                            <div class="layui-input-block" style="margin-left: 120px; width: 185px;">
+                                            <label class="layui-form-label" style="width: 85px;">缁勭粐*</label>
+                                            <div class="layui-input-block" style="margin-left: 120px; width: 501px;">
                                                 <select name="HOrgID" id="HOrgID" lay-verify="HOrgID">
                                                     <!--鍔ㄦ�佹覆鏌撶粍缁�-->
                                                 </select>
                                             </div>
                                         </div>
-                                    </div>
-                                    <div class="layui-row">
-                                        <div class="layui-inline" style="width: 56%;">
-                                            <label class="layui-form-label" style="width: 85px;">澶囨敞</label>
-                                            <div class="layui-input-block" style="margin-left: 120px;">
-                                                <input type="hidden" class="layui-input" name="HMaker" id="HMaker" lay-verify="HMaker" value="">
-                                                <input type="text" class="layui-input" name="HRemark" id="HRemark" lay-verify="HRemark" placeholder="璇疯緭鍏ュ唴瀹�" onmouseover="this.title=this.value">
-                                            </div>
-                                        </div>
-                                        <div class="layui-inline">
-                                            <div class="layui-input-block" style="margin-left: 70px;">
-                                                <input type="checkbox" name="checkboxHStandard" id="checkboxHStandard" lay-skin="primary" lay-filter="checkboxHStandard" checked title="鏄惁榛樿宸ヨ壓">
-                                                <input type="hidden" value="true" name="HStandard" id="HStandard" lay-verify="HStandard">
-                                                <!--<input type="checkbox" name="checkboxHUseFlag" id="checkboxHUseFlag" title="鏄惁鍚敤" lay-skin="primary" lay-filter="checkboxHUseFlag">
-                                                <input type="hidden" value="false" name="HUseFlag" id="HUseFlag">-->
-                                            </div>
-                                        </div>
-
                                     </div>
                                 </div>
                             </div>
@@ -282,13 +248,13 @@
                                         <div class="layui-inline">
                                             <label class="layui-form-label" style="width: 85px;">鍒跺崟浜�</label>
                                             <div class="layui-input-block" style="margin-left: 120px;">
-                                                <input type="text" class="layui-input" name="" id="" style="background-color:#efefef4d;" readonly>
+                                                <input type="text" class="layui-input" name="hmakers" id="hmakers" style="background-color:#efefef4d;" readonly>
                                             </div>
                                         </div>
                                         <div class="layui-inline">
                                             <label class="layui-form-label" style="width: 85px;">瀹℃牳浜�</label>
                                             <div class="layui-input-block" style="margin-left: 120px;">
-                                                <input type="text" class="layui-input" name="" id="" style="background-color:#efefef4d;" readonly>
+                                                <input type="text" class="layui-input" name="hchecker" id="hchecker" style="background-color:#efefef4d;" readonly>
                                             </div>
                                         </div>
                                         <div class="layui-inline">
@@ -302,13 +268,13 @@
                                         <div class="layui-inline">
                                             <label class="layui-form-label" style="width: 85px;">鍒跺崟鏃ユ湡</label>
                                             <div class="layui-input-block" style="margin-left: 120px;">
-                                                <input type="text" class="layui-input" name="" id="" style="background-color:#efefef4d;" readonly>
+                                                <input type="text" class="layui-input" name="hmakedate" id="hmakedate" style="background-color:#efefef4d;" readonly>
                                             </div>
                                         </div>
                                         <div class="layui-inline">
                                             <label class="layui-form-label" style="width: 85px;">瀹℃牳鏃ユ湡</label>
                                             <div class="layui-input-block" style="margin-left: 120px;">
-                                                <input type="text" class="layui-input" name="" id="" style="background-color:#efefef4d;" readonly>
+                                                <input type="text" class="layui-input" name="hcheckdate" id="hcheckdate" style="background-color:#efefef4d;" readonly>
                                             </div>
                                         </div>
                                         <div class="layui-inline">
@@ -328,13 +294,13 @@
                                         <div class="layui-inline">
                                             <label class="layui-form-label" style="width: 85px;">淇敼浜�</label>
                                             <div class="layui-input-block" style="margin-left: 120px;">
-                                                <input type="text" class="layui-input" name="" id="" style="background-color:#efefef4d;" readonly>
+                                                <input type="text" class="layui-input" name="hupdater" id="hupdater" style="background-color:#efefef4d;" readonly>
                                             </div>
                                         </div>
                                         <div class="layui-inline">
                                             <label class="layui-form-label" style="width: 85px;">浣滃簾浜�</label>
                                             <div class="layui-input-block" style="margin-left: 120px;">
-                                                <input type="text" class="layui-input" name="" id="" style="background-color:#efefef4d;" readonly>
+                                                <input type="text" class="layui-input" name="hdeleteman" id="hdeleteman" style="background-color:#efefef4d;" readonly>
                                             </div>
                                         </div>
                                     </div>
@@ -348,13 +314,75 @@
                                         <div class="layui-inline">
                                             <label class="layui-form-label" style="width: 85px;">淇敼鏃ユ湡</label>
                                             <div class="layui-input-block" style="margin-left: 120px;">
-                                                <input type="text" class="layui-input" name="" id="" style="background-color:#efefef4d;" readonly>
+                                                <input type="text" class="layui-input" name="hupdatedate" id="hupdatedate" style="background-color:#efefef4d;" readonly>
                                             </div>
                                         </div>
                                         <div class="layui-inline">
                                             <label class="layui-form-label" style="width: 85px;">浣滃簾鏃ユ湡</label>
                                             <div class="layui-input-block" style="margin-left: 120px;">
-                                                <input type="text" class="layui-input" name="" id="" style="background-color:#efefef4d;" readonly>
+                                                <input type="text" class="layui-input" name="hdeletedate" id="hdeletedate" style="background-color:#efefef4d;" readonly>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label">鏃堕棿鍗曚綅</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;width: 184px;">
+                                                <select name="HMainTimeUnit" lay-verify="HMainTimeUnit" id="HMainTimeUnit">
+                                                    <option value="灏忔椂">灏忔椂</option>
+                                                    <option value="澶�">澶�</option>
+                                                    <option value="澶�">澶�</option>
+                                                </select>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">鏉愯川</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="text" class="layui-input" name="HMaterTexture" lay-verify="HMaterTexture" id="HMaterTexture" value="" onmouseover="this.title=this.value">
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">鍥惧彿鐗堟湰</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="text" class="layui-input" lay-verify="HPicNumVer" name="HPicNumVer" id="HPicNumVer">
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">鎬昏鍥惧彿</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="text" class="layui-input" name="HPicNumAssemble" id="HPicNumAssemble" onmouseover="this.title=this.value">
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">宸ヨ壓璺嚎澶х被</label>
+                                            <div class="layui-input-block" style="margin-left: 77px;">
+                                                <input type="hidden" class="layui-input" lay-verify="HRoutingGroupID" name="HRoutingGroupID" id="HRoutingGroupID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+                                                <input type="text" class="layui-input" lay-verify="HRoutingGroupIDName" name="HRoutingGroupIDName" id="HRoutingGroupIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnRoutingGroup" id="btnRoutingGroup" style="padding: 0 10px;float: right;margin-right: 3px;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
+                                                </button>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">鎴愬搧缂栧彿</label>
+                                            <div class="layui-input-block" style="margin-left: 115px;">
+                                                <input type="text" class="layui-input" name="HProductNum" lay-verify="HProductNum" id="HProductNum" value="" onmouseover="this.title=this.value">
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">鐗堟湰</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="text" class="layui-input" name="HVerNum" lay-verify="HVerNum" id="HVerNum" value="" onmouseover="this.title=this.value">
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <div class="layui-input-block" style="margin-left: 185px;">
+                                                <input type="checkbox" name="checkboxIsProNo" id="checkboxIsProNo" lay-skin="primary" lay-filter="checkboxIsProNo" title="杞伐搴�">
+                                                <input type="hidden" value="1" name="IsProNo" id="IsProNo" lay-verify="IsProNo">
                                             </div>
                                         </div>
                                     </div>
@@ -368,6 +396,10 @@
                         <div class="layui-btn-container">
                             <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>澧炲姞涓�琛�</button>
                             <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>澶嶅埗涓�琛�</button>
+                            <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>
+                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn_up"><i class="layui-icon layui-icon-form"></i>涓婁竴琛�</button>
+                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn_under"><i class="layui-icon layui-icon-form"></i>涓嬩竴琛�</button>
+                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn_Refresh"><i class="layui-icon layui-icon-form"></i>鍒锋柊娴佹按鍙�</button>
                         </div>
                     </script>
                 </form>
@@ -398,14 +430,14 @@
     <!--澶嶉�夋 涓嬮亾娴佽浆宸ュ簭-->
     <script type="text/html" id="HNextProcFlag">
         <div class="layui-input-block" style="margin-left: 20px;">
-            <input type="checkbox" name="HNextProcFlag" lay-filter="HNextProcFlag" id="HNextProcFlag{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
+            <input type="checkbox" name="HNextProcFlag" disabled="disabled"  lay-filter="HNextProcFlag" id="HNextProcFlag{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
         </div>
     </script>
 
     <!--澶嶉�夋 娴佽浆宸ュ簭-->
     <script type="text/html" id="HFlowProc">
         <div class="layui-input-block" style="margin-left: 20px;">
-            <input type="checkbox" name="HFlowProc" lay-filter="HFlowProc" id="HFlowProc{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
+            <input type="checkbox" name="HFlowProc" disabled="disabled" lay-filter="HFlowProc" id="HFlowProc{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
         </div>
     </script>
 
@@ -446,124 +478,106 @@
 
             //鍒濆琛ㄦ牸鏁版嵁
             var rowdata = [{
-                "HProcNo": "", "HProcID_S": 0, "HProcType": "涓诲伐搴�", "HCenterID_S": 0, "HCenterID_SName": ""
+                "HProcNo": "10", "HProcID_S": 0, "HProcType": "涓诲伐搴�", "HCenterID_S": 0, "HCenterID_SName": ""
                 , "HWorkQty_S": 0, "HSubStdEmpQty_S": 0, "HMouldNo": "", "HChangeMould": 0, "HPackStd": ""
                 , "HPack": "", "HPutArea": "", "HMyWorkDays": 0, "HMyFixWorkDays": 0, "宸ュ簭": ""
                 , "HProcID": 0, "宸ヤ綔涓績浠g爜": "", "HCenterID": 0, "宸ヤ綔涓績": "", "HSupID": 0
                 , "渚涘簲鍟嗕唬鐮�": "", "渚涘簲鍟�": "", "HSupFlag": false, "HTimeUnit": "", "HUnitTime": 0
-                , "HWorkQty": 1, "HPassRate": 0, "HOverRate": 0, "HReadyTime": 0, "HQueueTime": 0
+                , "HWorkQty": 1, "HPassRate": 100, "HOverRate": 0, "HReadyTime": 0, "HQueueTime": 0
                 , "HMoveTime": 0, "HNextProcFlag": false, "HFlowProc": false, "HSubStdEmpQty": 0, "HSubCanUseSourceQty": 0
                 , "HFixPrice": 0, "HProcPrice": 0, "HBadPrice": 0, "HWasterPrice": 0, "HStdFlag": false
                 , "HBeginDayQty": 0, "HBeginFixQty": 0, "HFixWorkDays": 0, "HTrunWorkDays": 0, "HReadyTimes": 0
                 , "HICMOReadyTimes": 0, "HAutoTrunFlag": false, "HTechnologyParameter": "", "HPicNum": "", "HProcCheckNote": ""
-                , "HProcWorkNum": ""
+                , "HProcWorkNum": "", "HBadWHID": 0, "HBadWHName": "", "HWasterWHID": 0, "HWasterWHName": ""
+                , "HWHID": 0, "HWHName": "", "HRemark": ""
+                , "HQCSchemeID_Fst": 0, "HQCSchemeNumber_Fst": "", "HQCSchemeName_Fst": ""
+                , "HQCSchemeID_Proc": 0, "HQCSchemeNumber_Proc": "", "HQCSchemeName_Proc": ""
+                , "HQCSchemeID_Patrol": 0, "HQCSchemeNumber_Patrol": "", "HQCSchemeName_Patrol": ""
             }];
-
+            var HModName = "Gy_RoutingBill";
             //#endregion
 
             //#region 杩涘叆椤甸潰鍗冲姞杞�
-
-            //鍒跺崟浜�
-            $("#HMaker").val(sessionStorage["HUserName"]);
-            //缁勭粐
-            Organ();
-
-            //鍒ゆ柇鏄惁鐧诲綍 鏈櫥褰曞垯璺冲埌鐧诲綍椤�
-            //if (sessionStorage.login != "login") {
-            //    layer.confirm("鐧诲綍澶辨晥锛岃閲嶆柊鐧诲綍锛�", {
-            //        icon: 4, skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", closeBtn: 0, btn: ['閲嶆柊鐧诲綍']
-            //    }, function () { window.location.href = "../../user/login.html"; });
-            //}
-
-            var params = getUrlVars();
-            var OperationType = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鏁版嵁绫诲瀷  娣诲姞 淇濆瓨
-            var linterid = params[params[1]]; //浠庡弬鏁颁腑鑾峰彇 鍗曟嵁鍐呯爜
-            var lSourceBillType = params[params[2]];  //浠庡崟鎹幏鍙� 婧愬崟绫诲瀷
-            //var linteridSub = params[params[3]];  //浠庡弬鏁拌幏鍙� 瀛愯〃绾у埆
-
-            //鍒ゆ柇鏄惁鏂板
-            if (linterid == null || linterid == 0) {
-                //linteridSub = -1;
-                OperationType = 1;
-                $.ajax({
-                    url: GetWEBURL() + "/Web/GetMAXNum",
-                    type: "GET",
-                    data: { "HBillType": '3301' },
-                    success: function (d) {
-                        //console.log(d.data);
-                        $("#HInterID").val(d.data[0].HInterID);
-                        $("#HBillNo").val(d.data[0].HBillNo);
-                        $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
-                    }
-                });
-            }
-            else {//濡傛灉淇敼鍒欒蛋涓嬮潰 new
-                //绂佺敤缁勭粐閫夐」
-                $("#HOrgID").attr("disabled", true);
-                RoadBillMain(linterid);
-                //RoadBillSub(linterid);
-            }
 
             var option = {
                 elem: '#mainTable'
                 , toolbar: '#toolbarDemo'
                 , limit: 500 //姣忛〉榛樿鏄剧ず鐨勬暟閲�
-                , cellMinWidth: 120
+                //, cellMinWidth: 120
                 , height: 400
                 , cols: [[ //琛ㄥご
                     { type: 'checkbox', totalRowText: '鍚堣琛�' }
                     , { type: 'numbers', title: '搴忓彿', totalRow: true }
                     , { field: 'HProcNo', title: '娴佹按鍙�', edit: 'text' }
-                    , { field: 'HProcID_S', title: '宸ユ', edit: 'text' }
-                    , { field: 'HProcType', title: '宸ュ簭绫诲瀷', templet: '#HProcType' }//閫夋嫨
-                    , { field: 'HCenterID_SName', title: '浜х嚎涓績', edit: 'text', event: "CheckHCenterID_S" }//f7
-                    , { field: 'HCenterID_S', title: '浜х嚎涓績id', hide: true }//hide: true
-                    , { field: 'HWorkQty_S', title: '浜х嚎浜ц兘', edit: 'text' }
-                    , { field: 'HSubStdEmpQty_S', title: '浜х嚎浜烘暟', edit: 'text' }
-                    , { field: 'HMouldNo', title: '妯″叿缂栧彿', edit: 'text' }
-                    , { field: 'HChangeMould', title: '鎹㈡ā鏃堕棿', edit: 'text' }
-                    , { field: 'HPackStd', title: '鍛ㄨ浆绠辨爣鍑�', edit: 'text' }
-                    , { field: 'HPack', title: '鍛ㄨ浆绠�', edit: 'text' }
-                    , { field: 'HPutArea', title: '鏆傛斁鍖�', edit: 'text' }
-                    , { field: 'HMyWorkDays', title: '鐢熶骇鍛ㄦ湡', edit: 'text' }
-                    , { field: 'HMyFixWorkDays', title: '鍥哄畾鐢熶骇澶╂暟', edit: 'text' }
+                      // , { field: 'HProcID', title: '宸ュ簭ID', hide: true }//, hide: true
                     , { field: '宸ュ簭', title: '宸ュ簭', edit: 'text', event: "CheckHProcID" }//f7
-                    , { field: 'HProcID', title: '宸ュ簭ID', hide: true }//, hide: true
-                    , { field: '宸ヤ綔涓績浠g爜', title: '宸ヤ綔涓績浠g爜' }//涓嶅~
-                    , { 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: '宸ヤ綔涓績浠g爜', title: '宸ヤ綔涓績浠g爜', edit: 'text', event: "CheckHCenterID" }//涓嶅~
+                    // , { field: 'HCenterID', title: '宸ヤ綔涓績id', hide: true }//, hide: true
+                    , { field: '宸ヤ綔涓績', title: '宸ヤ綔涓績' }//f7
                     , { field: 'HTechnologyParameter', title: '宸ヨ壓鍙傛暟', edit: 'text' }
-                    , { field: 'HPicNum', title: '鍥剧焊缂栧彿', edit: 'text' }
-                    , { field: 'HProcCheckNote', title: '鏈伐搴忕‘璁よ褰�', edit: 'text' }
-                    , { field: 'HProcWorkNum', title: '绋嬪簭鍙�', edit: 'text' }
+                    , { field: 'HRemark', title: '澶囨敞', edit: 'text' }
+                    // , { field: 'HSupID', title: '渚涘簲鍟咺D', hide: true }
+                    , { field: '渚涘簲鍟嗕唬鐮�', title: '渚涘簲鍟嗕唬鐮�', edit: 'text', width: 110, event: "CheckHSupID" }
+                    , { field: '渚涘簲鍟�', title: '渚涘簲鍟�' }//f7
+                    , { field: 'HSupFlag', title: '澶栧崗鏍囪', templet: "#HSupFlag" }//checkbox
+
+                    //, { field: 'HProcType', title: '宸ュ簭绫诲瀷', templet: '#HProcType' }//閫夋嫨
+                    ////, { field: 'HBadWHID', title: 'HBadWHID', hide: true }//, hide: true
+                    //, { field: 'HBadWHName', title: '涓嶈壇鍝佷粨', edit: 'text', event: "HBadWHID" }//f7
+                    //// , { field: 'HWasterWHID', title: 'HWasterWHID', hide: true }//, hide: true
+                    //, { field: 'HWasterWHName', title: '鎶ュ簾鍝佷粨', edit: 'text', event: "HWasterWHID" }//f7
+                    //// , { field: 'HWHID', title: 'HWHID', hide: true }//, hide: true
+                    //, { field: 'HWHName', title: '鑹搧浠�', edit: 'text', event: "HWHID" }//f7
+                    //, { field: 'HMouldNo', title: '妯″叿缂栧彿', edit: 'text' }
+                    //, { field: 'HPicNum', title: '鍥剧焊缂栧彿', edit: 'text' }
+                    //, { field: 'HTimeUnit', title: '鏃堕棿鍗曚綅', edit: 'text' }
+                    //, { field: 'HUnitTime', title: '杩愯鏃堕棿', edit: 'text' }
+                    , { field: 'HWorkQty', title: '鍔犲伐鏁伴噺', edit: 'text' }//榛樿
+
+                    //, { field: 'HQCSchemeID_Fst', title: '棣栦欢妫�楠屾柟妗圛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' }
                     , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo' }
                 ]]
                 //, done: function (res, curr, count) {
@@ -588,6 +602,80 @@
             //鍒濆鍔犺浇琛ㄦ牸
             option.data = rowdata;
             table.render(option);
+            //鍒濆鍖栬〃鏍�
+            DisPlay_HideColumn();
+
+            //鍒跺崟浜�
+            $("#HMaker").val(sessionStorage["HUserName"]);
+            $("#hmakers").val(sessionStorage["HUserName"]);
+            $("#hmakedate").val(Format(new Date(), "yyyy-MM-dd"));
+            //缁勭粐
+            Organ();
+
+            //鍒ゆ柇鏄惁鐧诲綍 鏈櫥褰曞垯璺冲埌鐧诲綍椤�
+            //if (sessionStorage.login != "login") {
+            //    layer.confirm("鐧诲綍澶辨晥锛岃閲嶆柊鐧诲綍锛�", {
+            //        icon: 4, skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", closeBtn: 0, btn: ['閲嶆柊鐧诲綍']
+            //    }, function () { window.location.href = "../../user/login.html"; });
+            //}
+
+            var params = getUrlVars();
+            var OperationType = params[params[0]]; //浠庡弬鏁颁腑鑾峰彇 鏁版嵁绫诲瀷  1娣诲姞 淇濆瓨  2澶嶅埗  3 缂栬緫 4娣诲姞瀛愬伐鑹鸿矾绾�
+            var linterid = params[params[1]]; //浠庡弬鏁颁腑鑾峰彇 鍗曟嵁鍐呯爜
+            var HBillSubType = params[params[2]];  //浠庡崟鎹幏鍙� 婧愬崟绫诲瀷
+            //var linteridSub = params[params[3]];  //浠庡弬鏁拌幏鍙� 瀛愯〃绾у埆
+
+            if (HBillSubType == "SUB") {
+                //鏄剧ず宸ュ簭
+                $("#HIDDEN").show();
+            } else {
+                HBillSubType = "3301";
+            }
+
+            //鍒ゆ柇鏄惁鏂板
+            if (linterid == null || linterid == 0) {
+                //$("#HIDDEN").hide();
+                OperationType = 1;
+
+                $.ajax({
+                    url: GetWEBURL() + "/Web/GetMAXNum",
+                    type: "GET",
+                    data: { "HBillType": '3301' },
+                    success: function (d) {
+                        //console.log(d.data);
+                        $("#HInterID").val(d.data[0].HInterID);
+                        $("#HBillNo").val(d.data[0].HBillNo);
+                        $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+                    }
+                });
+            }
+            else if (OperationType == 2) {
+                //绂佺敤缁勭粐閫夐」
+                //$("#HOrgID").attr("disabled", true);
+                RoadBillMain(linterid);
+                $.ajax({
+                    url: GetWEBURL() + "/Web/GetMAXNum",
+                    type: "GET",
+                    async: false,
+                    data: { "HBillType": '3301' },
+                    success: function (d) {
+                        $("#HInterID").val(d.data[0].HInterID);
+                        $("#HBillNo").val(d.data[0].HBillNo);
+                        $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+                    }
+                });
+            }
+            else {//濡傛灉淇敼鍒欒蛋涓嬮潰 new
+
+                //绂佺敤缁勭粐閫夐」
+                $("#HOrgID").attr("disabled", true);
+                RoadBillMain(linterid);
+                //RoadBillSub(linterid);
+            }
+            //璁剧疆杞伐搴�
+            get_xt();
+
+
 
             //#endregion
 
@@ -623,10 +711,41 @@
                 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) {
                 $("#HStandard").val(data.elem.checked);
+            });
+
+            //鏄惁杞伐搴�
+            form.on('checkbox(checkboxIsProNo)', function (data) {
+
+                if (data.elem.checked) {
+                    $("#IsProNo").val("1");
+                }
+                else {
+                    $("#IsProNo").val("0");
+                }
             });
 
             //#region 澶嶉�夋
@@ -708,25 +827,29 @@
             table.on('toolbar(mainTable)', function (obj) {
                 var checkStatus = table.checkStatus('mainTable')
                     , data = checkStatus.data;
+
                 //鏂板琛岃〃鏍兼暟鎹�
                 var NewRow = {
-                    "HProcNo": "", "HProcID_S": 0, "HProcType": "涓诲伐搴�", "HCenterID_S": 0, "HCenterID_SName": ""
+                    "HProcNo": (table.cache["mainTable"].length + 1) * 10, "HProcID_S": 0, "HProcType": "涓诲伐搴�", "HCenterID_S": 0, "HCenterID_SName": ""
                     , "HWorkQty_S": 0, "HSubStdEmpQty_S": 0, "HMouldNo": "", "HChangeMould": 0, "HPackStd": ""
                     , "HPack": "", "HPutArea": "", "HMyWorkDays": 0, "HMyFixWorkDays": 0, "宸ュ簭": ""
                     , "HProcID": 0, "宸ヤ綔涓績浠g爜": "", "HCenterID": 0, "宸ヤ綔涓績": "", "HSupID": 0
                     , "渚涘簲鍟嗕唬鐮�": "", "渚涘簲鍟�": "", "HSupFlag": false, "HTimeUnit": "", "HUnitTime": 0
-                    , "HWorkQty": 1, "HPassRate": 0, "HOverRate": 0, "HReadyTime": 0, "HQueueTime": 0
+                    , "HWorkQty": 1, "HPassRate": 100, "HOverRate": 0, "HReadyTime": 0, "HQueueTime": 0
                     , "HMoveTime": 0, "HNextProcFlag": false, "HFlowProc": false, "HSubStdEmpQty": 0, "HSubCanUseSourceQty": 0
                     , "HFixPrice": 0, "HProcPrice": 0, "HBadPrice": 0, "HWasterPrice": 0, "HStdFlag": false
                     , "HBeginDayQty": 0, "HBeginFixQty": 0, "HFixWorkDays": 0, "HTrunWorkDays": 0, "HReadyTimes": 0
                     , "HICMOReadyTimes": 0, "HAutoTrunFlag": false, "HTechnologyParameter": "", "HPicNum": "", "HProcCheckNote": ""
-                    , "HProcWorkNum": ""
+                    , "HProcWorkNum": "", "HBadWHID": 0, "HBadWHName": "", "HWasterWHID": 0, "HWasterWHName": ""
+                    , "HWHID": 0, "HWHName": "", "HRemark": ""
+                    , "HQCSchemeID_Fst": 0, "HQCSchemeNumber_Fst": "", "HQCSchemeName_Fst": ""
+                    , "HQCSchemeID_Proc": 0, "HQCSchemeNumber_Proc": "", "HQCSchemeName_Proc": ""
+                    , "HQCSchemeID_Patrol": 0, "HQCSchemeNumber_Patrol": "", "HQCSchemeName_Patrol": ""
                 };
                 switch (obj.event) {
                     case 'btn-AddLine':
                         table.cache["mainTable"].push(NewRow);
                         option.data = table.cache["mainTable"];
-
                         table.render(option);
 
                         for (var i = 1; i <= option.data.length; i++) {
@@ -796,6 +919,22 @@
                             form.render('checkbox');
                         }
                         break;
+                    //鍒楄缃�
+                    case 'set_HideColumn':
+                        get_HideColumn();
+                        break; 
+                    //涓婁竴琛�
+                    case 'btn_up':
+                        btn_up(data);
+                        break; 
+                    //涓嬩竴琛�
+                    case 'btn_under':
+                        btn_under(data);
+                        break; 
+                    //鍒锋柊娴佹按鍙�
+                    case 'btn_Refresh':
+                        btn_Refresh(data);
+                        break; 
                 }
             });
 
@@ -806,6 +945,22 @@
 
             });
 
+            //琛屽唴榧犳爣绂诲紑浜嬩欢
+            table.on('edit(mainTable)', function (obj) {
+                if (obj.field == "HProcNo") {
+                    var num = 0;
+                    for (var i = 0; i < option.data.length; i++) {
+                        if (obj.value == option.data[i]["HProcNo"]) {
+                            num += 1;
+                        }
+                        if (num > 1) {
+                            layer.msg("娴佹按鍙�:" + obj.value + "閲嶅!");
+                            return false;
+                        }
+                    }
+                }
+            })
+
             $('#HName').on('keydown', function (event) {//宸ヨ壓璺嚎鍚嶇О
                 if (event.keyCode == 118) {
                     layer.msg("宸ヨ壓璺嚎鍚嶇ОF7鎸夐挳")
@@ -815,152 +970,17 @@
             //淇濆瓨鎻愪氦
             form.on('submit(btnSave)', function (data) {//鎻愪氦
                 if (AllowLoadData(data)) {
-                set_AddNew(data);
+                    set_AddNew(data);
                 }
             });
 
-            //閫夋嫨涓嶈壇鍘熷洜
-            form.on('submit(HBadReasonID-BT)', function () {//閫夋嫨浠撳簱
-                layer.open({
-                    type: 2
-                    , area: ['80%', '80%']
-                    , title: '涓嶈壇鍘熷洜鍒楄〃'
-                    , shade: 0.6 //閬僵閫忔槑搴�
-                    , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
-                    , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
-                    , content: ['../../../views/Baseset/鍩虹璧勬枡/Gy_BadReasonList.html', 'yes']
-                    , resize: false
-                    , cancel: function () {
-                        //$(".layui-btn").removeClass("layui-btn-disabled");
-                    }
-                })
-            });
-
-            //閫夋嫨宸ュ簭璁″垝鍗�
-            form.on('submit(HPlanID-BT)', function () {//閫夋嫨宸ュ簭璁″垝鍗�
-                layer.open({
-                    type: 2
-                    , area: ['80%', '80%']
-                    , title: '宸ュ簭璁″垝鍗曞垪琛�'
-                    , shade: 0.6 //閬僵閫忔槑搴�
-                    , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
-                    , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
-                    , content: ['../../../views/Baseset/鍩虹璧勬枡/Sc_ProcessPlanViewList.html', 'yes']
-                    , resize: false
-                    , cancel: function () {
-                        //$(".layui-btn").removeClass("layui-btn-disabled");
-                    }
-                })
-            });
-
-            //閫夋嫨璐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);
-                        }
-                    });
+            //閫�鍑�
+            form.on('submit(btnEdit)', function (data) {
+                if (params[1] != null) {
+                    Pub_Close(1);
+                } else if (params[1] == null) {
+                    Pub_Close(2);
+                }
             });
 
             //鐩戝惉鎻愪氦
@@ -1025,6 +1045,11 @@
                         $("#HMaterName").val(checkStatus.data[0].HName);//鐗╂枡鍚嶇О
                         $("#HMaterNumber").val(checkStatus.data[0].HNumber);//鐗╂枡浠g爜
                         $("#HMaterModel").val(checkStatus.data[0].HModel);//瑙勬牸鍨嬪彿
+                        $("#HUnitID").val(checkStatus.data[0].HUnitID);//璁¢噺鍗曚綅id
+                        $("#HUnitName").val(checkStatus.data[0].HUnitName);//璁¢噺鍗曚綅鍚嶇О
+                        if ($("#HName").val() == "") {
+                            $("#HName").val(checkStatus.data[0].HNumber);
+                        }
 
                         layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨�
                     }
@@ -1179,17 +1204,136 @@
                 var rowIndex = $(obj.tr).attr("data-index");
                 if (obj.event === 'del') {
                     layer.confirm('鐪熺殑鍒犻櫎琛屽悧锛�', function (index) {
-                        console.log("绱㈠紩涓�:" + rowIndex);
                         if (rowIndex === '0') {
                             layer.msg('棣栬鏃犳硶鍒犻櫎锛侊紒锛�');
                         } else {
-                            obj.del();
-                            option.data = table.cache["mainTable"];//灏嗘暟鎹粦瀹氬埌data涓�
-                            table.reload(option);
+                            var oldData = table.cache["mainTable"];
+                            oldData.splice(obj.tr.data('index'), 1)
+                            option.data = oldData;//灏嗘暟鎹粦瀹氬埌data涓�
+                            table.render(option);
                             layer.close(index);
                         }
                     });
                 }
+            }
+
+            //鑾峰彇 杞伐搴� 绯荤粺鍙傛暟
+            function get_xt() {
+                $.ajax({
+                    type: "get",
+                    url: GetWEBURL() + '/LEMS/MES_XT_List',
+                    async: false,
+                    data: { "sWhere": "" },
+                    success: function (result) {
+                        if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                            if (result.data.Gy_RoutingBill_SaveAutoLastProc == "Y") {
+                                $("#IsProNo").val("1");
+                                $("input[name='checkboxIsProNo']").prop("checked", true);
+                                form.render("checkbox");
+                            } else {
+                                $("#IsProNo").val("0");
+                                $("input[name='checkboxIsProNo']").prop("checked", false);
+                            }
+                        }
+                        layer.closeAll("loading");
+                    }
+                })
+            }
+
+            //瀹℃牳
+            function set_CheckBill() {
+                layer.confirm("纭瑕佸鏍稿悧?", function (index) {
+                    var wait = layer.load();
+                    $.ajax({
+                        url: GetWEBURL() + '/Gy_RoutingBill/AuditGy_RoutingBill',
+                        type: "GET",
+                        data: { "HInterID": $("#HInterID").val(), "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
+                        success: function (result) {
+                            if (result.count == 1) {
+                                layer.msg(result.Message, { icon: 1 });
+                                layer.close(wait);
+                            } else {
+                                layer.alert(result.code + result.Message, { icon: 5 });
+                                layer.close(wait);
+                            }
+                        }, error: function () {
+                            layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                            layer.close(wait);
+                        }
+                    });
+                })
+            }
+
+            //鍙嶅鏍�
+            function set_AbandonCheck() {
+                layer.confirm("纭瑕佸弽瀹℃牳鍚�?", function (index) {
+                    var wait = layer.load();
+                    $.ajax({
+                        url: GetWEBURL() + '/Gy_RoutingBill/AuditGy_RoutingBill',
+                        type: "GET",
+                        data: { "HInterID": $("#HInterID").val(), "IsAudit": 1, "CurUserName": sessionStorage["HUserName"] },
+                        success: function (result) {
+                            if (result.count == 1) {
+                                layer.msg(result.Message, { icon: 1 });
+                                layer.close(wait);
+                            } else {
+                                layer.alert(result.code + result.Message, { icon: 5 });
+                                layer.close(wait);
+                            }
+                        }, error: function () {
+                            layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                            layer.close(wait);
+                        }
+                    });
+                })
+            }
+
+            //鍏抽棴
+            function set_CloseBill() {
+                layer.confirm("纭瑕佸叧闂悧?", function (index) {
+                    var wait = layer.load();
+                    $.ajax({
+                        url: GetWEBURL() + '/Gy_RoutingBill/CloseGy_RoutingBill',
+                        type: "GET",
+                        data: { "HInterID": $("#HInterID").val(), "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
+                        success: function (result) {
+                            if (result.count == 1) {
+                                layer.msg(result.Message, { icon: 1 });
+                                layer.close(wait);
+                            } else {
+                                layer.alert(result.code + result.Message, { icon: 5 });
+                                layer.close(wait);
+                            }
+                        }, error: function () {
+                            layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                            layer.close(wait);
+                        }
+                    });
+                })
+            }
+
+            //鍙嶅叧闂�
+            function set_CancelCloseBill() {
+                layer.confirm("纭瑕佸弽鍏抽棴鍚�?", function (index) {
+                    var wait = layer.load();
+                    $.ajax({
+                        url: GetWEBURL() + '/Gy_RoutingBill/CloseGy_RoutingBill',
+                        type: "GET",
+                        data: { "HInterID": $("#HInterID").val(), "IsAudit": 1, "CurUserName": sessionStorage["HUserName"] },
+                        success: function (result) {
+                            if (result.count == 1) {
+                                layer.msg(result.Message, { icon: 1 });
+                                layer.close(wait);
+                            } else {
+                                layer.alert(result.code + result.Message, { icon: 5 });
+                                layer.close(wait);
+                            }
+                        }, error: function () {
+                            layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                            layer.close(wait);
+                        }
+                    });
+                })
             }
 
             //琛屽唴鍒犻櫎蹇嵎閿�
@@ -1228,7 +1372,7 @@
                         }
                         //宸ュ簭
                         if (obj.event == "CheckHProcID") {
-                            //鎵撳紑浜哄憳琛�  灏忕獥浣�
+                            // 灏忕獥浣�
                             layer.open({
                                 type: 2
                                 , skin: "layui-layer-rim" //鍔犱笂杈规
@@ -1237,21 +1381,116 @@
                                 , shift: 2 //寮瑰嚭鍔ㄧ敾
                                 , area: ["90%", "90%"] //绐椾綋澶у皬
                                 , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
-                                , content: ["../../Baseset/鍩虹璧勬枡/Gy_ProcList.html", "yes"]
+                                , content: ["../../鍩虹璧勬枡/鐢熶骇鍩虹璧勬枡/Gy_Process.html", "yes"]
                                 , btn: ["纭畾", "鍙栨秷"]
                                 , btn1: function (index, laero) {
                                     //鎸夐挳涓�  鐨勫洖璋�
                                     var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰
                                     var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹�
 
-                                    if (checkStatus.data.length != 1) {
-                                        return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�");
+                                    if (checkStatus.data.length ==0) {
+                                        return layer.msg("璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�!");
                                     }
-                                    //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
-                                    obj.update({
-                                        "宸ュ簭": checkStatus.data[0].宸ュ簭
-                                        , "HProcID": checkStatus.data[0].HItemID
-                                    })
+
+                                    //鑾峰彇宸ュ簭浠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_SOPBillList/WindowPrintList", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                                        async: false,
+                                        data: { "sWhere": sWhere },
+                                        success: function (data) {
+                                            if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                                                WorkCente = data.data;
+                                            }
+                                            else {
+                                                layer.msg(data.Message, { icon: 5 });
+                                            }
+                                            layer.closeAll("loading");
+                                        },
+                                        error: function (err) {
+                                            layer.msg("閿欒:" + err, { icon: 5 });
+                                        }
+                                    });
+
+                                    //鍒ゆ柇閫夋嫨鐨勬暟鎹�绘暟 鏄惁澶т簬琛ㄦ牸鐜版湁鐨勬暟鎹�
+                                    if (ProcessNumber.length > option.data.length - (NowNum - 1)) {
+                                        //鑾峰彇琛ㄦ牸鍓╀綑琛屾暟閲�
+                                        var num = ProcessNumber.length - option.data.length + (NowNum - 1);
+                                        //寰幆璧嬪��  鍦ㄥ凡鏈夌殑琛ㄦ牸璧嬪��
+                                        var j = 0;
+                                        for (var i = (NowNum - 1); i < option.data.length; i++) {
+                                            option.data[i]["宸ュ簭"] = WorkCente[j]["宸ュ簭鍚嶇О"];
+                                            option.data[i]["HProcID"] = WorkCente[j]["HProcID"];
+                                            option.data[i]["宸ヤ綔涓績"] = WorkCente[j]["宸ヤ綔涓績鍚嶇О"];
+                                            option.data[i]["HCenterID"] = WorkCente[j]["HCenterID"];
+                                            option.data[i]["宸ヤ綔涓績浠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, "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": ""
+                                                , "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);//鍏抽棴寮圭獥
                                 }
                             })
@@ -1262,7 +1501,7 @@
                             layer.open({
                                 type: 2
                                 , skin: "layui-layer-rim" //鍔犱笂杈规
-                                , title: "浜哄憳鍒楄〃"  //鏍囬
+                                , title: "宸ヤ綔涓績鍒楄〃"  //鏍囬
                                 , closeBtn: 1  //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
                                 , shift: 2 //寮瑰嚭鍔ㄧ敾
                                 , area: ["90%", "90%"] //绐椾綋澶у皬
@@ -1298,7 +1537,7 @@
                                 , shift: 2 //寮瑰嚭鍔ㄧ敾
                                 , area: ["90%", "90%"] //绐椾綋澶у皬
                                 , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
-                                , content: ["../../Baseset/鍩虹璧勬枡/Gy_SupplierList.html", "yes"]
+                                , content: ["../../鍩虹璧勬枡/閲囪喘鍩虹璧勬枡/Gy_Supplier.html", "yes"]
                                 , btn: ["纭畾", "鍙栨秷"]
                                 , btn1: function (index, laero) {
                                     //鎸夐挳涓�  鐨勫洖璋�
@@ -1310,14 +1549,186 @@
                                     }
                                     //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
                                     obj.update({
-                                        "渚涘簲鍟�": checkStatus.data[0].HName
+                                        "渚涘簲鍟�": checkStatus.data[0].渚涘簲鍟嗗悕绉�
                                         , "HSupID": checkStatus.data[0].HItemID
-                                        , "渚涘簲鍟嗕唬鐮�": checkStatus.data[0].HNumber
+                                        , "渚涘簲鍟嗕唬鐮�": checkStatus.data[0].渚涘簲鍟嗕唬鐮�
                                     })
                                     layer.close(index);//鍏抽棴寮圭獥
                                 }
                             })
                         }
+                        //涓嶈壇鍝佷粨
+                        if (obj.event == "HBadWHID") {
+                            //鎵撳紑浜哄憳琛�  灏忕獥浣�
+                            layer.open({
+                                type: 2
+                                , skin: "layui-layer-rim" //鍔犱笂杈规
+                                , title: "浠撳簱鍒楄〃"  //鏍囬
+                                , closeBtn: 1  //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+                                , shift: 2 //寮瑰嚭鍔ㄧ敾
+                                , area: ["90%", "90%"] //绐椾綋澶у皬
+                                , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                                , content: ["../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Warehouse.html", "yes"]
+                                , btn: ["纭畾", "鍙栨秷"]
+                                , btn1: function (index, laero) {
+                                    //鎸夐挳涓�  鐨勫洖璋�
+                                    var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰
+                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹�
+
+                                    if (checkStatus.data.length != 1) {
+                                        return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�");
+                                    }
+                                    //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                                    obj.update({
+                                        "HBadWHID": checkStatus.data[0].HItemID
+                                        , "HBadWHName": checkStatus.data[0].浠撳簱鍚嶇О
+                                    })
+                                    layer.close(index);//鍏抽棴寮圭獥
+                                }
+                            })
+                        }
+
+                        //鑹搧浠�
+                        if (obj.event == "HWHID") {
+                            //鎵撳紑浜哄憳琛�  灏忕獥浣�
+                            layer.open({
+                                type: 2
+                                , skin: "layui-layer-rim" //鍔犱笂杈规
+                                , title: "浠撳簱鍒楄〃"  //鏍囬
+                                , closeBtn: 1  //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+                                , shift: 2 //寮瑰嚭鍔ㄧ敾
+                                , area: ["90%", "90%"] //绐椾綋澶у皬
+                                , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                                , content: ["../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Warehouse.html", "yes"]
+                                , btn: ["纭畾", "鍙栨秷"]
+                                , btn1: function (index, laero) {
+                                    //鎸夐挳涓�  鐨勫洖璋�
+                                    var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰
+                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹�
+
+                                    if (checkStatus.data.length != 1) {
+                                        return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�");
+                                    }
+                                    //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                                    obj.update({
+                                        "HWHID": checkStatus.data[0].HItemID
+                                        , "HWHName": checkStatus.data[0].浠撳簱鍚嶇О
+                                    })
+                                    layer.close(index);//鍏抽棴寮圭獥
+                                }
+                            })
+                        }
+
+                        //鎶ュ簾鍝佷粨
+                        if (obj.event == "HWasterWHID") {
+                            //鎵撳紑浜哄憳琛�  灏忕獥浣�
+                            layer.open({
+                                type: 2
+                                , skin: "layui-layer-rim" //鍔犱笂杈规
+                                , title: "浠撳簱鍒楄〃"  //鏍囬
+                                , closeBtn: 1  //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+                                , shift: 2 //寮瑰嚭鍔ㄧ敾
+                                , area: ["90%", "90%"] //绐椾綋澶у皬
+                                , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                                , content: ["../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Warehouse.html", "yes"]
+                                , btn: ["纭畾", "鍙栨秷"]
+                                , btn1: function (index, laero) {
+                                    //鎸夐挳涓�  鐨勫洖璋�
+                                    var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰
+                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹�
+
+                                    if (checkStatus.data.length != 1) {
+                                        return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�");
+                                    }
+                                    //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                                    obj.update({
+                                        "HWasterWHID": checkStatus.data[0].HItemID
+                                        , "HWasterWHName": checkStatus.data[0].浠撳簱鍚嶇О
+                                    })
+                                    layer.close(index);//鍏抽棴寮圭獥
+                                }
+                            })
+                        }
+                        //棣栦欢妫�楠屾柟妗�
+                        if (obj.event == "HQCSchemeNumber_Fst") {
+                            layer.open({
+                                type: 2//寮圭獥绫诲瀷
+                                , skin: 'layui-layer-rim' //鍔犱笂杈规
+                                , area: ['90%', '90%']//澶у皬
+                                , title: '妫�楠屾柟妗堝垪琛�'//鏍囬
+                                , shift: 2//寮瑰嚭鍔ㄧ敾
+                                , content: ['../../Baseset/鍩虹璧勬枡/Gy_QCCheckProjectListView.html', 'yes']
+                                , btn: ['纭畾', '鍙栨秷']
+                                , btn1: function (index, layero) {//鎸夐挳銆愭寜閽竴銆戠殑鍥炶皟
+                                    var iframeWindow = window['layui-layer-iframe' + index]  //鑾峰彇寮规椤甸潰
+                                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//鑾峰彇table鐨別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;
                     }
@@ -1332,7 +1743,8 @@
                 $.ajax({
                     url: GetWEBURL() + "/LEMS/MES_Gy_RoutingBillList_Json",
                     type: "GET",
-                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
+                    async: false,
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "HBillSubType": HBillSubType },
                     success: function (d) {
 
                         //alert(JSON.stringify(d.data[0]))
@@ -1342,15 +1754,20 @@
                         if (IsHStopflag == 1) {
                             $("input[name='checkboxHStandard']").prop("checked", true);
                         }
+                        else {
+                            $("input[name='checkboxHStandard']").prop("checked", false);
+                        }
+
+                      
                         //涓昏〃
                         form.val("formData", { //formTest 鍗� class="layui-form" 鎵�鍦ㄥ厓绱犲睘鎬� lay-filter="" 瀵瑰簲鐨勫��
-                            "HBillNo": d.data[0].鍗曟嵁鍙�
-                            , "HInterID": d.data[0].hmainid
-                            , "HDate": Format(new Date(d.data[0].鍒跺崟鏃ユ湡), "yyyy-MM-dd")
+                            "HBillNo": OperationType == 2 ? "" : d.data[0].鍗曟嵁鍙�
+                            , "HInterID": OperationType == 2 ? 0 : d.data[0].hmainid
+                            , "HDate": Format(new Date(d.data[0].鏃ユ湡), "yyyy-MM-dd")
                             , "HName": d.data[0].宸ヨ壓鍚嶇О
-                            , "HMaterNumber": d.data[0].鐗╂枡浠g爜
-                            , "HMaterName": d.data[0].鐗╂枡鍚嶇О
-                            , "HMaterID": d.data[0].hmaterid
+                            , "HMaterNumber": OperationType == 2 ? "" : d.data[0].鐗╂枡浠g爜
+                            , "HMaterName": OperationType == 2 ? "" : d.data[0].鐗╂枡鍚嶇О
+                            , "HMaterID": OperationType == 2 ? "" : d.data[0].HMaterID
                             , "HUnitName": d.data[0].璁¢噺鍗曚綅
                             , "HUnitID": d.data[0].hunitid
                             , "HMainTimeUnit": d.data[0].杩愯鏃堕棿鍗曚綅
@@ -1368,16 +1785,25 @@
                             , "HDelSourceRate": d.data[0].鍑忚祫婧愬噺閲�
                             , "HRemark": d.data[0].琛ㄥご澶囨敞
                             , "HStandard": d.data[0].榛樿宸ヨ壓 == 1 ? true : false
-                            , "HMaterModel": d.data[0].瑙勬牸鍨嬪彿
+                            , "HMaterModel": OperationType == 2 ? 0 : d.data[0].瑙勬牸鍨嬪彿
                             , "HPicNumVer": d.data[0].鍥惧彿鐗堟湰
                             , "HPicNumAssemble": d.data[0].鎬昏鍥惧彿
                             , "HMaterTexture": d.data[0].鏉愯川
                             , "HProductNum": d.data[0].鎴愬搧缂栧彿
                             , "HVerNum": d.data[0].鐗堟湰
                             , "HOrgID": d.data[0].HOrgID
+                            //鍏朵粬淇℃伅
+                            , "hmakers": d.data[0].鍒跺崟浜�
+                            , "hmakedate": d.data[0].鍒跺崟鏃ユ湡 == null ? "" : Format(new Date(d.data[0].鍒跺崟鏃ユ湡), "yyyy-MM-dd")
+                            , "hchecker": d.data[0].瀹℃牳浜�
+                            , "hcheckdate": d.data[0].瀹℃牳鏃ユ湡 == null ? "" : Format(new Date(d.data[0].瀹℃牳鏃ユ湡), "yyyy-MM-dd")
+                            , "hupdater": d.data[0].淇敼浜�
+                            , "hupdatedate": d.data[0].淇敼鏃ユ湡 == null ? "" : Format(new Date(d.data[0].淇敼鏃ユ湡), "yyyy-MM-dd")
+                            , "hdeleteman": d.data[0].浣滃簾浜�
+                            , "hdeletedate": d.data[0].浣滃簾鏃ユ湡 == null ? "" : Format(new Date(d.data[0].浣滃簾鏃ユ湡), "yyyy-MM-dd")
                         });
 
-                         //瀛愯〃  璧嬪��
+                        //瀛愯〃  璧嬪��
                         var rowdata = [];
                         for (var i = 0; i < d.data.length; i++) {
                             rowdata.push(
@@ -1392,7 +1818,11 @@
                                     , "HFixPrice": d.data[i].鐝骇瀹氶, "HProcPrice": d.data[i].鍔犲伐鍗曚环, "HBadPrice": d.data[i].涓嶅悎鏍煎崟浠�, "HWasterPrice": d.data[i].鎶ュ簾鍗曚环, "HStdFlag": d.data[i].鏍囧噯瀹氶
                                     , "HBeginDayQty": d.data[i].寮�宸ヤ綑閲忓ぉ鏁�, "HBeginFixQty": d.data[i].寮�宸ヤ綑閲忓浐鏁�, "HFixWorkDays": d.data[i].涓婇亾鍥哄畾澶╂暟, "HTrunWorkDays": d.data[i].涓婇亾寰幆鍛ㄦ湡, "HReadyTimes": d.data[i].鏈亾鍑嗗鏃堕棿
                                     , "HICMOReadyTimes": d.data[i].鎹㈠崟鍑嗗鏃堕棿, "HAutoTrunFlag": d.data[i].鑷姩绉昏浆, "HTechnologyParameter": d.data[i].宸ヨ壓鍙傛暟, "HPicNum": d.data[i].鍥剧焊缂栧彿, "HProcCheckNote": d.data[i].鏈伐搴忕‘璁よ褰�
-                                    , "HProcWorkNum": d.data[i].绋嬪簭鍙�
+                                    , "HProcWorkNum": d.data[i].绋嬪簭鍙�, "HBadWHID": d.data[i].HBadWHID, "HBadWHName": d.data[i].HBadWHName, "HWasterWHID": d.data[i].HWasterWHID, "HWasterWHName": d.data[i].HWasterWHName
+                                    , "HWHID": d.data[i].HWHID, "HWHName": d.data[i].HWHName, "HRemark": d.data[i].琛ㄤ綋澶囨敞
+                                    , "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].宸℃妫�楠屾柟妗�
                                 }
                             )
                         }
@@ -1422,6 +1852,7 @@
                     }
                 })
             }
+
             //淇濆瓨HMaker
             function set_AddNew(data) {
 
@@ -1437,7 +1868,7 @@
                 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({
@@ -1449,14 +1880,7 @@
                     dataType: "json",
                     success: function (data) {
                         if (data.count == 1) {
-                            //layer.confirm(data.Message, {
-                            //    icon: 1, skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", closeBtn: 0, btn: ['鏂板'],
-                            //    btn2: function () {
-                            //        //parent.layui.admin.events.closeThisTabs();鍏抽棴椤电
-                            //        //window.close();//鍏抽棴椤甸潰锛屾祻瑙堝櫒鏈夋晥锛孭DA鏃犳晥
-                            //        parent.location.href = "../../../views/index.html"
-                            //    }//鍏抽棴
-                            //}, function () { window.location.reload(); });//鏂板
+                            $('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);
                             layer.close(index);
                             layer.msg("鎻愪氦鎴愬姛");
                         }
@@ -1479,48 +1903,285 @@
             //闈炵┖楠岃瘉
             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;
                 //}
-                if ($("#HMainCenterIDName").val() == "") {
-                    layer.msg("宸ヤ綔涓績娌℃湁閫夋嫨");
-                    return false;
-                }
-                if ($("#HGroupIDName").val() == "") {
-                    layer.msg("鐢熶骇鐝粍娌℃湁閫夋嫨");
-                    return false;
+
+                //if ($("#HMainCenterIDName").val() == "") {
+                //    layer.msg("宸ヤ綔涓績娌℃湁閫夋嫨");
+                //    return false;
+                //}
+                //if ($("#HGroupIDName").val() == "") {
+                //    layer.msg("鐢熶骇鐝粍娌℃湁閫夋嫨");
+                //    return false;
+                //}
+                var num = [];
+                for (var i = 0; i < option.data.length; i++) {
+
+                    if (option.data[i] != "") {
+                        //娴佹按鍙�
+                        if ($.inArray(option.data[i]["HProcNo"], num) == -1) {
+                            num.push(option.data[i]["HProcNo"]);
+                        } else {
+                            layer.msg("绗�" + (i + 1) + "琛�,娴佹按鍙�:" + option.data[i]["HProcNo"] + "閲嶅!");
+                            return false;
+                        }
+                        //娴佹按鍙蜂笉涓虹┖
+                        if (option.data[i]["HProcNo"] == "") {
+                            layer.msg("绗�" + (i + 1) + "琛�:娴佹按鍙蜂笉鑳戒负绌�!");
+                            return false;
+                        }
+                        //宸ュ簭涓嶄负绌�
+                        if (option.data[i]["HProcID"] == "0") {
+                            layer.msg("绗�" + (i + 1) + "琛�:宸ュ簭涓嶈兘涓虹┖!");
+                            return false;
+                        }
+                        //澶栧崗鏍囪
+                        if (option.data[i]["HSupFlag"]) {
+                            if (option.data[i]["HSupID"] == "0") {
+                                layer.msg("绗�" + (i + 1) + "琛�:渚涘簲鍟嗕笉鑳戒负绌�!");
+                                return false;
+                            }
+                        }
+                        //else {
+                        //    if (option.data[i]["HCenterID"] == "0") {
+                        //        layer.msg("绗�" + (i + 1) + "琛�:宸ヤ綔涓績涓嶈兘涓虹┖!");
+                        //        return false;
+                        //    }
+                        //}
+
+                        //鑹巼 澶т簬0  灏忎簬绛変簬100
+                        if (parseInt(option.data[i]["HPassRate"]) <= 0) {
+                            layer.msg("绗�" + (i + 1) + "琛�:鑹巼蹇呴』澶т簬0!");
+                            return false;
+                        }
+                        if (parseInt(option.data[i]["HPassRate"]) > 100) {
+                            layer.msg("绗�" + (i + 1) + "琛�:鑹巼蹇呴』灏忎簬绛変簬100!");
+                            return false;
+                        }
+
+
+                        //浠撳簱閲嶅
+                        if (option.data[i]["HBadWHID"] != 0 && option.data[i]["HWasterWHID"] != 0) {
+
+                            if (option.data[i]["HBadWHID"] == option.data[i]["HWasterWHID"]) {
+                                layer.msg("绗�" + (i + 1) + "琛�:涓嶈壇鍝佷粨鍜屾姤搴熷搧浠撻噸澶�!");
+                                return false;
+                            }
+                        }
+                        if (option.data[i]["HBadWHID"] != 0 && option.data[i]["HWHID"] != 0) {
+                            if (option.data[i]["HBadWHID"] == option.data[i]["HWHID"]) {
+                                layer.msg("绗�" + (i + 1) + "琛�:涓嶈壇鍝佷粨鍜岃壇鍝佷粨閲嶅!");
+                                return false;
+                            }
+                        }
+                        if (option.data[i]["HWasterWHID"] != 0 && option.data[i]["HWHID"] != 0) {
+                            if (option.data[i]["HWasterWHID"] == option.data[i]["HWHID"]) {
+                                layer.msg("绗�" + (i + 1) + "琛�:鎶ュ簾鍝佷粨鍜岃壇鍝佷粨閲嶅!");
+                                return false;
+                            }
+                        }
+                    }
                 }
 
                 return true;
-                //if ($("#HBillNo").val() == '') {
-                //    layer.msg("閿欒鐨勫崟鎹彿", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                //    return false;
-                //}
-                //if ($("#HInterID").val() == '') {
-                //    layer.msg("閿欒鐨勫唴鐮�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                //    return false;
-                //}
-                //if (typeof (sSubStr) == "undefined") {
-                //    layer.msg("娌℃湁鐗╂枡鏄庣粏璁板綍", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                //    return false;
-                //}
-
             }
 
+            //闅愯棌鍒楄缃�
+            function get_HideColumn() {
+                var colName = "";
+                var contentUrl = "";
+                for (var i = 1; i < option.cols[0].length - 1; i++) {
+                    colName += option.cols[0][i]["title"] + ",";
+                }
+                var urlStr = window.document.location.pathname;//鑾峰彇鏂囦欢璺緞
+                var urlLen = urlStr.split('/');
+                for (var i = 0; i < urlLen.length - 4; i++) {
+                    contentUrl += "../";
+                }
+                colName = encodeURI(colName.substring(0, colName.length - 1));//瀵� URI 杩涜缂栫爜
+
+                contentUrl += '鍩虹璧勬枡/闅愯棌鍒楄缃�/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName;
+
+                layer.open({
+                    type: 2
+                    , skin: "layui-layer-rim" //鍔犱笂杈规
+                    , title: "闅愯棌鍒楄缃�"  //鏍囬
+                    , closeBtn: 1  //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+                    , shift: 2 //寮瑰嚭鍔ㄧ敾
+                    , area: ["50%", "90%"] //绐椾綋澶у皬
+                    , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                    , content: [contentUrl, "yes"]
+                    , btn: ["纭畾", "鍙栨秷"]
+                    , btn1: function (index, laero) {
+                        //鍒锋柊琛ㄦ牸鏁版嵁
+                        DisPlay_HideColumn();
+                        //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                        layer.close(index);//鍏抽棴寮圭獥
+                    }
+                })
+            }
+
+            //涓婁竴琛�
+            function btn_up(data) {
+                if (data.length != 1) {
+                    layer.msg("璇烽�夋嫨涓�琛屾暟鎹紒");
+                } else if (option.data[0]["HProcNo"] == data[0]["HProcNo"]) {
+                    layer.msg("棣栬鏁版嵁鏃犳硶绉诲姩锛�");
+                } else {
+                    var tables = [];
+                    for (var i = 0; i < option.data.length; i++) {
+                        if (option.data[i]["HProcNo"] == data[0]["HProcNo"]) {
+                            tables.push(option.data[i - 1]);
+                            data[0].LAY_CHECKED = true;
+                            option.data[i - 1] = data[0];
+                            option.data[i] = tables[0];
+                            table.render(option);
+                            break;
+                        }
+                    }
+                }
+            }
+
+            //涓嬩竴琛�
+            function btn_under(data) {
+                if (data.length != 1) {
+                    layer.msg("璇烽�夋嫨涓�琛屾暟鎹紒");
+                } else if (option.data[option.data.length-1]["HProcNo"] == data[0]["HProcNo"]) {
+                    layer.msg("鏈鏁版嵁鏃犳硶绉诲姩锛�");
+                } else {
+                    var tables = [];
+                    for (var i = 0; i < option.data.length; i++) {
+                        if (option.data[i]["HProcNo"] == data[0]["HProcNo"]) {
+                            tables.push(option.data[i + 1]);
+                            data[0].LAY_CHECKED = true;
+                            option.data[i + 1] = data[0];
+                            option.data[i] = tables[0];
+                            table.render(option);
+                            break;
+                        }
+                    }
+                }
+            }
+
+            //鍒锋柊娴佹按鍙�
+            function btn_Refresh(data) {
+                for (var i = 0; i < option.data.length; i++) {
+                    option.data[i]["HProcNo"] = (i + 1) * 10;
+                }
+                table.render(option);
+            }
+
+            //鏄剧ず鍒楁暟鎹�
+            function DisPlay_HideColumn() {
+                $.ajax({
+                    url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
+                    type: "GET",
+                    data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
+                    async: false,
+                    success: function (data1) {
+                        if (data1.data.length != 0) {
+                            var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
+                            var titleData = ["绋嬪簭鍙�", "鏈伐搴忕‘璁よ褰�", "鑷姩绉昏浆", "鎹㈠崟鍑嗗鏃堕棿", "鏈亾鍑嗗鏃堕棿", "涓婇亾寰幆鍛ㄦ湡", "涓婇亾鍥哄畾澶╂暟", "寮�宸ヤ綑閲忥紙鍥烘暟锛�", "寮�宸ヤ綑閲忥紙澶╂暟锛�", "鏍囧噯瀹氶", "鎶ュ簾鍗曚环", "涓嶅悎鏍煎崟浠�", "宸ュ簭宸ヤ环", "鐝骇瀹氶", "鍙搷浣滆澶囨暟", "鏍囧噯浜烘暟", "娴佽浆宸ュ簭", "涓嬮亾娴佽浆宸ュ簭", "鍥哄畾鐢熶骇澶╂暟", "鐢熶骇鍛ㄦ湡", "鏆傛斁鍖�", "鍛ㄨ浆绠�", "鍛ㄨ浆绠辨爣鍑�", "鎹㈡ā鏃堕棿", "杞Щ鏃堕棿", "鎺掗槦鏃堕棿", "鍑嗗鏃堕棿", "浜х嚎浜烘暟", "浜х嚎浜ц兘", "浜х嚎涓績", "鑹巼", "鍔犲伐鏁伴噺", "杩愯鏃堕棿", "鏃堕棿鍗曚綅", "鍥剧焊缂栧彿", "妯″叿缂栧彿", "鑹搧浠�", "鎶ュ簾鍝佷粨", "涓嶈壇鍝佷粨", "宸ュ簭绫诲瀷"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+
+                            dataCol = data1.data[0].HGridString.split(',');
+
+                            for (var i = 0; i < option.cols[0].length - 2; i++) {
+                                var dataCols = dataCol[i].split('|');
+                                //闅愯棌鍒�
+                                if (dataCols[1] == 1) {
+                                    option.cols[0][i + 1]["hide"] = true;
+                                }
+                                //璁剧疆鍒楀
+                                if (dataCols[3] > 0) {
+                                    option.cols[0][i + 1]["width"] = dataCols[3];
+                                }
+                                //璁剧疆鍐呭瀛椾綋澶у皬
+                                if (data1.data[0].HFontSize != 0) {
+                                    option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
+                                } else {
+                                    option.cols[0][i + 1]["style"] = "font-size:100%";
+                                }
+                                //璁剧疆鍒楀
+                                //if (data1.data[0].HColumnWidth != 0) {
+                                //    option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;";
+                                //} else {
+                                //    option.cols[0][i + 1]["width"] = "";
+                                //}
+                                //鏄剧ず鍒�
+                                if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
+                                    option.cols[0][i + 1]["hide"] = false;
+                                }
+                                //瀛椾綋鎵�鍦ㄤ綅缃�(宸� 灞呬腑 鍙�)
+                                switch (dataCols[2]) {
+                                    case "L":
+                                        option.cols[0][i + 1]["align"] = "left";
+                                        break;
+                                    case "M":
+                                        option.cols[0][i + 1]["align"] = "center";
+                                        break;
+                                    case "R":
+                                        option.cols[0][i + 1]["align"] = "right";
+                                        break;
+                                }
+                            }
+
+                            //鍙栨秷鍐荤粨鍒�
+                            for (var i = 1; i < option.cols[0].length - 1; i++) {
+                                if (option.cols[0][i]["fixed"] != null) {
+                                    option.cols[0][i]["fixed"] = null;
+                                }
+                                else {
+                                    break;
+                                }
+                            }
+                            //鍐荤粨鍒�
+                            if (data1.data[0].HFixCols != 0) {
+                                for (var i = 0; i < data1.data[0].HFixCols; i++) {
+                                    if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
+                                        data1.data[0].HFixCols += 1;
+                                    }
+                                    option.cols[0][i + 1]["fixed"] = "left";
+                                }
+                            }
+                            table.render(option);
+                        } else {
+                            table.render(option);
+                        }
+                    }, error: function () {
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                })
+            }
             //#endregion
 
         });
-
-
     </script>
 </body>
 </html>
\ No newline at end of file

--
Gitblit v1.9.1