From 45012c55d231a88bd17d3e6bc8c19a9940266d4e Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期三, 21 五月 2025 09:09:01 +0800
Subject: [PATCH] fix: 修正 客户分类复制页面 供应商分类复制页面 审核按钮禁用异常

---
 WebTM/views/仓存管理/仓库调拨/Add_Edit_Kf_MoveStockBill.html |  723 ++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 554 insertions(+), 169 deletions(-)

diff --git "a/WebTM/views/\344\273\223\345\255\230\347\256\241\347\220\206/\344\273\223\345\272\223\350\260\203\346\213\250/Add_Edit_Kf_MoveStockBill.html" "b/WebTM/views/\344\273\223\345\255\230\347\256\241\347\220\206/\344\273\223\345\272\223\350\260\203\346\213\250/Add_Edit_Kf_MoveStockBill.html"
index 091b397..619f2b2 100644
--- "a/WebTM/views/\344\273\223\345\255\230\347\256\241\347\220\206/\344\273\223\345\272\223\350\260\203\346\213\250/Add_Edit_Kf_MoveStockBill.html"
+++ "b/WebTM/views/\344\273\223\345\255\230\347\256\241\347\220\206/\344\273\223\345\272\223\350\260\203\346\213\250/Add_Edit_Kf_MoveStockBill.html"
@@ -58,6 +58,7 @@
                         <ul class="layui-tab-title" lay-filter="tab-all">
                             <li lay-id="1" style="padding:1px;" class="layui-this">鍩烘湰淇℃伅</li>
                             <li lay-id="2" style="padding:1px;">鍒跺崟淇℃伅</li>
+                            <li lay-id="3" style="padding:1px;">鍏跺畠淇℃伅</li>
                         </ul>
                         <div class="layui-tab-content">
                             <!--鍩烘湰淇℃伅-->
@@ -78,31 +79,7 @@
                                             </div>
                                         </div>
                                         <div class="layui-col-xs4 layui-inline">
-                                            <label class="layui-form-label">鍐呴儴鍗曟嵁鍙�</label>
-                                            <div class="layui-input-inline">
-                                                <input class="layui-input" name="HInnerBillNo" id="HInnerBillNo" autocomplete="off">
-                                            </div>
-                                        </div>
-
-
-                                    </div>
-                                    <div class="layui-row">
-                                        <div class="layui-col-xs4 layui-inline" style="display:none;">
-                                            <label class="layui-form-label">閮ㄩ棬</label>
-                                            <div class="layui-input-inline">
-                                                <input type="hidden" name="HDeptID" id="HDeptID" class="layui-input" value=0 style="float:left;width:150px;">
-                                              
-                                            </div>
-                                        </div>
-                                        <div class="layui-col-xs4 layui-inline" style="display:none;">
-                                            <label class="layui-form-label">寰�鏉ュ崟浣�</label>
-                                            <div class="layui-input-inline">
-                                                <input type="hidden" name="HSupID" id="HSupID" class="layui-input" value=0 style="float:left;width:150px;">
-                                            </div>
-                                        </div>
-                                       
-                                        <div class="layui-col-xs4 layui-inline">
-                                            <label class="layui-form-label">涓荤<label style="color:red"> * </label></label>
+                                            <label class="layui-form-label">涓荤<!--<label style="color:red"> * </label>--></label>
                                             <div class="layui-input-inline">
                                                 <input type="text" name="HMangerName" id="HMangerName" class="layui-input" value="" style="float:left;width:150px;">
                                                 <input type="hidden" name="HManagerID" id="HManagerID" class="layui-input" value=0 style="float:left;width:150px;">
@@ -111,7 +88,53 @@
                                                 </button>
                                             </div>
                                         </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-col-xs4 layui-inline">
+                                            <label class="layui-form-label">楠屾敹鍛�<!--<label style="color:red"> * </label>--></label>
+                                            <div class="layui-input-inline">
+                                                <input type="text" name="HSecManagerName" id="HSecManagerName" class="layui-input" value="" style="float:left;width:150px;">
+                                                <input type="hidden" name="HSecManagerID" id="HSecManagerID" class="layui-input" value=0 style="float:left;width:150px;">
+                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HSecManagerList" style="width:40px;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
+                                                </button>
+                                            </div>
+                                        </div>
+                                        <div class="layui-col-xs4 layui-inline">
+                                            <label class="layui-form-label">淇濈鍛�<!--<label style="color:red"> * </label>--></label>
+                                            <div class="layui-input-inline">
+                                                <input type="text" name="HKeeperName" id="HKeeperName" class="layui-input" value="" style="float:left;width:150px;">
+                                                <input type="hidden" name="HKeeperID" id="HKeeperID" class="layui-input" value=0 style="float:left;width:150px;">
+                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HKeeperList" style="width:40px;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
+                                                </button>
+                                            </div>
+                                        </div>
+                                        <div class="layui-col-xs4 layui-inline">
+                                            <label class="layui-form-label">涓氬姟鍛�<!--<label style="color:red"> * </label>--></label>
+                                            <div class="layui-input-inline">
+                                                <input type="text" name="HEmpName" id="HEmpName" class="layui-input" value="" style="float:left;width:150px;">
+                                                <input type="hidden" name="HEmpID" id="HEmpID" class="layui-input" value=0 style="float:left;width:150px;">
+                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HEMPList" style="width:40px;">
+                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
+                                                </button>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-col-xs4 layui-inline" style="display:none;">
+                                            <label class="layui-form-label">閮ㄩ棬</label>
+                                            <div class="layui-input-inline">
+                                                <input type="hidden" name="HDeptID" id="HDeptID" class="layui-input" value=0 style="float:left;width:150px;">
 
