From 0290fa42118f5753849650b98f4d858f33d1cfba Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期一, 26 九月 2022 12:59:24 +0800
Subject: [PATCH] 工艺路线编辑及列表模块,生产订单列表模块,工序流转单编辑及列表模块。增加隐藏列功能

---
 WebTM/views/车间管理/工序流转卡/Sc_ProcessExchangeIssueBillList.html |    2 
 WebTM/views/计划管理/工艺路线/Gy_RoutingBillimport.html             |  132 ++++++++++++++++++++++++++
 WebTM/views/计划管理/工艺路线大类/Gy_RoutingGroupList.html            |  127 ++++++++++++++++++++++++
 WebTM/views/车间管理/工序流转卡/Sc_ProcessExchangeBillList.html      |    2 
 WebTM/views/车间管理/工序流转卡/Sc_ProcessExchangeBill.html          |    4 
 5 files changed, 259 insertions(+), 8 deletions(-)

diff --git "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillimport.html" "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillimport.html"
index ae5c1c7..b552835 100644
--- "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillimport.html"
+++ "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277/Gy_RoutingBillimport.html"
@@ -73,6 +73,7 @@
                         <script type="text/html" id="toolbarDemo">
                             <div class="layui-btn-container">
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></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>
@@ -104,14 +105,24 @@
             , tree = layui.tree
             , util = layui.util
             , upload = layui.upload
+
+        var HModName = "Gy_RoutingBillimport";
         //#endregion
 
         //#region 杩涘叆椤甸潰鍗冲姞杞�
 
         //鍒濆鍖栫晫闈�
         set_ClearBill();
-
         //#endregion
+
+        //#region 澶村伐鍏锋爮浜嬩欢
+        table.on('toolbar(mainTable)', function (obj) {
+            switch (obj.event) {
+                //鍒楄缃�
+                case 'set_HideColumn': get_HideColumn();
+                    break;
+            };
+        });
 
         //#region 瑙﹀彂浜嬩欢锛氬寘鎷琭orm.on(){}鏍煎紡鐨勬墍鏈夌偣鍑讳簨浠躲�侀�夋嫨浜嬩欢绛�
 
@@ -265,6 +276,7 @@
 
             //娓叉煋椤甸潰
             table.render(option);
+            DisPlay_HideColumn();
         }
 
         //瀵煎叆(淇濆瓨)
@@ -308,6 +320,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 = ["鍗曟嵁ID", "HMouldID", "hsubid", "HManagerID", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+
+                        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 });
+                }
+            })
+        }
+
         //#endregion
         //浠ヤ笂鏄痩ayui妯″潡
     });
diff --git "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277\345\244\247\347\261\273/Gy_RoutingGroupList.html" "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277\345\244\247\347\261\273/Gy_RoutingGroupList.html"
index a49b785..32dacd6 100644
--- "a/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277\345\244\247\347\261\273/Gy_RoutingGroupList.html"
+++ "b/WebTM/views/\350\256\241\345\210\222\347\256\241\347\220\206/\345\267\245\350\211\272\350\267\257\347\272\277\345\244\247\347\261\273/Gy_RoutingGroupList.html"
@@ -50,6 +50,7 @@
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeAudit"><i class="layui-icon layui-icon-circle"></i>鍙嶅鏍�</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-view"><i class="layui-icon layui-icon-tips"></i>棰勮</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></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>
@@ -76,6 +77,7 @@
                 , laydate = layui.laydate
             var sWhere = "";
             var option = [];
+            var HModName = "Gy_RoutingGroupList";
             //#endregion
 
             //#region 杩涘叆椤甸潰鍗冲姞杞�
@@ -107,6 +109,9 @@
                         break;
                     //閫�鍑烘寜閽�
                     case 'get_Exit': Pub_Close(2);
+                        break;
+                    //鍒楄缃�
+                    case 'set_HideColumn': get_HideColumn();
                         break;
                 };
             });
