From 93142ea60b226e7b9e52bc4465795efa06babd96 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期一, 05 九月 2022 10:42:44 +0800
Subject: [PATCH] 工艺路线  报表 维护

---
 WebTM/App_Data/MssqlReportData.cs                   |    4 
 WebTM/views/车间管理/报表分析/ProductionPlanReportList.html |  120 ++++++++++++++++++++++++++++++++++++++-
 WebTM/views/计划管理/工艺路线/Gy_RoutingBillimport.html     |   18 ++++-
 3 files changed, 132 insertions(+), 10 deletions(-)

diff --git a/WebTM/App_Data/MssqlReportData.cs b/WebTM/App_Data/MssqlReportData.cs
index 7282839..4f85e41 100644
--- a/WebTM/App_Data/MssqlReportData.cs
+++ b/WebTM/App_Data/MssqlReportData.cs
@@ -18,12 +18,12 @@
     //public const string SqlConnStr = "Data Source=10.0.2.9;Initial Catalog=HX_LimsSys;Persist Security Info=True;User ID=HX_USER;Password=lc@841022;";
     //public const string SqlConnStr = "Data Source=.;Initial Catalog=HX_LMESsys;Persist Security Info=True;User ID=HX_USER;Password=lc@841022;";
     //public const string SqlConnStr = "Data Source=.;Initial Catalog=HX_LimsSys;Persist Security Info=True;User ID=HX_USER;Password=lc@841022;";//ch娴嬭瘯
-   public const string SqlConnStr = "Data Source=47.96.97.237,15127;Initial Catalog=HX_LMESsys;Persist Security Info=True;User ID=HX_USER;Password=lc@841022;";//YL娴嬭瘯
+    //public const string SqlConnStr = "Data Source=47.96.97.237,15127;Initial Catalog=HX_LMESsys;Persist Security Info=True;User ID=HX_USER;Password=lc@841022;";//YL娴嬭瘯
     //public const string SqlConnStr = "Data Source=47.96.97.237,15127;Initial Catalog=HX_LMESsys;Persist Security Info=True;User ID=HX_USER;Password=lc@841022;";//涓镐簳
     //public const string SqlConnStr = "Data Source=192.168.0.200;Initial Catalog=HX_LimsSys;Persist Security Info=True;User ID=HX_USER;Password=lc@841022;";//涓镐簳鍦板潃
     //public const string SqlConnStr = "Data Source=192.168.0.175;Initial Catalog=HX_LimsSys;Persist Security Info=True;User ID=HX_USER;Password=lc@841022;";//闆呯惇璇烘祴璇�
     //public const string SqlConnStr = "Data Source=.;Initial Catalog=HX_LMESsys;Persist Security Info=True;User ID=HX_USER;Password=lc@841022;";//鍑礉濂堢壒
-    //public const string SqlConnStr = "Data Source=192.168.0.199;Initial Catalog=HX_LMESsys;Persist Security Info=True;User ID=HX_USER;Password=lc@841022;";//鐟炵惇
+    public const string SqlConnStr = "Data Source=192.168.0.199;Initial Catalog=HX_LMESsys;Persist Security Info=True;User ID=HX_USER;Password=lc@841022;";//鐟炵惇
 
     //public string sServer;
     //public string sDataBase;
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_RoutingBillimport.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_RoutingBillimport.html"
index c8bb5bd..ae5c1c7 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_RoutingBillimport.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_RoutingBillimport.html"
@@ -54,6 +54,11 @@
                                     </div>
                                 </div>
                                 <div class="layui-inline">
+                                    <div class="layui-input-block" style="margin-left: 10px;min-height:0px">
+                                        <input type="checkbox" name="SqlAppend" id="SqlAppend" lay-skin="primary" lay-filter="SqlAppend" title="鏁版嵁搴撴坊鍔�">
+                                    </div>
+                                </div>
+                                <div class="layui-inline">
                                     <label class="layui-form-label" style="width: 85px;">鏄惁杞伐搴�</label>
                                     <div class="layui-input-block" style="margin-left: 120px; width: 85px;">
                                         <select name=" HTProcessFlag" id="HTProcessFlag">
@@ -155,12 +160,17 @@
 
         //瀵煎叆  淇濆瓨鏁版嵁
         form.on('submit(btnSave)', function (data) {
-          
-            if (table.cache["mainTable"] != null) {
+
+            if ($("input[name='SqlAppend']").prop("checked")) {
                 set_AddNew(data);
             }
             else {
-                layer.msg("鏃犳暟鎹�,璇峰厛瀵煎叆鏁版嵁!");
+                if (table.cache["mainTable"] != null) {
+                    set_AddNew(data);
+                }
+                else {
+                    layer.msg("鏃犳暟鎹�,璇峰厛瀵煎叆鏁版嵁!");
+                }
             }
         })
         //#endregion
@@ -259,7 +269,6 @@
 
         //瀵煎叆(淇濆瓨)
         function set_AddNew(data) {
-
             //var num = [];
             //for (var i = 0; i < table.cache["mainTable"].length; i++) {
             //    if (table.cache["mainTable"][i] != "") {
@@ -284,6 +293,7 @@
                         layer.close(index);
                         layer.msg(data.Message);
                         option.data = null;
+                        table.cache["mainTable"] = null;
                         table.render(option);
                     }
                     else {
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/ProductionPlanReportList.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/ProductionPlanReportList.html"
index dced2c8..7d286ae 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/ProductionPlanReportList.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/ProductionPlanReportList.html"
@@ -106,6 +106,7 @@
                         <script type="text/html" id="toolbarDemo">
                             <div class="layui-btn-container">
                                 <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>
                         </script>
                     </form>
@@ -134,6 +135,7 @@
             //鏌ヨ鏉′欢
             var sWhere = "";
             var option = [];
+            var HModName = "ProductionPlanReportList";
             //#endregion
 
             //#region 杩涘叆椤甸潰鏃㈠姞杞�
@@ -149,6 +151,10 @@
                 switch (obj.event) {
                     //閫�鍑�
                     case 'btn-exit': Pub_Close(2);
+                        break;
+                    //闅愯棌鍒楄缃�
+                    case 'HideColumn':
+                        get_HideColumn();
                         break;
                 };
             });
