From df3e719955cc93b4e762ac75fbb61737fbf3b7a8 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 16 六月 2025 08:38:12 +0800
Subject: [PATCH] 1

---
 WebTM/views/质量管理/环境检测单/QC_EnvironmentTestDotCheckBillList.html |  480 ++++++++++++++++++++++++++++++++++-------------------------
 1 files changed, 279 insertions(+), 201 deletions(-)

diff --git "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\347\216\257\345\242\203\346\243\200\346\265\213\345\215\225/QC_EnvironmentTestDotCheckBillList.html" "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\347\216\257\345\242\203\346\243\200\346\265\213\345\215\225/QC_EnvironmentTestDotCheckBillList.html"
index 2510f9a..a52c691 100644
--- "a/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\347\216\257\345\242\203\346\243\200\346\265\213\345\215\225/QC_EnvironmentTestDotCheckBillList.html"
+++ "b/WebTM/views/\350\264\250\351\207\217\347\256\241\347\220\206/\347\216\257\345\242\203\346\243\200\346\265\213\345\215\225/QC_EnvironmentTestDotCheckBillList.html"
@@ -15,7 +15,8 @@
     <script src="../../../layuiadmin/PubCustom.js"></script>
     <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
     <script src="../../../layuiadmin/PageTitle.js"></script>
-
+    <script src="../../../layuiadmin/HideButton_New.js"></script>
+    <script src="../../../layuiadmin/SetColumn.js"></script>
 </head>
 <body>
     <div class="layui-fluid">
@@ -150,22 +151,24 @@
                         </div>
                         <table class="" id="mainTable" lay-filter="mainTable"></table>
                         <script type="text/html" id="toolbarDemo">
-                            <div class="layui-btn-container">
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>鏂板</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill"><i class="layui-icon layui-icon-form"></i>缂栬緫</button>
+                            <div class="layui-btn-container" id="toolbarDemo_ButtonSet">
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn_Export" id="btn_Export"><i class="layui-icon layui-icon-export"></i>瀵煎嚭</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="set_Copy" id="set_Copy"><i class="layui-icon layui-icon-form"></i>澶嶅埗</button>
-                                <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="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>鍒锋柊</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Audit"><i class="layui-icon layui-icon-radio"></i>瀹℃牳</button>
-                                <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-Close"><i class="layui-icon layui-icon-radio"></i>鍏抽棴</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeClose"><i class="layui-icon layui-icon-radio"></i>鍙嶅叧闂�</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Drop"><i class="layui-icon layui-icon-radio"></i>浣滃簾</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeDrop"><i class="layui-icon layui-icon-radio"></i>鍙嶄綔搴�</button>
-                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></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="set_AddNew" id="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>鏂板</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill" id="set_ShowBill"><i class="layui-icon layui-icon-form"></i>缂栬緫</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill" id="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>鍒犻櫎</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Audit" id="btn-Audit"><i class="layui-icon layui-icon-radio"></i>瀹℃牳</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeAudit" id="btn-DeAudit"><i class="layui-icon layui-icon-circle"></i>鍙嶅鏍�</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Close" id="btn-Close"><i class="layui-icon layui-icon-radio"></i>鍏抽棴</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeClose" id="btn-DeClose"><i class="layui-icon layui-icon-radio"></i>鍙嶅叧闂�</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Drop" id="btn-Drop"><i class="layui-icon layui-icon-radio"></i>浣滃簾</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeDrop" id="btn-DeDrop"><i class="layui-icon layui-icon-radio"></i>鍙嶄綔搴�</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn" id="set_HideColumn"><i class="layui-icon layui-icon-form"></i>鍒楄缃�</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideButton" id="HideButton"><i class="layui-icon layui-icon-form"></i>鎸夐挳璁剧疆</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="set_SaveScheme" id="set_SaveScheme"><i class="layui-icon layui-icon-template"></i>淇濆瓨鏂规</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ReadScheme" id="set_ReadScheme"><i class="layui-icon layui-icon-set"></i>璇诲彇鏂规</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh" id="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>鍒锋柊</button>
+                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit" id="get_Exit"><i class="layui-icon layui-icon-logout"></i>閫�鍑�</button>
                             </div>
                         </script>
                     </form>
@@ -190,8 +193,12 @@
                 , laydate = layui.laydate
             var option = [];
             var sWhere = "";
