From 51d0c509da9c1daec861fb8ffd0df6d02e4ef387 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期三, 10 七月 2024 13:50:22 +0800
Subject: [PATCH] 滞留时间报表:根据用户关联客户过滤

---
 WebTM/views/车间管理/报表分析/Kf_ProdProcessEntryReport_DyeColor.html |   38 +++++++++++++++++++++++++++++++++-----
 1 files changed, 33 insertions(+), 5 deletions(-)

diff --git "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\346\212\245\350\241\250\345\210\206\346\236\220/Kf_ProdProcessEntryReport_DyeColor.html" "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\346\212\245\350\241\250\345\210\206\346\236\220/Kf_ProdProcessEntryReport_DyeColor.html"
index a9b50f9..2cc8a9d 100644
--- "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\346\212\245\350\241\250\345\210\206\346\236\220/Kf_ProdProcessEntryReport_DyeColor.html"
+++ "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\346\212\245\350\241\250\345\210\206\346\236\220/Kf_ProdProcessEntryReport_DyeColor.html"
@@ -2,7 +2,7 @@
 <html>
 <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>鐧藉澂鍙戝竷鏄庣粏鎶ヨ〃</title>
+    <title>鏌撳巶鏄庣粏鎶ヨ〃</title>
     <meta name="renderer" content="webkit">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
@@ -167,6 +167,7 @@
                         <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="get_export" id="get_export"><i class="layui-icon layui-icon-export"></i>瀵煎嚭</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></i>閫�鍑�</button>
                                 <button type="button" class="layui-btn layui-btn-sm" lay-event="HideColumn"><i class="layui-icon layui-icon-form"></i>闅愯棌鍒楄缃�</button>
                             </div>
@@ -200,6 +201,8 @@
             var HModName = "ProdProcessEntryReport_DyeColor";
 
             var detailBar = 0;       //鐢ㄤ簬姹囨�绘姤琛ㄦ煡鐪嬫槑缁嗘姤琛紝褰撲负0鏃舵樉绀烘槑缁嗘眹鎬绘姤琛ㄥ搴旀槑缁嗘姤琛ㄣ��
+
+            var ins;                        //鐢ㄤ簬瀵煎嚭excel
             //#endregion
 
             //#region 杩涘叆椤甸潰鏃㈠姞杞�
@@ -213,6 +216,10 @@
             //澶村伐鍏锋爮浜嬩欢
             table.on('toolbar(mainTable)', function (obj) {
                 switch (obj.event) {
+                    //瀵煎嚭excel
+                    case 'get_export':
+                        get_Export();
+                        break;
                     //閫�鍑�
                     case 'btn-exit': Pub_Close(2);
                         break;
@@ -385,7 +392,7 @@
                                 , cols: [col]
                                 , data: data1.data
                             };
-                            table.render(option);
+                            ins = table.render(option);
                         } else {
                             option = {
                                 elem: '#mainTable'
@@ -410,7 +417,7 @@
                                 , done: function (res) {
                                 }
                             };
-                            table.render(option);
+                            ins = table.render(option);
                         }
                     },
                     error: function (err) {
@@ -462,7 +469,7 @@
                                 }
                             }
 
-                            option.data = data1.data;
+                            ins = table.render(option);
                             //var num = 0;
                             //for (let i = 0; i < data1.data.length; i++) {
                             //    for (let j = i + 1; j < data1.data.length; j++) {
@@ -475,7 +482,7 @@
                             //        }
                             //    }
                             //}
-                            table.render(option);
+                            ins = table.render(option);
 
                             //璁$畻鍚堣鍏枻鏁�
                             var sumHMaterOutQty = 0;
@@ -643,6 +650,27 @@
                 sWhere = "";
             }
 
+            //#region 瀵煎嚭Execel
+            function get_Export() {
+                var ModRightNameCheck = "Kf_ProdProcessEntryReport_DyeColor_ExportExcel";
+
+                //閫昏緫瀹℃牳鏂规硶
+                $.ajax({
+                    type: "GET",
+                    url: GetWEBURL() + "/LMES/getReportByModRightNameCheck", //鏂规硶鎵�鍦ㄩ〉闈㈠拰鏂规硶鍚�
+                    data: { "ModRightNameCheck": ModRightNameCheck, "user": sessionStorage["HUserName"] },
+                    success: function (result) {
+                        if (result.count == 1) {
+                            table.exportFile(ins.config.id, option.data, "xls");
+                        } else {
+                            layer.alert("褰撳墠妯″潡娌℃湁瀵煎嚭鏉冮檺!", { icon: 5 });
+                        }
+                    }, error: function () {
+                        layer.alert("鎺ュ彛璇锋眰澶辫触!", { icon: 5 });
+                    }
+                });
+            }
+            //#endregion
 
             //闅愯棌鍒楄缃�
             function get_HideColumn() {

--
Gitblit v1.9.1