From c19da196eb158700931633899c3aecb9d232a2ce Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期五, 16 九月 2022 14:01:43 +0800
Subject: [PATCH] 隐藏列功能(工艺路线模块、生产订单模块)bug修复

---
 WebTM/views/计划管理/工艺路线/Gy_RoutingBill.html |  135 +++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 130 insertions(+), 5 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_RoutingBill.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_RoutingBill.html"
index dac8543..cf4c460 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_RoutingBill.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_RoutingBill.html"
@@ -368,6 +368,7 @@
                         <div class="layui-btn-container">
                             <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>澧炲姞涓�琛�</button>
                             <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="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>
                         </div>
                     </script>
                 </form>
@@ -458,10 +459,13 @@
                 , "HICMOReadyTimes": 0, "HAutoTrunFlag": false, "HTechnologyParameter": "", "HPicNum": "", "HProcCheckNote": ""
                 , "HProcWorkNum": ""
             }];
-
+            var HModName = "Sc_MouldDotCheckBillList";
             //#endregion
 
             //#region 杩涘叆椤甸潰鍗冲姞杞�
+
+            //鍒濆鍖栬〃鏍�
+            DisPlay_HideColumn();
 
             //鍒跺崟浜�
             $("#HMaker").val(sessionStorage["HUserName"]);
@@ -517,7 +521,7 @@
                     , { field: 'HProcID_S', title: '宸ユ', edit: 'text' }
                     , { field: 'HProcType', title: '宸ュ簭绫诲瀷', templet: '#HProcType' }//閫夋嫨
                     , { field: 'HCenterID_SName', title: '浜х嚎涓績', edit: 'text', event: "CheckHCenterID_S" }//f7
-                    , { field: 'HCenterID_S', title: '浜х嚎涓績id', hide: true }//hide: true
+                    //, { field: 'HCenterID_S', title: '浜х嚎涓績id', hide: true }//hide: true
                     , { field: 'HWorkQty_S', title: '浜х嚎浜ц兘', edit: 'text' }
                     , { field: 'HSubStdEmpQty_S', title: '浜х嚎浜烘暟', edit: 'text' }
                     , { field: 'HMouldNo', title: '妯″叿缂栧彿', edit: 'text' }
@@ -528,11 +532,11 @@
                     , { field: 'HMyWorkDays', title: '鐢熶骇鍛ㄦ湡', edit: 'text' }
                     , { field: 'HMyFixWorkDays', title: '鍥哄畾鐢熶骇澶╂暟', edit: 'text' }
                     , { field: '宸ュ簭', title: '宸ュ簭', edit: 'text', event: "CheckHProcID" }//f7
-                    , { field: 'HProcID', title: '宸ュ簭ID', hide: true }//, hide: true
+                    //, { field: 'HProcID', title: '宸ュ簭ID', hide: true }//, hide: true
                     , { field: '宸ヤ綔涓績浠g爜', title: '宸ヤ綔涓績浠g爜' }//涓嶅~
-                    , { field: 'HCenterID', title: '宸ヤ綔涓績id', hide: true }//, hide: true
+                    //, { field: 'HCenterID', title: '宸ヤ綔涓績id', hide: true }//, hide: true
                     , { field: '宸ヤ綔涓績', title: '宸ヤ綔涓績', edit: 'text', event: "CheckHCenterID" }//f7
-                    , { field: 'HSupID', title: '渚涘簲鍟咺D', hide: true }
+                    //, { field: 'HSupID', title: '渚涘簲鍟咺D', hide: true }
                     , { field: '渚涘簲鍟嗕唬鐮�', title: '渚涘簲鍟嗕唬鐮�' }
                     , { field: '渚涘簲鍟�', title: '渚涘簲鍟�', edit: 'text', width: 110, event: "CheckHSupID" }//f7
                     , { field: 'HSupFlag', title: '澶栧崗鏍囪', templet: "#HSupFlag" }//checkbox
@@ -795,6 +799,10 @@
                             form.render('select');
                             form.render('checkbox');
                         }
+                        break;
+                    //鍒楄缃�
+                    case 'set_HideColumn':
+                        get_HideColumn();
                         break;
                 }
             });
@@ -1516,6 +1524,123 @@
 
             }
 
+            //闅愯棌鍒楄缃�
+            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
 
         });

--
Gitblit v1.9.1