@@ -217,6 +223,7 @@
                 set_InitGrid();
                 //鍔犺浇鏁版嵁鍒扮綉鏍�
                 get_FastQuery();
+                DisPlay_HideColumn();
             }
 
             //鍒濆鍖栬〃鏍�
@@ -226,17 +233,16 @@
                     , toolbar: '#toolbarDemo'
                     , cellMinWidth: 120
                     , limit: Number.MAX_VALUE // 鏁版嵁琛ㄦ牸榛樿鍏ㄩ儴鏄剧ず
-                    , height: 'full-50'
+                    , height: 'full-70'
                     , cols: [[
                         { type: 'checkbox', fixed: 'left' }
-                        , { field: '瑕佽揣鏃ユ湡', title: '浜よ揣鏃ユ湡', width: 160, templet: "<div>{{d.瑕佽揣鏃ユ湡 ==null ?'':layui.util.toDateString(d.瑕佽揣鏃ユ湡, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
-                        , { field: '閿�鍞鍗曞彿', title: '閿�鍞崟鍙�', width: 160 }
+                        , { field: '娴佽浆鍗″彿', title: '娴佽浆鍗″彿', width: 160 }
+                        , { field: '鍞竴ID', title: '鍞竴ID', width: 160 }
                         , { field: '鐢熶骇璁㈠崟鍙�', title: '鎵瑰彿', width: 160 }
                         , { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О', width: 160 }
                         , { field: '鐗╂枡浠g爜', title: '鐗╂枡浠g爜', width: 160 }
                         , { field: '寮�宸ユ棩鏈�', title: '涓嬭揪鏃ユ湡', width: 160, templet: "<div>{{d.寮�宸ユ棩鏈� ==null ?'':layui.util.toDateString(d.寮�宸ユ棩鏈�, 'yyyy-MM-dd')}}</div>" }
                         , { field: '瑕佹眰瀹屽伐', title: '瑕佹眰瀹屽伐', width: 160, templet: "<div>{{d.瑕佹眰瀹屽伐 ==null ?'':layui.util.toDateString(d.瑕佹眰瀹屽伐, 'yyyy-MM-dd')}}</div>" }
-                        , { field: '绛夌骇', title: '绛夌骇', width: 160 }
                         , { field: '鏁存壒', title: '鏁存壒', width: 160 }
                         , { field: '鎶ュ簾鏁伴噺', title: '鎶ュ簾', width: 160 }
                         , { field: '姹囨姤鍗曟暟閲�', title: '姹囨姤鍗曟暟閲�', width: 160 }
@@ -246,6 +252,9 @@
                         , { field: '鐝粍', title: '鐝粍', width: 200 }
                         , { field: '鐘舵��', title: '鐘舵��', width: 200 }
                         , { field: '鎿嶄綔宸�', title: '鎿嶄綔宸�', width: 200 }
+                        , { field: '瑕佽揣鏃ユ湡', title: '浜よ揣鏃ユ湡', width: 160, templet: "<div>{{d.瑕佽揣鏃ユ湡 ==null ?'':layui.util.toDateString(d.瑕佽揣鏃ユ湡, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
+                        , { field: '閿�鍞鍗曞彿', title: '閿�鍞崟鍙�', width: 160 }
+                        , { field: '绛夌骇', title: '绛夌骇', width: 160 }
                     ]]
                 };
             }
@@ -337,6 +346,109 @@
                 })
             }
 
+            //闅愯棌鍒楄缃�
+            function get_HideColumn() {
+                var colName = "";
+                for (var i = 1; i < option.cols[0].length - 1; i++) {
+                    colName += option.cols[0][i]["title"] + ",";
+                }
+
+                colName = encodeURI(colName.substring(0, colName.length - 1));//瀵� URI 杩涜缂栫爜
+                layer.open({
+                    type: 2
+                    , skin: "layui-layer-rim" //鍔犱笂杈规
+                    , title: "闅愯棌鍒楄缃�"  //鏍囬
+                    , closeBtn: 1  //绐椾綋鍙充笂瑙掑叧闂� 鐨� 鏍峰紡
+                    , shift: 2 //寮瑰嚭鍔ㄧ敾
+                    , area: ["50%", "90%"] //绐椾綋澶у皬
+                    , maxmin: true //璁剧疆鏈�澶ф渶灏忔寜閽槸鍚︽樉绀�
+                    , content: ['../../鍩虹璧勬枡/闅愯棌鍒楄缃�/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName, "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 = [];//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+
+                            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 (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 (dataCols[3] > 0) {
+                                    option.cols[0][i + 1]["width"] = dataCols[3];
+                                }
+                                //鏄剧ず鍒�
+                                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