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 |   49 ++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 40 insertions(+), 9 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 57f32c7..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;
@@ -339,12 +346,12 @@
                     url: GetWEBURL() + "/ProdProcessEntryReport/ProdProcessEntryReport_DyeColor",
                     type: "GET",
                     async: false,
-                    data: { "sWhere": sWhere,"sProcessNo":''},
+                    data: { "sWhere": sWhere, "sProcessNo": '', "user": sessionStorage["HUserName"] },
                     //async: false,
                     success: function (data1) {
 
                         if (data1.count == 1) {
-
+                            var totalArray = ["鐢熶骇浠诲姟鍗曟暟閲�", "鐧藉澂鍙戝竷"];
                             var data = [];
                             var col = [];
                             //缁欑┖鐨勬暟缁勮祴鍊�
@@ -357,6 +364,9 @@
                             for (var i = 0; i < data.length; i++) {
                                 if ($.inArray(data[i].name, "") > -1) {
                                     col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //闅愯棌id鍒�
+                                }
+                                else if ($.inArray(data[i].name, totalArray) > -1) {
+                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 });
                                 }
                                 else if (data[i].ColName == '鐧藉澂鍙戝竷') {
                                     col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true });
@@ -382,7 +392,7 @@
                                 , cols: [col]
                                 , data: data1.data
                             };
-                            table.render(option);
+                            ins = table.render(option);
                         } else {
                             option = {
                                 elem: '#mainTable'
@@ -400,14 +410,14 @@
                                     , { field: '瑙勬牸鍨嬪彿', title: '瑙勬牸鍨嬪彿', width: 160 }
                                     , { field: '涓氬姟鍛�', title: '涓氬姟鍛�', width: 160 }
                                     , { field: '瀹㈡埛', title: '瀹㈡埛', width: 160 }
-                                    , { field: '鐢熶骇浠诲姟鍗曟暟閲�', title: '鐢熶骇浠诲姟鍗曟暟閲�', width: 200 }
+                                    , { field: '鐢熶骇浠诲姟鍗曟暟閲�', title: '鐢熶骇浠诲姟鍗曟暟閲�', totalRow: true,width: 200 }
                                     , { field: '鐧藉澂鍙戝竷', title: '鐧藉澂鍙戝竷', width: 160, totalRow: true }
                                     , { field: '鏄惁涓嬫帹鐢熸垚娴佽浆鍗�', title: '鏄惁涓嬫帹鐢熸垚娴佽浆鍗�', width: 160 }
                                 ]]
                                 , done: function (res) {
                                 }
                             };
-                            table.render(option);
+                            ins = table.render(option);
                         }
                     },
                     error: function (err) {
@@ -441,7 +451,7 @@
                 $.ajax({
                     url: GetWEBURL() + '/ProdProcessEntryReport/ProdProcessEntryReport_DyeColor',
                     type: "GET",
-                    data: { "sWhere": sWhere, "sProcessNo": sProcessNo },
+                    data: { "sWhere": sWhere, "sProcessNo": sProcessNo, "user": sessionStorage["HUserName"]  },
                     success: function (data1) {
                         if (data1.count == 1) {
                             //璋冩暣鏃ユ湡鏍煎紡锛氭樉绀� 骞存湀鏃� 鍜� 鏃�
@@ -459,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++) {
@@ -472,7 +482,7 @@
                             //        }
                             //    }
                             //}
-                            table.render(option);
+                            ins = table.render(option);
 
                             //璁$畻鍚堣鍏枻鏁�
                             var sumHMaterOutQty = 0;
@@ -640,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