+                                            </div>
+                                        </div>
+                                        <div class="layui-col-xs4 layui-inline" style="display:none;">
+                                            <label class="layui-form-label">寰�鏉ュ崟浣�</label>
+                                            <div class="layui-input-inline">
+                                                <input type="hidden" name="HSupID" id="HSupID" class="layui-input" value=0 style="float:left;width:150px;">
+                                            </div>
+                                        </div>
                                         <div class="layui-col-xs4 layui-inline">
                                             <label class="layui-form-label">璋冨叆浠撳簱<label style="color:red"> * </label></label>
                                             <div class="layui-input-inline">
@@ -132,41 +155,17 @@
                                                 </button>
                                             </div>
                                         </div>
-                                        
-                                    </div>
-                                    <div class="layui-row">
                                         <div class="layui-col-xs4 layui-inline">
-                                            <label class="layui-form-label">楠屾敹鍛�<label style="color:red"> * </label></label>
+                                            <label class="layui-form-label">椤圭洰浠g爜</label>
                                             <div class="layui-input-inline">
-                                                <input type="text" name="HSecManagerName" id="HSecManagerName" class="layui-input" value="" style="float:left;width:150px;">
-                                                <input type="hidden" name="HSecManagerID" id="HSecManagerID" class="layui-input" value=0 style="float:left;width:150px;">
-                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HSecManagerList" style="width:40px;">
-                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
-                                                </button>
-                                            </div>
-                                        </div>
-                                        <div class="layui-col-xs4 layui-inline">
-                                            <label class="layui-form-label">淇濈鍛�<label style="color:red"> * </label></label>
-                                            <div class="layui-input-inline">
-                                                <input type="text" name="HKeeperName" id="HKeeperName" class="layui-input" value="" style="float:left;width:150px;">
-                                                <input type="hidden" name="HKeeperID" id="HKeeperID" class="layui-input" value=0 style="float:left;width:150px;">
-                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HKeeperList" style="width:40px;">
-                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
-                                                </button>
-                                            </div>
-                                        </div>
-                                        <div class="layui-col-xs4 layui-inline">
-                                            <label class="layui-form-label">涓氬姟鍛�<label style="color:red"> * </label></label>
-                                            <div class="layui-input-inline">
-                                                <input type="text" name="HEmpName" id="HEmpName" class="layui-input" value="" style="float:left;width:150px;">
-                                                <input type="hidden" name="HEmpID" id="HEmpID" class="layui-input" value=0 style="float:left;width:150px;">
-                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HEMPList" style="width:40px;">
+                                                <input type="text" class="layui-input" lay-verify="HProNumber" name="HProNumber" id="HProNumber" value="" style="background-color: #efefef4d;float: left; width: 150px;" readonly>
+                                                <input type="hidden" name="HProjectID" id="HProjectID" lay-verify="HProjectID" value="0">
+                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHProNumber" id="btnSearchHProNumber" style="width:40px;">
                                                     <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                 </button>
                                             </div>
                                         </div>
                                     </div>
-
                                     <div class="layui-row">
                                         <div class="layui-col-xs4 layui-inline">
                                             <label class="layui-form-label">婧愬崟绫诲瀷</label>
@@ -175,7 +174,6 @@
                                                     <option value="1243" selected="selected">璋冩嫧鐢宠鍗�</option>
                                                     <option value="鎵嬪伐褰曞叆">鎵嬪伐褰曞叆</option>
                                                 </select>
-
                                             </div>
                                         </div>
                                         <div class="layui-col-xs4 layui-inline">
@@ -189,37 +187,9 @@
                                             </div>
                                         </div>
                                         <div class="layui-col-xs4 layui-inline">
-                                            <label class="layui-form-label">鍙戠エ缂栧彿</label>
-                                            <div class="layui-input-inline">
-                                                <input class="layui-input" name="HInvoiceBillNo" id="HInvoiceBillNo" value="" autocomplete="off">
-                                            </div>
-                                        </div>
-                                    </div>
-                                    <div class="layui-row">
-                                        <div class="layui-col-xs4 layui-inline">
-
-                                            <label class="layui-form-label">椤圭洰浠g爜</label>
-                                            <div class="layui-input-inline">
-                                                <input type="text" class="layui-input" lay-verify="HProNumber" name="HProNumber" id="HProNumber" value="" style="background-color: #efefef4d;float: left; width: 150px;" readonly>
-                                                <input type="hidden" name="HProjectID" id="HProjectID" lay-verify="HProjectID" value="0">
-                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHProNumber" id="btnSearchHProNumber" style="width:40px;">
-                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
-                                                </button>
-                                            </div>
-                                        </div>
-                                        <div class="layui-col-xs4 layui-inline">
-                                            <label class="layui-form-label" >椤圭洰鍚嶇О</label>
-                                            <div class="layui-input-block" >
-                                                <input type="text" class="layui-input" lay-verify="HProName" name="HProName" id="HProName" readonly>
-                                            </div>
-                                        </div>
-                                    </div>
-                                    <div class="layui-row">
-
-                                        <div class="layui-col-xs7 layui-inline">
-                                            <label class="layui-form-label">鎽樿</label>
+                                            <label class="layui-form-label">椤圭洰鍚嶇О</label>
                                             <div class="layui-input-block">
-                                                <input class="layui-input" name="HExplanation" id="HExplanation" autocomplete="off">
+                                                <input type="text" class="layui-input" lay-verify="HProName" name="HProName" id="HProName" readonly>
                                             </div>
                                         </div>
                                     </div>
