From 55dfc2d5eeb31b8420c4fe502d926cad9d353e70 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期三, 28 九月 2022 17:01:37 +0800
Subject: [PATCH] 车间工序全程跟踪报表 、工序在制品报表纵向、不良明细良率报表、车间生产汇报统计表

---
 WebTM/views/验收入库/外购入库/Kf_POStockInBill_Fast.html |  653 +++++++++++++++++++++++++++++++++--------------------------
 1 files changed, 366 insertions(+), 287 deletions(-)

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 0a35707..1b7098d 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"
@@ -13,6 +13,9 @@
             height: auto;
             white-space: normal;
         }
+        .layui-col-xs8 {
+            width: 55.666667%;
+        }
     </style>
 </head>
 <body>
@@ -38,8 +41,11 @@
                             <div class="layui-col-xs3">
                                 <label class="layui-form-label" style="width:40px;padding-left:0px;">鏉$爜</label>
                             </div>
-                            <div class="layui-col-xs8">
+                            <div class="layui-col-xs5">
                                 <input type="text" name="HBarCode" id="HBarCode" lay-verify="HBarCode" autocomplete="off" class="layui-input">
+                            </div>
+                            <div class="layui-col-xs2">
+                                <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin">纭畾</button>
                             </div>
                         </div>
                     </div>
@@ -73,6 +79,9 @@
                                         <div class="layui-col-xs8">
                                             <input type="text" name="HSourceBillNo" id="HSourceBillNo" lay-verify="HSourceBillNo" autocomplete="off" class="layui-input">
                                         </div>
+                                        <div class="layui-col-xs2">
+                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin2">纭畾</button>
+                                        </div>
                                     </div>
                                 </div>
                             </div>
@@ -102,7 +111,7 @@
                                             <input type="hidden" name="HStockPlaceID" id="HStockPlaceID" lay-verify="HStockPlaceID" value="0" autocomplete="off" class="layui-input">
                                         </div>
                                         <div class="layui-col-xs3">
-                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HSpID-BT" style="display:none">...</button>
+                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HSpID-BT" >...</button>
                                         </div>
                                     </div>
                                 </div>
@@ -157,6 +166,7 @@
                                             <input type="text" name="HBillerID" id="HBillerID" lay-verify="HBillerID" autocomplete="off" class="layui-input">
                                             <input type="text" name="HMaker" id="HMaker" lay-verify="HMaker" autocomplete="off" class="layui-input">
                                             <input type="hidden" name="HMakerID" id="HMakerID" lay-verify="HMakerID" value="0" autocomplete="off" class="layui-input" style="display : none">
+                                            <input type="hidden" name="HSTOCKORGID" id="HSTOCKORGID" lay-verify="HSTOCKORGID" value="0" autocomplete="off" class="layui-input" style="display : none">
                                         </div>
                                     </div>
                                 </div>
@@ -216,6 +226,14 @@
                                         </div>
                                         <div class="layui-col-xs8">
                                             <input type="text" name="HBarCode_B" id="HBarCode_B" lay-verify="HBarCode_B" autocomplete="off" class="layui-input">
+                                        </div>
+                                    </div>
+                                    <div class="layui-row">
+                                        <div class="layui-col-xs3">
+                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">鏁伴噺</label>
+                                        </div>
+                                        <div class="layui-col-xs8">
+                                            <input type="text" name="HQty" id="HQty" lay-verify="HQty" autocomplete="off" class="layui-input">
                                         </div>
                                     </div>
                                 </div>
@@ -307,7 +325,7 @@
                                         <label class="layui-form-label" style="width:60px;padding-left:0px;">鏉$爜鏁伴噺</label>
                                     </div>
                                     <div class="layui-col-xs8 layui-input-inline mobile">
-                                        <input type="text" name="HBarcodeQtys" id="HBarcodeQtys" lay-verify="HBarcodeQtys" value="0" autocomplete="off" class="layui-input">
+                                        <input type="text" name="HBarcodeQtys" id="HBarcodeQtys" lay-verify="HBarcodeQtys" autocomplete="off" class="layui-input">
                                     </div>
                                 </div>
                                 <div class="layui-row">
@@ -387,6 +405,9 @@
             $("#HMakerID").hide();
             $("#HBillerID").val(sessionStorage["HBillerID"]);
             $("#HBillerID").hide();
+            $("#HSTOCKORGID").val(sessionStorage["OrganizationID"]);
+            $("#HSTOCKORGID").hide();
+            var HSourceFlag = sessionStorage["SourceFlag"];
             //榛樿甯﹀叆鐨勪粨搴擄紝濡傛灉鍚敤浠撲綅鍒欎粨浣嶆湁鏁堬紝濡傛灉娌℃湁鍚敤鍒欎粨浣嶇伆搴� new
 
 
