From c63d87a7a69a5025a7dae7135cc7f674709fd053 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期二, 22 十一月 2022 08:43:37 +0800
Subject: [PATCH] 增加列合计

---
 WebTM/views/车间管理/报表分析/ProductionPlanReportList.html    |   46 ++++++++++++++++++++---
 WebTM/views/车间管理/工序流转卡/Sc_ProcessExchangeBillList.html |    9 +++-
 WebTM/views/基础资料/生产基础资料/Gy_SOPBill.html                |    9 ++--
 WebTM/views/车间管理/工序出站汇报单/Cj_StationOutBillList.html    |    9 +++-
 WebTM/views/生产管理/生产任务单/Sc_ICMOBillList.html            |    5 +-
 5 files changed, 62 insertions(+), 16 deletions(-)

diff --git "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\347\224\237\344\272\247\345\237\272\347\241\200\350\265\204\346\226\231/Gy_SOPBill.html" "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\347\224\237\344\272\247\345\237\272\347\241\200\350\265\204\346\226\231/Gy_SOPBill.html"
index 33b5e67..db9eeb5 100644
--- "a/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\347\224\237\344\272\247\345\237\272\347\241\200\350\265\204\346\226\231/Gy_SOPBill.html"
+++ "b/WebTM/views/\345\237\272\347\241\200\350\265\204\346\226\231/\347\224\237\344\272\247\345\237\272\347\241\200\350\265\204\346\226\231/Gy_SOPBill.html"
@@ -210,9 +210,10 @@
             //#region 鑷姩鎾斁妯″紡涓嬭幏鍙栭〉闈俊鎭殑鏂规硶
             function set_LoadAgain() {
                 get_Display(sWhere);
-                get_Display2(sWhere);
-                get_Display3(sWhere);
-                setTimeout(function () { ins.reload({ autoplay: false }) }, 500);
+                setTimeout(function () { get_Display2(sWhere); }, 500);
+                setTimeout(function () { get_Display2(sWhere); }, 500);
+                setTimeout(function () { get_Display3(sWhere); }, 500);
+                setTimeout(function () { ins.reload({ autoplay: false }) }, 1000);
             }
             //#endregion
 
