From 7aca0ba298995c44c0cf3c2102c244f458ccf864 Mon Sep 17 00:00:00 2001
From: yxj <1qaz@123>
Date: 星期四, 04 五月 2023 20:41:14 +0800
Subject: [PATCH] 直接调拨模块扫描物料条码、源单条码方法修改

---
 WebTM/views/验收入库/外购入库/Kf_POStockInBill_Fast.html |   16 ++++
 WebTM/views/验收入库/产品入库/Kf_ProductInBill_Fast.html |   16 ++++
 WebTM/views/仓存管理/仓库调拨/Kf_MoveStockBill_Fast.html |  148 ++++++++++++++++++++++++++++++++++++++++++++++--
 3 files changed, 168 insertions(+), 12 deletions(-)

diff --git "a/WebTM/views/\344\273\223\345\255\230\347\256\241\347\220\206/\344\273\223\345\272\223\350\260\203\346\213\250/Kf_MoveStockBill_Fast.html" "b/WebTM/views/\344\273\223\345\255\230\347\256\241\347\220\206/\344\273\223\345\272\223\350\260\203\346\213\250/Kf_MoveStockBill_Fast.html"
index 60b017a..8def539 100644
--- "a/WebTM/views/\344\273\223\345\255\230\347\256\241\347\220\206/\344\273\223\345\272\223\350\260\203\346\213\250/Kf_MoveStockBill_Fast.html"
+++ "b/WebTM/views/\344\273\223\345\255\230\347\256\241\347\220\206/\344\273\223\345\272\223\350\260\203\346\213\250/Kf_MoveStockBill_Fast.html"
@@ -67,8 +67,8 @@
                                             <select name="HBillType" id="HBillType">
                                                 <option value="1402">鍙戣揣閫氱煡鍗�</option>
                                                 <option value="1243">璋冩嫧鐢宠鍗�</option>
-                                                <!--<option value="3720">鐢熶骇鐢ㄦ枡娓呭崟</option>-->
-                                                <!--<option value="1604">濮斿鐢ㄦ枡娓呭崟</option>-->
+                                                <option value="3720">鐢熶骇鐢ㄦ枡娓呭崟</option>
+                                                <option value="1604">濮斿鐢ㄦ枡娓呭崟</option>
                                                 <option value="1242">鍑哄簱鐢宠鍗�</option>
                                                 <option value="1214">鐢熶骇鍙戞枡閫氱煡鍗�</option>
                                                 <option value="-1" selected>鎵嬪伐褰曞叆</option>
@@ -1146,6 +1146,14 @@
                                 $("#HDeptID").val(result.data.hDeptIDField);
                                 $("#HDeptName").val(result.data.hDeptNameField);
                             }
+                            if (result.data.hWhIDField != 0) {
+                                $("#HWHID").val(result.data.hWhIDField);
+                                $("#HWHNAME").val(result.data.hWhNameField);
+                            }
+                            if (result.data.hSCWhIDField != 0) {
+                                $("#HSCWHID").val(result.data.hSCWhIDField);
+                                $("#HSCWHNAME").val(result.data.hSCWhNameField);
+                            }
 
                             $("#HStockStyle").find("option:contains('" + result.data.hStockStyleField +"')").attr("selected", true);
                             $("#HStockInOrgID").val(result.data.hStockInOrgIDField);