@@ -285,7 +255,7 @@
                                                 <input type="text" class="layui-input" name="HCheckDate" id="HCheckDate" style="background-color:#efefef4d;" readonly>
                                             </div>
                                         </div>
-                                        <div class="layui-inline" >
+                                        <div class="layui-inline">
                                             <label class="layui-form-label" style="width: 85px;">鍏抽棴鏃ユ湡</label>
                                             <div class="layui-input-block" style="margin-left: 120px;">
                                                 <input type="text" class="layui-input" name="HCloseDate" id="HCloseDate" style="background-color:#efefef4d;" readonly>
@@ -308,6 +278,34 @@
                                     </div>
                                 </div>
                             </div>
+
+                            <!--鍏跺畠淇℃伅-->
+                            <div class="layui-tab-item">
+                                <div class="layui-form-item">
+                                    <div class="layui-row">
+                                        <div class="layui-col-xs4 layui-inline">
+                                            <label class="layui-form-label">鍐呴儴鍗曟嵁鍙�</label>
+                                            <div class="layui-input-inline">
+                                                <input class="layui-input" name="HInnerBillNo" id="HInnerBillNo" autocomplete="off">
+                                            </div>
+                                        </div>
+                                        <div class="layui-col-xs4 layui-inline">
+                                            <label class="layui-form-label">鍙戠エ缂栧彿</label>
+                                            <div class="layui-input-inline">
+                                                <input class="layui-input" name="HInvoiceBillNo" id="HInvoiceBillNo" value="" autocomplete="off">
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-col-xs7 layui-inline">
+                                            <label class="layui-form-label">鎽樿</label>
+                                            <div class="layui-input-block">
+                                                <input class="layui-input" name="HExplanation" id="HExplanation" autocomplete="off">
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
                         </div>
                     </div>
 
@@ -316,7 +314,9 @@
                         <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="get_Inventory" id="get_Inventory"><i class="layui-icon layui-icon-form"></i>搴撳瓨鏌ヨ</button>
+                            <button type="button" class="layui-btn layui-btn-sm" lay-event="get_InOutSum" id="get_InOutSum"><i class="layui-icon layui-icon-form"></i>鍑哄叆搴撹褰曟煡璇�</button>
                         </div>
                     </script>
                     <script type="text/html" id="xuhao">
@@ -330,6 +330,12 @@
         <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">鍒犻櫎</a>
     </script>
     <script>
