Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
王晓迪 3 days ago
parent
commit
b426b13a8d
  1. 65
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseQuoteController.java
  2. 13
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseQuoteHistoryController.java
  3. 8
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseQuoteHistory.java
  4. 13
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/Vo/PurchaseQuoteVo.java
  5. 5
      ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseQuoteChildMapper.java
  6. 5
      ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseQuoteHistoryMapper.java
  7. 7
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseQuoteHistoryService.java
  8. 62
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteHistoryServiceImpl.java
  9. 8
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteServiceImpl.java
  10. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java
  11. 4
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteHistoryServiceImpl.java
  12. 5
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteChildMapper.xml
  13. 50
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteHistoryMapper.xml
  14. 150
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/add.html
  15. 40
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/detail.html
  16. 1
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/edit.html
  17. 34
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/purchaseQuote.html
  18. 74
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/recentQuotationHistory.html
  19. 38
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskCgjlVerify.html
  20. 40
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskFzjlVerify.html
  21. 1
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskModifyApply.html
  22. 2
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuoteHistory/add.html
  23. 2
      ruoyi-admin/src/main/resources/templates/purchase/purchaseQuoteHistory/purchaseQuoteHistory.html

65
ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseQuoteController.java

@ -1,7 +1,9 @@
package com.ruoyi.purchase.controller; package com.ruoyi.purchase.controller;
import java.math.BigDecimal;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.ruoyi.ck.utils.Result; 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.common.utils.StringUtils;
import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.purchase.domain.PurchaseQuoteChild; import com.ruoyi.purchase.domain.PurchaseQuoteChild;
import com.ruoyi.purchase.domain.PurchaseQuoteHistory;
import com.ruoyi.purchase.domain.Vo.PurchaseQuoteVo; 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.domain.SysSalesOrderChild;
import com.ruoyi.system.service.ISysRoleService; import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
@ -51,6 +56,10 @@ public class PurchaseQuoteController extends BaseController
@Autowired @Autowired
private IPurchaseQuoteService purchaseQuoteService; private IPurchaseQuoteService purchaseQuoteService;
@Autowired
private IPurchaseQuoteHistoryService purchaseQuoteHistoryService;
@Autowired @Autowired
private ISysRoleService roleService; private ISysRoleService roleService;
@ -243,6 +252,7 @@ public class PurchaseQuoteController extends BaseController
if(!approvedFlag){ if(!approvedFlag){
// 审核状态-审核拒绝 // 审核状态-审核拒绝
purchaseQuoteVo.setAuditStatus("2"); purchaseQuoteVo.setAuditStatus("2");
purchaseQuoteHistoryService.updatePurchaseQuoteHistoryByPurchaseQuote(purchaseQuoteVo);
} }
// 如果任务已结束更新业务表状态 // 如果任务已结束更新业务表状态
boolean processIsFinish = processService.judgeProcessIsFinish(instanceId); boolean processIsFinish = processService.judgeProcessIsFinish(instanceId);
@ -253,6 +263,7 @@ public class PurchaseQuoteController extends BaseController
if("submit".equals(instanceType)){ if("submit".equals(instanceType)){
// 使用状态-是 // 使用状态-是
purchaseQuoteVo.setUseStatus("1"); purchaseQuoteVo.setUseStatus("1");
purchaseQuoteHistoryService.updatePurchaseQuoteHistoryByPurchaseQuote(purchaseQuoteVo);
} }
// 作废 // 作废
else if("cancel".equals(instanceType)){ else if("cancel".equals(instanceType)){
@ -310,4 +321,58 @@ public class PurchaseQuoteController extends BaseController
purchaseQuoteService.restorePurchaseQuoteById(id); purchaseQuoteService.restorePurchaseQuoteById(id);
return AjaxResult.success(); 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<PurchaseQuoteHistory> 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<PurchaseQuoteHistory> purchaseQuoteHistories = purchaseQuoteHistoryService.selectPurchaseQuoteHistoryList(purchaseQuoteHistory);
List<PurchaseQuoteHistory> 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));
}
} }

13
ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseQuoteHistoryController.java

@ -1,15 +1,13 @@
package com.ruoyi.purchase.controller; package com.ruoyi.purchase.controller;
import java.util.List; import java.util.List;
import com.ruoyi.system.domain.SysCustomerQuoteHistory;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
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 com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.purchase.domain.PurchaseQuoteHistory; import com.ruoyi.purchase.domain.PurchaseQuoteHistory;
@ -26,10 +24,10 @@ import com.ruoyi.common.core.page.TableDataInfo;
* @date 2024-08-28 * @date 2024-08-28
*/ */
@Controller @Controller
@RequestMapping("/purchaseQuoteHistory/purchaseQuoteHistory") @RequestMapping("/purchase/purchaseQuoteHistory")
public class PurchaseQuoteHistoryController extends BaseController public class PurchaseQuoteHistoryController extends BaseController
{ {
private String prefix = "purchaseQuoteHistory/purchaseQuoteHistory"; private String prefix = "purchase/purchaseQuoteHistory";
@Autowired @Autowired
private IPurchaseQuoteHistoryService purchaseQuoteHistoryService; private IPurchaseQuoteHistoryService purchaseQuoteHistoryService;
@ -147,5 +145,4 @@ public class PurchaseQuoteHistoryController extends BaseController
return toAjax(purchaseQuoteHistoryService.restorePurchaseQuoteHistoryById(id)); return toAjax(purchaseQuoteHistoryService.restorePurchaseQuoteHistoryById(id));
} }
} }

8
ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseQuoteHistory.java

@ -72,12 +72,12 @@ public class PurchaseQuoteHistory extends BaseEntity
@Excel(name = "物料的对外报价") @Excel(name = "物料的对外报价")
private Long materialSole; private Long materialSole;
/** 物料的不含税单价(RMB) */
@Excel(name = "物料的不含税单价(RMB)")
private BigDecimal materialRmb;
/** 物料的含税单价(RMB) */ /** 物料的含税单价(RMB) */
@Excel(name = "物料的含税单价(RMB)") @Excel(name = "物料的含税单价(RMB)")
private BigDecimal materialRmb;
/** 物料的不含税单价(RMB) */
@Excel(name = "物料的不含税单价(RMB)")
private BigDecimal materialNormb; private BigDecimal materialNormb;
/** 供应商编号 */ /** 供应商编号 */

