From be7d738131c8cf9c8e00c6abfde469f2d82cbfb0 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期五, 15 三月 2024 16:48:45 +0800
Subject: [PATCH] 1

---
 WebTM/views/质量管理/检验方案单/QC_CheckProjectList.html |  190 ++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 162 insertions(+), 28 deletions(-)

diff --git "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\346\243\200\351\252\214\346\226\271\346\241\210\345\215\225/QC_CheckProjectList.html" "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\346\243\200\351\252\214\346\226\271\346\241\210\345\215\225/QC_CheckProjectList.html"
index 9e53797..161144c 100644
--- "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\346\243\200\351\252\214\346\226\271\346\241\210\345\215\225/QC_CheckProjectList.html"
+++ "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\346\243\200\351\252\214\346\226\271\346\241\210\345\215\225/QC_CheckProjectList.html"
@@ -9,6 +9,8 @@
     <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>
+
 </head>
 <body>
 
@@ -65,7 +67,7 @@
                             <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add" id="btn-Add" ><i class="layui-icon layui-icon-add-1"></i>鏂板</button>
                             <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit" id="btn-Edit"><i class="layui-icon layui-icon-edit"></i>缂栬緫</button>
                             <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete" id="btn-Delete"><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>
                             <button type="button" class="layui-btn layui-btn-sm" lay-event="btn_Exit" ><i class="layui-icon layui-icon-return"></i>閫�鍑�</button>
                         </div>
                     </script>
