From f025d969dcf4e664ef8f7f33ee2060e113c3adff Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期五, 30 五月 2025 20:56:58 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-LayUI

---
 WebTM/views/销售管理/销售订单/Add_Edit_Xs_SeOrderBillList.html |  485 +++++++++++++++++++++++++++++++++--------------------
 1 files changed, 303 insertions(+), 182 deletions(-)

diff --git "a/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\351\224\200\345\224\256\350\256\242\345\215\225/Add_Edit_Xs_SeOrderBillList.html" "b/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\351\224\200\345\224\256\350\256\242\345\215\225/Add_Edit_Xs_SeOrderBillList.html"
index 8d720c0..0eb8a77 100644
--- "a/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\351\224\200\345\224\256\350\256\242\345\215\225/Add_Edit_Xs_SeOrderBillList.html"
+++ "b/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\351\224\200\345\224\256\350\256\242\345\215\225/Add_Edit_Xs_SeOrderBillList.html"
@@ -157,6 +157,15 @@
                                             </div>
                                         </div>
                                         <div class="layui-inline">
+                                            <label class="layui-form-label">浜у搧绫诲瀷</label>
+                                            <div class="layui-input-inline">
+                                                <select name="HProductType" id="HProductType" lay-filter="HProductType" style="width: 180px; ">
+                                                    <option style="color:blue;" selected="selected" value="闈炴牱鍝�">闈炴牱鍝�</option>
+                                                    <option style="color:blue;" value="鏍峰搧">鏍峰搧</option>
+                                                </select>
+                                            </div>
+                                        </div>
+                                        <div class="layui-inline">
                                             <label class="layui-form-label">缁撶畻鏂瑰紡<label style="color:red"> * </label></label>
                                             <div class="layui-input-inline">
                                                 <input type="text" name="HSSName" id="HSSName" class="layui-input" value="" style="float: left; width: 150px; background-color: #efefef4d;" readonly>
@@ -453,7 +462,7 @@
             base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
         }).extend({
             index: 'lib/index' //涓诲叆鍙fā鍧�
-        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
+        }).use(['index', 'form', 'laydate', 'table', 'element', 'tableSelect'], function () {
 
             //#region 鍏敤鍙橀噺
             var $ = layui.$
@@ -462,11 +471,12 @@
                 , table = layui.table
                 , form = layui.form
                 , laydate = layui.laydate
-                , element = layui.element;
+                , element = layui.element
+                , tableSelect = layui.tableSelect;
 
             //瀛愯〃娓叉煋鍙傛暟
             window.option = {};
-
+            var topScroll = 0;//璁板綍婊氬姩鏉$殑浣嶇疆
             var titleData = ["HMaterID", "HUnitID", "鎶樻墸鐜�", "瀹為檯鍚◣鍗曚环", "绋庨", "鏈綅甯佷环绋庡悎璁�", "鍑哄簱鏁伴噺", "寮�绁ㄦ暟閲�", "HOrderLevID", "璁㈠崟绛夌骇浠g爜", "閿�鍞嚭搴撴暟閲�", "閿�鍞嚭搴撳鏍告暟閲�", "閿�鍞嚭搴撳鏍搁噾棰�", "鐢熶骇鏁伴噺", "閿�鍞��搴撴暟閲�", "閿�鍞��搴撳鏍告暟閲�"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
 
             //璁板綍缁勭粐鐨勫��
@@ -856,6 +866,7 @@
                 var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"];  //鏁伴噺绮惧害
                 var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"];  //鍗曚环绮惧害
                 var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"];  //閲戦绮惧害
+                topScroll = $('#mainTable').next('.layui-table-view').find('.layui-table-body').scrollTop();//鑾峰彇婊氬姩鏉′綅缃�
                 // 鍗曞厓鏍肩紪杈戜箣鍓嶇殑鍊�
                 var oldText = $(this).prev().text();
                 var value = obj.value //寰楀埌淇敼鍚庣殑鍊�
@@ -910,7 +921,7 @@
                             , HMoney: HMoney
                             , HlineTotal: HlineTotal
                         });
-                        //table.render(option);
+                        table.render(option);
 
                         //鍒锋柊琛ㄦ牸鍚屾椂鏍规嵁option涓璈isStockGoods鍊艰缃笅鎷夊垪琛�
                         setSelectHisStockGoodsByTableRender();
@@ -993,7 +1004,7 @@
                             , HMoney: HMoney
                             , HlineTotal: HlineTotal
                         });
