From d33f1177a2057180d9db3e75894e86bc4fff67c0 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期一, 24 六月 2024 15:47:55 +0800
Subject: [PATCH] 1

---
 WebTM/views/WMS扫码模块/其他入库/Kf_OtherInBill_PDA.html |  253 +++++++++++++++++++++++++++++++++----------------
 1 files changed, 169 insertions(+), 84 deletions(-)

diff --git "a/WebTM/views/WMS\346\211\253\347\240\201\346\250\241\345\235\227/\345\205\266\344\273\226\345\205\245\345\272\223/Kf_OtherInBill_PDA.html" "b/WebTM/views/WMS\346\211\253\347\240\201\346\250\241\345\235\227/\345\205\266\344\273\226\345\205\245\345\272\223/Kf_OtherInBill_PDA.html"
index 63c113b..a3f75a7 100644
--- "a/WebTM/views/WMS\346\211\253\347\240\201\346\250\241\345\235\227/\345\205\266\344\273\226\345\205\245\345\272\223/Kf_OtherInBill_PDA.html"
+++ "b/WebTM/views/WMS\346\211\253\347\240\201\346\250\241\345\235\227/\345\205\266\344\273\226\345\205\245\345\272\223/Kf_OtherInBill_PDA.html"
@@ -14,7 +14,7 @@
     <script src="../../../layuiadmin/Scripts/json2.js"></script>
     <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
     <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
