From 617f7b3ef0d489993d8cad57be6cbda92c9726be Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期一, 17 十一月 2025 09:42:22 +0800
Subject: [PATCH] 添加库存删除功能

---
 WebTM/views/WMS扫码模块/库存查询/KF_ICInventory_Clear_PDA.html |  222 ++++++++++++++++++++++---------------------------------
 WebTM/WebTM.csproj                                     |    2 
 2 files changed, 91 insertions(+), 133 deletions(-)

diff --git a/WebTM/WebTM.csproj b/WebTM/WebTM.csproj
index 5554df2..9388f67 100644
--- a/WebTM/WebTM.csproj
+++ b/WebTM/WebTM.csproj
@@ -336,7 +336,7 @@
     <Content Include="views\WMS鎵爜妯″潡\瀹㈡埛鏉$爜鎵弿\Gy_getCusBarCodeBill_PDA.html" />
     <Content Include="views\WMS鎵爜妯″潡\瀹㈡埛鏉$爜鎵弿\Gy_getCusBarCodeBillList_PDA.html" />
     <Content Include="views\WMS鎵爜妯″潡\灏忚溅閿佸畾\Kf_TrolleyPositionBill_PDA.html" />
-    <Content Include="views\WMS鎵爜妯″潡\搴撳瓨鏌ヨ\KF_ICInventory_Clear_PDA .html" />
+    <Content Include="views\WMS鎵爜妯″潡\搴撳瓨鏌ヨ\KF_ICInventory_Clear_PDA.html" />
     <Content Include="views\WMS鎵爜妯″潡\搴撳瓨鏌ヨ\KF_ICInventory_WorkShopByXJ_PDA.html" />
     <Content Include="views\WMS鎵爜妯″潡\搴撳瓨鏌ヨ\KF_ICInventory_WorkShopByCLD_PDA.html" />
     <Content Include="views\WMS鎵爜妯″潡\搴撳瓨鏌ヨ\KF_ICInventoryByWorkShop_PDA.html" />
diff --git "a/WebTM/views/WMS\346\211\253\347\240\201\346\250\241\345\235\227/\345\272\223\345\255\230\346\237\245\350\257\242/KF_ICInventory_Clear_PDA .html" "b/WebTM/views/WMS\346\211\253\347\240\201\346\250\241\345\235\227/\345\272\223\345\255\230\346\237\245\350\257\242/KF_ICInventory_Clear_PDA.html"
similarity index 72%
rename from "WebTM/views/WMS\346\211\253\347\240\201\346\250\241\345\235\227/\345\272\223\345\255\230\346\237\245\350\257\242/KF_ICInventory_Clear_PDA .html"
rename to "WebTM/views/WMS\346\211\253\347\240\201\346\250\241\345\235\227/\345\272\223\345\255\230\346\237\245\350\257\242/KF_ICInventory_Clear_PDA.html"
index 6d7b618..c94e0bc 100644
--- "a/WebTM/views/WMS\346\211\253\347\240\201\346\250\241\345\235\227/\345\272\223\345\255\230\346\237\245\350\257\242/KF_ICInventory_Clear_PDA .html"
+++ "b/WebTM/views/WMS\346\211\253\347\240\201\346\250\241\345\235\227/\345\272\223\345\255\230\346\237\245\350\257\242/KF_ICInventory_Clear_PDA.html"
@@ -30,25 +30,23 @@
                         <span style="color: white;"><i class="layui-icon layui-icon-form"></i>杞﹂棿涓婃灦搴撳瓨鏌ヨ</span>
                     </div>
                     <div class="layui-form-item" style="margin: 1% 2%;text-align: right;">
-                        <button type="button" lay-submit="" lay-filter="cmdSearch" class="layui-btn layui-btn-radius" id="cmdSearch">鏌ヨ</button>
+                        <button type="button" lay-submit="" lay-filter="cmdDelete" class="layui-btn layui-btn-radius" id="cmdDelete">鍒犻櫎</button>
                         <button type="button" lay-submit="" lay-filter="cmdCancel" class="layui-btn layui-btn-radius layui-btn-danger" id="cmdCancel">閫�鍑�</button>
                     </div>
                     <div class="layui-collapse">
                         <div class="layui-colla-item">