+        //#region 鏂囨湰妗嗚緭鍏ユ悳绱㈢浉鍏虫暟鎹�-鍙橀噺
+        var childPage = null;                       //鑾峰彇瀛愮獥鍙e璞★紝鐢ㄤ簬鎿嶄綔瀛愮獥鍙g殑鍙橀噺鍜屾柟娉�
+        var currRowIndex = 0;                       //鐢ㄤ簬瀹氫綅瀛愮獥鍙e綋鍓嶉�変腑鐨勮
+        var childData = null;                       //鐢ㄤ簬鑾峰彇瀛愮獥鍙h繑鍥炵殑鏁版嵁
+        //#endregion
+
         //#region 鎶樺彔娉ㄩ噴
         //#endregion
         layui.config({
@@ -351,10 +357,14 @@
             var month = date.getMonth() + 1;
             var year = date.getFullYear();
             var shijian = year + "-" + month + "-" + day;
+            var titleData = [];
+            //妯″潡鍚�
+            var HModName = "Add_Edit_Kf_MoveStockBill";
+
 
             var allVal;
             //鍙屽嚮杩斿洖鍏ㄥ眬鍙橀噺
-            window.OptionData = {};
+            window.OptionData = [];
             //#endregion
 
 
@@ -431,14 +441,15 @@
             //#endregion
 
             var rowdata = [{
-                "HMaterID": 0, "鐗╂枡浠g爜": "", "鐗╂枡鍚嶇О": "", "瑙勬牸鍨嬪彿": "", "HPropertyID": "0", "杈呭姪灞炴��": "", "HSecUnitRate": "", "HUnitID": 0, "璁¢噺鍗曚綅": "", "HRemark": "",
-                "HOutPrice": "0", "HOutMoney": "0", "HQtyMust": "", "HQty": "", "HPrice": "0", "HMoney": "0", "HWHID": 0, "璋冨叆浠撳簱": "", "HSCWHID": 0, "璋冨嚭浠撳簱": "",
+                "HMaterID": 0, "鐗╂枡浠g爜": "", "鐗╂枡鍚嶇О": "", "瑙勬牸鍨嬪彿": "", "HPropertyID": "0", "杈呭姪灞炴��": "", "HSecUnitRate": "1", "HUnitID": 0, "璁¢噺鍗曚綅": "", "HRemark": "",
+                "HOutPrice": "0", "HOutMoney": "0", "HQtyMust": "0", "HQty": "0", "HPrice": "0", "HMoney": "0", "HWHID": 0, "璋冨叆浠撳簱": "", "HSCWHID": 0, "璋冨嚭浠撳簱": "",
                 "HSPID": 0, "HSPGroupID": 0, "浠撲綅鍚嶇О": "", "HBatchNo": "", "HPOOrderInterID": 0, "HPOOrderEntryID": 0,
                 "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "",
                 "HSourceBillNo": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0,
             }];
             // 鍒濆鍖栫晫
             set_InitGrid();
+            DisPlay_HideColumn();
 
             //澶村伐鍏锋爮浜嬩欢
             table.on('toolbar(mainTable)', function (obj) {
@@ -446,13 +457,20 @@
                     , data = checkStatus.data;
                 //鏂板琛岃〃鏍兼暟鎹�
                 var NewRow = {
-                    "HMaterID": 0, "鐗╂枡浠g爜": "", "鐗╂枡鍚嶇О": "", "瑙勬牸鍨嬪彿": "", "HPropertyID": "0", "杈呭姪灞炴��": "", "HSecUnitRate": "", "HUnitID": 0, "璁¢噺鍗曚綅": "", "HRemark": "",
-                    "HOutPrice": "0", "HOutMoney": "0", "HQtyMust": "", "HQty": "", "HPrice": "0", "HMoney": "0", "HWHID": 0, "璋冨叆浠撳簱": "", "HSCWHID": 0, "璋冨嚭浠撳簱": "",
+                    "HMaterID": 0, "鐗╂枡浠g爜": "", "鐗╂枡鍚嶇О": "", "瑙勬牸鍨嬪彿": "", "HPropertyID": "0", "杈呭姪灞炴��": "", "HSecUnitRate": "1", "HUnitID": 0, "璁¢噺鍗曚綅": "", "HRemark": "",
+                    "HOutPrice": "0", "HOutMoney": "0", "HQtyMust": "0", "HQty": "0", "HPrice": "0", "HMoney": "0", "HWHID": 0, "璋冨叆浠撳簱": "", "HSCWHID": 0, "璋冨嚭浠撳簱": "",
                     "HSPID": 0, "HSPGroupID": 0, "浠撲綅鍚嶇О": "", "HBatchNo": "", "HPOOrderInterID": 0, "HPOOrderEntryID": 0,
                     "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "",
                     "HSourceBillNo": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0,
                 };
                 switch (obj.event) {
+                    //搴撳瓨鏌ヨ
+                    case 'get_Inventory': get_Inventory();
+                        break;
+                    //鍑哄叆搴撹褰曟煡璇�
+                    case 'get_InOutSum': get_InOutSum();
+                        break;
+
                     case 'btn-AddLine':
                         table.cache["mainTable"].push(NewRow);
                         option.data = table.cache["mainTable"];
@@ -478,6 +496,10 @@
                             //鍒锋柊澶嶉�夋
                             //checkRefresh();
                         }
+                        break;
+                    //鍒楄缃�
+                    case 'set_HideColumn':
+                        get_HideColumn();
                         break;
 
                 }
@@ -664,7 +686,55 @@
 
 
             //#region 鏈〉闈㈡墍鏈夎璋冪敤鐨勬柟娉�
-
+            //#region 搴撳瓨鏌ヨ
+            function get_Inventory() {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1 && data[0].HMaterID != 0) {
+                    var HMaterID = data[0].HMaterID.toString();
+                    //寮圭獥鏂规硶
+                    layer.open({
+                        type: 2//寮圭獥绫诲瀷
+                        , skin: 'layui-layer-rim' //鍔犱笂杈规
+                        , area: ['90%', '90%']//澶у皬
+                        , title: '搴撳瓨鏌ヨ鍒楄〃'//鏍囬
+                        , shift: 2//寮瑰嚭鍔ㄧ敾
+                        , content: ['../../浠撳瓨绠$悊/鏉$爜鎶ヨ〃/Kf_ICinventoryQueryReport.html?Type=1&HMaterID=' + HMaterID, 'yes']
+                        , btn: ['鍙栨秷']
+                        , btn1: function (index, layero) {
+                            layer.close(index);
+                        }
+                    })
+                }
+                else {
+                    layer.msg('璇烽�夋嫨涓�琛屾湁鐗╂枡鏁版嵁鏌ヨ锛�');
+                }
+            }
+            //#endregion
+            //#region 鍑哄叆搴撹褰曟煡璇�
+            function get_InOutSum() {
+                var checkStatus = table.checkStatus('mainTable')
+                    , data = checkStatus.data;
+                if (checkStatus.data.length === 1 && data[0].HMaterID != 0) {
+                    var HMaterID = data[0].HMaterID.toString();
+                    layer.open({
+                        type: 2//寮圭獥绫诲瀷
+                        , skin: 'layui-layer-rim' //鍔犱笂杈规
+                        , area: ['90%', '90%']//澶у皬
+                        , title: '鍑哄叆搴撹褰曞垪琛�'//鏍囬
+                        , shift: 2//寮瑰嚭鍔ㄧ敾
+                        , content: ['../../浠撳瓨绠$悊/鏉$爜鎶ヨ〃/Kf_StockInOutSumQueryReport.html?Type=1&HMaterID=' + HMaterID, 'yes']
+                        , btn: ['鍙栨秷']
+                        , btn1: function (index, layero) {
+                            layer.close(index);
+                        }
+                    })
+                }
+                else {
+                    layer.msg('璇烽�夋嫨涓�琛屾湁鐗╂枡鏁版嵁鏌ヨ锛�');
+                }
+            }
+            //#endregion
             //#region 鍒ゆ柇鏄惁鐧诲綍 鏈櫥褰曞垯璺冲埌鐧诲綍椤�
             function get_LoginIs() {
                 if (sessionStorage.login != "login") {
@@ -869,22 +939,22 @@
                     layer.msg("璇烽�夋嫨璋冨嚭浠撳簱锛�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                     return;
                 }
-                if ($("#HManagerID").val() == 0) {
-                    layer.msg("璇烽�夋嫨璐熻矗浜猴紒", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                    return;
-                }
-                if ($("#HSecManagerID").val() == 0) {
-                    layer.msg("璇烽�夋嫨楠屾敹浜猴紒", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                    return;
-                }
-                if ($("#HEmpID").val() == 0) {
-                    layer.msg("璇烽�夋嫨浠撶鍛橈紒", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                    return;
-                }
-                if ($("#HKeeperID ").val() == 0) {
-                    layer.msg("璇烽�夋嫨淇濈鍛橈紒", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                    return;
-                }
+                //if ($("#HManagerID").val() == 0) {
+                //    layer.msg("璇烽�夋嫨璐熻矗浜猴紒", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                //    return;
+                //}
+                //if ($("#HSecManagerID").val() == 0) {
+                //    layer.msg("璇烽�夋嫨楠屾敹浜猴紒", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                //    return;
+                //}
+                //if ($("#HEmpID").val() == 0) {
+                //    layer.msg("璇烽�夋嫨浠撶鍛橈紒", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                //    return;
+                //}
+                //if ($("#HKeeperID ").val() == 0) {
+                //    layer.msg("璇烽�夋嫨淇濈鍛橈紒", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                //    return;
+                //}
                 
 
 
@@ -1174,6 +1244,105 @@
             //琛屽唴蹇嵎閿瓫閫�
             function set_GridCellCheck(obj) {
                 $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
+                    //#region 瀛愯〃鏂囨湰妗嗚緭鍏ュ悗妫�绱㈡暟鎹�
+                    if (event.key != "F7") {
+                        var errKeys = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Enter"];
+                        if (obj.event == "HMaterID") {                           //瀹氫綅褰撳墠姝e湪杈撳叆鐨勬枃鏈鐨勫垪鍚�
+                            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 = $(e.currentTarget).val().replace("'", "");                                  //鑾峰彇鏂囨湰妗嗘渶鏂板��
+                                                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 () {
+                                            obj.event = "";
+                                            childPage = null;
+                                            currRowIndex = 0;
+                                            if (childData != null) {
+                                                obj.update({
+                                                    "HMaterID": childData.HItemID
+                                                    , "鐗╂枡浠g爜": childData.鐗╂枡浠g爜
+                                                    , "鐗╂枡鍚嶇О": childData.鐗╂枡鍚嶇О
+                                                    , "瑙勬牸鍨嬪彿": childData.瑙勬牸鍨嬪彿
+                                                    , "HUnitID": childData.HUnitID
+                                                    , "璁¢噺鍗曚綅": childData.璁¢噺鍗曚綅鍚嶇О
+                                                })
+
+                                                childData = null;
+                                            }
+                                        }
+                                    });
+                                } else {
+                                    setTimeout(function () {
+                                        var value = $(e.currentTarget).val().replace("'", "");                                  //鑾峰彇鏂囨湰妗嗘渶鏂板��
+                                        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("HBillNo");
+                                    element.focus();
+
+                                    childPage.getSelectedData(currRowIndex);
+
+                                    if (childData != null) {
+                                        obj.update({
+                                            "HMaterID": childData.HItemID
+                                            , "鐗╂枡浠g爜": childData.鐗╂枡浠g爜
+                                            , "鐗╂枡鍚嶇О": childData.鐗╂枡鍚嶇О
+                                            , "瑙勬牸鍨嬪彿": childData.瑙勬牸鍨嬪彿
+                                            , "HUnitID": childData.HUnitID
+                                            , "璁¢噺鍗曚綅": childData.璁¢噺鍗曚綅鍚嶇О
+                                        })
+
+                                        childData = null;
+                                    }
+                                    
+
+                                    childPage = null;
+                                    currRowIndex = 0;
+                                    childData = null;
+                                    obj.event = "";
+                                }
+                            }
+                        }
+
+                    }
+                    //#endregion
+
                     if (event.key == "F7") {
                         //鐗╂枡
                         if (obj.event == "HMaterID") {
@@ -1192,35 +1361,48 @@
                                     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 <1) {
+                                        return layer.msg("璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�");
                                     }
-
-
-                                    //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
-                                    obj.update({
-                                        "HMaterID": checkStatus.data[0].HItemID,
-                                        "鐗╂枡浠g爜": checkStatus.data[0].鐗╂枡浠g爜,
-                                        "鐗╂枡鍚嶇О": checkStatus.data[0].鐗╂枡鍚嶇О,
-                                        "瑙勬牸鍨嬪彿": checkStatus.data[0].瑙勬牸鍨嬪彿,
-                                        "HUnitID": checkStatus.data[0].HUnitID,
-                                        "璁¢噺鍗曚綅": checkStatus.data[0].璁¢噺鍗曚綅鍚嶇О
-                                    })
+                                    OptionData = checkStatus.data[0];  //鎶婇�変腑鏁版嵁鐨勭涓�鏉¤祴鍊肩粰OptionData鍙橀噺
+                                    if (checkStatus.data.length > 1) {
+                                        var rowIndex = $(obj.tr).attr("data-index") * 1;  //attr("data-index")鐢ㄤ簬鑾峰彇璇r鍏冪礌涓奷ata-index灞炴�х殑鍊�*1杞崲绫诲瀷鐒跺悗璧嬪�肩粰rowIndex
+                                        for (var i = 0; i < checkStatus.data.length; i++) {  //鍒ゆ柇閫変腑鐨勬暟鎹殑闀垮害  鐢ㄤ簬閬嶅巻checkStatus.data鏁扮粍涓殑姣忎釜鍏冪礌
+                                            if (rowIndex + i >= option.data.length) {           //鍒ゆ柇rowIndex + i鐨勭储寮曡秴鍑轰簡option.data鏁扮粍鐨勯暱搴︼紝璇存槑option.data鏁扮粍闇�瑕佹墿灞曚互鍖呭惈鏇村琛�
+                                                var NewRow = {
+                                                    "HMaterID": 0, "鐗╂枡浠g爜": "", "鐗╂枡鍚嶇О": "", "瑙勬牸鍨嬪彿": "", "HPropertyID": "0", "杈呭姪灞炴��": "", "HSecUnitRate": "1", "HUnitID": 0, "璁¢噺鍗曚綅": "", "HRemark": "",
+                                                    "HOutPrice": "0", "HOutMoney": "0", "HQtyMust": "0", "HQty": "0", "HPrice": "0", "HMoney": "0", "HWHID": 0, "璋冨叆浠撳簱": "", "HSCWHID": 0, "璋冨嚭浠撳簱": "",
+                                                    "HSPID": 0, "HSPGroupID": 0, "浠撲綅鍚嶇О": "", "HBatchNo": "", "HPOOrderInterID": 0, "HPOOrderEntryID": 0,
+                                                    "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "",
+                                                    "HSourceBillNo": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0,
+                                                };
+                                                table.cache["mainTable"].push(NewRow);    //鍒涘缓鏂扮殑鍖呭惈鏁扮粍  浼犲叆table.cache["mainTable"]鏁扮粍
+                                                option.data = table.cache["mainTable"];  //鎶婁紶鍏� table.cache["mainTable"]鏁扮粍鐨勫�艰祴鍊肩粰option.data 鐨勫睘鎬�
+                                                table.render(option);//娓叉煋鐣岄潰
+                                            }
+                                            option.data[rowIndex + i].HMaterID = checkStatus.data[i].HItemID; 
+                                            option.data[rowIndex + i].鐗╂枡浠g爜 = checkStatus.data[i].鐗╂枡浠g爜;
+                                            option.data[rowIndex + i].鐗╂枡鍚嶇О = checkStatus.data[i].鐗╂枡鍚嶇О; 
+                                            option.data[rowIndex + i].瑙勬牸鍨嬪彿 = checkStatus.data[i].瑙勬牸鍨嬪彿; 
+                                            option.data[rowIndex + i].HUnitID = checkStatus.data[i].HUnitID; 
+                                            option.data[rowIndex + i].璁¢噺鍗曚綅 = checkStatus.data[i].璁¢噺鍗曚綅鍚嶇О; 
+                                        }
+                                        table.render(option); //閲嶆柊娓叉煋琛ㄦ牸浠ユ樉绀烘洿鏂板悗鐨勬暟鎹�
+                                    }
                                     layer.close(index);//鍏抽棴寮圭獥
                                 }
                                 , end: function () {
-                                    //if (OptionData.length>0) {
-                                    //    OptionData = [];
-                                    //}
-                                    obj.update({
-                                        "HMaterID": OptionData.HItemID
-                                        , "鐗╂枡浠g爜": OptionData.鐗╂枡浠g爜
-                                        , "鐗╂枡鍚嶇О": OptionData.鐗╂枡鍚嶇О
-                                        , "瑙勬牸鍨嬪彿": OptionData.瑙勬牸鍨嬪彿
-                                        , "HUnitID": OptionData.HUnitID
-                                        , "璁¢噺鍗曚綅": OptionData.璁¢噺鍗曚綅鍚嶇О
-                                    })
-                                    
+                                    if (OptionData != null && OptionData.length == undefined) {
+                                        obj.update({
+                                            "HMaterID": OptionData.HItemID
+                                            , "鐗╂枡浠g爜": OptionData.鐗╂枡浠g爜
+                                            , "鐗╂枡鍚嶇О": OptionData.鐗╂枡鍚嶇О
+                                            , "瑙勬牸鍨嬪彿": OptionData.瑙勬牸鍨嬪彿
+                                            , "HUnitID": OptionData.HUnitID
+                                            , "璁¢噺鍗曚綅": OptionData.璁¢噺鍗曚綅鍚嶇О
+                                        })
+                                        OptionData = [];
+                                    }
                                 }
                             });
                         }
@@ -1252,14 +1434,14 @@
                                     layer.close(index);//鍏抽棴寮圭獥
                                 }
                                 , end: function () {
-                                    //if (OptionData.length > 0) {
-                                    //    OptionData = [];
-                                    //}
-                                    obj.update({
-                                        "HPropertyID": OptionData.HItemID
-                                        , "杈呭姪灞炴��": OptionData.杈呭姪灞炴�у悕绉�
-                                    })
-                            }
+                                    if (OptionData != null && OptionData.length == undefined) {
+                                        obj.update({
+                                            "HPropertyID": OptionData.HItemID
+                                            , "杈呭姪灞炴��": OptionData.杈呭姪灞炴�у悕绉�
+                                        })
+                                        OptionData = [];
+                                    }
+                                }
                             })
                         }
                         //璁¢噺鍗曚綅
