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..b4e2b22b 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 @@ -71,6 +71,7 @@ public class ReportDataController extends BaseController { } String info = JSONArray.toJSONString(list); // System.out.println(info); + System.out.println("条码信息查询Json格式:"+info); return info; } } 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..8c8c5258 100644 --- a/ruoyi-admin/src/main/resources/templates/nanjing/Report/Report.html +++ b/ruoyi-admin/src/main/resources/templates/nanjing/Report/Report.html @@ -51,18 +51,18 @@ processData: false, contentType: false, success: function (json) { + console.log("条码信息查询Json格式"+json); var coulmnsData = []; var columnsArray = []; - columnsArray.push({field : "barcode",title : "产品条码",colspan: 1,rowspan: 2}); + columnsArray.push({field : "barcode",title : "产品条码",align:"center"}); var columns = []; if(json.length>0){ 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({ + columnsArray.push({ "title": property, - "field": property+'value', - switchable: true, + "field": property+"value", align:"center", } ); @@ -70,21 +70,21 @@ } } - coulmnsData.push(columnsArray); - coulmnsData.push(columns); - // console.log(columnsArray); + //coulmnsData.push(columnsArray); + //coulmnsData.push(columns); + console.log(columnsArray); $('#bootstrap-table').bootstrapTable('destroy').bootstrapTable({ id: "bootstrap-table", data:json, toolbar: "#toolbar", singleSelect: false, - // clickToSelect: true, + clickToSelect: true, sortName: "barcode", sortOrder: "desc", pageSize: 15, pageNumber: 1, pageList: "[10, 15,25, 50, 100, All]", - // showToggle: true, + showToggle: true, showRefresh: true, showColumns: true, search: false, @@ -93,9 +93,9 @@ fixedColumns: true, fixedNumber: 4, fixedLeftNumber: 4, - columns: coulmnsData + columns: columnsArray }); - // columnsArray.push(); + columnsArray.push(); }, error: function () { alert("错误");