diff --git a/ruoyi-admin/src/main/resources/templates/manage/order/add.html b/ruoyi-admin/src/main/resources/templates/manage/order/add.html index 7317ef68..c8d43b08 100644 --- a/ruoyi-admin/src/main/resources/templates/manage/order/add.html +++ b/ruoyi-admin/src/main/resources/templates/manage/order/add.html @@ -227,7 +227,7 @@ align: 'center', title: '产品名称', formatter: function (value, row, index) { - var html = $.common.sprintf("
%s
", value); + var html = $.common.sprintf("", index, value); return html; } }, @@ -253,9 +253,9 @@ field: 'discount', align: 'center', title: '折扣', - width: 70, + width: 90, formatter: function (value, row, index) { - var html = $.common.sprintf("", index, value); + var html = $.common.sprintf("", index, value); return html; } }, @@ -298,10 +298,11 @@ function addRow(row) { var count = $("#" + table.options.id).bootstrapTable('getData').length; - var row = { + var newRow = { index: $.table.serialNumber(count), productId: row.productId, productCode: row.productCode, + productName: row.productName, quantity: row.quantity, price: row.price, amount: row.amount, @@ -311,7 +312,7 @@ deletedAt: row.deletedAt, discount: row.discount, } - sub.addRow(row); + sub.addRow(newRow); } @@ -421,6 +422,7 @@ let data = JSON.parse(res.currentTarget.response) if (data.code === 0) { $.modal.msgSuccess('导入成功'); + data.data.forEach((row) => { addRow(row) }) diff --git a/ruoyi-admin/src/main/resources/templates/manage/order/edit.html b/ruoyi-admin/src/main/resources/templates/manage/order/edit.html index 606ebb80..f8fd060c 100644 --- a/ruoyi-admin/src/main/resources/templates/manage/order/edit.html +++ b/ruoyi-admin/src/main/resources/templates/manage/order/edit.html @@ -425,8 +425,9 @@ field: 'discount', align: 'center', title: '折扣', + width:90, formatter: function (value, row, index) { - var html = $.common.sprintf("", index, value); + var html = $.common.sprintf("", index, value); return html; } }, diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/OrderInfoController.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/OrderInfoController.java index 1dda344c..91bc9d22 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/OrderInfoController.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/controller/OrderInfoController.java @@ -2,8 +2,10 @@ package com.ruoyi.sip.controller; import java.io.File; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.Set; +import java.util.function.Function; import java.util.stream.Collectors; import cn.hutool.core.collection.CollUtil; @@ -218,9 +220,16 @@ public class OrderInfoController extends BaseController } //只处理当前产品表有的数据 List