@@ -1272,7 +1454,7 @@
                                 , shift: 2 //寮瑰嚭鍔ㄧ敾
                                 , area: ["90%", "90%"] //绐椾綋澶у皬
                                 , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
-                                , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Unit.html', 'yes']
+                                , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Unit.html?type=AuxiliaryUnit', 'yes']
                                 , btn: ["纭畾", "鍙栨秷"]
                                 , btn1: function (index, laero) {
                                     //鎸夐挳涓�  鐨勫洖璋�
@@ -1333,15 +1515,14 @@
                                     layer.close(index);//鍏抽棴寮圭獥
                                 }
                                 , end: function () {
-                                    //if (OptionData.length > 0) {
-                                    //    OptionData = [];
-                                    //}
-                                    obj.update({
-                                        "HWHID": OptionData.HItemID
-                                        , "璋冨叆浠撳簱": OptionData.浠撳簱鍚嶇О
-                                    })
-                                
-                            }
+                                    if (OptionData != null && OptionData.length == undefined) {
+                                        obj.update({
+                                            "HWHID": OptionData.HItemID
+                                            , "璋冨叆浠撳簱": OptionData.浠撳簱鍚嶇О
+                                        })
+                                        OptionData = [];
+                                    }
+                                }
                             })
                             
                         }