-                        //table.render(option);
+                        table.render(option);
 
                         //鍒锋柊琛ㄦ牸鍚屾椂鏍规嵁option涓璈isStockGoods鍊艰缃笅鎷夊垪琛�
                         setSelectHisStockGoodsByTableRender();
@@ -1047,7 +1058,7 @@
                             , HMoney: HMoney
                             , HlineTotal: HlineTotal
                         });
-                        //table.render(option);
+                        table.render(option);
 
                         //鍒锋柊琛ㄦ牸鍚屾椂鏍规嵁option涓璈isStockGoods鍊艰缃笅鎷夊垪琛�
                         setSelectHisStockGoodsByTableRender();
@@ -1131,7 +1142,7 @@
                             , HMoney: HMoney
                             , HlineTotal: HlineTotal
                         });
-                        //table.render(option);
+                        table.render(option);
 
                         //鍒锋柊琛ㄦ牸鍚屾椂鏍规嵁option涓璈isStockGoods鍊艰缃笅鎷夊垪琛�
                         setSelectHisStockGoodsByTableRender();
@@ -1388,6 +1399,7 @@
                                 }
                             });
                         });
+                        $(".layui-table-main").scrollTop(topScroll);
                     }
                 }
 
@@ -1516,6 +1528,7 @@
                                 , "HProjectName": data.椤圭洰鍚嶇О
                                 , "HWHID": data.涓讳粨搴搃d
                                 , "HWHName": data.涓讳粨搴�
+                                , "HProductType": data.浜у搧绫诲瀷
                                 , "HCreditRating_Now": data.HCreditRating_Now
                                 , "HRemark": data.琛ㄥご澶囨敞
                                 , "HMaker": data.鍒跺崟浜�
@@ -2672,199 +2685,199 @@
             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) {
-                                                var rowIndex = $(obj.tr).attr("data-index") * 1;
-                                                var Dec = getDecByMaterID(childData.HItemID) //鑾峰彇绮惧害
-                                                var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"];  //鏁伴噺绮惧害
-                                                var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"];  //鍗曚环绮惧害
-                                                var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"];  //閲戦绮惧害
-                                                //鏁板�兼牸寮忔牎楠屽伐鍏�
-                                                var ref = /^\d+(\.\d+)?$/;                                  //闈炶礋鏁版鍒欒〃杈惧紡
-                                                var temp = "";
-                                                //鑾峰彇閫夋嫨鐗╂枡鍓嶅悗鐨勭◣鐜�
-                                                var value_TaxRate = subHTaxRate;                                    //閫夋嫨鐗╂枡鍚庢牴鎹鎴峰緱鍒扮殑绋庣巼
-                                                var oldText = option.data[rowIndex].HTaxRate;           //璇ヨ褰曚腑鍘熸湁鐨勭◣鐜�
+                    //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) {
+                    //                            var rowIndex = $(obj.tr).attr("data-index") * 1;
+                    //                            var Dec = getDecByMaterID(childData.HItemID) //鑾峰彇绮惧害
+                    //                            var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"];  //鏁伴噺绮惧害
+                    //                            var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"];  //鍗曚环绮惧害
+                    //                            var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"];  //閲戦绮惧害
+                    //                            //鏁板�兼牸寮忔牎楠屽伐鍏�
+                    //                            var ref = /^\d+(\.\d+)?$/;                                  //闈炶礋鏁版鍒欒〃杈惧紡
+                    //                            var temp = "";
+                    //                            //鑾峰彇閫夋嫨鐗╂枡鍓嶅悗鐨勭◣鐜�
+                    //                            var value_TaxRate = subHTaxRate;                                    //閫夋嫨鐗╂枡鍚庢牴鎹鎴峰緱鍒扮殑绋庣巼
+                    //                            var oldText = option.data[rowIndex].HTaxRate;           //璇ヨ褰曚腑鍘熸湁鐨勭◣鐜�
 
-                                                //绋庣巼鏁版嵁鏍煎紡鏍¢獙锛岃嫢鏍规嵁瀹㈡埛鑾峰彇鐨勭◣鐜囦笉鍚堟硶锛屽垯浣跨敤璁板綍涓師鏈夌殑绋庣巼锛屽苟鎻愮ず
-                                                temp = value_TaxRate + "";
-                                                if (!ref.test(temp)) {
-                                                    value_TaxRate = oldText;
-                                                    layer.msg("鑾峰彇鍒扮殑绋庣巼涓嶅悎娉曪紝宸茶嚜鍔ㄥ彉鏇翠负鍘熸湁绋庣巼!");
-                                                }
+                    //                            //绋庣巼鏁版嵁鏍煎紡鏍¢獙锛岃嫢鏍规嵁瀹㈡埛鑾峰彇鐨勭◣鐜囦笉鍚堟硶锛屽垯浣跨敤璁板綍涓師鏈夌殑绋庣巼锛屽苟鎻愮ず
+                    //                            temp = value_TaxRate + "";
+                    //                            if (!ref.test(temp)) {
+                    //                                value_TaxRate = oldText;
+                    //                                layer.msg("鑾峰彇鍒扮殑绋庣巼涓嶅悎娉曪紝宸茶嚜鍔ㄥ彉鏇翠负鍘熸湁绋庣巼!");
+                    //                            }
 
-                                                //鏁版嵁鏍¢獙鍚堟牸锛岄噸绠楄褰�
-                                                var HQty = option.data[rowIndex].HQty * 1;                  //鏁伴噺
-                                                var HPrice = option.data[rowIndex].HPrice * 1;              //鍗曚环
-                                                var HTaxRate = value_TaxRate * 0.01;                                //绋庣巼
-                                                /*var HDiscountRate = obj.data.HDiscountRate * 1;           //鎶樻墸鐜�*/
-                                                var HTaxPrice = HPrice * (1 + HTaxRate);                    //鍚◣鍗曚环=鍗曚环*(1+绋庣巼)
-                                                /*var HRelTaxPrice = HTaxPrice * HDiscountRate;             //瀹為檯鍚◣鍗曚环=鍚◣鍗曚环*鎶樻墸鐜�*/
-                                                //鎶樻墸棰� = 鍚◣鍗曚环 * (1 - 鎶樻墸鐜�) * 鏁伴噺
-                                                var HMoney = HQty * HPrice;                                 //閲戦=鏁伴噺*鍗曚环
-                                                var HTaxMoney = HMoney * HTaxRate;                          //绋庨=閲戦*绋庣巼
-                                                var HlineTotal = HMoney + HTaxMoney;                        //浠风◣鍚堣=閲戦+绋庨
-                                                //鏁板瓧绮惧害
-                                                HQty = Number(HQty.toFixed(HQtyDec));
-                                                HPrice = Number(HPrice.toFixed(HPriceDec));
-                                                HMoney = Number(HMoney.toFixed(HMoneyDec));
-                                                HTaxMoney = Number(HTaxMoney.toFixed(HMoneyDec));
-                                                HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
-                                                HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
+                    //                            //鏁版嵁鏍¢獙鍚堟牸锛岄噸绠楄褰�
+                    //                            var HQty = option.data[rowIndex].HQty * 1;                  //鏁伴噺
+                    //                            var HPrice = option.data[rowIndex].HPrice * 1;              //鍗曚环
+                    //                            var HTaxRate = value_TaxRate * 0.01;                                //绋庣巼
+                    //                            /*var HDiscountRate = obj.data.HDiscountRate * 1;           //鎶樻墸鐜�*/
+                    //                            var HTaxPrice = HPrice * (1 + HTaxRate);                    //鍚◣鍗曚环=鍗曚环*(1+绋庣巼)
+                    //                            /*var HRelTaxPrice = HTaxPrice * HDiscountRate;             //瀹為檯鍚◣鍗曚环=鍚◣鍗曚环*鎶樻墸鐜�*/
+                    //                            //鎶樻墸棰� = 鍚◣鍗曚环 * (1 - 鎶樻墸鐜�) * 鏁伴噺
+                    //                            var HMoney = HQty * HPrice;                                 //閲戦=鏁伴噺*鍗曚环
+                    //                            var HTaxMoney = HMoney * HTaxRate;                          //绋庨=閲戦*绋庣巼
+                    //                            var HlineTotal = HMoney + HTaxMoney;                        //浠风◣鍚堣=閲戦+绋庨
+                    //                            //鏁板瓧绮惧害
+                    //                            HQty = Number(HQty.toFixed(HQtyDec));
+                    //                            HPrice = Number(HPrice.toFixed(HPriceDec));
+                    //                            HMoney = Number(HMoney.toFixed(HMoneyDec));
+                    //                            HTaxMoney = Number(HTaxMoney.toFixed(HMoneyDec));
+                    //                            HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
+                    //                            HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
 
-                                                option.data[rowIndex].HMaterID = childData.HItemID;
-                                                option.data[rowIndex].鐗╂枡浠g爜 = childData.鐗╂枡浠g爜;
-                                                option.data[rowIndex].鐗╂枡鍚嶇О = childData.鐗╂枡鍚嶇О;
-                                                option.data[rowIndex].瑙勬牸鍨嬪彿 = childData.瑙勬牸鍨嬪彿;
-                                                option.data[rowIndex].HUnitID = childData.HUnitID;
-                                                option.data[rowIndex].璁¢噺鍗曚綅 = childData.璁¢噺鍗曚綅鍚嶇О;
+                    //                            option.data[rowIndex].HMaterID = childData.HItemID;
+                    //                            option.data[rowIndex].鐗╂枡浠g爜 = childData.鐗╂枡浠g爜;
+                    //                            option.data[rowIndex].鐗╂枡鍚嶇О = childData.鐗╂枡鍚嶇О;
+                    //                            option.data[rowIndex].瑙勬牸鍨嬪彿 = childData.瑙勬牸鍨嬪彿;
+                    //                            option.data[rowIndex].HUnitID = childData.HUnitID;
+                    //                            option.data[rowIndex].璁¢噺鍗曚綅 = childData.璁¢噺鍗曚綅鍚嶇О;
 
-                                                option.data[rowIndex].HQty = HQty;
-                                                option.data[rowIndex].HPrice = HPrice;
-                                                option.data[rowIndex].HTaxRate = HTaxRate * 100;
-                                                option.data[rowIndex].HTaxPrice = HTaxPrice;
-                                                option.data[rowIndex].HMoney = HMoney;
-                                                option.data[rowIndex].HlineTotal = HlineTotal;
+                    //                            option.data[rowIndex].HQty = HQty;
+                    //                            option.data[rowIndex].HPrice = HPrice;
+                    //                            option.data[rowIndex].HTaxRate = HTaxRate * 100;
+                    //                            option.data[rowIndex].HTaxPrice = HTaxPrice;
+                    //                            option.data[rowIndex].HMoney = HMoney;
+                    //                            option.data[rowIndex].HlineTotal = HlineTotal;
 
-                                                table.render(option);
+                    //                            table.render(option);
 
-                                                //鍒锋柊琛ㄦ牸鍚屾椂鏍规嵁option涓璈isStockGoods鍊艰缃笅鎷夊垪琛�
-                                                setSelectHisStockGoodsByTableRender();
+                    //                            //鍒锋柊琛ㄦ牸鍚屾椂鏍规嵁option涓璈isStockGoods鍊艰缃笅鎷夊垪琛�
+                    //                            setSelectHisStockGoodsByTableRender();
 
-                                                //璁剧疆琛ㄥご鎵�闇�閲戦
-                                                set_HBillMoney($("#HEarnestRate").val() * 1);
+                    //                            //璁剧疆琛ㄥご鎵�闇�閲戦
+                    //                            set_HBillMoney($("#HEarnestRate").val() * 1);
 
-                                                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();
+                    //                            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);
+                    //                childPage.getSelectedData(currRowIndex);
 
 
-                                    var Dec = getDecByMaterID(childData.HItemID) //鑾峰彇绮惧害
-                                    var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"];  //鏁伴噺绮惧害
-                                    var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"];  //鍗曚环绮惧害
-                                    var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"];  //閲戦绮惧害
-                                    //鏁板�兼牸寮忔牎楠屽伐鍏�
-                                    var ref = /^\d+(\.\d+)?$/;                                  //闈炶礋鏁版鍒欒〃杈惧紡
-                                    var temp = "";
-                                    //鑾峰彇閫夋嫨鐗╂枡鍓嶅悗鐨勭◣鐜�
-                                    var value_TaxRate = subHTaxRate;                                    //閫夋嫨鐗╂枡鍚庢牴鎹鎴峰緱鍒扮殑绋庣巼
-                                    var oldText = option.data[rowIndex].HTaxRate;           //璇ヨ褰曚腑鍘熸湁鐨勭◣鐜�
+                    //                var Dec = getDecByMaterID(childData.HItemID) //鑾峰彇绮惧害
+                    //                var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"];  //鏁伴噺绮惧害
+                    //                var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"];  //鍗曚环绮惧害
+                    //                var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"];  //閲戦绮惧害
+                    //                //鏁板�兼牸寮忔牎楠屽伐鍏�
+                    //                var ref = /^\d+(\.\d+)?$/;                                  //闈炶礋鏁版鍒欒〃杈惧紡
+                    //                var temp = "";
+                    //                //鑾峰彇閫夋嫨鐗╂枡鍓嶅悗鐨勭◣鐜�
+                    //                var value_TaxRate = subHTaxRate;                                    //閫夋嫨鐗╂枡鍚庢牴鎹鎴峰緱鍒扮殑绋庣巼
+                    //                var oldText = option.data[rowIndex].HTaxRate;           //璇ヨ褰曚腑鍘熸湁鐨勭◣鐜�
 
-                                    //绋庣巼鏁版嵁鏍煎紡鏍¢獙锛岃嫢鏍规嵁瀹㈡埛鑾峰彇鐨勭◣鐜囦笉鍚堟硶锛屽垯浣跨敤璁板綍涓師鏈夌殑绋庣巼锛屽苟鎻愮ず
-                                    temp = value_TaxRate + "";
-                                    if (!ref.test(temp)) {
-                                        value_TaxRate = oldText;
-                                        layer.msg("鑾峰彇鍒扮殑绋庣巼涓嶅悎娉曪紝宸茶嚜鍔ㄥ彉鏇翠负鍘熸湁绋庣巼!");
-                                    }
+                    //                //绋庣巼鏁版嵁鏍煎紡鏍¢獙锛岃嫢鏍规嵁瀹㈡埛鑾峰彇鐨勭◣鐜囦笉鍚堟硶锛屽垯浣跨敤璁板綍涓師鏈夌殑绋庣巼锛屽苟鎻愮ず
+                    //                temp = value_TaxRate + "";
+                    //                if (!ref.test(temp)) {
+                    //                    value_TaxRate = oldText;
+                    //                    layer.msg("鑾峰彇鍒扮殑绋庣巼涓嶅悎娉曪紝宸茶嚜鍔ㄥ彉鏇翠负鍘熸湁绋庣巼!");
+                    //                }
 
-                                    //鏁版嵁鏍¢獙鍚堟牸锛岄噸绠楄褰�
-                                    var HQty = option.data[rowIndex].HQty * 1;                  //鏁伴噺
-                                    var HPrice = option.data[rowIndex].HPrice * 1;              //鍗曚环
-                                    var HTaxRate = value_TaxRate * 0.01;                                //绋庣巼
-                                    /*var HDiscountRate = obj.data.HDiscountRate * 1;           //鎶樻墸鐜�*/
-                                    var HTaxPrice = HPrice * (1 + HTaxRate);                    //鍚◣鍗曚环=鍗曚环*(1+绋庣巼)
-                                    /*var HRelTaxPrice = HTaxPrice * HDiscountRate;             //瀹為檯鍚◣鍗曚环=鍚◣鍗曚环*鎶樻墸鐜�*/
-                                    //鎶樻墸棰� = 鍚◣鍗曚环 * (1 - 鎶樻墸鐜�) * 鏁伴噺
-                                    var HMoney = HQty * HPrice;                                 //閲戦=鏁伴噺*鍗曚环
-                                    var HTaxMoney = HMoney * HTaxRate;                          //绋庨=閲戦*绋庣巼
-                                    var HlineTotal = HMoney + HTaxMoney;                        //浠风◣鍚堣=閲戦+绋庨
-                                    //鏁板瓧绮惧害
-                                    HQty = Number(HQty.toFixed(HQtyDec));
-                                    HPrice = Number(HPrice.toFixed(HPriceDec));
-                                    HMoney = Number(HMoney.toFixed(HMoneyDec));
-                                    HTaxMoney = Number(HTaxMoney.toFixed(HMoneyDec));
-                                    HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
-                                    HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
+                    //                //鏁版嵁鏍¢獙鍚堟牸锛岄噸绠楄褰�
+                    //                var HQty = option.data[rowIndex].HQty * 1;                  //鏁伴噺
+                    //                var HPrice = option.data[rowIndex].HPrice * 1;              //鍗曚环
+                    //                var HTaxRate = value_TaxRate * 0.01;                                //绋庣巼
+                    //                /*var HDiscountRate = obj.data.HDiscountRate * 1;           //鎶樻墸鐜�*/
+                    //                var HTaxPrice = HPrice * (1 + HTaxRate);                    //鍚◣鍗曚环=鍗曚环*(1+绋庣巼)
+                    //                /*var HRelTaxPrice = HTaxPrice * HDiscountRate;             //瀹為檯鍚◣鍗曚环=鍚◣鍗曚环*鎶樻墸鐜�*/
+                    //                //鎶樻墸棰� = 鍚◣鍗曚环 * (1 - 鎶樻墸鐜�) * 鏁伴噺
+                    //                var HMoney = HQty * HPrice;                                 //閲戦=鏁伴噺*鍗曚环
+                    //                var HTaxMoney = HMoney * HTaxRate;                          //绋庨=閲戦*绋庣巼
+                    //                var HlineTotal = HMoney + HTaxMoney;                        //浠风◣鍚堣=閲戦+绋庨
+                    //                //鏁板瓧绮惧害
+                    //                HQty = Number(HQty.toFixed(HQtyDec));
+                    //                HPrice = Number(HPrice.toFixed(HPriceDec));
+                    //                HMoney = Number(HMoney.toFixed(HMoneyDec));
+                    //                HTaxMoney = Number(HTaxMoney.toFixed(HMoneyDec));
+                    //                HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
+                    //                HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
 
-                                    option.data[rowIndex].HMaterID = childData.HItemID;
-                                    option.data[rowIndex].鐗╂枡浠g爜 = childData.鐗╂枡浠g爜;
-                                    option.data[rowIndex].鐗╂枡鍚嶇О = childData.鐗╂枡鍚嶇О;
-                                    option.data[rowIndex].瑙勬牸鍨嬪彿 = childData.瑙勬牸鍨嬪彿;
-                                    option.data[rowIndex].HUnitID = childData.HUnitID;
-                                    option.data[rowIndex].璁¢噺鍗曚綅 = childData.璁¢噺鍗曚綅鍚嶇О;
+                    //                option.data[rowIndex].HMaterID = childData.HItemID;
+                    //                option.data[rowIndex].鐗╂枡浠g爜 = childData.鐗╂枡浠g爜;
+                    //                option.data[rowIndex].鐗╂枡鍚嶇О = childData.鐗╂枡鍚嶇О;
+                    //                option.data[rowIndex].瑙勬牸鍨嬪彿 = childData.瑙勬牸鍨嬪彿;
+                    //                option.data[rowIndex].HUnitID = childData.HUnitID;
+                    //                option.data[rowIndex].璁¢噺鍗曚綅 = childData.璁¢噺鍗曚綅鍚嶇О;
 
-                                    option.data[rowIndex].HQty = HQty;
-                                    option.data[rowIndex].HPrice = HPrice;
-                                    option.data[rowIndex].HTaxRate = HTaxRate * 100;
-                                    option.data[rowIndex].HTaxPrice = HTaxPrice;
-                                    option.data[rowIndex].HMoney = HMoney;
-                                    option.data[rowIndex].HlineTotal = HlineTotal;
+                    //                option.data[rowIndex].HQty = HQty;
+                    //                option.data[rowIndex].HPrice = HPrice;
+                    //                option.data[rowIndex].HTaxRate = HTaxRate * 100;
+                    //                option.data[rowIndex].HTaxPrice = HTaxPrice;
+                    //                option.data[rowIndex].HMoney = HMoney;
+                    //                option.data[rowIndex].HlineTotal = HlineTotal;
 
-                                    table.render(option);
+                    //                table.render(option);
 
-                                    //鍒锋柊琛ㄦ牸鍚屾椂鏍规嵁option涓璈isStockGoods鍊艰缃笅鎷夊垪琛�
-                                    setSelectHisStockGoodsByTableRender();
+                    //                //鍒锋柊琛ㄦ牸鍚屾椂鏍规嵁option涓璈isStockGoods鍊艰缃笅鎷夊垪琛�
+                    //                setSelectHisStockGoodsByTableRender();
 
-                                    //璁剧疆琛ㄥご鎵�闇�閲戦
-                                    set_HBillMoney($("#HEarnestRate").val() * 1);
+                    //                //璁剧疆琛ㄥご鎵�闇�閲戦
+                    //                set_HBillMoney($("#HEarnestRate").val() * 1);
 
-                                    childPage = null;
-                                    currRowIndex = 0;
-                                    childData = null;
-                                    obj.event = "";
-                                }
-                            }
-                        }
+                    //                childPage = null;
+                    //                currRowIndex = 0;
+                    //                childData = null;
+                    //                obj.event = "";
+                    //            }
+                    //        }
+                    //    }
 