-    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
+    <script src="../../../layuiadmin/PubCustom.js"></script>
     <style>
         .layui-col-xs8 {
             width: 55.666667%;
@@ -105,7 +105,7 @@
                                                 <label class="layui-form-label" style="width:60px;padding-left:0px;">鍒跺崟浜�</label>
                                             </div>
                                             <div class="layui-col-xs9">
-                                                <input type="text" name="HMaker" id="HMaker" lay-verify="HMaker" autocomplete="off" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
+                                                <input type="text" name="HMaker" id="HMaker" lay-verify="HMaker" autocomplete="off" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                             </div>
                                         </div>
                                         <div class="layui-row">
@@ -113,7 +113,7 @@
                                                 <label class="layui-form-label" style="width:60px;padding-left:0px;">鍗曟嵁鍙�</label>
                                             </div>
                                             <div class="layui-col-xs9">
-                                                <input type="text" name="HBillNo" id="HBillNo" lay-verify="HBillNo" autocomplete="off" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
+                                                <input type="text" name="HBillNo" id="HBillNo" lay-verify="HBillNo" autocomplete="off" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                             </div>
                                         </div>
                                         <div class="layui-row">
@@ -121,7 +121,7 @@
                                                 <label class="layui-form-label" style="width:60px;padding-left:0px;">鍗曟嵁ID</label>
                                             </div>
                                             <div class="layui-col-xs9">
-                                                <input type="text" name="HInterID" id="HInterID" lay-verify="HInterID" value="0" autocomplete="off" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
+                                                <input type="text" name="HInterID" id="HInterID" lay-verify="HInterID" value="0" autocomplete="off" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                             </div>
                                         </div>
                                     </div>
@@ -230,7 +230,7 @@
                                                 <label class="layui-form-label" style="width:30px;padding-left:0px;">缁勭粐</label>
                                             </div>
                                             <div class="layui-col-xs10">
-                                                <input type="text" name="HStockOrgName" id="HStockOrgName" lay-verify="HStockOrgName" autocomplete="off" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
+                                                <input type="text" name="HStockOrgName" id="HStockOrgName" lay-verify="HStockOrgName" autocomplete="off" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                                 <input type="hidden" name="HStockOrgID" id="HStockOrgID" lay-verify="HStockOrgID" value="0" autocomplete="off" class="layui-input">
                                             </div>
                                         </div>
@@ -253,7 +253,7 @@
                                                 <label class="layui-form-label" style="width:40px;padding-left:0px;">鏉$爜</label>
                                             </div>
                                             <div class="layui-col-xs10">
-                                                <input type="text" name="HBarCode_B" id="HBarCode_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
+                                                <input type="text" name="HBarCode_B" id="HBarCode_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                             </div>
                                         </div>
                                     </div>
@@ -263,7 +263,7 @@
                                                 <label class="layui-form-label" style="width:40px;padding-left:0px;">鐗╂枡</label>
                                             </div>
                                             <div class="layui-col-xs10">
-                                                <input type="text" name="HMaterName_B" id="HMaterName_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
+                                                <input type="text" name="HMaterName_B" id="HMaterName_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                             </div>
                                         </div>
                                     </div>
@@ -273,7 +273,7 @@
                                                 <label class="layui-form-label" style="width:40px;padding-left:0px;">瑙勬牸</label>
                                             </div>
                                             <div class="layui-col-xs10">
-                                                <input type="text" name="HMaterModel_B" id="HMaterModel_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
+                                                <input type="text" name="HMaterModel_B" id="HMaterModel_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                             </div>
                                         </div>
                                     </div>
@@ -283,7 +283,7 @@
                                                 <label class="layui-form-label" style="width:40px;padding-left:0px;">鎵规</label>
                                             </div>
                                             <div class="layui-col-xs10">
-                                                <input type="text" name="HBatchNo_B" id="HBatchNo_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
+                                                <input type="text" name="HBatchNo_B" id="HBatchNo_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                             </div>
                                         </div>
                                     </div>
@@ -293,7 +293,7 @@
                                                 <label class="layui-form-label" style="width:40px;padding-left:0px;">鍗曚綅</label>
                                             </div>
                                             <div class="layui-col-xs10">
-                                                <input type="text" name="HUnitName_B" id="HUnitName_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
+                                                <input type="text" name="HUnitName_B" id="HUnitName_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                             </div>
                                         </div>
                                     </div>
@@ -303,7 +303,7 @@
                                                 <label class="layui-form-label" style="width:40px;padding-left:0px;">鏁伴噺</label>
                                             </div>
                                             <div class="layui-col-xs10">
-                                                <input type="text" name="HQty_B" id="HQty_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
+                                                <input type="text" name="HQty_B" id="HQty_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                             </div>
                                         </div>
                                     </div>
@@ -313,7 +313,7 @@
                                                 <label class="layui-form-label" style="width:40px;padding-left:0px;">瀹归噺</label>
                                             </div>
                                             <div class="layui-col-xs10">
-                                                <input type="text" name="HTMQty_B" id="HTMQty_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
+                                                <input type="text" name="HTMQty_B" id="HTMQty_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                             </div>
                                         </div>
                                     </div>
@@ -323,7 +323,7 @@
                                                 <label class="layui-form-label" style="width:40px;padding-left:0px;">浠撳簱</label>
                                             </div>
                                             <div class="layui-col-xs10">
-                                                <input type="text" name="HWHName_B" id="HWHName_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
+                                                <input type="text" name="HWHName_B" id="HWHName_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                             </div>
                                         </div>
                                     </div>
@@ -333,7 +333,7 @@
                                                 <label class="layui-form-label" style="width:40px;padding-left:0px;">浠撲綅</label>
                                             </div>
                                             <div class="layui-col-xs10">
-                                                <input type="text" name="HSPName_B" id="HSPName_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
+                                                <input type="text" name="HSPName_B" id="HSPName_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                             </div>
                                         </div>
                                     </div>
@@ -392,11 +392,15 @@
             var HBillerID = sessionStorage["HBillerID"]
             var HStockOrgID = sessionStorage["OrganizationID"]  //缁勭粐ID
             var HSourceFlag = false     //鏄惁宸叉壂鐮佹爣蹇�
-            var OperationType = 0       //鎿嶄綔绫诲瀷锛�1鏂板銆�2浠庣紦瀛樺垪琛ㄤ腑杩斿洖锛�
+            var OperationType = 1       //鎿嶄綔绫诲瀷锛�1鏂板銆�2浠庣紦瀛樺垪琛ㄤ腑杩斿洖锛�
             var listOption = [];
             var columns = "";
             var HModName = "Kf_OtherInBill_PDA";
-            var titleData = [];     //涓嶉渶瑕佹樉绀虹殑瀛楁
+            var ModRightName = "CE_OtherIn";    //妯″潡鏉冮檺鍙傛暟
+            var titleData = [];                 //涓嶉渶瑕佹樉绀虹殑瀛楁
+            var params = get_UrlVars();
+            var OperationType = params[params[0]] == null ? 1 : params[params[0]];  //浠庣紦瀛樺垪琛ㄤ腑杩斿洖鏁版嵁绫诲瀷锛�1鏂板銆�2浠庣紦瀛樺垪琛ㄤ腑杩斿洖锛�
+            var HInterID_Temp = params[params[1]];      //浠庣紦瀛樺垪琛ㄤ腑杩斿洖鍗曟嵁ID
 
             //#endregion
 
@@ -404,20 +408,57 @@
             if (sessionStorage.login != "login") {
                 layer.confirm("鐧诲綍澶辨晥锛岃閲嶆柊鐧诲綍锛�", {
                     icon: 4, skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", closeBtn: 0, btn: ['閲嶆柊鐧诲綍']
-                }, function () { window.location.href = "../../user/login.html"; });
+                }, function () { window.location.href = "../../user/login_pda.html"; });
             }