@@ -183,6 +188,7 @@
                         if (data1.count == 1) {
                             option.data = data1.data;
                             table.render(option);
+                            DisPlay_HideColumn();
                             layer.close(ajaxLoad);
                             //layer.alert("鏌ヨ鎴愬姛", { icon: 1 });
                         } else {
@@ -298,13 +304,128 @@
             }
             //#endregion
 
+            //闅愯棌鍒楄缃�
+            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 = ["鍗曟嵁ID", "HMouldID", "hsubid", "HManagerID", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+
+                            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 });
+                    }
+                })
+            }
+
             //#endregion
 
             //浠ヤ笂鏄痩ayui妯″潡
         });
-
-
-
 
     </script>
 </body>
diff --git "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\346\265\201\350\275\254\345\215\241/Sc_ProcessExchangeBill.html" "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\346\265\201\350\275\254\345\215\241/Sc_ProcessExchangeBill.html"
index 3985c74..bdecb82 100644
--- "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\346\265\201\350\275\254\345\215\241/Sc_ProcessExchangeBill.html"
+++ "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\346\265\201\350\275\254\345\215\241/Sc_ProcessExchangeBill.html"
@@ -55,8 +55,8 @@
                         <div class="layui-btn-group">
                             <button type="button" id="set_SaveBill" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="btnSave">淇濆瓨</button>
                             <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Cancel">閫�鍑�</button>
-                            <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="HideColumn" id="HideColumn">闅愯棌鍒楄缃�</button>
                             <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="btn_print">鎵撳嵃</button>
+                            <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="HideColumn" id="HideColumn">闅愯棌鍒楄缃�</button>
                         </div>
                     </div>
                     <div class="layui-tab" lay-filter="tab-POStockInBill">
@@ -1604,7 +1604,7 @@
 
 
                             var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
-                            var titleData = ["HProcID", "HCenterID", "HDeptID", "HSupID"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+                            var titleData = ["宸ュ簭ID", "宸ヤ綔涓績ID","閮ㄩ棬ID","渚涘簲鍟咺D"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
 
                             dataCol = data1.data[0].HGridString.split(',');
 
diff --git "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\346\265\201\350\275\254\345\215\241/Sc_ProcessExchangeBillList.html" "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\346\265\201\350\275\254\345\215\241/Sc_ProcessExchangeBillList.html"
index e66b69e..88f0b38 100644
--- "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\346\265\201\350\275\254\345\215\241/Sc_ProcessExchangeBillList.html"
+++ "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\346\265\201\350\275\254\345\215\241/Sc_ProcessExchangeBillList.html"
@@ -648,7 +648,7 @@
 
 
                             var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
-                            var titleData = ["HMaterID", "HUnitID", "HICMOEmpID"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+                            var titleData = ["hmainid", "hicmointerid", "HWorkShopID", "HDeptID", "HMaterID", "HMaterID2", "HUnitID", "HBillType", "hsubid"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
 
                             dataCol = data1.data[0].HGridString.split(',');
 
diff --git "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\346\265\201\350\275\254\345\215\241/Sc_ProcessExchangeIssueBillList.html" "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\346\265\201\350\275\254\345\215\241/Sc_ProcessExchangeIssueBillList.html"
index 3147a89..c467ca5 100644
--- "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\346\265\201\350\275\254\345\215\241/Sc_ProcessExchangeIssueBillList.html"
+++ "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\346\265\201\350\275\254\345\215\241/Sc_ProcessExchangeIssueBillList.html"
@@ -437,7 +437,7 @@
 
 
                             var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
-                            var titleData = ["HMaterID", "HUnitID", "HICMOEmpID"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+                            var titleData = ["hmainid", "HEntryID", "hicmointerid", "HWorkShopID", "HDeptID", "HProcID", "HMaterID", "HMaterID2", "HUnitID", "HBillType", "hsubid"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
 
                             dataCol = data1.data[0].HGridString.split(',');
 

--
Gitblit v1.9.1