From 8802227cb8a2db80273ea4ededbe721e762e0acf Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期五, 17 十一月 2023 12:13:23 +0800
Subject: [PATCH] ../../Baseset/基础资料/Gy_SettleStyle.html:单选改为复选,单击选中,双击返回

---
 WebTM/views/基础资料/基础资料/InventoryAnalysis.html |  194 ++++++++++++++++++++++++++++++++++--------------
 1 files changed, 137 insertions(+), 57 deletions(-)

diff --git "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/InventoryAnalysis.html" "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/InventoryAnalysis.html"
index e7238fa..6a55a1a 100644
--- "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/InventoryAnalysis.html"
+++ "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/InventoryAnalysis.html"
@@ -9,6 +9,7 @@
     <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
     <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
     <script src="../../../layuiadmin/layui/layui.js"></script>
+    <script src="../../../layuiadmin/soulTable.slim.js"></script>
     <style type="text/css">
         input.layui-input.layui-unselect {
             padding-right: 0;
@@ -45,6 +46,9 @@
                                                 </button>
                                                 <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch1" id="btnReSearch1">
                                                     閲嶇疆
+                                                </button>
+                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnDel" id="btnDel">
+                                                    鍒犻櫎
                                                 </button>
                                             </div>
                                         </div>
@@ -169,7 +173,7 @@
             base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
         }).extend({
             index: 'lib/index', //涓诲叆鍙fā鍧�
-        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
+        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate','soulTable'], function () {
             // #region 鍏ㄥ眬鍙橀噺
             var $ = layui.$
                 , admin = layui.admin
@@ -188,6 +192,7 @@
                 , laypage = layui.laypage
                 , laydate = layui.laydate
                 , util = layui.util
+                , soulTable = layui.soulTable
             //鏌ヨ鏉′欢
             var sWhere = " HRealPotType=HBookPotType and HRealPot=HBookPot";
             var option1 = [];
@@ -199,14 +204,16 @@
             var option7 = [];
             var col = [
                 { type: 'checkbox', fixed: 'left' }
-                , { field: 'HItemID', title: 'HItemID', width: 200,hide: true}
-                , { field: 'HBarCode', title: '鍣ㄥ叿鏉$爜', width: 200 }
-                , { field: 'HMouldNo', title: '鍣ㄥ叿缂栧彿', width: 200 }
-                , { field: 'HStockCheck', title: '鐩樼偣鏂规', width: 200 }
-                , { field: 'HRealPotType', title: '瀹為檯浣嶇疆绫诲瀷', width: 200 }
-                , { field: 'HRealPot', title: '瀹為檯浣嶇疆', width: 200 }
-                , { field: 'HBookPotType', title: '璐﹂潰浣嶇疆绫诲瀷', width: 200 }
-                , { field: 'HBookPot', title: '璐﹂潰浣嶇疆', width: 200 }
+                , { field: 'HItemID', title: 'HItemID', width: 200, hide: true, sort: true}
+                , { field: 'HBarCode', title: '鍣ㄥ叿鏉$爜', width: 200, sort: true}
+                , { field: 'HMouldNo', title: '鍣ㄥ叿缂栧彿', width: 200, sort: true}
+                , { field: 'HStockCheck', title: '鐩樼偣鏂规', width: 200, sort: true}
+                , { field: 'HRealPotType', title: '瀹為檯浣嶇疆绫诲瀷', width: 200, sort: true}
+                , { field: 'HRealPot', title: '瀹為檯浣嶇疆', width: 200, sort: true}
+                , { field: 'HBookPotType', title: '璐﹂潰浣嶇疆绫诲瀷', width: 200, sort: true}
+                , { field: 'HBookPot', title: '璐﹂潰浣嶇疆', width: 200, sort: true}
+                , { field: 'HOWNERName', title: '鐩樼偣缁勭粐', width: 200, sort: true}
+                , { field: 'HMakeDate', title: '鐩樼偣鏃ユ湡', width: 200, templet: "<div>{{d.HMakeDate ==null ?'':layui.util.toDateString(d.HMakeDate, 'yyyy-MM-dd')}}</div>", sort: true }
             ];
             //#endregion
 
@@ -215,22 +222,7 @@
             set_ClearBill();
             //#endregion
 
-            //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
-            //#region 澶村伐鍏锋爮浜嬩欢 姝e父
-            table.on('toolbar(mainTable1)', function (obj) {
-                switch (obj.event) {
-                    //瀹℃牳
-                    case 'btn-Check1': set_CheckBill1();
-                        break;
-                    //鍒锋柊
-                    case 'btn-Refresh1': set_ClearQuery();;
-                        break;
-                    //閫�鍑烘寜閽�
-                    case 'btn-Exit1': Pub_Close1(2);
-                        break;
-                };
-            });
-            //#endregion
+            //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛� 
             //#region 澶村伐鍏锋爮浜嬩欢 璋冩嫧
             table.on('toolbar(mainTable2)', function (obj) {
                 switch (obj.event) {
@@ -325,22 +317,71 @@
             //鏌ヨ鎸夐挳
             form.on('submit(btnSearch1)', function (data) {
                 var HItemID = $("#HItemID").val();//鐩樼偣
-                //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛�
-                $.ajax({
-                    url: GetWEBURL() + 'Gy_StockCheckItemBill/Get_InventoryAnalysisList',
-                    type: "GET",
-                    data: { "sWhere": sWhere, "sID": HItemID },
-                    success: function (data1) {
-                        if (data1.count == 1) {
-                            option1.data = data1.list[0];
-                            table1.render(option1);
-                        } else {
-                            layer.alert(result.code + result.Message, { icon: 5 });
+                if (HItemID) {
+                    //鐩樼偣鍒嗘瀽鍒楄〃鍒ゆ柇褰撳墠閫夋嫨鐨勭洏鐐规柟妗堟槸鍚︾敓鎴愯繃鍗曟嵁
+                    $.ajax({
+                        url: GetWEBURL() + 'Gy_StockCheckItemBill/StockItemSubIsExistence',
+                        type: "GET",
+                        data: { "sID": HItemID },
+                        success: function (data1) {
+                            if (data1.count == 0) {
+                                layer.confirm('鏆傛湭鐢熸垚杩囧搴旂洏鐐规柟妗堟暟鎹紝鏄惁鐢熸垚锛�', {
+                                    icon: 3,
+                                    title: "鎻愮ず",
+                                    btn: ['纭畾', '鍙栨秷'],
+                                    submit: function (index) {
+                                        //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛�
+                                        $.ajax({
+                                            url: GetWEBURL() + 'Gy_StockCheckItemBill/Get_InventoryAnalysisList',
+                                            type: "GET",
+                                            data: { "sWhere": sWhere, "sID": HItemID },
+                                            success: function (data1) {
+                                                if (data1.count == 1) {
+                                                    option1.data = data1.list[0];
+                                                    table1.render(option1);
+                                                } else {
+                                                    layer.alert(result.code + result.Message, { icon: 5 });
+                                                }
+                                            },
+                                            error: function () {
+                                                layer.alert("鎺ュ彛澶辨晥!", { icon: 5 });
+                                            }
+                                        });
+                                    },
+                                    cancel: function (index, layero) {
+                                        layer.close(index);
+                                        location.reload();
+                                    }
+                                });
+                                
+                            }
+                            else {
+                                $.ajax({
+                                    url: GetWEBURL() + 'Gy_StockCheckItemBill/Get_InventoryAnalysisList',
+                                    type: "GET",
+                                    data: { "sWhere": sWhere, "sID": HItemID },
+                                    success: function (data1) {
+                                        if (data1.count == 1) {
+                                            option1.data = data1.list[0];
+                                            table1.render(option1);
+                                        } else {
+                                            layer.alert(result.code + result.Message, { icon: 5 });
+                                        }
+                                    }, error: function () {
+                                        layer.alert("鎺ュ彛澶辨晥!", { icon: 5 });
+                                    }
+                                });
+                            }
+                        }, error: function () {
+                            layer.alert("鎺ュ彛澶辨晥!", { icon: 5 });
                         }
-                    }, error: function () {
-                        layer.alert("鎺ュ彛澶辨晥!", { icon: 5 });
-                    }
-                });
+                    });
+                    
+                }
+                else {
+                    layer.msg("璇烽�夋嫨鐩樼偣鏂规");
+                    return;
+                }
             });
 
             // 閲嶇疆鎸夐挳
@@ -357,12 +398,45 @@
                             option1.data = data1.list[0];
                             table1.render(option1);
                         } else {
-                            layer.alert(result.code + result.Message, { icon: 5 });
+                            layer.alert(data1.code + data1.Message, { icon: 5 });
                         }
                     }, error: function () {
                         layer.alert("鎺ュ彛澶辨晥!", { icon: 5 });
                     }
                 });
+            });
+
+            //鍒犻櫎鎸夐挳
+            form.on('submit(btnDel)', function (data) {
+                var HItemID = $("#HItemID").val();//鐩樼偣
+                if (HItemID) {
+                    layer.confirm('鏄惁鍒犻櫎鍏朵粬鏃犵敤鐨勫簱瀛橈紵', {
+                        icon: 3,
+                        title: "鎻愮ず",
+                        btn: ['纭畾', '鍙栨秷'],
+                        btn1: function (index) {
+                            $.ajax({
+                                url: GetWEBURL() + 'Gy_StockCheckItemBill/StockItemSubDel',
+                                type: "GET",
+                                anysc: false,
+                                data: { "sID": HItemID },
+                                success: function (data1) {
+                                    if (data1.count == 1) {
+                                        layer.msg(data1.Message, { icon: 1 });
+                                    } else {
+                                        layer.alert(data1.code + data1.Message, { icon: 5 });
+                                    }
+                                }, error: function () {
+                                    layer.alert("鎺ュ彛澶辨晥!", { icon: 5 });
+                                }
+                            })
+                        }
+                    })
+                }
+                else {
+                    layer.msg("璇烽�夋嫨鐩樼偣鏂规");
+                    return;
+                }
             });
 
             //鐩樼偣鏂规寮圭獥