13
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 taskId;
/** 任务名称 */ /** 任务名称 */
private String taskName; private String taskName;
// 当前状态
private String taskStatus;
/** 办理时间 */ /** 办理时间 */
private Date doneTime; private Date doneTime;
/** 创建人 */ /** 创建人 */
@ -96,6 +101,13 @@ public class PurchaseQuoteVo extends PurchaseQuote {
this.instanceTypeName = instanceTypeName; this.instanceTypeName = instanceTypeName;
} }
public String getTaskStatus() {
return taskStatus;
}
public void setTaskStatus(String taskStatus) {
this.taskStatus = taskStatus;
}
@Override @Override
public String toString() { public String toString() {
@ -103,6 +115,7 @@ public class PurchaseQuoteVo extends PurchaseQuote {
"applyUserName='" + applyUserName + '\'' + "applyUserName='" + applyUserName + '\'' +
", taskId='" + taskId + '\'' + ", taskId='" + taskId + '\'' +
", taskName='" + taskName + '\'' + ", taskName='" + taskName + '\'' +
", taskStatus='" + taskStatus + '\'' +
", doneTime=" + doneTime + ", doneTime=" + doneTime +
", createUserName='" + createUserName + '\'' + ", createUserName='" + createUserName + '\'' +
", suspendState='" + suspendState + '\'' + ", suspendState='" + suspendState + '\'' +

5
ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseQuoteChildMapper.java

@ -94,4 +94,9 @@ public interface PurchaseQuoteChildMapper
* 通过供应商编码查找所有采购报价子表集合 * 通过供应商编码查找所有采购报价子表集合
* */ * */
List<PurchaseQuoteChild> selectQuoteChildBySupplierCode(String supplierCode); List<PurchaseQuoteChild> selectQuoteChildBySupplierCode(String supplierCode);
/**
* 通过采购报价编码查找所有采购报价子表集合
* */
List<PurchaseQuoteChild> selectQuoteChildByPurchaseQuoteCode(String purchaseQuoteCode);
} }

5
ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseQuoteHistoryMapper.java

@ -89,4 +89,9 @@ public interface PurchaseQuoteHistoryMapper
* @return 结果 * @return 结果
*/ */
public int restorePurchaseQuoteHistoryById(Long purchaseQuoteChildId); public int restorePurchaseQuoteHistoryById(Long purchaseQuoteChildId);
/**
* 通过供应商编号和物料编号更新采购报价历史数据
* */
public int updatePurchaseQuoteHistoryByCode(PurchaseQuoteHistory purchaseQuoteHistory);
} }

7
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseQuoteHistoryService.java

@ -4,6 +4,7 @@ import java.util.List;
import com.ruoyi.purchase.domain.PurchaseQuote; import com.ruoyi.purchase.domain.PurchaseQuote;
import com.ruoyi.purchase.domain.PurchaseQuoteHistory; import com.ruoyi.purchase.domain.PurchaseQuoteHistory;
import com.ruoyi.purchase.domain.Vo.PurchaseQuoteVo;
/** /**
* 采购物料历史报价信息Service接口 * 采购物料历史报价信息Service接口
@ -80,4 +81,10 @@ public interface IPurchaseQuoteHistoryService
* *
* */ * */
int generatePurchaseQuoteHistory(PurchaseQuote purchaseQuote); int generatePurchaseQuoteHistory(PurchaseQuote purchaseQuote);
/**
* 采购报价更新的时候更新采购报价历史数据
*
* */
void updatePurchaseQuoteHistoryByPurchaseQuote(PurchaseQuoteVo purchaseQuoteVo);
} }

62
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteHistoryServiceImpl.java