+
+            //#region   鐢ㄦ埛妯″潡鏉冮檺鍒ゆ柇
+
+            //鐢ㄦ埛妯″潡鏉冮檺鍒ゆ柇
+            CheckModRight();
+
+            function CheckModRight() {
+                layer.load(3);
+                $.ajax({
+                    type: "GET",
+                    url: GetWEBURL() + "/WEBSController/CheckModRight_Json",
+                    async: false,    //async鐢ㄤ簬鎺у埗锛坒alse锛夊悓姝ュ拰锛坱rue锛夊紓姝ワ紝榛樿鐨勬槸true锛屽嵆璇锋眰榛樿鐨勬槸寮傛璇锋眰
+                    data: { "ModRightName": ModRightName, "HUserName": HMaker },
+                    success: function (d) {
+                        if (d.count == 1) {
+                        }
+                        else {
+                            layer.msg(d.Message, {
+                                icon: 0, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", btn: ['纭']
+                            }, function () { parent.location.href = "../../../views/index_Mobile.html"; });
+                        }
+                    },
+                    complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
+                });
+                layer.closeAll("loading");
+            }
+            //#endregion
 
             //澶辫触鎻愮ず闊�
             function playSound() {
                 console.log("playSound");
                 var audio = document.getElementById("cs");
                 audio.play();
+                audio.onended = function () {
+                    // 褰撻煶棰戞挱鎶ュ畬鎴愭椂锛岃皟鐢� pause 鍜岃缃� currentTime 涓� 0 浠ュ仠姝㈡挱鎶ュ苟閲嶇疆
+                    audio.pause();
+                    audio.currentTime = 0;
+                };
             }
             //鎴愬姛鎻愮ず闊�
             function playSound_OK() {
                 console.log("playSound_OK");
                 var audio = document.getElementById("cs2");
                 audio.play();
+                audio.onended = function () {
+                    // 褰撻煶棰戞挱鎶ュ畬鎴愭椂锛岃皟鐢� pause 鍜岃缃� currentTime 涓� 0 浠ュ仠姝㈡挱鎶ュ苟閲嶇疆
+                    audio.pause();
+                    audio.currentTime = 0;
+                };
             }
 
             //#region 鍒濆鍖栫晫闈�
@@ -435,7 +476,7 @@
                 $("#HKeeperID").val(sessionStorage["HKeeperID"]);
                 $("#HKeeperName").val(sessionStorage["HKeeper"]);
                 $("#HMaker").val(sessionStorage["HUserName"]);
-                $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
+                $("#HDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
                 $("#HBillerID").val(sessionStorage["HBillerID"]);
                 $("#HStockOrgID").val(sessionStorage["OrganizationID"]);
                 $("#HStockOrgName").val(sessionStorage["Organization"]);
@@ -444,13 +485,13 @@
                 if (sessionStorage["HWhSPFlag"]) {
                     $("#HStockPlaceID").val("0");
                     $("#HStockPlaceName").val("");
-                    $("#HStockPlaceName").attr("readonly", "readonly");
+                    $("#HStockPlaceName").attr("disabled", "disabled");
                     $('#HSpID-BT').addClass("layui-btn-disabled").attr("disabled", true);//鎸夐挳绂佺敤
                 }
                 else {
                     $("#HStockPlaceID").val(sessionStorage["HSPID"]);
                     $("#HStockPlaceName").val(sessionStorage["HSPName"]);
-                    $("#HStockPlaceName").removeAttr("readonly");
+                    $("#HStockPlaceName").removeAttr("disabled");
                     $('#HSpID-BT').removeClass("layui-btn-disabled").attr("disabled", false);//鎸夐挳鎭㈠姝e父鐘舵��
                 }
 
@@ -505,7 +546,8 @@
                             form.render('select');
                         }
                         layer.closeAll("loading");
