From 2a43b84a4746c2770b2c569d224d175eb8e54d31 Mon Sep 17 00:00:00 2001 From: xd <844539747@qq.com> Date: Mon, 13 May 2024 16:03:01 +0800 Subject: [PATCH] '123' --- .../controller/redBook/RedBookController.java | 16 +++ .../java/com/ruoyi/redBook/domain/OAQuot.java | 5 + .../ruoyi/redBook/mapper/OARedBookMapper.java | 8 ++ .../redBook/service/IRedBookService.java | 8 ++ .../service/impl/RedBookServiceImpl.java | 12 +++ .../mapper/redBook/OARedBookMapper.xml | 17 ++++ ruoyi-ui/src/api/redBook/redBook.js | 10 ++ ruoyi-ui/src/views/redBook/productSelect.vue | 18 +++- ruoyi-ui/src/views/redBook/quots.vue | 99 +++++++++++++++++++ 9 files changed, 192 insertions(+), 1 deletion(-) create mode 100644 ruoyi-ui/src/views/redBook/quots.vue diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java index accff63..02bed16 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/redBook/RedBookController.java @@ -5,11 +5,13 @@ import com.ruoyi.common.annotation.Log; import com.ruoyi.common.constant.CacheConstants; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.DataSourceType; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.uuid.UUID; +import com.ruoyi.customer.domain.Customer; import com.ruoyi.redBook.domain.OAQuotProduct; import com.ruoyi.redBook.domain.Product; import com.ruoyi.redBook.domain.OAQuot; @@ -18,6 +20,7 @@ import com.ruoyi.redBook.service.IRedBookService; import com.ruoyi.web.utils.IdUtils; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.*; @@ -280,4 +283,17 @@ public class RedBookController extends BaseController logger.info("根据选择的调价日期 匹配数据结果: {}", oaQuotProducts); return success(oaQuotProducts); } + + + /** + * 查询已生成的报价单列表 + */ + @DataSource(DataSourceType.MASTER) + @GetMapping("/listQuots") + public TableDataInfo listQuots(OAQuot oaQuot) + { + startPage(); + List list = redBookService.listQuots(oaQuot); + return getDataTable(list); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/OAQuot.java b/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/OAQuot.java index 3c60eb1..f6a623a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/OAQuot.java +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/domain/OAQuot.java @@ -11,6 +11,7 @@ public class OAQuot extends BaseEntity { private String quotProject;//报价项目 private String quotLxr;//联系人 private String quotLxrdh;//联系人电话 + private String totalPrice;//总金额 private List selectedResultData; @@ -54,6 +55,10 @@ public class OAQuot extends BaseEntity { this.quotLxrdh = quotLxrdh; } + public String getTotalPrice() { return totalPrice; } + + public void setTotalPrice(String totalPrice) { this.totalPrice = totalPrice; } + public List getSelectedResultData() { return selectedResultData; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/redBook/mapper/OARedBookMapper.java b/ruoyi-system/src/main/java/com/ruoyi/redBook/mapper/OARedBookMapper.java index 254d63f..3bdfc69 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/redBook/mapper/OARedBookMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/mapper/OARedBookMapper.java @@ -1,5 +1,6 @@ package com.ruoyi.redBook.mapper; +import com.ruoyi.customer.domain.Customer; import com.ruoyi.material.domain.CMaterial; import com.ruoyi.material.domain.CMaterialCost; import com.ruoyi.material.domain.temp; @@ -100,4 +101,11 @@ public interface OARedBookMapper * @return */ List queryRedBPriceByParams(@Param("params") List params); + + /** + * 查询已生成的报价单列表 + * @param oaQuot + * @return + */ + List listQuots(OAQuot oaQuot); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/redBook/service/IRedBookService.java b/ruoyi-system/src/main/java/com/ruoyi/redBook/service/IRedBookService.java index 2ad78d0..3c3eae5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/redBook/service/IRedBookService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/service/IRedBookService.java @@ -2,6 +2,7 @@ package com.ruoyi.redBook.service; import com.ruoyi.common.annotation.DataSource; import com.ruoyi.common.enums.DataSourceType; +import com.ruoyi.customer.domain.Customer; import com.ruoyi.quote.domain.CalculateRBParamDto; import com.ruoyi.redBook.domain.OAQuot; import com.ruoyi.redBook.domain.OAQuotProduct; @@ -93,4 +94,11 @@ public interface IRedBookService * @return */ List queryRedBPriceByParams(List params); + + /** + * 查询已生成的报价单列表 + * @param oaQuot + * @return + */ + List listQuots(OAQuot oaQuot); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/RedBookServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/RedBookServiceImpl.java index 2e39e62..d3e66dc 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/RedBookServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/redBook/service/impl/RedBookServiceImpl.java @@ -1,5 +1,6 @@ package com.ruoyi.redBook.service.impl; +import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.uuid.UUID; @@ -166,4 +167,15 @@ public class RedBookServiceImpl implements IRedBookService public List queryRedBPriceByParams(List params) { return oaRedBookMapper.queryRedBPriceByParams(params); } + + /** + * 查询已生成的报价单列表 + * @param oaQuot + * @return + */ + @Override + @DataScope(deptAlias = "d", userAlias = "u") + public List listQuots(OAQuot oaQuot) { + return oaRedBookMapper.listQuots(oaQuot); + } } diff --git a/ruoyi-system/src/main/resources/mapper/redBook/OARedBookMapper.xml b/ruoyi-system/src/main/resources/mapper/redBook/OARedBookMapper.xml index 94901d2..9a6e65a 100644 --- a/ruoyi-system/src/main/resources/mapper/redBook/OARedBookMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/redBook/OARedBookMapper.xml @@ -89,6 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" quotProject, quotLxr, quotLxrdh, + totalPrice, create_by, create_time @@ -99,6 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{quotProject}, #{quotLxr}, #{quotLxrdh}, + #{totalPrice}, #{createBy}, getdate() @@ -134,4 +136,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND a.电压等级 = v.电压等级 + + + LEFT JOIN sys_user u on u.user_name=a.create_by + LEFT JOIN sys_dept d on u.dept_id = d.dept_id + + + diff --git a/ruoyi-ui/src/api/redBook/redBook.js b/ruoyi-ui/src/api/redBook/redBook.js index 2e955a9..702396f 100644 --- a/ruoyi-ui/src/api/redBook/redBook.js +++ b/ruoyi-ui/src/api/redBook/redBook.js @@ -138,6 +138,16 @@ export function updateSelectedResultData(data) { } +/** 已生成的报价单列表 */ +export function listQuots(query) { + return request({ + url: '/redBook/redBook/listQuots', + method: 'get', + params: query + }) +} + + diff --git a/ruoyi-ui/src/views/redBook/productSelect.vue b/ruoyi-ui/src/views/redBook/productSelect.vue index 91e71a4..d5a6cdc 100644 --- a/ruoyi-ui/src/views/redBook/productSelect.vue +++ b/ruoyi-ui/src/views/redBook/productSelect.vue @@ -65,6 +65,7 @@ :limit.sync="searchResultPageSize" @size-change="handleSearchResultSizeChange" @current-change="handleSearchResultCurrentChange" + :layout="'total, sizes, prev, pager, next'" /> @@ -96,6 +97,9 @@ + + + @@ -257,7 +261,7 @@ perc2: '', //表单 - form: {}, + form: {totalPrice: ''}, //调价日期选择 versionList: [], // 国家数据列表 @@ -622,6 +626,8 @@ // 报价单保存 handleSaveClick() { + const allPrice = this.selectedResultData.reduce((sum, row) => sum + parseFloat(row.allPrice), 0); + this.form.totalPrice = allPrice.toFixed(2); this.form.selectedResultData = this.selectedResultData; saveQuot(this.form).then(response => { this.$modal.msgSuccess("保存报价单成功,单号:"+response.data.quotCode); @@ -629,6 +635,11 @@ }, // 报价单生成 handleMadeQuotClick() { + if(this.selectedResultData.length==0){ + this.$modal.msgWarning("未选择报价产品信息"); + return; + } + this.form.selectedResultData = this.selectedResultData; madeQuot(this.form).then(response => { this.$modal.msgSuccess("生成报价单成功"); @@ -662,6 +673,11 @@ }, //选择调价日期 selectRbDate(uid){ + if(this.selectedResultData.length==0){ + this.$modal.msgWarning("未选择报价产品信息"); + return; + } + this.selectedResultData.forEach((row, index) => { this.$set(this.selectedResultData, index, { ...row, diff --git a/ruoyi-ui/src/views/redBook/quots.vue b/ruoyi-ui/src/views/redBook/quots.vue new file mode 100644 index 0000000..f767dc7 --- /dev/null +++ b/ruoyi-ui/src/views/redBook/quots.vue @@ -0,0 +1,99 @@ + + + + +