From 3d240d150e6e1a4e2df1a9f87d00ddd03ace4ee5 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期五, 17 一月 2025 10:06:37 +0800
Subject: [PATCH] 增加 BOM层级展开报表,修复全程追溯报表 黑白标页签导出失败,工艺路线的表头查询优化页面排序

---
 WebTM/views/计划管理/工艺路线/Gy_RoutingBill.html |  804 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 732 insertions(+), 72 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 cc08d0b..3f0cdc9 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"
@@ -60,15 +60,24 @@
                 <form class="layui-form" action="" lay-filter="formData" style="background-color:white;">
                     <div style="padding: 2px; ">
                         <!--<button type="button" id="btnSearch" style="margin-left: 0px" class="layui-btn layui-btn-normal"  lay-submit="" lay-filter="btnSearch" >棰勮</button>
-                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">鏂板</button>
-                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">淇敼</button>-->
+    <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">鏂板</button>
+    <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">淇敼</button>-->
 
                         <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">淇濆瓨</button>
                         <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnEdit" id="btnEdit">閫�鍑�</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_defaultRoute" id="set_defaultRoute">鍚敤榛樿</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_closeOtherRoute" id="set_closeOtherRoute">绂佺敤鍏跺畠</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_startCheckBill" id="set_startCheckBill">鍙戣捣瀹℃壒</button>
                         <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CheckBill" id="set_CheckBill">瀹℃牳</button>
                         <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_AbandonCheck" id="set_AbandonCheck">鍙嶅鏍�</button>
                         <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CloseBill" id="set_CloseBill">鍏抽棴</button>
                         <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CancelCloseBill" id="set_CancelCloseBill">鍙嶅叧闂�</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_Copy" id="set_Copy">澶嶅埗</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CheckFlowInfo" id="set_CheckFlowInfo">鏌ョ湅瀹℃壒杩涘害</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CheckBill_Flow" id="set_CheckBill_Flow">澶氱骇瀹℃牳</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_AbandonCheck_Flow" id="set_AbandonCheck_Flow">澶氱骇鍙嶅鏍�</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_RejectCheck_Flow" id="set_RejectCheck_Flow">椹冲洖</button>
+                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_WithdrawCheck_Flow" id="set_WithdrawCheck_Flow">鎾ゅ洖</button>
                     </div>
                     <div class="layui-tab" lay-filter="tab-POStockInBill">
                         <ul class="layui-tab-title" lay-filter="tab-all">
@@ -95,7 +104,7 @@
                                             </div>
                                         </div>
                                         <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;">宸ヨ壓璺嚎鍚嶇О<label style="color:red"> * </label></label>
+                                            <label class="layui-form-label" style="width: 90px;">宸ヨ壓璺嚎鍚嶇О*</label>
                                             <div class="layui-input-block" style="margin-left: 120px;">
                                                 <input type="text" class="layui-input" lay-verify="HName" name="HName" id="HName">
                                             </div>
@@ -106,7 +115,7 @@
                                         <div class="layui-inline">
                                             <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>
+                                                <input type="text" class="layui-input" lay-verify="HMaterNumber" name="HMaterNumber" id="HMaterNumber" style="width: 60%;display: inline-block;">
                                                 <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchMater" id="btnSearchMater" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                     <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                 </button>
@@ -130,7 +139,7 @@
                                     <div class="layui-row">
                                         <div class="layui-inline">
                                             <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">璁¢噺鍗曚綅*</label>
-                                            <div class="layui-input-block" style="margin-left: 77px;">
+                                            <div class="layui-input-block" style="margin-left: 83px;">
                                                 <input type="text" class="layui-input" name="HUnitName" lay-verify="HUnitName" id="HUnitName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                 <input type="hidden" name="HUnitID" id="HUnitID" lay-verify="HUnitID" value="0">
                                                 <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnUnit" id="btnUnit" style="padding: 0 10px;float: right;margin-right: 3px;">
@@ -142,17 +151,25 @@
                                             <label class="layui-form-label" style="width: 85px;">瀹氶绫诲瀷</label>
                                             <div class="layui-input-inline">
                                                 <select name="HProcPriceType" id="HProcPriceType" lay-filter="HProcPriceType" style="width:200px;">
-                                                    <option value="涓存椂瀹氶" selected="selected">涓存椂瀹氶</option>
-                                                    <option value="姘镐箙瀹氶">姘镐箙瀹氶</option>
+                                                    <option value="涓存椂瀹氶">涓存椂瀹氶</option>
+                                                    <option value="姘镐箙瀹氶" selected="selected">姘镐箙瀹氶</option>
                                                 </select>
                                             </div>
                                         </div>
                                         <div class="layui-inline">
-                                            <div class="layui-input-block" style="margin-left: 96px;">
+                                            <div class="layui-input-block" style="margin-left: 0px;">
                                                 <input type="checkbox" name="checkboxHStandard" id="checkboxHStandard" lay-skin="primary" lay-filter="checkboxHStandard" checked title="鏄惁榛樿宸ヨ壓">
                                                 <input type="hidden" value="true" name="HStandard" id="HStandard" lay-verify="HStandard">
                                                 <!--<input type="checkbox" name="checkboxHUseFlag" id="checkboxHUseFlag" title="鏄惁鍚敤" lay-skin="primary" lay-filter="checkboxHUseFlag">
                                                 <input type="hidden" value="false" name="HUseFlag" id="HUseFlag">-->
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">缁勭粐*</label>
+                                            <div class="layui-input-block" style="margin-left: 120px; width: 501px;">
+                                                <select name="HOrgID" id="HOrgID" lay-verify="HOrgID">
+                                                    <!--鍔ㄦ�佹覆鏌撶粍缁�-->
+                                                </select>
                                             </div>
                                         </div>
                                     </div>
@@ -167,26 +184,45 @@
                                                 </button>
                                             </div>
                                         </div>
-                                        <!--<div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">宸ヤ綔涓績</label>
-                                            <div class="layui-input-block" style="margin-left: 77px;">
-                                                <input type="text" class="layui-input" lay-verify="HMainCenterIDName" name="HMainCenterIDName" id="HMainCenterIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
-                                                <input type="hidden" class="layui-input" name="HMainCenterID" lay-verify="HMainCenterID" id="HMainCenterID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
-                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnWorkCenter" id="btnWorkCenter" style="padding: 0 10px;float: right;margin-right: 3px;">
-                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
-                                                </button>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">寮�濮嬫棩鏈�</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="date" class="layui-input" lay-verify="HBeginDate" name="HBeginDate" id="HBeginDate" style="padding-left: 20px;">
                                             </div>
                                         </div>
                                         <div class="layui-inline">
-                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">鐢熶骇鐝粍</label>
-                                            <div class="layui-input-block" style="margin-left: 77px;">
-                                                <input type="text" class="layui-input" name="HGroupIDName" lay-verify="HGroupIDName" id="HGroupIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
-                                                <input type="hidden" class="layui-input" name="HGroupID" lay-verify="HGroupID" id="HGroupID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
-                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnGroup" id="" style="padding: 0 10px;float: right;margin-right: 3px;">
-                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
-                                                </button>
+                                            <label class="layui-form-label" style="width: 85px;">澶辨晥鏃ユ湡</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="date" class="layui-input" lay-verify="HEndDate" name="HEndDate" id="HEndDate" style="padding-left: 80px;">
                                             </div>
-                                        </div>-->
+                                        </div>
+                                        <div class="layui-inline">
+                                            <label class="layui-form-label" style="width: 85px;">澶囨敞</label>
+                                            <div class="layui-input-block" style="margin-left: 120px;">
+                                                <input type="hidden" class="layui-input" name="HMaker" id="HMaker" lay-verify="HMaker" value="">
+                                                <input type="text" class="layui-input" name="HRemark" id="HRemark" lay-verify="HRemark" placeholder="璇疯緭鍏ュ唴瀹�" onmouseover="this.title=this.value" style=" width: 500px;">
+                                            </div>
+                                        </div>
+                                        <!--<div class="layui-inline">
+        <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">宸ヤ綔涓績</label>
+        <div class="layui-input-block" style="margin-left: 77px;">
+            <input type="text" class="layui-input" lay-verify="HMainCenterIDName" name="HMainCenterIDName" id="HMainCenterIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+            <input type="hidden" class="layui-input" name="HMainCenterID" lay-verify="HMainCenterID" id="HMainCenterID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+            <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnWorkCenter" id="btnWorkCenter" style="padding: 0 10px;float: right;margin-right: 3px;">
+                <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
+            </button>
+        </div>
+    </div>
+    <div class="layui-inline">
+        <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">鐢熶骇鐝粍</label>
+        <div class="layui-input-block" style="margin-left: 77px;">
+            <input type="text" class="layui-input" name="HGroupIDName" lay-verify="HGroupIDName" id="HGroupIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+            <input type="hidden" class="layui-input" name="HGroupID" lay-verify="HGroupID" id="HGroupID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
+            <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnGroup" id="" style="padding: 0 10px;float: right;margin-right: 3px;">
+                <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
+            </button>
+        </div>
+    </div>-->
                                     </div>
                                     <div class="layui-row">
                                         <!--<div class="layui-inline">