-                    }
+                    },
+                    complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
                 })
             }
             //鍒濆鍖栬〃鏍�
@@ -517,24 +559,20 @@
                     , height: 'full-60'
                     , cellMinWidth: 90
                     , limit: 50
+                    , done: function () {
+                        layer.closeAll("loading");
+                    }
                 };
             }
 
-            //#region   浠庣紦瀛樺垪琛ㄤ腑杩斿洖淇℃伅
-            function getUrlVars() {
-                var vars = [], hash;
-                var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
-                for (var i = 0; i < hashes.length; i++) {
-                    hash = hashes[i].split('=');
-                    vars.push(hash[0]);
-                    vars[hash[0]] = hash[1];
-                }
-                return vars;
-            }
-            var params = getUrlVars();
-            var OperationType = params[params[0]];  //浠庣紦瀛樺垪琛ㄤ腑杩斿洖鏁版嵁绫诲瀷  1鏂板  2浠庣紦瀛樺垪琛ㄤ腑杩斿洖
-            var HInterID_Temp = params[params[1]];  //浠庣紦瀛樺垪琛ㄤ腑杩斿洖鍗曟嵁ID
-
+            //#region 鐐瑰嚮琛岄�変腑楂樹寒
+            table.on('row(wl-table)', function (obj) {
+                //閫変腑琛屾敼鍙橀鑹�
+                $(".layui-table-body tr ").attr({ "style": "background:" });    //鍏朵粬tr鎭㈠鍘熸牱
+                obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click');   //閫変腑琛屾牱寮�
+                obj.tr.find('i[class="layui-anim layui-icon"]').trigger("click");   //閫変腑radio鏍峰紡
+                $(obj.tr.selector).attr({ "style": "background:#ceedfa;color:black" }); //鏀瑰彉褰撳墠tr鑳屾櫙棰滆壊鍜屽瓧浣撻鑹�
+            })
             //#endregion
 
             //鍒ゆ柇鏄惁鏂板锛岃幏鍙栨渶澶у崟鎹彿
@@ -552,7 +590,6 @@
                 element.tabChange('tab-Kf_OtherInBill_PDA', '2');
             }
             else {
-                OperationType = 1;
                 //鑾峰彇鏈�澶у崟鎹甀D銆佸崟鎹彿
                 $.ajax({
                     type: "GET",
@@ -569,7 +606,8 @@
                         else {
                             layer.msg(d.Message, { icon: 0, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                         }
-                    }
+                    },
+                    complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
                 });
                 HSourceFlag = false;
             }
@@ -586,15 +624,19 @@
                         $("#HBillNo").val(d.data[0].HBillNo);
                         HInterID = $('#HInterID').val()
                         HBillNo = $('#HBillNo').val()