@@ -338,7 +339,7 @@
                     , limit: 50
                     , height: 300
                     , cols: [[
-                        , { field: '璁″垝', title: '璁″垝', width: 100 }
+                        , { field: '婧愬崟鍗曞彿', title: '璁″垝', width: 100 }
                         , { field: '鏃ユ湡', title: '鏃ユ湡', width: 100, templet: "<div>{{d.鏃ユ湡 ==null ?'':layui.util.toDateString(d.鏃ユ湡, 'yyyy-MM-dd')}}</div>" }
                         , { field: '鐗╂枡浠g爜', title: '鐗╂枡浠g爜', width: 100 }
                         , { field: '鐗╂枡鍚嶇О', title: '鐗╂枡鍚嶇О', width: 100 }
diff --git "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillList.html" "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillList.html"
index 940fab1..8587fd0 100644
--- "a/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillList.html"
+++ "b/WebTM/views/\347\224\237\344\272\247\347\256\241\347\220\206/\347\224\237\344\272\247\344\273\273\345\212\241\345\215\225/Sc_ICMOBillList.html"
@@ -388,10 +388,11 @@
                     , height: 'full-50'
                     , page: true
                     , cellMinWidth: 90
+                    , totalRow: true
                     , limit: 50
                     , limits: [50, 500, 5000, 20000]
                     , cols: [[
-                        { type: 'checkbox', fixed: 'left' }
+                        { type: 'checkbox', fixed: 'left', totalRowText: '鍚堣' }
                         , { field: 'hmainid', title: 'hmainid', sort: true, width: 165, hide: true }
                         , { field: 'HEntryID', title: 'HEntryID', sort: true, width: 165, hide: true }
                         , { field: '鍗曟嵁鍙�', title: '鍗曟嵁鍙�', sort: true, width: 170 }
@@ -404,7 +405,7 @@
                         , { field: '瑙勬牸鍨嬪彿', title: '瑙勬牸鍨嬪彿', width: 215 }
                         , { field: '鐢熶骇杞﹂棿浠g爜', title: '鐢熶骇杞﹂棿浠g爜', width: 115 }
                         , { field: '鐢熶骇杞﹂棿', title: '鐢熶骇杞﹂棿', width: 115 }
-                        , { field: '鐢熶骇浠诲姟鍗曟暟閲�', title: '鐢熶骇璁㈠崟鏁伴噺', width: 115 }
+                        , { field: '鐢熶骇浠诲姟鍗曟暟閲�', title: '鐢熶骇璁㈠崟鏁伴噺', width: 115, totalRow: true }
                         , { field: '鍖呰鏍囪瘑浠g爜', title: '鍖呰鏍囪瘑浠g爜', width: 115 }
                         , { field: '鍖呰鏍囪瘑', title: '鍖呰鏍囪瘑', width: 115 }
                         , { field: '璁¢噺鍗曚綅浠g爜', title: '璁¢噺鍗曚綅浠g爜', width: 115 }
diff --git "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\345\207\272\347\253\231\346\261\207\346\212\245\345\215\225/Cj_StationOutBillList.html" "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\345\207\272\347\253\231\346\261\207\346\212\245\345\215\225/Cj_StationOutBillList.html"
index a6b47f6..a0bd901 100644
--- "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\345\207\272\347\253\231\346\261\207\346\212\245\345\215\225/Cj_StationOutBillList.html"
+++ "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\345\207\272\347\253\231\346\261\207\346\212\245\345\215\225/Cj_StationOutBillList.html"
@@ -725,7 +725,7 @@
                                 data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                             }
                             //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
-                            col.push({ type: 'checkbox', fixed: 'left' });
+                            col.push({ type: 'checkbox', fixed: 'left', totalRowText: '鍚堣' });
                             for (var i = 0; i < data.length; i++) {
                                 // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
                                 if ($.inArray(data[i].name, titleData) > -1) {
@@ -738,7 +738,11 @@
                                             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;
                                         default:
-                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
+                                            if (data[i].name == '鏁伴噺' || data[i].name == '鍑虹珯鏁伴噺' || data[i].name == '鎶ュ簾鏁伴噺') {
+                                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, totalRow: true });
+                                            } else {
+                                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
+                                            }                                            
                                     }
                                 }
                             }
@@ -751,6 +755,7 @@
                                 , data: data1.data
                                 , height: 550
                                 , page: true
+                                , totalRow: true
                                 , cellMinWidth: 90
                                 , limit: 50
                                 , limits: [50, 500, 5000, 20000]
diff --git "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\346\265\201\350\275\254\345\215\241/Sc_ProcessExchangeBillList.html" "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\346\265\201\350\275\254\345\215\241/Sc_ProcessExchangeBillList.html"
index b640f82..83df1ab 100644
--- "a/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\346\265\201\350\275\254\345\215\241/Sc_ProcessExchangeBillList.html"
+++ "b/WebTM/views/\350\275\246\351\227\264\347\256\241\347\220\206/\345\267\245\345\272\217\346\265\201\350\275\254\345\215\241/Sc_ProcessExchangeBillList.html"
@@ -815,7 +815,7 @@
                                 data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                             }
                             //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
-                            col.push({ type: 'checkbox', fixed: 'left' });
+                            col.push({ type: 'checkbox', fixed: 'left', totalRowText: '鍚堣' });
                             for (var i = 0; i < data.length; i++) {
                                 // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
                                 if ($.inArray(data[i].name, titleData) > -1) {
@@ -828,7 +828,11 @@
                                             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;
                                         default:
-                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
+                                            if (data[i].name == '鐢熶骇鏁伴噺' || data[i].name == '娴佽浆鍗℃暟閲�' || data[i].name == '鍏ュ簱鏁伴噺') {
+                                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, totalRow: true });
+                                            } else {
+                                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
+                                            }
                                     }
                                 }
                             }
@@ -841,6 +845,7 @@
                                 , data: data1.data
                                 , height: 550
                                 , page: true
+                                , totalRow: true
                                 , cellMinWidth: 90
                                 , limit: 50
                                 , limits: [50, 500, 5000, 20000]
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 653b1d9..3a16b25 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"
@@ -248,9 +248,10 @@
                     , toolbar: '#toolbarDemo'
                     , cellMinWidth: 120
                     , limit: Number.MAX_VALUE // 鏁版嵁琛ㄦ牸榛樿鍏ㄩ儴鏄剧ず