@@ -1374,14 +1555,13 @@
                                         layer.close(index);//鍏抽棴寮圭獥
                                     }
                                     , end: function () {
-                                        //if (OptionData.length > 0) {
-                                        //    OptionData = [];
-                                        //}
-                                        obj.update({
-                                            "HSCWHID": OptionData.HItemID
-                                            , "璋冨嚭浠撳簱": OptionData.浠撳簱鍚嶇О
-                                        })
-                                       
+                                        if (OptionData != null && OptionData.length == undefined) {
+                                            obj.update({
+                                                "HSCWHID": OptionData.HItemID
+                                                , "璋冨嚭浠撳簱": OptionData.浠撳簱鍚嶇О
+                                            })
+                                            OptionData = [];
+                                        }
                                     }
                                 })
                             }
@@ -1414,15 +1594,14 @@
                                     layer.close(index);//鍏抽棴寮圭獥
                                 }
                                 , end: function () {
-                                    //if (OptionData.length > 0) {
-                                    //    OptionData = [];
-                                    //}
-                                    obj.update({
-                                        "HSPID": OptionData.HMainID
-                                        , "浠撲綅鍚嶇О": OptionData.浠撲綅鍚嶇О
-                                    })
-                               
-                            }
+                                    if (OptionData != null && OptionData.length == undefined) {
+                                        obj.update({
+                                            "HSPID": OptionData.HMainID
+                                            , "浠撲綅鍚嶇О": OptionData.浠撲綅鍚嶇О
+                                        })
+                                        optiondata = [];
+                                    }
+                                }
                             })
                         }
                        