-                        //$("#HMainSourceBillType").val(d.data[0].HSourceBillType == null ? "1241" : d.data[0].HSourceBillType);
                         //鑾峰彇婧愬崟绫诲瀷
                         if (d.data[0].HSourceBillType == "1241") {
                             $("#HMainSourceBillType").empty();
                             var optionHtml = '';
                             optionHtml += "<option value = '" + d.data[0].HSourceBillType + "' >" + '鍏ュ簱鐢宠鍗�' + "</option>";
                             $("#HMainSourceBillType").append(optionHtml);
+                            $("#HMainSourceBillType").attr("disabled", "disabled");
+                            $("#HBillSubType").val("QTRKD01_SYS");   //鏍囧噯鍏朵粬鍏ュ簱鍗�
+                            $("#HBillSubType").attr("disabled", "disabled");
                             layui.form.render('select');
-                            $("#HMainSourceBillType").attr("readonly", "readonly");
+                            //渚涘簲鍟嗕笉鍙紪杈�
+                            $("#HSupName").attr("disabled", "disabled");
+                            $('#HSupID-BT').addClass("layui-btn-disabled").attr("disabled", true);//鎸夐挳绂佺敤
                         }
                         else {
                             $("#HMainSourceBillType").empty();
@@ -602,21 +644,24 @@
                             optionHtml += "<option value = '" + d.data[0].HSourceBillType + "' >" + '鎵嬪伐褰曞叆' + "</option>";
                             $("#HMainSourceBillType").append(optionHtml);
                             layui.form.render('select');
-                            $("#HMainSourceBillType").attr("readonly", "readonly");
+                            $("#HMainSourceBillType").attr("disabled", "disabled");
                         }
 
                         $("#HSourceBillNo").val(d.data[0].HSourceBillNo);
                         //闈炲婧愬崟妯″紡
                         if (d.data[0].HMulSourceBill == 0) {
-                            $("#HSourceBillNo").attr("readonly", "readonly");
+                            $("#HSourceBillNo").attr("disabled", "disabled");
                             $('#HSourceBillNo-BT').addClass("layui-btn-disabled").attr("disabled", true);//鎸夐挳绂佺敤
                         }
                         if (d.data[0].HDeptID != 0) {
                             $("#HDeptID").val(d.data[0].HDeptID);
                             $("#HDeptName").val(d.data[0].HDeptName);
                         }
-                        $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
-                    }
+                        $("#HSupID").val(d.data[0].HCusID);
+                        $("#HSupName").val(d.data[0].HSupName);
+                        $("#HDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
+                    },
+                    complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
                 })
             }
 
@@ -635,7 +680,7 @@
                         $("#HWHName").val("");
                         $("#HStockPlaceID").val("0");
                         $("#HStockPlaceName").val("");
-                        $("#HStockPlaceName").removeAttr("readonly");
+                        $("#HStockPlaceName").removeAttr("disabled");
                         $('#HSpID-BT').removeClass("layui-btn-disabled").attr("disabled", false);//鎸夐挳鎭㈠姝e父鐘舵��
                         layer.msg("浠撳簱鏉$爜涓虹┖锛�", {
                             icon: 0, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", btn: ['纭']
@@ -659,11 +704,11 @@
                                 $("#HStockPlaceID").val("0");
                                 $("#HStockPlaceName").val("");
                                 if (result.data[0].HSPFlag == 0) {
-                                    $("#HStockPlaceName").attr("readonly", "readonly");
+                                    $("#HStockPlaceName").attr("disabled", "disabled");
                                     $('#HSpID-BT').addClass("layui-btn-disabled").attr("disabled", true);//鎸夐挳绂佺敤
                                 }
                                 else {
-                                    $("#HStockPlaceName").removeAttr("readonly");
+                                    $("#HStockPlaceName").removeAttr("disabled");
                                     $('#HSpID-BT').removeClass("layui-btn-disabled").attr("disabled", false);//鎸夐挳鎭㈠姝e父鐘舵��
                                 }
                                 element.tabChange('tab-Kf_OtherInBill_PDA', '2');
@@ -677,7 +722,7 @@
                                 $("#HWHName").val("");
                                 $("#HStockPlaceID").val("0");
                                 $("#HStockPlaceName").val("");
-                                $("#HStockPlaceName").removeAttr("readonly");
+                                $("#HStockPlaceName").removeAttr("disabled");
                                 $('#HSpID-BT').removeClass("layui-btn-disabled").attr("disabled", false);//鎸夐挳鎭㈠姝e父鐘舵��
                                 layer.msg(result.Message, {
                                     icon: 0, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず", btn: ['纭']
@@ -687,7 +732,8 @@
                                 });
                             }
                             layer.closeAll("loading");
-                        }
+                        },
+                        complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
                     });
                 }
             });
@@ -767,7 +813,8 @@
                                 });
                             }
                             layer.closeAll("loading");
-                        }
+                        },
+                        complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
                     });
                 }
             });
@@ -840,7 +887,8 @@
                                 });
                             }
                             layer.closeAll("loading");
-                        }
+                        },
+                        complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
                     });
                 }
             });
@@ -909,7 +957,8 @@
                                 });
                             }
                             layer.closeAll("loading");