@@ -1340,19 +1348,143 @@
                         data: { "sBarCode": sBarCode, "HInterID": sInterID, "HBillType": HBillType, "HBillNo": sBillNo, "HMaker": sMaker, "HWhID": WhID, "HSPID": SPID, "HSCWHID": HSCWhID, "HSCSPID": HSCSPID, "HQty": sQty, "SourceFlag": HSourceFlag, "HSourceBillNo": sSourceBillNo, "HSourceBillType": sHBillType, "HStockInOrgID": HStockInOrgID, "HStockOutOrgID": HStockOutOrgID, "HScanStyle": HScanStyle },
                         success: function (result) {
                             if (result.count == 1) {
-                                if (HSourceFlag == "false") {
-                                    $("#HBillType").find("option:contains('鎵嬪伐褰曞叆')").attr("selected", true);
-                                    $("#HSourceBillNo").val("");
+                                if (result.data.hBarTypeField == '浠撳簱鏉$爜') {
+                                    $("#HSCWHNAME").val(result.data.hWhNameField);
+                                    $("#HSCWHID").val(result.data.hWhIDField);
+                                    $("#HOutStockPlaceName").val("");
+                                    $("#HNote").val(";涓�閿壂鐮佷粨搴撴潯鐮�");
+                                    element.tabChange('tab-MoveStockBill', '2');  //璺宠浆椤电
+                                    return;
+                                }
+                                else if (result.data.hBarTypeField == '浠撲綅鏉$爜') {
+                                    $("#HOutStockPlaceName").val(result.data.hSPNameField);
+                                    $("#HOutStockPlaceID").val(result.data.hSPIDField);
+                                    $("#HSCWHNAME").val(result.data.hWhNameField);
+                                    $("#HSCWHID").val(result.data.hWhIDField);
+                                    $("#HNote").val(";涓�閿壂鐮佷粨浣嶆潯鐮�");
+                                    element.tabChange('tab-MoveStockBill', '2');//璺宠浆椤电
+                                    return;
+                                }
+                                else if (result.data.hBarTypeField == '閮ㄩ棬鏉$爜') {
+                                    $("#HDeptName").val(result.data.hDeptNameField);
+                                    $("#HDeptID").val(result.data.hDeptIDField);
+                                    $("#HNote").val(";涓�閿壂鐮侀儴闂ㄦ潯鐮�");
+                                    element.tabChange('tab-MoveStockBill', '2');//璺宠浆椤电
+                                    return;
+                                }
+                                else if (result.data.hBarTypeField == '婧愬崟鏉$爜') {
+                                    if (result.data.hDeptIDField != 0) {
+                                        $("#HDeptID").val(result.data.hDeptIDField);
+                                        $("#HDeptName").val(result.data.hDeptNameField);
+                                    }
+                                    if (result.data.hWhIDField != 0) {
+                                        $("#HWHID").val(result.data.hWhIDField);
+                                        $("#HWHNAME").val(result.data.hWhNameField);
+                                    }
+                                    if (result.data.hSCWhIDField != 0) {
+                                        $("#HSCWHID").val(result.data.hSCWhIDField);
+                                        $("#HSCWHNAME").val(result.data.hSCWhNameField);
+                                    }
+
+                                    $("#HStockStyle").find("option:contains('" + result.data.hStockStyleField + "')").attr("selected", true);
+                                    $("#HStockInOrgID").val(result.data.hStockInOrgIDField);
+                                    $("#HStockInOrgName").val(result.data.hStockInOrgNameField);
+                                    $("#HStockOutOrgID").val(result.data.hStockOutOrgIDField);
+                                    $("#HStockOutOrgName").val(result.data.hStockOutOrgNameField);
+                                    $("#HSourceBillNo").val(result.data.hSourceBillNoField);
+                                    HSourceFlag = true;
+                                    //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+                                    $("#HBillType").val(result.data.hSourceBillTypeField == null ? "1402" : result.data.hSourceBillTypeField);
+                                    if (result.data.hSourceBillTypeField == "1402") {
+                                        $("#HBillType").empty();
+                                        $("#HBillType").val("1402");
+                                        var optionHtml = '';
+                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '鍙戣揣閫氱煡鍗�' + "</option>";
+                                        $("#HBillType").append(optionHtml);
+                                        layui.form.render('select');
+                                        $("#HBillType").attr("readonly", "readonly");
+                                    }
+                                    else if (result.data.hSourceBillTypeField == "1243") {
+                                        $("#HBillType").empty();
+                                        $("#HBillType").val("1243");
+                                        var optionHtml = '';
+                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '璋冩嫧鐢宠鍗�' + "</option>";
+                                        $("#HBillType").append(optionHtml);
+                                        layui.form.render('select');
+                                        $("#HBillType").attr("readonly", "readonly");
+                                    }
+                                    else if (result.data.hSourceBillTypeField == "3720") {
+                                        $("#HBillType").empty();
+                                        $("#HBillType").val("3720");
+                                        var optionHtml = '';
+                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '鐢熶骇鐢ㄦ枡娓呭崟' + "</option>";
+                                        $("#HBillType").append(optionHtml);
+                                        layui.form.render('select');
+                                        $("#HBillType").attr("readonly", "readonly");
+                                    }
+                                    else if (result.data.hSourceBillTypeField == "1604") {
+                                        $("#HBillType").empty();
+                                        $("#HBillType").val("1604");
+                                        var optionHtml = '';
+                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '濮斿鐢ㄦ枡娓呭崟' + "</option>";
+                                        $("#HBillType").append(optionHtml);
+                                        layui.form.render('select');
+                                        $("#HBillType").attr("readonly", "readonly");
+                                    }
+                                    else if (result.data.hSourceBillTypeField == "1242") {
+                                        $("#HBillType").empty();
+                                        $("#HBillType").val("1242");
+                                        var optionHtml = '';
+                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '鍑哄簱鐢宠鍗�' + "</option>";
+                                        $("#HBillType").append(optionHtml);
+                                        layui.form.render('select');
+                                        $("#HBillType").attr("readonly", "readonly");
+                                    }
+                                    else if (result.data.hSourceBillTypeField == "1214") {
+                                        $("#HBillType").empty();
+                                        $("#HBillType").val("1214");
+                                        var optionHtml = '';
+                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '鐢熶骇鍙戞枡閫氱煡鍗�' + "</option>";
+                                        $("#HBillType").append(optionHtml);
+                                        layui.form.render('select');
+                                        $("#HBillType").attr("readonly", "readonly");
+                                    }
+                                    else {
+                                        //$("#HBillType").empty();
+                                        $("#HBillType").val("-1");
+                                        var optionHtml = '';
+                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '鎵嬪伐褰曞叆' + "</option>";
+                                        $("#HBillType").append(optionHtml);
+                                        layui.form.render('select');
+                                        $("#HBillType").attr("readonly", "readonly");
+                                    }
 
                                     $("#HStockStyle").attr("disabled", "disabled");
                                     $("#HStockInOrgName").attr("readonly", "readonly");
                                     $("#HStockOutOrgName").attr("readonly", "readonly");
                                     $("#HBillType").attr("disabled", "disabled");
-                                    $("#HSourceBillNo").attr("readonly", "readonly");
                                     form.render('select');
+                                    if (result.data.hMulSourceFlagField == 0) {
+                                        $("#HSourceBillNo").attr("readonly", "readonly");
+                                    }
+                                    $("#HNote").val(";涓�閿壂鐮佹簮鍗曟潯鐮�");
+                                    element.tabChange('tab-MoveStockBill', '3');
                                 }
-                                HSourceFlag = true;
-                                element.tabChange('tab-MoveStockBill', '3');
+                                else {
+                                    if (HSourceFlag == "false") {
+                                        $("#HBillType").find("option:contains('鎵嬪伐褰曞叆')").attr("selected", true);
+                                        $("#HSourceBillNo").val("");
+
+                                        $("#HStockStyle").attr("disabled", "disabled");
+                                        $("#HStockInOrgName").attr("readonly", "readonly");
+                                        $("#HStockOutOrgName").attr("readonly", "readonly");
+                                        $("#HBillType").attr("disabled", "disabled");
+                                        $("#HSourceBillNo").attr("readonly", "readonly");
+                                        form.render('select');
+                                    }
+                                    HSourceFlag = true;
+                                    element.tabChange('tab-MoveStockBill', '3');
+                                }
 
                                 layer.load(3)
                                 $.ajax({
diff --git "a/WebTM/views/\351\252\214\346\224\266\345\205\245\345\272\223/\344\272\247\345\223\201\345\205\245\345\272\223/Kf_ProductInBill_Fast.html" "b/WebTM/views/\351\252\214\346\224\266\345\205\245\345\272\223/\344\272\247\345\223\201\345\205\245\345\272\223/Kf_ProductInBill_Fast.html"
index 3fc9623..42865be 100644
--- "a/WebTM/views/\351\252\214\346\224\266\345\205\245\345\272\223/\344\272\247\345\223\201\345\205\245\345\272\223/Kf_ProductInBill_Fast.html"
+++ "b/WebTM/views/\351\252\214\346\224\266\345\205\245\345\272\223/\344\272\247\345\223\201\345\205\245\345\272\223/Kf_ProductInBill_Fast.html"
@@ -1368,7 +1368,13 @@
                                         $("#HBillType").attr("readonly", "readonly");
                                     }
                                     else {
-                                        //$("#HBillType").val("-1");
+                                        //$("#HBillType").empty();
+                                        $("#HBillType").val("-1");
+                                        var optionHtml = '';
+                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '鎵嬪伐褰曞叆' + "</option>";
+                                        $("#HBillType").append(optionHtml);
+                                        layui.form.render('select');
+                                        $("#HBillType").attr("readonly", "readonly");
                                     }
                                     $("#HSourceBillNo").attr("readonly", "readonly");
                                     $("#HNote").val(";涓�閿壂鐮佹簮鍗曟潯鐮�");
@@ -1420,7 +1426,13 @@
                                             $("#HBillType").attr("readonly", "readonly");
                                         }
                                         else {
-                                            //$("#HBillType").val("-1");
+                                            //$("#HBillType").empty();
+                                            $("#HBillType").val("-1");
+                                            var optionHtml = '';
+                                            optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '鎵嬪伐褰曞叆' + "</option>";
+                                            $("#HBillType").append(optionHtml);
+                                            layui.form.render('select');
+                                            $("#HBillType").attr("readonly", "readonly");
                                         }
                                         $("#HSourceBillNo").attr("readonly", "readonly");
                                         $("#HNote").val(";鐗╂枡鏉$爜");
diff --git "a/WebTM/views/\351\252\214\346\224\266\345\205\245\345\272\223/\345\244\226\350\264\255\345\205\245\345\272\223/Kf_POStockInBill_Fast.html" "b/WebTM/views/\351\252\214\346\224\266\345\205\245\345\272\223/\345\244\226\350\264\255\345\205\245\345\272\223/Kf_POStockInBill_Fast.html"
index b7ef7f3..94b6acc 100644
--- "a/WebTM/views/\351\252\214\346\224\266\345\205\245\345\272\223/\345\244\226\350\264\255\345\205\245\345\272\223/Kf_POStockInBill_Fast.html"
+++ "b/WebTM/views/\351\252\214\346\224\266\345\205\245\345\272\223/\345\244\226\350\264\255\345\205\245\345\272\223/Kf_POStockInBill_Fast.html"
@@ -1090,7 +1090,13 @@
                                         $("#HBillType").attr("readonly", "readonly");
                                     }
                                     else {
-                                        //$("#HBillType").val("-1");
+                                        //$("#HBillType").empty();
+                                        $("#HBillType").val("-1");
+                                        var optionHtml = '';
+                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '鎵嬪伐褰曞叆' + "</option>";
+                                        $("#HBillType").append(optionHtml);
+                                        layui.form.render('select');
+                                        $("#HBillType").attr("readonly", "readonly");
                                     }
                                     $("#HSourceBillNo").attr("readonly", "readonly");
                                     $("#HNote").val(";涓�閿壂鐮佹簮鍗曟潯鐮�");
@@ -1129,7 +1135,13 @@
                                             $("#HBillType").attr("readonly", "readonly");
                                         }
                                         else {
-                                            //$("#HBillType").val("-1");
+                                            //$("#HBillType").empty();
+                                            $("#HBillType").val("-1");
+                                            var optionHtml = '';
+                                            optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '鎵嬪伐褰曞叆' + "</option>";
+                                            $("#HBillType").append(optionHtml);
+                                            layui.form.render('select');
+                                            $("#HBillType").attr("readonly", "readonly");
                                         }
                                         $("#HSourceBillNo").attr("readonly", "readonly");
                                         $("#HNote").val(";鐗╂枡鏉$爜");

--
Gitblit v1.9.1