@@ -233,26 +269,26 @@
                                         </div>-->
                                     </div>
                                     <div class="layui-row">
-                                        <div class="layui-inline">
+                                        <!--<div class="layui-inline">
                                             <label class="layui-form-label" style="width: 85px;">澶囨敞</label>
                                             <div class="layui-input-block" style="margin-left: 120px;">
                                                 <input type="hidden" class="layui-input" name="HMaker" id="HMaker" lay-verify="HMaker" value="">
                                                 <input type="text" class="layui-input" name="HRemark" id="HRemark" lay-verify="HRemark" placeholder="璇疯緭鍏ュ唴瀹�" onmouseover="this.title=this.value" style=" width: 500px;">
                                             </div>
-                                        </div>
+                                        </div>-->
 
 
 
                                     </div>
                                     <div class="layui-row">
-                                        <div class="layui-inline">
+                                        <!--<div class="layui-inline">
                                             <label class="layui-form-label" style="width: 85px;">缁勭粐*</label>
                                             <div class="layui-input-block" style="margin-left: 120px; width: 501px;">
-                                                <select name="HOrgID" id="HOrgID" lay-verify="HOrgID">
+                                                <select name="HOrgID" id="HOrgID" lay-verify="HOrgID">-->
                                                     <!--鍔ㄦ�佹覆鏌撶粍缁�-->
-                                                </select>
+                                                <!--</select>
                                             </div>
-                                        </div>
+                                        </div>-->
                                     </div>
                                 </div>
                             </div>
@@ -303,7 +339,7 @@
                                         <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="hcloser" id="hcloser" style="background-color:#efefef4d;" readonly>
                                             </div>
                                         </div>
                                         <div class="layui-inline">
@@ -323,7 +359,7 @@
                                         <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="hclosedate" id="hclosedate" style="background-color:#efefef4d;" readonly>
                                             </div>
                                         </div>
                                         <div class="layui-inline">
@@ -508,6 +544,12 @@
     </script>
 
     <script>
+        //#region 鏂囨湰妗嗚緭鍏ユ悳绱㈢浉鍏虫暟鎹�-鍙橀噺
+        var childPage = null;                       //鑾峰彇瀛愮獥鍙e璞★紝鐢ㄤ簬鎿嶄綔瀛愮獥鍙g殑鍙橀噺鍜屾柟娉�
+        var currRowIndex = 0;                       //鐢ㄤ簬瀹氫綅瀛愮獥鍙e綋鍓嶉�変腑鐨勮
+        var childData = null;                       //鐢ㄤ簬鑾峰彇瀛愮獥鍙h繑鍥炵殑鏁版嵁
+        //#endregion
+
         var OptionData = [];
         layui.config({
             base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
@@ -530,9 +572,9 @@
 
             //鍒濆琛ㄦ牸鏁版嵁
             var rowdata = [{
-                "HProcNo": "10", "HProcID_S": 0, "HProcType": "涓诲伐搴�", "HCenterID_S": 0, "HCenterID_SName": ""
+                "HProcNo": "10", "HProcID_S": 0, "HProcType": "涓诲伐搴�", "HCenterID_S": 0, "HCenterID_SName": "","宸ュ簭浠g爜":""
                 , "HWorkQty_S": 0, "HSubStdEmpQty_S": 0, "HMouldNo": "", "HChangeMould": 0, "HPackStd": ""
-                , "HPack": "", "HPutArea": "", "HMyWorkDays": 0, "HMyFixWorkDays": 0, "宸ュ簭": ""
+                , "HPack": "", "HPutArea": "", "HMyWorkDays": 0, "HMyFixWorkDays": 0, "宸ュ簭": "","宸ユ":""
                 , "HProcID": 0, "宸ヤ綔涓績浠g爜": "", "HCenterID": 0, "宸ヤ綔涓績": "", "HSupID": 0
                 , "渚涘簲鍟嗕唬鐮�": "", "渚涘簲鍟�": "", "HSupFlag": false, "HSortProcFlag": false, "HTimeUnit": "", "HUnitTime": 0
                 , "HWorkQty": 1, "HSNCtrl": false, "HPassRate": 100, "HOverRate": 0, "HReadyTime": 0, "HQueueTime": 0
@@ -546,6 +588,7 @@
                 , "HQCSchemeID_Proc": 0, "HQCSchemeNumber_Proc": "", "HQCSchemeName_Proc": ""
                 , "HQCSchemeID_Patrol": 0, "HQCSchemeNumber_Patrol": "", "HQCSchemeName_Patrol": ""
                 , "HQCFst": false, "HQCProc": false, "HQCPatrol": false, "HMaterToSourceCtrl": false
+                ,"HSubStdEmpAvg_S": 0
             }];
             var HModName = "Gy_RoutingBill";
             //#endregion
@@ -558,24 +601,28 @@
                 , limit: 500 //姣忛〉榛樿鏄剧ず鐨勬暟閲�
                 , totalRow: true
                 //, cellMinWidth: 120
-                , height: 400
+                , height: 450
                 , cols: [[ //琛ㄥご
                     { type: 'checkbox', totalRowText: '鍚堣琛�' }
-                    , { type: 'numbers', title: '搴忓彿', totalRow: true }
+                    , { type: 'numbers', field: '搴忓彿', title: '搴忓彿', totalRow: true }
                     , { field: 'HProcNo', title: '娴佹按鍙�', edit: 'text' }
-                    // , { field: 'HProcID', title: '宸ュ簭ID', hide: true }//, hide: true
+                    , { field: 'HProcID', title: '宸ュ簭ID', hide: true }//, hide: true
+                    , { field: '宸ュ簭浠g爜', title: '宸ュ簭浠g爜'}
                     , { field: '宸ュ簭', title: '宸ュ簭', edit: 'text', event: "CheckHProcID" }//f7
+                    , { field: 'HProcID_S', title: '宸ユID', hide: true }//, hide: true
+                    , { field: '宸ユ', title: '宸ユ', edit: 'text', event: "CheckHProcMulID" }//f7
                     , { field: '宸ヤ綔涓績浠g爜', title: '宸ヤ綔涓績浠g爜', edit: 'text', event: "CheckHCenterID" }//涓嶅~
-                    // , { field: 'HCenterID', title: '宸ヤ綔涓績id', hide: true }//, hide: true
+                     , { field: 'HCenterID', title: '宸ヤ綔涓績ID', hide: true }//, hide: true
                     , { field: '宸ヤ綔涓績', title: '宸ヤ綔涓績' }//f7
                     , { field: 'HTechnologyParameter', title: '宸ヨ壓鍙傛暟', edit: 'text' }
+                    , { field: 'HProcPrice', title: '宸ヤ环', edit: 'text' }
                     , { field: 'HRemark', title: '澶囨敞', edit: 'text' }
-                    // , { field: 'HSupID', title: '渚涘簲鍟咺D', hide: true }
+                     , { field: 'HSupID', title: '渚涘簲鍟咺D', hide: true }
                     , { field: '渚涘簲鍟嗕唬鐮�', title: '渚涘簲鍟嗕唬鐮�', edit: 'text', width: 110, event: "CheckHSupID" }
                     , { field: '渚涘簲鍟�', title: '渚涘簲鍟�' }//f7
                     , { field: 'HSupFlag', title: '澶栧崗鏍囪', templet: "#HSupFlag" }//checkbox
                     , { field: 'HSortProcFlag', title: '鎺掍骇宸ュ簭鏍囪', templet: "#HSortProcFlag", width: 120 }//checkbox
-
+                    
                     //, { field: 'HProcType', title: '宸ュ簭绫诲瀷', templet: '#HProcType' }//閫夋嫨
                     ////, { field: 'HBadWHID', title: 'HBadWHID', hide: true }//, hide: true
                     //, { field: 'HBadWHName', title: '涓嶈壇鍝佷粨', edit: 'text', event: "HBadWHID" }//f7
@@ -587,7 +634,6 @@
                     //, { field: 'HPicNum', title: '鍥剧焊缂栧彿', edit: 'text' }
                     //, { field: 'HTimeUnit', title: '鏃堕棿鍗曚綅', edit: 'text' }
                     //, { field: 'HUnitTime', title: '杩愯鏃堕棿', edit: 'text' }
-                    , { field: 'HWorkQty', title: '鍔犲伐鏁伴噺', edit: 'text', totalRow: true, width: 120 }//榛樿
                     , { field: 'HSNCtrl', title: 'SN杩囩珯鎺у埗', templet: "#HSNCtrl", width: 120 }
                     , { field: 'HMaterToSourceCtrl', title: '涓婃枡闃查敊鎺у埗', templet: "#HMaterToSourceCtrl", width:120 }
                     , { field: 'HQCFst', title: '鏄惁棣栦欢', templet: "#HQCFst", width: 120 }
@@ -603,7 +649,9 @@
                     , { 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: 'HWorkQty', title: '鍔犲伐鏁伴噺', edit: 'text', width: 125 }
+                    , { field: 'HSubStdEmpQty_S', title: '浜х嚎浜烘暟', edit: 'text', width: 125 }
+                    , { field: 'HSubStdEmpAvg_S', title: '浜哄潎浜ц兘', edit: 'text', width: 125}
                     //, { field: 'HPassRate', title: '鑹巼', edit: 'text' }//榛樿
                     //, { field: 'HProcID_S', title: '宸ユ', edit: 'text' }
                     ////, { field: 'HCenterID_S', title: '浜х嚎涓績id', hide: true }//hide: true
@@ -624,8 +672,7 @@
                     //, { 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: 'HFixPrice', title: '鐝骇瀹氶', edit: 'text' }//榛樿                  
                     //, { field: 'HBadPrice', title: '涓嶅悎鏍煎崟浠�', edit: 'text' }//榛樿
                     //, { field: 'HWasterPrice', title: '鎶ュ簾鍗曚环', edit: 'text' }//榛樿
                     //, { field: 'HStdFlag', title: '鏍囧噯瀹氶', templet: "#HStdFlag" }//chenbox
@@ -638,7 +685,8 @@
                     //, { field: 'HAutoTrunFlag', title: '鑷姩绉昏浆', templet: "#HAutoTrunFlag" }//chenbox
                     //, { field: 'HProcCheckNote', title: '鏈伐搴忕‘璁よ褰�', edit: 'text' }
                     //, { field: 'HProcWorkNum', title: '绋嬪簭鍙�', edit: 'text' }
-                    //, { field: 'HWorkTimes_S', title: '浜у搧鍗曚欢宸ユ椂', edit: 'text' }
+                    /* , { field: 'HWorkTimes_S', title: '浜у搧鍗曚欢宸ユ椂', edit: 'text' }*/
+                    , { field: 'HWorkTimes_S', title: '鍗曚欢鐢熶骇鑺傛媿', edit: 'text' }
                     , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo' }
                 ]]
                 //, done: function (res, curr, count) {
@@ -721,7 +769,7 @@
             if (linterid == null || linterid == 0) {
                 //$("#HIDDEN").hide();
                 OperationType = 1;
-
+                $('#set_closeOtherRoute').addClass("layui-btn-disabled").attr("disabled", true);
                 $.ajax({
                     url: GetWEBURL() + "/Web/GetMAXNum",
                     type: "GET",
@@ -731,6 +779,8 @@
                         $("#HInterID").val(d.data[0].HInterID);
                         $("#HBillNo").val(d.data[0].HBillNo);
                         $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+                        $("#HBeginDate").val(Format(new Date(), "yyyy-MM-dd"));
+                        $("#HEndDate").val(Format(new Date(2100,12,31), "yyyy-MM-dd"));
                     }
                 });
             }
@@ -747,6 +797,8 @@
                         $("#HInterID").val(d.data[0].HInterID);
                         $("#HBillNo").val(d.data[0].HBillNo);
                         $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+                        $("#HBeginDate").val(Format(new Date(), "yyyy-MM-dd"));
+                        $("#HEndDate").val(Format(new Date(2100, 12, 31), "yyyy-MM-dd"));
                     }
                 });
             }