-                        }
+                        },
+                        complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
                     });
                 }
             });
@@ -978,7 +1027,8 @@
                                 });
                             }
                             layer.closeAll("loading");
-                        }
+                        },
+                        complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
                     });
                 }
             });
@@ -1047,7 +1097,8 @@
                                 });
                             }
                             layer.closeAll("loading");
-                        }
+                        },
+                        complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
                     });
                 }
             });
@@ -1137,6 +1188,7 @@
                                     layer.msg(data.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                                 }
                             },
+                            complete: function (XHR, TS) { XHR = null },//鍥炴敹璧勬簮
                             error: function (err) {
                                 layer.msg("閿欒:" + err, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                             }
@@ -1213,6 +1265,7 @@
                                         layer.msg(data.Message, { icon: 2, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                                     }
                                 },
+                                complete: function (XHR, TS) { XHR = null },//鍥炴敹璧勬簮
                                 error: function (err) {
                                     layer.msg('閿欒' + err, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                                 }
@@ -1284,11 +1337,16 @@
 
                             $("#HSourceBillNo").val(result.data.hSourceBillNoField);
                             $("#HMainSourceBillType").attr("disabled", "disabled");
-                            form.render('select');
                             if (result.data.hMulSourceFlagField == 0) {
-                                $("#HSourceBillNo").attr("readonly", "readonly");
+                                $("#HSourceBillNo").attr("disabled", "disabled");
                                 $('#HSourceBillNo-BT').addClass("layui-btn-disabled").attr("disabled", true);//鎸夐挳绂佺敤
                             }
+                            $("#HBillSubType").val("QTRKD01_SYS");   //鏍囧噯鍏朵粬鍏ュ簱鍗�
+                            $("#HBillSubType").attr("disabled", "disabled");
+                            form.render('select');
+                            //渚涘簲鍟嗕笉鍙紪杈�
+                            $("#HSupName").attr("disabled", "disabled");
+                            $('#HSupID-BT').addClass("layui-btn-disabled").attr("disabled", true);//鎸夐挳绂佺敤
                             element.tabChange('tab-Kf_OtherInBill_PDA', '2');
                             $("#HBarCode").select();
                             $("#HBarCode").focus();
@@ -1305,7 +1363,8 @@
                                 $("#HSourceBillNo").focus();
                             });
                         }
-                    }
+                    },
+                    complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
                 });
                 layer.closeAll("loading");
             }
@@ -1389,6 +1448,7 @@
                                     });
                                 }
                             },