@@ -1490,6 +1669,77 @@
                         obj.event = "";
                         return false;
                     }
+                })
+
+                $(document).off('dblclick', ".layui-table-edit").on('dblclick', '.layui-table-edit', function (e) {
+                    //鎵嬪姩澶辩劍
+                    var element = document.getElementById("HBillNo");
+                    element.focus();
+
+                    //鐗╂枡
+                    if (obj.event == "HMaterID") {
+                        layer.open({
+                            type: 2
+                            , skin: "layui-layer-rim" //鍔犱笂杈规
+                            , title: "鐗╂枡鍒楄〃"  //鏍囬
+                            , closeBtn: 1  //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+                            , shift: 2 //寮瑰嚭鍔ㄧ敾
+                            , area: ["90%", "90%"] //绐椾綋澶у皬
+                            , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                            , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Material.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("璇烽�夋嫨涓�鏉℃暟鎹�");
+                                }
+                                OptionData = checkStatus.data[0];  //鎶婇�変腑鏁版嵁鐨勭涓�鏉¤祴鍊肩粰OptionData鍙橀噺
+                                if (checkStatus.data.length > 1) {
+                                    var rowIndex = $(obj.tr).attr("data-index") * 1;  //attr("data-index")鐢ㄤ簬鑾峰彇璇r鍏冪礌涓奷ata-index灞炴�х殑鍊�*1杞崲绫诲瀷鐒跺悗璧嬪�肩粰rowIndex
+                                    for (var i = 0; i < checkStatus.data.length; i++) {  //鍒ゆ柇閫変腑鐨勬暟鎹殑闀垮害  鐢ㄤ簬閬嶅巻checkStatus.data鏁扮粍涓殑姣忎釜鍏冪礌
+                                        if (rowIndex + i >= option.data.length) {           //鍒ゆ柇rowIndex + i鐨勭储寮曡秴鍑轰簡option.data鏁扮粍鐨勯暱搴︼紝璇存槑option.data鏁扮粍闇�瑕佹墿灞曚互鍖呭惈鏇村琛�
+                                            var NewRow = {
+                                                "HMaterID": 0, "鐗╂枡浠g爜": "", "鐗╂枡鍚嶇О": "", "瑙勬牸鍨嬪彿": "", "HPropertyID": "0", "杈呭姪灞炴��": "", "HSecUnitRate": "1", "HUnitID": 0, "璁¢噺鍗曚綅": "", "HRemark": "",
+                                                "HOutPrice": "0", "HOutMoney": "0", "HQtyMust": "0", "HQty": "0", "HPrice": "0", "HMoney": "0", "HWHID": 0, "璋冨叆浠撳簱": "", "HSCWHID": 0, "璋冨嚭浠撳簱": "",
+                                                "HSPID": 0, "HSPGroupID": 0, "浠撲綅鍚嶇О": "", "HBatchNo": "", "HPOOrderInterID": 0, "HPOOrderEntryID": 0,
+                                                "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "",
+                                                "HSourceBillNo": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0,
+                                            };
+                                            table.cache["mainTable"].push(NewRow);    //鍒涘缓鏂扮殑鍖呭惈鏁扮粍  浼犲叆table.cache["mainTable"]鏁扮粍
+                                            option.data = table.cache["mainTable"];  //鎶婁紶鍏� table.cache["mainTable"]鏁扮粍鐨勫�艰祴鍊肩粰option.data 鐨勫睘鎬�
+                                            table.render(option);//娓叉煋鐣岄潰
+                                        }
+                                        option.data[rowIndex + i].HMaterID = checkStatus.data[i].HItemID;
+                                        option.data[rowIndex + i].鐗╂枡浠g爜 = checkStatus.data[i].鐗╂枡浠g爜;
+                                        option.data[rowIndex + i].鐗╂枡鍚嶇О = checkStatus.data[i].鐗╂枡鍚嶇О;
+                                        option.data[rowIndex + i].瑙勬牸鍨嬪彿 = checkStatus.data[i].瑙勬牸鍨嬪彿;
+                                        option.data[rowIndex + i].HUnitID = checkStatus.data[i].HUnitID;
+                                        option.data[rowIndex + i].璁¢噺鍗曚綅 = checkStatus.data[i].璁¢噺鍗曚綅鍚嶇О;
+                                    }
+                                    table.render(option); //閲嶆柊娓叉煋琛ㄦ牸浠ユ樉绀烘洿鏂板悗鐨勬暟鎹�
+                                }
+                                layer.close(index);//鍏抽棴寮圭獥
+                            }
+                            , end: function () {
+                                if (OptionData != null && OptionData.length == undefined) {
+                                    obj.update({
+                                        "HMaterID": OptionData.HItemID
+                                        , "鐗╂枡浠g爜": OptionData.鐗╂枡浠g爜
+                                        , "鐗╂枡鍚嶇О": OptionData.鐗╂枡鍚嶇О
+                                        , "瑙勬牸鍨嬪彿": OptionData.瑙勬牸鍨嬪彿
+                                        , "HUnitID": OptionData.HUnitID
+                                        , "璁¢噺鍗曚綅": OptionData.璁¢噺鍗曚綅鍚嶇О
+                                    })
+                                    OptionData = [];
+                                }
+                            }
+                        });
+                    }
+                    obj.event = "";
+                    //return false;
                 })
             }
 
