From 11c8a0a9f8fd158328b3882a0a2de81fb00f6a35 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Fri, 22 Nov 2024 17:09:30 +0800 Subject: [PATCH 1/4] =?UTF-8?q?[feat]=E9=87=87=E8=B4=AD=E7=AE=A1=E7=90=86?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E9=87=87=E8=B4=AD=E6=8A=A5=E4=BB=B7?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A1=B5=E9=9D=A2=E9=A1=B5=E9=9D=A2=E9=94=99?= =?UTF-8?q?=E4=B9=B1=E9=97=AE=E9=A2=98=EF=BC=9B=E9=87=87=E8=B4=AD=E6=8A=A5?= =?UTF-8?q?=E4=BB=B7=E7=89=A9=E6=96=99=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E6=9C=80=E6=96=B0=E6=8A=A5=E4=BB=B7=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E6=95=B0=E6=8D=AE=EF=BC=9B=E6=96=B0=E5=A2=9E=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E6=8F=92=E5=85=A5=E7=89=A9=E6=96=99=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=EF=BC=8C=E9=87=87=E7=94=A8=E5=BC=82=E6=AD=A5=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=AF=B9=E6=9C=80=E6=96=B0=E6=8A=A5=E4=BB=B7?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9A=84=E5=A1=AB=E5=85=85=EF=BC=9B=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20=E6=9F=A5=E6=89=BE=E6=9C=80=E6=96=B0=E7=9A=84?= =?UTF-8?q?=E6=8A=A5=E4=BB=B7=E6=95=B0=E6=8D=AE=E5=89=8D=E7=AB=AF=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=9B=E6=96=B0=E5=A2=9E=E6=9C=80=E6=96=B0=E6=8A=A5?= =?UTF-8?q?=E4=BB=B7=E5=8E=86=E5=8F=B2=E5=89=8D=E7=AB=AF=E6=96=B9=E6=B3=95?= =?UTF-8?q?=20=E9=87=87=E8=B4=AD=E6=8A=A5=E4=BB=B7Controller=E5=B1=82?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E6=89=93=E5=BC=80=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E6=8A=A5=E4=BB=B7=E5=8E=86=E5=8F=B2=E5=BC=B9=E7=AA=97=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=8C=E6=96=B0=E5=A2=9E=20=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=8A=A5=E4=BB=B7=E5=8E=86=E5=8F=B2=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=96=B9=E6=B3=95=EF=BC=9B=E6=96=B0=E5=A2=9E=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=9C=80=E6=96=B0=E6=8A=A5=E4=BB=B7=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=96=B9=E6=B3=95=EF=BC=8C=20=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E6=8A=A5=E4=BB=B7=E5=AE=9E=E4=BD=93=E7=B1=BB=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=B8=8D=E5=90=AB=E7=A8=8E=E5=8D=95=E4=BB=B7=E5=92=8C?= =?UTF-8?q?=E5=90=AB=E7=A8=8E=E5=8D=95=E4=BB=B7=E9=94=99=E4=B9=B1=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20=E4=BF=AE=E5=A4=8D=E6=89=80=E6=9C=89=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E6=8A=A5=E4=BB=B7=E5=8E=86=E5=8F=B2url=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E9=97=AE=E9=A2=98=20=E6=96=B0=E5=A2=9E=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E6=8A=A5=E4=BB=B7=E5=8E=86=E5=8F=B2=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/PurchaseQuoteController.java | 64 +++++++ .../PurchaseQuoteHistoryController.java | 13 +- .../purchase/domain/PurchaseQuoteHistory.java | 8 +- .../impl/PurchaseQuoteServiceImpl.java | 4 +- .../purchase/PurchaseQuoteHistoryMapper.xml | 12 +- .../templates/purchase/purchaseQuote/add.html | 166 ++++++++++++++---- .../purchaseQuote/recentQuotationHistory.html | 74 ++++++++ .../purchase/purchaseQuoteHistory/add.html | 2 +- .../purchaseQuoteHistory.html | 2 +- 9 files changed, 280 insertions(+), 65 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/recentQuotationHistory.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseQuoteController.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseQuoteController.java index 7c6f5c0d..c30843e4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseQuoteController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseQuoteController.java @@ -1,7 +1,9 @@ package com.ruoyi.purchase.controller; +import java.math.BigDecimal; import java.util.HashMap; import java.util.List; +import java.util.stream.Collectors; import com.alibaba.fastjson.JSON; import com.ruoyi.ck.utils.Result; @@ -10,7 +12,10 @@ import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.purchase.domain.PurchaseQuoteChild; +import com.ruoyi.purchase.domain.PurchaseQuoteHistory; import com.ruoyi.purchase.domain.Vo.PurchaseQuoteVo; +import com.ruoyi.purchase.service.IPurchaseQuoteHistoryService; +import com.ruoyi.system.domain.SysCustomerQuoteHistory; import com.ruoyi.system.domain.SysSalesOrderChild; import com.ruoyi.system.service.ISysRoleService; import com.ruoyi.system.service.ISysUserService; @@ -51,6 +56,10 @@ public class PurchaseQuoteController extends BaseController @Autowired private IPurchaseQuoteService purchaseQuoteService; + + @Autowired + private IPurchaseQuoteHistoryService purchaseQuoteHistoryService; + @Autowired private ISysRoleService roleService; @@ -310,4 +319,59 @@ public class PurchaseQuoteController extends BaseController purchaseQuoteService.restorePurchaseQuoteById(id); return AjaxResult.success(); } + + + + + + /** + * 打开采购报价历史弹窗 + * */ + @GetMapping("/recentQuotationHistory") + public String history(@RequestParam("materialCode") String materialCode , + @RequestParam("supplierQuoteCode") String supplierQuoteCode, + ModelMap mmap) + { + + mmap.put("materialCode", materialCode); + mmap.put("supplierQuoteCode", supplierQuoteCode); + return prefix + "/recentQuotationHistory"; + } + + /** + * 查询客户报价历史列表 + * */ + @PostMapping("/recentQuotationHistoryList") + @ResponseBody + public TableDataInfo recentQuotationHistoryList(PurchaseQuoteHistory purchaseQuoteHistory) + { + startPage(); + List list = purchaseQuoteHistoryService.selectPurchaseQuoteHistoryList(purchaseQuoteHistory); + return getDataTable(list); + } + + + + + + /** + * 查询最新报价历史数据 + * */ + @GetMapping("/queryLatestRecentQuotation") + @ResponseBody + public AjaxResult recentQuotationHistoryData(@RequestParam("materialNo") String materialNo, @RequestParam("supplierQuoteCode") String supplierQuoteCode) + { + PurchaseQuoteHistory purchaseQuoteHistory = new PurchaseQuoteHistory(); + purchaseQuoteHistory.setMaterialCode(materialNo); + purchaseQuoteHistory.setSupplierCode(supplierQuoteCode); + List purchaseQuoteHistories = purchaseQuoteHistoryService.selectPurchaseQuoteHistoryList(purchaseQuoteHistory); + List filterPurchaseQuoteHistories = purchaseQuoteHistories.stream().filter(item -> "1".equals(item.getIsLatest())).collect(Collectors.toList()); + if (filterPurchaseQuoteHistories.size() == 0) + { + PurchaseQuoteHistory temp = new PurchaseQuoteHistory(); + temp.setMaterialRmb(BigDecimal.ZERO); + return AjaxResult.success(temp); + } + return AjaxResult.success(filterPurchaseQuoteHistories.get(0)); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseQuoteHistoryController.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseQuoteHistoryController.java index b53fa846..9ed1a4c4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseQuoteHistoryController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseQuoteHistoryController.java @@ -1,15 +1,13 @@ package com.ruoyi.purchase.controller; import java.util.List; + +import com.ruoyi.system.domain.SysCustomerQuoteHistory; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.purchase.domain.PurchaseQuoteHistory; @@ -26,10 +24,10 @@ import com.ruoyi.common.core.page.TableDataInfo; * @date 2024-08-28 */ @Controller -@RequestMapping("/purchaseQuoteHistory/purchaseQuoteHistory") +@RequestMapping("/purchase/purchaseQuoteHistory") public class PurchaseQuoteHistoryController extends BaseController { - private String prefix = "purchaseQuoteHistory/purchaseQuoteHistory"; + private String prefix = "purchase/purchaseQuoteHistory"; @Autowired private IPurchaseQuoteHistoryService purchaseQuoteHistoryService; @@ -147,5 +145,4 @@ public class PurchaseQuoteHistoryController extends BaseController return toAjax(purchaseQuoteHistoryService.restorePurchaseQuoteHistoryById(id)); } - } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseQuoteHistory.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseQuoteHistory.java index 8f9ed37a..61c94da5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseQuoteHistory.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseQuoteHistory.java @@ -72,12 +72,12 @@ public class PurchaseQuoteHistory extends BaseEntity @Excel(name = "物料的对外报价") private Long materialSole; - /** 物料的不含税单价(RMB) */ - @Excel(name = "物料的不含税单价(RMB)") - private BigDecimal materialRmb; - /** 物料的含税单价(RMB) */ @Excel(name = "物料的含税单价(RMB)") + private BigDecimal materialRmb; + + /** 物料的不含税单价(RMB) */ + @Excel(name = "物料的不含税单价(RMB)") private BigDecimal materialNormb; /** 供应商编号 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteServiceImpl.java index f0711d4d..dcb4f0b6 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteServiceImpl.java @@ -397,9 +397,7 @@ public class PurchaseQuoteServiceImpl implements IPurchaseQuoteService SysUser user = ShiroUtils.getSysUser(); purchaseQuote.setApplyUser(user.getLoginName()); purchaseQuote.setApplyTime(DateUtils.getNowDate()); - if(purchaseQuote.getPurchaseQuoteId()==null){ - insertPurchaseQuote(purchaseQuote); - } + insertPurchaseQuote(purchaseQuote); // 启动流程 String applyTitle = user.getUserName()+"发起了客户信息提交审批-"+DateUtils.dateTimeNow(); String instanceType = "submit"; diff --git a/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteHistoryMapper.xml b/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteHistoryMapper.xml index 70be7175..749ccf16 100644 --- a/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteHistoryMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteHistoryMapper.xml @@ -30,12 +30,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - select purchase_quote_child_id, purchase_quote_code, material_id, material_code, material_name, material_type, processMethod, brand, photoUrl, describe, tax_rate, usd_rate, material_num, material_sole, material_rmb, material_noRmb, supplier_code, supplier_name, create_by, create_time, update_by, update_time, remark, use_status, audit_status, is_latest,del_flag from purchase_quote_history + select purchase_quote_child_id, purchase_quote_code, material_id, material_code, material_name, material_sole, material_rmb, material_noRmb, supplier_code, supplier_name, create_by, create_time, update_by, update_time, remark, use_status, audit_status, is_latest,del_flag from purchase_quote_history +
+
+
@@ -159,6 +161,16 @@ } }, {title: '最新报价',field: 'materialSole',align: 'center',}, + + { title: '最新报价历史',align: 'center', + + formatter: function (value, row, index) { + var actions = []; + actions.push('最新报价历史 '); + return actions.join(''); + } + }, + {title: '物料的数量', field: 'materialNum',align: 'center',editable: true,visible: false}, {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center', editable:{ @@ -234,48 +246,91 @@ }); getPurchaseQuoteCode(); }); - function doSubmit(index, layero,uniqueId){ + + + + + function doSubmit(index, layero, uniqueId) { var iframeWin = window[layero.find('iframe')[0]['name']]; - var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections'); - var rows = $("#bootstrap-sub-table-1").bootstrapTable('getData').length; - for(var j=0;i { + // 检查是否已经存在相同的料号 + if (materialCodesSet.has(rowData.materialNo) || newMaterialCodesSet.has(rowData.materialNo)) { + $.modal.alertError("不能选择已添加过的相同料号 " + rowData.materialNo); + return Promise.reject("Duplicate material number: " + rowData.materialNo); + } + + // 标记即将插入的物料号 + newMaterialCodesSet.add(rowData.materialNo); + + return queryRecentQuotation(rowData.materialNo) + .then(function(quotationData) { + return { + materialId:rowData.id, + materialCode: rowData.materialNo, + materialName: rowData.materialName, + materialType: rowData.materialType, + describe: rowData.describe, + brand: rowData.brand, + unit: rowData.unit, + processMethod: rowData.processMethod, + materialSole: quotationData.data.materialRmb || '', + photoUrl: rowData.photoUrl, + materialNum: 1, + materialRmb: "", + materialNoRmb: "", + materialNoRmbSum: "", + materialRmbSum: "", + remark: "" + }; + }); + }); + + // 使用 Promise.all 来等待所有请求完成,并将结果直接存入 newRows + Promise.all(promises) + .then(function(newRows) { + // 批量插入新行 + newRows.forEach(function(row) { + $("#bootstrap-sub-table-purchaseQuoteChild").bootstrapTable('insertRow', { index: 1, row: row }); + }); + + layer.close(index); }) - } - layer.close(index); + .catch(function(error) { + console.error('Some requests failed:', error); + layer.close(index); + }); } + + + + function insertRow() { + + if ($("#selectSupplierQuoteCode").val() == null || $("#selectSupplierQuoteCode").val() == '') { + $.modal.alertWarning("请先选择供应商ID"); + return; + } + + + var url = ctx + "erp/material/select"; var options = { title: '选择料号', @@ -378,6 +433,41 @@ values: materialCode }) } + + + //最新报价历史 + function recentQuotationHistory(materialCode){ + var supplierQuoteCode = $("#selectSupplierQuoteCode").val(); + var queryParams = new URLSearchParams(); + queryParams.append("materialCode", materialCode); + queryParams.append("supplierQuoteCode", encodeURIComponent(supplierQuoteCode)); + var url = ctx +'purchase/purchaseQuote/recentQuotationHistory?'+queryParams.toString(); + + $.modal.open("最新报价历史", url); + } + + + + // 查找最新的报价数据 + function queryRecentQuotation(materialNo) { + return new Promise((resolve, reject) => { + // 使用AJAX请求从服务器获取最近的报价信息 + $.ajax({ + url: prefix + '/queryLatestRecentQuotation', + type: 'GET', + data: { materialNo: materialNo, supplierQuoteCode: $("#selectSupplierQuoteCode").val() }, + success: function (data) { + resolve(data); // 成功时解析数据 + }, + error: function (jqXHR, textStatus, errorThrown) { + reject(new Error('查找最新报价数据失败')); // 失败时抛出错误 + } + }); + }); + } + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/recentQuotationHistory.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/recentQuotationHistory.html new file mode 100644 index 00000000..bd685361 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/recentQuotationHistory.html @@ -0,0 +1,74 @@ + + + + + + +
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuoteHistory/add.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuoteHistory/add.html index c2b16bd3..210e5c65 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuoteHistory/add.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuoteHistory/add.html @@ -147,7 +147,7 @@
\ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/recentQuotationHistory.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/recentQuotationHistory.html index bd685361..053becd8 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/recentQuotationHistory.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/recentQuotationHistory.html @@ -29,7 +29,7 @@ showToggle: false, queryParams: { materialCode: materialCode, - supplierQuoteCode: supplierQuoteCode + supplierCode: supplierQuoteCode }, columns: [{ checkbox: true diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskCgjlVerify.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskCgjlVerify.html index 55f67dbf..7f9ee2e3 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskCgjlVerify.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskCgjlVerify.html @@ -46,26 +46,26 @@
- +
- +
- +
- +
@@ -94,7 +94,7 @@
- + %
@@ -118,11 +118,6 @@
-
-
- 选择报价信息 -
-
@@ -251,7 +246,15 @@ } }, {title:'最新报价',field: 'materialSole',align: 'center',}, - {title: '物料的数量', field: 'materialNum',align: 'center',editable: true,visible: false}, + { title: '最新报价历史',align: 'center', + + formatter: function (value, row, index) { + var actions = []; + actions.push('最新报价历史 '); + return actions.join(''); + } + }, + {title: '物料的数量', field: 'materialNum',align: 'center',visible: false}, {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',}, {title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',}, {title: '录入人',field: 'createBy',align: 'center',visible: false}, @@ -323,6 +326,18 @@ minView: "month", autoclose: true }); + + //最新报价历史 + function recentQuotationHistory(materialCode){ + var supplierQuoteCode = $("#supplierQuoteCode").val(); + var queryParams = new URLSearchParams(); + queryParams.append("materialCode", materialCode); + queryParams.append("supplierQuoteCode", encodeURIComponent(supplierQuoteCode)); + var url = ctx +'purchase/purchaseQuote/recentQuotationHistory?'+queryParams.toString(); + + $.modal.open("最新报价历史", url); + } + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskFzjlVerify.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskFzjlVerify.html index d75393dd..09b3962c 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskFzjlVerify.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskFzjlVerify.html @@ -46,26 +46,26 @@
- +
- +
- +
- +
@@ -94,7 +94,7 @@
- + %
@@ -118,11 +118,6 @@
-
-
- 选择报价信息 -
-
@@ -251,7 +246,17 @@ } }, {title:'最新报价',field: 'materialSole',align: 'center',}, - {title: '物料的数量', field: 'materialNum',align: 'center',editable: true,visible: false}, + { title: '最新报价历史',align: 'center', + + formatter: function (value, row, index) { + var actions = []; + actions.push('最新报价历史 '); + return actions.join(''); + } + }, + + + {title: '物料的数量', field: 'materialNum',align: 'center',visible: false}, {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center'}, {title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center'}, {title: '录入人',field: 'createBy',align: 'center',visible: false}, @@ -330,6 +335,18 @@ minView: "month", autoclose: true }); + + //最新报价历史 + function recentQuotationHistory(materialCode){ + var supplierQuoteCode = $("#supplierQuoteCode").val(); + var queryParams = new URLSearchParams(); + queryParams.append("materialCode", materialCode); + queryParams.append("supplierQuoteCode", encodeURIComponent(supplierQuoteCode)); + var url = ctx +'purchase/purchaseQuote/recentQuotationHistory?'+queryParams.toString(); + + $.modal.open("最新报价历史", url); + } + \ No newline at end of file From c386df0c9982dc91eeb85789f724f9af5321d75b Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Sat, 23 Nov 2024 09:00:12 +0800 Subject: [PATCH 4/4] =?UTF-8?q?[feat]=E9=87=87=E8=B4=AD=E7=AE=A1=E7=90=86?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E9=87=87=E8=B4=AD=E6=8A=A5=E4=BB=B7?= =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=EF=BC=9A?= =?UTF-8?q?=E8=A1=A8=E5=A4=B4=E3=80=81=E5=88=97=E8=A1=A8=E3=80=81=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=A0=8F=E8=B0=83=E6=95=B4=E4=B8=BA=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=20=E6=96=B0=E5=A2=9E=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E3=80=81=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2=E3=80=81=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E9=A1=B5=E9=9D=A2=E5=8E=BB=E6=8E=89=E6=B2=A1=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E5=A4=87=E6=B3=A8=E5=AD=97=E6=AE=B5=20=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E6=8A=A5=E4=BB=B7=E5=AD=90=E8=A1=A8=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=20=E9=80=9A=E8=BF=87=E9=87=87=E8=B4=AD=E6=8A=A5=E4=BB=B7?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E6=9F=A5=E6=89=BE=E6=89=80=E6=9C=89=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E6=8A=A5=E4=BB=B7=E5=AD=90=E8=A1=A8=E9=9B=86=E5=90=88?= =?UTF-8?q?=E6=96=B9=E6=B3=95=20=E4=BF=AE=E5=A4=8D=20=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E6=8A=A5=E4=BB=B7=E4=BF=A1=E6=81=AF=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E9=87=87=E8=B4=AD=E6=8A=A5=E4=BB=B7=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E6=8A=A5=E4=BB=B7=E8=AE=B0=E5=BD=95=E6=8A=A5=E9=94=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20=E4=BF=AE=E6=94=B9=E9=87=87=E8=B4=AD=E6=8A=A5?= =?UTF-8?q?=E4=BB=B7=E5=88=86=E9=A1=B5=E6=9F=A5=E8=AF=A2=E6=96=B9=E6=B3=95?= =?UTF-8?q?=EF=BC=9A=E5=8A=A0=E4=B8=8A=E5=AE=A1=E6=A0=B8=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E5=92=8C=E5=AE=A1=E6=A0=B8=E6=8B=92=E7=BB=9D=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=20=E9=87=87=E8=B4=AD=E6=8A=A5=E4=BB=B7Vo=E7=B1=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=E5=BD=93=E5=89=8D=E7=8A=B6=E6=80=81=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchase/domain/Vo/PurchaseQuoteVo.java | 13 +++++++ .../mapper/PurchaseQuoteChildMapper.java | 4 +++ .../impl/PurchaseQuoteHistoryServiceImpl.java | 5 +-- .../impl/PurchaseQuoteServiceImpl.java | 6 ++++ .../purchase/PurchaseQuoteChildMapper.xml | 5 +++ .../templates/purchase/purchaseQuote/add.html | 1 - .../purchase/purchaseQuote/detail.html | 1 - .../purchase/purchaseQuote/edit.html | 1 - .../purchase/purchaseQuote/purchaseQuote.html | 34 ++++++++++++------- .../purchaseQuote/taskCgjlVerify.html | 1 - .../purchaseQuote/taskFzjlVerify.html | 1 - .../purchaseQuote/taskModifyApply.html | 1 - 12 files changed, 53 insertions(+), 20 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/Vo/PurchaseQuoteVo.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/Vo/PurchaseQuoteVo.java index 3468c5cd..153d9b1f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/Vo/PurchaseQuoteVo.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/Vo/PurchaseQuoteVo.java @@ -19,6 +19,11 @@ public class PurchaseQuoteVo extends PurchaseQuote { private String taskId; /** 任务名称 */ private String taskName; + + + // 当前状态 + private String taskStatus; + /** 办理时间 */ private Date doneTime; /** 创建人 */ @@ -96,6 +101,13 @@ public class PurchaseQuoteVo extends PurchaseQuote { this.instanceTypeName = instanceTypeName; } + public String getTaskStatus() { + return taskStatus; + } + + public void setTaskStatus(String taskStatus) { + this.taskStatus = taskStatus; + } @Override public String toString() { @@ -103,6 +115,7 @@ public class PurchaseQuoteVo extends PurchaseQuote { "applyUserName='" + applyUserName + '\'' + ", taskId='" + taskId + '\'' + ", taskName='" + taskName + '\'' + + ", taskStatus='" + taskStatus + '\'' + ", doneTime=" + doneTime + ", createUserName='" + createUserName + '\'' + ", suspendState='" + suspendState + '\'' + diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseQuoteChildMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseQuoteChildMapper.java index 0a24b429..7cb27f49 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseQuoteChildMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseQuoteChildMapper.java @@ -95,4 +95,8 @@ public interface PurchaseQuoteChildMapper * */ List selectQuoteChildBySupplierCode(String supplierCode); + /** + * 通过采购报价编码查找所有采购报价子表集合 + * */ + List selectQuoteChildByPurchaseQuoteCode(String purchaseQuoteCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteHistoryServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteHistoryServiceImpl.java index c7528461..eb478b9d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteHistoryServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteHistoryServiceImpl.java @@ -18,6 +18,7 @@ import com.ruoyi.purchase.mapper.PurchaseQuoteHistoryMapper; import com.ruoyi.purchase.domain.PurchaseQuoteHistory; import com.ruoyi.purchase.service.IPurchaseQuoteHistoryService; import com.ruoyi.common.core.text.Convert; +import org.springframework.transaction.annotation.Transactional; /** * 采购物料历史报价信息Service业务层处理 @@ -199,9 +200,9 @@ public class PurchaseQuoteHistoryServiceImpl implements IPurchaseQuoteHistorySer String loginName = ShiroUtils.getLoginName(); String supplierCode = purchaseQuoteVo.getSupplierQuoteCode(); String auditStatus = purchaseQuoteVo.getAuditStatus(); - + String purchaseQuoteCode = purchaseQuoteVo.getPurchaseQuoteCode(); // 获取所有的子项 - List purchaseQuoteChildList= purchaseQuoteChildMapper.selectQuoteChildBySupplierCode(supplierCode); + List purchaseQuoteChildList= purchaseQuoteChildMapper.selectQuoteChildByPurchaseQuoteCode(purchaseQuoteCode); for (PurchaseQuoteChild purchaseQuoteChild : purchaseQuoteChildList) { PurchaseQuoteHistory purchaseQuoteHistory = new PurchaseQuoteHistory(); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteServiceImpl.java index dcb4f0b6..05b0836a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteServiceImpl.java @@ -148,6 +148,12 @@ public class PurchaseQuoteServiceImpl implements IPurchaseQuoteService } else { purchaseQuoteVo.setTaskName("未启动"); } + purchaseQuoteVo.setTaskStatus(purchaseQuoteVo.getTaskName()); + if(purchaseQuoteVo.getAuditStatus()!=null && purchaseQuoteVo.getAuditStatus().equals("1")){ + purchaseQuoteVo.setTaskStatus("审核通过"); + }else if(purchaseQuoteVo.getAuditStatus()!=null && purchaseQuoteVo.getAuditStatus().equals("2")){ + purchaseQuoteVo.setTaskStatus("审核拒绝"); + } returnList.add(purchaseQuoteVo); } returnList.setTotal(CollectionUtils.isEmpty(list) ? 0 : list.getTotal()); diff --git a/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteChildMapper.xml b/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteChildMapper.xml index 814e8523..9297bcc3 100644 --- a/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteChildMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteChildMapper.xml @@ -90,6 +90,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where supplier_code = #{supplierCode} + + insert into purchase_quote_child diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/add.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/add.html index 14f9bb40..76e67e96 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/add.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/add.html @@ -201,7 +201,6 @@ {title: '录入时间',field: 'createTime',align: 'center',visible: false }, {title: '更新人',field: 'updateBy',align: 'center',visible: false}, {title: '上次更新时间',field: 'updateTime',align: 'center',visible: false}, - {title: '备注',field: 'remark',align: 'center'}, {title: '操作', align: 'center', formatter: function (value, row, index) { var actions = []; diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/detail.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/detail.html index cd98cb9d..85ce9568 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/detail.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/detail.html @@ -218,7 +218,6 @@ {title: '录入时间',field: 'createTime',align: 'center',visible: false }, {title: '更新人',field: 'updateBy',align: 'center',visible: false}, {title: '上次更新时间',field: 'updateTime',align: 'center',visible: false}, - {title: '备注',field: 'remark',align: 'center'}, ], }; $.table.init(options); diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/edit.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/edit.html index 7ff73315..cd658d06 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/edit.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/edit.html @@ -240,7 +240,6 @@ {title: '录入时间',field: 'createTime',align: 'center',visible: false }, {title: '更新人',field: 'updateBy',align: 'center',visible: false}, {title: '上次更新时间',field: 'updateTime',align: 'center',visible: false}, - {title: '备注',field: 'remark',align: 'center'}, {title: '操作', align: 'center', formatter: function (value, row, index) { var actions = []; diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/purchaseQuote.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/purchaseQuote.html index 71a93b81..dd12d6ef 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/purchaseQuote.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/purchaseQuote.html @@ -109,7 +109,7 @@ columns: [ {checkbox: true}, {title: '采购报价索引id',field: 'purchaseQuoteId',visible: false}, - {title: '审核状态',field: 'auditStatus', + {title: '审核状态',field: 'auditStatus',visible: false, formatter: function (value, row, index) {return $.table.selectDictLabel(auditStatusDatas, value);} }, {title: '流程实例ID',field: 'instanceId',visible: false}, @@ -118,29 +118,39 @@ {title: '流程恢复实例ID',field: 'restoreInstanceId', visible: false}, { title: '流程实例类型', field: 'instanceTypeName',visible: false}, {title: '申请人ID',field: 'applyUser', visible: false}, - { - field: 'applyUserName', - title: '申请人', - formatter: function(value, row, index) { - return '' + (value ? value : "-") + ''; - } - }, - {field: 'applyTime',title: '申请时间' - }, {title: '当前任务ID',field: 'taskId',visible: false}, { title: '待办用户ID',field: 'todoUserId', visible: false}, - { title: '当前任务名称',field: 'taskName', + { title: '当前任务名称',field: 'taskName', visible: false, align: 'center', formatter: function(value, row, index) { return '' + value + ''; } }, - {title: '采购员',field: 'purchaseBuyer',}, + {title: '当前状态',field: 'taskStatus', + formatter: function(value, row, index) { + if(row.auditStatus!="1"&&value != "未启动"){ + return '' + value + ''; + } + if(value === "未启动"){ + return '' + value + ''; + } + return '' + value + '';} + }, {title: '采购报价单号',field: 'purchaseQuoteCode',}, {title: '供应商ID',field: 'supplierQuoteCode',}, {title: '供应商名称',field: 'supplierName',}, {title: '物料合计',field: 'materialAmount',}, {title: '定价时间',field: 'pricingDate',}, + {field: 'applyTime',title: '申请时间' + }, + { + field: 'applyUserName', + title: '申请人', + formatter: function(value, row, index) { + return '' + (value ? value : "-") + ''; + } + }, + {title: '采购员',field: 'purchaseBuyer',}, {title: '录入时间',field: 'createTime',}, {title: '更新人',field: 'updateBy',}, {title: '上次更新时间',field: 'updateTime',}, diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskCgjlVerify.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskCgjlVerify.html index 7f9ee2e3..b8e0c88d 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskCgjlVerify.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskCgjlVerify.html @@ -261,7 +261,6 @@ {title: '录入时间',field: 'createTime',align: 'center',visible: false }, {title: '更新人',field: 'updateBy',align: 'center',visible: false}, {title: '上次更新时间',field: 'updateTime',align: 'center',visible: false}, - {title: '备注',field: 'remark',align: 'center'}, ], }; $.table.init(options); diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskFzjlVerify.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskFzjlVerify.html index 09b3962c..70a39820 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskFzjlVerify.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskFzjlVerify.html @@ -263,7 +263,6 @@ {title: '录入时间',field: 'createTime',align: 'center',visible: false }, {title: '更新人',field: 'updateBy',align: 'center',visible: false}, {title: '上次更新时间',field: 'updateTime',align: 'center',visible: false}, - {title: '备注',field: 'remark',align: 'center'}, ], }; $.table.init(options); diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskModifyApply.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskModifyApply.html index 0740a9a4..298829ef 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskModifyApply.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskModifyApply.html @@ -257,7 +257,6 @@ {title: '录入时间',field: 'createTime',align: 'center',visible: false }, {title: '更新人',field: 'updateBy',align: 'center',visible: false}, {title: '上次更新时间',field: 'updateTime',align: 'center',visible: false}, - {title: '备注',field: 'remark',align: 'center'}, {title: '操作', align: 'center', formatter: function (value, row, index) { var actions = [];