From 64f90f56a8102ea508be952649b713a03b550de8 Mon Sep 17 00:00:00 2001 From: Limy <1353020654@qq.com> Date: Sun, 7 Mar 2021 20:50:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E8=A1=8C=E8=BD=AC=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nanjing/ReportDataController.java | 7 +++++-- .../templates/nanjing/Report/Report.html | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/ReportDataController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/ReportDataController.java index a19cc2b1..202f361d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/ReportDataController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/nanjing/ReportDataController.java @@ -59,8 +59,11 @@ public class ReportDataController extends BaseController { for (String param:paraNameList) { for (ReportData rpd:reportDataList) { if (rpd.getBarcode().equals(item)&&rpd.getParameaning().equals(param)){ - map1.put(param,rpd.getParameaning()); - map1.put(param+"value",rpd.getValue()); + if(rpd.getValue()==null){ + rpd.setValue("-"); + } + map1.put(param,rpd.getValue()); +// map1.put(param+"value",rpd.getValue()); break; } } diff --git a/ruoyi-admin/src/main/resources/templates/nanjing/Report/Report.html b/ruoyi-admin/src/main/resources/templates/nanjing/Report/Report.html index 7d0f44fb..294eed83 100644 --- a/ruoyi-admin/src/main/resources/templates/nanjing/Report/Report.html +++ b/ruoyi-admin/src/main/resources/templates/nanjing/Report/Report.html @@ -51,17 +51,18 @@ processData: false, contentType: false, success: function (json) { - var coulmnsData = []; + // var coulmnsData = []; var columnsArray = []; - columnsArray.push({field : "barcode",title : "产品条码",colspan: 1,rowspan: 2}); - var columns = []; + columnsArray.push({field : "barcode",title : "产品条码",colspan: 1,rowspan: 1}); + // var columns = []; if(json.length>0){ + // console.log(Object.keys(json[0]).length); for (var i = 0; i < (Object.keys(json[0])).length; i++) {//Object.keys(obj) 获取key名称 var property = (Object.keys(json[0]))[i];//id username - if(property!='barcode'&&!(property.endsWith("value"))){ - columns.push({ + if(property!='barcode'){ + columnsArray.push({ "title": property, - "field": property+'value', + "field": property, switchable: true, align:"center", } @@ -70,8 +71,8 @@ } } - coulmnsData.push(columnsArray); - coulmnsData.push(columns); + // coulmnsData.push(columnsArray); + // coulmnsData.push(columns); // console.log(columnsArray); $('#bootstrap-table').bootstrapTable('destroy').bootstrapTable({ id: "bootstrap-table", @@ -93,7 +94,7 @@ fixedColumns: true, fixedNumber: 4, fixedLeftNumber: 4, - columns: coulmnsData + columns: columnsArray }); // columnsArray.push(); },