@ -1,17 +1,24 @@
package com.ruoyi.purchase.service.impl; package com.ruoyi.purchase.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.purchase.domain.PurchaseQuote; import com.ruoyi.purchase.domain.PurchaseQuote;
import com.ruoyi.purchase.domain.PurchaseQuoteChild; import com.ruoyi.purchase.domain.PurchaseQuoteChild;
import com.ruoyi.purchase.domain.Vo.PurchaseQuoteVo;
import com.ruoyi.purchase.mapper.PurchaseQuoteChildMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.purchase.mapper.PurchaseQuoteHistoryMapper; import com.ruoyi.purchase.mapper.PurchaseQuoteHistoryMapper;
import com.ruoyi.purchase.domain.PurchaseQuoteHistory; import com.ruoyi.purchase.domain.PurchaseQuoteHistory;
import com.ruoyi.purchase.service.IPurchaseQuoteHistoryService; import com.ruoyi.purchase.service.IPurchaseQuoteHistoryService;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional;
/** /**
* 采购物料历史报价信息Service业务层处理 * 采购物料历史报价信息Service业务层处理
@ -25,6 +32,9 @@ public class PurchaseQuoteHistoryServiceImpl implements IPurchaseQuoteHistorySer
@Autowired @Autowired
private PurchaseQuoteHistoryMapper purchaseQuoteHistoryMapper; private PurchaseQuoteHistoryMapper purchaseQuoteHistoryMapper;
@Autowired
private PurchaseQuoteChildMapper purchaseQuoteChildMapper;
/** /**
* 查询采购物料历史报价信息 * 查询采购物料历史报价信息
* *
@ -46,7 +56,21 @@ public class PurchaseQuoteHistoryServiceImpl implements IPurchaseQuoteHistorySer
@Override @Override
public List<PurchaseQuoteHistory> selectPurchaseQuoteHistoryList(PurchaseQuoteHistory purchaseQuoteHistory) public List<PurchaseQuoteHistory> selectPurchaseQuoteHistoryList(PurchaseQuoteHistory purchaseQuoteHistory)
{ {
//最新的报价
PurchaseQuoteHistory latestQuoteHistory = purchaseQuoteHistoryMapper.findLatestPurchaseQuoteHistory(purchaseQuoteHistory);
if (latestQuoteHistory != null){
List<PurchaseQuoteHistory> purchaseQuoteHistories = purchaseQuoteHistoryMapper.selectPurchaseQuoteHistoryList(purchaseQuoteHistory);
purchaseQuoteHistories.forEach(item -> {
if (Objects.equals(item.getPurchaseQuoteChildId(), latestQuoteHistory.getPurchaseQuoteChildId())) {
item.setIsLatest("1");
} else {
item.setIsLatest("0");
}
});
return purchaseQuoteHistories;
}
return purchaseQuoteHistoryMapper.selectPurchaseQuoteHistoryList(purchaseQuoteHistory); return purchaseQuoteHistoryMapper.selectPurchaseQuoteHistoryList(purchaseQuoteHistory);
} }
/** /**
@ -162,4 +186,42 @@ public class PurchaseQuoteHistoryServiceImpl implements IPurchaseQuoteHistorySer
} }
return purchaseQuoteHistoryMapper.insertBatchPurchaseQuoteHistory(purchaseQuoteHistoryChildren); return purchaseQuoteHistoryMapper.insertBatchPurchaseQuoteHistory(purchaseQuoteHistoryChildren);
} }
/**
* 根据采购报价信息更新采购报价最新报价记录
* @param purchaseQuoteVo
*/
@Override
public void updatePurchaseQuoteHistoryByPurchaseQuote(PurchaseQuoteVo purchaseQuoteVo) {
String loginName = ShiroUtils.getLoginName();
String supplierCode = purchaseQuoteVo.getSupplierQuoteCode();
String auditStatus = purchaseQuoteVo.getAuditStatus();
String purchaseQuoteCode = purchaseQuoteVo.getPurchaseQuoteCode();
// 获取所有的子项
List<PurchaseQuoteChild> purchaseQuoteChildList= purchaseQuoteChildMapper.selectQuoteChildByPurchaseQuoteCode(purchaseQuoteCode);
for (PurchaseQuoteChild purchaseQuoteChild : purchaseQuoteChildList) {
PurchaseQuoteHistory purchaseQuoteHistory = new PurchaseQuoteHistory();
// 设置审核状态
purchaseQuoteHistory.setAuditStatus(auditStatus.equals("1") ? "1" : "2");
purchaseQuoteHistory.setSupplierCode(supplierCode);
// 设置其他字段
purchaseQuoteHistory.setMaterialCode(purchaseQuoteChild.getMaterialCode());
purchaseQuoteHistory.setUpdateBy(loginName);
purchaseQuoteHistory.setUpdateTime(new Date());
// 更新报价历史记录
int result = purchaseQuoteHistoryMapper.updatePurchaseQuoteHistoryByCode(purchaseQuoteHistory);
if (result <= 0){
throw new BusinessException("更新采购报价历史数据失败");
}
}
}
} }

8
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseQuoteServiceImpl.java

@ -148,6 +148,12 @@ public class PurchaseQuoteServiceImpl implements IPurchaseQuoteService
} else { } else {
purchaseQuoteVo.setTaskName("未启动"); 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.add(purchaseQuoteVo);
} }
returnList.setTotal(CollectionUtils.isEmpty(list) ? 0 : list.getTotal()); returnList.setTotal(CollectionUtils.isEmpty(list) ? 0 : list.getTotal());
@ -397,9 +403,7 @@ public class PurchaseQuoteServiceImpl implements IPurchaseQuoteService
SysUser user = ShiroUtils.getSysUser(); SysUser user = ShiroUtils.getSysUser();
purchaseQuote.setApplyUser(user.getLoginName()); purchaseQuote.setApplyUser(user.getLoginName());
purchaseQuote.setApplyTime(DateUtils.getNowDate()); purchaseQuote.setApplyTime(DateUtils.getNowDate());
if(purchaseQuote.getPurchaseQuoteId()==null){
insertPurchaseQuote(purchaseQuote); insertPurchaseQuote(purchaseQuote);
}
// 启动流程 // 启动流程
String applyTitle = user.getUserName()+"发起了客户信息提交审批-"+DateUtils.dateTimeNow(); String applyTitle = user.getUserName()+"发起了客户信息提交审批-"+DateUtils.dateTimeNow();
String instanceType = "submit"; String instanceType = "submit";

2
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysCustomerQuoteController.java

