From 150251c70dee8e1e3c28b09ae1c928cdf5097ed5 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期三, 28 九月 2022 14:08:44 +0800
Subject: [PATCH] 添加隐藏列功能(采购订单维护,委外订单维护,委外用料单维护,收料通知单维护,退料通知单维护,采购入库单维护,采购退料单维护,生产计划平台,生产日计划查询,车间仓库对照列表,考勤汇报单维护)

---
 WebTM/views/采购管理/委外订单/WW_EntrustOrderBillList.html |  147 +++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 136 insertions(+), 11 deletions(-)

diff --git "a/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\345\247\224\345\244\226\350\256\242\345\215\225/WW_EntrustOrderBillList.html" "b/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\345\247\224\345\244\226\350\256\242\345\215\225/WW_EntrustOrderBillList.html"
index 5f832d2..0742709 100644
--- "a/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\345\247\224\345\244\226\350\256\242\345\215\225/WW_EntrustOrderBillList.html"
+++ "b/WebTM/views/\351\207\207\350\264\255\347\256\241\347\220\206/\345\247\224\345\244\226\350\256\242\345\215\225/WW_EntrustOrderBillList.html"
@@ -163,6 +163,7 @@
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-back" id="btn_back"><i class="layui-icon layui-icon-close-fill"></i>椹冲洖</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-details"><i class="layui-icon layui-icon-form"></i>璇︽儏</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-generate"><i class="layui-icon layui-icon-file"></i>鐢熸垚閫佽揣鍗�</button>-->
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-return"></i>閫�鍑�</button>
                                 <!--<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnResCnz" id="btnReSearch" style="padding:0 5px">閲嶆柊鍚屾</button>-->
 
@@ -193,6 +194,7 @@
             var sWhere = "";
             var option = [];
             var Name = "MouldProdInHouseCellWidth";
+            var HModName = "WW_EntrustOrderBillList";
             //#endregion
 
             //#region 杩涘叆椤甸潰鏃㈠姞杞�
@@ -236,6 +238,9 @@
                     case 'btn-yxj': set_Yxj();
                         break;
                     case 'btn-back': set_Back();
+                        break;
+                    //鍒楄缃�
+                    case 'set_HideColumn': get_HideColumn();
                         break;
                 };
             });
@@ -298,6 +303,8 @@
                 get_FastQuery(table, option)
                 //鍔犺浇涓氬姟鍛�
                 get_HEmpName();
+                //闅愯棌鍕鹃�夊瓧娈�
+                DisPlay_HideColumn();
             }
             //鍒濆鍖栬〃鏍�
             function set_InitGrid() {
@@ -331,33 +338,33 @@
                     , { field: '瑙勬牸鍨嬪彿', title: '瑙勬牸鍨嬪彿', width: 100 }
                     , { field: '鎵瑰彿', title: '鎵瑰彿', width: 100 }
                     , { field: '婧愬崟鍗曞彿', title: '婧愬崟鍗曞彿', width: 100 }
-                    , { field: '渚涘簲鍟嗕唬鐮�', title: '渚涘簲鍟嗕唬鐮�', width: 120, hide: true}
-                    , { field: '涓氬姟鍛樹唬鐮�', title: '涓氬姟鍛樹唬鐮�', width: 100, hide: true }
-                    , { field: 'HPriority', title: 'HPriority', width: 100, hide: true }
+                    //, { field: '渚涘簲鍟嗕唬鐮�', title: '渚涘簲鍟嗕唬鐮�', width: 120, hide: true}
+                    //, { field: '涓氬姟鍛樹唬鐮�', title: '涓氬姟鍛樹唬鐮�', width: 100, hide: true }
+                    //, { field: 'HPriority', title: 'HPriority', width: 100, hide: true }
                     , { field: '浼樺厛绾�', title: '浼樺厛绾�', width: 100 }
                     , { field: '浜よ揣鍦扮偣', title: '浜よ揣鍦扮偣', width: 100 }
-                    , { field: 'HPSStyleID', title: 'HPSStyleID', hide: true }
+                    //, { field: 'HPSStyleID', title: 'HPSStyleID', hide: true }
                     , { field: '閲囪喘鏂瑰紡浠g爜', title: '閲囪喘鏂瑰紡浠g爜', width: 120 }
                     , { field: '閲囪喘鏂瑰紡', title: '閲囪喘鏂瑰紡', width: 100 }
-                    , { field: 'HSSID', title: 'HSSID', hide: true }
+                    //, { field: 'HSSID', title: 'HSSID', hide: true }
                     , { field: '缁撶畻鏂瑰紡浠g爜', title: '缁撶畻鏂瑰紡浠g爜', width: 120 }
                     , { field: '缁撶畻鏂瑰紡', title: '缁撶畻鏂瑰紡', width: 100 }
                     , { field: '缁撶畻鏃ユ湡', title: '缁撶畻鏃ユ湡', width: 120, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.缁撶畻鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
-                    , { field: 'HCurID', title: 'HCurID', hide: true }
+                    //, { field: 'HCurID', title: 'HCurID', hide: true }
                     , { field: '甯佸埆浠g爜', title: '甯佸埆浠g爜', width: 100 }
                     , { field: '甯佸埆', title: '甯佸埆', width: 100 }
                     , { field: '姹囩巼', title: '姹囩巼', width: 100 }
-                    , { field: 'HDeptID', title: 'HDeptID', hide: true }
+                    //, { field: 'HDeptID', title: 'HDeptID', hide: true }
                     , { field: '閮ㄩ棬浠g爜', title: '閮ㄩ棬浠g爜', width: 100 }
                     , { field: '閮ㄩ棬', title: '閮ㄩ棬', width: 100 }
-                    , { field: 'HManagerID', title: 'HManagerID', hide: true }
+                    //, { field: 'HManagerID', title: 'HManagerID', hide: true }
                     , { field: '涓荤浠g爜', title: '涓荤浠g爜', width: 100 }
                     , { field: '涓荤', title: '涓荤', width: 100 }
-                    , { field: 'HEmpID', title: 'HEmpID', hide: true }
+                    //, { field: 'HEmpID', title: 'HEmpID', hide: true }
                     , { field: '鎽樿', title: '鎽樿', width: 100 }
                     , { field: '琛ㄥご澶囨敞', title: '琛ㄥご澶囨敞', width: 100 }
-                    , { field: 'hsubid', title: 'hsubid', hide: true }
-                    , { field: 'HMaterID', title: 'HMaterID', hide: true }
+                    //, { field: 'hsubid', title: 'hsubid', hide: true }
+                    //, { field: 'HMaterID', title: 'HMaterID', hide: true }
                     , { field: '鍗曚环', title: '鍗曚环', width: 100 }
                     , { field: '閲戦', title: '閲戦', width: 100 }
                     , { field: '绋庣巼', title: '绋庣巼', width: 100 }
@@ -1103,6 +1110,124 @@
                     }
                 })
             }
