From 8a36bbee40f5e1069b15a98b1e64ac9719ee8a46 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期二, 23 四月 2024 17:17:13 +0800
Subject: [PATCH] 1.销售出库单 增加 反写源单 销售订单和发货通知单   超出 关联数量  关闭源单 2.应收单 增加  反写源单 销售出库单 和 销售订单  超出关联数量  关闭源单 3.动态获取源单增加参数 Num 0蓝单   1红单  2全部 4.销售流程的测试并完善功能; 销售订单-》发货通知单-》销售出库单-》应收单 (注意: 源单类型的下拉框 需要 根据数据库 表动态加载, 关联数量 要准确 , 审核 且 未关闭 未行关闭的行 才能下推 ,关联数量超额后,要 反写 关闭 源单 )

---
 WebTM/views/WMS扫码模块/其他入库/Kf_OtherInBill_PDA.html |  182 ++++++++++++++++++++++++++++++---------------
 1 files changed, 122 insertions(+), 60 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 9227286..252df04 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,7 +392,7 @@
             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";
@@ -428,7 +428,8 @@
                                 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");
             }
@@ -439,12 +440,22 @@
                 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 鍒濆鍖栫晫闈�
@@ -462,7 +473,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"]);
@@ -471,13 +482,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父鐘舵��
                 }
 
@@ -532,7 +543,8 @@
                             form.render('select');
                         }
                         layer.closeAll("loading");
-                    }
+                    },
+                    complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
                 })
             }
             //鍒濆鍖栬〃鏍�
@@ -544,6 +556,9 @@
                     , height: 'full-60'
                     , cellMinWidth: 90
                     , limit: 50
+                    , done: function () {
+                        layer.closeAll("loading");
+                    }
                 };
             }
 
@@ -579,7 +594,6 @@
                 element.tabChange('tab-Kf_OtherInBill_PDA', '2');
             }
             else {
-                OperationType = 1;
                 //鑾峰彇鏈�澶у崟鎹甀D銆佸崟鎹彿
                 $.ajax({
                     type: "GET",
@@ -596,7 +610,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;
             }
@@ -613,15 +628,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();
@@ -629,21 +648,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 }//鍥炴敹璧勬簮
                 })
             }
 
@@ -662,7 +684,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: ['纭']
@@ -686,11 +708,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');
@@ -704,7 +726,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: ['纭']
@@ -714,7 +736,8 @@
                                 });
                             }
                             layer.closeAll("loading");
-                        }
+                        },
+                        complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
                     });
                 }
             });
@@ -794,7 +817,8 @@
                                 });
                             }
                             layer.closeAll("loading");
-                        }
+                        },
+                        complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
                     });
                 }
             });
@@ -867,7 +891,8 @@
                                 });
                             }
                             layer.closeAll("loading");
-                        }
+                        },
+                        complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
                     });
                 }
             });
@@ -936,7 +961,8 @@
                                 });
                             }
                             layer.closeAll("loading");
-                        }
+                        },
+                        complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
                     });
                 }
             });
@@ -1005,7 +1031,8 @@
                                 });
                             }
                             layer.closeAll("loading");
-                        }
+                        },
+                        complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
                     });
                 }
             });
@@ -1074,7 +1101,8 @@
                                 });
                             }
                             layer.closeAll("loading");
-                        }
+                        },
+                        complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
                     });
                 }
             });
@@ -1164,6 +1192,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: "娓╅Θ鎻愮ず" });
                             }
@@ -1240,6 +1269,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: "娓╅Θ鎻愮ず" });
                                 }
@@ -1311,11 +1341,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();
@@ -1332,7 +1367,8 @@
                                 $("#HSourceBillNo").focus();
                             });
                         }
-                    }
+                    },
+                    complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
                 });
                 layer.closeAll("loading");
             }
@@ -1416,6 +1452,7 @@
                                     });
                                 }
                             },
+                            complete: function (XHR, TS) { XHR = null },//鍥炴敹璧勬簮
                             error: function (err) {
                                 playSound();
                                 layer.msg('閿欒' + err, {
@@ -1461,11 +1498,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');  //璺宠浆椤电
@@ -1501,7 +1538,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();
@@ -1509,12 +1546,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');
                                 }
                                 //鐗╂枡鏉$爜
@@ -1537,8 +1580,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();
@@ -1546,12 +1591,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');
                                     }
                                 }
@@ -1570,6 +1618,7 @@
                                 });
                             }
                         },
+                        complete: function (XHR, TS) { XHR = null },//鍥炴敹璧勬簮
                         error: function (err) {
                             playSound();
                             layer.msg("閿欒锛�" + err, {
@@ -1640,14 +1689,26 @@
 
                             //鏉$爜淇℃伅
                             $("#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 = [[
@@ -1674,7 +1735,8 @@
                             $("#HWHName_B").val("");
                             $("#HSPName_B").val("");
                         }
-                    }
+                    },
+                    complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
                 });
             }
 
@@ -1696,11 +1758,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父鐘舵��
                 }
             }

--
Gitblit v1.9.1