From 4eff3a8e16e844fd1d842a6b790ecb9e1878d4b1 Mon Sep 17 00:00:00 2001
From: ch <37327@LLOOCCY>
Date: 星期一, 30 五月 2022 13:34:58 +0800
Subject: [PATCH] 缓存列表样式修改

---
 WebTM/views/公共页面/Kf_BarCodeEditDlg.html |  333 ++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 209 insertions(+), 124 deletions(-)

diff --git "a/WebTM/views/\345\205\254\345\205\261\351\241\265\351\235\242/Kf_BarCodeEditDlg.html" "b/WebTM/views/\345\205\254\345\205\261\351\241\265\351\235\242/Kf_BarCodeEditDlg.html"
index 96c0366..d2987aa 100644
--- "a/WebTM/views/\345\205\254\345\205\261\351\241\265\351\235\242/Kf_BarCodeEditDlg.html"
+++ "b/WebTM/views/\345\205\254\345\205\261\351\241\265\351\235\242/Kf_BarCodeEditDlg.html"
@@ -54,7 +54,7 @@
                                         <input type="text" name="HSupName" id="HSupName" lay-verify="HSupName" autocomplete="off" class="layui-input">
                                         <input type="hidden" name="HSupID" id="HSupID" lay-verify="HSupID" autocomplete="off" class="layui-input">
                                     </div>
-         
+
                                 </div>
                                 <div class="layui-form-item">
                                     <label class="layui-form-label" style="width:60px;padding-left:0px;">閮ㄩ棬</label>
@@ -87,70 +87,128 @@
             </div>
         </div>
     </div>
-        <script src="../../../layuiadmin/layui/layui.js"></script>
-        <script src="../../layuiadmin/Scripts/json2.js" type="text/javascript"></script>
-        <script src="../../layuiadmin/Scripts/jquery-1.4.1.js" type="text/javascript"></script>
+    <script src="../../layuiadmin/layui/layui.js"></script>
+    <script src="../../layuiadmin/Scripts/json2.js" type="text/javascript"></script>
+    <script src="../../layuiadmin/Scripts/jquery-1.4.1.js" type="text/javascript"></script>
+    <script src="../../layuiadmin/Scripts/webConfig.js"></script>
     <script>