-            var HModName = "QC_EnvironmentTestDotCheckBillList";
-
+            var page = 1;//鍒嗛〉鏁版嵁
+            var size = 50;
+            var HModName = "QC_EnvironmentTestDotCheckBillList"
+            var HBillType = "QC_EnvironmentTestDotCheckBillList";
+            var set_HideButton_ID = "toolbarDemo_ButtonSet";//闇�瑕佽缃殑鎸夐挳鐨勭埗绾ц妭鐐圭殑id
+            var ins;                //鐢ㄤ簬瀵煎嚭excel
             //涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
             var titleData = ["HInterID", "HEntryID", "HDeptID", "HCenterWorkID", "HProcID", "HEnvironmentItemID", "HEmpID","HEnvironmentTestSchemeID"];
 
@@ -228,6 +235,9 @@
 
             table.on('toolbar(mainTable)', function (obj) {
                 switch (obj.event) {
+                    //瀵煎嚭鎸夐挳
+                    case 'btn_Export': btn_Export();
+                        break;
                     //鏂板
                     case 'set_AddNew': set_AddNew();
                         break;
@@ -272,7 +282,11 @@
                     case 'get_Exit': Pub_Close(2);
                         break;
                     //鍒楄缃�
-                    case 'set_HideColumn': get_HideColumn();
+                    case 'set_HideColumn': get_HideColumn(HModName, sessionStorage["HUserName"], option, optionPage, get_FastQuery);
+                        break;
+                    //鎸夐挳璁剧疆
+                    case 'set_HideButton':
+                        get_HideButton(set_HideButton_ID, HBillType, HModName, sessionStorage["HUserName"]);
                         break;
                     //淇濆瓨鏂规
                     case 'set_SaveScheme': set_SaveScheme();
@@ -308,12 +322,21 @@
             //#region 閲嶇疆鎸夐挳
             form.on('submit(btnReSearch)', function (data) {
                 set_ClearQuery();
+                if (page != 1) {
+                    $("#page a:eq(1)").get(0).click();//鐐瑰嚮鍒嗛〉鏍忕涓�椤�
+                } else {
+                    get_FastQuery();
+                }
             });
             //#endregion
 
             //#region 鏌ヨ鎸夐挳
             form.on('submit(btnSearch)', function (data) {
-                get_FastQuery(2);
+                if (page != 1) {
+                    $("#page a:eq(1)").get(0).click();//鐐瑰嚮鍒嗛〉鏍忕涓�椤�
+                } else {
+                    get_FastQuery();
+                }
             });
             //#endregion
 
@@ -355,7 +378,9 @@
                 $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * HInitTimeCycle), "yyyy-MM-dd"));
                 $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
                 //鍒濆鍖栬〃鏍�
-                set_InitGrid();              
+                set_InitGrid();
+                //鏌ヨ
+                get_FastQuery();
                 //鏌ヨ褰撳墠鐧诲綍鐢ㄦ埛鏈夋病鏈夊湪褰撳墠妯″潡璁剧疆榛樿杩囨护鏂规
                 get_DefaultModule();
             }
@@ -373,6 +398,24 @@
                     , limit: 50
                     , limits: [50, 500, 5000, 20000]
                 };
+                optionPage = {
+                    elem: 'page', //娉ㄦ剰锛岃繖閲岀殑 page 鏄� ID锛屼笉鐢ㄥ姞 # 鍙�
+                    count: 10000, //鏁版嵁鎬绘暟锛屼粠鏈嶅姟绔緱鍒�
+                    limit: 50,
+                    limits: [50, 500, 5000, 50000],
+                    layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
+                    jump: function (obj, first) {
+
+                        //棣栨涓嶆墽琛�
+                        if (!first) {
+                            //do something
+                            page = obj.curr;
+                            size = obj.limit;
+                            get_FastQuery();
+                        }
+                    }
+                }
+                laypage.render(optionPage);
             }
             //#endregion
 
@@ -401,6 +444,122 @@
             });
              //#endregion
 