-                    }
+                    //}
                     //#endregion
 
 
@@ -2881,7 +2894,7 @@
                                 , shift: 2 //寮瑰嚭鍔ㄧ敾
                                 , area: ["90%", "90%"] //绐椾綋澶у皬
                                 , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
-                                , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Material.html?openType=2&HOrgID=' + HOrgID, 'yes']
+                                , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Material.html?openType=2&HOrgID=' + HOrgID + '&openType2=SeOrder', 'yes']
                                 , btn: ["纭畾", "鍙栨秷"]
                                 , btn1: function (index, laero) {
                                     //鎸夐挳涓�  鐨勫洖璋�
@@ -3508,6 +3521,10 @@
 
                 //鍙屽嚮
                 $('.layui-table-box tbody td[data-field="鐗╂枡浠g爜"]').off('dblclick').on('dblclick', function () {
+                    //鎵嬪姩澶辩劍
+                    var element = document.getElementById("HBillNo");
+                    element.focus();
+
                     var HOrgID = $("#HOrgID").val();
 
                     layer.open({
@@ -3518,7 +3535,7 @@
                         , shift: 2 //寮瑰嚭鍔ㄧ敾
                         , area: ["90%", "90%"] //绐椾綋澶у皬
                         , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
-                        , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Material.html?openType=2&HOrgID=' + HOrgID, 'yes']
+                        , content: ['../../鍩虹璧勬枡/鍏敤鍩虹璧勬枡/Gy_Material.html?openType=2&HOrgID=' + HOrgID + '&openType2=SeOrder', 'yes']
                         , btn: ["纭畾", "鍙栨秷"]
                         , btn1: function (index, laero) {
                             //鎸夐挳涓�  鐨勫洖璋�
@@ -3654,7 +3671,111 @@
                             }
                         }
                     })
+
+                    obj.event = "";
                 });