-        function getUrlVars() {
-            var vars = [], hash;
-            var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
-            for (var i = 0; i < hashes.length; i++) {
-                hash = hashes[i].split('=');
-                vars.push(hash[0]);
-                vars[hash[0]] = hash[1];
-            }
-            return vars;
-        }
-        //鑾峰彇椤甸潰璺宠浆鍙傛暟
-        var params = getUrlVars();
-        if (typeof (params[params[0]]) == "undefined") {
-            var OperationType = 1;//鎿嶄綔绫诲瀷
-        } else {
-            var HInterID = params[params[0]];//鍗曟嵁ID
-            var HMaterID = params[params[1]];//鐗╂枡ID
-            var HAuxPropID = params[params[2]];//杈呭姪灞炴��
-            var HMTONo = params[params[3]];//璁″垝璺熻釜鍙�
-            var HWhID = params[params[4]];//浠撳簱ID
-            var HSPID = params[params[5]];//浠撲綅ID
-            var HSCWHID = params[params[6]];//璋冨嚭浠撳簱ID
-            var HSCSPID = params[params[7]];//璋冨嚭浠撲綅ID
-            var HBatchNo = params[params[8]];//鎵规
-            var HSourceInterID = params[params[9]];//婧愬崟涓籌D
-            var HSourceEntryID = params[params[10]];//婧愬崟瀛怚D
-            var HBillType = params[params[11]];//鍗曟嵁绫诲瀷
-            var HBarCode = params[params[12]];//鏉$爜
-        }
+      
+
+        //layui.config({
+        //    base: '../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
+        //}).extend({
+        //    index: 'lib/index' //涓诲叆鍙fā鍧�
+        //}).use(['index', 'form', 'table'], function () {
+        //    var $ = layui.$
+        //    , admin = layui.admin
+        //    , layer = layui.layer
+        //    , table = layui.table
+        //    , form = layui.form;
 
         layui.config({
-            base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
+            base: '../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
         }).extend({
             index: 'lib/index' //涓诲叆鍙fā鍧�
-        }).use(['index', 'form', 'table'], function () {
+        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
             var $ = layui.$
-            , admin = layui.admin
-            , layer = layui.layer
-            , table = layui.table
-            , form = layui.form;
+                , admin = layui.admin
+                , layer = layui.layer
+                , table = layui.table
+                , form = layui.form
+                , element = layui.element;
 
 
-            table.render({
-            elem: '#mx-table'
-                //, url: 'http://localhost:8083/Web/GetHBarCodeShowBillSub'
-                 ,url: GetWEBURL() + "/Web/GetHBarCodeShowBillSub"
-                , where: {
-                    "HInterID": HInterID, "HMaterID": HMaterID, "HAuxPropID": HAuxPropID, "HMTONo": HMTONo, "HWhID": HWhID, "HSPID": HSPID, "HSCWHID": HSCWHID
-                    , "HSCSPID": HSCSPID, "HBatchNo": HBatchNo, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "HBillType": HBillType,sWhere: ''
-                },
-             cols: [[
-             { type: 'radio' }
-           , { field: 'HSonNo', title: '搴忓彿', width: 100 }
-           , { field: 'HBarCode', title: '鏉″舰鐮�', width: 200 }
-           , { field: 'HQty', title: '鏁伴噺', width: 100 }
-           , { field: 'HBatchNo', title: '鎵规', width: 150 }
-           , { field: 'HMTONo', title: '璁″垝璺熻釜鍗曞彿', width: 150 }
-         ]]
-            // , data: [linterid]
-            });
+          
+            //鑾峰彇椤甸潰璺宠浆鍙傛暟
+            var HMTONo = ''
+            var HSourceInterID = 0
+            var HSourceEntryID = 0
+            var HQty = 0
+            var HAuxPropID = 0
+            var HBatchNo = ''
+
+            var params = getUrlVars();
+            if (typeof (params[params[0]]) == "undefined") {
+                var OperationType = 1;//鎿嶄綔绫诲瀷
+            } else {
+                var HInterID = params[params[0]];//鍗曟嵁ID
+                var HMaterID = params[params[1]];//鐗╂枡ID
+                //var HAuxPropID = params[params[2]];//杈呭姪灞炴��
+                //var HMTONo = params[params[3]];//璁″垝璺熻釜鍙�
+                //var HWhID = params[params[4]];//浠撳簱ID
+                //var HSPID = params[params[5]];//浠撲綅ID
+                //var HSCWHID = params[params[6]];//璋冨嚭浠撳簱ID
+                //var HSCSPID = params[params[7]];//璋冨嚭浠撲綅ID
+                //var HBatchNo = params[params[8]];//鎵规
+                //var HSourceInterID = params[params[2]];//婧愬崟涓籌D
+                //var HSourceEntryID = params[params[3]];//婧愬崟瀛怚D
+                //var HBillType = params[params[6]];//鍗曟嵁绫诲瀷
+                //var HQty = params[params[6]];//鏉$爜
+                var sBillType = params[params[2]];//鍗曟嵁绫诲瀷
+
+
+                //var HBillType = ''
+
+                //var sBillType = '';//鍗曟嵁绫诲瀷
+
+                var sWhere = " and HInterID=" + HInterID + " and HMaterID=" + HMaterID + "";
+                $.ajax({
+                    url: GetWEBURL() + "/Kf_BarCodeEditDlg/Kf_BarCodeEditDlg_Json",
+                    type: "GET",
+                    data: { "sWhere": sWhere },
+                    success: function (d) {
+                        HMTONo = d.data[0].HMTONo
+                        HSourceInterID = d.data[0].HSourceInterID
+                        HSourceEntryID = d.data[0].HSourceEntryID
+                        HBatchNo = d.data[0].HBatchNo
+                        //HSourceInterID = 11
+                        //HSourceEntryID = 11
+                        HQty = d.data[0].HQty
+                        HAuxPropID = d.data[0].HAuxPropID
+                        //sBillType = d.data[0].HBillType
+                        tableRender();
+                    }
+                })
+
+
+            }
+            function tableRender() {
+                table.render({
+                    elem: '#mx-table'
+                    //, url: 'http://localhost:8083/Web/GetHBarCodeShowBillSub'
+                    , url: GetWEBURL() + "/Web/GetHBarCodeShowBillSub"
+                    , where: {
+                        "HInterID": HInterID, "HMaterID": HMaterID, "HAuxPropID": HAuxPropID, "HMTONo": HMTONo, "HWhID": 0, "HSPID": 0, "HSCWhID": 0
+                        , "HSCSPID": 0, "HBatchNo": HBatchNo, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "sBillType": sBillType, sWhere: ''
+                    },
+                    cols: [[
+                        { type: 'radio' }
+                        , { field: 'HSonNo', title: '搴忓彿', width: 100 }
+                        , { field: 'HBarCode', title: '鏉″舰鐮�', width: 200 }
+                        , { field: 'HQty', title: '鏁伴噺', width: 100 }
+                        , { field: 'HBatchNo', title: '鎵规', width: 150 }
+                        , { field: 'HMTONo', title: '璁″垝璺熻釜鍗曞彿', width: 150 }
+                    ]]
+                    // , data: [linterid]
+                });
+            }
+           
+
+
+            form.on('submit(cmdCancel)', function () {
+                var index = parent.layer.getFrameIndex(window.name);
+                    parent.layer.close(index);
+            })
+            //function Pub_Close(closeType) {
+            //    if (closeType == 1) {
+            //        //鍏抽棴寮圭獥
+            //        var index = parent.layer.getFrameIndex(window.name);
+            //        parent.layer.close(index);
+            //    } else if (closeType == 2) {
+            //        //鍏抽棴椤电
+            //        parent.layui.admin.events.closeThisTabs();
+            //    }
+            //}
 
 
             //#region 鍒犻櫎
@@ -164,7 +222,7 @@
                         $.ajax({
                             type: "GET",
                             url: GetWEBURL() + "Kf_BarCodeEditDlg/DeltetBill", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-                            data: { "HInterID": HInterID, "HBarCode": HBarCode, "HBillType": HBillType },
+                            data: { "HInterID": HInterID, "HBarCode": HBarCode, "HBillType": sBillType },
                             success: function (result) {
                                 if (result.count == 1) {
                                     layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
@@ -191,74 +249,101 @@
             })
 
 
-            //缂栬緫
-            //form.on('submit(cmdChange)', function () {//缂栬緫
-            //    var checkStatus = table.checkStatus('mx-table')
-            //        , data = checkStatus.data;
-            //    var sQty = data[0].HQty.toString();
-            //    var iQty = $('#HQty').val()
-            //        $.ajax(
-            //            {
-            //                type: "Get",
-            //                //url: "http://61.130.49.162:9090/WMSAPI///ProductIn/Delete_Json", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
-            //                url: GetWEBURL() + "/Kf_BarCodeEditDlg/GetCheckQtyByBarCodeBill",
-            //                async: true,
-            //                data: {
-            //                    "HInterID": HInterID, "HBillType": HBillType, "sBatchNo": HBatchNo, "sBarCode": HBarCode, "sSCWhID": HSCWHID
-            //                    , "sSCSPID": HSCSPID, "sAuxPropID": HAuxPropID, "sMTONo": HMTONo, "iQty": iQty
-            //                    , "HMaterID": HMaterID, "sWhID": HWhID, "sSPID": HSPID, "HSourceInterID": HSourceInterID
-            //                    , "HSourceEntryID": HSourceEntryID, "EndQty": EndQty, "sQty": sQty
-            //                },
-            //                dataType: "json",
-            //                success: function (data) {
-            //                    if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜�
-            //                        table.render({
-            //                            elem: '#mx-table'
-            //                            //, url: 'http://localhost:8083/Web/GetHBarCodeShowBillSub'
-            //                            , url: GetWEBURL() + "/Web/GetHBarCodeShowBillSub"
-            //                            , where: {
-            //                                "HInterID": HInterID, "HMaterID": HMaterID, "HAuxPropID": HAuxPropID, "HMTONo": HMTONo, "HWhID": HWhID, "HSPID": HSPID, "HSCWHID": HSCWHID
-            //                                , "HSCSPID": HSCSPID, "HBatchNo": HBatchNo, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "HBillType": HBillType
-            //                            },
-            //                            cols: [[
-            //                                { type: 'radio' }
-            //                                , { field: 'HSonNo', title: '搴忓彿', width: 100 }
-            //                                , { field: 'HBarCode', title: '鏉″舰鐮�', width: 200 }
-            //                                , { field: 'HQty', title: '鏁伴噺', width: 100 }
-            //                                , { field: 'HBatchNo', title: '鎵规', width: 150 }
-            //                                , { field: 'HMTONo', title: '璁″垝璺熻釜鍗曞彿', width: 150 }
-            //                            ]]
-            //                            // , data: [linterid]
-            //                        });
-            //                        alert("缂栬緫鎴愬姛锛�");
-            //                    }
-            //                    else {
-            //                        layer.msg(data.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-            //                    }
-            //                },
-            //                error: function (err) {
-            //                    layer.msg('閿欒' + err, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-            //                }
-            //            });
+            //璋冩暣
+            form.on('submit(cmdChange)', function () {//缂栬緫
+                var checkStatus = table.checkStatus('mx-table')
+                    , data = checkStatus.data;
+                var sQty = data[0].HQty.toString();
+                var iQty = $('#HQty').val();
+                var HBarCode = data[0].HBarCode.toString();
+                var sWhID = data[0].HWHID;
+                var sSPID = data[0].HStockPlaceID;
+                var sBatchNo = data[0].HBatchNo;
+                var HMTONo = data[0].HMTONo;
+                //if (iQty > sQty)
+                //{
+                    var EndQty = iQty - sQty;
+                //}
 
-            //        layer.open({
-            //            type: 2
-            //            , area: ['100%', '100%']
-            //            , title: '鏄庣粏鍒楄〃'
-            //            , shade: 0.6 //閬僵閫忔槑搴�
-            //            , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
-            //            , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
-            //            , content: ['../../../views/鍏叡椤甸潰/Kf_BarCodeEditDlg.html?HInterID=' + HInterID + '&HMaterID = ' + HMaterID + '&HAuxPropID = ' + HAuxPropID + '& HMTONo = ' + HMTONo + '&HWhID = ' + HWhID + '&HSPID = ' + HSPID + '&HSCWHID = ' + HSCWHID + '&HSCSPID= ' + HSCSPID + '&HBatchNo= ' + HBatchNo + '&HSourceInterID= ' + HSourceInterID + '&HSourceEntryID= ' + HSourceEntryID + '&HBillType=  ' + HBillType + '&HBarCode=  ' + HBarCode + ''
-            //                , 'yes']
-            //            , resize: false
-            //            , cancel: function () {
-            //                //$(".layui-btn").removeClass("layui-btn-disabled");
-            //            }
-            //        })
-            //    } else {
-            //        layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒');
-            //    }
+                    $.ajax(
+                        {
+                            type: "Get",
+                            //url: "http://61.130.49.162:9090/WMSAPI///ProductIn/Delete_Json", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                            url: GetWEBURL() + "/Kf_BarCodeEditDlg/GetCheckQtyByBarCodeBill",
+                            async: true,
+                            data: {
+                                "HInterID": HInterID, "HBillType": sBillType, "sBatchNo": sBatchNo, "sBarCode": HBarCode, "sSCWhID": 0
+                                , "sSCSPID": 0, "sAuxPropID": HAuxPropID, "sMTONo": HMTONo, "iQty": iQty
+                                , "HMaterID": HMaterID, "sWhID": sWhID, "sSPID": sSPID, "HSourceInterID": HSourceInterID
+                                , "HSourceEntryID": HSourceEntryID, "EndQty": EndQty, "sQty": sQty
+                            },
+                            dataType: "json",
+                            success: function (data) {
+                                if (data.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜�
+                                    table.render({
+                                        elem: '#mx-table'
+                                        //, url: 'http://localhost:8083/Web/GetHBarCodeShowBillSub'
+                                        , url: GetWEBURL() + "/Web/GetHBarCodeShowBillSub"
+                                        , where: {
+                                            "HInterID": HInterID, "HMaterID": HMaterID, "HAuxPropID": HAuxPropID, "HMTONo": HMTONo, "HWhID": sWhID, "HSPID": sSPID, "HSCWHID": 0
+                                            , "HSCSPID": 0, "HBatchNo": sBatchNo, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "sBillType": sBillType, sWhere: ''
+
+                                        },
+                                        cols: [[
+                                            { type: 'radio' }
+                                            , { field: 'HSonNo', title: '搴忓彿', width: 100 }
+                                            , { field: 'HBarCode', title: '鏉″舰鐮�', width: 200 }
+                                            , { field: 'HQty', title: '鏁伴噺', width: 100 }
+                                            , { field: 'HBatchNo', title: '鎵规', width: 150 }
+                                            , { field: 'HMTONo', title: '璁″垝璺熻釜鍗曞彿', width: 150 }
+                                        ]]
+                                        // , data: [linterid]
+                                    });
+                                    alert("缂栬緫鎴愬姛锛�");
+                                }
+                                else {
+                                    layer.msg(data.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                                }
+                            },
+                            error: function (err) {
+                                layer.msg('閿欒' + err, { icon: 5, btn: ['纭'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
+                            }
+                        });
+
+                //    layer.open({
+                //        type: 2
+                //        , area: ['100%', '100%']
+                //        , title: '鏄庣粏鍒楄〃'
+                //        , shade: 0.6 //閬僵閫忔槑搴�
+                //        , maxmin: true //鍏佽鍏ㄥ睆鏈�灏忓寲
+                //        , anim: 0 //0-6鐨勫姩鐢诲舰寮忥紝-1涓嶅紑鍚�
+                //        , content: ['../../../views/鍏叡椤甸潰/Kf_BarCodeEditDlg.html?HInterID=' + HInterID + '&HMaterID = ' + HMaterID + '&HAuxPropID = ' + HAuxPropID + '& HMTONo = ' + HMTONo + '&HWhID = ' + HWhID + '&HSPID = ' + HSPID + '&HSCWHID = ' + HSCWHID + '&HSCSPID= ' + HSCSPID + '&HBatchNo= ' + HBatchNo + '&HSourceInterID= ' + HSourceInterID + '&HSourceEntryID= ' + HSourceEntryID + '&HBillType=  ' + HBillType + '&HBarCode=  ' + HBarCode + ''
+                //            , 'yes']
+                //        , resize: false
+                //        , cancel: function () {
+                //            //$(".layui-btn").removeClass("layui-btn-disabled");
+                //        }
+                //    })
+                //} else {
+                //    layer.msg('璇烽�夋嫨涓�琛屾暟鎹紪杈戯紒');
+                //}
             })
+            function getUrlVars() {
+                var vars = [], hash;
+                //var hashes = decodeURIComponent(window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'));
+                //var hashes1 = decodeURIComponent(window.location.href);
+                //var hashes = hashes1.indexOf('?') + 1.split('&');
+
+                var hashes = window.location.href.slice(decodeURIComponent(window.location.href.indexOf('?') + 1)).split('&');
+
+                for (var i = 0; i < hashes.length; i++) {
+                    hash = hashes[i].split('=');
+                    vars.push(hash[0]);
+                    vars[hash[0]] = hash[1];
+                }
+                return vars;
+            }
+        })
 
 
     </script>

--
Gitblit v1.9.1