@@ -91,7 +93,7 @@
             base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
         }).extend({
             index: 'lib/index' //涓诲叆鍙fā鍧�
-        }).use(['index', 'form', 'laydate', 'code', 'table', 'element', 'layer'], function () {
+        }).use(['index', 'form', 'laydate', 'code', 'table', 'element', 'layer','soulTable'], function () {
             //#region 鍏敤鍙橀噺
             var $ = layui.$
                 , admin = layui.admin
@@ -99,12 +101,19 @@
                 , laydate = layui.laydate
                 , table = layui.table
                 , form = layui.form
+                , soulTable = layui.soulTable
                 , element = layui.element;
+
+
 
             var sWhere = "";
             var option = [];
+            var HModName = "QC_CheckProjectList";
             //#endregion
 
+            //鍒濆鍖栬〃鏍�
+            set_InitGrid();
+            DisPlay_HideColumn();
             //#region 杩涘叆椤甸潰鍗冲姞杞�
 
             //鍒ゆ柇鎿嶄綔绫诲瀷
@@ -137,6 +146,9 @@
                         break;
                     //鍙嶅鏍告寜閽�
                     case 'btn-DeAudit': set_AbandonCheck();
+                        break;
+                    //鍒楄缃�
+                    case 'set_HideColumn': get_HideColumn();
                         break;
                     //閫�鍑烘寜閽�
                     case 'btn_Exit': Pub_Close(1);
@@ -174,37 +186,41 @@
                     , cellMinWidth: 100
                     , height: 'full-50'
                     , page: true
+                    , totalRow: true
                     , limit: 50
                     , limits: [50, 500, 5000, 20000]
+                    , done: function (res, curr, count) {
+                        soulTable.render(this);
+                    }
                     , cols: [[
-                        { type: 'checkbox', fixed: 'left' }
+                        { type: 'checkbox', fixed: 'left', totalRowText: '鍚堣琛�'}
                         , { field: 'hmainid', title: 'hmainid', sort: true, fixed: true, hide: true }
                         , { field: 'hsubid', title: 'hsubid', hide: true }
                         , { field: '鏃ユ湡', title: '鏃ユ湡', sort: true, width: 120, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
                         , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', sort: true, width: 170 }
-                        , { field: '琛ㄥご澶囨敞 ', title: '琛ㄥご澶囨敞', width: 105 }
-                        , { field: '鐗╂枡', title: '鐗╂枡' }
-                        , { field: '鐗╂枡浠g爜', title: '鐗╂枡浠g爜' }
-                        , { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О' }
-                        , { field: '鐗╂枡澶х被浠g爜', title: '鐗╂枡澶х被浠g爜' }
-                        , { field: '鐗╂枡澶х被鍚嶇О', title: '鐗╂枡澶х被鍚嶇О', width: 115 }
-                        , { field: '鍗曚綅浠g爜', title: '鍗曚綅浠g爜', width: 115 }
-                        , { field: '鍗曚綅鍚嶇О', title: '鍗曚綅鍚嶇О' }
-                        , { field: '宸ュ簭浠g爜', title: '宸ュ簭浠g爜', width: 160 }
-                        , { field: '宸ュ簭鍚嶇О', title: '宸ュ簭鍚嶇О', width: 160 }
-                        , { field: '閮ㄩ棬浠g爜', title: '閮ㄩ棬浠g爜', width: 160 }
-                        , { field: '閮ㄩ棬鍚嶇О', title: '閮ㄩ棬鍚嶇О', width: 160 }
-                        , { field: '鍒跺崟浜�', title: '鍒跺崟浜�', width: 160 }
-                        , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡', width: 160, templet: "<div>{{d.鍒跺崟鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍒跺崟鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '瀹℃牳浜�', title: '瀹℃牳浜�', width: 160 }
-                        , { field: '瀹℃牳鏃ユ湡', title: '瀹℃牳鏃ユ湡', width: 160, templet: "<div>{{d.瀹℃牳鏃ユ湡 ==null ?'':layui.util.toDateString(d.瀹℃牳鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '淇敼浜� ', title: '淇敼浜�', width: 215 }
-                        , { field: '淇敼鏃ユ湡 ', title: '淇敼鏃ユ湡 ', width: 115, templet: "<div>{{d.淇敼鏃ユ湡 ==null ?'':layui.util.toDateString(d.淇敼鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '鍏抽棴浜�', title: '鍏抽棴浜�' }
-                        , { field: '鍏抽棴鏃ユ湡	', title: '鍏抽棴鏃ユ湡', width: 100, templet: "<div>{{d.鍏抽棴鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍏抽棴鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '浣滃簾浜�', title: '浣滃簾浜�' }
-                        , { field: '浣滃簾鏃ユ湡', title: '浣滃簾鏃ユ湡', templet: "<div>{{d.浣滃簾鏃ユ湡 ==null ?'':layui.util.toDateString(d.浣滃簾鏃ユ湡, 'yyyy-MM-dd')}}</div>"  }
-                        , { field: '鍗曟嵁绫诲瀷', title: '鍗曟嵁绫诲瀷' }
+                        , { field: '琛ㄥご澶囨敞 ', title: '琛ㄥご澶囨敞', width: 105, sort: true }
+                        , { field: '鐗╂枡', title: '鐗╂枡', sort: true }
+                        , { field: '鐗╂枡浠g爜', title: '鐗╂枡浠g爜', sort: true }
+                        , { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О', sort: true }
+                        , { field: '鐗╂枡澶х被浠g爜', title: '鐗╂枡澶х被浠g爜', sort: true }
+                        , { field: '鐗╂枡澶х被鍚嶇О', title: '鐗╂枡澶х被鍚嶇О', width: 115, sort: true }
+                        , { field: '鍗曚綅浠g爜', title: '鍗曚綅浠g爜', width: 115, sort: true }
+                        , { field: '鍗曚綅鍚嶇О', title: '鍗曚綅鍚嶇О', sort: true }
+                        , { field: '宸ュ簭浠g爜', title: '宸ュ簭浠g爜', width: 160, sort: true }
+                        , { field: '宸ュ簭鍚嶇О', title: '宸ュ簭鍚嶇О', width: 160, sort: true }
+                        , { field: '閮ㄩ棬浠g爜', title: '閮ㄩ棬浠g爜', width: 160, sort: true }
+                        , { field: '閮ㄩ棬鍚嶇О', title: '閮ㄩ棬鍚嶇О', width: 160, sort: true }
+                        , { field: '鍒跺崟浜�', title: '鍒跺崟浜�', width: 160, sort: true }
+                        , { field: '鍒跺崟鏃ユ湡', title: '鍒跺崟鏃ユ湡', width: 160, templet: "<div>{{d.鍒跺崟鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍒跺崟鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '瀹℃牳浜�', title: '瀹℃牳浜�', width: 160, sort: true }
+                        , { field: '瀹℃牳鏃ユ湡', title: '瀹℃牳鏃ユ湡', width: 160, templet: "<div>{{d.瀹℃牳鏃ユ湡 ==null ?'':layui.util.toDateString(d.瀹℃牳鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '淇敼浜� ', title: '淇敼浜�', width: 215, sort: true }
+                        , { field: '淇敼鏃ユ湡 ', title: '淇敼鏃ユ湡 ', width: 115, templet: "<div>{{d.淇敼鏃ユ湡 ==null ?'':layui.util.toDateString(d.淇敼鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '鍏抽棴浜�', title: '鍏抽棴浜�', sort: true }
+                        , { field: '鍏抽棴鏃ユ湡	', title: '鍏抽棴鏃ユ湡', width: 100, templet: "<div>{{d.鍏抽棴鏃ユ湡 ==null ?'':layui.util.toDateString(d.鍏抽棴鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '浣滃簾浜�', title: '浣滃簾浜�', sort: true }
+                        , { field: '浣滃簾鏃ユ湡', title: '浣滃簾鏃ユ湡', templet: "<div>{{d.浣滃簾鏃ユ湡 ==null ?'':layui.util.toDateString(d.浣滃簾鏃ユ湡, 'yyyy-MM-dd')}}</div>", sort: true }
+                        , { field: '鍗曟嵁绫诲瀷', title: '鍗曟嵁绫诲瀷', sort: true }
 
                     ]]
                 };
@@ -217,7 +233,7 @@
                 $.ajax({
                     url: GetWEBURL() + "/QC_Management/MES_QC_CheckProjectList_Json",
                     type: "GET",
-                    data: { "sWhere": sWhere },
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"]},
                     success: function (result) {
                         if (result.count == 1) {
                             option.data = result.data;
@@ -320,7 +336,7 @@
                     layer.confirm("纭瑕佸垹闄ゅ悧锛屽垹闄ゅ悗涓嶈兘鎭㈠", { title: "鍒犻櫎纭" }, function (index) {
                         $.ajax({
                             type: "GET",
-                            url: GetWEBURL() + "Sc_MESBeginWorkBill/DeltetQCCheckProject", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                            url: GetWEBURL() + "DeltetQCCheckProject", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
                             data: { "HInterID": InterID, "UserName": sessionStorage["HUserName"] },
                             success: function (result) {
                                 if (result.count == 1) {
@@ -357,6 +373,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", "hsubid"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+
+                            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