+
+                //鐗╂枡琛ㄦ牸涓嬫媺鎼滅储妗�
+                tableSelect.render({
+                    elem: 'td[data-field="鐗╂枡浠g爜"] .layui-table-edit',
+                    checkedKey: 'HItemID',
+                    searchKey: '鐗╂枡浠g爜,鐗╂枡鍚嶇О',
+                    sWhere: " and 鐗╂枡灞炴��='鑷埗'",//table鎼滅储sWhere鏉′欢
+                    table: {
+                        url: GetWEBURL() + 'Gy_Material/page',
+                        where: { user: sessionStorage["HUserName"], Organization: sessionStorage["Organization"] },
+                        cols: [[
+                            { type: 'checkbox', fixed: 'left' },
+                            { field: 'HItemID', title: 'HItemID' },
+                            { field: '鐗╂枡浠g爜', title: '鐗╂枡浠g爜' },
+                            { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О' },
+                        ]],
+                        page: true,
+                        limit: 5,
+                        limits: [5]
+                    },
+                    done: function (elem, data) {
+                        if (data != []) {
+                            checkStatus = data;
+                            var rowIndex = $(obj.tr).attr("data-index") * 1;
+                            var Dec = getDecByMaterID(obj.data.HMaterID) //鑾峰彇绮惧害
+                            var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"];  //鏁伴噺绮惧害
+                            var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"];  //鍗曚环绮惧害
+                            var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"];  //閲戦绮惧害
+                            for (var i = 0; i < checkStatus.data.length; i++) {
+                                if (rowIndex + i >= option.data.length) {
+                                    var NewRow = {
+                                        "HMaterID": "0", "鐗╂枡浠g爜": "", "鐗╂枡鍚嶇О": "", "瑙勬牸鍨嬪彿": "", "HUnitID": "0", "璁¢噺鍗曚綅": "", "HQty": "0", "HPrice": "0", "HTaxPrice": "0"
+                                        , "HMoney": "0", "HDiscountRate": "0", "HRelTaxPrice": "0", "HTaxRate": "0", "HTaxMoney": "0", "HlineTotal": "0", "HlineTotalBB": "0"
+                                        , "HDate": Format(new Date(), 'yyyy-MM-dd'), "HOutStockQty": "0", "HInvoiceQty": "0", "HRemark": "", "HCusMaterNumber": "",
+                                        "HCusModel": "", "HCusMaterName": ""
+                                    }
+                                    btnAddLine(NewRow);
+                                }
+
+                                //鑾峰彇閫変腑鐨勭墿鏂欎俊鎭�
+                                var resultData = checkStatus.data[i];
+
+                                //鏁板�兼牸寮忔牎楠屽伐鍏�
+                                var ref = /^\d+(\.\d+)?$/;                                  //闈炶礋鏁版鍒欒〃杈惧紡
+                                var temp = "";
+                                //鑾峰彇閫夋嫨鐗╂枡鍓嶅悗鐨勭◣鐜�
+                                var value = subHTaxRate;                                    //閫夋嫨鐗╂枡鍚庢牴鎹鎴峰緱鍒扮殑绋庣巼
+                                var oldText = option.data[rowIndex + i].HTaxRate;           //璇ヨ褰曚腑鍘熸湁鐨勭◣鐜�
+
+                                //绋庣巼鏁版嵁鏍煎紡鏍¢獙锛岃嫢鏍规嵁瀹㈡埛鑾峰彇鐨勭◣鐜囦笉鍚堟硶锛屽垯浣跨敤璁板綍涓師鏈夌殑绋庣巼锛屽苟鎻愮ず
+                                temp = value + "";
+                                if (!ref.test(temp)) {
+                                    value = oldText;
+                                    layer.msg("鑾峰彇鍒扮殑绋庣巼涓嶅悎娉曪紝宸茶嚜鍔ㄥ彉鏇翠负鍘熸湁绋庣巼!");
+                                }
+
+                                //鏁版嵁鏍¢獙鍚堟牸锛岄噸绠楄褰�
+                                var HQty = option.data[rowIndex + i].HQty * 1;                  //鏁伴噺
+                                var HPrice = option.data[rowIndex + i].HPrice * 1;              //鍗曚环
+                                var HTaxRate = value * 0.01;                                //绋庣巼
+                                /*var HDiscountRate = obj.data.HDiscountRate * 1;           //鎶樻墸鐜�*/
+                                var HTaxPrice = HPrice * (1 + HTaxRate);                    //鍚◣鍗曚环=鍗曚环*(1+绋庣巼)
+                                /*var HRelTaxPrice = HTaxPrice * HDiscountRate;             //瀹為檯鍚◣鍗曚环=鍚◣鍗曚环*鎶樻墸鐜�*/
+                                //鎶樻墸棰� = 鍚◣鍗曚环 * (1 - 鎶樻墸鐜�) * 鏁伴噺
+                                var HMoney = HQty * HPrice;                                 //閲戦=鏁伴噺*鍗曚环
+                                var HTaxMoney = HMoney * HTaxRate;                          //绋庨=閲戦*绋庣巼
+                                var HlineTotal = HMoney + HTaxMoney;                        //浠风◣鍚堣=閲戦+绋庨
+                                //鏁板瓧绮惧害
+                                HQty = Number(HQty.toFixed(HQtyDec));
+                                HPrice = Number(HPrice.toFixed(HPriceDec));
+                                HMoney = Number(HMoney.toFixed(HMoneyDec));
+                                HTaxMoney = Number(HTaxMoney.toFixed(HMoneyDec));
+                                HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
+                                HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
+
+                                option.data[rowIndex + i].HMaterID = resultData.HItemID;
+                                option.data[rowIndex + i].鐗╂枡浠g爜 = resultData.鐗╂枡浠g爜;
+                                option.data[rowIndex + i].鐗╂枡鍚嶇О = resultData.鐗╂枡鍚嶇О;
+                                option.data[rowIndex + i].瑙勬牸鍨嬪彿 = resultData.瑙勬牸鍨嬪彿;
+                                option.data[rowIndex + i].HUnitID = resultData.HUnitID;
+                                option.data[rowIndex + i].璁¢噺鍗曚綅 = resultData.璁¢噺鍗曚綅鍚嶇О;
+
+                                option.data[rowIndex + i].HQty = HQty;
+                                option.data[rowIndex + i].HPrice = HPrice;
+                                option.data[rowIndex + i].HTaxRate = HTaxRate * 100;
+                                option.data[rowIndex + i].HTaxPrice = HTaxPrice;
+                                option.data[rowIndex + i].HMoney = HMoney;
+                                option.data[rowIndex + i].HlineTotal = HlineTotal;
+
+
+                            }
+                            table.render(option);
+
+                            //鍒锋柊琛ㄦ牸鍚屾椂鏍规嵁option涓璈isStockGoods鍊艰缃笅鎷夊垪琛�
+                            setSelectHisStockGoodsByTableRender();
+
+                            //璁剧疆琛ㄥご鎵�闇�閲戦
+                            set_HBillMoney($("#HEarnestRate").val() * 1);
+                        }
+                        
+                    }
+                })
             }
             //#endregion
 

--
Gitblit v1.9.1