+          
+            //#region 蹇�熻繃婊�
+            function get_FastQuery(number) {
+                var HBillNo = $("#HBillNo").val();  //鍗曟嵁鍙�
+                var HDate = $("#HBeginDate").val();//寮�濮嬫棩鏈�
+                var HDate1 = $("#HEndDate").val();//缁撴潫鏃ユ湡
+                //浠绘剰瀛楁杩囨护
+                var ColName = $("#ColName").val();//澶嶉�夋
+                var Comparator = $("#Comparator").val()
+                var ColContent = $("#ColContent").val();
+                var ColName1 = $("#ColName1").val();//澶嶉�夋
+                var Comparator1 = $("#Comparator1").val()
+                var ColContent1 = $("#ColContent1").val();
+                var ColName2 = $("#ColName2").val();//澶嶉�夋
+                var Comparator2 = $("#Comparator2").val()
+                var ColContent2 = $("#ColContent2").val();
+                if (ColName != 0 && Comparator != 0) {
+                    var com = "";
+                    switch (Comparator) {
+                        case "7":
+                            com = "like'%" + ColContent + "%'";
+                            break;
+                        case "8":
+                            com = "like'%" + ColContent + "'";
+                            break;
+                        case "9":
+                            com = "like'" + ColContent + "%'";
+                            break;
+                        case "10":
+                            com = "not like'%" + ColContent + "%'";
+                            break;
+                        default:
+                            com = "" + Comparator + "'" + ColContent + "'";
+                            break;
+                    }
+                    sWhere += " and " + ColName + " " + com;
+                }
+                if (ColName1 != 0 && Comparator1 != 0) {
+                    var com1 = "";
+                    switch (Comparator1) {
+                        case "7":
+                            com1 = "like'%" + ColContent1 + "%'";
+                            break;
+                        case "8":
+                            com1 = "like'%" + ColContent1 + "'";
+                            break;
+                        case "9":
+                            com1 = "like'" + ColContent1 + "%'";
+                            break;
+                        case "10":
+                            com1 = "not like'%" + ColContent1 + "%'";
+                            break;
+                        default:
+                            com1 = "" + Comparator1 + "'" + ColContent1 + "'";
+                            break;
+                    }
+                    sWhere += " and " + ColName1 + " " + com1;
+                }
+                if (ColName2 != 0 && Comparator2 != 0) {
+                    var com2 = "";
+                    switch (Comparator2) {
+                        case "7":
+                            com2 = "like'%" + ColContent2 + "%'";
+                            break;
+                        case "8":
+                            com2 = "like'%" + ColContent2 + "'";
+                            break;
+                        case "9":
+                            com2 = "like'" + ColContent2 + "%'";
+                            break;
+                        case "10":
+                            com2 = "not like'%" + ColContent2 + "%'";
+                            break;
+                        default:
+                            com2 = "" + Comparator2 + "'" + ColContent2 + "'";
+                            break;
+                    }
+                    sWhere += " and " + ColName2 + " " + com2;
+                }
+                if (HDate) {
+                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + HDate + "'";
+                }
+                if (HDate1) {
+                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) <= '" + HDate1 + "'";
+                }
+
+                if (HBillNo) {
+                    sWhere += " and 鍗曟嵁鍙� like '%" + HBillNo + "%'";
+                }
+                //get_Display(sWhere);
+                get_DisplayPage(sWhere);
+                sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
+            }
+            //#endregion
+
+            //#region 閲嶇疆杩囨护鏉′欢鏂规硶
+            function set_ClearQuery() {
+                var HInitTimeCycle = $("#HInitTimeCycle").val() * 1;
+                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * HInitTimeCycle), "yyyy-MM-dd"));
+                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
+                $("#HBillNo").val("");
+                $("#ColContent").val("");
+                $("#ColName").val("0");
+                $("#Comparator").val("0");
+                $("#ColContent1").val("");
+                $("#ColName1").val("0");
+                $("#Comparator1").val("0");
+                $("#ColContent2").val("");
+                $("#ColName2").val("0");
+                $("#Comparator2").val("0");
+                form.render('select');
+
+                sWhere = "";
+            }
+            //#endregion
+
             //#region 鏌ヨ
             function get_Display(sWhere) {
                 var ajaxLoad = layer.load();
@@ -408,7 +567,7 @@
                     url: GetWEBURL() + '/QC_EnvironmentTestDotCheckBill/get锘縌C_EnvironmentTestDotCheckBillMainList',
                     async: false,
                     type: "GET",
-                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"]},
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                     success: function (data1) {
                         if (data1.count == 1) {
                             var totalArray = [];
@@ -433,7 +592,7 @@
                                     switch (data[i].Type) {
                                         //int
                                         case 'DateTime':
-                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width:120 });
+                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 120 });
                                             break;
                                         case 'long':
                                         case 'Int32':
