From dc31d20a6c22a3451ca82756602abb667a23bb94 Mon Sep 17 00:00:00 2001
From: chenhao <852066789@qq.com>
Date: Wed, 2 Jul 2025 16:41:42 +0800
Subject: [PATCH] =?UTF-8?q?refactor(project):=20=E9=87=8D=E6=9E=84?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E5=88=97=E8=A1=A8=E5=88=A0=E9=99=A4=E9=80=BB?=
=?UTF-8?q?=E8=BE=91=E5=B9=B6=E4=BC=98=E5=8C=96=E8=A1=8C=E4=B8=9A=E7=B1=BB?=
=?UTF-8?q?=E5=9E=8B=E9=80=89=E6=8B=A9-=20=E7=A7=BB=E9=99=A4=E4=BA=A7?=
=?UTF-8?q?=E5=93=81=E5=88=97=E8=A1=A8=E7=9A=84=E5=88=A0=E9=99=A4=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=20-=20=E8=A7=A3=E9=99=A4=E8=A1=8C=E4=B8=9A=E7=B1=BB?=
=?UTF-8?q?=E5=9E=8B=E9=80=89=E6=8B=A9=E6=A1=86=E7=9A=84=E5=8F=AA=E8=AF=BB?=
=?UTF-8?q?=E9=99=90=E5=88=B6=20-=20=E6=9B=B4=E6=96=B0=E4=BA=A7=E5=93=81?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E7=B4=A2=E5=BC=95=E9=87=8D=E7=BD=AE?=
=?UTF-8?q?=E9=80=BB=E8=BE=91=20-=20=E4=BF=AE=E6=AD=A3=E4=BA=A7=E5=93=81?=
=?UTF-8?q?=E9=80=89=E6=8B=A9=E5=92=8C=E6=98=BE=E7=A4=BA=E7=9B=B8=E5=85=B3?=
=?UTF-8?q?=E9=97=AE=E9=A2=98=20-=20=E4=BC=98=E5=8C=96=E8=AE=A2=E5=8D=95?=
=?UTF-8?q?=E4=BF=A1=E6=81=AF=E4=BF=9D=E5=AD=98=E9=80=BB=E8=BE=91=EF=BC=8C?=
=?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=A1=B9=E7=9B=AEBG=E5=B1=9E=E6=80=A7?=
=?UTF-8?q?=E5=92=8C=E8=A1=8C=E4=B8=9A=E7=B1=BB=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../templates/layout/product-list.html | 67 +++++++++++++------
.../resources/templates/project/info/add.html | 32 ++++-----
.../templates/project/info/edit.html | 32 ++++-----
.../templates/project/order/add.html | 32 ++++-----
.../templates/project/order/edit.html | 48 ++++++-------
.../impl/ProjectOrderInfoServiceImpl.java | 14 ++++
6 files changed, 131 insertions(+), 94 deletions(-)
diff --git a/ruoyi-admin/src/main/resources/templates/layout/product-list.html b/ruoyi-admin/src/main/resources/templates/layout/product-list.html
index 771df480..0a4b0f23 100644
--- a/ruoyi-admin/src/main/resources/templates/layout/product-list.html
+++ b/ruoyi-admin/src/main/resources/templates/layout/product-list.html
@@ -98,21 +98,44 @@
const FOLD_ON_FOLD = 0.988;
document.addEventListener("DOMContentLoaded", function () {
// 初始化删除逻辑等
- $('.productTable .delRow').on('click', function () {
- let ele = $(this);
- $.modal.confirm('是否确认删除', function () {
- $(ele).parent().parent().remove();
- updateIndices();
- });
- });
+ // $('.productTable .delRow').on('click', function () {
+ // let ele = $(this);
+ // $.modal.confirm('是否确认删除', function () {
+ // $(ele).parent().parent().remove();
+ // updateIndices();
+ // });
+ // });
- function updateIndices() {
- $('#productTable tbody tr').each(function (index) {
- $(this).find('.indexBox').text(index + 1);
- });
- }
});
+ function delProductRow(that){
+ top.layer.confirm('是否确认删除', {
+ icon: 3,
+ id:'delProductRow'+Math.random(),
+ title: "系统提示",
+ btn: ['确认', '取消']
+ }, function (index) {
+ $.modal.close(index);
+ $(that).parent().parent().remove();
+ updateIndices();
+ });
+ }
+ function updateIndices() {
+ $('.productTable').each(function () {
+ $(this).find("tbody tr").each(function(index){
+ $(this).find('.indexBox').text(index + 1);
+ $(this).find('input, textarea').each(function() {
+ let name = $(this).attr('name');
+ if (name && name.includes("ProductInfoList")) {
+ // 替换名称中的索引值为新的索引
+ let newName = name.replace(/ProductInfoList\[\d+\]/, 'ProductInfoList[' + index + ']');
+ $(this).attr('name', newName);
+ }
+ });
+ })
+
+ });
+ }
function setOrderPriceData(){
let allPrice=0.00;
$('#productTable tbody').find('tr').find('.allPrice').each(function (index) {
@@ -140,8 +163,8 @@
let tr = $(`
${length + 1} |
- |
- |
+ |
+ |
|
|
@@ -169,11 +192,11 @@
|
|
-删除 |
+删除 |
`)
$('#productTable tbody').append(tr)
- initSearchProduct('1')
+ // initSearchProduct('1')
initPrice()
}
@@ -186,8 +209,8 @@
let tr = $(`
${length + 1} |
- |
- |
+ |
+ |
|
|
@@ -215,11 +238,11 @@
|
|
-删除 |
+删除 |
`)
$('#productTable2 tbody').append(tr)
- initSearchProduct('2')
+ // initSearchProduct('2')
initPrice()
}
@@ -264,11 +287,11 @@
|
-删除 |
+删除 |
`)
$('#productTable3 tbody').append(tr)
- initSearchProduct('11,22,99')
+ // initSearchProduct('11,22,99')
initPrice()
}
function getData(that,name){
diff --git a/ruoyi-admin/src/main/resources/templates/project/info/add.html b/ruoyi-admin/src/main/resources/templates/project/info/add.html
index cdbe5f73..1069ef82 100644
--- a/ruoyi-admin/src/main/resources/templates/project/info/add.html
+++ b/ruoyi-admin/src/main/resources/templates/project/info/add.html
@@ -540,22 +540,22 @@
}
function initSearchProduct(type) {
- $('.productTable .delRow').on('click', function () {
- let ele = $(this)
- $.modal.confirm('是否确认删除', function () {
- $(ele).parent().parent().remove()
- $('#productTable tbody tr').each((index, item) => {
- $(item).find('.indexBox').text(index + 1)
- })
- $('#productTable2 tbody tr').each((index, item) => {
- $(item).find('.indexBox').text(index + 1)
- })
- $('#productTable3 tbody tr').each((index, item) => {
- $(item).find('.indexBox').text(index + 1)
- })
-
- });
- })
+ // $('.productTable .delRow').on('click', function () {
+ // let ele = $(this)
+ // $.modal.confirm('是否确认删除', function () {
+ // $(ele).parent().parent().remove()
+ // $('#productTable tbody tr').each((index, item) => {
+ // $(item).find('.indexBox').text(index + 1)
+ // })
+ // $('#productTable2 tbody tr').each((index, item) => {
+ // $(item).find('.indexBox').text(index + 1)
+ // })
+ // $('#productTable3 tbody tr').each((index, item) => {
+ // $(item).find('.indexBox').text(index + 1)
+ // })
+ //
+ // });
+ // })
}
diff --git a/ruoyi-admin/src/main/resources/templates/project/info/edit.html b/ruoyi-admin/src/main/resources/templates/project/info/edit.html
index bea4228e..54786665 100644
--- a/ruoyi-admin/src/main/resources/templates/project/info/edit.html
+++ b/ruoyi-admin/src/main/resources/templates/project/info/edit.html
@@ -616,22 +616,22 @@
}
function initSearchProduct(type) {
- $('.productTable .delRow').on('click', function () {
- let ele = $(this)
- $.modal.confirm('是否确认删除', function () {
- $(ele).parent().parent().remove()
- $('#productTable tbody tr').each((index, item) => {
- $(item).find('.indexBox').text(index + 1)
- })
- $('#productTable2 tbody tr').each((index, item) => {
- $(item).find('.indexBox').text(index + 1)
- })
- $('#productTable3 tbody tr').each((index, item) => {
- $(item).find('.indexBox').text(index + 1)
- })
-
- });
- })
+ // $('.productTable .delRow').on('click', function () {
+ // let ele = $(this)
+ // $.modal.confirm('是否确认删除', function () {
+ // $(ele).parent().parent().remove()
+ // $('#productTable tbody tr').each((index, item) => {
+ // $(item).find('.indexBox').text(index + 1)
+ // })
+ // $('#productTable2 tbody tr').each((index, item) => {
+ // $(item).find('.indexBox').text(index + 1)
+ // })
+ // $('#productTable3 tbody tr').each((index, item) => {
+ // $(item).find('.indexBox').text(index + 1)
+ // })
+ //
+ // });
+ // })
}
diff --git a/ruoyi-admin/src/main/resources/templates/project/order/add.html b/ruoyi-admin/src/main/resources/templates/project/order/add.html
index e37c2830..ccd5bcd2 100644
--- a/ruoyi-admin/src/main/resources/templates/project/order/add.html
+++ b/ruoyi-admin/src/main/resources/templates/project/order/add.html
@@ -637,22 +637,22 @@
}
function initSearchProduct() {
- $('.productTable .delRow').on('click', function () {
- let ele = $(this)
- $.modal.confirm('是否确认删除', function () {
- $(ele).parent().parent().remove()
- $('#productTable tbody tr').each((index, item) => {
- $(item).find('.indexBox').text(index + 1)
- })
- $('#productTable2 tbody tr').each((index, item) => {
- $(item).find('.indexBox').text(index + 1)
- })
- $('#productTable3 tbody tr').each((index, item) => {
- $(item).find('.indexBox').text(index + 1)
- })
-
- });
- })
+ // $('.productTable .delRow').on('click', function () {
+ // let ele = $(this)
+ // $.modal.confirm('是否确认删除', function () {
+ // $(ele).parent().parent().remove()
+ // $('#productTable tbody tr').each((index, item) => {
+ // $(item).find('.indexBox').text(index + 1)
+ // })
+ // $('#productTable2 tbody tr').each((index, item) => {
+ // $(item).find('.indexBox').text(index + 1)
+ // })
+ // $('#productTable3 tbody tr').each((index, item) => {
+ // $(item).find('.indexBox').text(index + 1)
+ // })
+ //
+ // });
+ // })
}
diff --git a/ruoyi-admin/src/main/resources/templates/project/order/edit.html b/ruoyi-admin/src/main/resources/templates/project/order/edit.html
index 8b3b77ae..3c34d82e 100644
--- a/ruoyi-admin/src/main/resources/templates/project/order/edit.html
+++ b/ruoyi-admin/src/main/resources/templates/project/order/edit.html
@@ -73,9 +73,9 @@
position: relative;
}
- [name="bgProperty"], #industryTypeBox select {
- pointer-events: none;
- }
+ /*[name="bgProperty"], #industryTypeBox select {*/
+ /* pointer-events: none;*/
+ /*}*/
#projectNameBox {
margin-left: 20px;
@@ -139,8 +139,8 @@
BG* |
|