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* + required > @@ -673,22 +673,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) + // }) + // + // }); + // }) } @@ -701,7 +701,7 @@ str += ` ` }) $('#industryTypeBox').html(` - ${str} @@ -713,7 +713,7 @@ str += ` ` }) $('#industryTypeBox').html(` - ${str} diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java index 707d5bfe..2bc68ec6 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/ProjectOrderInfoServiceImpl.java @@ -29,6 +29,7 @@ import com.ruoyi.sip.domain.*; import com.ruoyi.sip.dto.HomepageQueryDto; import com.ruoyi.sip.dto.OrderExcelNumStaticsDto; import com.ruoyi.sip.dto.StatisticsDetailDto; +import com.ruoyi.sip.mapper.ProjectInfoMapper; import com.ruoyi.sip.service.*; import lombok.extern.slf4j.Slf4j; import org.apache.poi.ss.usermodel.*; @@ -37,6 +38,8 @@ import org.springframework.stereotype.Service; import com.ruoyi.sip.mapper.ProjectOrderInfoMapper; import com.ruoyi.common.core.text.Convert; +import javax.annotation.Resource; + import static com.ruoyi.sip.service.impl.ProjectInfoServiceImpl.INDUSTRY_TYPE_DICT_TYPE; import static com.ruoyi.sip.service.impl.ProjectInfoServiceImpl.INDUSTRY_TYPE_YYS_DICT_TYPE; @@ -58,6 +61,8 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService { private IProjectProductInfoService productInfoService; @Autowired private ICnareaService cnareaService; + @Resource + private ProjectInfoMapper projectInfoMapper; private static final List MAINTENANCE_SERVICES = Arrays.asList("8813A3YA", "8813A3YB", "8813A7U4", "8813A7U2"); private static final List DEPLOY_SERVICES = Arrays.asList("8814A0BT"); @@ -210,6 +215,15 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService { // String orderNumber = generateOrderNumber(projectOrderInfo.getProjectId()); // projectOrderInfo.setOrderCode(orderNumber); // } + //更新BG属性 + ProjectInfo projectInfo = new ProjectInfo(); + projectInfo.setId(projectOrderInfo.getProjectId()); + projectInfo.setBgProperty(projectOrderInfo.getBgProperty()); + projectInfo.setIndustryType(projectOrderInfo.getIndustryType()); + projectInfo.setUpdateBy(ShiroUtils.getUserId().toString()); + projectInfo.setUpdateTime(DateUtils.getNowDate()); + projectInfoMapper.updateProjectInfo(projectInfo); + //不更新订单编号 projectOrderInfo.setOrderCode(null); projectOrderInfo.setUpdateBy(ShiroUtils.getUserId().toString());