@@ -450,11 +609,12 @@
 
                             option.cols = [col];
                             option.data = data1.data;
-                            table.render(option);
-
                             //鍒锋柊琛ㄦ牸鏁版嵁
-                            DisPlay_HideColumn();
-
+                            DisPlay_HideColumn(HModName, sessionStorage["HUserName"], option, titleData)
+                            laypage.render(optionPage);
+                            ins = table.render(option);
+                            //鍒锋柊鎸夐挳鏄剧ず
+                            Display_HideButton(set_HideButton_ID, HBillType, HModName, sessionStorage["HUserName"]);
                             layer.close(ajaxLoad);
 
                             if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
@@ -474,72 +634,90 @@
             }
             //#endregion
 
-            //#region 蹇�熻繃婊�
-            function get_FastQuery(number) {
-                var HBillNo = $("#HBillNo").val();  //鍗曟嵁鍙�
-                var HDate = $("#HBeginDate").val();//寮�濮嬫棩鏈�
-                var HDate1 = $("#HEndDate").val();//缁撴潫鏃ユ湡
-                //浠绘剰瀛楁杩囨护
-                var ColName = $("#ColName").val();//澶嶉�夋
-                var Comparator = $("#Comparator").val()
-                var ColContent = $("#ColContent").val();
 
-                if (ColName != 0 && Comparator != 0) {
-                    var com = "";
-                    switch (Comparator) {
-                        case "7":
-                            com = "like'%" + ColContent + "%'";
-                            break;
-                        case "8":
-                            com = "like'%" + ColContent + "'";
-                            break;
-                        case "9":
-                            com = "like'" + ColContent + "%'";
-                            break;
-                        case "10":
-                            com = "not like'%" + ColContent + "%'";
-                            break;
-                        default:
-                            com = "" + Comparator + "'" + ColContent + "'";
-                            break;
+            //#region 鍒嗛〉鏌ヨ
+            function get_DisplayPage(sWhere) {
+                var ajaxLoad = layer.load();
+                $.ajax({
+                    url: GetWEBURL() + '/QC_EnvironmentTestDotCheckBill/get锘縌C_EnvironmentTestDotCheckBillListPage',
+                    type: "GET",
+                    async:false,
+                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "page": page, "size": size },
+                    success: function (data1) {
+                        option.limit = size;//鏀瑰彉琛ㄦ牸椤靛ぇ灏�
+                        if (data1.code == 1) {
+                            optionPage.count = data1.count;//鏀瑰彉鍒楄〃鏁版嵁鎬绘暟
+                            var data = [];
+                            var col = [];
+                            //缁欑┖鐨勬暟缁勮祴鍊�
+                            for (var key in data1.list) {
+                                //鍔ㄦ�佽幏鍙栧垪琛ㄦ墍鏈夊垪鍚�
+                                data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
+                                //鑾峰彇涓嶉渶瑕佹樉绀虹殑鍒楋紙H寮�澶寸殑鍒椾笉鏄剧ず锛�
+                                var patrn = new RegExp(/^h/i);
+                                if (patrn.test(data1.list[key].ColmCols)) {
+                                    titleData[key] = data1.list[key].ColmCols;
+                                }
+                            }
+                            //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
+                            col.push({ type: 'checkbox', fixed: 'left' });
+                            for (var i = 0; i < data.length; i++) {
+                                if ($.inArray(data[i].name, titleData) > -1) {
+                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //闅愯棌id鍒�
+                                }
+                                else if (data[i].name == '鍗曟嵁鍙�') {//娣诲姞瓒呴摼鎺�
+                                    col.push({
+                                        field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, event: '鍗曟嵁鍙�', templet: function (d) {
+                                            return '<span style="color: blue;">' + d.鍗曟嵁鍙� + '</span>'
+                                        }, style: 'cursor: pointer;'
+                                    });
+                                }
+                                else {
+                                    switch (data[i].Type) {
+                                        //int
+                                        case 'DateTime':
+                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 });
+                                            break;
+                                        case 'long':
+                                        case 'Int32':
+                                        case 'Int64':
+                                        case 'double':
+                                        case 'Decimal':
+                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true });
+                                            break;
+                                        default:
+                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
+                                    }
+                                }
+                            }
+                            option.cols = [col];
+                            option.data = data1.data;
+                            option.totalRow = true;
+                            //鍒锋柊琛ㄦ牸鏁版嵁
+                            DisPlay_HideColumn(HModName, sessionStorage["HUserName"], option, titleData)
+                            ins = table.render(option);
+                            laypage.render(optionPage);
+
+                            //鍒锋柊鎸夐挳鏄剧ず
+                            Display_HideButton(set_HideButton_ID, HBillType, HModName, sessionStorage["HUserName"]);
+
+                            layer.close(ajaxLoad);
+                            if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
+                                ColFilter();
+                            }
+                        } else {
+                            layer.close(ajaxLoad);
+                            layer.alert(data1.code + data1.Message, { icon: 5 });
+                        }
+                    }, error: function () {
+                        layer.close(ajaxLoad);
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
                     }