@ -477,7 +477,7 @@ public class SysCustomerQuoteController extends BaseController
sysCustomerQuoteHistory.setMaterialCode(materialNo); sysCustomerQuoteHistory.setMaterialCode(materialNo);
sysCustomerQuoteHistory.setCustomerCode(customerCode); sysCustomerQuoteHistory.setCustomerCode(customerCode);
List<SysCustomerQuoteHistory> sysCustomerQuoteHistories = quoteHistoryService.selectSysCustomerQuoteHistoryList(sysCustomerQuoteHistory); List<SysCustomerQuoteHistory> sysCustomerQuoteHistories = quoteHistoryService.selectSysCustomerQuoteHistoryList(sysCustomerQuoteHistory);
List<SysCustomerQuoteHistory> filterCustomerQuoteHistories = sysCustomerQuoteHistories.stream().filter(item -> item.getIsLatest().equals("1")).collect(Collectors.toList()); List<SysCustomerQuoteHistory> filterCustomerQuoteHistories = sysCustomerQuoteHistories.stream().filter(item -> "1".equals(item.getIsLatest())).collect(Collectors.toList());
if (filterCustomerQuoteHistories.size() == 0) if (filterCustomerQuoteHistories.size() == 0)
{ {
SysCustomerQuoteHistory temp = new SysCustomerQuoteHistory(); SysCustomerQuoteHistory temp = new SysCustomerQuoteHistory();

4
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerQuoteHistoryServiceImpl.java

@ -56,6 +56,7 @@ public class SysCustomerQuoteHistoryServiceImpl implements ISysCustomerQuoteHist
//最新的报价 //最新的报价
SysCustomerQuoteHistory latestQuoteHistory = sysCustomerQuoteHistoryMapper.findLatestQuoteHistory(sysCustomerQuoteHistory); SysCustomerQuoteHistory latestQuoteHistory = sysCustomerQuoteHistoryMapper.findLatestQuoteHistory(sysCustomerQuoteHistory);
List<SysCustomerQuoteHistory> sysCustomerQuoteHistories = sysCustomerQuoteHistoryMapper.selectSysCustomerQuoteHistoryList(sysCustomerQuoteHistory); List<SysCustomerQuoteHistory> sysCustomerQuoteHistories = sysCustomerQuoteHistoryMapper.selectSysCustomerQuoteHistoryList(sysCustomerQuoteHistory);
if (latestQuoteHistory != null){
sysCustomerQuoteHistories.forEach(customerQuoteHistory -> { sysCustomerQuoteHistories.forEach(customerQuoteHistory -> {
if (Objects.equals(customerQuoteHistory.getQuoteHistoryId(), latestQuoteHistory.getQuoteHistoryId())) { if (Objects.equals(customerQuoteHistory.getQuoteHistoryId(), latestQuoteHistory.getQuoteHistoryId())) {
customerQuoteHistory.setIsLatest("1"); customerQuoteHistory.setIsLatest("1");
@ -66,6 +67,9 @@ public class SysCustomerQuoteHistoryServiceImpl implements ISysCustomerQuoteHist
return sysCustomerQuoteHistories; return sysCustomerQuoteHistories;
} }
return sysCustomerQuoteHistoryMapper.selectSysCustomerQuoteHistoryList(sysCustomerQuoteHistory);
}
/** /**
* 新增客户报价历史 * 新增客户报价历史

5
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} where supplier_code = #{supplierCode}
</select> </select>
<select id="selectQuoteChildByPurchaseQuoteCode" parameterType="String" resultMap="PurchaseQuoteChildResult">
<include refid="selectPurchaseQuoteChildVo"/>
where purchase_quote_code = #{purchaseQuoteCode}
</select>
<insert id="insertPurchaseQuoteChild" parameterType="PurchaseQuoteChild" useGeneratedKeys="true" keyProperty="purchaseQuoteChildId"> <insert id="insertPurchaseQuoteChild" parameterType="PurchaseQuoteChild" useGeneratedKeys="true" keyProperty="purchaseQuoteChildId">
insert into purchase_quote_child insert into purchase_quote_child

50
ruoyi-admin/src/main/resources/mapper/purchase/PurchaseQuoteHistoryMapper.xml

@ -35,7 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectPurchaseQuoteHistoryVo"> <sql id="selectPurchaseQuoteHistoryVo">
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
</sql> </sql>
<select id="selectPurchaseQuoteHistoryList" parameterType="PurchaseQuoteHistory" resultMap="PurchaseQuoteHistoryResult"> <select id="selectPurchaseQuoteHistoryList" parameterType="PurchaseQuoteHistory" resultMap="PurchaseQuoteHistoryResult">
@ -46,14 +46,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialId != null "> and material_id = #{materialId}</if> <if test="materialId != null "> and material_id = #{materialId}</if>
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if> <if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if> <if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if>
<if test="processMethod != null and processMethod != ''"> and processMethod = #{processMethod}</if>
<if test="brand != null and brand != ''"> and brand = #{brand}</if>
<if test="photoUrl != null and photoUrl != ''"> and photoUrl = #{photoUrl}</if>
<if test="describe != null and describe != ''"> and describe = #{describe}</if>
<if test="taxRate != null "> and tax_rate = #{taxRate}</if>
<if test="usdRate != null "> and usd_rate = #{usdRate}</if>
<if test="materialNum != null "> and material_num = #{materialNum}</if>
<if test="materialSole != null "> and material_sole = #{materialSole}</if> <if test="materialSole != null "> and material_sole = #{materialSole}</if>
<if test="materialRmb != null "> and material_rmb = #{materialRmb}</if> <if test="materialRmb != null "> and material_rmb = #{materialRmb}</if>
<if test="materialNormb != null "> and material_noRmb = #{materialNormb}</if> <if test="materialNormb != null "> and material_noRmb = #{materialNormb}</if>
@ -180,12 +172,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert> </insert>
<update id="updatePurchaseQuoteHistory" parameterType="PurchaseQuoteHistory"> <update id="updatePurchaseQuoteHistory" parameterType="PurchaseQuoteHistory">
update purchase_quote_history update purchase_quote_history
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
@ -219,6 +205,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where purchase_quote_child_id = #{purchaseQuoteChildId} where purchase_quote_child_id = #{purchaseQuoteChildId}
</update> </update>
<update id="updatePurchaseQuoteHistoryByCode" parameterType="PurchaseQuoteHistory">
update purchase_quote_history
<trim prefix="SET" suffixOverrides=",">
<if test="purchaseQuoteCode != null">purchase_quote_code = #{purchaseQuoteCode},</if>
<if test="materialId != null">material_id = #{materialId},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="materialSole != null">material_sole = #{materialSole},</if>
<if test="materialRmb != null">material_rmb = #{materialRmb},</if>
<if test="materialNormb != null">material_noRmb = #{materialNormb},</if>
<if test="supplierCode != null">supplier_code = #{supplierCode},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="useStatus != null">use_status = #{useStatus},</if>
<if test="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="isLatest != null">is_latest = #{isLatest},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where material_code = #{materialCode} and supplier_code = #{supplierCode}
</update>
<delete id="deletePurchaseQuoteHistoryById" parameterType="Long"> <delete id="deletePurchaseQuoteHistoryById" parameterType="Long">
delete from purchase_quote_history where purchase_quote_child_id = #{purchaseQuoteChildId} delete from purchase_quote_history where purchase_quote_child_id = #{purchaseQuoteChildId}
</delete> </delete>
@ -241,7 +259,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="findLatestPurchaseQuoteHistory" parameterType="String" resultMap="PurchaseQuoteHistoryResult" > <select id="findLatestPurchaseQuoteHistory" parameterType="String" resultMap="PurchaseQuoteHistoryResult" >
<include refid="selectPurchaseQuoteHistoryVo"/> <include refid="selectPurchaseQuoteHistoryVo"/>
where purchase_quote_code = #{purchaseQuoteCode} and material_code = #{materialCode} and audit_status = '1' where supplier_code = #{supplierCode} and material_code = #{materialCode} and audit_status = '1'
order by update_time desc order by update_time desc
limit 1 limit 1
</select> </select>

150
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/add.html

@ -27,16 +27,18 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">供应商名称:</label> <label class="col-sm-3 control-label is-required">供应商名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="supplierName" class="form-control select2" required /> <input name="supplierName" class="form-control select2" required readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">定价日期:</label> <label class="col-sm-3 control-label">定价日期:</label>
<div class="col-sm-8">
<div class="input-group date"> <div class="input-group date">
<input name="pricingDate" class="form-control" type="text" /> <input name="pricingDate" class="form-control" type="text" />
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div> </div>
</div> </div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">备注说明:</label> <label class="col-sm-3 control-label">备注说明:</label>
<div class="col-sm-8"> <div class="col-sm-8">
@ -159,6 +161,16 @@
} }
}, },
{title: '最新报价',field: 'materialSole',align: 'center',}, {title: '最新报价',field: 'materialSole',align: 'center',},
{ title: '最新报价历史',align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="recentQuotationHistory(\'' + row.materialCode + '\')"><i class="fa fa-edit"></i>最新报价历史</a> ');
return actions.join('');
}
},
{title: '物料的数量', field: 'materialNum',align: 'center',editable: true,visible: false}, {title: '物料的数量', field: 'materialNum',align: 'center',editable: true,visible: false},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center', {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',
editable:{ editable:{
@ -189,7 +201,6 @@
{title: '录入时间',field: 'createTime',align: 'center',visible: false }, {title: '录入时间',field: 'createTime',align: 'center',visible: false },
{title: '更新人',field: 'updateBy',align: 'center',visible: false}, {title: '更新人',field: 'updateBy',align: 'center',visible: false},
{title: '上次更新时间',field: 'updateTime',align: 'center',visible: false}, {title: '上次更新时间',field: 'updateTime',align: 'center',visible: false},
{title: '备注',field: 'remark',align: 'center'},
{title: '操作', align: 'center', {title: '操作', align: 'center',
formatter: function (value, row, index) { formatter: function (value, row, index) {
var actions = []; var actions = [];
@ -234,48 +245,94 @@
}); });
getPurchaseQuoteCode(); getPurchaseQuoteCode();
}); });
function doSubmit(index, layero, uniqueId) { function doSubmit(index, layero, uniqueId) {
var iframeWin = window[layero.find('iframe')[0]['name']]; var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections'); var selectedRows = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections');
var rows = $("#bootstrap-sub-table-1").bootstrapTable('getData').length;
for(var j=0;i<rows;j++){ if (selectedRows.length === 0) {
var data = $("#bootstrap-sub-table-1").bootstrapTable('getData'); $.modal.alertWarning("请选择至少一条物料信息");
for (var i = 0;i<data.length;i++){
if(data[i].materialNo==rowData[j].materialNo){
//如果是物料料号的相同,则从rowData清除相同的料号物料
rowData.splice(j,1);
$.modal.alertError("不能选择已添加过的相同料号" + rowData[j].materialNo);
return; return;
} }
var existingData = $("#bootstrap-sub-table-purchaseQuoteChild").bootstrapTable('getData');
var materialCodesSet = new Set(); // 使用 Set 来存储物料号
// 存储所有现有的物料号
existingData.forEach(function(row) {
materialCodesSet.add(row.materialCode);
});
// 存储所有即将插入的料号
var newMaterialCodesSet = new Set();
var promises = selectedRows.map(rowData => {
// 检查是否已经存在相同的料号
if (materialCodesSet.has(rowData.materialNo) || newMaterialCodesSet.has(rowData.materialNo)) {
$.modal.alertError("不能选择已添加过的相同料号 " + rowData.materialNo);
return Promise.reject("Duplicate material number: " + rowData.materialNo);
} }
}
console.log("rowData: "+rowData); // 标记即将插入的物料号
for(var i=0;i<rowData.length;i++){ newMaterialCodesSet.add(rowData.materialNo);
$("#bootstrap-sub-table-purchaseQuoteChild").bootstrapTable('insertRow', {
index: i, return queryRecentQuotation(rowData.materialNo)
row: { .then(function(quotationData) {
materialId:rowData[i].id, return {
materialCode: rowData[i].materialNo, materialId:rowData.id,
materialName: rowData[i].materialName, materialCode: rowData.materialNo,
materialType: rowData[i].materialType, materialName: rowData.materialName,
describe: rowData[i].describe, materialType: rowData.materialType,
brand: rowData[i].brand, describe: rowData.describe,
unit: rowData[i].unit, brand: rowData.brand,
processMethod: rowData[i].processMethod, unit: rowData.unit,
materialSole: '', processMethod: rowData.processMethod,
photoUrl: rowData[i].photoUrl, materialSole: quotationData.data.materialRmb || '',
photoUrl: rowData.photoUrl,
materialNum: 1, materialNum: 1,
materialRmb: "", materialRmb: "",
materialNoRmb: "", materialNoRmb: "",
materialNoRmbSum: "", materialNoRmbSum: "",
materialRmbSum: "", materialRmbSum: "",
remark: "" 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);
}) })
} .catch(function(error) {
console.error('Some requests failed:', error);
layer.close(index); layer.close(index);
});
} }
function insertRow() { function insertRow() {
if ($("#selectSupplierQuoteCode").val() == null || $("#selectSupplierQuoteCode").val() == '') {
$.modal.alertWarning("请先选择供应商ID");
return;
}
if ($("#taxRate").val() == null || $("#taxRate").val() == '') {
$.modal.alertWarning("请先填写税率");
return;
}
var url = ctx + "erp/material/select"; var url = ctx + "erp/material/select";
var options = { var options = {
title: '选择料号', title: '选择料号',
@ -378,6 +435,41 @@
values: materialCode 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('查找最新报价数据失败')); // 失败时抛出错误
}
});
});
}
</script> </script>
</body> </body>
</html> </html>

40
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/detail.html

@ -20,26 +20,26 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">供应商ID:</label> <label class="col-sm-3 control-label">供应商ID:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="supplierQuoteCode" th:field="*{supplierQuoteCode}" class="form-control" /> <input name="supplierQuoteCode" th:field="*{supplierQuoteCode}" class="form-control" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">供应商名称:</label> <label class="col-sm-3 control-label">供应商名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="supplierName" th:field="*{supplierName}" class="form-control"> <input name="supplierName" th:field="*{supplierName}" class="form-control" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">定价日期:</label> <label class="col-sm-3 control-label">定价日期:</label>
<div class="input-group date"> <div class="input-group date">
<input name="pricingDate" th:field="*{pricingDate}" class="form-control" type="text"> <input name="pricingDate" th:field="*{pricingDate}" class="form-control" type="text" readonly>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">备注说明:</label> <label class="col-sm-3 control-label">备注说明:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<textarea name="remark" class="form-control" th:field="*{remark}"></textarea> <textarea name="remark" class="form-control" th:field="*{remark}" readonly></textarea>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -68,18 +68,13 @@
<label class="col-sm-3 control-label">税率:</label> <label class="col-sm-3 control-label">税率:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group"> <div class="input-group">
<input name="taxRate" id="taxRate" th:field="*{taxRate}" class="form-control" placeholder="13" /> <input name="taxRate" id="taxRate" th:field="*{taxRate}" class="form-control" placeholder="13" readonly>
<span class="input-group-addon">%</span> <span class="input-group-addon">%</span>
</div> </div>
</div> </div>
</div> </div>
</form> </form>
<div class="container"> <div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>选择报价信息</span>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-purchaseQuoteChild"></table> <table id="bootstrap-sub-table-purchaseQuoteChild"></table>
@ -208,14 +203,21 @@
} }
}, },
{title:'最新报价',field: 'materialSole',align: 'center',}, {title:'最新报价',field: 'materialSole',align: 'center',},
{ title: '最新报价历史',align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="recentQuotationHistory(\'' + row.materialCode + '\')"><i class="fa fa-edit"></i>最新报价历史</a> ');
return actions.join('');
}
},
{title: '物料的数量', field: 'materialNum',align: 'center',editable: true,visible: false}, {title: '物料的数量', field: 'materialNum',align: 'center',editable: true,visible: false},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',editable: true,}, {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',},
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',editable: true,}, {title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',},
{title: '录入人',field: 'createBy',align: 'center',visible: false}, {title: '录入人',field: 'createBy',align: 'center',visible: false},
{title: '录入时间',field: 'createTime',align: 'center',visible: false }, {title: '录入时间',field: 'createTime',align: 'center',visible: false },
{title: '更新人',field: 'updateBy',align: 'center',visible: false}, {title: '更新人',field: 'updateBy',align: 'center',visible: false},
{title: '上次更新时间',field: 'updateTime',align: 'center',visible: false}, {title: '上次更新时间',field: 'updateTime',align: 'center',visible: false},
{title: '备注',field: 'remark',align: 'center'},
], ],
}; };
$.table.init(options); $.table.init(options);
@ -269,6 +271,18 @@
minView: "month", minView: "month",
autoclose: true 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);
}
</script> </script>
</body> </body>
</html> </html>

1
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/edit.html

@ -240,7 +240,6 @@
{title: '录入时间',field: 'createTime',align: 'center',visible: false }, {title: '录入时间',field: 'createTime',align: 'center',visible: false },
{title: '更新人',field: 'updateBy',align: 'center',visible: false}, {title: '更新人',field: 'updateBy',align: 'center',visible: false},
{title: '上次更新时间',field: 'updateTime',align: 'center',visible: false}, {title: '上次更新时间',field: 'updateTime',align: 'center',visible: false},
{title: '备注',field: 'remark',align: 'center'},
{title: '操作', align: 'center', {title: '操作', align: 'center',
formatter: function (value, row, index) { formatter: function (value, row, index) {
var actions = []; var actions = [];

34
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/purchaseQuote.html

@ -109,7 +109,7 @@
columns: [ columns: [
{checkbox: true}, {checkbox: true},
{title: '采购报价索引id',field: 'purchaseQuoteId',visible: false}, {title: '采购报价索引id',field: 'purchaseQuoteId',visible: false},
{title: '审核状态',field: 'auditStatus', {title: '审核状态',field: 'auditStatus',visible: false,
formatter: function (value, row, index) {return $.table.selectDictLabel(auditStatusDatas, value);} formatter: function (value, row, index) {return $.table.selectDictLabel(auditStatusDatas, value);}
}, },
{title: '流程实例ID',field: 'instanceId',visible: false}, {title: '流程实例ID',field: 'instanceId',visible: false},
@ -118,29 +118,39 @@
{title: '流程恢复实例ID',field: 'restoreInstanceId', visible: false}, {title: '流程恢复实例ID',field: 'restoreInstanceId', visible: false},
{ title: '流程实例类型', field: 'instanceTypeName',visible: false}, { title: '流程实例类型', field: 'instanceTypeName',visible: false},
{title: '申请人ID',field: 'applyUser', visible: false}, {title: '申请人ID',field: 'applyUser', visible: false},
{
field: 'applyUserName',
title: '<span style="color: red;">申请人</span>',
formatter: function(value, row, index) {
return '<span style="color: red;">' + (value ? value : "-") + '</span>';
}
},
{field: 'applyTime',title: '申请时间'
},
{title: '当前任务ID',field: 'taskId',visible: false}, {title: '当前任务ID',field: 'taskId',visible: false},
{ title: '待办用户ID',field: 'todoUserId', visible: false}, { title: '待办用户ID',field: 'todoUserId', visible: false},
{ title: '当前任务名称',field: 'taskName', { title: '当前任务名称',field: 'taskName', visible: false,
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
return '<span class="badge badge-primary">' + value + '</span>'; return '<span class="badge badge-primary">' + value + '</span>';
} }
}, },
{title: '采购员',field: 'purchaseBuyer',}, {title: '当前状态',field: 'taskStatus',
formatter: function(value, row, index) {
if(row.auditStatus!="1"&&value != "未启动"){
return '<span class="badge badge-danger">' + value + '</span>';
}
if(value === "未启动"){
return '<span class="badge badge-primary">' + value + '</span>';
}
return '<span class="badge badge-primary">' + value + '</span>';}
},
{title: '采购报价单号',field: 'purchaseQuoteCode',}, {title: '采购报价单号',field: 'purchaseQuoteCode',},
{title: '供应商ID',field: 'supplierQuoteCode',}, {title: '供应商ID',field: 'supplierQuoteCode',},
{title: '供应商名称',field: 'supplierName',}, {title: '供应商名称',field: 'supplierName',},
{title: '物料合计',field: 'materialAmount',}, {title: '物料合计',field: 'materialAmount',},
{title: '定价时间',field: 'pricingDate',}, {title: '定价时间',field: 'pricingDate',},
{field: 'applyTime',title: '申请时间'
},
{
field: 'applyUserName',
title: '<span style="color: red;">申请人</span>',
formatter: function(value, row, index) {
return '<span style="color: red;">' + (value ? value : "-") + '</span>';
}
},
{title: '采购员',field: 'purchaseBuyer',},
{title: '录入时间',field: 'createTime',}, {title: '录入时间',field: 'createTime',},
{title: '更新人',field: 'updateBy',}, {title: '更新人',field: 'updateBy',},
{title: '上次更新时间',field: 'updateTime',}, {title: '上次更新时间',field: 'updateTime',},

74
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/recentQuotationHistory.html

@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('采购报价历史列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var isLatestDatas = [[${@dict.getType('is_latest')}]];
var materialCode = /*[[${materialCode}]]*/ '';
var supplierQuoteCode = /*[[${supplierQuoteCode}]]*/ '';
var prefix = ctx + "purchase/purchaseQuote";
$(function() {
var options = {
url: prefix + "/recentQuotationHistoryList",
modalName: "采购报价历史",
showSearch: false,
showRefresh: false,
showToggle: false,
queryParams: {
materialCode: materialCode,
supplierCode: supplierQuoteCode
},
columns: [{
checkbox: true
},
{
title: '报价历史id',
field: 'purchaseQuoteChildId',
visible: false
},
{
title: '报价时间',
field: 'createTime',
},
{
title: '物料的含税单价(RMB)',
field: 'materialRmb',
},
{
title: '物料的不含税单价(RMB)',
field: 'materialNormb',
},
{
title: '审核状态',
field: 'auditStatus',
formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value);
}
},
{
title: '是否是最新报价',
field: 'isLatest',
formatter: function(value, row, index) {
return $.table.selectDictLabel(isLatestDatas, value);
}
},]
};
$.table.init(options);
});
</script>
</body>
</html>

38
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskCgjlVerify.html

@ -46,26 +46,26 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">供应商ID:</label> <label class="col-sm-3 control-label">供应商ID:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="supplierQuoteCode" th:field="*{supplierQuoteCode}" class="form-control" /> <input name="supplierQuoteCode" th:field="*{supplierQuoteCode}" class="form-control" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">供应商名称:</label> <label class="col-sm-3 control-label">供应商名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="supplierName" th:field="*{supplierName}" class="form-control"> <input name="supplierName" th:field="*{supplierName}" class="form-control" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">定价日期:</label> <label class="col-sm-3 control-label">定价日期:</label>
<div class="input-group date"> <div class="input-group date">
<input name="pricingDate" th:field="*{pricingDate}" class="form-control" type="text"> <input name="pricingDate" th:field="*{pricingDate}" class="form-control" type="text" readonly>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">备注说明:</label> <label class="col-sm-3 control-label">备注说明:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<textarea name="remark" class="form-control" th:field="*{remark}"></textarea> <textarea name="remark" class="form-control" th:field="*{remark}" readonly></textarea>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -94,7 +94,7 @@
<label class="col-sm-3 control-label">税率:</label> <label class="col-sm-3 control-label">税率:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group"> <div class="input-group">
<input name="taxRate" id="taxRate" th:field="*{taxRate}" class="form-control" placeholder="13" /> <input name="taxRate" id="taxRate" th:field="*{taxRate}" class="form-control" placeholder="13" readonly>
<span class="input-group-addon">%</span> <span class="input-group-addon">%</span>
</div> </div>
</div> </div>
@ -118,11 +118,6 @@
<input id="purchaseQuoteChildList_cgjl" type="hidden" name="purchaseQuoteChildLists" class="form-control m-b" /> <input id="purchaseQuoteChildList_cgjl" type="hidden" name="purchaseQuoteChildLists" class="form-control m-b" />
</form> </form>
<div class="container"> <div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>选择报价信息</span>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-purchaseQuoteChild"></table> <table id="bootstrap-sub-table-purchaseQuoteChild"></table>
@ -251,14 +246,21 @@
} }
}, },
{title:'最新报价',field: 'materialSole',align: 'center',}, {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('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="recentQuotationHistory(\'' + row.materialCode + '\')"><i class="fa fa-edit"></i>最新报价历史</a> ');
return actions.join('');
}
},
{title: '物料的数量', field: 'materialNum',align: 'center',visible: false},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',}, {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',},
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',}, {title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',},
{title: '录入人',field: 'createBy',align: 'center',visible: false}, {title: '录入人',field: 'createBy',align: 'center',visible: false},
{title: '录入时间',field: 'createTime',align: 'center',visible: false }, {title: '录入时间',field: 'createTime',align: 'center',visible: false },
{title: '更新人',field: 'updateBy',align: 'center',visible: false}, {title: '更新人',field: 'updateBy',align: 'center',visible: false},
{title: '上次更新时间',field: 'updateTime',align: 'center',visible: false}, {title: '上次更新时间',field: 'updateTime',align: 'center',visible: false},
{title: '备注',field: 'remark',align: 'center'},
], ],
}; };
$.table.init(options); $.table.init(options);
@ -323,6 +325,18 @@
minView: "month", minView: "month",
autoclose: true 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);
}
</script> </script>
</body> </body>
</html> </html>

