From 306a5bb459d13ded4bc4772a3da0a4c88bb27701 Mon Sep 17 00:00:00 2001
From: pzy <2829717936@qq.com>
Date: 星期一, 26 八月 2024 15:19:21 +0800
Subject: [PATCH] 1

---
 WebTM/views/采购管理/询价单/Sup_AskPriceBillEdit.html |  119 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 116 insertions(+), 3 deletions(-)

diff --git "a/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\350\257\242\344\273\267\345\215\225/Sup_AskPriceBillEdit.html" "b/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\350\257\242\344\273\267\345\215\225/Sup_AskPriceBillEdit.html"
index c1e7e19..c4ce325 100644
--- "a/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\350\257\242\344\273\267\345\215\225/Sup_AskPriceBillEdit.html"
+++ "b/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\350\257\242\344\273\267\345\215\225/Sup_AskPriceBillEdit.html"
@@ -248,6 +248,7 @@
                             <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>澶嶅埗涓�琛�</button>
                             <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Inventory" id="get_Inventory"><i class="layui-icon layui-icon-form"></i>搴撳瓨鏌ヨ</button>
                             <button type="button" class="layui-btn layui-btn-sm" lay-event="get_InOutSum" id="get_InOutSum"><i class="layui-icon layui-icon-form"></i>鍑哄叆搴撹褰曟煡璇�</button>
+                            <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>
                         </div>
                     </script>
                 </form>
@@ -277,7 +278,7 @@
         var option;
 
         //#endregion
-
+        HModName = 'Sup_AskPriceBillEdit'
         //#region 杩涘叆椤甸潰鍗冲姞杞�
 
         //#region 銆愬姩鎬佽幏鍙栨ā鍧楀悕绉般��
@@ -362,6 +363,10 @@
                     break;
                 //鍑哄叆搴撹褰曟煡璇�
                 case 'get_InOutSum': get_InOutSum();
+                    break;
+                //鍒楄缃�
+                case 'set_HideColumn':
+                    get_HideColumn();
                     break;
             }
         });
@@ -665,7 +670,7 @@
             //琛ㄥご
             columns = [ //琛ㄥご
                 { type: 'checkbox', totalRowText: '鍚堣琛�' }
-                , { type: 'numbers', title: '搴忓彿', totalRow: true }
+                , { type: 'numbers', field: '搴忓彿', title: '搴忓彿', totalRow: true }
                 , { field: 'HMaterID', title: '鐗╂枡ID', hide: true }
                 , { field: 'HMaterNumber', title: '鐗╂枡浠g爜', edit: 'text', event: "HMaterID", width: 165 }
                 , { field: 'HMaterName', title: '鐗╂枡鍚嶇О', width: 220 }
@@ -679,7 +684,7 @@
                 , { field: 'HCarryType', title: '杩愯緭鏂瑰紡', edit: 'text', width: 120 }
                 , { field: 'HAddress', title: '浜よ揣鍦扮偣', edit: 'text', width: 120 }
                 , { field: 'HRemark', title: '澶囨敞', edit: 'text' }
-                , { fixed: 'right', title: '鎿嶄綔', toolbar: '#barDemo', width: 65 }
+                , { fixed: 'right', field: '鎿嶄綔', title: '鎿嶄綔', toolbar: '#barDemo', width: 65 }
             ];
             option = {
                 id: 'mainTable'
@@ -711,6 +716,7 @@
             }];
             table.render(option);
 
+            DisPlay_HideColumn();
         }
 
 
@@ -827,7 +833,114 @@
             }
         }
             //#endregion
+        //#region 鍒楄缃�
+        //闅愯棌鍒楄缃�
+        function get_HideColumn() {
+            var colName = "";
+            for (var i = 1; i < option.cols[0].length - 1; i++) {
+                colName += option.cols[0][i]["field"] + ",";
+            }
 
+            colName = encodeURI(colName.substring(0, colName.length - 1));//瀵� URI 杩涜缂栫爜
+            layer.open({
+                type: 2
+                , skin: "layui-layer-rim" //鍔犱笂杈规
+                , title: "闅愯棌鍒楄缃�"  //鏍囬
+                , closeBtn: 1  //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+                , shift: 2 //寮瑰嚭鍔ㄧ敾
+                , area: ["50%", "90%"] //绐椾綋澶у皬
+                , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                , content: ['../../鍩虹璧勬枡/闅愯棌鍒楄缃�/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName, "yes"]
+                , btn: ["纭畾", "鍙栨秷"]
+                , btn1: function (index, laero) {
+                    //鍒锋柊琛ㄦ牸鏁版嵁
+                    DisPlay_HideColumn();
+                    //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                    layer.close(index);//鍏抽棴寮圭獥
+                }
+            })
+        }
+
+        //鏄剧ず鍒楁暟鎹�
+        function DisPlay_HideColumn() {
+            $.ajax({
+                url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
+                type: "GET",
+                async: false,
+                data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
+                success: function (data1) {
+                    if (data1.data.length != 0) {
+
+                        var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
+                        var titleData = [];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+
+                        dataCol = data1.data[0].HGridString.split(',');
+
+                        for (var i = 0; i < option.cols[0].length - 2; i++) {
+                            var dataCols = dataCol[i].split('|');
+                            //闅愯棌鍒�
+                            if (dataCols[1] == 1) {
+                                option.cols[0][i + 1]["hide"] = true;
+                            }
+                            //璁剧疆鍐呭瀛椾綋澶у皬
+                            if (data1.data[0].HFontSize != 0) {
+                                option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
+                            } else {
+                                option.cols[0][i + 1]["style"] = "font-size:100%";
+                            }
+                            //璁剧疆鍒楀
+                            if (dataCols[3] > 0) {
+                                option.cols[0][i + 1]["width"] = dataCols[3];
+                            }
+                            //鏄剧ず鍒�
+                            if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
+                                option.cols[0][i + 1]["hide"] = false;
+                            }
+                            //瀛椾綋鎵�鍦ㄤ綅缃�(宸� 灞呬腑 鍙�)
+                            switch (dataCols[2]) {
+                                case "L":
+                                    option.cols[0][i + 1]["align"] = "left";
+                                    break;
+                                case "M":
+                                    option.cols[0][i + 1]["align"] = "center";
+                                    break;
+                                case "R":
+                                    option.cols[0][i + 1]["align"] = "right";
+                                    break;
+                            }
+                            //璁剧疆琛ㄦ牸title灞炴�ф樉绀哄埆鍚�
+                            if (dataCols[4] != null && dataCols[4] != "") {
+                                option.cols[0][i + 1]["title"] = dataCols[4];
+                            }
+                        }
+                        //鍙栨秷鍐荤粨鍒�
+                        for (var i = 1; i < option.cols[0].length - 1; i++) {
+                            if (option.cols[0][i]["fixed"] != null) {
+                                option.cols[0][i]["fixed"] = null;
+                            }
+                            else {
+                                break;
+                            }
+                        }
+                        //鍐荤粨鍒�
+                        if (data1.data[0].HFixCols != 0) {
+                            for (var i = 0; i < data1.data[0].HFixCols; i++) {
+                                if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
+                                    data1.data[0].HFixCols += 1;
+                                }
+                                option.cols[0][i + 1]["fixed"] = "left";
+                            }
+                        }
+                        table.render(option);
+                    } else {
+                        table.render(option);
+                    }
+                }, error: function () {
+                    layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                }
+            })
+        }
+            //#endregion
         //缂栬緫 椤甸潰璧嬪��
         function RoadBillMain(linterid)//鍔犺浇琛ㄥご
         {

--
Gitblit v1.9.1