-                    sWhere += " and " + ColName + " " + com;
-                }
-                if (HDate) {
-                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) >= '" + HDate + "'";
-                }
-                if (HDate1) {
-                    sWhere += " and CONVERT(varchar(100),鏃ユ湡, 23) <= '" + HDate1 + "'";
-                }
-
-                if (HBillNo) {
-                    sWhere += " and 鍗曟嵁鍙� like '%" + HBillNo + "%'";
-                }
-
-
-                get_Display(sWhere);
-                sWhere = "";//璋冪敤鎺ュ彛鍚庢竻绌簊Where缂撳瓨
+                });
             }
             //#endregion
 
-            //#region 閲嶇疆杩囨护鏉′欢鏂规硶
-            function set_ClearQuery() {
-                var HInitTimeCycle = $("#HInitTimeCycle").val() * 1;
-                $("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * HInitTimeCycle), "yyyy-MM-dd"));
-                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
-                $("#HBillNo").val("");
-                $("#ColContent").val("");
-                $("#ColName").val("0");
-                $("#Comparator").val("0");   $("#ColContent1").val("");
-                $("#ColName1").val("0");
-                $("#Comparator1").val("0");   $("#ColContent2").val("");
-                $("#ColName2").val("0");
-                $("#Comparator2").val("0");
-                form.render('select');
 
-                sWhere = "";
-            }
-            //#endregion
 
             //#region 鍒濆鏃ユ湡闂撮殧 涓嬫媺鍒楄〃
             function setSelect_HInitTimeCycle() {
@@ -774,124 +952,22 @@
             }
             //#endregion
 
-            //#region 闅愯棌鍒楄缃�
-            function get_HideColumn() {
-                var colName = "";
-                var contentUrl = "";
-                for (var i = 1; i < option.cols[0].length; 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);//鍏抽棴寮圭獥
-                    }
-                })
-            }
-            //#endregion
-            //#region 鏄剧ず鍒楁暟鎹�
-            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", "婧愬崟涓诲唴鐮�", "婧愬崟瀛愬唴鐮�"];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
-                            var titleData = ["HInterID", "HEntryID", "HDeptID", "HReceiveDeptID", "HErrMsgBackTypeID", "HOrgID", "HDutyID"];
-                            dataCol = data1.data[0].HGridString.split(',');
-
-                            for (var i = 0; i < option.cols[0].length - 1; 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);
+            //#region 瀵煎嚭Execel
+            function btn_Export() {
+                option.data.forEach((item) => {
+                    for (let itemobj in item) {
+                        if (item[itemobj] == null) {
+                            item[itemobj] = "";
                         }
-                    }, error: function () {
-                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                        if (item[itemobj].length > 0) {  // 鍋囪瀛楁鍚嶄负field
+                            item[itemobj] = item[itemobj].toString().replaceAll(/[\r\n]+/g, '');  // 灏嗘崲琛岀鏇挎崲涓虹┖瀛楃涓�
+                        }
                     }
-                })
+                });
+
+                table.exportFile(ins.config.id, option.data, "xls");
             }
             //#endregion
-
 
             //#region 浠绘剰瀛楁杩囨护锛氬垪鍚嶆樉绀轰笅鎷夋
             function ColFilter() {
@@ -902,8 +978,10 @@
                     }
                 }
                 $("#ColName").empty();
-                $("#ColName").append(Organization);      $("#ColName1").empty();
-                $("#ColName1").append(Organization);      $("#ColName2").empty();
+                $("#ColName").append(Organization);
+                $("#ColName1").empty();
+                $("#ColName1").append(Organization);
+                $("#ColName2").empty();
                 $("#ColName2").append(Organization);
                 form.render('select');
             }

--
Gitblit v1.9.1