@@ -1651,7 +1901,142 @@
                     });
                 }
             }
-            
+
+            //#region 瀛愯〃1锛氶殣钘忓垪璁剧疆
+            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);//鍏抽棴寮圭獥
+                    }
+                })
+            }
+            //#endregion
+            //#region 瀛愯〃1锛氭樉绀哄垪鏁版嵁
+            function DisPlay_HideColumn() {
+                $.ajax({
+                    url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
+                    async: false,
+                    type: "GET",
+                    data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
+                    async: false,
+                    success: function (data1) {
+                        if (data1.data.length != 0) {
+                            var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
+                            /*var titleData = ["HMaterID", "HUnitID", "鎶樻墸鐜�", "瀹為檯鍚◣鍗曚环", "绋庨", "鏈綅甯佷环绋庡悎璁�", "鍑哄簱鏁伴噺", "寮�绁ㄦ暟閲�", "HOrderLevID","璁㈠崟绛夌骇浠g爜","閿�鍞嚭搴撴暟閲�","閿�鍞嚭搴撳鏍告暟閲�","閿�鍞嚭搴撳鏍搁噾棰�","鐢熶骇鏁伴噺","閿�鍞��搴撴暟閲�","閿�鍞��搴撳鏍告暟閲�"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�*/
+                            //titleData = [];
+
+                            dataCol = data1.data[0].HGridString.split(',');
+
+                            for (var i = 0; i < option.cols[0].length - 2; i++) {
+                                if (i >= dataCol.length) {
+                                    continue;
+                                }
+
+                                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;
+                                }
+                                if ($.inArray(option.cols[0][i + 1]["title"], titleData) > -1) {
+                                    option.cols[0][i + 1]["hide"] = true;
+                                }
+
+                                //瀛椾綋鎵�鍦ㄤ綅缃�(宸� 灞呬腑 鍙�)
+                                switch (dataCols[2]) {
+                                    case "L":
+                                        option.cols[0][i + 1]["align"] = "left";
+                                        break;
+                                    case "M":
+                                        option.cols[0][i + 1]["align"] = "center";
+                                        break;
+                                    case "R":
+                                        option.cols[0][i + 1]["align"] = "right";
+                                        break;
+                                }
+
+                                //璁剧疆琛ㄦ牸title灞炴�ф樉绀哄埆鍚�
+                                if (dataCols[4] != null && dataCols[4] != "") {
+                                    option.cols[0][i + 1]["title"] = dataCols[4];
+                                }
+                            }
+
+                            //鍙栨秷鍐荤粨鍒�
+                            for (var i = 1; i < option.cols[0].length - 1; i++) {
+                                if (option.cols[0][i]["fixed"] != null) {
+                                    option.cols[0][i]["fixed"] = null;
+                                }
+                                else {
+                                    break;
+                                }
+                            }
+                            //鍐荤粨鍒�
+                            if (data1.data[0].HFixCols != 0) {
+                                for (var i = 0; i < data1.data[0].HFixCols; i++) {
+                                    if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
+                                        data1.data[0].HFixCols += 1;
+                                    }
+                                    option.cols[0][i + 1]["fixed"] = "left";
+                                }
+                            }
+                            table.render(option);
+
+
+                        } else {
+                            table.render(option);
+
+                        }
+                    }, error: function () {
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                })
+            }
+            //#endregion
 
             //#region 淇濆瓨鍚庢祻瑙堟柟娉�
             function ReRoadBillMain() {

--
Gitblit v1.9.1