-                            <div class="layui-colla-title layui-inline">
+                            <!--<div class="layui-colla-title layui-inline">
                                 <div class="layui-inline">
                                     <span>鏇村</span>
                                 </div>
-                            </div>
+                            </div>-->
                             <div class="layui-inline">
                                 <div class="layui-col-xs2">
-                                    <label class="layui-form-label" style="width:30px;padding-left:0px;">鏉$爜</label>
+                                    <label class="layui-form-label" style="width:30px;padding-left:0px;">鐗╂枡浠g爜</label>
                                 </div>
                                 <div class="layui-col-xs10">
                                     <input type="text" name="HBarCode" id="HBarCode" lay-verify="HBarCode" onkeyup="value=value.replace(/\s+/g,'')" autocomplete="off" class="layui-input" onfocus="this.select();">
                                 </div>
-                            </div>
-                            <div class="layui-colla-content" style="padding: 6px; margin-left: 6%;">
                                 <div class="layui-row" style="margin-top:5px">
                                     <div class="layui-col-xs2">
                                         <label class="layui-form-label" style="width:30px;padding-left:0px;">浠撳簱</label>
@@ -78,21 +76,20 @@
                                     </div>
                                 </div>
                             </div>
-                        </div>
-                    </div>
-                    <div class="layui-tab layui-col-xs12" lay-filter="tab-KF_ICInventoryByCLD_PDA">
-                        <ul class="layui-tab-title" lay-filter="tab-all">
-                            <li lay-id="1" style="padding:1px;">杞﹂棿鍙婃椂搴撳瓨淇℃伅</li>
-                        </ul>
-                        <div class="layui-tab-content">
-                            <!--杞﹂棿鍙婃椂搴撳瓨淇℃伅-->
-                            <div class="layui-tab-item layui-show">
-                                <div class="layui-row">
-                                    <div class="layui-col-xs12">
-                                        <div class="layui-form-item" style="padding:0px;margin:0px"></div>
-                                        <table class="layui-hide" id="wl-table" lay-filter="wl-table"></table>
-                                    </div>
-                                </div>
+                            <div class="layui-colla-content" style="padding: 6px; margin-left: 6%;">
+                                
+                            </div>
+                                    <!--澶辫触鎻愮ず闊�-->
+                            <div id="" style="display:none;">
+                                <audio id="cs" hidden controls>
+                                    <source src="../../video/jingbao.wav" type="audio/ogg">
+                                </audio>
+                            </div>
+                            <!--鎴愬姛鎻愮ず闊�-->
+                            <div id="" style="display:none;">
+                                <audio id="cs2" hidden controls>
+                                    <source src="../../video/success.wav" type="audio/ogg">
+                                </audio>
                             </div>
                         </div>
                     </div>
@@ -118,7 +115,7 @@
             var HStockOrgID = sessionStorage["OrganizationID"]  //缁勭粐ID
             var listOption = [];
             var columns = "";
-            var HModName = "KF_ICInventory_WorkShopByCLD_PDA";
+            var HModName = "KF_ICInventory_Clear_PDA";
             var titleData = [];     //涓嶉渶瑕佹樉绀虹殑瀛楁
             var params = get_UrlVars();
             var OperationType = params[params[0]] == null ? 1 : params[params[0]];  //1涓虹洿鎺ユā鍧楁墦寮�  2涓轰粠鍏朵粬妯″潡璺宠浆鎵撳紑
@@ -158,12 +155,7 @@
                 listOption.data = data;
                 table.render(listOption);
 
-                if (OperationType == 2) {
-                    //杩斿洖鐗╂枡浠g爜
-                    $("#HBarCode").val(HMaterNumber);
-                    //鏄剧ず琛ㄤ綋鏄庣粏
-                    DisBillEntryList();
-                }
+                
             }
 
             //鍒濆鍖栬〃鏍�
@@ -361,115 +353,16 @@
             //#endregion
 
 
-            //#region 鎵弿鐗╂枡鏉$爜
-
-            //鎵弿鏉$爜
-            $('#HBarCode').on('keydown', function (event) {
-                if (event.keyCode == 13) {
-                    DisBillEntryList();
-                    layer.closeAll("loading");
-                }
-            });
-
-            //#endregion
 
 
             //#region 鍔熻兘鎺т欢