+
+            //闅愯棌鍒楄缃�
+            function get_HideColumn() {
+                var colName = "";
+                var contentUrl = "";
+                for (var i = 1; i < option.cols[0].length - 1; i++) {
+                    colName += option.cols[0][i]["title"] + ",";
+                }
+                var urlStr = window.document.location.pathname;//鑾峰彇鏂囦欢璺緞
+                var urlLen = urlStr.split('/');
+                for (var i = 0; i < urlLen.length - 4; i++) {
+                    contentUrl += "../";
+                }
+                colName = encodeURI(colName.substring(0, colName.length - 1));//瀵� URI 杩涜缂栫爜
+
+                contentUrl += '鍩虹璧勬枡/闅愯棌鍒楄缃�/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName;
+
+                layer.open({
+                    type: 2
+                    , skin: "layui-layer-rim" //鍔犱笂杈规
+                    , title: "闅愯棌鍒楄缃�"  //鏍囬
+                    , closeBtn: 1  //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+                    , shift: 2 //寮瑰嚭鍔ㄧ敾
+                    , area: ["50%", "90%"] //绐椾綋澶у皬
+                    , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                    , content: [contentUrl, "yes"]
+                    , btn: ["纭畾", "鍙栨秷"]
+                    , btn1: function (index, laero) {
+                        //鍒锋柊琛ㄦ牸鏁版嵁
+                        DisPlay_HideColumn();
+                        //鏇存柊琛ㄦ牸缂撳瓨鐨勬暟鎹�
+                        layer.close(index);//鍏抽棴寮圭獥
+                    }
+                })
+            }
+
+            //鏄剧ず鍒楁暟鎹�
+            function DisPlay_HideColumn() {
+                $.ajax({
+                    url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
+                    type: "GET",
+                    data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
+                    success: function (data1) {
+                        if (data1.data.length != 0) {
+
+
+                            var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
+                            var titleData = ["hmainid", "HBillType", "HSupID", "涓氬姟鐘舵��", "HUnitID", "渚涘簲鍟嗕唬鐮�", "涓氬姟鍛樹唬鐮�", "HPriority", "HPSStyleID", "HSSID", "HCurID", "HDeptID", "HManagerID", "HEmpID", "hsubid","HMaterID"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+
+                            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 (dataCols[3] > 0) {
+                                    option.cols[0][i + 1]["width"] = dataCols[3];
+                                }
+                                //璁剧疆鍐呭瀛椾綋澶у皬
+                                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 (data1.data[0].HColumnWidth != 0) {
+                                //    option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;";
+                                //} else {
+                                //    option.cols[0][i + 1]["width"] = "";
+                                //}
+                                //鏄剧ず鍒�
+                                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;
+                                }
+                            }
+
+                            //鍙栨秷鍐荤粨鍒�
+                            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 });
+                    }
+                })
+            }
             //浠ヤ笂鏄痩ayui妯″潡
         });
     </script>

--
Gitblit v1.9.1