@@ -459,9 +533,8 @@
                 set_InitGrid6();
                 //鍒濆鍖栬〃鏍�(閫�搴�)
                 set_InitGrid7();
-                //鏌ヨ
-                zc_Display();
-
+                //鍒濆鏌ユ甯搁〉绛�
+                //zc_Display();
             }
 
             //鍒濆鍖栬〃鏍�(姝e父)
@@ -476,6 +549,9 @@
                     , limit: 50
                     , limits: [50, 500, 5000, 20000]
                     , cols: [col]
+                    , done: function (res, curr, count) {
+                        soulTable.render(this);
+                    }
                 };
                 option1.data = [];
                 table1.render(option1);
@@ -614,7 +690,7 @@
             }
             //璋冩嫧鏌ヨ
             function db_Display() {
-                var sWhere = " HRealPotType=HBookPotType and HRealPotType='浠撳簱' and HRealPot!=HBookPot";
+                var sWhere = " HRealPotType=HBookPotType and HRealPotType=''浠撳簱'' and HRealPot!=HBookPot";
                 var HItemID = $("#HItemID").val();//鐩樼偣
                 //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛�
                 $.ajax({
@@ -635,8 +711,9 @@
             }
             //鍑哄簱鏌ヨ
             function ck_Display() {
-                var sWhere = " HBookPotType='浠撳簱' and isnull(HBookPot,'')!='' and (HRealPotType='渚涘簲鍟�' or HRealPotType='瀹㈡埛') and isnull(HRealPot,'')!=''";
+                var sWhere = " HBookPotType=''浠撳簱'' and isnull(HBookPot,'''')!='''' and (HRealPotType=''渚涘簲鍟�'' or HRealPotType=''瀹㈡埛'') and isnull(HRealPot,'''')!=''''";
                 var HItemID = $("#HItemID").val();//鍗曟嵁绫诲瀷
+                
                 //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛�
                 $.ajax({
                     url: GetWEBURL() + 'Gy_StockCheckItemBill/Get_InventoryAnalysisList',
@@ -656,8 +733,9 @@
             }
             //鍏ュ簱鏌ヨ
             function rk_Display() {
-                var sWhere = " (HRealPotType='渚涘簲鍟�' or HRealPotType='瀹㈡埛') and (HBookPotType='渚涘簲鍟�' or HBookPotType='瀹㈡埛') and HRealPot!=HBookPot";
+                var sWhere = " (HRealPotType=''渚涘簲鍟�'' or HRealPotType=''瀹㈡埛'') and (HBookPotType=''渚涘簲鍟�'' or HBookPotType=''瀹㈡埛'') and HRealPot!=HBookPot";
                 var HItemID = $("#HItemID").val();//鍗曟嵁绫诲瀷
+                
                 //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛�
                 $.ajax({
                     url: GetWEBURL() + 'Gy_StockCheckItemBill/Get_InventoryAnalysisList',
@@ -677,8 +755,9 @@
             }
             //鐩樼泩鏌ヨ
             function py_Display() {
-                var sWhere = "isnull(HBookPot,'')='' and isnull(HRealPot,'')!=''";
+                var sWhere = "py";
                 var HItemID = $("#HItemID").val();//鍗曟嵁绫诲瀷
+               
                 //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛�
                 $.ajax({
                     url: GetWEBURL() + 'Gy_StockCheckItemBill/Get_InventoryAnalysisList',
@@ -698,8 +777,9 @@
             }
             //鐩樹簭鏌ヨ
             function pk_Display() {
-                var sWhere = "isnull(HBookPot,'')!='' and isnull(HRealPot,'')=''";
+                var sWhere = "pk";
                 var HItemID = $("#HItemID").val();//鍗曟嵁绫诲瀷
+                
                 //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛�
                 $.ajax({
                     url: GetWEBURL() + 'Gy_StockCheckItemBill/Get_InventoryAnalysisList',
@@ -719,8 +799,9 @@
             }
             //閫�搴撴煡璇�
             function tk_Display() {
-                var sWhere = " HRealPotType='浠撳簱' and isnull(HRealPot,'')!='' and  (HBookPotType='渚涘簲鍟�' or HBookPotType='瀹㈡埛')";
+                var sWhere = " HRealPotType=''浠撳簱'' and isnull(HRealPot,'''')!='''' and  (HBookPotType=''渚涘簲鍟�'' or HBookPotType=''瀹㈡埛'')";
                 var HItemID = $("#HItemID").val();//鍗曟嵁绫诲瀷
+                
                 //杩涘叆椤甸潰鏄剧ず鐨勭紦瀛樺垪琛�
                 $.ajax({
                     url: GetWEBURL() + 'Gy_StockCheckItemBill/Get_InventoryAnalysisList',
@@ -740,14 +821,13 @@
             }
             //#endregion
 
-
             //#region 瀹℃牳
             //瀹℃牳 璋冩嫧
             function set_CheckBill2() {
                 var checkStatus = table.checkStatus('mainTable2')
                     , data = checkStatus.data;
                 if (checkStatus.data.length >= 1) {
-                    var sSubStr = JSON.stringify(data) + ";" + sessionStorage["HUserName"] + ";" + sessionStorage["OrganizationID"];
+                    var sSubStr = JSON.stringify(data) + ";" + sessionStorage["HUserName"] + ";" + sessionStorage["OrganizationID"] + ";" + $("#HName").val();
                     $('#btn-Check2').addClass("layui-btn-disabled").attr("disabled", true);
                     $.ajax({
                         type: "POST",
@@ -782,7 +862,7 @@
                 var checkStatus = table.checkStatus('mainTable3')
                     , data = checkStatus.data;
                 if (checkStatus.data.length >= 1) {
-                    var sSubStr = JSON.stringify(data) + ";" + sessionStorage["HUserName"] + ";" + sessionStorage["OrganizationID"];
+                    var sSubStr = JSON.stringify(data) + ";" + sessionStorage["HUserName"] + ";" + sessionStorage["OrganizationID"] + ";" + $("#HName").val();
                     $('#btn-Check3').addClass("layui-btn-disabled").attr("disabled", true);
                     $.ajax({
                         type: "POST",
@@ -816,7 +896,7 @@
                 var checkStatus = table.checkStatus('mainTable4')
                     , data = checkStatus.data;
                 if (checkStatus.data.length >= 1) {
-                    var sSubStr = JSON.stringify(data) + ";" + sessionStorage["HUserName"] + ";" + sessionStorage["OrganizationID"];
+                    var sSubStr = JSON.stringify(data) + ";" + sessionStorage["HUserName"] + ";" + sessionStorage["OrganizationID"] + ";" + $("#HName").val();
                     $('#btn-Check4').addClass("layui-btn-disabled").attr("disabled", true);
                     $.ajax({
                         type: "POST",
@@ -850,7 +930,7 @@
                 var checkStatus = table.checkStatus('mainTable5')
                     , data = checkStatus.data;
                 if (checkStatus.data.length >= 1) {
-                    var sSubStr = JSON.stringify(data) + ";" + sessionStorage["HUserName"] + ";" + sessionStorage["OrganizationID"];
+                    var sSubStr = JSON.stringify(data) + ";" + sessionStorage["HUserName"] + ";" + sessionStorage["OrganizationID"] + ";" + $("#HName").val();
                     $('#btn-Check5').addClass("layui-btn-disabled").attr("disabled", true);
                      $.ajax({
                          type: "POST",
@@ -884,7 +964,7 @@
                 var checkStatus = table.checkStatus('mainTable6')
                     , data = checkStatus.data;
                 if (checkStatus.data.length >= 1) {
-                    var sSubStr = JSON.stringify(data) + ";" + sessionStorage["HUserName"] + ";" + sessionStorage["OrganizationID"];
+                    var sSubStr = JSON.stringify(data) + ";" + sessionStorage["HUserName"] + ";" + sessionStorage["OrganizationID"] + ";" + $("#HName").val();
                     $('#btn-Check6').addClass("layui-btn-disabled").attr("disabled", true);
                     $.ajax({
                         type: "POST",
@@ -918,7 +998,7 @@
                 var checkStatus = table.checkStatus('mainTable7')
                     , data = checkStatus.data;
                 if (checkStatus.data.length >= 1) {
-                    var sSubStr = JSON.stringify(data) + ";" + sessionStorage["HUserName"] + ";" + sessionStorage["OrganizationID"];
+                    var sSubStr = JSON.stringify(data) + ";" + sessionStorage["HUserName"] + ";" + sessionStorage["OrganizationID"] + ";" + $("#HName").val();
                     $('#btn-Check7').addClass("layui-btn-disabled").attr("disabled", true);
                     $.ajax({
                         type: "POST",

--
Gitblit v1.9.1