From 1c28114c9e54230fa2742776320ffaf2f19c1ac3 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期五, 06 九月 2024 09:38:21 +0800
Subject: [PATCH] 采购订单列设置添加字段统计案例

---
 WebTM/views/基础资料/隐藏列设置/Gy_GridView_Hide_New.html |   35 +++++++++++++++++++++++++++++++----
 1 files changed, 31 insertions(+), 4 deletions(-)

diff --git "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\351\232\220\350\227\217\345\210\227\350\256\276\347\275\256/Gy_GridView_Hide_New.html" "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\351\232\220\350\227\217\345\210\227\350\256\276\347\275\256/Gy_GridView_Hide_New.html"
index 0b2a3bb..59eae84 100644
--- "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\351\232\220\350\227\217\345\210\227\350\256\276\347\275\256/Gy_GridView_Hide_New.html"
+++ "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\351\232\220\350\227\217\345\210\227\350\256\276\347\275\256/Gy_GridView_Hide_New.html"
@@ -121,6 +121,12 @@
         <input type="checkbox" name="IsHide" lay-filter="IsHide" id="IsHide{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
     </div>
 </script>
+<!--澶嶉�夋 鏄惁缁熻琛�-->
+<script type="text/html" id="IsTotalRow">
+    <div class="layui-input-block" style="margin-left: 20px;">
+        <input type="checkbox" name="IsTotalRow" lay-filter="IsTotalRow" id="IsTotalRow{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
+    </div>
+</script>
 <script>
     layui.config({
         base: '../../../layuiadmin/' //闈欐�佽祫婧愭墍鍦ㄨ矾寰�
@@ -176,7 +182,17 @@
                 }
             });
         });
-
+        //鏄惁缁熻
+        form.on('checkbox(IsTotalRow)', function (data) {
+            //鑾峰彇涓嬫媺妗嗛�変腑鐨勫��
+            var elem = data.othis.parents('tr');
+            var dataindex = elem.attr("data-index");
+            $.each(option.data, function (index, value) {
+                if (value.LAY_TABLE_INDEX == dataindex) {
+                    value.IsTotalRow = data.elem.checked;//鎶婇�変腑涓嬫媺妗唅d鍊艰祴鍊肩粰琛ㄦ牸缂撳瓨
+                }
+            });
+        });
         //淇濆瓨鎻愪氦
         form.on('submit(btnSave)', function (data) {//鎻愪氦
             set_AddNew(data);
@@ -223,6 +239,9 @@
                             if (option.data[j - 1].IsHide == true) {
                                 $("#IsHide" + j).attr("checked", true);
                             }
+                            if (option.data[j - 1].IsTotalRow == true) {
+                                $("#IsTotalRow" + j).attr("checked", true);
+                            }
                             $('#Alignment' + j).find("option[value='" + option.data[j - 1].Alignment + "']").attr("selected", true);
                         }
                         form.render('select');
@@ -254,6 +273,9 @@
                         for (var j = 1; j <= option.data.length; j++) {
                             if (option.data[j - 1].IsHide == true) {
                                 $("#IsHide" + j).attr("checked", true);
+                            }
+                            if (option.data[j - 1].IsTotalRow == true) {
+                                $("#IsTotalRow" + j).attr("checked", true);
                             }
                             $('#Alignment' + j).find("option[value='" + option.data[j - 1].Alignment + "']").attr("selected", true);
                         }
@@ -296,7 +318,7 @@
                     var colNames = [];//鐩稿鍗曟嵁浼犺繃鏉ョ殑鍒楀悕
                     var cols = [];//瑕佷紶杩涜〃鏍肩殑鏁版嵁
                     var dataCol = [];//琛ㄦ牸鏁版嵁
-                
+
                     if (data1.data.length != 0) {
                         //鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
                         dataCol = data1.data[0].HGridString.split(',');
@@ -317,7 +339,7 @@
                         for (var i = 0; i < colNames.length; i++) {
                             var dataCols = dataCol[i].split('|');
                             var ColumnName_Other = dataCols[4] == dataCols[5] ? "" : dataCols[4];
-                            cols.push({ "ColumnName": colNames[i], "IsHide": dataCols[1] == 1 ? true : false, "Alignment": dataCols[2], "ColumnWidth": dataCols[3], "ColumnName_Other": ColumnName_Other, "ColumnName_real": dataCols[5] })
+                            cols.push({ "ColumnName": colNames[i], "IsHide": dataCols[1] == 1 ? true : false, "Alignment": dataCols[2], "ColumnWidth": dataCols[3], "ColumnName_Other": ColumnName_Other, "ColumnName_real": dataCols[5], "IsTotalRow": dataCols[6] == 1 ? true : false })
                         }
                         option.data = cols;
                         table.render(option);
@@ -328,6 +350,9 @@
                             if (dataCols[1] == 1) {
                                 $("#IsHide" + (i + 1)).attr("checked", true);
                             }
+                            if (dataCols[6] == 1) {
+                                $("#IsTotalRow" + (i + 1)).attr("checked", true);
+                            }
                             $('#Alignment' + (i + 1)).find("option[value='" + dataCols[2] + "']").attr("selected", true);
                         }
                         form.render('checkbox');
@@ -336,7 +361,7 @@
                     } else {
                         //榛樿涓嶉�変腑 鏄剧ず瀛椾綋灞呭乏  琛ㄦ牸鐨勬暟鎹~鍏�
                         for (var i = 0; i < colNames.length; i++) {
-                            cols.push({ "ColumnName": colNames[i], "IsHide": false, "Alignment": "L", "ColumnWidth": 120 })
+                            cols.push({ "ColumnName": colNames[i], "IsHide": false, "Alignment": "L", "ColumnWidth": 120, "IsTotalRow": false })
                         }
                         option.data = cols;
                         table.render(option);
@@ -344,6 +369,7 @@
                         //榛樿涓嶉�変腑 鏄剧ず瀛椾綋灞呭乏 椤甸潰澶氶�夋 涓嬫媺妗� 閲嶆柊娓叉煋
                         for (var i = 0; i < colNames.length; i++) {
                             $('#IsHide' + (i + 1)).prop("checked", false);
+                            $('#IsTotalRow' + (i + 1)).prop("checked", false);
                             $('#Alignment' + (i + 1)).find("option[value='L']").attr("selected", true);
                         }
                         form.render('checkbox');
@@ -374,6 +400,7 @@
                     , { field: 'ColumnWidth', title: '鍒楀', width: 100, edit: 'text' }
                     , { field: 'ColumnName_Other', title: '鍒悕', width: 120, edit: 'text' }
                     , { field: 'ColumnName_real', title: '鍒悕瀵瑰簲鍒楀悕', width: 120, edit: 'text', hide: "true" }
+                    , { field: 'IsTotalRow', title: '鏄惁缁熻', width: 100, templet: '#IsTotalRow' }
                 ]]
             };
         }

--
Gitblit v1.9.1