+                    , totalRow: true
                     , height: 'full-70'
                     , cols: [[
-                        { type: 'checkbox', fixed: 'left' }
+                        { type: 'checkbox', fixed: 'left', totalRowText: '鍚堣' }
                         , { field: '娴佽浆鍗″彿', title: '娴佽浆鍗″彿', width: 160 }
                         , { field: '鍞竴ID', title: '鍞竴ID', width: 160 }
                         , { field: '鐢熶骇璁㈠崟鍙�', title: '鎵瑰彿', width: 160 }
@@ -259,11 +260,11 @@
                         , { 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: 200 }
-                        , { field: '鏁存壒', title: '鏁存壒', width: 160 }
-                        , { field: '鎶ュ簾鏁伴噺', title: '鎶ュ簾', width: 160 }
+                        , { field: '鏁存壒', title: '鏁存壒', width: 160, totalRow: true }
+                        , { field: '鎶ュ簾鏁伴噺', title: '鎶ュ簾', width: 160, totalRow: true}
                         , { field: '姹囨姤鍗曟暟閲�', title: '姹囨姤鍗曟暟閲�', width: 160 }
-                        , { field: '鍏ュ簱', title: '鍏ュ簱', width: 200 }
-                        , { field: '鍦ㄥ埗', title: '鍦ㄥ埗', width: 200 }
+                        , { field: '鍏ュ簱', title: '鍏ュ簱', width: 200, totalRow: true}
+                        , { field: '鍦ㄥ埗', title: '鍦ㄥ埗', width: 200, totalRow: true }
                         , { field: '宸ュ簭', title: '宸ュ簭', width: 200 }
                         , { field: '鐝粍', title: '鐝粍', width: 200 }
                         , { field: '鐘舵��', title: '鐘舵��', width: 200 }
@@ -272,6 +273,25 @@
                         , { field: '閿�鍞鍗曞彿', title: '閿�鍞崟鍙�', width: 160 }
                         , { field: '绛夌骇', title: '绛夌骇', width: 160 }
                     ]]
+                    ,done: function (res) {
+                        var count = 0;
+                        var HBillNo = "";
+                        for (var i = 0; i < res.data.length; i++) {
+                            if (res.data[i]["娴佽浆鍗″彿"] != HBillNo) {
+                                count += res.data[i]["鏁存壒"];
+                                HBillNo = res.data[i]["娴佽浆鍗″彿"];
+                            }
+                        }
+                        var divArr = $(".layui-table-total div.layui-table-cell");
+                        $.each(divArr, function (index, item) {
+                            var _div = $(item);
+                            var content = _div.html();
+                            if (index == 9) {
+                                content = count;
+                            }
+                            _div.html(content);
+                        });
+                    }
                 };
             }
 
@@ -285,6 +305,18 @@
                     success: function (data1) {
                         if (data1.count == 1) {
                             option.data = data1.data;
+                            //var num = 0;
+                            //for (let i = 0; i < data1.data.length; i++) {
+                            //    for (let j = i + 1; j < data1.data.length; j++) {
+                            //        if (data1.data[i].娴佽浆鍗″彿 === data1.data[j].娴佽浆鍗″彿) {
+                            //            //num += data1.data[i].鏁存壒;
+                            //            //data1.data[i].filter(() => {
+                            //            //    return 
+                            //            //})
+                            //            data1.data[j].鏁存壒 = '';
+                            //        }
+                            //    }
+                            //}
                             table.render(option);
                             layer.close(wait);
                         } else {
@@ -418,7 +450,9 @@
                             dataCol = data1.data[0].HGridString.split(',');
 
                             for (var i = 0; i < option.cols[0].length - 2; i++) {
-                                var dataCols = dataCol[i].split('|');
+                                if (dataCol[i]) {
+                                    var dataCols = dataCol[i].split('|');
+                                }
                                 //闅愯棌鍒�
                                 if (dataCols[1] == 1) {
                                     option.cols[0][i + 1]["hide"] = true;

--
Gitblit v1.9.1