From fd86952d172cb1225e2238fe1f6309422fc427f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E8=BF=AA?= <2596750866@qq.com> Date: Thu, 10 Oct 2024 08:53:42 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E5=9F=BA=E7=A1=80=E8=B5=84=E6=96=99=20?= =?UTF-8?q?=E8=AF=B7=E8=B4=AD=E5=8D=95=20=E4=BF=AE=E6=94=B9=E8=AF=B7?= =?UTF-8?q?=E8=B4=AD=E5=8D=95=E6=B7=BB=E5=8A=A0=E3=80=81=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E3=80=81=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=AD=A3=E5=B8=B8=EF=BC=9B=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=AF=B7=E8=B4=AD=E5=8D=95=E3=80=81vo=E5=92=8C=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E5=AE=9E=E4=BD=93=E7=B1=BB=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=EF=BC=9B=20=E4=BF=AE=E6=94=B9=E8=AF=B7?= =?UTF-8?q?=E8=B4=AD=E5=8D=95=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=A1=A8=E6=A0=BC=E5=AD=97=E6=AE=B5=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=BB=93=E6=9E=84=EF=BC=9B=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=AF=B7=E8=B4=AD=E7=BB=8F=E7=90=86=E3=80=81=E4=B8=BB=E7=AE=A1?= =?UTF-8?q?=E3=80=81=E5=89=AF=E6=80=BB=E7=BB=8F=E7=90=86=E3=80=81=E6=80=BB?= =?UTF-8?q?=E7=BB=8F=E7=90=86=E5=AE=A1=E6=89=B9=E9=A1=B5=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=98=BE=E7=A4=BA=E6=95=88=E6=9E=9C=EF=BC=9B?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E8=AF=B7=E8=B4=AD=E5=8D=95controller?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=8F=96=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E5=91=98=E6=8E=A5=E5=8F=A3=EF=BC=9B=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=AF=B7=E8=B4=AD=E5=8D=95=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?service=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=B7=BB=E5=8A=A0=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E9=99=90=E5=88=B6=EF=BC=9B=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=AF=B7=E8=B4=AD=E5=8D=95=E5=92=8C=E8=AF=A6=E6=83=85mapper?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=AD=97=E6=AE=B5=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2mapper=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=8C=E5=AE=9E=E7=8E=B0=E6=A8=A1=E7=B3=8A=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BaseRequisitioningOrderController.java | 24 ++- .../domain/BaseRequisitioningOrder.java | 36 ++++- .../domain/BaseRequisitioningOrderChild.java | 11 ++ .../domain/Vo/BaseRequisitioningOrderVo.java | 11 ++ .../IBaseRequisitioningOrderService.java | 2 +- .../BaseRequisitioningOrderServiceImpl.java | 143 ++++++++++++------ .../BaseRequisitioningOrderChildMapper.xml | 7 +- .../system/BaseRequisitioningOrderMapper.xml | 26 ++-- .../templates/system/requisitioning/add.html | 135 +++++++++-------- .../system/requisitioning/detail.html | 37 +++-- .../templates/system/requisitioning/edit.html | 118 +++++++++------ .../system/requisitioning/requisitioning.html | 107 ++++++++++--- .../system/requisitioning/taskFzjlVerify.html | 58 ++++--- .../system/requisitioning/taskQgjlVerify.html | 55 ++++--- .../system/requisitioning/taskQgzgVerify.html | 56 ++++--- .../system/requisitioning/taskZozjVerify.html | 136 +++++++++-------- 16 files changed, 619 insertions(+), 343 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseRequisitioningOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseRequisitioningOrderController.java index a6d453f4..d692f14d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseRequisitioningOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/BaseRequisitioningOrderController.java @@ -18,6 +18,7 @@ import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper; import com.ruoyi.purchase.service.IPurchasePlanService; import com.ruoyi.system.domain.*; +import com.ruoyi.system.domain.Vo.BaseExpenseAccountVo; import com.ruoyi.system.domain.Vo.BaseRequisitioningOrderVo; import com.ruoyi.system.mapper.*; import com.ruoyi.system.service.*; @@ -93,6 +94,9 @@ public class BaseRequisitioningOrderController extends BaseController @Autowired private IPurchasePlanService purchasePlanService; + @Autowired + private IBaseExpenseAccountService baseExpenseAccountService; + @RequiresPermissions("system:requisitioning:view") @GetMapping() public String requisitioning() @@ -106,8 +110,7 @@ public class BaseRequisitioningOrderController extends BaseController @RequiresPermissions("system:requisitioning:list") @PostMapping("/list") @ResponseBody - public TableDataInfo list(BaseRequisitioningOrderVo baseRequisitioningOrder) - { + public TableDataInfo list(BaseRequisitioningOrderVo baseRequisitioningOrder) throws Exception { startPage(); List list = baseRequisitioningOrderService.selectBaseRequisitioningOrderList(baseRequisitioningOrder); return getDataTable(list); @@ -120,8 +123,7 @@ public class BaseRequisitioningOrderController extends BaseController @Log(title = "请购单", businessType = BusinessType.EXPORT) @PostMapping("/export") @ResponseBody - public AjaxResult export(BaseRequisitioningOrderVo baseRequisitioningOrder) - { + public AjaxResult export(BaseRequisitioningOrderVo baseRequisitioningOrder) throws Exception { List list = baseRequisitioningOrderService.selectBaseRequisitioningOrderList(baseRequisitioningOrder); ExcelUtil util = new ExcelUtil(BaseRequisitioningOrderVo.class); return util.exportExcel(list, "请购单数据"); @@ -296,6 +298,7 @@ public class BaseRequisitioningOrderController extends BaseController if (processIsFinish) { // 审核通过 baseRequisitioningOrderVo.setAuditStatus("1"); + baseRequisitioningOrderVo.setRequisitioningStatus("0");//待采购 //查通过的审核订单 BaseRequisitioningOrder baseRequisitioningOrder = baseRequisitioningOrderService.selectBaseRequisitioningOrderById(baseRequisitioningOrderVo.getRequisitioningId()); baseRequisitioningOrder.setRequisitioningId(baseRequisitioningOrderVo.getRequisitioningId()); @@ -330,4 +333,17 @@ public class BaseRequisitioningOrderController extends BaseController public Result getId(HttpServletRequest request) throws Exception { return Result.getSuccessResult(baseRequisitioningOrderService.getId()); } + + @GetMapping("/getBinessMembers") + @ResponseBody + public TableDataInfo getBusinessMembers(){ + startPage(); + List list = sysUserService.selectRoleToUserList("ywyRole,ywjlRole,ywzgRole,zozjRole," + + "cgyRole,cgjlRole,cgzgRole," + + "gcwyRole,gcjlRole,gczgRole," + + "scyRole,scjlRole,sczgRole," + + "shgcsRole,shjlRole,shzgRole," + + "cgyyRole,cgjlRole,cgzgRole,admin"); + return getDataTable(list); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseRequisitioningOrder.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseRequisitioningOrder.java index 420e36e6..9afe0bae 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseRequisitioningOrder.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseRequisitioningOrder.java @@ -48,14 +48,22 @@ public class BaseRequisitioningOrder extends BaseEntity @Excel(name = "数量总计") private Long materialSum; +// 料号(用以搜索框关联子表搜索) + private String materialCode; + +// 物料名称 + private String materialName; + /** 不含税总价(RMB) */ @Excel(name = "不含税总价(RMB)") private BigDecimal noRmbSum; - /** 含税总价合计(RMB) */ - @Excel(name = "含税总价合计(RMB)") + /** 预估总价(RMB) */ + @Excel(name = "预估总价(RMB)") private BigDecimal rmbSum; + private BigDecimal estimatePrice; + /** 申请人 */ @Excel(name = "申请人") private String applyUser; @@ -293,6 +301,30 @@ public class BaseRequisitioningOrder extends BaseEntity return useStatus; } + public String getMaterialCode() { + return materialCode; + } + + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + public String getMaterialName() { + return materialName; + } + + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + public BigDecimal getEstimatePrice() { + return estimatePrice; + } + + public void setEstimatePrice(BigDecimal estimatePrice) { + this.estimatePrice = estimatePrice; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseRequisitioningOrderChild.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseRequisitioningOrderChild.java index 3314b8a1..3c03236f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseRequisitioningOrderChild.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseRequisitioningOrderChild.java @@ -52,6 +52,9 @@ public class BaseRequisitioningOrderChild extends BaseEntity @Excel(name = "物料的规格") private String specifications; +// 加工方式 + private String processMethod; + /** 物料的品牌 */ @Excel(name = "物料的品牌") private String brand; @@ -286,6 +289,14 @@ public class BaseRequisitioningOrderChild extends BaseEntity return auditStatus; } + public String getProcessMethod() { + return processMethod; + } + + public void setProcessMethod(String processMethod) { + this.processMethod = processMethod; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/BaseRequisitioningOrderVo.java b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/BaseRequisitioningOrderVo.java index c995e980..6e4976a1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/BaseRequisitioningOrderVo.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/BaseRequisitioningOrderVo.java @@ -18,6 +18,9 @@ public class BaseRequisitioningOrderVo extends BaseRequisitioningOrder { private String taskId; /** 任务名称 */ private String taskName; + +// 任务状态 + private String taskStatus; /** 办理时间 */ private Date doneTime; /** 创建人 */ @@ -106,6 +109,14 @@ public class BaseRequisitioningOrderVo extends BaseRequisitioningOrder { this.keyword = keyword; } + public String getTaskStatus() { + return taskStatus; + } + + public void setTaskStatus(String taskStatus) { + this.taskStatus = taskStatus; + } + @Override public String toString() { return "ErpMaterialVo{" + diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseRequisitioningOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseRequisitioningOrderService.java index 6175a95e..f89773bb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseRequisitioningOrderService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/IBaseRequisitioningOrderService.java @@ -30,7 +30,7 @@ public interface IBaseRequisitioningOrderService * @return 请购单集合 */ - List selectBaseRequisitioningOrderList(BaseRequisitioningOrderVo baseRequisitioningOrderVo); + List selectBaseRequisitioningOrderList(BaseRequisitioningOrderVo baseRequisitioningOrderVo) throws Exception; /** * 新增请购单 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseRequisitioningOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseRequisitioningOrderServiceImpl.java index d38c31d5..8a3ff3b0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseRequisitioningOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseRequisitioningOrderServiceImpl.java @@ -3,12 +3,16 @@ package com.ruoyi.system.service.impl; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.*; +import java.util.stream.Collectors; import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.page.PageDomain; import com.ruoyi.common.core.page.TableSupport; import com.ruoyi.common.core.redis.RedisCache; +import com.ruoyi.common.exception.BusinessException; import com.ruoyi.common.service.ICommonService; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; @@ -25,9 +29,7 @@ import com.ruoyi.system.domain.BaseRequisitioningOrderChild; import com.ruoyi.system.domain.Vo.BaseRequisitioningOrderVo; import com.ruoyi.system.mapper.BaseRequisitioningOrderChildMapper; import com.ruoyi.system.mapper.SysUserMapper; -import com.ruoyi.system.service.ISysAttachFileService; -import com.ruoyi.system.service.ISysAttachService; -import com.ruoyi.system.service.ISysRoleService; +import com.ruoyi.system.service.*; import org.activiti.engine.TaskService; import org.activiti.engine.impl.persistence.entity.TaskEntityImpl; import org.activiti.engine.runtime.ProcessInstance; @@ -37,7 +39,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.mapper.BaseRequisitioningOrderMapper; import com.ruoyi.system.domain.BaseRequisitioningOrder; -import com.ruoyi.system.service.IBaseRequisitioningOrderService; import com.ruoyi.common.core.text.Convert; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; @@ -93,6 +94,9 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr @Autowired private IPurchasePlanService purchasePlanService; + + @Autowired + private IBaseExpenseAccountService baseExpenseAccountService; /** * 查询请购单 * @@ -119,13 +123,27 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr * @return 请购单 */ @Override - public List selectBaseRequisitioningOrderList(BaseRequisitioningOrderVo baseRequisitioningOrderVo1) - { + public List selectBaseRequisitioningOrderList(BaseRequisitioningOrderVo baseRequisitioningOrderVo1) throws Exception { + SysUser curUser = ShiroUtils.getSysUser(); + Long userId = curUser.getUserId(); + Set roleKeys = roleService.selectRoleKeys(userId); + List Volist = baseRequisitioningOrderMapper.selectBaseRequisitioningOrderList(baseRequisitioningOrderVo1); + +// 获取当前登录名下可看用户列表 + Set users = baseExpenseAccountService.userLimitedList(roleKeys,curUser); + + List matchedList = Volist.stream() + .filter(requisitioningOrderVo -> users.contains(requisitioningOrderVo.getApplyUser())) + .collect(Collectors.toList()); + PageDomain pageDomain = TableSupport.buildPageRequest(); Integer pageNum = pageDomain.getPageNum(); Integer pageSize = pageDomain.getPageSize(); + PageHelper.startPage(pageNum, pageSize); //PageHelper 仅对第一List分页有效 - Page list = (Page) baseRequisitioningOrderMapper.selectBaseRequisitioningOrderList(baseRequisitioningOrderVo1); + PageInfo pageInfo = new PageInfo<>(matchedList); +// Page list = (Page) pageInfo.getList(); + List list = pageInfo.getList(); Page returnList = new Page<>(); for(BaseRequisitioningOrderVo baseRequisitioningOrderVo : list){ SysUser sysUser = userMapper.selectUserByLoginName(baseRequisitioningOrderVo.getCreateBy()); @@ -166,9 +184,15 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr } else { baseRequisitioningOrderVo.setTaskName("未启动"); } + baseRequisitioningOrderVo.setTaskStatus(baseRequisitioningOrderVo.getTaskName()); + if(baseRequisitioningOrderVo.getAuditStatus()!=null && baseRequisitioningOrderVo.getAuditStatus().equals("1")){ + baseRequisitioningOrderVo.setTaskStatus("审核通过"); + }else if(baseRequisitioningOrderVo.getAuditStatus()!=null && baseRequisitioningOrderVo.getAuditStatus().equals("2")){ + baseRequisitioningOrderVo.setTaskStatus("审核拒绝"); + } returnList.add(baseRequisitioningOrderVo); } - returnList.setTotal(CollectionUtils.isEmpty(list) ? 0 : list.getTotal()); + returnList.setTotal(CollectionUtils.isEmpty(list) ? 0 : list.size()); returnList.setPageNum(pageNum); returnList.setPageSize(pageSize); return returnList; @@ -181,45 +205,51 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr * @return 结果 */ @Override - @Transactional(rollbackFor = NullPointerException.class) + @Transactional(rollbackFor = Exception.class) public int insertBaseRequisitioningOrder(BaseRequisitioningOrder baseRequisitioningOrder) { String loginName = ShiroUtils.getLoginName(); baseRequisitioningOrder.setCreateBy(loginName); baseRequisitioningOrder.setCreateTime(DateUtils.getNowDate()); - if (baseRequisitioningOrder.getRequisitioningCode() == null) { - baseRequisitioningOrder.setRequisitioningCode(redisCache.generateBillNo("QG")); - } + baseRequisitioningOrder.setRequisitioningCode(redisCache.generateBillNo("QG")); List childList = baseRequisitioningOrder.getBaseRequisitioningOrderChildList(); Long materialSum = 0L; BigDecimal materialRmbSum = new BigDecimal(0); - BigDecimal materialNoRmbSum = new BigDecimal(0); +// 预估单价合计 + BigDecimal estimatePrice = new BigDecimal(0); +// BigDecimal materialNoRmbSum = new BigDecimal(0); //物料合计 + if(CollectionUtils.isEmpty(childList)){ + throw new BusinessException("请购物料为空!"); + } Integer childSize = childList.size(); - if (childSize > 0) { - for (BaseRequisitioningOrderChild child : childList) { - //物料数量 - materialSum += child.getMaterialNum(); - if (child.getMaterialRmbSum() == null){ - child.setMaterialRmbSum(new BigDecimal(0)); - } - if (child.getMaterialNoRmbSum() == null){ - child.setMaterialNoRmbSum(new BigDecimal(0)); - } - //物料不含税总价(RMB) - materialRmbSum = child.getMaterialRmbSum().setScale(2, RoundingMode.HALF_UP).add(materialNoRmbSum); - //物料含税总价(RMB) - materialNoRmbSum = child.getMaterialNoRmbSum().setScale(2, RoundingMode.HALF_UP).add(materialNoRmbSum); - child.setRequisitioningCode(baseRequisitioningOrder.getRequisitioningCode()); - child.setCreateBy(loginName); - child.setCreateTime(DateUtils.getNowDate()); - baseRequisitioningOrderChildMapper.insertBaseRequisitioningOrderChild(child); + for (BaseRequisitioningOrderChild child : childList) { + //物料数量 + if(child.getMaterialNum() == null){ + throw new BusinessException("存在物料数为空,请检查"); + } + materialSum += child.getMaterialNum(); + if (child.getMaterialRmbSum() == null){ + child.setMaterialRmbSum(new BigDecimal(0)); + } + if(child.getMaterialRmb() == null){ + throw new BusinessException("存在预估金额为空,请检查"); } + //物料预估总价(RMB) + materialRmbSum = child.getMaterialRmbSum().setScale(2, RoundingMode.HALF_UP).add(materialRmbSum); +// 物料预估单价合计 + estimatePrice = child.getMaterialRmb().setScale(2, RoundingMode.HALF_UP).add(estimatePrice); + //物料不含税总价(RMB) + child.setRequisitioningCode(baseRequisitioningOrder.getRequisitioningCode()); + child.setCreateBy(loginName); + child.setCreateTime(DateUtils.getNowDate()); + baseRequisitioningOrderChildMapper.insertBaseRequisitioningOrderChild(child); } baseRequisitioningOrder.setMaterialAmount(childSize); baseRequisitioningOrder.setMaterialSum(materialSum); baseRequisitioningOrder.setRmbSum(materialRmbSum); - baseRequisitioningOrder.setNoRmbSum(materialNoRmbSum); + baseRequisitioningOrder.setEstimatePrice(estimatePrice); +// baseRequisitioningOrder.setNoRmbSum(materialNoRmbSum); int result = baseRequisitioningOrderMapper.insertBaseRequisitioningOrder(baseRequisitioningOrder); //如要获取请购单ID,作为key baseRequisitioningOrder.getRequisitioningId(); @@ -233,7 +263,7 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr * @return 结果 */ @Override - @Transactional(rollbackFor = NullPointerException.class) + @Transactional(rollbackFor = Exception.class) public int updateBaseRequisitioningOrder(BaseRequisitioningOrder baseRequisitioningOrder) { String loginName = ShiroUtils.getLoginName(); @@ -243,14 +273,29 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr List childList = baseRequisitioningOrder.getBaseRequisitioningOrderChildList(); Long materialSum = 0L; BigDecimal materialRmbSum = new BigDecimal(0); - BigDecimal materialNoRmbSum = new BigDecimal(0); +// BigDecimal materialNoRmbSum = new BigDecimal(0); +// 物料预估单价合计 + BigDecimal estimatePrice = new BigDecimal(0); + // Integer childSize = childList.size(); if (!StringUtils.isEmpty(childList)) { baseRequisitioningOrderChildMapper.deleteBaseRequisitioningOrderChildByRequisitioningCode(baseRequisitioningOrder.getRequisitioningCode()); for (BaseRequisitioningOrderChild child: childList) { + //物料数量 + if(child.getMaterialNum() == null){ + throw new BusinessException("存在物料数为空,请检查"); + } materialSum += child.getMaterialNum(); - materialRmbSum = child.getMaterialRmbSum().setScale(2, RoundingMode.HALF_UP).add(materialNoRmbSum); - materialNoRmbSum = child.getMaterialNoRmbSum().setScale(2, RoundingMode.HALF_UP).add(materialNoRmbSum); + if (child.getMaterialRmbSum() == null){ + child.setMaterialRmbSum(new BigDecimal(0)); + } + if(child.getMaterialRmb() == null){ + throw new BusinessException("存在预估金额为空,请检查"); + } + //物料预估总价(RMB) + materialRmbSum = child.getMaterialRmbSum().setScale(2, RoundingMode.HALF_UP).add(materialRmbSum); +// 物料预估单价合计 + estimatePrice = child.getMaterialRmb().setScale(2, RoundingMode.HALF_UP).add(estimatePrice); child.setRequisitioningCode(requisitioningCode); child.setCreateBy(loginName); child.setCreateTime(DateUtils.getNowDate()); @@ -262,12 +307,13 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr } baseRequisitioningOrder.setMaterialSum(materialSum); baseRequisitioningOrder.setRmbSum(materialRmbSum); - baseRequisitioningOrder.setNoRmbSum(materialNoRmbSum); + baseRequisitioningOrder.setEstimatePrice(estimatePrice); +// baseRequisitioningOrder.setNoRmbSum(materialNoRmbSum); return baseRequisitioningOrderMapper.updateBaseRequisitioningOrder(baseRequisitioningOrder); } @Override - @Transactional(rollbackFor = NullPointerException.class) + @Transactional(rollbackFor = Exception.class) public int updateVerifyBaseRequisitioningOrder(BaseRequisitioningOrder baseRequisitioningOrder) { baseRequisitioningOrder.setUpdateBy(ShiroUtils.getLoginName()); baseRequisitioningOrder.setUpdateTime(DateUtils.getNowDate()); @@ -461,8 +507,8 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr } private void buildAuthority(SysUser user, Map variables) { - System.out.println("请购单启动流程"); - System.out.println("user = " + user + ", variables = " + variables); +// System.out.println("请购单启动流程"); +// System.out.println("user = " + user + ", variables = " + variables); //查询当前请购人的角色 Set roleKeys = roleService.selectRoleKeys(user.getUserId()); @@ -488,7 +534,7 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr } else if (roleKeys.contains("scyRole") || roleKeys.contains("scjlRole") || roleKeys.contains("sczgRole")){ // 生产经理 - variables.put("qgjlRole","scjlRoe"); + variables.put("qgjlRole","scjlRole"); // 生产主管 variables.put("qgzgRole","sczgRole"); } @@ -498,15 +544,15 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr // 售后主管 variables.put("qgzgRole","shzgRole"); } - else if(roleKeys.contains("cgyyRole") || roleKeys.contains("ckzgRole")){ - variables.put("qgjlRole","shzgRole"); - // 售后主管 - variables.put("qgzgRole","shzgRole"); + else if(roleKeys.contains("cgyyRole") || roleKeys.contains("cgzgRole")){ +// 仓管员、仓管主管 + variables.put("qgjlRole","cgzgRole"); + + variables.put("qgzgRole","cgzgRole"); } else if (roleKeys.contains("cwRole") || roleKeys.contains("cwjlRole")){ variables.put("qgjlRole","cwjlRole"); - // 售后主管 - variables.put("qgzgRole","cwJlRole"); +// 财务 } else{ variables.put("authority",2); @@ -547,11 +593,12 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr purchasePlanChild.setBrand(requisitioningOrderDetail.getBrand()); purchasePlanChild.setUnit(requisitioningOrderDetail.getUnit()); purchasePlanChild.setPhotoUrl(requisitioningOrderDetail.getPhotoUrl()); + purchasePlanChild.setProcessMethod(requisitioningOrderDetail.getProcessMethod()); purchasePlanChild.setMaterialNum(Double.valueOf(requisitioningOrderDetail.getMaterialNum())); purchasePlanChild.setMaterialType(requisitioningOrderDetail.getMaterialType()); purchasePlanChild.setMaterialNoRmb(requisitioningOrderDetail.getMaterialNoRmb()); purchasePlanChild.setMaterialRmb(requisitioningOrderDetail.getMaterialRmb()); - noRmbSum = noRmbSum.add(requisitioningOrderDetail.getMaterialNoRmb()); +// noRmbSum = noRmbSum.add(requisitioningOrderDetail.getMaterialNoRmb()); rmbSum = rmbSum.add(requisitioningOrderDetail.getMaterialRmbSum()); materialSum += requisitioningOrderDetail.getMaterialNum(); planChildMapper.insertPurchasePlanChild(purchasePlanChild); diff --git a/ruoyi-admin/src/main/resources/mapper/system/BaseRequisitioningOrderChildMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/BaseRequisitioningOrderChildMapper.xml index 5e8b2f0e..392aa62c 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/BaseRequisitioningOrderChildMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/BaseRequisitioningOrderChildMapper.xml @@ -16,6 +16,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + @@ -34,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select requisitioning_child_id, requisitioning_code, material_id, material_code, photoUrl, - material_name, material_type, material_model, specifications, brand,unit,warehouseDept, + material_name, material_type, material_model, specifications, brand,unit,warehouseDept,process_method, `describe`, materialNum, materialRmb, materialNoRmb, materialNoRmbSum, materialRmbSum, remark, create_by, create_time, update_by, update_time, use_status, audit_status,del_flag from base_requisitioning_order_child @@ -93,6 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" material_type, material_model, specifications, + process_method, brand, unit, warehouseDept, @@ -120,6 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{materialType}, #{materialModel}, #{specifications}, + #{processMethod}, #{brand}, #{unit}, #{warehouseDept}, @@ -151,6 +155,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" material_type = #{materialType}, material_model = #{materialModel}, specifications = #{specifications}, + process_method = #{processMethod}, brand = #{brand}, unit = #{unit}, warehouseDept = #{warehouseDept}, diff --git a/ruoyi-admin/src/main/resources/mapper/system/BaseRequisitioningOrderMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/BaseRequisitioningOrderMapper.xml index 11aad916..4397af96 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/BaseRequisitioningOrderMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/BaseRequisitioningOrderMapper.xml @@ -11,7 +11,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + @@ -35,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select requisitioning_id, audit_status, requisitioning_status, requisitioning_code, - correlation_code, material_amount, materialSum, noRmbSum, rmbSum, + correlation_code, material_amount, materialSum, noRmbSum,estimate_price,rmbSum, create_by, create_time, update_by, update_time, remark, use_status, instance_id, instance_type, submit_instance_id, cancel_instance_id, restore_instance_id, apply_title, apply_user, apply_time, dept_name, post_name @@ -44,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +
- +
- +
@@ -43,7 +43,7 @@
- 报价信息 + 物料信息
@@ -62,6 +62,7 @@ var auditStatusDatas = [[${@dict.getType('auditStatus')}]]; var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]]; var processMethodDatas = [[${@dict.getType('processMethod')}]]; + var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]]; var prefix = ctx + "system/requisitioning"; $("#form-requisitioning-detail").validate({focusCleanup: true}); $(function() { @@ -72,15 +73,8 @@ pagination: false, sidePagination: "client", queryParams:queryParams, - model: "物料报价信息", + model: "物料信息", columns: [ - {checkbox: true}, - {field: 'index',align: 'center', title: "序号", - formatter: function (value, row, index) { - var columnIndex = $.common.sprintf("", $.table.serialNumber(index)); - return columnIndex + $.table.serialNumber(index); - } - }, {title: '物料索引id',field: 'materialId',align: 'center',visible: false}, {title: '料号',field: 'materialCode',align: 'center'}, {title: '物料名称',field: 'materialName',align: 'center'}, @@ -94,23 +88,28 @@ return $.table.selectCategoryLabel(materialTypeDatas, value); } }, - { title: '描述',field: 'describe',align: 'center'}, + {title: '描述',field: 'describe',align: 'center'}, {title: '品牌',field: 'brand',align: 'center'}, - { title: '单位',field: 'unit',align: 'center', + {title: '单位',field: 'unit',align: 'center', formatter: function(value, row, index) { return $.table.selectDictLabel(sysUnitClassDatas, value); } }, - {title: '半成品类型',field: 'processMethod',align: 'center', + {title: '加工方式',field: 'processMethod',align: 'center', formatter: function(value, row, index) { return $.table.selectDictLabel(processMethodDatas, value); } }, + {title: '入库部门',field: 'warehouseDept',align: 'center', + formatter:function(value, row, index){ + return $.table.selectDictLabel(warehouseDeptDatas, value); + } + }, {title: '物料的数量', field: 'materialNum',align: 'center'}, - {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',}, - {title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',}, - {title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',}, - {title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center',}, + {title: '物料的不含税单价(RMB)',visible: false,field: 'materialNoRmb',align: 'center',}, + {title: '物料的含税总价(RMB)',visible: false,field: 'materialNoRmbSum',align: 'center',}, + {title: '预估单价(RMB)',field: 'materialRmb',align: 'center',}, + {title: '预估总价(RMB)',field: 'materialRmbSum',align: 'center',}, {title: '录入人',field: 'createBy',align: 'center',visible: false}, {title: '录入时间',field: 'createTime',align: 'center',visible: false }, {title: '更新人',field: 'updateBy',align: 'center',visible: false}, diff --git a/ruoyi-admin/src/main/resources/templates/system/requisitioning/edit.html b/ruoyi-admin/src/main/resources/templates/system/requisitioning/edit.html index fb0adab9..c773db35 100644 --- a/ruoyi-admin/src/main/resources/templates/system/requisitioning/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/requisitioning/edit.html @@ -44,7 +44,7 @@
- 选择报价信息 + 请购物料信息 添加物料 @@ -78,15 +78,8 @@ pagination: false, sidePagination: "client", queryParams:queryParams, - model: "物料报价信息", + model: "请购物料信息", columns: [ - {checkbox: true}, - {field: 'index',align: 'center', title: "序号", - formatter: function (value, row, index) { - var columnIndex = $.common.sprintf("", $.table.serialNumber(index)); - return columnIndex + $.table.serialNumber(index); - } - }, {title: '物料索引id',field: 'materialId',align: 'center',visible: false}, {title: '料号',field: 'materialCode',align: 'center'}, {title: '物料名称',field: 'materialName',align: 'center'}, @@ -107,16 +100,36 @@ return $.table.selectDictLabel(sysUnitClassDatas, value); } }, - {title: '半成品类型',field: 'processMethod',align: 'center', + {title: '加工方式',field: 'processMethod',align: 'center', formatter: function(value, row, index) { return $.table.selectDictLabel(processMethodDatas, value); } }, + {title: '入库部门',field: 'warehouseDept',align: 'center', + formatter:function(value, row, index){ + return $.table.selectDictLabel(warehouseDeptDatas, value); + } + }, {title: '物料的数量', field: 'materialNum',align: 'center',editable: true,}, - {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',}, - {title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',}, - {title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',}, - {title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center',}, + {title: '预估单价(RMB)', field: 'materialRmb', align: 'center', + editable : { + type : 'text', + mode : 'inline', + title : '预估单价', + validate : function(value) { + if (!value) { + return '金额不能为空'; + } + if (isNaN(value)) { + return '金额必须为数字'; + }else if(value < 0){ + return "输入数值不能小于0"; + } + } + } + }, + {title: '预估总价(RMB)',field: 'materialRmbSum',align: 'center', + }, {title: '录入人',field: 'createBy',align: 'center',visible: false}, {title: '录入时间',field: 'createTime',align: 'center',visible: false }, {title: '更新人',field: 'updateBy',align: 'center',visible: false}, @@ -125,15 +138,16 @@ {title: '操作', align: 'center', formatter: function (value, row, index) { var actions = []; - actions.push('删除 '); + actions.push('删除 '); return actions.join(''); } } ], - onEditableSave:function(field, row, oldValue, $el){ - row.materialNoRmbSum = Number(row.materialNum * Number(row.materialNoRmb)).toFixed(2); - row.materialRmbSum = Number(row.materialRmb * row.materialNum).toFixed(2); - }, + onEditableSave: function (field, row, oldValue, $el) { + // row.materialNoRmbSum = row.materialNum * row.materialNoRmb; + // row.materialRmbSum = row.materialNum * row.materialRmb; + row.materialRmbSum = (row.materialNum * row.materialRmb).toFixed(2); + } }; $.table.init(options); }); @@ -147,32 +161,46 @@ return curParams; } function doSubmit(index, layero,uniqueId){ - console.log(uniqueId); var iframeWin = window[layero.find('iframe')[0]['name']]; - var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections')[0]; - console.log("rowData: "+rowData); - $("#bootstrap-sub-table-requisitionChild").bootstrapTable('insertRow', { - index:1, - row: { - materialId:rowData.id, - materialCode: rowData.materialNo, - materialName: rowData.materialName, - materialType: rowData.materialType, - describe: rowData.describe, - brand: rowData.brand, - unit: rowData.unit, - processMethod: rowData.processMethod, - photoUrl: rowData.photoUrl, - materialNum: "", - materialRmb: "", - materialNoRmb: "", - materialNoRmbSum: "", - materialRmbSum: "", - remark: "" - } - }) + var rowData = iframeWin.$('#bootstrap-select-table').bootstrapTable('getSelections'); + //判断是否重复 + var data = $("#bootstrap-sub-table-requisitionChild").bootstrapTable('getData'); + var rows = data.length; + if(rows>0){ + for(var i=0;i请购单ID: +
  • + + +
  • - +
  • - +
  • @@ -38,14 +42,16 @@
  • - - + +
  • - - + + - - +
  •  搜索 @@ -83,6 +89,22 @@ var loginName = [[${@permission.getPrincipalProperty('loginName')}]]; var prefix = ctx + "system/requisitioning"; $(function() { + $.ajax({ + url: ctx + 'system/salesOrder/getBinessMembers', + type: 'get', + success: function (res) { + console.log(res) + if (res.rows.length > 0) { + var usertData = res.rows; + for (let i in usertData) { + $("select[name='createBy']").append( + ""); + } + } else { + $.modal.msgError(res.msg); + } + } + }); var options = { url: prefix + "/list", createUrl: prefix + "/add", @@ -93,12 +115,15 @@ exportUrl: prefix + "/export", detailUrl: prefix + "/detail/{id}", modalName: "请购单", + // pageList: [5, 10, 25, 50], + // pageSize: 10, sortable: true, // 是否启用排序 sortStable: true, // 设置为 true 将获得稳定的排序 detailView: false, fixedColumns: true, // 启用冻结列 rightFixedColumns:1, fixedRightNumber: 1, // 冻结右列个数 + showFooter: true, columns: [ {checkbox: true}, {title: '请购单索引id',field: 'requisitioningId',visible: false}, @@ -108,6 +133,8 @@ {title: '流程恢复实例ID',field: 'restoreInstanceId', visible: false}, { title: '流程实例类型', field: 'instanceTypeName',visible: false}, {title: '申请人ID',field: 'applyUser', visible: false}, + {title: '请购单编号',field: 'requisitioningCode',}, + {title: '关联单号',field: 'correlationCode',}, { field: 'applyUserName', title: '申请人', @@ -115,33 +142,55 @@ return '' + (value ? value : "-") + ''; } }, - {field: 'applyTime',title: '申请时间' - }, + {title: '请购部门',field: 'deptName',}, {title: '当前任务ID',field: 'taskId',visible: false}, { title: '待办用户ID',field: 'todoUserId', visible: false}, - { title: '当前任务名称',field: 'taskName', + { title: '当前任务名称',field: 'taskName', visible: false}, + { title: '当前状态',field: 'taskStatus', align: 'center', - formatter: function(value, row, index) { + formatter: function(value, row, index) { + if(row.auditStatus!="1"&&value != "未启动"){ + return '' + value + ''; + } + if(value === "未启动"){ + return '' + value + ''; + } return '' + value + ''; } }, - {title: '审核状态',field: 'auditStatus', + {title: '物料合计',field: 'materialAmount',}, + {title: '数量总计',field: 'materialSum',}, + // {title: '预估单价合计(RMB)',field: 'noRmbSum',}, + {title: '预估单价合计(RMB)',field: 'estimatePrice', + footerFormatter: function (value) { + var sum = 0; + for (var i in value) { + sum += parseFloat(value[i].estimatePrice) || 0; + } + return "总预估单价: " + sum.toFixed(2); + } + }, + {title: '预估总价合计(RMB)',field: 'rmbSum', + footerFormatter: function (value) { + var sum = 0; + for (var i in value) { + sum += parseFloat(value[i].rmbSum) || 0; + } + return "总预估总价: " + sum.toFixed(2); + } + }, + {field: 'applyTime',title: '申请时间'}, + {title: '审核状态',field: 'auditStatus',visible: false, formatter: function(value, row, index) { - return $.table.selectDictLabel(auditStatusDatas, value); + return $.table.selectDictLabel(auditStatusDatas, value); } }, {title: '请购状态',field: 'requisitioningStatus', formatter: function(value, row, index) { - return $.table.selectDictLabel(requisitioningStatusDatas, value); + return $.table.selectDictLabel(requisitioningStatusDatas, value); } }, - {title: '请购单编号',field: 'requisitioningCode',}, - {title: '关联单号',field: 'correlationCode',}, - {title: '物料合计',field: 'materialAmount',}, - {title: '数量总计',field: 'materialSum',}, - {title: '不含税总价(RMB)',field: 'noRmbSum',}, - {title: '含税总价合计(RMB)',field: 'rmbSum',}, - {title: '请购人',field: 'createBy',}, + {title: '请购人',field: 'createBy',visible: false}, {title: '备注',field: 'remark',}, {title: '操作',align: 'center', formatter: function (value, row, index) { @@ -149,13 +198,15 @@ if(row.auditStatus=="1" && row.useStatus=="1" && !row.cancelInstanceId) { // 作废 actions.push(' 作废'); - // 编辑 - actions.push(' 编辑 '); // 已作废 } else{ actions.push(' 编辑 '); } + if(row.auditStatus == "2" && row.useStatus == "1"){ + // 编辑 + actions.push(' 编辑 '); + } // 有流程实例id if(row.useStatus=="2" && !row.restoreInstanceId){ // 恢复 @@ -181,7 +232,15 @@ return actions.join(''); } } - ] + ], + rowStyle: function (row, index) { + if (row.auditStatus=="0") { + // 如果审核状态为待审核,则设置为红色 + return {css:{"color":"red"}}; + } + // 否则使用默认样式 + return {}; + } }; $.table.init(options); }); diff --git a/ruoyi-admin/src/main/resources/templates/system/requisitioning/taskFzjlVerify.html b/ruoyi-admin/src/main/resources/templates/system/requisitioning/taskFzjlVerify.html index 0d53bc3c..4ca66842 100644 --- a/ruoyi-admin/src/main/resources/templates/system/requisitioning/taskFzjlVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/requisitioning/taskFzjlVerify.html @@ -44,21 +44,21 @@
    - +
    - -
    -
    -
    - -
    - +
    + + + + + +
    @@ -85,7 +85,7 @@
    - 选择报价信息 + 请购物料信息
    @@ -123,16 +123,12 @@ id:'bootstrap-sub-table-requisitionChild', url: ctx + "system/requisitioningChild/list", pagination: false, + showSearch: false, + showColumns: false, sidePagination: "client", queryParams: queryParams, - model: "物料报价信息", + model: "请购物料信息", columns: [ - {checkbox: true}, - {field: 'index',align: 'center', title: "序号", - formatter: function (value, row, index,column) { - return $.table.serialNumber(index) - 1; - } - }, {title: '物料索引id',field: 'materialId',align: 'center',visible: false}, {title: '料号',field: 'materialCode',align: 'center'}, {title: '物料名称',field: 'materialName',align: 'center'}, @@ -155,15 +151,31 @@ } }, {title: '入库部门',field: 'warehouseDept',align: 'center', - formatter: function(value, row, index) { - $.table.selectDictLabel(warehouseDeptDatas, value); - } + formatter:function(value, row, index){ + return $.table.selectDictLabel(warehouseDeptDatas, value); + } }, {title: '物料的数量', field: 'materialNum',align: 'center',}, - {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',}, - {title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',}, - {title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',}, - {title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center',}, + {title: '预估单价(RMB)',field: 'materialRmb',align: 'center', + footerFormatter: function (value) { + var sum = 0; + for (var i in value) { + sum += parseFloat(value[i].materialRmb) || 0; + } + return "总预估单价: " + sum.toFixed(2); + } + }, + {title: '预估总价(RMB)',field: 'materialRmbSum',align: 'center', + footerFormatter: function (value) { + var sum = 0; + for (var i in value) { + sum += parseFloat(value[i].materialRmbSum) || 0; + } + return "总预估总价: " + sum.toFixed(2); + } + }, + {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',visible: false}, + {title: '物料的不含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',visible: false}, {title: '录入人',field: 'createBy',align: 'center',visible: false}, {title: '录入时间',field: 'createTime',align: 'center',visible: false }, {title: '更新人',field: 'updateBy',align: 'center',visible: false}, diff --git a/ruoyi-admin/src/main/resources/templates/system/requisitioning/taskQgjlVerify.html b/ruoyi-admin/src/main/resources/templates/system/requisitioning/taskQgjlVerify.html index a93b03bc..f7b45b85 100644 --- a/ruoyi-admin/src/main/resources/templates/system/requisitioning/taskQgjlVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/requisitioning/taskQgjlVerify.html @@ -44,21 +44,21 @@
    - +
    - -
    -
    -
    - -
    - +
    + + + + + +
    @@ -85,7 +85,7 @@
    - 选择报价信息 + 请购物料信息
    @@ -108,21 +108,18 @@ var processMethodDatas = [[${@dict.getType('processMethod')}]]; var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]]; $("#form-requisitioning-qgjl-audit").validate({focusCleanup: true}); + $(function() { var options = { id:'bootstrap-sub-table-requisitionChild', url: ctx + "system/requisitioningChild/list", pagination: false, + showSearch: false, + showColumns: false, sidePagination: "client", queryParams: queryParams, - model: "物料报价信息", + model: "请购物料信息", columns: [ - {checkbox: true}, - {field: 'index',align: 'center', title: "序号", - formatter: function (value, row, index,column) { - return $.table.serialNumber(index) - 1; - } - }, {title: '物料索引id',field: 'materialId',align: 'center',visible: false}, {title: '料号',field: 'materialCode',align: 'center'}, {title: '物料名称',field: 'materialName',align: 'center'}, @@ -145,15 +142,31 @@ } }, {title: '入库部门',field: 'warehouseDept',align: 'center', - formatter: function(value, row, index) { + formatter:function(value, row, index){ return $.table.selectDictLabel(warehouseDeptDatas, value); } }, {title: '物料的数量', field: 'materialNum',align: 'center',}, - {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',}, - {title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',}, - {title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',}, - {title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center',}, + {title: '预估单价(RMB)',field: 'materialRmb',align: 'center', + footerFormatter: function (value) { + var sum = 0; + for (var i in value) { + sum += parseFloat(value[i].materialRmb) || 0; + } + return "总预估单价: " + sum.toFixed(2); + } + }, + {title: '预估总价(RMB)',field: 'materialRmbSum',align: 'center', + footerFormatter: function (value) { + var sum = 0; + for (var i in value) { + sum += parseFloat(value[i].materialRmbSum) || 0; + } + return "总预估总价: " + sum.toFixed(2); + } + }, + {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',visible: false}, + {title: '物料的不含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',visible: false}, {title: '录入人',field: 'createBy',align: 'center',visible: false}, {title: '录入时间',field: 'createTime',align: 'center',visible: false }, {title: '更新人',field: 'updateBy',align: 'center',visible: false}, diff --git a/ruoyi-admin/src/main/resources/templates/system/requisitioning/taskQgzgVerify.html b/ruoyi-admin/src/main/resources/templates/system/requisitioning/taskQgzgVerify.html index 8494cc4d..70e18d21 100644 --- a/ruoyi-admin/src/main/resources/templates/system/requisitioning/taskQgzgVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/requisitioning/taskQgzgVerify.html @@ -38,27 +38,27 @@
    - +
    - -
    -
    -
    - -
    - +
    + + + + + +
    @@ -85,7 +85,7 @@
    - 选择报价信息 + 请购物料信息
    @@ -114,16 +114,12 @@ id:'bootstrap-sub-table-requisitionChild', url: ctx + "system/requisitioningChild/list", pagination: false, + showSearch: false, + showColumns: false, sidePagination: "client", queryParams: queryParams, - model: "物料报价信息", + model: "请购物料信息", columns: [ - {checkbox: true}, - {field: 'index',align: 'center', title: "序号", - formatter: function (value, row, index,column) { - return $.table.serialNumber(index) - 1; - } - }, {title: '物料索引id',field: 'materialId',align: 'center',visible: false}, {title: '料号',field: 'materialCode',align: 'center'}, {title: '物料名称',field: 'materialName',align: 'center'}, @@ -146,15 +142,31 @@ } }, {title: '入库部门',field: 'warehouseDept',align: 'center', - formatter: function(value, row, index) { + formatter:function(value, row, index){ return $.table.selectDictLabel(warehouseDeptDatas, value); } }, {title: '物料的数量', field: 'materialNum',align: 'center',}, - {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',}, - {title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',}, - {title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',}, - {title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center',}, + {title: '预估单价(RMB)',field: 'materialRmb',align: 'center', + footerFormatter: function (value) { + var sum = 0; + for (var i in value) { + sum += parseFloat(value[i].materialRmb) || 0; + } + return "总预估单价: " + sum.toFixed(2); + } + }, + {title: '预估总价(RMB)',field: 'materialRmbSum',align: 'center', + footerFormatter: function (value) { + var sum = 0; + for (var i in value) { + sum += parseFloat(value[i].materialRmbSum) || 0; + } + return "总预估总价: " + sum.toFixed(2); + } + }, + {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',visible: false}, + {title: '物料的不含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',visible: false}, {title: '录入人',field: 'createBy',align: 'center',visible: false}, {title: '录入时间',field: 'createTime',align: 'center',visible: false }, {title: '更新人',field: 'updateBy',align: 'center',visible: false}, diff --git a/ruoyi-admin/src/main/resources/templates/system/requisitioning/taskZozjVerify.html b/ruoyi-admin/src/main/resources/templates/system/requisitioning/taskZozjVerify.html index 37eba16c..55bad3b3 100644 --- a/ruoyi-admin/src/main/resources/templates/system/requisitioning/taskZozjVerify.html +++ b/ruoyi-admin/src/main/resources/templates/system/requisitioning/taskZozjVerify.html @@ -44,21 +44,21 @@
    - +
    - -
    -
    -
    - -
    - +
    + + + + + +
    @@ -85,7 +85,7 @@
    - 选择报价信息 + 请购物料信息
    @@ -109,59 +109,71 @@ var warehouseDeptDatas = [[${@dict.getType('warehouseDept')}]]; $("#form-requisitioning-zozj-audit").validate({focusCleanup: true}); $(function() { - var options = { - id:'bootstrap-sub-table-requisitionChild', - url: ctx + "system/requisitioningChild/list", - pagination: false, - sidePagination: "client", - queryParams: queryParams, - model: "物料报价信息", - columns: [ - {checkbox: true}, - {field: 'index',align: 'center', title: "序号", - formatter: function (value, row, index,column) { - return $.table.serialNumber(index) - 1; - } - }, - {title: '物料索引id',field: 'materialId',align: 'center',visible: false}, - {title: '料号',field: 'materialCode',align: 'center'}, - {title: '物料名称',field: 'materialName',align: 'center'}, - {title: '图片',field: 'photoUrl', - formatter: function(value, row, index) { - return $.table.imageView(value); - } - }, - {title: '物料类型',field: 'materialType',align: 'center', - formatter: function(value, row, index) { - return $.table.selectCategoryLabel(materialTypeDatas, value); - } - }, - { title: '描述',field: 'describe',align: 'center'}, - {title: '品牌',field: 'brand',align: 'center'}, - { title: '单位',field: 'unit',align: 'center',}, - {title: '加工方式',field: 'processMethod',align: 'center', - formatter: function(value, row, index) { - return $.table.selectDictLabel(processMethodDatas, value); - } - }, - {title: '入库部门',field: 'warehouseDept',align: 'center', - formatter: function(value, row, index) { - return $.table.selectDictLabel(warehouseDeptDatas, value); - } - }, - {title: '物料的数量', field: 'materialNum',align: 'center',}, - {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',}, - {title: '物料的含税单价(RMB)',field: 'materialRmb',align: 'center',}, - {title: '物料的含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',}, - {title: '物料的不含税总价(RMB)',field: 'materialRmbSum',align: 'center',}, - {title: '录入人',field: 'createBy',align: 'center',visible: false}, - {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); + var options = { + id:'bootstrap-sub-table-requisitionChild', + url: ctx + "system/requisitioningChild/list", + pagination: false, + showSearch: false, + showColumns: false, + sidePagination: "client", + queryParams: queryParams, + model: "请购物料信息", + columns: [ + {title: '物料索引id',field: 'materialId',align: 'center',visible: false}, + {title: '料号',field: 'materialCode',align: 'center'}, + {title: '物料名称',field: 'materialName',align: 'center'}, + {title: '图片',field: 'photoUrl', + formatter: function(value, row, index) { + return $.table.imageView(value); + } + }, + {title: '物料类型',field: 'materialType',align: 'center', + formatter: function(value, row, index) { + return $.table.selectCategoryLabel(materialTypeDatas, value); + } + }, + { title: '描述',field: 'describe',align: 'center'}, + {title: '品牌',field: 'brand',align: 'center'}, + { title: '单位',field: 'unit',align: 'center',}, + {title: '加工方式',field: 'processMethod',align: 'center', + formatter: function(value, row, index) { + return $.table.selectDictLabel(processMethodDatas, value); + } + }, + {title: '入库部门',field: 'warehouseDept',align: 'center', + formatter:function(value, row, index){ + return $.table.selectDictLabel(warehouseDeptDatas, value); + } + }, + {title: '物料的数量', field: 'materialNum',align: 'center',}, + {title: '预估单价(RMB)',field: 'materialRmb',align: 'center', + footerFormatter: function (value) { + var sum = 0; + for (var i in value) { + sum += parseFloat(value[i].materialRmb) || 0; + } + return "总预估单价: " + sum.toFixed(2); + } + }, + {title: '预估总价(RMB)',field: 'materialRmbSum',align: 'center', + footerFormatter: function (value) { + var sum = 0; + for (var i in value) { + sum += parseFloat(value[i].materialRmbSum) || 0; + } + return "总预估总价: " + sum.toFixed(2); + } + }, + {title: '物料的不含税单价(RMB)',field: 'materialNoRmb',align: 'center',visible: false}, + {title: '物料的不含税总价(RMB)',field: 'materialNoRmbSum',align: 'center',visible: false}, + {title: '录入人',field: 'createBy',align: 'center',visible: false}, + {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); }); function queryParams(params) { var curParams = {