From e8527f7c4f46aaf034f4e7d31d0e20cb924500d4 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期五, 01 十一月 2024 11:24:46 +0800
Subject: [PATCH] 直接调拨单:子表物料根据输入值进行过滤并提示物料、选择

---
 WebTM/views/仓存管理/仓库调拨/Add_Edit_Kf_MoveStockBill.html |  105 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 WebTM/Properties/PublishProfiles/JFTM.pubxml.user    |    4 +-
 2 files changed, 107 insertions(+), 2 deletions(-)

diff --git a/WebTM/Properties/PublishProfiles/JFTM.pubxml.user b/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
index 529aa8b..af0d1c7 100644
--- a/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
+++ b/WebTM/Properties/PublishProfiles/JFTM.pubxml.user
@@ -2203,10 +2203,10 @@
       <publishTime>07/31/2024 13:38:19</publishTime>
     </File>
     <File Include="views/浠撳瓨绠$悊/浠撳簱璋冩嫧/Add_Edit_Kf_MoveStockBill.html">
-      <publishTime>07/31/2024 13:38:19</publishTime>
+      <publishTime>11/01/2024 11:22:43</publishTime>
     </File>
     <File Include="views/浠撳瓨绠$悊/浠撳簱璋冩嫧/Add_Edit_Kf_MoveStockBill.html">
-      <publishTime>07/31/2024 13:38:19</publishTime>
+      <publishTime>11/01/2024 11:22:43</publishTime>
     </File>
     <File Include="views/浠撳瓨绠$悊/浠撳簱璋冩嫧/Cc_LookingForBill.html">
       <publishTime>04/11/2023 16:34:43</publishTime>
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 e894945..4e7aaa0 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"
@@ -331,6 +331,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({
@@ -1230,6 +1236,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") {

--
Gitblit v1.9.1