40
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskFzjlVerify.html

@ -46,26 +46,26 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">供应商ID:</label> <label class="col-sm-3 control-label">供应商ID:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="supplierQuoteCode" th:field="*{supplierQuoteCode}" class="form-control" /> <input name="supplierQuoteCode" th:field="*{supplierQuoteCode}" class="form-control" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">供应商名称:</label> <label class="col-sm-3 control-label">供应商名称:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="supplierName" th:field="*{supplierName}" class="form-control"> <input name="supplierName" th:field="*{supplierName}" class="form-control" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">定价日期:</label> <label class="col-sm-3 control-label">定价日期:</label>
<div class="input-group date"> <div class="input-group date">
<input name="pricingDate" th:field="*{pricingDate}" class="form-control" type="text"> <input name="pricingDate" th:field="*{pricingDate}" class="form-control" type="text" readonly>
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">备注说明:</label> <label class="col-sm-3 control-label">备注说明:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<textarea name="remark" class="form-control" th:field="*{remark}"></textarea> <textarea name="remark" class="form-control" th:field="*{remark}" readonly></textarea>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -94,7 +94,7 @@
<label class="col-sm-3 control-label">税率:</label> <label class="col-sm-3 control-label">税率:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group"> <div class="input-group">
<input name="taxRate" id="taxRate" th:field="*{taxRate}" class="form-control" placeholder="13" /> <input name="taxRate" id="taxRate" th:field="*{taxRate}" class="form-control" placeholder="13" readonly>
<span class="input-group-addon">%</span> <span class="input-group-addon">%</span>
</div> </div>
</div> </div>
@ -118,11 +118,6 @@
<input id="purchaseQuoteChildList_fzjl" type="hidden" name="purchaseQuoteChildLists" class="form-control m-b" /> <input id="purchaseQuoteChildList_fzjl" type="hidden" name="purchaseQuoteChildLists" class="form-control m-b" />
</form> </form>
<div class="container"> <div class="container">
<div class="form-row">
<div class="btn-group-sm" id="toolbar" role="group">
<span>选择报价信息</span>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-purchaseQuoteChild"></table> <table id="bootstrap-sub-table-purchaseQuoteChild"></table>
@ -251,14 +246,23 @@
} }
}, },
{title:'最新报价',field: 'materialSole',align: 'center',}, {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('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="recentQuotationHistory(\'' + row.materialCode + '\')"><i class="fa fa-edit"></i>最新报价历史</a> ');
return actions.join('');
}
},
{title: '物料的数量', field: 'materialNum',align: 'center',visible: false},
{title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center'}, {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center'},
{title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center'}, {title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center'},
{title: '录入人',field: 'createBy',align: 'center',visible: false}, {title: '录入人',field: 'createBy',align: 'center',visible: false},
{title: '录入时间',field: 'createTime',align: 'center',visible: false }, {title: '录入时间',field: 'createTime',align: 'center',visible: false },
{title: '更新人',field: 'updateBy',align: 'center',visible: false}, {title: '更新人',field: 'updateBy',align: 'center',visible: false},
{title: '上次更新时间',field: 'updateTime',align: 'center',visible: false}, {title: '上次更新时间',field: 'updateTime',align: 'center',visible: false},
{title: '备注',field: 'remark',align: 'center'},
], ],
}; };
$.table.init(options); $.table.init(options);
@ -330,6 +334,18 @@
minView: "month", minView: "month",
autoclose: true 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);
}
</script> </script>
</body> </body>
</html> </html>