+                            complete: function (XHR, TS) { XHR = null },//鍥炴敹璧勬簮
                             error: function (err) {
                                 playSound();
                                 layer.msg('閿欒' + err, {
@@ -1434,11 +1494,11 @@
                                     $("#HStockPlaceName").val("");
                                     $("#HStockPlaceID").val("0");
                                     if (result.data.hSPFlagField == 0) {
-                                        $("#HStockPlaceName").attr("readonly", "readonly");
+                                        $("#HStockPlaceName").attr("disabled", "disabled");
                                         $('#HSpID-BT').addClass("layui-btn-disabled").attr("disabled", true);//鎸夐挳绂佺敤
                                     }
                                     else {
-                                        $("#HStockPlaceName").removeAttr("readonly");
+                                        $("#HStockPlaceName").removeAttr("disabled");
                                         $('#HSpID-BT').removeClass("layui-btn-disabled").attr("disabled", false);//鎸夐挳鎭㈠姝e父鐘舵��
                                     }
                                     element.tabChange('tab-Kf_OtherInBill_PDA', '2');  //璺宠浆椤电
@@ -1474,7 +1534,7 @@
                                         optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '鍏ュ簱鐢宠鍗�' + "</option>";
                                         $("#HMainSourceBillType").append(optionHtml);
                                         layui.form.render('select');
-                                        $("#HMainSourceBillType").attr("readonly", "readonly");
+                                        $("#HMainSourceBillType").attr("disabled", "disabled");
                                     }
                                     else {
                                         $("#HMainSourceBillType").empty();
@@ -1482,12 +1542,18 @@
                                         optionHtml += "<option value = '-1' >" + '鎵嬪伐褰曞叆' + "</option>";
                                         $("#HMainSourceBillType").append(optionHtml);
                                         layui.form.render('select');
-                                        $("#HMainSourceBillType").attr("readonly", "readonly");
+                                        $("#HMainSourceBillType").attr("disabled", "disabled");
                                     }
                                     if (result.data.hMulSourceFlagField == 0) {
-                                        $("#HSourceBillNo").attr("readonly", "readonly");
+                                        $("#HSourceBillNo").attr("disabled", "disabled");
                                         $('#HSourceBillNo-BT').addClass("layui-btn-disabled").attr("disabled", true);//鎸夐挳绂佺敤
                                     }
+                                    $("#HBillSubType").val("QTRKD01_SYS");   //鏍囧噯鍏朵粬鍏ュ簱鍗�
+                                    $("#HBillSubType").attr("disabled", "disabled");
+                                    form.render('select');
+                                    //渚涘簲鍟嗕笉鍙紪杈�
+                                    $("#HSupName").attr("disabled", "disabled");
+                                    $('#HSupID-BT').addClass("layui-btn-disabled").attr("disabled", true);//鎸夐挳绂佺敤
                                     element.tabChange('tab-Kf_OtherInBill_PDA', '3');
                                 }
                                 //鐗╂枡鏉$爜
@@ -1510,8 +1576,10 @@
                                             var optionHtml = '';
                                             optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '鍏ュ簱鐢宠鍗�' + "</option>";
                                             $("#HMainSourceBillType").append(optionHtml);
+                                            $("#HMainSourceBillType").attr("disabled", "disabled");
+                                            $("#HBillSubType").val("QTRKD01_SYS");   //鏍囧噯鍏朵粬鍏ュ簱鍗�
+                                            $("#HBillSubType").attr("disabled", "disabled");
                                             layui.form.render('select');
-                                            $("#HMainSourceBillType").attr("readonly", "readonly");
                                         }
                                         else {
                                             $("#HMainSourceBillType").empty();
@@ -1519,12 +1587,15 @@
                                             optionHtml += "<option value = '-1' >" + '鎵嬪伐褰曞叆' + "</option>";
                                             $("#HMainSourceBillType").append(optionHtml);
                                             layui.form.render('select');
-                                            $("#HMainSourceBillType").attr("readonly", "readonly");
+                                            $("#HMainSourceBillType").attr("disabled", "disabled");
                                         }
                                         if (result.data.hMulSourceFlagField == 0) {
-                                            $("#HSourceBillNo").attr("readonly", "readonly");
+                                            $("#HSourceBillNo").attr("disabled", "disabled");
                                             $('#HSourceBillNo-BT').addClass("layui-btn-disabled").attr("disabled", true);//鎸夐挳绂佺敤
                                         }
+                                        //渚涘簲鍟嗕笉鍙紪杈�
+                                        $("#HSupName").attr("disabled", "disabled");
+                                        $('#HSupID-BT').addClass("layui-btn-disabled").attr("disabled", true);//鎸夐挳绂佺敤
                                         element.tabChange('tab-Kf_OtherInBill_PDA', '3');
                                     }
                                 }
@@ -1543,6 +1614,7 @@
                                 });
                             }
                         },