-
-            //#region 鏌ヨ
-            form.on('submit(cmdSearch)', function (data) {
-                DisBillEntryList();
-                layer.closeAll("loading");
-            });
-
-            function DisBillEntryList() {
-                //浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
-                if ($("#HWHName").val() == '') {
-                    $("#HWHID").val("0");
+            //鍒犻櫎
+            form.on('submit(cmdDelete)', function () {
+                if (set_ModCheck("CE_MaterialUpperClear") == true) {
+                    set_DeleteBill();
                 }
-                if ($("#HStockPlaceName").val() == '') {
-                    $("#HStockPlaceID").val("0");
-                }
-                var sHBarCode = $('#HBarCode').val()
-                var sHWHID = $("#HWHID").val()
-                var sHSPID = $("#HStockPlaceID").val()
+            })
 
-                $.ajax({
-                    type: "GET",
-                    url: GetWEBURL() + '/KF_ICInventory_WorkShopByMaterID/GetWorkShopICInventory',
-                    async: true,    //async鐢ㄤ簬鎺у埗锛坒alse锛夊悓姝ュ拰锛坱rue锛夊紓姝ワ紝榛樿鐨勬槸true锛屽嵆璇锋眰榛樿鐨勬槸寮傛璇锋眰
-                    data: { "HBarCode": sHBarCode, "sHWHID": sHWHID, "sHSPID": sHSPID, "HOWNERID": HStockOrgID, "sWhere": '' },
-                    success: function (result) {
-                        var data = [];
-                        var col = [];
-                        if (result.count == 1) { // 璇存槑楠岃瘉鎴愬姛浜嗭紝
-                            //缁欑┖鐨勬暟缁勮祴鍊�
-                            for (var key in result.list) {
-                                //鍔ㄦ�佽幏鍙栧垪琛ㄦ墍鏈夊垪鍚�
-                                data.push({ "id": result.list[key].ColmCols, "name": result.list[key].ColmCols, "Type": result.list[key].ColmType });
-                                //鑾峰彇涓嶉渶瑕佹樉绀虹殑鍒楋紙H寮�澶寸殑鍒椾笉鏄剧ず锛�
-                                var patrn = new RegExp(/^h/i);
-                                if (patrn.test(result.list[key].ColmCols)) {
-                                    titleData[key] = result.list[key].ColmCols;
-                                }
-                            }
-
-                            //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
-                            col.push({ type: 'radio' });
-                            for (var i = 0; i < data.length; i++) {
-                                if ($.inArray(data[i].name, titleData) > -1) {
-                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //闅愯棌id鍒�
-                                }
-                                else {
-                                    switch (data[i].Type) {
-                                        //int
-                                        case 'DateTime':
-                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 });
-                                            break;
-                                        default:
-
-                                            if (data[i].name == '浠撳簱' || data[i].name == '鎵瑰彿') {
-                                                col.push({ field: data[i].id, title: data[i].name, align: 'center', width: 120 });
-                                            } else if (data[i].name == '鐗╂枡浠g爜' || data[i].name == '鐗╂枡鍚嶇О' || data[i].name == '瑙勬牸鍨嬪彿' || data[i].name == '缁勭粐' || data[i].name == '浠撲綅浠g爜' ) {
-                                                col.push({ field: data[i].id, title: data[i].name, align: 'center', width: 180 });
-                                            } else {
-                                                col.push({ field: data[i].id, title: data[i].name, align: 'center' });
-                                            }
-                                    }
-                                }
-                            }
-                            columns = col;
-                            listOption.cols = [columns];
-                            listOption.data = result.data;
-                            //listOption.totalRow = true;
-                            table.cache['wl-table'] = null;         //娓呯┖琛ㄦ牸缂撳瓨鏁版嵁
-                            table.render(listOption);
-                        }
-                        else {
-                            listOption.cols = [[
-                                { field: '鏁伴噺', title: '鏁伴噺', width: 100 }
-                                , { field: '浠撳簱', title: '浠撳簱', width: 100 }
-                                , { field: '浠撲綅', title: '浠撲綅', width: 100 }
-                                , { field: '鐗╂枡浠g爜', title: '鐗╂枡浠g爜', width: 100 }
-                                , { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О', width: 100 }
-                                , { field: '瑙勬牸鍨嬪彿', title: '瑙勬牸鍨嬪彿', width: 100 }
-                                , { field: '鎵规', title: '鎵规', width: 100 }
-                                , { field: '杈呭姪灞炴��', title: '杈呭姪灞炴��', width: 100 }
-                                , { field: '鐢熶骇鏃ユ湡', title: '鐢熶骇鏃ユ湡', width: 100 }
-                                , { field: '鏈夋晥鏈熻嚦', title: '鏈夋晥鏈熻嚦', width: 100 }
-                                , { field: '缁勭粐', title: '缁勭粐', width: 100 }
-                            ]];
-                            listOption.data = data;
-                            //listOption.totalRow = true;
-                            table.render(listOption);
-                            //layer.msg(result.Message, { icon: 5, btn: ['纭'], time: 100000, offset: 'auto', skin: 'layui-layer-lan', title: "娓╅Θ鎻愮ず" });
-                        }
-                    },
-                    complete: function (XHR, TS) { XHR = null }//鍥炴敹璧勬簮
-                });
-            }
-
-            //#endregion
 
             //#region 閫�鍑�
             form.on('submit(cmdCancel)', function () {
@@ -487,6 +380,71 @@
 
             //#endregion
 
+            //澶辫触鎻愮ず闊�
+            function playSound() {
+                console.log("playSound");
+                var audio = document.getElementById("cs");
+                audio.play();
+                audio.onended = function () {
+                    // 褰撻煶棰戞挱鎶ュ畬鎴愭椂锛岃皟鐢� pause 鍜岃缃� currentTime 涓� 0 浠ュ仠姝㈡挱鎶ュ苟閲嶇疆
+                    audio.pause();
+                    audio.currentTime = 0;
+                };
+            }
+            //鎴愬姛鎻愮ず闊�
+            function playSound_OK() {
+                console.log("playSound_OK");
+                var audio = document.getElementById("cs2");
+                audio.play();
+                audio.onended = function () {
+                    // 褰撻煶棰戞挱鎶ュ畬鎴愭椂锛岃皟鐢� pause 鍜岃缃� currentTime 涓� 0 浠ュ仠姝㈡挱鎶ュ苟閲嶇疆
+                    audio.pause();
+                    audio.currentTime = 0;
+                };
+            }
+
+            function set_ModCheck(ModRightNameCheck) {
+                var Permission = false;
+                $.ajax({
+                    type: "GET",
+                    url: GetWEBURL() + "/LMES/getReportByModRightNameCheck", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                    async: false,
+                    data: { "ModRightNameCheck": ModRightNameCheck, "user": sessionStorage["HUserName"] },
+                    success: function (result) {
+                        if (result.count == 1) {
+                            Permission = true;
+                        } else {
+                            layer.alert("褰撳墠妯″潡娌℃湁鏌ヨ鏉冮檺!", { icon: 5 });
+                        }
+                    }, error: function () {
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
+                return Permission;
+            }
+            function set_DeleteBill() {
+                if ($("#HStockPlaceID").val() == 0 || $("#HWHID").val() == 0 || $("#HBarCode").val() == "") {
+                    return layer.alert("浠撲綅鎴栫墿鏂欐湭閫夋嫨!", { icon: 5 });
+                }
+                $.ajax({
+                    type: "GET",
+                    url: GetWEBURL() + "/KF_ICInventory_WorkShop/ClearHBarCode", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                    async: false,
+                    data: { "HBarCode": $("#HBarCode").val(), "HWHID": $("#HWHID").val(), "HSPID": $("#HStockPlaceID").val(), "user": sessionStorage["HUserName"], "HOrgID": HStockOrgID },
+                    success: function (result) {
+                        if (result.count == 1) {
+                            layer.alert("鍒犻櫎鎴愬姛!", { icon: 5 });
+                        } else {
+                            layer.alert(result.Message, { icon: 5 });
+                        }
+                    }, error: function () {
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
+                
+            }
+
+
             //#endregion
 
         });

--
Gitblit v1.9.1