1
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuote/taskModifyApply.html

@ -257,7 +257,6 @@
{title: '录入时间',field: 'createTime',align: 'center',visible: false }, {title: '录入时间',field: 'createTime',align: 'center',visible: false },
{title: '更新人',field: 'updateBy',align: 'center',visible: false}, {title: '更新人',field: 'updateBy',align: 'center',visible: false},
{title: '上次更新时间',field: 'updateTime',align: 'center',visible: false}, {title: '上次更新时间',field: 'updateTime',align: 'center',visible: false},
{title: '备注',field: 'remark',align: 'center'},
{title: '操作', align: 'center', {title: '操作', align: 'center',
formatter: function (value, row, index) { formatter: function (value, row, index) {
var actions = []; var actions = [];

2
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuoteHistory/add.html

@ -147,7 +147,7 @@
</div> </div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<script th:inline="javascript"> <script th:inline="javascript">
var prefix = ctx + "purchaseQuoteHistory/purchaseQuoteHistory" var prefix = ctx + "purchase/purchaseQuoteHistory"
$("#form-purchaseQuoteHistory-add").validate({ $("#form-purchaseQuoteHistory-add").validate({
focusCleanup: true focusCleanup: true
}); });

2
ruoyi-admin/src/main/resources/templates/purchase/purchaseQuoteHistory/purchaseQuoteHistory.html

@ -50,7 +50,7 @@
var removeFlag = [[${@permission.hasPermi('purchaseQuoteHistory:purchaseQuoteHistory:remove')}]]; var removeFlag = [[${@permission.hasPermi('purchaseQuoteHistory:purchaseQuoteHistory:remove')}]];
var cancelFlag = [[${@permission.hasPermi('purchaseQuoteHistory:purchaseQuoteHistory:cancel')}]]; var cancelFlag = [[${@permission.hasPermi('purchaseQuoteHistory:purchaseQuoteHistory:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('purchaseQuoteHistory:purchaseQuoteHistory:restore')}]]; var restoreFlag = [[${@permission.hasPermi('purchaseQuoteHistory:purchaseQuoteHistory:restore')}]];
var prefix = ctx + "purchaseQuoteHistory/purchaseQuoteHistory"; var prefix = ctx + "purchase/purchaseQuoteHistory";
$(function() { $(function() {
var options = { var options = {

Loading…
Cancel
Save