+                        complete: function (XHR, TS) { XHR = null },//鍥炴敹璧勬簮
                         error: function (err) {
                             playSound();
                             layer.msg("閿欒锛�" + err, {
@@ -1584,7 +1656,7 @@
                             }
 
                             //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
-                            col.push({ type: 'radio', fixed: 'left', totalRowText: '鍚堣' });
+                            col.push({ type: 'radio', totalRowText: '鍚堣' });
                             for (var i = 0; i < data.length; i++) {
                                 if ($.inArray(data[i].name, titleData) > -1) {
                                     col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //闅愯棌id鍒�
@@ -1609,18 +1681,31 @@
                             listOption.cols = [columns];
                             listOption.data = result.data.Materlist;
                             listOption.totalRow = true;
+                            table.cache['wl-table'] = null;         //娓呯┖琛ㄦ牸缂撳瓨鏁版嵁
                             table.render(listOption);
 
                             //鏉$爜淇℃伅
                             $("#HBarCode_B").val(result.data.BarCodeDetailslist[0].HBarCode);
-                            $("#HMaterName_B").val(result.data.BarCodeDetailslist[0].HMaterName);
-                            $("#HMaterModel_B").val(result.data.BarCodeDetailslist[0].HMaterModel);
-                            $("#HBatchNo_B").val(result.data.BarCodeDetailslist[0].HBatchNo);
-                            $("#HUnitName_B").val(result.data.BarCodeDetailslist[0].HUnitName);
-                            $("#HQty_B").val(result.data.BarCodeDetailslist[0].HQty);
-                            $("#HTMQty_B").val(result.data.BarCodeDetailslist[0].HTMQty);
-                            $("#HWHName_B").val(result.data.BarCodeDetailslist[0].HWHName);
-                            $("#HSPName_B").val(result.data.BarCodeDetailslist[0].HSPName);
+                            if ($("#HBarCode_B").val() == '') {
+                                $("#HMaterName_B").val("");
+                                $("#HMaterModel_B").val("");
+                                $("#HBatchNo_B").val("");
+                                $("#HUnitName_B").val("");
+                                $("#HQty_B").val("");
+                                $("#HTMQty_B").val("");
+                                $("#HWHName_B").val("");
+                                $("#HSPName_B").val("");
+                            }
+                            else {
+                                $("#HMaterName_B").val(result.data.BarCodeDetailslist[0].HMaterName);
+                                $("#HMaterModel_B").val(result.data.BarCodeDetailslist[0].HMaterModel);
+                                $("#HBatchNo_B").val(result.data.BarCodeDetailslist[0].HBatchNo);
+                                $("#HUnitName_B").val(result.data.BarCodeDetailslist[0].HUnitName);
+                                $("#HQty_B").val(result.data.BarCodeDetailslist[0].HQty);
+                                $("#HTMQty_B").val(result.data.BarCodeDetailslist[0].HTMQty);
+                                $("#HWHName_B").val(result.data.BarCodeDetailslist[0].HWHName);
+                                $("#HSPName_B").val(result.data.BarCodeDetailslist[0].HSPName);
+                            }
                         }
                         else {
                             listOption.cols = [[
@@ -1647,7 +1732,8 @@
                             $("#HWHName_B").val("");
                             $("#HSPName_B").val("");
                         }
-                    }
+                    },
+                    complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
                 });
             }
 
@@ -1669,11 +1755,11 @@
                 $("#HStockPlaceName").val("");
                 $("#HStockPlaceID").val("0");
                 if (obj[0].HSPFlag == 0) {
-                    $("#HStockPlaceName").attr("readonly", "readonly");
+                    $("#HStockPlaceName").attr("disabled", "disabled");
                     $('#HSpID-BT').addClass("layui-btn-disabled").attr("disabled", true);//鎸夐挳绂佺敤
                 }
                 else {
-                    $("#HStockPlaceName").removeAttr("readonly");
+                    $("#HStockPlaceName").removeAttr("disabled");
                     $('#HSpID-BT').removeClass("layui-btn-disabled").attr("disabled", false);//鎸夐挳鎭㈠姝e父鐘舵��
                 }
             }
@@ -1726,14 +1812,15 @@
                 layer.msg("鍗曟嵁鍙疯幏鍙栧け璐ワ紝閿欒鐨勫崟鎹彿锛�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                 return false;
             }
-            if (typeof (sSubStr) == "undefined") {
+            if (sSubStr.length == 0) {
                 layer.msg("娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忔潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                 return false;
             }
             //鍒ゆ柇鏄惁宸叉壂鎻忕墿鏂欐潯鐮�
-            if (!typeof (sSubStr) == "undefined") {
-                for (var i = 0; i <= sSubStr.length - 1; i++) { 
-                    if (parseFloat(sSubStr[i].HQty) > 0) {
+            else {
+                var s = 0;
+                for (var i = 0; i <= sSubStr.length - 1; i++) {
+                    if (sSubStr[i].鏁伴噺 > 0) {
                         s = 1;
                     }
                 }
@@ -1742,9 +1829,7 @@
                     return false;
                 }
             }
-            else {
-                return true;
-            }
+            return true;
         }
     </script>
 

--
Gitblit v1.9.1