@@ -496,7 +517,7 @@
                 $("#HInterID").val("");
                 $("#HBillNo").val("");
                 $.ajax({
-                    url: GetWEBURL() + "/Web/GetMAXNum",
+                    url: GetWEBURL() + "/Web/GetMAXNumPDA",
                     //url: GetWEBURL() + "/Web/UpdatePOInStockBillPrintQty", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
                     type: "GET",
                     data: { "HBillType": '1201' },
@@ -644,9 +665,7 @@
 
             //閫�鍑�
             form.on('submit(Cancel)', function () {
-                sessionStorage["SourceFlag"] = false;
                 parent.location.href = "../../../views/index.html"
-                //window.close();//鍏抽棴褰撳墠椤�
             })
             //缂栬緫
             form.on('submit(cmdModify)', function () {
@@ -680,41 +699,42 @@
                 var sMTONo = ''
                 var sSourceInterID = data[0].HSourceInterID
                 var sSourceEntryID = data[0].HSourceEntryID
+                var sMouldManagerCtl = 'N'
+                var sFIFOCtl = 'N'
                 $.ajax(
                     {
                         type: "Get",
-                        //url: "http://61.130.49.162:9090/WMSAPI///POStockInBill/Delete_Json", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                        url: GetWEBURL() + "/POStockInBill/Delete_Json",
+                        //url: "http://61.130.49.162:9090/WMSAPI///ProductIn/Delete_Json", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                        url: GetWEBURL() + "/ProductIn/Delete_Json_AN",
                         async: true,
-                        data: { "HInterID": sInterID, "HMaterID": sMaterID, "HAuxPropID": sAuxPropID, "HMTONo": sMTONo, "HSourceInterID": sSourceInterID, "HSourceEntryID": sSourceEntryID, "sHBillType": '1103', },
+                        data: { "HInterID": sInterID, "HMaterID": sMaterID, "HAuxPropID": sAuxPropID, "HMTONo": sMTONo, "HSourceInterID": sSourceInterID, "HSourceEntryID": sSourceEntryID, "sHBillType": sBillType, },
                         dataType: "json",
                         success: function (data) {
-                            if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
-                                //layer.msg(data.Message, { icon: 1 });
-                                table.render({
-                                    elem: '#wl-table'
-                                    //, url: 'http://61.130.49.162:9090/WMSAPI///POStockInBill/DisBillEntryList_Mate_Webs_Json'
-                                    //, url: GetWEBURL() + '/POStockInBill/DisBillEntryList_Mate_Webs_Json'
-                                    , url: GetWEBURL() + '/POStockInBill/DisBillEntryList_Webs_Json'
-                                    , cellMinWidth: 80
-                                    , toolbar: '#toolbarDemo'
-                                    , where: { HBillID: sInterID, HBillType: '1201', sWhere: '' }
-                                    , cols: [[
-                                        { type: 'radio' }
-                                        , { field: 'HQty', title: '鏁伴噺', width: 100 }
-                                        , { field: 'HQtyMust', title: '搴旀敹鏁伴噺', width: 100 }
-                                        , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', width: 200 }
-                                        , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 200 }
-                                        , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', width: 200 }
-                                        , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 200 }
-                                        , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 200 }
-                                        , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 200 }
-                                        , { field: 'HBatchNo', title: '鎵规', width: 200 }
-                                        , { field: 'HAuxPropID', title: '杈呭姪灞炴��', width: 200 }
-                                        , { field: 'HMTONo', title: '璁″垝璺熻釜鍙�', width: 200 }
-                                    ]]
-                                    , height: 500
-                                })
+                            if (data.count == 1) {
+                                $.ajax({
+                                    url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_New_Json1',
+                                    type: "GET",
+                                    data: { HBillID: sInterID, HBillNo: sBillNo, HBillType: '1201', sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl },
+                                    success: function (result) {
+                                        if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                                            listOption.data = result.data.list;
+                                            table.render(listOption);
+                                            var count = 0;
+                                            var count1 = 0;
+                                            for (var i = 0; i < result.data.list.length; i++) {
+                                                count += result.data.list[i].HQty;
+                                                count1 += result.data.list[i].HPieceQty;
+                                            }
+                                            $("#HSumQtys").val(count);
+                                            $("#HBarCodeQtys").val(count1);
+                                            //return;
+                                        }
+                                        else {
+                                            layer.msg(result.Message);
+                                        }
+                                        layer.closeAll("loading");
+                                    }
+                                });
                             }
                             else {
                                 layer.msg(data.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
@@ -794,8 +814,121 @@
                 }
             });
 
+            
+            //鏉″舰鐮佸洖杞︽柟娉�
+            $('#HBarCode').on('keydown', function (event) {
+                var sQty = $("#HQty").val();
+                if (sQty == "") {
+                    sQty = 0;
+                }
+                if (event.keyCode == 13) {
+                    GetMeesageByBarCode();
+                }
+            });
+            //纭畾
+            form.on('submit(QueDin)', function (data) {
+                GetMeesageByBarCode();
+            });
+
+
+            //鎵簮鍗�
+            $('#HSourceBillNo').on('keydown', function (event) {      
+                if (event.keyCode == 13) {
+                    GetMeesageBySourceBillNo();
+                }
+            });
+            //纭畾
+            form.on('submit(QueDin2)', function (data) {
+                GetMeesageBySourceBillNo();
+            });
+
+
+
+            //鎵粨浣�
+            $('#HStockPlaceName').on('keydown', function (event) {
+                var HBarCode = $('#HStockPlaceName').val()
+                if (event.keyCode == 13) {
+                    //鍒ゆ柇鏂囨湰妗嗘槸鍚︽湁鏁版嵁    new
+                    $.ajax({
+                        url: GetWEBURL() + "/LookingFor/getSpName_Json",
+                        type: "GET",
+                        data: { "HBarCode": HBarCode },
+                        success: function (result) {
+                            if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                                $("#HStockPlaceName").val(result.data[0].HName);
+                                $("#HStockPlaceID").val(result.data[0].HItemID);
+                                $("#HWHID").val(result.data[0].HWHID);
+                                $("#HWHNAME").val(result.data[0].HWhName);
+                                element.tabChange('tab-POStockInBill', '2');
+                            }
+                            else {
+                                // $("#verifycode").click();
+                                //layer.msg(result.Message, { icon: 5 });
+                                layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                            }
+                            layer.closeAll("loading");
+                        }
+                    });
+                    // layer.msg($('#HSourceBillNo').val(), { icon: 1 });
+                }
+            });
+            //鍒锋柊鏄庣粏椤电
+            table.render({
+                elem: '#mx-table'
+                // , url: 'http://localhost:8083/POStockInBill/GetHBarCodeShowBillSub'
+                //, toolbar: '#toolbarDemo'
+                // , where: { sMsg: linterid, sMsg2: lentryid }
+                , cols: [[
+                    , { field: 'HMaterID', title: '鐗╂枡ID', width: 100, hide: true }
+                ]]
+                , page: true
+                , height: 500
+                , done: function () {
+                }
+            });
+
+            //鎵玀ES浠撲綅
+            $('#HMESSPName').on('keydown', function (event) {      //鎵粨浣�
+                var HBarCode = $('#HMESSPName').val();
+                if (event.keyCode == 13) {
+                    $.ajax({
+                        url: GetWEBURL() + "/LookingFor/getSpName_Json",
+                        type: "GET",
+                        data: { "HBarCode": HBarCode },
+                        success: function (result) {
+                            if (result.count == 1) {
+                                $("#HMESSPID").val(result.data[0].HWHID);
+                                $("#HMESSPName").val(result.data[0].HWhName + "-" + result.data[0].HName);
+                                $("#HExplanation").val(result.data[0].HName + "-" + result.data[0].HWhName);
+                                $.ajax({
+                                    url: GetWEBURL() + "/LookingFor/GetSpNameMES_Json",
+                                    type: "GET",
+                                    data: { "HERPWHID": result.data[0].HWHID },
+                                    success: function (result) {
+                                        if (result.count == 1) {
+                                            $("#HWHID").val(result.data[0].HMESWHID);
+                                            $("#HWHNAME").val(result.data[0].HMESWHNAME);
+                                            $("#HMESSPName").attr("readonly", "readonly");//MES浠撲綅鍙HExplanation
+                                            $("#HMESSPName").css("background-color", "#efefef4d");
+                                        }
+                                        else {
+                                            layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                                        }
+                                        layer.closeAll("loading");
+                                    }
+                                });
+                            }
+                            else {
+                                layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                            }
+                            layer.closeAll("loading");
+                        }
+                    });
+                }
+            });
+
             //鎵潯鐮�
-            $('#HBarCode').on('keydown', function (event) {  //鎵潯鐮�
+            function GetMeesageByBarCode(obj) {  //杩斿洖宸ヤ綔涓績
                 var sSubStr = table.cache['wl-table'];
                 var sBarCode = $('#HBarCode').val()
                 var sInterID = $("#HInterID").val()
@@ -808,184 +941,202 @@
                 var sSourceBillNo = $("#HSourceBillNo").val()
                 var sMouldManagerCtl = "N";  //鏄惁鍚敤鍣ㄥ叿绠$悊
                 var sFIFOCtl = "N";          //鏄惁鍚敤鍏堣繘鍏堝嚭绠$悊
-                // var Flag = sessionStorage["SourceFlag"];
+
                 if (sQty == "") {
                     sQty = 0;
                 }
-                if (event.keyCode == 13) {
-                    //鍒ゆ柇鏉$爜鏄惁涓虹┖  new
-                    if (sBarCode == '') {
+
+                //鍒ゆ柇鏉$爜鏄惁涓虹┖  new
+                if (sBarCode == '') {
+                    playSound();
+                    layer.msg("鏉$爜涓虹┖锛屼笉鑳芥壂鎻忥紒", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                    return false;
+                }
+                if (sBarCode != "") {
+                    $('#HBarCode').val("");
+                }
+                if (sQty != "") {
+                    $('#HQty').val("");
+                }
+                if (sHWHID == "184154") {
+                    if (sHSPID == "0") {
                         playSound();
-                        layer.msg("鏉$爜涓虹┖锛屼笉鑳芥壂鎻忥紒", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                        layer.msg("浠撲綅涓虹┖锛岃閫夋嫨浠撲綅锛�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                         return false;
                     }
-                    if (sBarCode != "") {
-                        $('#HBarCode').val("");
-                    }
-                    if (sQty != "") {
-                        $('#HQty').val("");
-                    }
-                    if (sHWHID == "184154") {
-                        if (sHSPID == "0") {
-                            playSound();
-                            layer.msg("浠撲綅涓虹┖锛岃閫夋嫨浠撲綅锛�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                            return false;
-                        }
-                    }
-                    $.ajax({
-                        url: GetWEBURL() + "/POStockInBill/get_CheckTypeByBarCode_Json",
-                        type: "GET",
-                        data: { "sCode": sBarCode, "sInterID": sInterID, "sBillNo": sBillNo, "sBillType": sBillType, "sMaker": sessionStorage["HUserName"], "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": true, "sSourceBillNo": sSourceBillNo, "sSourceType": '1103', "HOWNERID": sessionStorage["OrganizationID"] },
-                        success: function (result) {
-                            if (result.count == 1) {
-                                playSound1();
-                                if (result.data.HBarType == '浠撳簱鏉$爜') {
-                                    $("#HWHNAME").val(result.data.HWhName);
-                                    $("#HWHID").val(result.data.HWhID);
-                                    $("#HStockPlaceName").val("");
-                                    $("#HNote").val(";涓�閿壂鐮佷粨搴撴潯鐮�");
-                                    element.tabChange('tab-POStockInBill', '2');  //璺宠浆椤电
-                                }
-                                else if (result.data.HBarType == '浠撲綅鏉$爜') {
-                                    $("#HStockPlaceName").val(result.data.HSPName);
-                                    $("#HStockPlaceID").val(result.data.HSPID);
-                                    $("#HWHNAME").val(result.data.HWhName);
-                                    $("#HWHID").val(result.data.HWhID);
-                                    $("#HNote").val(";涓�閿壂鐮佷粨浣嶆潯鐮�");
-                                    element.tabChange('tab-POStockInBill', '2');//璺宠浆椤电
-                                }
-                                else if (result.data.HBarType == '閮ㄩ棬鏉$爜') {
-                                    $("#HDeptName").val(result.data.HDeptName);
-                                    $("#HDeptID").val(result.data.HDeptID);
-                                    $("#HNote").val(";涓�閿壂鐮侀儴闂ㄦ潯鐮�");
-                                    element.tabChange('tab-POStockInBill', '2');//璺宠浆椤电
-                                }
-                                else if (result.data.HBarType == '婧愬崟鏉$爜') {
-                                    $("#HSupName").val(result.data.HSupName);
-                                    $("#HSupID").val(result.data.HSupID);
-                                    $("#HDeptName").val(result.data.HDeptName);
-                                    $("#HDeptID").val(result.data.HDeptID);
-                                    $("#HSourceBillNo").val(result.data.HSourceBillNo);
-                                    sessionStorage["SourceFlag"] = true;
-                                    //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
-                                    if (result.data.HSourceBillType == "1102") {
-                                        $("#HBillType").val("1102");
+                }
+                $.ajax({
+                    url: GetWEBURL() + "/POStockInBill/get_CheckTypeByBarCode_Json",
+                    type: "GET",
+                    async: false,
+                    data: { "sCode": sBarCode, "sInterID": sInterID, "sBillNo": sBillNo, "sBillType": sBillType, "sMaker": sessionStorage["HUserName"], "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": sessionStorage["SourceFlag"], "sSourceBillNo": sSourceBillNo, "sSourceType": sHBillType, "HOWNERID": sessionStorage["OrganizationID"] },
+                    success: function (result) {
+                        if (result.count == 1) {
+                            playSound1();
+                            if (result.data.HBarType == '浠撳簱鏉$爜') {
+                                $("#HWHNAME").val(result.data.HWhName);
+                                $("#HWHID").val(result.data.HWhID);
+                                $("#HStockPlaceName").val("");
+                                $("#HNote").val(";涓�閿壂鐮佷粨搴撴潯鐮�");
+                                element.tabChange('tab-POStockInBill', '2');  //璺宠浆椤电
+                            }
+                            else if (result.data.HBarType == '浠撲綅鏉$爜') {
+                                $("#HStockPlaceName").val(result.data.HSPName);
+                                $("#HStockPlaceID").val(result.data.HSPID);
+                                $("#HWHNAME").val(result.data.HWhName);
+                                $("#HWHID").val(result.data.HWhID);
+                                $("#HNote").val(";涓�閿壂鐮佷粨浣嶆潯鐮�");
+                                element.tabChange('tab-POStockInBill', '2');//璺宠浆椤电
+                            }
+                            else if (result.data.HBarType == '閮ㄩ棬鏉$爜') {
+                                $("#HDeptName").val(result.data.HDeptName);
+                                $("#HDeptID").val(result.data.HDeptID);
+                                $("#HNote").val(";涓�閿壂鐮侀儴闂ㄦ潯鐮�");
+                                element.tabChange('tab-POStockInBill', '2');//璺宠浆椤电
+                            }
+                            else if (result.data.HBarType == '婧愬崟鏉$爜') {
+                                $("#HSupName").val(result.data.HSupName);
+                                $("#HSupID").val(result.data.HSupID);
+                                $("#HDeptName").val(result.data.HDeptName);
+                                $("#HDeptID").val(result.data.HDeptID);
+                                $("#HSourceBillNo").val(result.data.hSourceBillNoField);
+                                $("#HBillType").val(result.data.hSourceBillTypeField)
+                                sessionStorage["SourceFlag"] = true;
+                                //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+                                if (result.data.HSourceBillType == "1102") {
+                                    $("#HBillType").val("1102");
 
-                                    }
-                                    else if (result.data.HSourceBillType == "1103") {
-                                        $("#HBillType").val("1103");
-                                    }
-                                    else {
-                                        $("#HBillType").val("鎵嬪伐褰曞叆");
-                                    }
-                                    $("#HNote").val(";涓�閿壂鐮佹簮鍗曟潯鐮�");
+                                }
+                                else if (result.data.HSourceBillType == "1103") {
+                                    $("#HBillType").val("1103");
+                                }
+                                else {
+                                    $("#HBillType").val("鎵嬪伐褰曞叆");
+                                }
+                                $("#HNote").val(";涓�閿壂鐮佹簮鍗曟潯鐮�");
+                                element.tabChange('tab-POStockInBill', '3');
+                            }
+                            else {
+                                if (HSourceFlag == true) {
                                     element.tabChange('tab-POStockInBill', '3');
                                 }
                                 else {
-                                    if (sessionStorage["SourceFlag"] == "true") {
-                                        element.tabChange('tab-POStockInBill', '3');
+                                    $("#HSupName").val(result.data.hSupNameField);
+                                    $("#HSupID").val(result.data.hSupIDField);
+                                    //$("#HDeptName").val(result.data.HDept);
+                                    //$("#HDeptID").val(result.data.HDeptID);
+                                    //$("#HSourceBillNo").val(result.data.hSourceBillNoField);
+                                    //$("#HBillType").val(result.data.hSourceBillTypeField)
+                                    HSourceFlag = true;
+                                    //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+                                    if (result.data.hSourceBillTypeField == "1102") {
+                                        $("#HBillType").empty();
+                                        $("#HBillType").val("1102");
+                                        var optionHtml = '';
+                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '閲囪喘璁㈠崟' + "</option>";
+                                        $("#HBillType").append(optionHtml);
+                                        layui.form.render('select');
+                                        $("#HBillType").attr("readonly", "readonly");
+                                    }
+                                    if (result.data.hSourceBillTypeField == "1103") {
+                                        $("#HBillType").empty();
+                                        $("#HBillType").val("1103");
+                                        var optionHtml = '';
+                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '鏀舵枡閫氱煡鍗�' + "</option>";
+                                        $("#HBillType").append(optionHtml);
+                                        layui.form.render('select');
+                                        $("#HBillType").attr("readonly", "readonly");
                                     }
                                     else {
-                                        $("#HSupName").val(result.data.hSupNameField);
-                                        $("#HSupID").val(result.data.hSupIDField);
-                                        //$("#HDeptName").val(result.data.HDept);
-                                        //$("#HDeptID").val(result.data.HDeptID);
-                                        $("#HSourceBillNo").val(result.data.hSourceBillNoField);
-                                        sessionStorage["SourceFlag"] = true;
-                                        //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
-                                        if (result.data.hSourceBillTypeField == "1102") {
-                                            $("#HBillType").val("1102");
-                                        }
-                                        else if (result.data.hSourceBillTypeField == "1103") {
-                                            $("#HBillType").val("1103");
-                                        }
-                                        else {
-                                            $("#HBillType").val("鎵嬪伐褰曞叆");
-                                        }
-                                        $("#HNote").val(";鐗╂枡鏉$爜");
-                                        element.tabChange('tab-POStockInBill', '3');
+                                        //$("#HBillType").val("-1");
                                     }
+                                    $("#HSourceBillNo").attr("readonly", "readonly");
+                                    $("#HNote").val(";鐗╂枡鏉$爜");
+                                    element.tabChange('tab-POStockInBill', '3');
                                 }
-
-                                layer.load(3)
-                                table.render({
-                                    elem: '#wl-table'
-                                    , url: GetWEBURL() + '/POStockInBill/DisBillEntryList_Webs_Json'
-                                    , where: { HBillID: sInterID, HBillType: '1201', sWhere: '' }
-                                    , cellMinWidth: 115
-                                    , cols: [[
-                                        { type: 'radio' }
-                                        , { field: 'HQty', title: '鏁伴噺', sort: true, width: 100 }
-                                        , { field: 'HQtyMust', title: '搴旀敹鏁伴噺', sort: true, width: 100 }
-                                        , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', sort: true, width: 200 }
-                                        , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', sort: true, width: 200 }
-                                        , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', sort: true, width: 200 }
-                                        , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', sort: true, width: 200 }
-                                        , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', sort: true, width: 200 }
-                                        , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', sort: true, width: 200 }
-                                        , { field: 'HBatchNo', title: '鎵规', sort: true, width: 200 }
-                                    ]]
-                                    , height: 500
-                                    , done: function () {
-                                        layer.closeAll("loading");
-                                    }
-                                });
-
-                                $.ajax({
-                                    url: GetWEBURL() + '/MateOutBill/DisBillEntryList_Webs_New_Json1',
-                                    type: "GET",
-                                    data: { HBillID: sInterID, HBillNo: sBillNo, HBillType: '1201', sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl },
-                                    //data: { HBillID: sInterID, HBillType: '1201', sWhere: '' },
-                                    success: function (result) {
-                                        if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
-                                            //listOption.data = result.data.list;
-                                            table.render(result.data.list);
-                                            $("#HBarCode_B").val(result.data.list2[0].HBarCode);
-                                            $("#HMaterName_B").val(result.data.list2[0].HMaterName);
-                                            $("#HMaterModel_B").val(result.data.list2[0].HMaterModel);
-                                            $("#HBatchNo_B").val(result.data.list2[0].HBatchNo);
-                                            $("#HUnitName_B").val(result.data.list2[0].HUnitName);
-                                            $("#HQty_B").val(result.data.list2[0].HQty);
-                                            $("#HTMQty_B").val(result.data.list2[0].HTMQty);
-                                            $("#HWHName_B").val(result.data.list2[0].HWHName);
-                                            $("#HSPName_B").val(result.data.list2[0].HSPName);
-                                        }
-                                        else {
-                                            layer.msg(result.Message);
-                                        }
-                                        layer.closeAll("loading");
-                                    }
-                                });
                             }
-                            else {
-                                playSound();
-                                layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                            }
-                            layer.closeAll("loading");
+
+                            layer.load(3)
+                            $.ajax({
+                                url: GetWEBURL() + '/MateOutBill/DisBillEntryList_Webs_New_Json1',
+                                type: "GET",
+                                data: { HBillID: sInterID, HBillNo: sBillNo, HBillType: '1201', sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl },
+                                success: function (result) {
+                                    if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
+                                        listOption.data = result.data.list;
+                                        table.render(listOption);
+                                        $("#HBarCode_B").val(result.data.list2[0].HBarCode);
+                                        $("#HMaterName_B").val(result.data.list2[0].HMaterName);
+                                        $("#HMaterModel_B").val(result.data.list2[0].HMaterModel);
+                                        $("#HBatchNo_B").val(result.data.list2[0].HBatchNo);
+                                        $("#HUnitName_B").val(result.data.list2[0].HUnitName);
+                                        $("#HQty_B").val(result.data.list2[0].HQty);
+                                        $("#HTMQty_B").val(result.data.list2[0].HTMQty);
+                                        $("#HWHName_B").val(result.data.list2[0].HWHName);
+                                        $("#HSPName_B").val(result.data.list2[0].HSPName);
+
+                                        var count = 0;
+                                        var count1 = 0;
+                                        for (var i = 0; i < result.data.list.length; i++) {
+                                            count += result.data.list[i].HQty;
+                                            count1 += result.data.list[i].HPieceQty;
+                                        }
+                                        $("#HSumQtys").val(count);
+                                        $("#HBarCodeQtys").val(count1);
+                                    }
+                                    else {
+                                        layer.msg(result.Message);
+                                    }
+                                    layer.closeAll("loading");
+                                }
+                            });
                         }
-                    });
+                        else {
+                            playSound();
+                            layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                        }
+                        layer.closeAll("loading");
+                    }
+                });
+            }
+            var listOption = {
+                elem: '#wl-table'
+                , toolbar: '#toolbarDemo'
+                , totalRow: true
+                , cellMinWidth: 90
+                , cols: [[
+                    { type: 'radio' }
+                    , { field: 'HSNO', title: '搴忓彿', width: 60 }
+                    , { field: 'HQty', title: '鏁伴噺', width: 80, totalRow: true }
+                    , { field: 'HQtyMust', title: '搴斿彂鏁伴噺', width: 80, totalRow: true}
+                    , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', width: 150 }
+                    , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 150 }
+                    , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', width: 150 }
+                    , { field: 'HSourceInterID', title: '婧愬崟涓诲唴鐮�', width: 150 }
+                    , { field: 'HSourceEntryID', title: '婧愬崟瀛愬唴鐮�', width: 150 }
+                    , { field: 'HSourceBillNo', title: '婧愬崟鍗曞彿', width: 150 }
+                    , { field: 'HBatchNo', title: '鎵规', width: 150 }
+                    , { field: 'HPieceQty', title: '鏉$爜鏁伴噺', width: 150 }
+                ]]
+                , height: 500
+                , done: function () {
+                    layer.closeAll("loading");
                 }
-            });
-
-        function playSound() {
-            var audio = document.getElementById("cs");
-            audio.play();
-        }
-
-        function playSound1() {
-            var audio = document.getElementById("cs2");
-            audio.play();
-        }
-
-        
-        //鎵簮鍗�
-        $('#HSourceBillNo').on('keydown', function (event) {      //鎵簮鍗�
-            var HSourceBillNo = $('#HSourceBillNo').val()
-            var sInterID = $("#HInterID").val()
-            var sBillNo = $("#HBillNo").val()
-            var HSourceBillType = $("#HBillType").val()
-            if (event.keyCode == 13) {
-                //鍒ゆ柇鏂囨湰妗嗘槸鍚︽湁鏁版嵁    new
+            }
+            function playSound() {
+                var audio = document.getElementById("cs");
+                audio.play();
+            }
+            function playSound1() {
+                var audio = document.getElementById("cs2");
+                audio.play();
+            }
+            //鎵簮鍗�
+            function GetMeesageBySourceBillNo(obj) {
+                var HSourceBillNo = $('#HSourceBillNo').val()
+                var sInterID = $("#HInterID").val()
+                var sBillNo = $("#HBillNo").val()
+                var HSourceBillType = $("#HBillType").val()
                 if (HSourceBillNo == "" || sInterID <= 0) {
                     layer.msg("婧愬崟鍙蜂负绌猴紝鎴栬�呭唴鐮佷笉瀛樺湪锛�", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
                     return;
@@ -1000,22 +1151,22 @@
                         if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
                             $("#HSupID").val(result.data[0].HSupID);
                             $("#HSupName").val(result.data[0].HSupName);
-                            //$("#HDeptID").val(result.data[0].HDeptID);
-                            //$("#HDeptName").val(result.data[0].HDeptName);
                             sessionStorage["SourceFlag"] = true;
                             layer.load(3);
                             element.tabChange('tab-POStockInBill', '2');
+
                             table.render({
                                 elem: '#wl-table'
                                 , cellMinWidth: 80
+                                , totalRow: true
                                 //, url: 'http://61.130.49.162:9090/WMSAPI///POStockInBill/DisBillEntryList_Webs_Json'
                                 , url: GetWEBURL() + '/POStockInBill/DisBillEntryList_Webs_Json'
                                 //, toolbar: '#toolbarDemo'
                                 , where: { HBillID: sInterID, HBillType: '1201', sWhere: '' }
                                 , cols: [[
                                     { type: 'radio' }
-                                    , { field: 'HQty', title: '鏁伴噺', sort: true, width: 100 }
-                                    , { field: 'HQtyMust', title: '搴旀敹鏁伴噺', sort: true, width: 100 }
+                                    , { field: 'HQty', title: '鏁伴噺', sort: true, width: 100, totalRow: true}
+                                    , { field: 'HQtyMust', title: '搴旀敹鏁伴噺', sort: true, width: 100, totalRow: true}
                                     , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', sort: true, width: 200 }
                                     , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', sort: true, width: 200 }
                                     , { field: 'HMaterModel', title: '瑙勬牸鍨嬪彿', sort: true, width: 200 }
@@ -1040,95 +1191,11 @@
                         layer.closeAll("loading");
                     }
                 });
-                // layer.msg($('#HSourceBillNo').val(), { icon: 1 });
             }
         });
 
-        //鎵粨浣�
-        $('#HStockPlaceName').on('keydown', function (event) {
-            var HBarCode = $('#HStockPlaceName').val()
-            if (event.keyCode == 13) {
-                //鍒ゆ柇鏂囨湰妗嗘槸鍚︽湁鏁版嵁    new
-                $.ajax({
-                    url: GetWEBURL() + "/LookingFor/getSpName_Json",
-                    type: "GET",
-                    data: { "HBarCode": HBarCode },
-                    success: function (result) {
-                        if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
-                            $("#HStockPlaceName").val(result.data[0].HName);
-                            $("#HStockPlaceID").val(result.data[0].HItemID);
-                            $("#HWHID").val(result.data[0].HWHID);
-                            $("#HWHNAME").val(result.data[0].HWhName);
-                            element.tabChange('tab-POStockInBill', '2');
-                        }
-                        else {
-                            // $("#verifycode").click();
-                            //layer.msg(result.Message, { icon: 5 });
-                            layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                        }
-                        layer.closeAll("loading");
-                    }
-                });
-                // layer.msg($('#HSourceBillNo').val(), { icon: 1 });
-            }
-        });
-        //鍒锋柊鏄庣粏椤电
-        table.render({
-            elem: '#mx-table'
-            // , url: 'http://localhost:8083/POStockInBill/GetHBarCodeShowBillSub'
-            //, toolbar: '#toolbarDemo'
-            // , where: { sMsg: linterid, sMsg2: lentryid }
-            , cols: [[
-                , { field: 'HMaterID', title: '鐗╂枡ID', width: 100, hide: true }
-            ]]
-            , page: true
-            , height: 500
-            , done: function () {
-            }
-        });
-
-        //鎵玀ES浠撲綅
-        $('#HMESSPName').on('keydown', function (event) {      //鎵粨浣�
-            var HBarCode = $('#HMESSPName').val();
-            if (event.keyCode == 13) {
-                $.ajax({
-                    url: GetWEBURL() + "/LookingFor/getSpName_Json",
-                    type: "GET",
-                    data: { "HBarCode": HBarCode },
-                    success: function (result) {
-                        if (result.count == 1) {
-                            $("#HMESSPID").val(result.data[0].HWHID);
-                            $("#HMESSPName").val(result.data[0].HWhName + "-" + result.data[0].HName);
-                            $("#HExplanation").val(result.data[0].HName + "-" + result.data[0].HWhName);
-                            $.ajax({
-                                url: GetWEBURL() + "/LookingFor/GetSpNameMES_Json",
-                                type: "GET",
-                                data: { "HERPWHID": result.data[0].HWHID },
-                                success: function (result) {
-                                    if (result.count == 1) {
-                                        $("#HWHID").val(result.data[0].HMESWHID);
-                                        $("#HWHNAME").val(result.data[0].HMESWHNAME);
-                                        $("#HMESSPName").attr("readonly", "readonly");//MES浠撲綅鍙HExplanation
-                                        $("#HMESSPName").css("background-color", "#efefef4d");
-                                    }
-                                    else {
-                                        layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                                    }
-                                    layer.closeAll("loading");
-                                }
-                            });
-                        }
-                        else {
-                            layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                        }
-                        layer.closeAll("loading");
-                    }
-                });
-            }
-        });
-
-                //浠ヤ笂涓簂ayui妯″潡
-            });
+        //浠ヤ笂涓簂ayui妯″潡
+        //姝ゅ鏂规硶娑夊強鍒拌澶栭儴椤甸潰parent.鏂规硶鍚嶈皟鐢ㄧ殑蹇呴』鏀惧湪Layui鏂规硶澶栭儴
 
         function GetHWHValue(obj)  //杩斿洖璋冨叆浠撳簱
         {
@@ -1139,6 +1206,8 @@
         function GetHSpValue(obj) {  //杩斿洖璋冨叆浠撲綅
             $("#HStockPlaceName").val(obj[0].HName);
             $("#HStockPlaceID").val(obj[0].HItemID);
+            $("#HWHNAME").val(obj[0].HWhName);
+            $("#HWHID").val(obj[0].HWHID);
         }
         function GetHSupValue(obj) {  //杩斿洖渚涘簲鍟�
             $("#HSupName").val(obj[0].HName);
@@ -1157,6 +1226,16 @@
             $("#HDeptID").val(obj[0].HItemID);
         }
         function AllowLoadData(sSubStr, bnt) {  //闈炵┖楠岃瘉
+            //鏁板瓧姝e垯(鍖呭惈灏忔暟)
+            var reg = /^\d+(\.\d+)?$/;
+            //if (reg.test($("#HQty").val()) == false || $("#HQty").val() == '') {
+            //    layer.msg("鏁伴噺蹇呴』涓烘暟閲忔垨灏忔暟", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+            //    return false;
+            //}
+            //if (reg.test($("#Qty_B").val()) == false || $("#Qty_B").val() == '') {
+            //    layer.msg("鏁伴噺蹇呴』涓烘暟閲忔垨灏忔暟", { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+            //    return false;
+            //}
             //if ($("#HSourceBillNo").val() == '') {
             //    layer.msg("璇峰厛鎵簮鍗�!", { icon: 5 });
             //    return false;

--
Gitblit v1.9.1