@@ -765,6 +817,120 @@
             //#endregion
 
             //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
+            //#region 琛ㄥご鍩虹璧勬枡閫夋嫨寮圭獥
+            //#region 鏂囨湰妗嗙洃鍚�
+            $(document).ready(function () {
+                //#region 鏍规嵁鐗╂枡浠g爜鑾峰彇鐗╂枡鍩虹璧勬枡绛涢�夊脊绐�
+                //鏍规嵁鍏冪礌ID瀵瑰厓绱犺繘琛岀洃鍚�=============================================================================
+                $("#HMaterNumber").on('keydown', function (data) {
+                    //================================================================================================
+                    var errKeys = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Enter"];
+                    if ($.inArray(event.key, errKeys) == -1) {              //濡傛灉鎸変笅鐨勯敭浣嶄笉鏄� 鏂瑰悜閿紝鍒欏埛鏂板脊绐椾腑鐨勬暟鎹�
+                        if (childPage == null) {                            //鍒ゆ柇褰撳墠瀛愮獥鍙f槸鍚﹀凡缁忔墦寮�锛岃嫢鏈墦鍗★紝鍒欐墦寮�椤甸潰锛屽苟鑾峰彇瀛愮獥鍙g殑瀵硅薄
+                            var offset = $(this).offset();                  //鑾峰彇瑙﹀彂浜嬩欢鐨勫厓绱犵殑浣嶇疆锛岀敤浜庡畾浣嶅瓙绐楀彛鎵撳紑鐨勪綅缃�
+                            var innerHeight = window.innerHeight;
+                            var top = offset.top + 0.05 * innerHeight;
+                            var left = offset.left;
+                            if (top + 0.05 * innerHeight + 0.3 * innerHeight > innerHeight) {
+                                top = top - 0.3 * innerHeight - 0.05 * innerHeight;
+                            }
+                            layer.open({
+                                type: 2                                                                                     //寮圭獥绫诲瀷
+                                , skin: 'layui-layer-rim'                                                                   //鍔犱笂杈规
+                                , area: ['25%', '30%']                                                                      //澶у皬
+                                , shadeClose: true                                                                          //鐐瑰嚮閬僵鏃跺叧闂脊绐�
+                                , offset: [top, left]
+                                , title: false                                                                              //涓嶆樉绀烘爣棰樻爮
+                                //, title: '椤圭洰璐圭敤鍒楄〃'                                                                     //鏍囬
+                                , shift: 2                                                                                  //寮瑰嚭鍔ㄧ敾
+                                , closeBtn: 0                                                                               //绂佺敤鍏抽棴鎸夐挳
+                                , content: ["../../鍩虹璧勬枡/閫氱敤鍩虹璧勬枡/Gy_CommonBaseData.html?OperationType=2", "yes"]
+                                , success: function (layero, index) {
+                                    setTimeout(function () {
+                                        //淇敼锛屾牴鎹枃鏈鏁版嵁锛岀紪鍐欐煡璇㈣鍙�================================================================================================
+                                        var value = $("#HMaterNumber").val().replace(/'/g, "");                                  //鑾峰彇鏂囨湰妗嗘渶鏂板��
+                                        currRowIndex = 0;
+                                        var tableView = "h_v_Gy_MaterialList";
+                                        var childSWhere = "select top(10) HItemID,鐗╂枡浠g爜,鐗╂枡鍚嶇О,瑙勬牸鍨嬪彿,HUnitID,璁¢噺鍗曚綅鍚嶇О from " + tableView + " where 1=1 and 缁勭粐鍚嶇О = '" + sessionStorage["Organization"] + "' and (鐗╂枡浠g爜 like '%" + value + "%' or 鐗╂枡鍚嶇О like '%" + value + "%') order by 鐗╂枡浠g爜 desc";
+                                        childPage.getData(childSWhere, tableView);
+                                        //===================================================================================================================================
+                                    }, 200);
+                                }
+                                , end: function () {
+                                    childPage = null;
+                                    currRowIndex = 0;
+                                    if (childData != null) {
+                                        //鏍规嵁寮圭獥杩斿洖鏁版嵁璁剧疆鏂囨湰妗嗘暟鎹�=================================================================================================
+                                        //鑾峰彇鏁版嵁
+                                        $("#HMaterID").val(childData.HItemID);//鐗╂枡id
+                                        $("#HMaterName").val(childData.鐗╂枡鍚嶇О);//鐗╂枡鍚嶇О
+                                        $("#HMaterNumber").val(childData.鐗╂枡浠g爜);//鐗╂枡浠g爜
+                                        $("#HMaterModel").val(childData.瑙勬牸鍨嬪彿);//瑙勬牸鍨嬪彿
+                                        $("#HUnitID").val(childData.HUnitID);//璁¢噺鍗曚綅id
+                                        $("#HUnitName").val(childData.璁¢噺鍗曚綅鍚嶇О);//璁¢噺鍗曚綅鍚嶇О
+                                        if ($("#HName").val() == "") {
+                                            $("#HName").val(childData.鐗╂枡浠g爜);
+                                        }
+                                        //===============================================================================================================================
+
+                                        childData = null;
+                                    }
+                                }
+                            });
+                        } else {
+                            setTimeout(function () {
+                                //淇敼锛屾牴鎹枃鏈鏁版嵁锛岀紪鍐欐煡璇㈣鍙�================================================================================================
+                                var value = $("#HMaterNumber").val().replace(/'/g, "");                                  //鑾峰彇鏂囨湰妗嗘渶鏂板��
+                                currRowIndex = 0;
+                                var tableView = "h_v_Gy_MaterialList";
+                                var childSWhere = "select top(10) HItemID,鐗╂枡浠g爜,鐗╂枡鍚嶇О,瑙勬牸鍨嬪彿,HUnitID,璁¢噺鍗曚綅鍚嶇О from " + tableView + " where 1=1 and 缁勭粐鍚嶇О = '" + sessionStorage["Organization"] + "' and (鐗╂枡浠g爜 like '%" + value + "%' or 鐗╂枡鍚嶇О like '%" + value + "%') order by 鐗╂枡浠g爜 desc";
+                                childPage.getData(childSWhere, tableView);
+                                //=================================================================================================================================
+                            }, 200);
+                        }
+                    } else {                                                    //濡傛灉鎸変笅鐨勯敭浣嶆槸 鏂瑰悜閿紝鍒欒皟鏁寸獥鍙d腑 閫変腑琛� 鐨勪綅缃�
+                        if (event.key == "ArrowUp") {
+                            currRowIndex--;
+                            childPage.setSelectedRow(currRowIndex);
+                        } else if (event.key == "ArrowDown") {
+                            currRowIndex++;
+                            childPage.setSelectedRow(currRowIndex);
+                        } else if (event.key == "Enter") {
+                            //鎵嬪姩澶辩劍
+                            var element = document.getElementById("HMaterNumber");
+                            element.blur();
+
+                            childPage.getSelectedData(currRowIndex);
+
+                            if (childData != null) {
+                                //鏍规嵁寮圭獥杩斿洖鏁版嵁璁剧疆鏂囨湰妗嗘暟鎹�=================================================================================================
+                                //鑾峰彇鏁版嵁
+                                $("#HMaterID").val(childData.HItemID);//鐗╂枡id
+                                $("#HMaterName").val(childData.鐗╂枡鍚嶇О);//鐗╂枡鍚嶇О
+                                $("#HMaterNumber").val(childData.鐗╂枡浠g爜);//鐗╂枡浠g爜
+                                $("#HMaterModel").val(childData.瑙勬牸鍨嬪彿);//瑙勬牸鍨嬪彿
+                                $("#HUnitID").val(childData.HUnitID);//璁¢噺鍗曚綅id
+                                $("#HUnitName").val(childData.璁¢噺鍗曚綅鍚嶇О);//璁¢噺鍗曚綅鍚嶇О
+                                if ($("#HName").val() == "") {
+                                    $("#HName").val(childData.鐗╂枡浠g爜);
+                                }
+                                //===============================================================================================================================
+
+                                childData = null;
+                            }
+
+
+                            childPage = null;
+                            currRowIndex = 0;
+                            childData = null;
+                        }
+                    }
+                });
+                //#endregion
+            });
+            //#endregion
+            //#endregion
+
 
             //閫夋嫨浜у搧浠g爜鎸夐挳
             form.on('submit(btnSearchMater)', function () {
@@ -796,6 +962,24 @@
                 get_checkRoutingGroup();
             });
 
+            //鍚敤榛樿
+            form.on('submit(set_defaultRoute)', function (data) {
+                set_defaultRoute(data);
+            });
+            //鍙戣捣瀹℃壒
+            form.on('submit(set_startCheckBill)', function (data) {
+                set_startCheckBill(data);
+            });
+            //绂佺敤鍏跺畠
+            form.on('submit(set_closeOtherRoute)', function (data) {
+                if ($("#hcloser").val() != '') {
+                    layer.alert("鍗曟嵁宸茶鍏抽棴鏃犳硶鍏抽棴鍏跺畠!", { icon: 5 });
+                } else {
+                    set_closeOtherRoute(data);
+                }
+                
+            });
+
             //瀹℃牳
             form.on('submit(set_CheckBill)', function (data) {
                 set_CheckBill(data);
@@ -816,6 +1000,32 @@
                 set_CancelCloseBill(data);
             });
 
+            //鏌ョ湅瀹℃壒杩涘害
+            form.on('submit(set_CheckFlowInfo)', function (data) {
+                set_CheckFlowInfo();
+            });
+
+            //澶氱骇瀹℃牳
+            form.on('submit(set_CheckBill_Flow)', function (data) {
+                set_CheckBill_Flow(0);
+            });
+
+            //澶氱骇鍙嶅鏍�
+            form.on('submit(set_AbandonCheck_Flow)', function (data) {
+                set_CheckBill_Flow(1);
+            });
+            //椹冲洖
+            form.on('submit(set_RejectCheck_Flow)', function (data) {
+                set_RejectCheck_Flow();
+            });
+            //鎾ゅ洖
+            form.on('submit(set_WithdrawCheck_Flow)', function (data) {
+                set_WithdrawCheck_Flow();
+            });
+            //澶嶅埗
+            form.on('submit(set_Copy)', function (data) {
+                set_Copy();
+            });
 
             //鏄惁榛樿宸ヨ壓
             form.on('checkbox(checkboxHStandard)', function (data) {
@@ -982,9 +1192,9 @@
 
                 //鏂板琛岃〃鏍兼暟鎹�
                 var NewRow = {
-                    "HProcNo": (table.cache["mainTable"].length + 1) * 10, "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": "","宸ュ簭浠g爜":""
                     , "HWorkQty_S": 0, "HSubStdEmpQty_S": 0, "HMouldNo": "", "HChangeMould": 0, "HPackStd": ""
-                    , "HPack": "", "HPutArea": "", "HMyWorkDays": 0, "HMyFixWorkDays": 0, "宸ュ簭": ""
+                    , "HPack": "", "HPutArea": "", "HMyWorkDays": 0, "HMyFixWorkDays": 0, "宸ュ簭": "","宸ユ":""
                     , "HProcID": 0, "宸ヤ綔涓績浠g爜": "", "HCenterID": 0, "宸ヤ綔涓績": "", "HSupID": 0
                     , "渚涘簲鍟嗕唬鐮�": "", "渚涘簲鍟�": "", "HSupFlag": false, "HSortProcFlag": false, "HTimeUnit": "", "HUnitTime": 0
                     , "HWorkQty": 1, "HSNCtrl": false, "HPassRate": 100, "HOverRate": 0, "HReadyTime": 0, "HQueueTime": 0
@@ -998,6 +1208,7 @@
                     , "HQCSchemeID_Proc": 0, "HQCSchemeNumber_Proc": "", "HQCSchemeName_Proc": ""
                     , "HQCSchemeID_Patrol": 0, "HQCSchemeNumber_Patrol": "", "HQCSchemeName_Patrol": ""
                     , "HQCFst": false, "HQCProc": false, "HQCPatrol": false, "HMaterToSourceCtrl": false
+                    , "HSubStdEmpAvg_S": 0
                 };
                 switch (obj.event) {
                     case 'btn-AddLine':
@@ -1162,6 +1373,33 @@
                 }
             })
 
+            //鏄庣粏缃戞牸鍗曞厓鏍肩紪杈戜簨浠�
+            table.on('edit(mainTable)', function (obj) {
+                var value = obj.value //寰楀埌淇敼鍚庣殑鍊�
+                    , data = obj.data //寰楀埌鎵�鍦ㄨ鎵�鏈夐敭鍊�
+                    , field = obj.field; //寰楀埌瀛楁
+                switch (field) {
+                    case 'HSubStdEmpQty_S': //浜х嚎浜烘暟
+                        if (value != 0 && value != "" && data.HSubStdEmpAvg_S != 0 && data.HSubStdEmpAvg_S != "") {
+                            //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
+                            obj.update({
+                                HWorkQty: Number((value * data.HSubStdEmpAvg_S).toFixed(2))
+                            });
+                            //table.render(option)
+                        }                       
+                        break;
+                    case 'HSubStdEmpAvg_S': //浜х嚎浜哄潎浜ц兘
+                        if (value != 0 && value != "" && data.HSubStdEmpQty_S != 0 && data.HSubStdEmpQty_S != "") {
+                            //鍚屾鏇存柊琛ㄦ牸鍜岀紦瀛樺搴旂殑鍊�
+                            obj.update({
+                                HWorkQty: Number((value * data.HSubStdEmpQty_S).toFixed(2))
+                            });
+                            //table.render(option)
+                        }
+                        break;
+                }
+            })
+
             $('#HName').on('keydown', function (event) {//宸ヨ壓璺嚎鍚嶇О
                 if (event.keyCode == 118) {
                     layer.msg("宸ヨ壓璺嚎鍚嶇ОF7鎸夐挳")
@@ -1170,11 +1408,36 @@
 
             //淇濆瓨鎻愪氦
             form.on('submit(btnSave)', function (data) {//鎻愪氦
-                if (AllowLoadData(data)) {
-                    set_AddNew(data);
+                const procNos = table.cache["mainTable"].map(item => Number(item.HProcNo));
+                if (isSortedAscending(procNos) && haveHProcNO9999()) {
+                    if (AllowLoadData(data)) {
+                        set_AddNew(data);
+                    }
+                } else {
+                    layer.msg('璇锋敞鎰忔祦姘村彿娆″簭鎴栬�呮槸鍚︽湁杞伐搴�');
                 }
             });
-
+            // 鍑芥暟锛氬垽鏂暟缁勬槸鍚︿粠灏忓埌澶ф帓搴�
+            function isSortedAscending(arr) {
+                for (let i = 0; i < arr.length - 1; i++) {
+                    if (arr[i] > arr[i + 1]) {
+                        return false;
+                    }
+                }
+                return true;
+            }
+            //澶嶅埗鏃朵繚璇佽浆宸ュ簭瀛樺湪
+            function haveHProcNO9999() {
+                if (OperationType == 2 || OperationType == 3) {
+                    for (var i = 0; i < option.data.length; i++) {
+                        if (option.data[i]["HProcNo"] == 9999 && option.data[i]["宸ュ簭浠g爜"] == 9999) {
+                            return true
+                        }
+                    }
+                    return false;
+                }
+                return true;
+            }
             //閫�鍑�
             form.on('submit(btnEdit)', function (data) {
                 if (params[1] != null) {
@@ -1409,6 +1672,8 @@
                     layer.confirm('鐪熺殑鍒犻櫎琛屽悧锛�', function (index) {
                         if (rowIndex === '0') {
                             layer.msg('棣栬鏃犳硶鍒犻櫎锛侊紒锛�');
+                        } else if (table.cache["mainTable"][obj.tr.data('index')].HProcNo == "9999") {
+                            layer.msg('绯荤粺杞伐搴忥紝涓嶅厑璁稿垹闄わ紒锛侊紒');
                         } else {
                             var oldData = table.cache["mainTable"];
                             oldData.splice(obj.tr.data('index'), 1)
@@ -1443,18 +1708,170 @@
                 })
             }
 
-            //瀹℃牳
-            function set_CheckBill() {
-                layer.confirm("纭瑕佸鏍稿悧?", function (index) {
+            //鍚敤榛樿
+            function set_defaultRoute() {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                var HInterID = $("#HInterID").val();
+
+                layer.confirm("纭瑕佸惎鐢ㄨ宸ヨ壓璺嚎涓虹墿鏂欓粯璁ゅ伐鑹鸿矾绾垮悧?", function (index) {
                     var wait = layer.load();
                     $.ajax({
-                        url: GetWEBURL() + '/Gy_RoutingBill/AuditGy_RoutingBill',
+                        url: GetWEBURL() + '/Gy_RoutingBill/set_defaultRoute',
                         type: "GET",
-                        data: { "HInterID": $("#HInterID").val(), "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
+                        data: { "HInterID": HInterID, "user": sessionStorage["HUserName"], "HBillSubType": "3301" },
                         success: function (result) {
                             if (result.count == 1) {
                                 layer.msg(result.Message, { icon: 1 });
                                 layer.close(wait);
+                            } else {
+                                layer.alert(result.code + result.Message, { icon: 5 });
+                                layer.close(wait);
+                            }
+                        }, error: function () {
+                            layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                            layer.close(wait);
+                        }
+                    });
+                })
+            }
+
+            //#region 鍏抽棴鍏跺畠
+            function set_closeOtherRoute() {
+                var hmainid = $("#HInterID").val();
+                var HName = $("#HName").val(); 
+                var HMaterID = $("#HMaterID").val();
+                if (hmainid != 0 && HMaterID != 0 && HName!="") {
+                    layer.open({
+                        type: 2
+                        , area: ['70%', '70%']
+                        , title: '浼氬叧闂殑鍗曟嵁鍒楄〃璇风‘璁�'
+                        , closeBtn: 1
+                        , shade: 0.6 //閬僵閫忔槑搴�
+                        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        , content: '../../璁″垝绠$悊/宸ヨ壓璺嚎/Gy_RoutingBillCloseList.html?HMaterID=' + HMaterID + '&HProID=' + 0 + '&HName=' + HName + '&HInterID=' + hmainid
+                        , resize: false
+                        , btn: ["纭畾", "鍙栨秷"]
+                        , btn1: function (index, laero) {
+                            $.ajax({
+                                url: GetWEBURL() + '/Gy_Routing/CloseOther',
+                                type: "GET",
+                                data: { "HInterID": hmainid, "CurUserName": sessionStorage["HUserName"] },
+                                success: function (result) {
+                                    if (result.count == 1) {
+                                        layer.msg(result.Message, { icon: 1 });
+                                        layer.close(index);
+                                    } else {
+                                        layer.alert(result.code + result.Message, { icon: 5 });
+                                        layer.close(index);
+                                    }
+                                }, error: function () {
+                                    layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+
+                                }
+                            });
+                            //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                            layer.close(index);//鍏抽棴寮圭獥
+                        }
+                        , end: function () {
+                            ////淇敼涓哄姛鍚庡埛鏂扮晫闈�
+                            //if (get_needClose_Bar == 0) {
+                            $("#btnSearch").trigger('click');
+                            //} else if (get_needClose_Bar == 1) {
+                            //    $("#get_needClose").trigger('click');
+                            //}
+                        }
+                        , cancel: function () {
+
+                        }
+                    })
+                } else {
+                    layer.msg('淇℃伅閿欒');
+                }
+            }
+            //#endregion
+
+            //#region 鍙戣捣瀹℃壒
+            function set_startCheckBill() {
+                var hmainid = $("#HInterID").val();
+                if (hmainid != 0) {
+                    //閫昏緫瀹℃牳鏂规硶
+                    $.ajax({
+                        type: "GET",
+                        url: GetWEBURL() + "/Gy_Routing/StartCheckFlow", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                        data: { "HInterID": hmainid, "CurUserName": sessionStorage["HUserName"] },
+                        success: function (result) {
+                            if (result.count == 1) {
+                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
+
+                                    // 寰楀埌frame绱㈠紩
+                                    var index = layer.getFrameIndex(window.name);
+                                    //鍏抽棴褰撳墠frame
+                                    layer.close(index);
+                                });
+
+                            } else {
+                                layer.alert(result.code + result.Message, { icon: 5 });
+                            }
+                        }, error: function () {
+                            layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                        }
+                    });
+                }
+                else {
+                    layer.msg('璇蜂繚瀛樺悗鍐嶅彂璧凤紒');
+                }
+            }
+            //#endregion
+
+            //瀹℃牳
+            function set_CheckBill() {
+                layer.confirm("纭瑕佸鏍稿悧?", function (index) {
+                    var wait = layer.load();
+                    var HInterID = $("#HInterID").val();
+                    $.ajax({
+                        url: GetWEBURL() + '/Gy_RoutingBill/AuditGy_RoutingBill',
+                        type: "GET",
+                        data: { "HInterID": HInterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
+                        success: function (result) {
+                            if (result.count == 1) {
+                                //妫�鏌ユ槸鍚﹀叿澶囧惎鐢ㄩ粯璁ゅ伐鑹鸿矾绾跨殑鏉冮檺锛屽瓨鍦紝鍒欏脊绐楁彁闂�
+                                $.ajax({
+                                    url: GetWEBURL() + '/Gy_RoutingBill/set_defaultRoute_CheckRight',
+                                    type: "GET",
+                                    async: false,
+                                    data: { "user": sessionStorage["HUserName"], "HBillSubType": "3301" },
+                                    success: function (result1) {
+                                        if (result1.count == 1) {                                        //鎷ユ湁鏉冮檺
+                                            layer.confirm("纭瑕佸惎鐢ㄨ宸ヨ壓璺嚎涓虹墿鏂欓粯璁ゅ伐鑹鸿矾绾垮悧?", function (index1) {
+                                                //鍚敤榛樿宸ヨ壓璺嚎
+                                                $.ajax({
+                                                    url: GetWEBURL() + '/Gy_RoutingBill/set_defaultRoute',
+                                                    type: "GET",
+                                                    async: false,
+                                                    data: { "HInterID": HInterID, "user": sessionStorage["HUserName"], "HBillSubType": "3301" },
+                                                    success: function (result2) {
+                                                        if (result2.count == 1) {
+                                                            layer.msg(result2.Message, { icon: 1 });
+                                                        } else {
+                                                            layer.alert(result2.code + result2.Message, { icon: 5 });
+                                                        }
+                                                    }, error: function () {
+                                                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                                                    }
+                                                });
+                                            })
+                                            layer.close(wait);
+                                        } else {
+                                            layer.close(wait);
+                                            layer.close(index);
+                                        }
+                                    }, error: function () {
+                                        layer.close(wait);
+                                        layer.close(index);
+                                    }
+                                });
                             } else {
                                 layer.alert(result.code + result.Message, { icon: 5 });
                                 layer.close(wait);
@@ -1539,6 +1956,162 @@
                 })
             }
 
+            //#region 澶氱骇 鍙嶅鏍�/瀹℃牳鏁版嵁
+            function set_CheckBill_Flow(num) {
+                var InterID = $("#HInterID").val();
+                if (InterID != 0) {
+                    //閫昏緫瀹℃牳鏂规硶
+                    $.ajax({
+                        type: "GET",
+                        url: GetWEBURL() + "/Gy_Routing/AuditFlow", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                        data: { "HInterID": InterID, "IsAudit": num, "CurUserName": sessionStorage["HUserName"], "CurUserID": sessionStorage["Czybm"] },
+                        success: function (result) {
+                            if (result.count == 1) {
+                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
+                                    // 寰楀埌frame绱㈠紩
+                                    var index = layer.getFrameIndex(window.name);
+                                    //鍏抽棴褰撳墠frame
+                                    layer.close(index);
+                                    //淇敼涓哄姛鍚庡埛鏂扮晫闈�
+                                    $("#btnSearch").trigger('click');
+                                });
+
+                            } else {
+                                layer.alert(result.code + result.Message, { icon: 5 });
+                            }
+                        }, error: function () {
+                            layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                        }
+                    });
+                }
+                else {
+                    layer.msg('璇烽�夋嫨璇烽�夋嫨鍦ㄥ鎵规祦鐨勫崟鎹鏍革紒');
+                }
+            }
+            //#endregion
+
+            //#region 椹冲洖
+            function set_RejectCheck_Flow() {
+                var InterID = $("#HInterID").val();
+                if (InterID != 0) {
+                    //閫昏緫瀹℃牳鏂规硶
+                    $.ajax({
+                        type: "GET",
+                        url: GetWEBURL() + "/Gy_Routing/RejectCheckFlow", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                        data: { "HInterID": InterID, "CurUserID": sessionStorage["Czybm"] },
+                        success: function (result) {
+                            if (result.count == 1) {
+                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
+                                    // 寰楀埌frame绱㈠紩
+                                    var index = layer.getFrameIndex(window.name);
+                                    //鍏抽棴褰撳墠frame
+                                    layer.close(index);
+                                });
+                                //淇敼涓哄姛鍚庡埛鏂扮晫闈�
+                                $("#btnSearch").trigger('click');
+                            } else {
+                                layer.alert(result.code + result.Message, { icon: 5 });
+                            }
+                        }, error: function () {
+                            layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                        }
+                    });
+                }
+                else {
+                    layer.msg('璇烽�夋嫨鍦ㄥ鎵规祦鐨勫崟鎹┏鍥烇紒');
+                }
+            }
+            //#endregion
+
+            //#region 鎾ゅ洖
+            function set_WithdrawCheck_Flow() {
+                var InterID = $("#HInterID").val();
+                if (InterID != 0) {
+                    //閫昏緫瀹℃牳鏂规硶
+                    $.ajax({
+                        type: "GET",
+                        url: GetWEBURL() + "/Gy_Routing/WithdrawCheckFlow", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                        data: { "HInterID": InterID, "user": sessionStorage["HUserName"] },
+                        success: function (result) {
+                            if (result.count == 1) {
+                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
+                                    // 寰楀埌frame绱㈠紩
+                                    var index = layer.getFrameIndex(window.name);
+                                    //鍏抽棴褰撳墠frame
+                                    layer.close(index);
+                                });
+                                //淇敼涓哄姛鍚庡埛鏂扮晫闈�
+                                $("#btnSearch").trigger('click');
+                            } else {
+                                layer.alert(result.code + result.Message, { icon: 5 });
+                            }
+                        }, error: function () {
+                            layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                        }
+                    });
+                }
+                else {
+                    layer.msg('璇烽�夋嫨鍦ㄥ鎵规祦鐨勫崟鎹┏鍥烇紒');
+                }
+            }
+            //#endregion
+
+            //#region 澶嶅埗
+            function set_Copy() {
+                //鍒跺崟浜�
+                $("#HMaker").val(sessionStorage["HUserName"]);
+                $("#hmakers").val(sessionStorage["HUserName"]);
+                $("#hmakedate").val(Format(new Date(), "yyyy-MM-dd"));
+                $("#HBeginDate").val(Format(new Date(), "yyyy-MM-dd"));
+                $("#HEndDate").val(Format(new Date(2100, 12, 31), "yyyy-MM-dd"));
+                //璁剧疆hinterid
+                $.ajax({
+                    url: GetWEBURL() + "/Web/GetMAXNum",
+                    type: "GET",
+                    async: false,
+                    data: { "HBillType": '3301' },
+                    success: function (d) {
+                        $("#HInterID").val(d.data[0].HInterID);
+                        $("#HBillNo").val(d.data[0].HBillNo);
+                        $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+                    }
+                });
+                OperationType = 2;
+            }
+            //#endregion
+
+            //#region 鏌ョ湅瀹℃壒杩涘害
+            function set_CheckFlowInfo() {
+                var InterID = $("#HInterID").val();
+                if (InterID != 0) {
+                    layer.open({
+                        type: 2
+                        , area: ['70%', '70%']
+                        , title: '鍗曟嵁瀹℃壒杩涘害'
+                        , closeBtn: 1
+                        , shade: 0.6 //閬僵閫忔槑搴�
+                        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                        , content: '../../绯荤粺绠$悊/澶氱骇瀹℃壒/瀹℃壒杩涘害/Xt_CheckFlowProgressList.html?linterid=' + InterID + '&HSouceBillType=3301'
+                        , resize: false,
+                        end: function () {
+                            ////淇敼涓哄姛鍚庡埛鏂扮晫闈�
+                            //if (get_needClose_Bar == 0) {
+                            //    $("#btnSearch").trigger('click');
+                            //} else if (get_needClose_Bar == 1) {
+                            //    $("#get_needClose").trigger('click');
+                            //}
+                        }
+                        , cancel: function () {
+
+                        }
+                    })
+                } else {
+                    layer.msg('璇烽�夋嫨姝g‘鏁版嵁鏌ョ湅锛�');
+                }
+            }
+            //#endregion
+
             //琛屽唴鍒犻櫎蹇嵎閿�
             function set_GridCellCheck(obj) {
                 $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
@@ -1584,7 +2157,7 @@
                                 , shift: 2 //寮瑰嚭鍔ㄧ敾
                                 , area: ["90%", "90%"] //绐椾綋澶у皬
                                 , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
-                                , content: ["../../鍩虹璧勬枡/鐢熶骇鍩虹璧勬枡/Gy_Process.html", "yes"]
+                                , content: ["../../鍩虹璧勬枡/鐢熶骇鍩虹璧勬枡/Gy_Process.html?Type=HProcess", "yes"]
                                 , btn: ["纭畾", "鍙栨秷"]
                                 , btn1: function (index, laero) {
                                     //鎸夐挳涓�  鐨勫洖璋�
@@ -1639,17 +2212,20 @@
                                         var j = 0;
                                         for (var i = (NowNum - 1); i < option.data.length; i++) {
                                             option.data[i]["宸ュ簭"] = WorkCente[j]["宸ュ簭鍚嶇О"];
+                                            option.data[i]["宸ュ簭浠g爜"] = ProcessNumber[j].substring(1, ProcessNumber[j].length - 1);
                                             option.data[i]["HProcID"] = WorkCente[j]["HProcID"];
                                             option.data[i]["宸ヤ綔涓績"] = WorkCente[j]["宸ヤ綔涓績鍚嶇О"];
                                             option.data[i]["HCenterID"] = WorkCente[j]["HCenterID"];
                                             option.data[i]["宸ヤ綔涓績浠g爜"] = WorkCente[j]["宸ヤ綔涓績浠g爜"];
+                                            option.data[i]["HProcID_S"] = checkStatus.data[j]["HProcMulID"];
+                                            option.data[i]["宸ユ"] = checkStatus.data[j]["宸ユ鍚嶇О"];
                                             j++;
                                         }
 
                                         //鍦ㄤ笅鏂规坊鍔犳柊鐨勮〃鏍兼暟鎹�
                                         for (var i = 0; i < num; i++) {
                                             option.data.push({
-                                                "HProcNo": (table.cache["mainTable"].length + i + 1) * 10, "HProcID_S": 0, "HProcType": "涓诲伐搴�", "HCenterID_S": 0, "HCenterID_SName": ""
+                                                "HProcNo": (table.cache["mainTable"].length + i + 1) * 10, "HProcID_S": 0, "HProcType": "涓诲伐搴�", "HCenterID_S": 0, "HCenterID_SName": "", "宸ュ簭浠g爜": ProcessNumber[j].substring(1, ProcessNumber[j].length - 1)
                                                 , "HWorkQty_S": 0, "HSubStdEmpQty_S": 0, "HMouldNo": "", "HChangeMould": 0, "HPackStd": ""
                                                 , "HPack": "", "HPutArea": "", "HMyWorkDays": 0, "HMyFixWorkDays": 0, "宸ュ簭": WorkCente[j]["宸ュ簭鍚嶇О"]
                                                 , "HProcID": WorkCente[j]["HProcID"], "宸ヤ綔涓績浠g爜": WorkCente[j]["宸ヤ綔涓績浠g爜"], "HCenterID": WorkCente[j]["HCenterID"], "宸ヤ綔涓績": WorkCente[j]["宸ヤ綔涓績鍚嶇О"], "HSupID": 0
@@ -1664,7 +2240,8 @@
                                                 , "HQCSchemeID_Fst": 0, "HQCSchemeNumber_Fst": "", "HQCSchemeName_Fst": ""
                                                 , "HQCSchemeID_Proc": 0, "HQCSchemeNumber_Proc": "", "HQCSchemeName_Proc": ""
                                                 , "HQCSchemeID_Patrol": 0, "HQCSchemeNumber_Patrol": "", "HQCSchemeName_Patrol": ""
-                                                , "HQCFst": false, "HQCProc": false, "HQCPatrol": false,"HMaterToSourceCtrl":false
+                                                , "HQCFst": false, "HQCProc": false, "HQCPatrol": false, "HMaterToSourceCtrl": false
+                                                , "HSubStdEmpAvg_S": 0
                                             })
                                             j++;
                                         }
@@ -1673,10 +2250,13 @@
                                         var j = 0;
                                         for (var i = (NowNum - 1); i < (NowNum - 1) + ProcessNumber.length; i++) {
                                             option.data[i]["宸ュ簭"] = WorkCente[j]["宸ュ簭鍚嶇О"];
+                                            option.data[i]["宸ュ簭浠g爜"] = ProcessNumber[j].substring(1, ProcessNumber[j].length - 1);
                                             option.data[i]["HProcID"] = WorkCente[j]["HProcID"];
                                             option.data[i]["宸ヤ綔涓績"] = WorkCente[j]["宸ヤ綔涓績鍚嶇О"];
                                             option.data[i]["HCenterID"] = WorkCente[j]["HCenterID"];
                                             option.data[i]["宸ヤ綔涓績浠g爜"] = WorkCente[j]["宸ヤ綔涓績浠g爜"];
+                                            option.data[i]["HProcID_S"] = checkStatus.data[j]["HProcMulID"];
+                                            option.data[i]["宸ユ"] = checkStatus.data[j]["宸ユ鍚嶇О"];
                                             j++;
                                         }
                                     }
@@ -1702,10 +2282,53 @@
                                         //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
                                         obj.update({
                                             "宸ュ簭": OptionData[0].宸ュ簭鍚嶇О
+                                            , "宸ュ簭浠g爜": OptionData[0].宸ュ簭浠g爜
                                             , "HProcID": OptionData[0].HItemID
                                             , "宸ヤ綔涓績": OptionData[0].宸ヤ綔涓績
                                             , "HCenterID": OptionData[0].HWorkCenterID
                                             , "宸ヤ綔涓績浠g爜": OptionData[0].宸ヤ綔涓績浠g爜
+                                            , "HProcID_S": OptionData[0].HProcMulID
+                                            , "宸ユ": OptionData[0].宸ユ鍚嶇О
+                                        })
+                                        OptionData = [];
+                                    }
+                                }
+                            })
+                        }
+                        //宸ユ
+                        if (obj.event == "CheckHProcMulID") {
+                            //鎵撳紑浜哄憳琛�  灏忕獥浣�
+                            layer.open({
+                                type: 2
+                                , skin: "layui-layer-rim" //鍔犱笂杈规
+                                , title: "宸ユ鍒楄〃"  //鏍囬
+                                , closeBtn: 1  //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+                                , shift: 2 //寮瑰嚭鍔ㄧ敾
+                                , area: ["90%", "90%"] //绐椾綋澶у皬
+                                , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                                , content: ["../../鍩虹璧勬枡/鐢熶骇鍩虹璧勬枡/Gy_ProcMul.html", "yes"]
+                                , btn: ["纭畾", "鍙栨秷"]
+                                , btn1: function (index, laero) {
+                                    //鎸夐挳涓�  鐨勫洖璋�
+                                    var iframeWindow = window["layui-layer-iframe" + index];//鑾峰彇寮规椤甸潰
+                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//鑾峰彇閫変腑鐨勬暟鎹�
+
+                                    if (checkStatus.data.length != 1) {
+                                        return layer.msg("璇烽�夋嫨涓�鏉℃暟鎹�");
+                                    }
+                                    //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                                    obj.update({
+                                        "宸ユ": checkStatus.data[0].宸ユ鍚嶇О
+                                        , "HProcID_S": checkStatus.data[0].HItemID
+                                    })
+                                    layer.close(index);//鍏抽棴寮圭獥
+                                }
+                                , end: function () {
+                                    if (OptionData.length > 0) {
+                                        //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                                        obj.update({
+                                            "宸ユ": OptionData[0].宸ユ鍚嶇О
+                                            , "HProcID_S": OptionData[0].HItemID
                                         })
                                         OptionData = [];
                                     }
@@ -1999,12 +2622,14 @@
                             "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].宸ヨ壓鍚嶇О
+                            , "HBeginDate": Format(new Date(d.data[0].鐢熸晥鏃堕棿), "yyyy-MM-dd")
+                            , "HEndDate": Format(new Date(d.data[0].澶辨晥鏃堕棿), "yyyy-MM-dd")
+                            , "HName": OperationType == 2 ? "" : d.data[0].宸ヨ壓鍚嶇О
                             , "HMaterNumber": OperationType == 2 ? "" : d.data[0].鐗╂枡浠g爜
                             , "HMaterName": OperationType == 2 ? "" : d.data[0].鐗╂枡鍚嶇О
                             , "HMaterID": OperationType == 2 ? "" : d.data[0].HMaterID
                             , "HUnitName": d.data[0].璁¢噺鍗曚綅
-                            , "HUnitID": d.data[0].hunitid
+                            , "HUnitID": d.data[0].HUnitID
                             , "HMainTimeUnit": d.data[0].杩愯鏃堕棿鍗曚綅
                             , "HMainProcIDName": d.data[0].宸ュ簭鍚嶇О
                             , "HMainProcID": d.data[0].HMainProcID
@@ -2037,6 +2662,8 @@
                             , "hupdatedate": d.data[0].淇敼鏃ユ湡 == null ? "" : Format(new Date(d.data[0].淇敼鏃ユ湡), "yyyy-MM-dd")
                             , "hdeleteman": d.data[0].浣滃簾浜�
                             , "hdeletedate": d.data[0].浣滃簾鏃ユ湡 == null ? "" : Format(new Date(d.data[0].浣滃簾鏃ユ湡), "yyyy-MM-dd")
+                            , "hcloser": d.data[0].鍏抽棴浜�
+                            , "hclosedate": d.data[0].鍏抽棴鏃ユ湡 == null ? "" : Format(new Date(d.data[0].鍏抽棴鏃ユ湡), "yyyy-MM-dd")
                         });
 
                         //瀛愯〃  璧嬪��
@@ -2045,10 +2672,10 @@
                         for (var i = 0; i < d.data.length; i++) {
                             rowdata.push(
                                 {
-                                    "HProcNo": d.data[i].宸ュ簭鍙�, "HProcID_S": d.data[i].宸ユ, "HProcType": d.data[i].宸ュ簭绫诲瀷, "HCenterID_S": d.data[i].HCenterID_S, "HCenterID_SName": d.data[i].浜х嚎涓績
+                                    "HProcNo": d.data[i].宸ュ簭鍙�, "HProcID_S": d.data[i].宸ユ, "HProcType": d.data[i].宸ュ簭绫诲瀷, "HCenterID_S": d.data[i].HCenterID_S, "HCenterID_SName": d.data[i].浜х嚎涓績, "宸ュ簭浠g爜": d.data[i].宸ュ簭浠g爜
                                     , "HWorkQty_S": d.data[i].浜х嚎浜ц兘, "HSubStdEmpQty_S": d.data[i].浜х嚎浜烘暟, "HMouldNo": d.data[i].妯″叿缂栧彿, "HChangeMould": d.data[i].鎹㈡ā鏃堕棿, "HPackStd": d.data[i].鍛ㄨ浆绠辨爣鍑�
-                                    , "HPack": d.data[i].鍛ㄨ浆绠�, "HPutArea": d.data[i].鏆傛斁鍖�, "HMyWorkDays": d.data[i].鐢熶骇鍛ㄦ湡, "HMyFixWorkDays": d.data[i].鍥哄畾鐢熶骇澶╂暟, "宸ュ簭": d.data[i].宸ュ簭
-                                    , "HProcID": d.data[i].hprocid, "宸ヤ綔涓績浠g爜": d.data[i].宸ヤ綔涓績浠g爜, "HCenterID": d.data[i].HCenterID, "宸ヤ綔涓績": d.data[i].宸ヤ綔涓績鍚嶇О, "HSupID": d.data[i].HSupID
+                                    , "HPack": d.data[i].鍛ㄨ浆绠�, "HPutArea": d.data[i].鏆傛斁鍖�, "HMyWorkDays": d.data[i].鐢熶骇鍛ㄦ湡, "HMyFixWorkDays": d.data[i].鍥哄畾鐢熶骇澶╂暟, "宸ュ簭": d.data[i].宸ュ簭, "宸ユ": d.data[i].宸ユ鍚嶇О
+                                    , "HProcID": d.data[i].HProcID, "宸ヤ綔涓績浠g爜": d.data[i].宸ヤ綔涓績浠g爜, "HCenterID": d.data[i].HCenterID, "宸ヤ綔涓績": d.data[i].宸ヤ綔涓績鍚嶇О, "HSupID": d.data[i].HSupID
                                     , "渚涘簲鍟嗕唬鐮�": d.data[i].渚涘簲鍟嗕唬鐮�, "渚涘簲鍟�": d.data[i].渚涘簲鍟�, "HSupFlag": d.data[i].濮斿鏍囪 == 0 ? false : true, "HSortProcFlag": d.data[i].鎺掍骇宸ュ簭鏍囪 == 0 ? false : true, "HTimeUnit": d.data[i].鏃堕棿鍗曚綅, "HUnitTime": d.data[i].杩愯鏃堕棿
                                     , "HWorkQty": d.data[i].鍔犲伐鏁伴噺, "HSNCtrl": d.data[i].SN杩囩珯鎺у埗 == 0 ? false : true, "HPassRate": d.data[i].鑹巼, "HOverRate": d.data[i].瓒呴姣斾緥, "HReadyTime": d.data[i].鍑嗗鏃堕棿, "HQueueTime": d.data[i].鎺掗槦鏃堕棿
                                     , "HMoveTime": d.data[i].杞Щ鏃堕棿, "HNextProcFlag": d.data[i].HNextProcFlag == 0 ? false : true, "HFlowProc": d.data[i].娴佽浆宸ュ簭 == 0 ? false : true, "HSubStdEmpQty": d.data[i].鏍囧噯浜烘暟, "HSubCanUseSourceQty": d.data[i].鍙搷浣滆澶囨暟
@@ -2061,6 +2688,7 @@
                                     , "HQCSchemeID_Proc": d.data[i].HQCSchemeID_Proc, "HQCSchemeNumber_Proc": d.data[i].杞簭妫�楠屾柟妗堜唬鐮�, "HQCSchemeName_Proc": d.data[i].杞簭妫�楠屾柟妗�
                                     , "HQCSchemeID_Patrol": d.data[i].HQCSchemeID_Patrol, "HQCSchemeNumber_Patrol": d.data[i].宸℃妫�楠屾柟妗堜唬鐮�, "HQCSchemeName_Patrol": d.data[i].宸℃妫�楠屾柟妗�
                                     , "HQCFst": d.data[i].HQCFst == 1 ? true : false, "HQCProc": d.data[i].HQCProc == 1 ? true : false, "HQCPatrol": d.data[i].HQCPatrol == 1 ? true : false, "HMaterToSourceCtrl": d.data[i].HMaterToSourceCtrl == 1 ? true : false
+                                    , "HSubStdEmpAvg_S": d.data[i].浜哄潎浜ц兘
                                 }
                             )
                         }
@@ -2112,12 +2740,23 @@
             //淇濆瓨HMaker
             function set_AddNew(data) {
 
+                data.field.HMaterModel = data.field.HMaterModel.replace("\"", "鈥�").replace(";", "锛�");
+                data.field.HMaterName = data.field.HMaterName.replace("\"", "鈥�").replace(";", "锛�");
+
                 var num = [];
                 for (var i = 0; i < table.cache["mainTable"].length; i++) {
                     if (table.cache["mainTable"][i] != "") {
                         table.cache["mainTable"][i].LAY_TABLE_INDEX = i;
+
+                        //鍔犲伐鏁伴噺=浜х嚎浜烘暟 * 浜х嚎浜哄潎浜ц兘
+                        if (table.cache["mainTable"][i].HSubStdEmpQty_S != 0 && table.cache["mainTable"][i].HSubStdEmpQty_S != "" && table.cache["mainTable"][i].HSubStdEmpAvg_S != 0 && table.cache["mainTable"][i].HSubStdEmpAvg_S != "") {
+
+                            table.cache["mainTable"][i].HWorkQty = Number((table.cache["mainTable"][i].HSubStdEmpQty_S * table.cache["mainTable"][i].HSubStdEmpAvg_S).toFixed(2))
+
+                        }
+
                         num.push(table.cache["mainTable"][i])
-                    }
+                    }                 
                 }
 
                 data.field.HPRDORGID = sessionStorage["OrganizationID"];//缁勭粐
@@ -2137,6 +2776,7 @@
                     success: function (data) {
                         if (data.count == 1) {
                             $('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);
+                            $('#set_closeOtherRoute').prop('disabled', false).removeClass('layui-btn-disabled');
                             layer.close(index);
                             layer.msg("鎻愪氦鎴愬姛");
                         }
@@ -2232,10 +2872,10 @@
                             pc += 1;
                         }
 
-                        if (pc > 1) {
-                            layer.msg("鎺掍骇宸ュ簭鏍囪鍙兘閫夋嫨涓�涓�,璇烽噸鏂伴�夋嫨!");
-                            return false;
-                        }
+                        //if (pc > 1) {
+                        //    layer.msg("鎺掍骇宸ュ簭鏍囪鍙兘閫夋嫨涓�涓�,璇烽噸鏂伴�夋嫨!");
+                        //    return false;
+                        //}
 
                         //else {
                         //    if (option.data[i]["HCenterID"] == "0") {
@@ -2285,7 +2925,7 @@
                 var colName = "";
                 var contentUrl = "";
                 for (var i = 1; i < option.cols[0].length - 1; i++) {
-                    colName += option.cols[0][i]["title"] + ",";
+                    colName += option.cols[0][i]["field"] + ",";
                 }
                 var urlStr = window.document.location.pathname;//鑾峰彇鏂囦欢璺緞
                 var urlLen = urlStr.split('/');
@@ -2360,7 +3000,9 @@
             //鍒锋柊娴佹按鍙�
             function btn_Refresh(data) {
                 for (var i = 0; i < option.data.length; i++) {
-                    option.data[i]["HProcNo"] = (i + 1) * 10;
+                    if (option.data[i]["HProcNo"] != 9999) {
+                        option.data[i]["HProcNo"] = (i + 1) * 10;
+                    }
                 }
                 table.render(option);
             }
@@ -2380,7 +3022,13 @@
                             dataCol = data1.data[0].HGridString.split(',');
 
                             for (var i = 0; i < option.cols[0].length - 2; i++) {
-                                var dataCols = dataCol[i].split('|');
+                                if (i >= dataCol.length) {
+                                    continue;
+                                }
+                                if (dataCol[i]) {
+                                    var dataCols = dataCol[i].split('|');
+                                }
+                                
                                 //闅愯棌鍒�
                                 if (dataCols[1] == 1) {
                                     option.cols[0][i + 1]["hide"] = true;
@@ -2394,6 +3042,10 @@
                                     option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
                                 } else {
                                     option.cols[0][i + 1]["style"] = "font-size:100%";
+                                }
+                                //缁熻鍒�
+                                if (dataCols[6] == 1) {
+                                    option.cols[0][i + 1]["totalRow"] = true;
                                 }
                                 //璁剧疆鍒楀
                                 //if (data1.data[0].HColumnWidth != 0) {
@@ -2416,6 +3068,10 @@
                                     case "R":
                                         option.cols[0][i + 1]["align"] = "right";
                                         break;
+                                }
+                                //璁剧疆琛ㄦ牸title灞炴�ф樉绀哄埆鍚�
+                                if (dataCols[4] != null && dataCols[4] != "") {
+                                    option.cols[0][i + 1]["title"] = dataCols[4];
                                 }
                             }
 
@@ -2495,6 +3151,10 @@
         function GetHSupNameValue(obj) {
             OptionData = obj;
         }
+        //渚涘簲鍟�
+        function GetGyProcMulValue(obj) {
+            OptionData = obj;
+        }
     </script>
 </body>
 </html>
\ No newline at end of file

--
Gitblit v1.9.1